forked from enlightenment/enlightenment
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
This commit is contained in:
parent
0aeaf86749
commit
7c50b360d8
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 \
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
.deps
|
||||
.libs
|
||||
Makefile
|
||||
Makefile.in
|
||||
*.lo
|
||||
module.la
|
||||
module.desktop
|
|
@ -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)
|
Binary file not shown.
|
@ -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 */
|
||||
|
|
@ -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);
|
||||
}
|
|
@ -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
|
|
@ -0,0 +1,4 @@
|
|||
[Desktop Entry]
|
||||
Type=Link
|
||||
Name=Exebuf
|
||||
Icon=e-module-exebuf
|
Loading…
Reference in New Issue