forked from enlightenment/enlightenment
'everyhing'
- when trigger active clear input without clearing the trigger - nicer macro for EVRY_PLUGIN_NEW SVN revision: 48294
This commit is contained in:
parent
4ddec81bfd
commit
857d064220
|
@ -963,25 +963,26 @@ _new_app_action(Evry_Action *act)
|
|||
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",
|
||||
p = EVRY_PLUGIN_NEW(Plugin, N_("Applications"), type_subject, "", "APPLICATION",
|
||||
_begin, _cleanup, _fetch, _icon_get, NULL);
|
||||
EVRY_PLUGIN(p1)->complete = &_complete;
|
||||
EVRY_PLUGIN(p1)->config_path = "extensions/everything-apps";
|
||||
p->complete = &_complete;
|
||||
p->config_path = "extensions/everything-apps";
|
||||
evry_plugin_register(p, 1);
|
||||
p1 = (Plugin *) p;
|
||||
|
||||
p2 = E_NEW(Plugin, 1);
|
||||
EVRY_PLUGIN_NEW(EVRY_PLUGIN(p2), N_("Open With..."), type_action, "FILE", "",
|
||||
p = EVRY_PLUGIN_NEW(Plugin, 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";
|
||||
|
||||
evry_plugin_register(EVRY_PLUGIN(p1), 1);
|
||||
evry_plugin_register(EVRY_PLUGIN(p2), 1);
|
||||
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);
|
||||
|
|
|
@ -321,28 +321,53 @@ _cleanup(Evry_Plugin *plugin)
|
|||
}
|
||||
}
|
||||
|
||||
/* 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);
|
||||
evry_plugin_register(p, 100);
|
||||
_plug = (Plugin *) p;
|
||||
|
||||
_plug = 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;
|
||||
}
|
||||
|
|
|
@ -229,7 +229,7 @@ _plugins_init(void)
|
|||
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;
|
||||
|
|
|
@ -704,12 +704,12 @@ _plugins_init(void)
|
|||
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);
|
||||
|
|
|
@ -123,7 +123,7 @@ _plugins_init(void)
|
|||
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);
|
||||
|
|
|
@ -205,11 +205,11 @@ _plugins_init(void)
|
|||
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);
|
||||
|
||||
|
|
|
@ -492,13 +492,12 @@ _plugins_init(void)
|
|||
if (!evry_api_version_check(EVRY_API_VERSION))
|
||||
return EINA_FALSE;
|
||||
|
||||
p1 = EVRY_PLUGIN_NEW(NULL, N_("Windows"), type_subject, NULL, "BORDER",
|
||||
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,
|
||||
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;
|
||||
|
|
|
@ -435,8 +435,11 @@ EAPI void evry_history_unload(void);
|
|||
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,
|
||||
|
|
|
@ -1651,18 +1651,18 @@ _evry_clear(Evry_Selector *sel)
|
|||
{
|
||||
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;
|
||||
if (s->trigger_active && s->inp[1] != 0)
|
||||
{
|
||||
s->inp[1] = 0;
|
||||
s->input = s->inp + 1;
|
||||
}
|
||||
else if (s->inp && s->inp[0] != 0)
|
||||
else
|
||||
{
|
||||
s->inp[0] = 0;
|
||||
s->input = s->inp;
|
||||
}
|
||||
|
||||
_evry_update(sel, 1);
|
||||
if (!list->visible && evry_conf->hide_input)
|
||||
|
|
|
@ -295,17 +295,17 @@ _icon_get(Evry_Plugin *plugin, const Evry_Item *it, Evas *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;
|
||||
p->action = &_action;
|
||||
p->history = EINA_FALSE;
|
||||
evry_plugin_register(p, -1);
|
||||
|
||||
evry_plugin_register(EVRY_PLUGIN(p), -1);
|
||||
p->selector = sel;
|
||||
PLUGIN(pa, p);
|
||||
pa->selector = sel;
|
||||
|
||||
return EVRY_PLUGIN(p);
|
||||
return p;
|
||||
}
|
||||
|
|
|
@ -41,10 +41,10 @@ _fetch(Evry_Plugin *p, const char *input)
|
|||
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";
|
||||
|
|
Loading…
Reference in New Issue