'everything module'
- use eina_module. TODO public header needs to be exported for external build of plugins - fix evry_async_update: do not show tab if there are no candidates SVN revision: 41539
This commit is contained in:
parent
c53fd6e204
commit
63c7a79c05
|
@ -21,21 +21,71 @@ pkg_LTLIBRARIES = module.la
|
|||
module_la_SOURCES = e_mod_main.c \
|
||||
e_mod_main.h \
|
||||
evry.c \
|
||||
evry_config.c \
|
||||
evry_plug_config.c \
|
||||
evry_plug_dir_browse.c \
|
||||
evry_plug_apps.c \
|
||||
evry_plug_tracker.c \
|
||||
evry_plug_calc.c \
|
||||
evry_plug_aspell.c \
|
||||
evry_plug_border.c \
|
||||
evry_plug_border_act.c
|
||||
evry_config.c
|
||||
|
||||
|
||||
module_la_LIBADD = @e_libs@ @dlopen_libs@
|
||||
module_la_LDFLAGS = -module -avoid-version
|
||||
module_la_DEPENDENCIES = $(top_builddir)/config.h
|
||||
|
||||
|
||||
evry_plug_appsdir = $(pkgdir)
|
||||
evry_plug_apps_LTLIBRARIES = evry_plug_apps.la
|
||||
evry_plug_apps_la_SOURCES = evry_plug_apps.c
|
||||
evry_plug_apps_la_LIBADD = @e_libs@
|
||||
evry_plug_apps_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_apps_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_borderdir = $(pkgdir)
|
||||
evry_plug_border_LTLIBRARIES = evry_plug_border.la
|
||||
evry_plug_border_la_SOURCES = evry_plug_border.c
|
||||
evry_plug_border_la_LIBADD = @e_libs@
|
||||
evry_plug_border_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_border_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_border_actdir = $(pkgdir)
|
||||
evry_plug_border_act_LTLIBRARIES = evry_plug_border_act.la
|
||||
evry_plug_border_act_la_SOURCES = evry_plug_border_act.c
|
||||
evry_plug_border_act_la_LIBADD = @e_libs@
|
||||
evry_plug_border_act_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_border_act_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_dir_browsedir = $(pkgdir)
|
||||
evry_plug_dir_browse_LTLIBRARIES = evry_plug_dir_browse.la
|
||||
evry_plug_dir_browse_la_SOURCES = evry_plug_dir_browse.c
|
||||
evry_plug_dir_browse_la_LIBADD = @e_libs@
|
||||
evry_plug_dir_browse_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_dir_browse_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_trackerdir = $(pkgdir)
|
||||
evry_plug_tracker_LTLIBRARIES = evry_plug_tracker.la
|
||||
evry_plug_tracker_la_SOURCES = evry_plug_tracker.c
|
||||
evry_plug_tracker_la_LIBADD = @e_libs@
|
||||
evry_plug_tracker_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_tracker_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_calcdir = $(pkgdir)
|
||||
evry_plug_calc_LTLIBRARIES = evry_plug_calc.la
|
||||
evry_plug_calc_la_SOURCES = evry_plug_calc.c
|
||||
evry_plug_calc_la_LIBADD = @e_libs@
|
||||
evry_plug_calc_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_calc_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_configdir = $(pkgdir)
|
||||
evry_plug_config_LTLIBRARIES = evry_plug_config.la
|
||||
evry_plug_config_la_SOURCES = evry_plug_config.c
|
||||
evry_plug_config_la_LIBADD = @e_libs@
|
||||
evry_plug_config_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_config_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
evry_plug_aspelldir = $(pkgdir)
|
||||
evry_plug_aspell_LTLIBRARIES = evry_plug_aspell.la
|
||||
evry_plug_aspell_la_SOURCES = evry_plug_aspell.c
|
||||
evry_plug_aspell_la_LIBADD = @e_libs@
|
||||
evry_plug_aspell_la_LDFLAGS = -no-undefined -module -avoid-version
|
||||
evry_plug_aspell_la_LIBTOOLFLAGS = --tag=disable-static
|
||||
|
||||
|
||||
uninstall:
|
||||
rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE)
|
||||
|
||||
|
|
|
@ -14,8 +14,10 @@ static void _e_mod_menu_add(void *data, E_Menu *m);
|
|||
static E_Action *act = NULL;
|
||||
static E_Int_Menu_Augmentation *maug = NULL;
|
||||
|
||||
static Eina_Array *plugins = NULL;
|
||||
static E_Config_DD *conf_edd = NULL;
|
||||
static E_Config_DD *conf_item_edd = NULL;
|
||||
|
||||
Config *evry_conf = NULL;
|
||||
|
||||
/* module setup */
|
||||
|
@ -25,6 +27,17 @@ EAPI E_Module_Api e_modapi =
|
|||
"Everything"
|
||||
};
|
||||
|
||||
|
||||
static Eina_Bool list_cb(Eina_Module *m, void *data)
|
||||
{
|
||||
if (eina_module_load(m))
|
||||
return EINA_TRUE;
|
||||
|
||||
return EINA_FALSE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
EAPI void *
|
||||
e_modapi_init(E_Module *m)
|
||||
{
|
||||
|
@ -70,19 +83,19 @@ e_modapi_init(E_Module *m)
|
|||
evry_conf->scroll_animate = 1;
|
||||
evry_conf->scroll_speed = 0.08;
|
||||
}
|
||||
|
||||
/* evry_conf->history = eina_hash_string_superfast_new(NULL); */
|
||||
|
||||
/* conf_module = m; */
|
||||
evry_init();
|
||||
|
||||
evry_plug_config_init();
|
||||
evry_plug_dir_browse_init();
|
||||
evry_plug_apps_init();
|
||||
evry_plug_tracker_init();
|
||||
evry_plug_border_init();
|
||||
evry_plug_border_act_init();
|
||||
evry_plug_calc_init();
|
||||
evry_plug_aspell_init();
|
||||
|
||||
eina_module_init();
|
||||
plugins = eina_module_list_get(NULL, m->dir, 1, &list_cb, NULL);
|
||||
if (plugins)
|
||||
printf("plugins loaded\n");
|
||||
else
|
||||
printf("could not find plugins in %s\n", m->dir);
|
||||
|
||||
/* add module supplied action */
|
||||
act = e_action_add("everything");
|
||||
if (act)
|
||||
|
@ -121,18 +134,15 @@ e_modapi_shutdown(E_Module *m __UNUSED__)
|
|||
act = NULL;
|
||||
}
|
||||
|
||||
evry_plug_config_shutdown();
|
||||
evry_plug_dir_browse_shutdown();
|
||||
evry_plug_apps_shutdown();
|
||||
evry_plug_tracker_shutdown();
|
||||
evry_plug_border_shutdown();
|
||||
evry_plug_border_act_shutdown();
|
||||
evry_plug_calc_shutdown();
|
||||
evry_plug_aspell_shutdown();
|
||||
|
||||
evry_shutdown();
|
||||
/* conf_module = NULL; */
|
||||
|
||||
eina_module_list_unload(plugins);
|
||||
eina_module_list_delete(plugins);
|
||||
eina_array_free(plugins);
|
||||
|
||||
eina_module_shutdown();
|
||||
|
||||
while ((cfd = e_config_dialog_get("E", "_config_everything_dialog"))) e_object_del(E_OBJECT(cfd));
|
||||
e_configure_registry_item_del("advanced/run_everything");
|
||||
e_configure_registry_category_del("advanced");
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
typedef struct _Evry_Plugin Evry_Plugin;
|
||||
typedef struct _Evry_Item Evry_Item;
|
||||
typedef struct _Evry_Action Evry_Action;
|
||||
typedef struct _Evry_Config Evry_Config;
|
||||
typedef struct _Evry_App Evry_App;
|
||||
#undef E_TYPEDEFS
|
||||
|
||||
|
@ -46,7 +45,8 @@ struct _Config
|
|||
|
||||
/**/
|
||||
Eina_List *plugins;
|
||||
|
||||
|
||||
Eina_Hash *history;
|
||||
};
|
||||
|
||||
struct _Plugin_Config
|
||||
|
@ -105,9 +105,6 @@ struct _Evry_Plugin
|
|||
/* get candidates matching string, fills 'candidates' list */
|
||||
int (*fetch) (Evry_Plugin *p, const char *input);
|
||||
|
||||
/* default action for this plugins items */
|
||||
int (*action) (Evry_Plugin *p, Evry_Item *item, const char *input);
|
||||
|
||||
/* run before new query and when hiding 'everything' */
|
||||
void (*cleanup) (Evry_Plugin *p);
|
||||
|
||||
|
@ -116,17 +113,17 @@ struct _Evry_Plugin
|
|||
/* provide more information for a candidate */
|
||||
/* int (*candidate_info) (Evas *evas, Evry_Item *item); */
|
||||
|
||||
/* optional */
|
||||
/* optional: default action for this plugins items */
|
||||
int (*action) (Evry_Plugin *p, Evry_Item *item, const char *input);
|
||||
|
||||
/* optional: create list of items when shown (e.g. for sorting) */
|
||||
void (*realize_items) (Evry_Plugin *p, Evas *e);
|
||||
|
||||
|
||||
Eina_List *items;
|
||||
|
||||
Evas_Object *(*config_page) (void);
|
||||
void (*config_apply) (void);
|
||||
|
||||
/* for internal use by plugin */
|
||||
void *priv;
|
||||
|
||||
/* not to be set by plugin! */
|
||||
Evas_Object *tab;
|
||||
Plugin_Config *config;
|
||||
|
@ -155,13 +152,6 @@ struct _Evry_Action
|
|||
Evas_Object *o_icon;
|
||||
};
|
||||
|
||||
struct _Evry_Config
|
||||
{
|
||||
Eina_List *plugin_order;
|
||||
|
||||
};
|
||||
|
||||
|
||||
struct _Evry_App
|
||||
{
|
||||
const char *file;
|
||||
|
@ -175,8 +165,8 @@ EAPI int e_modapi_shutdown (E_Module *m);
|
|||
EAPI int e_modapi_save (E_Module *m);
|
||||
EAPI E_Config_Dialog *evry_config_dialog(E_Container *con, const char *params);
|
||||
|
||||
EAPI int evry_init(void);
|
||||
EAPI int evry_shutdown(void);
|
||||
EAPI int evry_init(void);
|
||||
EAPI int evry_shutdown(void);
|
||||
EAPI int evry_show(E_Zone *zone);
|
||||
EAPI void evry_hide(void);
|
||||
EAPI void evry_plugin_register(Evry_Plugin *p);
|
||||
|
@ -186,30 +176,6 @@ EAPI void evry_action_unregister(Evry_Action *act);
|
|||
EAPI void evry_plugin_async_update(Evry_Plugin *plugin, int state);
|
||||
EAPI void evry_clear_input(void);
|
||||
|
||||
EAPI int evry_plug_apps_init(void);
|
||||
EAPI int evry_plug_apps_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_border_init(void);
|
||||
EAPI int evry_plug_border_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_border_act_init(void);
|
||||
EAPI int evry_plug_border_act_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_config_init(void);
|
||||
EAPI int evry_plug_config_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_tracker_init(void);
|
||||
EAPI int evry_plug_tracker_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_dir_browse_init(void);
|
||||
EAPI int evry_plug_dir_browse_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_calc_init(void);
|
||||
EAPI int evry_plug_calc_shutdown(void);
|
||||
|
||||
EAPI int evry_plug_aspell_init(void);
|
||||
EAPI int evry_plug_aspell_shutdown(void);
|
||||
|
||||
extern Config *evry_conf;
|
||||
|
||||
#endif
|
||||
|
|
|
@ -61,7 +61,7 @@ static int _evry_push_state(void);
|
|||
static int _evry_pop_state(void);
|
||||
static void _evry_plugin_selector_show(Evry_Plugin *p);
|
||||
static int _evry_cb_plugin_sort(const void *data1, const void *data2);
|
||||
static int _evry_cb_plugin_sort_by_trigger(const void *data1, const void *data2);
|
||||
/* static int _evry_cb_plugin_sort_by_trigger(const void *data1, const void *data2); */
|
||||
|
||||
static int _evry_plug_act_select_init(void);
|
||||
static int _evry_plug_act_select_begin(Evry_Plugin *p, Evry_Item *it);
|
||||
|
@ -134,8 +134,8 @@ evry_plugin_register(Evry_Plugin *plugin)
|
|||
evry_conf->plugins_conf = eina_list_append(evry_conf->plugins_conf, pc);
|
||||
}
|
||||
|
||||
if (plugin->trigger && !pc->trigger)
|
||||
pc->trigger = eina_stringshare_add(plugin->trigger);
|
||||
/* if (plugin->trigger && !pc->trigger)
|
||||
* pc->trigger = eina_stringshare_add(plugin->trigger); */
|
||||
|
||||
plugin->config = pc;
|
||||
|
||||
|
@ -284,20 +284,16 @@ evry_hide(void)
|
|||
cur_state = NULL;
|
||||
|
||||
if (update_timer)
|
||||
{
|
||||
ecore_timer_del(update_timer);
|
||||
update_timer = NULL;
|
||||
}
|
||||
ecore_timer_del(update_timer);
|
||||
update_timer = NULL;
|
||||
|
||||
if (scroll_timer)
|
||||
{
|
||||
ecore_timer_del(scroll_timer);
|
||||
scroll_timer = NULL;
|
||||
}
|
||||
ecore_timer_del(scroll_timer);
|
||||
scroll_timer = NULL;
|
||||
|
||||
if (scroll_animator)
|
||||
{
|
||||
ecore_animator_del(scroll_animator);
|
||||
scroll_animator = NULL;
|
||||
}
|
||||
ecore_animator_del(scroll_animator);
|
||||
scroll_animator = NULL;
|
||||
|
||||
e_popup_hide(popup);
|
||||
|
||||
|
@ -333,13 +329,15 @@ evry_plugin_async_update(Evry_Plugin *p, int action)
|
|||
|
||||
if (action == EVRY_ASYNC_UPDATE_ADD)
|
||||
{
|
||||
if (!p->items) return;
|
||||
|
||||
if (!eina_list_data_find(s->cur_plugins, p))
|
||||
{
|
||||
s->cur_plugins = eina_list_prepend(s->cur_plugins, p);
|
||||
|
||||
s->cur_plugins = eina_list_sort(s->cur_plugins,
|
||||
eina_list_count(s->cur_plugins),
|
||||
_evry_cb_plugin_sort_by_trigger);
|
||||
/* s->cur_plugins = eina_list_sort(s->cur_plugins,
|
||||
* eina_list_count(s->cur_plugins),
|
||||
* _evry_cb_plugin_sort_by_trigger); */
|
||||
|
||||
_evry_plugin_selector_show(p);
|
||||
}
|
||||
|
@ -396,19 +394,19 @@ _evry_cb_plugin_sort(const void *data1, const void *data2)
|
|||
return p1->config->priority - p2->config->priority;
|
||||
}
|
||||
|
||||
static int
|
||||
_evry_cb_plugin_sort_by_trigger(const void *data1, const void *data2)
|
||||
{
|
||||
const Evry_Plugin *p1 = data1;
|
||||
const Evry_Plugin *p2 = data2;
|
||||
if (p1->trigger)
|
||||
{
|
||||
if (!strncmp(cur_state->input, p1->trigger, strlen(p1->trigger)))
|
||||
return 1;
|
||||
}
|
||||
|
||||
return p1->config->priority - p2->config->priority;
|
||||
}
|
||||
/* static int
|
||||
* _evry_cb_plugin_sort_by_trigger(const void *data1, const void *data2)
|
||||
* {
|
||||
* const Evry_Plugin *p1 = data1;
|
||||
* const Evry_Plugin *p2 = data2;
|
||||
* if (p1->trigger)
|
||||
* {
|
||||
* if (!strncmp(cur_state->input, p1->trigger, strlen(p1->trigger)))
|
||||
* return 1;
|
||||
* }
|
||||
*
|
||||
* return p1->config->priority - p2->config->priority;
|
||||
* } */
|
||||
|
||||
static int
|
||||
_evry_push_state(void)
|
||||
|
@ -500,10 +498,7 @@ _evry_push_state(void)
|
|||
s->cur_actions = cur_state->cur_actions;
|
||||
s->initial = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
s->initial = 1;
|
||||
}
|
||||
else s->initial = 1;
|
||||
|
||||
cur_state = s;
|
||||
stack = eina_list_prepend(stack, s);
|
||||
|
@ -874,7 +869,7 @@ _evry_plugin_action(int finished)
|
|||
|
||||
if (s->cur_plugin == action_selector)
|
||||
{
|
||||
/* set cur_action and start plugins for second parameter (if required)*/
|
||||
/* set cur_action and start plugins for second parameter if required */
|
||||
if (s->sel_item)
|
||||
finished = _evry_plug_act_select_action(s->cur_plugin, s->sel_item, s->input);
|
||||
}
|
||||
|
@ -892,9 +887,8 @@ _evry_plugin_action(int finished)
|
|||
int ret = EVRY_ACTION_OTHER;
|
||||
|
||||
if (s->cur_plugin->action)
|
||||
{
|
||||
ret = s->cur_plugin->action(s->cur_plugin, s->sel_item, s->input);
|
||||
}
|
||||
ret = s->cur_plugin->action(s->cur_plugin, s->sel_item, s->input);
|
||||
|
||||
if (ret == EVRY_ACTION_OTHER)
|
||||
{
|
||||
_evry_push_state();
|
||||
|
@ -904,7 +898,7 @@ _evry_plugin_action(int finished)
|
|||
finished = 0;
|
||||
}
|
||||
else if (s->initial)
|
||||
e_exec(popup->zone, NULL, s->input, NULL, NULL /* "everything" */);
|
||||
e_exec(popup->zone, NULL, s->input, NULL, NULL);
|
||||
|
||||
if (finished)
|
||||
evry_hide();
|
||||
|
@ -999,7 +993,11 @@ _evry_show_items(Evry_Plugin *p)
|
|||
_evry_item_sel(s->sel_item);
|
||||
_evry_scroll_to(0);
|
||||
}
|
||||
|
||||
else if (!p->items)
|
||||
{
|
||||
s->sel_item = NULL;
|
||||
}
|
||||
|
||||
evas_event_thaw(popup->evas);
|
||||
|
||||
_evry_tab_scroll_to(p);
|
||||
|
@ -1010,7 +1008,7 @@ _evry_matches_update(Evry_Plugin *cur_plugin)
|
|||
{
|
||||
Evry_Plugin *p;
|
||||
Eina_List *l;
|
||||
int items;
|
||||
Eina_Bool has_items = EINA_FALSE;
|
||||
Evry_State *s = cur_state;
|
||||
|
||||
_evry_list_clear();
|
||||
|
@ -1019,35 +1017,47 @@ _evry_matches_update(Evry_Plugin *cur_plugin)
|
|||
s->sel_item = NULL;
|
||||
|
||||
if (s->input)
|
||||
EINA_LIST_FOREACH(s->plugins, l, p)
|
||||
{
|
||||
/* input matches trigger? */
|
||||
if (p->trigger)
|
||||
EINA_LIST_FOREACH(s->plugins, l, p)
|
||||
{
|
||||
if ((strlen(s->input) >= strlen(p->trigger)) &&
|
||||
(!strncmp(s->input, p->trigger, strlen(p->trigger))))
|
||||
/* input matches plugin trigger? */
|
||||
if (p->trigger)
|
||||
{
|
||||
s->cur_plugins = eina_list_append(s->cur_plugins, p);
|
||||
items = p->fetch(p, s->input);
|
||||
break;
|
||||
if ((strlen(s->input) >= strlen(p->trigger)) &&
|
||||
(!strncmp(s->input, p->trigger, strlen(p->trigger))))
|
||||
{
|
||||
s->cur_plugins = eina_list_append(s->cur_plugins, p);
|
||||
has_items = p->fetch(p, s->input);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (!s->cur_plugins)
|
||||
EINA_LIST_FOREACH(s->plugins, l, p)
|
||||
{
|
||||
if (p->trigger) continue;
|
||||
EINA_LIST_FOREACH(s->plugins, l, p)
|
||||
{
|
||||
if (p->trigger) continue;
|
||||
|
||||
if (strlen(s->input) == 0)
|
||||
items = !p->need_query ? p->fetch(p, NULL) : 0;
|
||||
else
|
||||
items = p->fetch(p, s->input);
|
||||
|
||||
if (!s->initial || (items && eina_list_count(p->items) > 0) || p->async_query)
|
||||
s->cur_plugins = eina_list_append(s->cur_plugins, p);
|
||||
if (strlen(s->input) == 0)
|
||||
{
|
||||
if (!p->need_query)
|
||||
has_items = p->fetch(p, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
has_items = p->fetch(p, s->input);
|
||||
}
|
||||
|
||||
if ((!s->initial) ||
|
||||
(has_items && eina_list_count(p->items) > 0) ||
|
||||
(p->async_query))
|
||||
s->cur_plugins = eina_list_append(s->cur_plugins, p);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* remove tabs for not active plugins */
|
||||
EINA_LIST_FOREACH(evry_conf->plugins, l, p)
|
||||
{
|
||||
|
|
|
@ -24,6 +24,11 @@ static int _edit_app_check_item(Evry_Action *act, Evry_Item *it);
|
|||
static int _new_app_action(Evry_Action *act);
|
||||
static int _new_app_check_item(Evry_Action *act, Evry_Item *it);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p1;
|
||||
static Evry_Plugin *p2;
|
||||
static Evry_Action *act;
|
||||
|
@ -32,8 +37,8 @@ static Evry_Action *act3;
|
|||
static Inst *inst;
|
||||
|
||||
|
||||
EAPI int
|
||||
evry_plug_apps_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p1 = E_NEW(Evry_Plugin, 1);
|
||||
p1->name = "Applications";
|
||||
|
@ -91,16 +96,14 @@ evry_plug_apps_init(void)
|
|||
return 1;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_apps_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p1);
|
||||
evry_plugin_unregister(p2);
|
||||
evry_action_unregister(act);
|
||||
evry_action_unregister(act2);
|
||||
evry_action_unregister(act3);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -659,4 +662,3 @@ _new_app_action(Evry_Action *act)
|
|||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -2,6 +2,12 @@
|
|||
#include "e_mod_main.h"
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static const char TRIGGER[] = "aspell ";
|
||||
static const char LANG_MODIFIER[] = "lang=";
|
||||
static Ecore_X_Window clipboard_win = 0;
|
||||
|
@ -377,13 +383,13 @@ _item_icon_get(Evry_Plugin *p __UNUSED__, Evry_Item *it, Evas *e __UNUSED__)
|
|||
it->o_icon = NULL;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_aspell_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
Plugin *p;
|
||||
|
||||
if (_singleton)
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
|
||||
p = E_NEW(Plugin, 1);
|
||||
p->base.name = "Spell Checker";
|
||||
|
@ -407,17 +413,17 @@ evry_plug_aspell_init(void)
|
|||
evry_plugin_register(&p->base);
|
||||
|
||||
_singleton = p;
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_aspell_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
Evry_Item *it;
|
||||
Plugin *p;
|
||||
|
||||
if (!_singleton)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
p = _singleton;
|
||||
_singleton = NULL;
|
||||
|
@ -427,6 +433,4 @@ evry_plug_aspell_shutdown(void)
|
|||
|
||||
evry_plugin_unregister(&p->base);
|
||||
E_FREE(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -8,11 +8,16 @@ static void _item_add(Evry_Plugin *p, E_Border *bd, int prio);
|
|||
static int _cb_sort(const void *data1, const void *data2);
|
||||
static void _item_icon_get(Evry_Plugin *p, Evry_Item *it, Evas *e);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p;
|
||||
|
||||
|
||||
EAPI int
|
||||
evry_plug_border_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p = E_NEW(Evry_Plugin, 1);
|
||||
p->name = "Windows";
|
||||
|
@ -25,16 +30,14 @@ evry_plug_border_init(void)
|
|||
p->icon_get = &_item_icon_get;
|
||||
evry_plugin_register(p);
|
||||
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_border_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p);
|
||||
E_FREE(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -15,12 +15,16 @@ static void _cleanup(Evry_Plugin *p);
|
|||
static void _item_icon_get(Evry_Plugin *p, Evry_Item *it, Evas *e);
|
||||
static void _item_add(Evry_Plugin *p, const char *label, void (*action_cb) (E_Border *bd), const char *icon);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p;
|
||||
static Inst *inst;
|
||||
|
||||
|
||||
EAPI int
|
||||
evry_plug_border_act_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p = E_NEW(Evry_Plugin, 1);
|
||||
p->name = "Window Action";
|
||||
|
@ -37,17 +41,15 @@ evry_plug_border_act_init(void)
|
|||
|
||||
inst = E_NEW(Inst, 1);
|
||||
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_border_act_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p);
|
||||
E_FREE(p);
|
||||
E_FREE(inst);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -144,4 +146,3 @@ _item_icon_get(Evry_Plugin *p __UNUSED__, Evry_Item *it, Evas *e)
|
|||
it->o_icon = edje_object_add(e);
|
||||
e_theme_edje_object_set(it->o_icon, "base/theme/borders", (const char *)it->data[1]);
|
||||
}
|
||||
|
||||
|
|
|
@ -15,6 +15,12 @@ static int _cb_data(void *data, int type, void *event);
|
|||
static int _cb_error(void *data, int type, void *event);
|
||||
static int _cb_del(void *data, int type, void *event);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
|
||||
static Evry_Plugin *p;
|
||||
static Ecore_Exe *exe = NULL;
|
||||
static Eina_List *history = NULL;
|
||||
|
@ -24,8 +30,8 @@ static Ecore_Event_Handler *del_handler = NULL;
|
|||
static Ecore_X_Window clipboard_win = 0;
|
||||
static int error = 0;
|
||||
|
||||
EAPI int
|
||||
evry_plug_calc_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p = E_NEW(Evry_Plugin, 1);
|
||||
p->name = "Calculator";
|
||||
|
@ -42,11 +48,11 @@ evry_plug_calc_init(void)
|
|||
evry_plugin_register(p);
|
||||
|
||||
clipboard_win = ecore_x_window_new(0, 0, 0, 1, 1);
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_calc_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
Evry_Item *it;
|
||||
|
||||
|
@ -60,9 +66,6 @@ evry_plug_calc_shutdown(void)
|
|||
E_FREE(p);
|
||||
|
||||
ecore_x_window_free(clipboard_win);
|
||||
clipboard_win = 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -103,6 +106,7 @@ _cleanup(Evry_Plugin *p)
|
|||
|
||||
ecore_event_handler_del(data_handler);
|
||||
ecore_event_handler_del(error_handler);
|
||||
ecore_event_handler_del(del_handler);
|
||||
data_handler = NULL;
|
||||
|
||||
ecore_exe_quit(exe);
|
||||
|
@ -171,8 +175,6 @@ _fetch(Evry_Plugin *p, const char *input)
|
|||
else
|
||||
snprintf(buf, 1024, "scale=3;%s\n", input + (strlen(p->trigger)));
|
||||
|
||||
/* printf("send %s\n",buf); */
|
||||
|
||||
ecore_exe_send(exe, buf, strlen(buf));
|
||||
|
||||
/* XXX after error we get no response for first input ?! - send a
|
||||
|
@ -217,8 +219,6 @@ _cb_data(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
|
||||
for (l = ev->lines; l && l->line; l++)
|
||||
{
|
||||
/* printf("line %s\n", l->line); */
|
||||
|
||||
if (p->items)
|
||||
{
|
||||
Evry_Item *it = p->items->data;
|
||||
|
@ -244,7 +244,6 @@ _cb_error(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
return 1;
|
||||
|
||||
error = 1;
|
||||
/* printf("got error\n"); */
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
@ -260,3 +259,4 @@ _cb_del(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|||
exe = NULL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,11 +8,16 @@ static void _item_add(Evry_Plugin *p, E_Configure_It *eci, int prio);
|
|||
static void _item_icon_get(Evry_Plugin *p, Evry_Item *it, Evas *e);
|
||||
static int _cb_sort(const void *data1, const void *data2);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p;
|
||||
|
||||
|
||||
EAPI int
|
||||
evry_plug_config_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p = E_NEW(Evry_Plugin, 1);
|
||||
p->name = "Settings";
|
||||
|
@ -24,16 +29,14 @@ evry_plug_config_init(void)
|
|||
p->icon_get = &_item_icon_get;
|
||||
|
||||
evry_plugin_register(p);
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_config_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p);
|
||||
E_FREE(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -21,12 +21,17 @@ static void _item_fill(Evry_Item *it, Evas *evas);
|
|||
static Evry_Item *_item_add(const char *directory, const char *file);
|
||||
static void _realize(Evry_Plugin *p, Evas *e);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p;
|
||||
static Eina_List *stack = NULL;
|
||||
|
||||
|
||||
EAPI int
|
||||
evry_plug_dir_browse_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
p = E_NEW(Evry_Plugin, 1);
|
||||
p->name = "Browse Files";
|
||||
|
@ -42,16 +47,14 @@ evry_plug_dir_browse_init(void)
|
|||
|
||||
evry_plugin_register(p);
|
||||
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_dir_browse_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p);
|
||||
E_FREE(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
|
|
|
@ -11,17 +11,21 @@ struct _Inst
|
|||
};
|
||||
|
||||
static int _fetch(Evry_Plugin *p, const char *input);
|
||||
static int _action(Evry_Plugin *p, Evry_Item *it, const char *input);
|
||||
static void _cleanup(Evry_Plugin *p);
|
||||
static void _item_add(Evry_Plugin *p, char *file, char *service, char *mime, int prio);
|
||||
static void _item_add(Evry_Plugin *p, char *file, char *mime, int prio);
|
||||
static void _item_icon_get(Evry_Plugin *p, Evry_Item *it, Evas *e);
|
||||
static void _dbus_cb_reply(void *data, DBusMessage *msg, DBusError *error);
|
||||
|
||||
static Eina_Bool _init(void);
|
||||
static void _shutdown(void);
|
||||
EINA_MODULE_INIT(_init);
|
||||
EINA_MODULE_SHUTDOWN(_shutdown);
|
||||
|
||||
static Evry_Plugin *p;
|
||||
static Inst *inst;
|
||||
|
||||
EAPI int
|
||||
evry_plug_tracker_init(void)
|
||||
static Eina_Bool
|
||||
_init(void)
|
||||
{
|
||||
E_DBus_Connection *conn = e_dbus_bus_get(DBUS_BUS_SESSION);
|
||||
|
||||
|
@ -33,7 +37,6 @@ evry_plug_tracker_init(void)
|
|||
p->type_out = "FILE";
|
||||
p->need_query = 1;
|
||||
p->fetch = &_fetch;
|
||||
p->action = &_action;
|
||||
p->cleanup = &_cleanup;
|
||||
p->icon_get = &_item_icon_get;
|
||||
|
||||
|
@ -42,11 +45,11 @@ evry_plug_tracker_init(void)
|
|||
|
||||
evry_plugin_register(p);
|
||||
|
||||
return 1;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EAPI int
|
||||
evry_plug_tracker_shutdown(void)
|
||||
static void
|
||||
_shutdown(void)
|
||||
{
|
||||
evry_plugin_unregister(p);
|
||||
|
||||
|
@ -58,14 +61,6 @@ evry_plug_tracker_shutdown(void)
|
|||
}
|
||||
|
||||
if (p) E_FREE(p);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int
|
||||
_action(Evry_Plugin *p __UNUSED__, Evry_Item *it __UNUSED__, const char *input __UNUSED__)
|
||||
{
|
||||
return EVRY_ACTION_OTHER;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -144,7 +139,7 @@ _item_icon_get(Evry_Plugin *p __UNUSED__, Evry_Item *it, Evas *e)
|
|||
}
|
||||
|
||||
static void
|
||||
_item_add(Evry_Plugin *p, char *file, char *service __UNUSED__, char *mime, int prio)
|
||||
_item_add(Evry_Plugin *p, char *file, char *mime, int prio)
|
||||
{
|
||||
Evry_Item *it;
|
||||
|
||||
|
@ -176,7 +171,6 @@ _dbus_cb_reply(void *data __UNUSED__, DBusMessage *msg, DBusError *error)
|
|||
while(dbus_message_iter_get_arg_type(&item) == DBUS_TYPE_ARRAY)
|
||||
{
|
||||
char *uri;
|
||||
char *service;
|
||||
char *mime;
|
||||
|
||||
dbus_message_iter_recurse(&item, &iter);
|
||||
|
@ -185,13 +179,13 @@ _dbus_cb_reply(void *data __UNUSED__, DBusMessage *msg, DBusError *error)
|
|||
{
|
||||
dbus_message_iter_get_basic(&iter, &uri);
|
||||
dbus_message_iter_next(&iter);
|
||||
dbus_message_iter_get_basic(&iter, &service);
|
||||
/* dbus_message_iter_get_basic(&iter, &service); */
|
||||
dbus_message_iter_next(&iter);
|
||||
dbus_message_iter_get_basic(&iter, &mime);
|
||||
|
||||
if (uri && service && mime)
|
||||
if (uri && mime)
|
||||
{
|
||||
_item_add(p, uri, service, mime, 1);
|
||||
_item_add(p, uri, mime, 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue