Enlightenment CVS committal Author : onefang Project : misc Module : engage
Dir : misc/engage/src Modified Files: e_apps.c main.c Log Message: Patch it up to bring it in to sync with E17's .desktop icon code. Really should be synced in full though. =================================================================== RCS file: /cvs/e/misc/engage/src/e_apps.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -3 -r1.7 -r1.8 --- e_apps.c 3 Sep 2006 15:14:51 -0000 1.7 +++ e_apps.c 3 Sep 2006 19:08:04 -0000 1.8 @@ -53,7 +53,7 @@ static int _e_app_is_eapp (const char *path); static int _e_app_copy (E_App *dst, E_App *src); static void _e_app_save_order (E_App *app); -static int _e_app_cb_event_border_add(void *data, int type, void *event); +//static int _e_app_cb_event_border_add(void *data, int type, void *event); static int _e_app_cb_expire_timer (void *data); static void _e_app_cache_copy (E_App_Cache *ac, E_App *a); static int _e_app_cb_scan_cache_timer(void *data); @@ -1154,13 +1154,12 @@ } if (!path) path = a->path; - ext = strchr(path, '.'); + ext = strrchr(path, '.'); if ((ext) && (strcmp(ext, ".desktop") == 0)) { /* It's a .desktop file. */ Ecore_Desktop *desktop; desktop = ecore_desktop_get(path, lang); - if (!desktop) return; if (desktop) { if (desktop->name) a->name = evas_stringshare_add(desktop->name); @@ -1169,19 +1168,11 @@ if (desktop->exec) a->exe = evas_stringshare_add(desktop->exec); if (desktop->icon_class) a->icon_class = evas_stringshare_add(desktop->icon_class); + if (desktop->icon_path) a->icon_path = evas_stringshare_add(desktop->icon_path); if (desktop->window_class) a->win_class = evas_stringshare_add(desktop->window_class); if (desktop->startup) a->startup_notify = *(desktop->startup); - if (desktop->icon) - { - /* FIXME: Should do this only when needed, is it can be expensive. */ - /* FIXME: Use a real icon size. */ - v = (char *) ecore_desktop_icon_find(desktop->icon, NULL, NULL);//e_config->icon_theme); - if (v) - a->icon_path = evas_stringshare_add(v); - } - // if (desktop->type) a->type = evas_stringshare_add(desktop->type); // if (desktop->categories) a->categories = evas_stringshare_add(desktop->categories); } @@ -1506,27 +1497,63 @@ return ok; } +static Evas_Object * +_e_app_icon_path_add(Evas *evas, E_App *a) +{ + Evas_Object *o; + char *ext; + + o = e_icon_add(evas); + ext = strrchr(a->icon_path, '.'); + if (ext) + { + if (strcmp(ext, ".edj") == 0) + e_icon_file_edje_set(o, a->icon_path, "icon"); + else + e_icon_file_set(o, a->icon_path); + } + else + e_icon_file_set(o, a->icon_path); + e_icon_fill_inside_set(o, 1); + + return o; +} + EAPI Evas_Object * e_app_icon_add(Evas *evas, E_App *a) { - Evas_Object *o; + Evas_Object *o = NULL; - o = edje_object_add(evas); -// if (!e_util_edje_icon_list_set(o, a->icon_class)) -// { - if (edje_object_file_set(o, a->path, "icon")) - { - ; /* It's a bit more obvious this way. */ - } - else if (a->icon_path) /* If that fails, then this might be an FDO icon. */ - { - /* Free the aborted object first. */ - if (o) evas_object_del(o); - o = e_icon_add(evas); - e_icon_file_set(o, a->icon_path); - e_icon_fill_inside_set(o, 1); - } -// } + if ((a->icon_path) && (a->icon_path[0] != 0)) + o = _e_app_icon_path_add(evas, a); + else + { + o = edje_object_add(evas); +// if (!e_util_edje_icon_list_set(o, a->icon_class)) +// { + if (edje_object_file_set(o, a->path, "icon")) + { + ; /* It's a bit more obvious this way. */ + } + else if (a->icon_class) /* If that fails, then this might be an FDO icon. */ + { + char *v; + + /* FIXME: Use a real icon size. */ +// v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, e_config->icon_theme); + v = (char *) ecore_desktop_icon_find(a->icon_class, NULL, NULL); + if (v) + a->icon_path = evas_stringshare_add(v); + } + + if (a->icon_path) + { + /* Free the aborted object first. */ + if (o) evas_object_del(o); + o = _e_app_icon_path_add(evas, a); + } +// } + } return o; } =================================================================== RCS file: /cvs/e/misc/engage/src/main.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -3 -r1.15 -r1.16 --- main.c 3 Sep 2006 15:14:51 -0000 1.15 +++ main.c 3 Sep 2006 19:08:04 -0000 1.16 @@ -23,9 +23,22 @@ if((ecore_init()) == 0) { exit(0); } - + + if((ecore_file_init()) == 0) { + ecore_shutdown(); + exit(0); + } + + if((ecore_desktop_init()) == 0) { + ecore_file_shutdown(); + ecore_shutdown(); + exit(0); + } + if((ecore_config_init("engage")) == ECORE_CONFIG_ERR_FAIL) { ecore_x_shutdown(); + ecore_desktop_shutdown(); + ecore_file_shutdown(); ecore_shutdown(); exit(0); } @@ -34,11 +47,15 @@ if (od_config_init() != ECORE_CONFIG_PARSE_CONTINUE) { ecore_config_shutdown(); ecore_x_shutdown(); + ecore_desktop_shutdown(); + ecore_file_shutdown(); ecore_shutdown(); exit(0); } if((ecore_x_init(NULL)) == 0) { + ecore_desktop_shutdown(); + ecore_file_shutdown(); ecore_shutdown(); exit(0); } @@ -78,6 +95,8 @@ ecore_config_save(); ecore_config_shutdown(); ecore_x_shutdown(); + ecore_desktop_shutdown(); + ecore_file_shutdown(); ecore_shutdown(); return 0; ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs