static Eina_Bool
_plugins_init(void)
{
+ Evry_Plugin *p;
+
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p1 = E_NEW(Plugin, 1);
- EVRY_PLUGIN_NEW(EVRY_PLUGIN(p1), N_("Applications"), type_subject, "", "APPLICATION",
- _begin, _cleanup, _fetch, _icon_get, NULL);
- EVRY_PLUGIN(p1)->complete = &_complete;
- EVRY_PLUGIN(p1)->config_path = "extensions/everything-apps";
-
- p2 = E_NEW(Plugin, 1);
- EVRY_PLUGIN_NEW(EVRY_PLUGIN(p2), N_("Open With..."), type_action, "FILE", "",
- _begin_open_with, _cleanup, _fetch,
- _icon_get, NULL);
-
- EVRY_PLUGIN(p2)->action = &_open_with_action;
- EVRY_PLUGIN(p2)->config_path = "extensions/everything-apps";
+ p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), type_subject, "", "APPLICATION",
+ _begin, _cleanup, _fetch, _icon_get, NULL);
+ p->complete = &_complete;
+ p->config_path = "extensions/everything-apps";
+ evry_plugin_register(p, 1);
+ p1 = (Plugin *) p;
- evry_plugin_register(EVRY_PLUGIN(p1), 1);
- evry_plugin_register(EVRY_PLUGIN(p2), 1);
+ p = EVRY_PLUGIN_NEW(Plugin, N_("Open With..."), type_action, "FILE", "",
+ _begin_open_with, _cleanup, _fetch,
+ _icon_get, NULL);
+
+ p->action = &_open_with_action;
+ p->config_path = "extensions/everything-apps";
+ evry_plugin_register(p, 1);
+ p2 = (Plugin *) p;
act = EVRY_ACTION_NEW(N_("Launch"), "APPLICATION", NULL,
"everything-launch", _exec_app_action, _exec_app_check_item);
}
}
+/* static int
+ * _action(Evry_Action *act)
+ * {
+ * const Evry_Item *it = act->item2;
+ * if (!it) return 0;
+ *
+ * ecore_x_selection_primary_set(clipboard_win, it->label, strlen(it->label));
+ * ecore_x_selection_clipboard_set(clipboard_win, it->label, strlen(it->label));
+ *
+ * return 1;
+ * } */
+
+
static Eina_Bool
_plugins_init(void)
{
- Plugin *p;
+ Evry_Plugin *p;
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p = E_NEW(Plugin, 1);
-
- EVRY_PLUGIN_NEW(p, N_("Spell Checker"), type_subject, "", "TEXT",
+ p = EVRY_PLUGIN_NEW(Plugin, N_("Spell Checker"), type_subject, "", "TEXT",
NULL, _cleanup, _fetch, NULL, NULL);
- EVRY_PLUGIN(p)->aggregate = EINA_FALSE;
- EVRY_PLUGIN(p)->history = EINA_FALSE;
- EVRY_PLUGIN(p)->async_fetch = EINA_TRUE;
- EVRY_PLUGIN(p)->icon = "accessories-dictionary";
- EVRY_PLUGIN(p)->trigger = TRIGGER;
+ p->aggregate = EINA_FALSE;
+ p->history = EINA_FALSE;
+ p->async_fetch = EINA_TRUE;
+ p->icon = "accessories-dictionary";
+ p->trigger = TRIGGER;
- evry_plugin_register(EVRY_PLUGIN(p), 100);
-
- _plug = p;
+ evry_plugin_register(p, 100);
+ _plug = (Plugin *) p;
+
+ /* TODO show spell check action for given text */
+ /* p = EVRY_PLUGIN_NEW2(Plugin, N_("Spell Checker"), type_object, "", "TEXT",
+ * _begin, _cleanup, _fetch, NULL, NULL);
+ *
+ * p->aggregate = EINA_FALSE;
+ * p->history = EINA_FALSE;
+ * p->async_fetch = EINA_TRUE;
+ * p->icon = "accessories-dictionary";
+ * p->trigger = TRIGGER;
+ *
+ * evry_plugin_register(p, 100);
+ * _plug2 = (Plugin *) p;
+ *
+ * _act = EVRY_ACTION_NEW(N_("Spell Checker"), "TEXT", "ASPELL", _action, NULL); */
return EINA_TRUE;
}
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p1 = EVRY_PLUGIN_NEW(NULL, N_("Calculator"), type_subject, NULL, "TEXT",
+ p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Calculator"), type_subject, NULL, "TEXT",
_begin, _cleanup, _fetch, NULL, NULL);
p1->view_mode = VIEW_MODE_LIST;
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p1 = EVRY_PLUGIN_NEW(NULL, N_("Files"), type_subject, "FILE", "FILE",
+ p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), type_subject, "FILE", "FILE",
_begin, _cleanup, _fetch, _icon_get, NULL);
EVRY_PLUGIN(p1)->config_path = "extensions/everything-files";
evry_plugin_register(p1, 3);
- p2 = EVRY_PLUGIN_NEW(NULL, N_("Files"), type_object, "FILE", "FILE",
+ p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Files"), type_object, "FILE", "FILE",
_begin, _cleanup, _fetch, _icon_get, NULL);
EVRY_PLUGIN(p2)->config_path = "extensions/everything-files";
evry_plugin_register(p2, 1);
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p = EVRY_PLUGIN_NEW(NULL, N_("Settings"), type_subject, NULL, "E_SETTINGS",
+ p = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Settings"), type_subject, NULL, "E_SETTINGS",
NULL, _cleanup, _fetch, _item_icon_get, NULL);
evry_plugin_register(p, 10);
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- _plug = EVRY_PLUGIN_NEW(NULL, N_("Wallpaper"), type_action, "FILE", "",
+ _plug = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Wallpaper"), type_action, "FILE", "",
_begin, _cleanup, _fetch, _icon_get, NULL);
- EVRY_PLUGIN(_plug)->icon = "preferences-desktop-wallpaper";
- EVRY_PLUGIN(_plug)->action = &_action;
+ _plug->icon = "preferences-desktop-wallpaper";
+ _plug->action = &_action;
evry_plugin_register(_plug, 10);
if (!evry_api_version_check(EVRY_API_VERSION))
return EINA_FALSE;
- p1 = EVRY_PLUGIN_NEW(NULL, N_("Windows"), type_subject, NULL, "BORDER",
- _begin, _cleanup, _fetch, _item_icon_get, NULL);
+ p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Windows"), type_subject, NULL, "BORDER",
+ _begin, _cleanup, _fetch, _item_icon_get, NULL);
p1->transient = EINA_TRUE;
evry_plugin_register(p1, 2);
-
- p2 = EVRY_PLUGIN_NEW(NULL, N_("Window Action"), type_action, "BORDER", NULL,
- _act_begin, _act_cleanup, _act_fetch, _act_item_icon_get, NULL);
+ p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Window Action"), type_action, "BORDER", NULL,
+ _act_begin, _act_cleanup, _act_fetch, _act_item_icon_get, NULL);
EVRY_PLUGIN(p2)->action = &_act_action;
EAPI History_Item *evry_history_add(Eina_Hash *hist, Evry_Item *it, const char *ctxt, const char *input);
EAPI int evry_history_item_usage_set(Eina_Hash *hist, Evry_Item *it, const char *input, const char *ctxt);
+/* #define EVRY_PLUGIN_NEW(_base, _name, _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \
+ * evry_plugin_new(EVRY_PLUGIN(_base), _name, _(_name), _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \ */
+
#define EVRY_PLUGIN_NEW(_base, _name, _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \
- evry_plugin_new(EVRY_PLUGIN(_base), _name, _(_name), _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \
+ evry_plugin_new(EVRY_PLUGIN(E_NEW(_base, 1)), _name, _(_name), _type, _in, _out, _begin, _cleanup, _fetch, _icon_get, _free) \
EAPI Evry_Plugin *evry_plugin_new(Evry_Plugin *base, const char *name, const char *label, int type,
const char *type_in, const char *type_out,
{
Evry_State *s = sel->state;
- if ((s->plugin && s->plugin->trigger && s->inp) &&
- (!strncmp(s->plugin->trigger, s->inp,
- strlen(s->plugin->trigger))))
+ if (s->inp && s->inp[0] != 0)
{
- s->input[strlen(s->plugin->trigger)] = 0;
- _evry_update(sel, 1);
- return 1;
- }
- else if (s->inp && s->inp[0] != 0)
- {
- s->inp[0] = 0;
- s->input = s->inp;
-
+ if (s->trigger_active && s->inp[1] != 0)
+ {
+ s->inp[1] = 0;
+ s->input = s->inp + 1;
+ }
+ else
+ {
+ s->inp[0] = 0;
+ s->input = s->inp;
+ }
+
_evry_update(sel, 1);
if (!list->visible && evry_conf->hide_input)
edje_object_signal_emit(list->o_main, "e,state,entry_hide", "e");
Evry_Plugin *
evry_plug_aggregator_new(Evry_Selector *sel, int type)
{
- Plugin *p;
+ Evry_Plugin *p;
- p = E_NEW(Plugin, 1);
- EVRY_PLUGIN_NEW(EVRY_PLUGIN(p), N_("All"), type, "", "",
+ p = EVRY_PLUGIN_NEW(Plugin, N_("All"), type, "", "",
NULL, _cleanup, _fetch, _icon_get, NULL);
- EVRY_PLUGIN(p)->action = &_action;
- EVRY_PLUGIN(p)->history = EINA_FALSE;
-
- evry_plugin_register(EVRY_PLUGIN(p), -1);
- p->selector = sel;
+ p->action = &_action;
+ p->history = EINA_FALSE;
+ evry_plugin_register(p, -1);
+
+ PLUGIN(pa, p);
+ pa->selector = sel;
- return EVRY_PLUGIN(p);
+ return p;
}
Eina_Bool
evry_plug_text_init(void)
{
- p1 = EVRY_PLUGIN_NEW(NULL, N_("Text"), type_subject, NULL, "TEXT",
+ p1 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Text"), type_subject, NULL, "TEXT",
NULL, _cleanup, _fetch, NULL, NULL);
- p2 = EVRY_PLUGIN_NEW(NULL, N_("Text"), type_object, NULL, "TEXT",
+ p2 = EVRY_PLUGIN_NEW(Evry_Plugin, N_("Text"), type_object, NULL, "TEXT",
NULL, _cleanup, _fetch, NULL, NULL);
p1->icon = "accessories-text-editor";