From 7c50b360d81b716dc03eba761be520c3db8d1cef Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 1 Aug 2007 12:37:01 +0000 Subject: [PATCH] another example - exebuf goes to a module. it's even a godo demo of how a moduel can extend the default action set (and remove its action) as well as extend the default menus. SVN revision: 31103 --- configure.in | 2 + po/POTFILES.in | 3 +- src/bin/Makefile.am | 2 - src/bin/e_actions.c | 15 --- src/bin/e_config.c | 1 + src/bin/e_includes.h | 1 - src/bin/e_int_menus.c | 146 ++++++++++++++++++++----- src/bin/e_main.c | 8 -- src/modules/Makefile.am | 2 +- src/modules/exebuf/.cvsignore | 7 ++ src/modules/exebuf/Makefile.am | 31 ++++++ src/modules/exebuf/e-module-exebuf.edj | Bin 0 -> 4669 bytes src/{bin => modules/exebuf}/e_exebuf.c | 1 + src/{bin => modules/exebuf}/e_exebuf.h | 0 src/modules/exebuf/e_mod_main.c | 140 ++++++++++++++++++++++++ src/modules/exebuf/e_mod_main.h | 21 ++++ src/modules/exebuf/module.desktop.in | 4 + 17 files changed, 326 insertions(+), 58 deletions(-) create mode 100644 src/modules/exebuf/.cvsignore create mode 100644 src/modules/exebuf/Makefile.am create mode 100644 src/modules/exebuf/e-module-exebuf.edj rename src/{bin => modules/exebuf}/e_exebuf.c (99%) rename src/{bin => modules/exebuf}/e_exebuf.h (100%) create mode 100644 src/modules/exebuf/e_mod_main.c create mode 100644 src/modules/exebuf/e_mod_main.h create mode 100644 src/modules/exebuf/module.desktop.in diff --git a/configure.in b/configure.in index 1ad41e971..c4339ac52 100644 --- a/configure.in +++ b/configure.in @@ -254,6 +254,8 @@ src/modules/start/Makefile src/modules/start/module.desktop src/modules/layout/Makefile src/modules/layout/module.desktop +src/modules/exebuf/Makefile +src/modules/exebuf/module.desktop src/modules/conf_wallpaper/Makefile src/modules/conf_wallpaper/module.desktop src/modules/conf_theme/Makefile diff --git a/po/POTFILES.in b/po/POTFILES.in index 1f6632e9a..307cc5cd2 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -26,7 +26,6 @@ src/bin/e_editable.c src/bin/e_entry.c src/bin/e_entry_dialog.c src/bin/e_error.c -src/bin/e_exebuf.c src/bin/e_exec.c src/bin/e_exehist.c src/bin/e_filereg.c @@ -210,6 +209,8 @@ src/modules/cpufreq/e_mod_main.c src/modules/cpufreq/freqset.c src/modules/dropshadow/e_mod_config.c src/modules/dropshadow/e_mod_main.c +src/modules/exebuf/e_mod_config.c +src/modules/exebuf/e_exebuf.c src/modules/ibar/e_mod_config.c src/modules/ibar/e_mod_main.c src/modules/ibox/e_mod_config.c diff --git a/src/bin/Makefile.am b/src/bin/Makefile.am index 8f29ed158..988a6453c 100644 --- a/src/bin/Makefile.am +++ b/src/bin/Makefile.am @@ -112,7 +112,6 @@ e_widget_tlist.h \ e_widget_config_list.h \ e_slider.h \ e_widget_slider.h \ -e_exebuf.h \ e_desklock.h \ e_screensaver.h \ e_dpms.h \ @@ -240,7 +239,6 @@ e_widget_tlist.c \ e_widget_config_list.c \ e_slider.c \ e_widget_slider.c \ -e_exebuf.c \ e_desklock.c \ e_screensaver.c \ e_dpms.c \ diff --git a/src/bin/e_actions.c b/src/bin/e_actions.c index 27b86cfd1..609629413 100644 --- a/src/bin/e_actions.c +++ b/src/bin/e_actions.c @@ -1963,16 +1963,6 @@ ACT_FN_GO(pointer_resize_pop) } } -/***************************************************************************/ -ACT_FN_GO(exebuf) -{ - E_Zone *zone; - - zone = _e_actions_zone_get(obj); - if (zone) - e_exebuf_show(zone); -} - /***************************************************************************/ ACT_FN_GO(desk_lock) { @@ -2303,11 +2293,6 @@ e_actions_init(void) ACT_GO(pointer_resize_push); ACT_GO(pointer_resize_pop); - /* exebuf */ - ACT_GO(exebuf); - e_action_predef_name_set(_("Launch"), _("Run Command Dialog"), "exebuf", - NULL, NULL, 0); - /* desk_lock */ ACT_GO(desk_lock); e_action_predef_name_set(_("Desktop"), _("Desktop Lock"), "desk_lock", diff --git a/src/bin/e_config.c b/src/bin/e_config.c index 38c7da9cd..a7729451d 100644 --- a/src/bin/e_config.c +++ b/src/bin/e_config.c @@ -758,6 +758,7 @@ e_config_init(void) CFG_MODULE("cpufreq", 1, 0); CFG_MODULE("temperature", 1, 0); CFG_MODULE("pager", 1, 0); + CFG_MODULE("exebuf", 1, 1); CFG_MODULE("conf_applications", 1, 1); CFG_MODULE("conf_borders", 1, 1); CFG_MODULE("conf_clientlist", 1, 1); diff --git a/src/bin/e_includes.h b/src/bin/e_includes.h index d8eaca3cc..512558ffd 100644 --- a/src/bin/e_includes.h +++ b/src/bin/e_includes.h @@ -84,7 +84,6 @@ #include "e_widget_config_list.h" #include "e_slider.h" #include "e_widget_slider.h" -#include "e_exebuf.h" #include "e_desklock.h" #include "e_screensaver.h" #include "e_dpms.h" diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 7cbfcde90..e3ffb961d 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -20,9 +20,7 @@ struct _Main_Data /* local subsystem functions */ static void _e_int_menus_main_del_hook (void *obj); static void _e_int_menus_main_about (void *data, E_Menu *m, E_Menu_Item *mi); -static int _e_int_menus_main_run_defer_cb (void *data); static void _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi); -static void _e_int_menus_main_run (void *data, E_Menu *m, E_Menu_Item*mi); static int _e_int_menus_main_lock_defer_cb (void *data); static void _e_int_menus_main_lock (void *data, E_Menu *m, E_Menu_Item*mi); static void _e_int_menus_main_restart (void *data, E_Menu *m, E_Menu_Item *mi); @@ -85,6 +83,7 @@ e_int_menus_main_new(void) E_Menu *m, *subm; E_Menu_Item *mi; Main_Data *dat; + Evas_List *l; dat = calloc(1, sizeof(Main_Data)); m = e_menu_new(); @@ -95,6 +94,12 @@ e_int_menus_main_new(void) e_menu_category_set(m, "main"); + l = evas_hash_find(_e_int_menus_augmentation, "main/0"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + if (e_config->menu_favorites_show) { subm = e_int_menus_favorite_apps_new(); @@ -125,14 +130,21 @@ e_int_menus_main_new(void) e_menu_item_callback_set(mi, _e_int_menus_fwin_favorites_item_cb, NULL); #endif - mi = e_menu_item_new(m); - e_menu_item_label_set(mi, _("Run Command")); - e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); - e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "main/1"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); + l = evas_hash_find(_e_int_menus_augmentation, "main/2"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + subm = e_int_menus_desktops_new(); dat->desktops = subm; mi = e_menu_item_new(m); @@ -156,9 +168,22 @@ e_int_menus_main_new(void) e_util_menu_item_edje_icon_set(mi, "enlightenment/lost_windows"); e_menu_item_submenu_set(mi, subm); */ + + l = evas_hash_find(_e_int_menus_augmentation, "main/3"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); + l = evas_hash_find(_e_int_menus_augmentation, "main/4"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + subm = e_menu_new(); mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Enlightenment")); @@ -176,9 +201,21 @@ e_int_menus_main_new(void) e_util_menu_item_edje_icon_set(mi, "enlightenment/themes"); e_menu_item_callback_set(mi, _e_int_menus_themes_about, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "main/5"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(subm); e_menu_item_separator_set(mi, 1); + l = evas_hash_find(_e_int_menus_augmentation, "main/6"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(subm); e_menu_item_label_set(mi, _("Restart")); e_util_menu_item_edje_icon_set(mi, "enlightenment/reset"); @@ -189,9 +226,21 @@ e_int_menus_main_new(void) e_util_menu_item_edje_icon_set(mi, "enlightenment/exit"); e_menu_item_callback_set(mi, _e_int_menus_main_exit, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "main/7"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); + l = evas_hash_find(_e_int_menus_augmentation, "main/8"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + subm = e_int_menus_config_new(); dat->config = subm; mi = e_menu_item_new(m); @@ -199,9 +248,21 @@ e_int_menus_main_new(void) e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration"); e_menu_item_submenu_set(mi, subm); + l = evas_hash_find(_e_int_menus_augmentation, "main/9"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); + l = evas_hash_find(_e_int_menus_augmentation, "main/10"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + subm = e_int_menus_sys_new(); dat->sys = subm; mi = e_menu_item_new(m); @@ -209,6 +270,12 @@ e_int_menus_main_new(void) e_util_menu_item_edje_icon_set(mi, "enlightenment/system"); e_menu_item_submenu_set(mi, subm); + l = evas_hash_find(_e_int_menus_augmentation, "main/11"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + return m; } @@ -394,6 +461,18 @@ _e_int_menus_main_del_hook(void *obj) e_object_del(E_OBJECT(dat->sys)); free(dat); } + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/0")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/1")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/2")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/3")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/4")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/5")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/6")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/7")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/8")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/9")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/10")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "main/11")); } static void @@ -414,31 +493,11 @@ _e_int_menus_themes_about(void *data, E_Menu *m, E_Menu_Item *mi) if (about) e_theme_about_show(about); } -/* FIXME: this is a workaround for menus' haveing a key grab AND exebuf - * wanting one too - */ -static int -_e_int_menus_main_run_defer_cb(void *data) -{ - E_Zone *zone; - - zone = data; - e_exebuf_show(zone); - return 0; -} - static void _e_int_menus_fwin_favorites_item_cb(void *data, E_Menu *m, E_Menu_Item *mi) { e_fwin_new(m->zone->container, "favorites", "/"); } - -static void -_e_int_menus_main_run(void *data, E_Menu *m, E_Menu_Item *mi) -{ - ecore_idle_enterer_add(_e_int_menus_main_run_defer_cb, m->zone); -} - /* FIXME: this is a workaround for menus' haveing a key grab AND exebuf * wanting one too */ @@ -769,11 +828,26 @@ _e_int_menus_config_pre_cb(void *data, E_Menu *m) e_menu_pre_activate_callback_set(m, NULL, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "config/0"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Configuration Panel")); e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration"); e_menu_item_callback_set(mi, _e_int_menus_config_item_cb, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "config/1"); + if (l) + { + mi = e_menu_item_new(m); + e_menu_item_separator_set(mi, 1); + + _e_int_menus_augmentation_add(m, l); + } + mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); @@ -809,7 +883,7 @@ _e_int_menus_config_pre_cb(void *data, E_Menu *m) e_menu_item_callback_set(mi, _e_int_menus_shelf_item_cb, NULL); } - l = evas_hash_find(_e_int_menus_augmentation, "config"); + l = evas_hash_find(_e_int_menus_augmentation, "config/2"); if (l) { mi = e_menu_item_new(m); @@ -827,7 +901,9 @@ _e_int_menus_config_free_hook(void *obj) E_Menu *m; m = obj; - _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "config")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "config/0")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "config/1")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "config/2")); } static void @@ -844,7 +920,7 @@ _e_int_menus_sys_pre_cb(void *data, E_Menu *m) e_menu_pre_activate_callback_set(m, NULL, NULL); - l = evas_hash_find(_e_int_menus_augmentation, "sys"); + l = evas_hash_find(_e_int_menus_augmentation, "sys/0"); if (l) { _e_int_menus_augmentation_add(m, l); @@ -903,6 +979,15 @@ _e_int_menus_sys_pre_cb(void *data, E_Menu *m) e_util_menu_item_edje_icon_set(mi, "enlightenment/logout"); e_menu_item_callback_set(mi, _e_int_menus_main_logout, NULL); + l = evas_hash_find(_e_int_menus_augmentation, "sys/1"); + if (l) + { + _e_int_menus_augmentation_add(m, l); + + mi = e_menu_item_new(m); + e_menu_item_separator_set(mi, 1); + } + e_object_free_attach_func_set(E_OBJECT(m), _e_int_menus_sys_free_hook); } @@ -912,7 +997,8 @@ _e_int_menus_sys_free_hook(void *obj) E_Menu *m; m = obj; - _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "sys")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "sys/0")); + _e_int_menus_augmentation_del(m, evas_hash_find(_e_int_menus_augmentation, "sys/1")); } static int diff --git a/src/bin/e_main.c b/src/bin/e_main.c index 1e391a390..8cbdac317 100644 --- a/src/bin/e_main.c +++ b/src/bin/e_main.c @@ -772,14 +772,6 @@ main(int argc, char **argv) _e_main_shutdown(-1); } _e_main_shutdown_push(e_shelf_shutdown); - TS("exebuf"); - /* setup exebuf */ - if (!e_exebuf_init()) - { - e_error_message_show(_("Enlightenment cannot set up its exebuf system.")); - _e_main_shutdown(-1); - } - _e_main_shutdown_push(e_exebuf_shutdown); TS("dpms"); /* setup dpms */ diff --git a/src/modules/Makefile.am b/src/modules/Makefile.am index 3e48d5d57..1a7db580b 100644 --- a/src/modules/Makefile.am +++ b/src/modules/Makefile.am @@ -10,6 +10,7 @@ cpufreq \ ibox \ start \ layout \ +exebuf \ conf_wallpaper \ conf_theme \ conf_colors \ @@ -44,4 +45,3 @@ conf_winlist \ conf_exebuf \ conf_paths \ conf_mime - diff --git a/src/modules/exebuf/.cvsignore b/src/modules/exebuf/.cvsignore new file mode 100644 index 000000000..06d064a84 --- /dev/null +++ b/src/modules/exebuf/.cvsignore @@ -0,0 +1,7 @@ +.deps +.libs +Makefile +Makefile.in +*.lo +module.la +module.desktop diff --git a/src/modules/exebuf/Makefile.am b/src/modules/exebuf/Makefile.am new file mode 100644 index 000000000..33a01df29 --- /dev/null +++ b/src/modules/exebuf/Makefile.am @@ -0,0 +1,31 @@ +MAINTAINERCLEANFILES = Makefile.in +MODULE = exebuf + +# data files for the module +filesdir = $(libdir)/enlightenment/modules/$(MODULE) +files_DATA = \ +e-module-$(MODULE).edj module.desktop + +EXTRA_DIST = $(files_DATA) + +# the module .so file +INCLUDES = -I. \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src/modules/$(MODULE) \ + -I$(top_srcdir)/src/bin \ + -I$(top_srcdir)/src/lib \ + -I$(top_srcdir)/src/modules \ + @e_cflags@ +pkgdir = $(libdir)/enlightenment/modules/$(MODULE)/$(MODULE_ARCH) +pkg_LTLIBRARIES = module.la +module_la_SOURCES = e_mod_main.c \ + e_mod_main.h \ + e_exebuf.c \ + e_exebuf.h + +module_la_LIBADD = @e_libs@ @dlopen_libs@ +module_la_LDFLAGS = -module -avoid-version +module_la_DEPENDENCIES = $(top_builddir)/config.h + +uninstall: + rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE) diff --git a/src/modules/exebuf/e-module-exebuf.edj b/src/modules/exebuf/e-module-exebuf.edj new file mode 100644 index 0000000000000000000000000000000000000000..7fcef53b9f95c247a1d53499ac66ae53996171b0 GIT binary patch literal 4669 zcmZ9PXEfYhyT(WFEjm%6hhPxBMGzrs1f#czUP1^_Mz0Z4L^pzjNP|l5b+rZM9p#S>0SMO zeB4}Lc>4PVNrSHoB+=Kywdno}h|1H~+1>4bHyNX^tJlXtyVq0RzX`XeUT%&-{=tE+ zZb8>;CZGQXCawcj*Pi-+0?#~s+(4lVksrtWrofDY>6v1_pQ>yOv^KhUn1WyOIcwct z>*3b<{q&vu$b#9f{ktM13`aXD!fIe#P(JJG+2y|HP=xmS!u( zmUK~eyoy1m&lx;)rnuS5@hYVuhN}Wot58jbrp|jI7`VNY{)O%-Z6P>URw_5E0aob} z{7onIw)(0Gnjty(q0J{zW7e{S74fBLFGy3yDMR*KZLQ`kgP_dZ7^n%V>N56+^J%S> z3e#7ly-UbbP1Vehh6Um<557Mp3=euFg;ho7zY$|bMT{gYF=e`K*7&do5vUf3i8O>J z43kFcv=k@T(f``J@Z#wn^Fm4blHj8m5@kj2Xs%!1f00koZQGRJ_EuXV)y^?IrwL|V zXdT(8SkYobo-_u!e=E)tzDN>pifaf~l=`S@)!Fo2jG9W^w}Zvr&5+O|en&67Eg(CD zWGM-DH9r=+yBQTy&)JCZq`L&?EJy%Iv-f8F_B>g$u_<9|NzJtbTo z+5Yo%z-!L-u}?m2B6;}M!%JudgCEf{-*B02RI9>B;wCLjp;^=4zM4<0vRezcovK&e zFBsy$fYJ+@&<#VDspd?7`g@pMIQ#Vct^Erv-n*Rsn)W1N+K*B*ye8ksgTZ(YWtxuQ zMnj*LHkzXP{mlCPoO-hezEm>wN>o0og&aSaA>o*p!DA*$NZVgMB~|dh65_2YWM~E$ zNtfpL2t1Ydt{dTB{_UK9`M(M!+Owf}^2D93iCexpR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k^`a^th#`Iz$NMF{wyEY^bbQe8cZemUtRJJ|e hYW`FuBwB*FuQ*tp?TS6$m6)h_U*W$`r6U^2`5%)^Ep-3@ literal 0 HcmV?d00001 diff --git a/src/bin/e_exebuf.c b/src/modules/exebuf/e_exebuf.c similarity index 99% rename from src/bin/e_exebuf.c rename to src/modules/exebuf/e_exebuf.c index 38365fccd..099a6130d 100644 --- a/src/bin/e_exebuf.c +++ b/src/modules/exebuf/e_exebuf.c @@ -2,6 +2,7 @@ * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 */ #include "e.h" +#include "e_mod_main.h" /* currently default bind is alt+esc buf alt+space has been suggested */ diff --git a/src/bin/e_exebuf.h b/src/modules/exebuf/e_exebuf.h similarity index 100% rename from src/bin/e_exebuf.h rename to src/modules/exebuf/e_exebuf.h diff --git a/src/modules/exebuf/e_mod_main.c b/src/modules/exebuf/e_mod_main.c new file mode 100644 index 000000000..163eaa525 --- /dev/null +++ b/src/modules/exebuf/e_mod_main.c @@ -0,0 +1,140 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#include "e.h" +#include "e_mod_main.h" + +/***************************************************************************/ +/**/ +/* actual module specifics */ + +static void _e_mod_action_exebuf_cb(E_Object *obj, const char *params); +static int _e_mod_run_defer_cb(void *data); +static void _e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi); +static void _e_mod_menu_add(void *data, E_Menu *m); + +static E_Module *conf_module = NULL; +static E_Action *act = NULL; +static E_Int_Menu_Augmentation *maug = NULL; + +/**/ +/***************************************************************************/ + +/***************************************************************************/ +/**/ + +/**/ +/***************************************************************************/ + +/***************************************************************************/ +/**/ +/* module setup */ +EAPI E_Module_Api e_modapi = +{ + E_MODULE_API_VERSION, + "Exebuf" +}; + +EAPI void * +e_modapi_init(E_Module *m) +{ + conf_module = m; + e_exebuf_init(); + /* add module supplied action */ + act = e_action_add("exebuf"); + if (act) + { + act->func.go = _e_mod_action_exebuf_cb; + e_action_predef_name_set(_("Launch"), _("Run Command Dialog"), "exebuf", + NULL, NULL, 0); + } + maug = e_int_menus_menu_augmentation_add("main/1", _e_mod_menu_add, NULL, NULL, NULL); + e_module_delayed_set(m, 1); + return m; +} + +EAPI int +e_modapi_shutdown(E_Module *m) +{ + /* remove module-supplied menu additions */ + if (maug) + { + e_int_menus_menu_augmentation_del("main/1", maug); + maug = NULL; + } + /* remove module-supplied action */ + if (act) + { + e_action_predef_name_del(_("Launch"), _("Run Command Dialog")); + e_action_del("exebuf"); + act = NULL; + } + e_exebuf_shutdown(); + conf_module = NULL; + return 1; +} + +EAPI int +e_modapi_save(E_Module *m) +{ + return 1; +} + +EAPI int +e_modapi_about(E_Module *m) +{ + e_module_dialog_show(m, + _("Enlightenment Exebuf Module"), + _("A module for executing apps just by typing names.")); + return 1; +} + +/* action callback */ +static void +_e_mod_action_exebuf_cb(E_Object *obj, const char *params) +{ + E_Zone *zone; + + if (obj) + { + if (obj->type == E_MANAGER_TYPE) + zone = e_util_zone_current_get((E_Manager *)obj); + else if (obj->type == E_CONTAINER_TYPE) + zone = e_util_zone_current_get(((E_Container *)obj)->manager); + else if (obj->type == E_ZONE_TYPE) + zone = e_util_zone_current_get(((E_Zone *)obj)->container->manager); + else + zone = e_util_zone_current_get(e_manager_current_get()); + } + zone = e_util_zone_current_get(e_manager_current_get()); + if (zone) e_exebuf_show(zone); +} + +/* menu item callback(s) */ +static int +_e_mod_run_defer_cb(void *data) +{ + E_Zone *zone; + + zone = data; + if (zone) e_exebuf_show(zone); + return 0; +} + +static void +_e_mod_run_cb(void *data, E_Menu *m, E_Menu_Item *mi) +{ + ecore_idle_enterer_add(_e_mod_run_defer_cb, m->zone); +} + +/* menu item add hook */ +static void +_e_mod_menu_add(void *data, E_Menu *m) +{ + E_Menu_Item *mi; + + mi = e_menu_item_new(m); + e_menu_item_label_set(mi, _("Run Command")); + e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); + e_menu_item_callback_set(mi, _e_mod_run_cb, NULL); +} diff --git a/src/modules/exebuf/e_mod_main.h b/src/modules/exebuf/e_mod_main.h new file mode 100644 index 000000000..7ca0fd048 --- /dev/null +++ b/src/modules/exebuf/e_mod_main.h @@ -0,0 +1,21 @@ +/* + * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2 + */ +#ifndef E_MOD_MAIN_H +#define E_MOD_MAIN_H + +#define E_TYPEDEFS 1 +#include "e_exebuf.h" + +#undef E_TYPEDEFS +#include "e_exebuf.h" + + +EAPI extern E_Module_Api e_modapi; + +EAPI void *e_modapi_init (E_Module *m); +EAPI int e_modapi_shutdown (E_Module *m); +EAPI int e_modapi_save (E_Module *m); +EAPI int e_modapi_about (E_Module *m); + +#endif diff --git a/src/modules/exebuf/module.desktop.in b/src/modules/exebuf/module.desktop.in new file mode 100644 index 000000000..f09c2f8e8 --- /dev/null +++ b/src/modules/exebuf/module.desktop.in @@ -0,0 +1,4 @@ +[Desktop Entry] +Type=Link +Name=Exebuf +Icon=e-module-exebuf