diff options
author | Christopher Michael <cpmichael1@comcast.net> | 2010-02-19 02:59:56 +0000 |
---|---|---|
committer | Christopher Michael <cpmichael1@comcast.net> | 2010-02-19 02:59:56 +0000 |
commit | 50bac5420696d46af63a581415e651e6067f1738 (patch) | |
tree | b37c6837cd316dc87a81e92247b0c518fe17ed4e /src/modules/illume-softkey | |
parent | eedb8f75dc8461c3ef1ecbaf4dc0a8f721a01fae (diff) | |
download | enlightenment-50bac5420696d46af63a581415e651e6067f1738.tar.gz |
Ok, another stab at adding this to svn. Remove old code.
SVN revision: 46289
Diffstat (limited to 'src/modules/illume-softkey')
-rw-r--r-- | src/modules/illume-softkey/Makefile.am | 51 | ||||
-rw-r--r-- | src/modules/illume-softkey/e-module-illume-softkey.edc | 133 | ||||
-rw-r--r-- | src/modules/illume-softkey/e_mod_main.c | 76 | ||||
-rw-r--r-- | src/modules/illume-softkey/e_mod_main.h | 12 | ||||
-rw-r--r-- | src/modules/illume-softkey/e_mod_sft_win.c | 333 | ||||
-rw-r--r-- | src/modules/illume-softkey/e_mod_sft_win.h | 24 | ||||
-rw-r--r-- | src/modules/illume-softkey/images/Makefile.am | 6 | ||||
-rw-r--r-- | src/modules/illume-softkey/images/module_icon.png | bin | 2815 -> 0 bytes | |||
-rw-r--r-- | src/modules/illume-softkey/images/shelf_alt_bg.png | bin | 1232 -> 0 bytes | |||
-rw-r--r-- | src/modules/illume-softkey/images/shelf_alt_over.png | bin | 502 -> 0 bytes | |||
-rw-r--r-- | src/modules/illume-softkey/images/shelf_alt_shine.png | bin | 393 -> 0 bytes | |||
-rw-r--r-- | src/modules/illume-softkey/module.desktop.in | 6 |
12 files changed, 0 insertions, 641 deletions
diff --git a/src/modules/illume-softkey/Makefile.am b/src/modules/illume-softkey/Makefile.am deleted file mode 100644 index e9b26d9cf6..0000000000 --- a/src/modules/illume-softkey/Makefile.am +++ /dev/null @@ -1,51 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -MODULE = illume-softkey -SUBDIRS = images - -EDJE_CC = @edje_cc@ -EDJE_FLAGS = -v \ - -id $(top_srcdir)/src/modules/$(MODULE)/images \ - @EDJE_DEF@ - -# data files for the module -filesdir = $(libdir)/enlightenment/modules/$(MODULE) -files_DATA = \ - e-module-$(MODULE).edj \ - module.desktop - -EXTRA_DIST = \ - e-module-$(MODULE).edc \ - module.desktop.in - -# 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_sft_win.c \ - e_mod_sft_win.h \ - e_mod_main.c \ - e_mod_main.h - -module_la_LIBADD = @e_libs@ @dlopen_libs@ -module_la_LDFLAGS = -module -avoid-version -module_la_DEPENDENCIES = $(top_builddir)/config.h - -e-module-$(MODULE).edj: Makefile $(EXTRA_DIST) - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/src/modules/$(MODULE)/e-module-$(MODULE).edc \ - $(top_builddir)/src/modules/$(MODULE)/e-module-$(MODULE).edj - -clean-local: - rm -f *.edj - -uninstall: - rm -rf $(DESTDIR)$(libdir)/enlightenment/modules/$(MODULE) diff --git a/src/modules/illume-softkey/e-module-illume-softkey.edc b/src/modules/illume-softkey/e-module-illume-softkey.edc deleted file mode 100644 index 73d4f3ccfa..0000000000 --- a/src/modules/illume-softkey/e-module-illume-softkey.edc +++ /dev/null @@ -1,133 +0,0 @@ -collections -{ - group - { - images.image: "module_icon.png" COMP; - name: "icon"; - max: 128 128; - parts - { - part - { - name: "base"; - mouse_events: 0; - description - { - state: "default" 0.0; - aspect: 1.0 1.0; - aspect_preference: BOTH; - image.normal: "module_icon.png"; - } - } - } - } - group - { - images - { - image: "shelf_alt_bg.png" COMP; - image: "shelf_alt_over.png" COMP; - image: "shelf_alt_shine.png" COMP; - } - name: "modules/illume-softkey/window"; - parts - { - part - { - name: "base"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - color_class: "shelf_base"; - image.normal: "shelf_alt_bg.png"; - fill.smooth: 0; - } - } - part - { - name: "shine"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - image.normal: "shelf_alt_shine.png"; - rel2.relative: 1.0 0.5; - fill.smooth: 0; - } - } - part - { - name: "over"; - type: IMAGE; - mouse_events: 0; - description - { - state: "default" 0.0; - image - { - normal: "shelf_alt_over.png"; - border: 5 5 5 5; - middle: 0; - } - fill.smooth: 0; - } - } - part - { - name: "e.box.extra_buttons"; - type: BOX; - description - { - state: "default" 0.0; - rel1 - { - offset: 3 3; - to: "base"; - } - rel2 - { - relative: 0.60 1.0; - offset: 0 -4; - to: "base"; - } - box - { - layout: "horizontal"; - padding: 2 0; - align: 0.0 0.5; - min: 1 1; - } - } - } - part - { - name: "e.box.buttons"; - type: BOX; - description - { - state: "default" 0.0; - rel1 - { - relative: 1.0 0.0; - to: "e.box.extra_buttons"; - } - rel2 - { - offset: -2 -4; - to: "base"; - } - box - { - layout: "horizontal"; - padding: 2 0; - align: 1.0 0.5; - min: 1 1; - } - } - } - } - } -} diff --git a/src/modules/illume-softkey/e_mod_main.c b/src/modules/illume-softkey/e_mod_main.c deleted file mode 100644 index 0be948f570..0000000000 --- a/src/modules/illume-softkey/e_mod_main.c +++ /dev/null @@ -1,76 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" -#include "e_mod_sft_win.h" - -/* local variables */ -static Eina_List *swins = NULL; - -/* external variables */ -const char *_sft_mod_dir = NULL; - -EAPI E_Module_Api e_modapi = { E_MODULE_API_VERSION, "Illume-Softkey" }; - -EAPI void * -e_modapi_init(E_Module *m) -{ - E_Manager *man; - Eina_List *ml; - - /* set module priority so we load before others */ - e_module_priority_set(m, 85); - - /* set module directory variable */ - _sft_mod_dir = eina_stringshare_add(m->dir); - - /* loop through the managers (root windows) */ - EINA_LIST_FOREACH(e_manager_list(), ml, man) - { - E_Container *con; - Eina_List *cl; - - /* loop through containers */ - EINA_LIST_FOREACH(man->containers, cl, con) - { - E_Zone *zone; - Eina_List *zl; - - /* for each zone, create a softkey window */ - EINA_LIST_FOREACH(con->zones, zl, zone) - { - Sft_Win *swin; - - /* try to create new softkey window */ - if (!(swin = e_mod_sft_win_new(zone))) continue; - swins = eina_list_append(swins, swin); - } - } - } - - return m; -} - -EAPI int -e_modapi_shutdown(E_Module *m) -{ - Sft_Win *swin; - - /* destroy the softkey windows */ - EINA_LIST_FREE(swins, swin) - e_object_del(E_OBJECT(swin)); - - /* reset softkey geometry for conformant apps */ - ecore_x_e_illume_softkey_geometry_set(ecore_x_window_root_first_get(), - 0, 0, 0, 0); - - /* clear module directory variable */ - if (_sft_mod_dir) eina_stringshare_del(_sft_mod_dir); - _sft_mod_dir = NULL; - - return 1; -} - -EAPI int -e_modapi_save(E_Module *m) -{ - return 1; -} diff --git a/src/modules/illume-softkey/e_mod_main.h b/src/modules/illume-softkey/e_mod_main.h deleted file mode 100644 index 78ba22502c..0000000000 --- a/src/modules/illume-softkey/e_mod_main.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef E_MOD_MAIN_H -# define E_MOD_MAIN_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); - -extern const char *_sft_mod_dir; - -#endif diff --git a/src/modules/illume-softkey/e_mod_sft_win.c b/src/modules/illume-softkey/e_mod_sft_win.c deleted file mode 100644 index 72aec35698..0000000000 --- a/src/modules/illume-softkey/e_mod_sft_win.c +++ /dev/null @@ -1,333 +0,0 @@ -#include "e.h" -#include "e_mod_main.h" -#include "e_mod_sft_win.h" - -/* local function prototypes */ -static void _e_mod_sft_win_cb_free(Sft_Win *swin); -static void _e_mod_sft_win_cb_hook_eval_end(void *data, void *data2); -static int _e_mod_sft_win_cb_win_prop(void *data, int type __UNUSED__, void *event); -static int _e_mod_sft_win_cb_client_message(void *data, int type __UNUSED__, void *event); -static void _e_mod_sft_win_cb_resize(E_Win *win); -static void _e_mod_sft_win_create_default_buttons(Sft_Win *swin); -static void _e_mod_sft_win_cb_close(void *data, void *data2 __UNUSED__); -static void _e_mod_sft_win_cb_back(void *data, void *data2 __UNUSED__); - -Sft_Win * -e_mod_sft_win_new(E_Zone *zone) -{ - Sft_Win *swin; - Ecore_X_Window_State states[2]; - - /* create our new softkey window object */ - swin = E_OBJECT_ALLOC(Sft_Win, SFT_WIN_TYPE, _e_mod_sft_win_cb_free); - if (!swin) return NULL; - - swin->zone = zone; - - /* hook into eval so we can set the softkey on the correct zone - swin->hook = e_border_hook_add(E_BORDER_HOOK_EVAL_END, - _e_mod_sft_win_cb_hook_eval_end, swin); -*/ - - /* hook into property change so we can adjust w/ e_scale */ - swin->scale_hdl = - ecore_event_handler_add(ECORE_X_EVENT_WINDOW_PROPERTY, - _e_mod_sft_win_cb_win_prop, swin); - - /* hook into client messages - swin->msg_hdl = - ecore_event_handler_add(ECORE_X_EVENT_CLIENT_MESSAGE, - _e_mod_sft_win_cb_client_message, swin); - */ - - /* create new window */ - swin->win = e_win_new(zone->container); - swin->win->data = swin; - - /* set some properties on the window */ - e_win_title_set(swin->win, _("Illume Softkey")); - e_win_name_class_set(swin->win, "Illume-Softkey", "Illume-Softkey"); - e_win_no_remember_set(swin->win, EINA_TRUE); - - /* hook into window resize so we can resize our objects */ - e_win_resize_callback_set(swin->win, _e_mod_sft_win_cb_resize); - - /* set this window to not show in taskbar or pager */ - states[0] = ECORE_X_WINDOW_STATE_SKIP_TASKBAR; - states[1] = ECORE_X_WINDOW_STATE_SKIP_PAGER; - ecore_x_netwm_window_state_set(swin->win->evas_win, states, 2); - - /* set this window to not accept or take focus */ - ecore_x_icccm_hints_set(swin->win->evas_win, 0, 0, 0, 0, 0, 0, 0); - - /* create our base object */ - swin->o_base = edje_object_add(swin->win->evas); - if (!e_theme_edje_object_set(swin->o_base, - "base/theme/modules/illume-softkey", - "modules/illume-softkey/window")) - { - char buff[PATH_MAX]; - - snprintf(buff, sizeof(buff), - "%s/e-module-illume-softkey.edj", _sft_mod_dir); - edje_object_file_set(swin->o_base, buff, - "modules/illume-softkey/window"); - } - evas_object_move(swin->o_base, 0, 0); - evas_object_show(swin->o_base); - - /* create default buttons */ - _e_mod_sft_win_create_default_buttons(swin); - - /* set minimum size of this window */ - e_win_size_min_set(swin->win, zone->w, (32 * e_scale)); - - /* position and resize this window */ - e_win_move_resize(swin->win, zone->x, (zone->y + zone->h - (32 * e_scale)), - zone->w, (32 * e_scale)); - - /* show the window */ - e_win_show(swin->win); - - e_border_zone_set(swin->win->border, zone); - - /* set this window to be a dock window. This needs to be done after show - * as E will sometimes reset the window type */ - ecore_x_netwm_window_type_set(swin->win->evas_win, ECORE_X_WINDOW_TYPE_DOCK); - - /* tell conformant apps our position and size */ - ecore_x_e_illume_softkey_geometry_set(zone->black_win, - zone->x, (zone->h - (32 * e_scale)), - zone->w, (32 * e_scale)); - - return swin; -} - -/* local functions */ -static void -_e_mod_sft_win_cb_free(Sft_Win *swin) -{ - const Evas_Object *box; - - /* delete the message handler */ - if (swin->msg_hdl) ecore_event_handler_del(swin->msg_hdl); - swin->msg_hdl = NULL; - - /* delete the scale handler */ - if (swin->scale_hdl) ecore_event_handler_del(swin->scale_hdl); - swin->scale_hdl = NULL; - - /* delete the border hook */ - if (swin->hook) e_border_hook_del(swin->hook); - swin->hook = NULL; - - if (box = edje_object_part_object_get(swin->o_base, "e.box.buttons")) - { - Evas_Object *btn; - - /* delete the buttons */ - EINA_LIST_FREE(swin->btns, btn) - { - edje_object_part_box_remove(swin->o_base, "e.box.buttons", btn); - evas_object_del(btn); - } - } - if (box = edje_object_part_object_get(swin->o_base, "e.box.extra_buttons")) - { - Evas_Object *btn; - - /* delete the buttons */ - EINA_LIST_FREE(swin->extra_btns, btn) - { - edje_object_part_box_remove(swin->o_base, "e.box.extra_buttons", btn); - evas_object_del(btn); - } - } - - /* delete the objects */ - if (swin->o_base) evas_object_del(swin->o_base); - swin->o_base = NULL; - - /* delete the window */ - if (swin->win) e_object_del(E_OBJECT(swin->win)); - swin->win = NULL; - - /* tell conformant apps our position and size */ - ecore_x_e_illume_softkey_geometry_set(swin->zone->black_win, 0, 0, 0, 0); - - /* free the allocated object */ - E_FREE(swin); -} - -static void -_e_mod_sft_win_cb_hook_eval_end(void *data, void *data2) -{ - Sft_Win *swin; - E_Border *bd; - - if (!(swin = data)) return; - if (!(bd = data2)) return; - if (bd != swin->win->border) return; - - /* check border position and size */ - if (bd->x != swin->zone->x) - { - bd->x = swin->zone->x; - bd->changes.pos = 1; - } - if (bd->y != ((swin->zone->y + swin->zone->h) - bd->h)) - { - bd->y = ((swin->zone->y + swin->zone->h) - bd->h); - bd->changes.pos = 1; - } - if (bd->w != swin->zone->w) - { - bd->w = swin->zone->w; - bd->changes.size = 1; - } - if ((bd->changes.pos) || (bd->changes.size)) bd->changed = 1; - - /* if zone is not correct, set it */ - if (bd->zone != swin->zone) e_border_zone_set(bd, swin->zone); -} - -static int -_e_mod_sft_win_cb_win_prop(void *data, int type __UNUSED__, void *event) -{ - Sft_Win *swin; - Ecore_X_Event_Window_Property *ev; - - ev = event; - - if (!(swin = data)) return 1; - if (ev->win != ecore_x_window_root_get(swin->win->evas_win)) return 1; - if (strcmp(ecore_x_atom_name_get(ev->atom), "ENLIGHTENMENT_SCALE")) return 1; - - /* set minimum size of this window */ - e_win_size_min_set(swin->win, swin->zone->w, (32 * e_scale)); - - /* resize this window */ - e_win_resize(swin->win, swin->zone->w, (32 * e_scale)); - - /* tell conformant apps our position and size */ - ecore_x_e_illume_softkey_geometry_set(swin->zone->black_win, - swin->win->x, swin->win->y, - swin->win->w, (32 * e_scale)); - return 1; -} - -static int -_e_mod_sft_win_cb_client_message(void *data, int type __UNUSED__, void *event) -{ - Sft_Win *swin; - Ecore_X_Event_Client_Message *ev; - - ev = event; - if (!(swin = data)) return 1; - if (ev->win != swin->zone->black_win) return 1; - return 1; -} - -static void -_e_mod_sft_win_cb_resize(E_Win *win) -{ - Sft_Win *swin; - Evas_Object *btn; - const Evas_Object *box; - Eina_List *l; - int mw, mh; - - if (!(swin = win->data)) return; - - /* adjust button(s) size for e_scale */ - EINA_LIST_FOREACH(swin->btns, l, btn) - { - e_widget_size_min_get(btn, &mw, &mh); - evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale)); - evas_object_resize(btn, (mw * e_scale), (mh * e_scale)); - } - - /* adjust box size for content */ - if (box = edje_object_part_object_get(swin->o_base, "e.box.buttons")) - { - evas_object_size_hint_min_get((Evas_Object *)box, &mw, &mh); - evas_object_resize((Evas_Object *)box, mw, mh); - } - - mw = mh = 0; - /* adjust button(s) size for e_scale */ - EINA_LIST_FOREACH(swin->extra_btns, l, btn) - { - e_widget_size_min_get(btn, &mw, &mh); - evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale)); - evas_object_resize(btn, (mw * e_scale), (mh * e_scale)); - } - - /* adjust box size for content */ - if (box = edje_object_part_object_get(swin->o_base, "e.box.extra_buttons")) - { - evas_object_size_hint_min_get((Evas_Object *)box, &mw, &mh); - evas_object_resize((Evas_Object *)box, mw, mh); - } - - /* resize the base object */ - if (swin->o_base) evas_object_resize(swin->o_base, win->w, win->h); -} - -static void -_e_mod_sft_win_create_default_buttons(Sft_Win *swin) -{ - Evas_Object *btn; - int mw, mh; - - /* create back button */ - btn = e_widget_button_add(swin->win->evas, _("Back"), "go-previous", - _e_mod_sft_win_cb_back, swin, NULL); - e_widget_size_min_get(btn, &mw, &mh); - evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale)); - - /* NB: this show is required when packing e_widgets into an edje box else - * the widgets do not receive any events */ - evas_object_show(btn); - - /* add button to box */ - edje_object_part_box_append(swin->o_base, "e.box.buttons", btn); - - /* add button to our list */ - swin->btns = eina_list_append(swin->btns, btn); - - - /* create close button */ - btn = e_widget_button_add(swin->win->evas, _("Close"), "window-close", - _e_mod_sft_win_cb_close, swin, NULL); - e_widget_size_min_get(btn, &mw, &mh); - evas_object_size_hint_min_set(btn, (mw * e_scale), (mh * e_scale)); - - /* NB: this show is required when packing e_widgets into an edje box else - * the widgets do not receive any events */ - evas_object_show(btn); - - /* add button to box */ - edje_object_part_box_append(swin->o_base, "e.box.buttons", btn); - - /* add button to our list */ - swin->btns = eina_list_append(swin->btns, btn); -} - -static void -_e_mod_sft_win_cb_close(void *data, void *data2 __UNUSED__) -{ - Sft_Win *swin; - - if (!(swin = data)) return; - ecore_x_e_illume_close_send(swin->zone->black_win); -} - -static void -_e_mod_sft_win_cb_back(void *data, void *data2 __UNUSED__) -{ - Sft_Win *swin; - - if (!(swin = data)) return; - ecore_x_e_illume_focus_back_send(swin->zone->black_win); -} diff --git a/src/modules/illume-softkey/e_mod_sft_win.h b/src/modules/illume-softkey/e_mod_sft_win.h deleted file mode 100644 index d481ed1f20..0000000000 --- a/src/modules/illume-softkey/e_mod_sft_win.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef E_MOD_SFT_WIN_H -# define E_MOD_SFT_WIN_H - -/* define softkey window object type */ -# define SFT_WIN_TYPE 0xE1b0784 - -/* define structure for softkey window */ -typedef struct _Sft_Win Sft_Win; -struct _Sft_Win -{ - E_Object e_obj_inherit; - - E_Zone *zone; - E_Border_Hook *hook; - Ecore_Event_Handler *scale_hdl, *msg_hdl; - - E_Win *win; - Evas_Object *o_base; - Eina_List *btns, *extra_btns; -}; - -Sft_Win *e_mod_sft_win_new(E_Zone *zone); - -#endif diff --git a/src/modules/illume-softkey/images/Makefile.am b/src/modules/illume-softkey/images/Makefile.am deleted file mode 100644 index e6de6fd76f..0000000000 --- a/src/modules/illume-softkey/images/Makefile.am +++ /dev/null @@ -1,6 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in - -EXTRA_DIST = shelf_alt_bg.png \ - shelf_alt_shine.png \ - module_icon.png \ - shelf_alt_over.png diff --git a/src/modules/illume-softkey/images/module_icon.png b/src/modules/illume-softkey/images/module_icon.png Binary files differdeleted file mode 100644 index 82c1b76f30..0000000000 --- a/src/modules/illume-softkey/images/module_icon.png +++ /dev/null diff --git a/src/modules/illume-softkey/images/shelf_alt_bg.png b/src/modules/illume-softkey/images/shelf_alt_bg.png Binary files differdeleted file mode 100644 index 64e2b2c2c3..0000000000 --- a/src/modules/illume-softkey/images/shelf_alt_bg.png +++ /dev/null diff --git a/src/modules/illume-softkey/images/shelf_alt_over.png b/src/modules/illume-softkey/images/shelf_alt_over.png Binary files differdeleted file mode 100644 index cef17132f1..0000000000 --- a/src/modules/illume-softkey/images/shelf_alt_over.png +++ /dev/null diff --git a/src/modules/illume-softkey/images/shelf_alt_shine.png b/src/modules/illume-softkey/images/shelf_alt_shine.png Binary files differdeleted file mode 100644 index 5c0588d8b8..0000000000 --- a/src/modules/illume-softkey/images/shelf_alt_shine.png +++ /dev/null diff --git a/src/modules/illume-softkey/module.desktop.in b/src/modules/illume-softkey/module.desktop.in deleted file mode 100644 index 1ae0e2f08a..0000000000 --- a/src/modules/illume-softkey/module.desktop.in +++ /dev/null @@ -1,6 +0,0 @@ -[Desktop Entry] -Type=Link -Name=Illume-Softkey -Icon=e-module-illume-softkey -X-Enlightenment-ModuleType=system -Comment=<title>Illume Softkey for Embedded</title> |