From: Gustavo Sverzut Barbieri Date: Sun, 13 Nov 2011 00:07:35 +0000 (+0000) Subject: everything: gadget icon and minor cleanups. X-Git-Tag: submit/efl/20131021.015651~5386 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b4572fddde57eca599e825479b9c8f0f3a80d1af;p=platform%2Fupstream%2Fenlightenment.git everything: gadget icon and minor cleanups. SVN revision: 65111 --- diff --git a/src/modules/everything/Makefile.am b/src/modules/everything/Makefile.am index f355d06..cd977b4 100644 --- a/src/modules/everything/Makefile.am +++ b/src/modules/everything/Makefile.am @@ -4,7 +4,9 @@ MODULE = everything # data files for the module filesdir = $(libdir)/enlightenment/modules/$(MODULE) files_DATA = \ -e-module-$(MODULE).edj module.desktop +e-module-$(MODULE).edj \ +e-module-$(MODULE)-start.edj \ +module.desktop EXTRA_DIST = $(files_DATA) everything.pc.in module.desktop.in diff --git a/src/modules/everything/e-module-everything-start.edj b/src/modules/everything/e-module-everything-start.edj new file mode 100644 index 0000000..57abea3 Binary files /dev/null and b/src/modules/everything/e-module-everything-start.edj differ diff --git a/src/modules/everything/e_mod_main.c b/src/modules/everything/e_mod_main.c index 26a9f7f..14e4625 100644 --- a/src/modules/everything/e_mod_main.c +++ b/src/modules/everything/e_mod_main.c @@ -22,6 +22,7 @@ static int _e_module_evry_log_dom = -1; Evry_API *evry = NULL; Evry_Config *evry_conf = NULL; int _evry_events[NUM_EVRY_EVENTS]; +E_Module *_mod_evry = NULL; /* module setup */ EAPI E_Module_Api e_modapi = @@ -47,6 +48,8 @@ e_modapi_init(E_Module *m) return NULL; } + _mod_evry = m; + /* add module supplied action */ act = e_action_add("everything"); if (act) @@ -243,6 +246,8 @@ e_modapi_shutdown(E_Module *m __UNUSED__) printf("%d %s\n", it->ref, it->label); #endif + _mod_evry = NULL; + return 1; } diff --git a/src/modules/everything/e_mod_main.h b/src/modules/everything/e_mod_main.h index 1175ab1..be435d7 100644 --- a/src/modules/everything/e_mod_main.h +++ b/src/modules/everything/e_mod_main.h @@ -348,6 +348,7 @@ extern Evry_API *evry; extern Evry_History *evry_hist; extern Evry_Config *evry_conf; extern int _evry_events[NUM_EVRY_EVENTS]; +extern E_Module *_mod_evry; /*** E Module ***/ EAPI void *e_modapi_init (E_Module *m); diff --git a/src/modules/everything/evry_gadget.c b/src/modules/everything/evry_gadget.c index 7650ef9..58fa15a 100644 --- a/src/modules/everything/evry_gadget.c +++ b/src/modules/everything/evry_gadget.c @@ -56,7 +56,7 @@ static const E_Gadcon_Client_Class _gadcon_class = }; static Eina_Bool -_illume_running() +_illume_running(void) { /* hack to find out out if illume is running, dont grab if this is the case... */ @@ -173,14 +173,14 @@ _gc_label(E_Gadcon_Client_Class *client_class __UNUSED__) static Evas_Object * _gc_icon(E_Gadcon_Client_Class *client_class __UNUSED__, Evas *evas __UNUSED__) { - /* Evas_Object *o; */ - /* char buf[4096]; - * - * o = edje_object_add(evas); - * snprintf(buf, sizeof(buf), "%s/e-module-start.edj", - * e_module_dir_get(start_module)); - * edje_object_file_set(o, buf, "icon"); */ - return NULL; + Evas_Object *o; + char buf[PATH_MAX]; + + o = edje_object_add(evas); + snprintf(buf, sizeof(buf), "%s/e-module-everything-start.edj", + e_module_dir_get(_mod_evry)); + edje_object_file_set(o, buf, "icon"); + return o; } static Gadget_Config * @@ -203,10 +203,7 @@ _conf_item_get(const char *id) static const char * _gc_id_new(E_Gadcon_Client_Class *client_class __UNUSED__) { - Gadget_Config *gc = NULL; - - gc = _conf_item_get(NULL); - + Gadget_Config *gc = _conf_item_get(NULL); return gc->id; } diff --git a/src/modules/everything/evry_util.c b/src/modules/everything/evry_util.c index 08de4cf..7b35c71 100644 --- a/src/modules/everything/evry_util.c +++ b/src/modules/everything/evry_util.c @@ -445,13 +445,17 @@ evry_util_icon_get(Evry_Item *it, Evas *e) Evas_Object *o = NULL; if (it->icon_get) - o = it->icon_get(it, e); - if (o) return o; + { + o = it->icon_get(it, e); + if (o) return o; + } if ((it->icon) && (it->icon[0] == '/')) - o = evry_icon_theme_get(it->icon, e); - if (o) return o; - + { + o = evry_icon_theme_get(it->icon, e); + if (o) return o; + } + if (CHECK_TYPE(it, EVRY_TYPE_FILE)) { const char *icon; @@ -460,8 +464,10 @@ evry_util_icon_get(Evry_Item *it, Evas *e) GET_FILE(file, it); if (it->browseable) - o = evry_icon_theme_get("folder", e); - if (o) return o; + { + o = evry_icon_theme_get("folder", e); + if (o) return o; + } if ((!it->icon) && (file->mime) && (/*(!strncmp(file->mime, "image/", 6)) || */ @@ -512,15 +518,18 @@ evry_util_icon_get(Evry_Item *it, Evas *e) } if (it->icon) - o = evry_icon_theme_get(it->icon, e); - if (o) return o; - + { + o = evry_icon_theme_get(it->icon, e); + if (o) return o; + } + if (it->browseable) - o = evry_icon_theme_get("folder", e); - if (o) return o; + { + o = evry_icon_theme_get("folder", e); + if (o) return o; + } o = evry_icon_theme_get("unknown", e); - return o; }