diff --git a/TODO b/TODO index b9e44738c..36ba6ba2f 100644 --- a/TODO +++ b/TODO @@ -167,8 +167,6 @@ Some of the things (in very short form) that need to be done to E17... locale+encoding) * add input method selector stuff to eapp - same as locale * "run command" typebuffer thing -* icons should be able to be overidden from the theme (eapp and menu stuff - etc.) * setup configs for gnome and kde (as options) if they are installed (eg run gnome-settings-daemon). * check evas has eet support early on. diff --git a/configure.in b/configure.in index 90069cba1..6ce1f665f 100644 --- a/configure.in +++ b/configure.in @@ -258,8 +258,6 @@ data/init/Makefile data/init/images/Makefile data/themes/Makefile data/themes/images/Makefile -data/icons/Makefile -data/icons/images/Makefile data/other/Makefile data/xsession/Makefile data/xsession/enlightenment.desktop diff --git a/data/Makefile.am b/data/Makefile.am index 6e6dccf8b..8c8db8405 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,3 +1,3 @@ MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = fonts images init themes icons other xsession +SUBDIRS = fonts images init themes other xsession diff --git a/data/icons/.cvsignore b/data/icons/.cvsignore deleted file mode 100644 index 89cafbeaf..000000000 --- a/data/icons/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile.in -Makefile -default.edj diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am deleted file mode 100644 index 38427be1c..000000000 --- a/data/icons/Makefile.am +++ /dev/null @@ -1,24 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -SUBDIRS = images - -EDJE_CC = @edje_cc@ -EDJE_FLAGS = \ --v \ --id $(top_srcdir)/data/icons/images \ --fd $(top_srcdir)/data/fonts \ -@EDJE_DEF@ - -filesdir = $(datadir)/enlightenment/data/icons -files_DATA = \ -default.edj - -EXTRA_DIST = default.edc - -default.edj: Makefile default.edc - $(EDJE_CC) $(EDJE_FLAGS) \ - $(top_srcdir)/data/icons/default.edc \ - $(top_builddir)/data/icons/default.edj - -clean-local: - rm -f *.edj - diff --git a/data/icons/default.edc b/data/icons/default.edc deleted file mode 100644 index f772dd372..000000000 --- a/data/icons/default.edc +++ /dev/null @@ -1,396 +0,0 @@ -images { - image: "e_0.png" LOSSY 90; - image: "e_glow_0.png" LOSSY 90; - - image: "power_button_0.png" LOSSY 90; - image: "power_button_glow_0.png" LOSSY 90; - - image: "reset_button_0.png" LOSSY 90; - image: "reset_button_glow_0.png" LOSSY 90; - - image: "theme_0.png" LOSSY 90; - image: "theme_glow_0.png" LOSSY 90; - - image: "windows.png" LOSSY 90; - - image: "module.png" LOSSY 90; - - image: "favorites.png" LOSSY 90; - - image: "desktop.png" LOSSY 90; - - image: "gadget.png" LOSSY 90; - - image: "configuration.png" LOSSY 90; - image: "run.png" LOSSY 90; -} - -collections { - group { - name: "e"; - max: 64 64; - parts { - part { - name: "e"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "e_0.png"; - } - } - } - part { - name: "e_glow"; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { - to: "e"; - } - rel2 { - to: "e"; - } - color: 255 255 255 0; - image { - normal: "e_glow_0.png"; - } - } - description { - state: "hilited" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "e_in"; - signal: "active"; - source: ""; - action: STATE_SET "hilited" 0.0; - transition: LINEAR 0.5; - target: "e_glow"; - } - program { - name: "e_out"; - signal: "passive"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "e_glow"; - } - } - } - group { - name: "power"; - max: 64 64; - parts { - part { - name: "power_button"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "power_button_0.png"; - } - } - } - part { - name: "power_button_glow"; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { - to: "power_button"; - } - rel2 { - to: "power_button"; - } - color: 255 255 255 0; - image { - normal: "power_button_glow_0.png"; - } - } - description { - state: "hilited" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "power_button_in"; - signal: "active"; - source: ""; - action: STATE_SET "hilited" 0.0; - transition: LINEAR 0.5; - target: "power_button_glow"; - } - program { - name: "power_button_out"; - signal: "passive"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "power_button_glow"; - } - } - } - group { - name: "reset"; - max: 64 64; - parts { - part { - name: "reset_button"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "reset_button_0.png"; - } - } - } - part { - name: "reset_button_glow"; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { - to: "reset_button"; - } - rel2 { - to: "reset_button"; - } - color: 255 255 255 0; - image { - normal: "reset_button_glow_0.png"; - } - } - description { - state: "hilited" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "reset_button_in"; - signal: "active"; - source: ""; - action: STATE_SET "hilited" 0.0; - transition: LINEAR 0.5; - target: "reset_button_glow"; - } - program { - name: "reset_button_out"; - signal: "passive"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "reset_button_glow"; - } - } - } - group { - name: "theme"; - max: 64 64; - parts { - part { - name: "theme_button"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "theme_0.png"; - } - } - } - part { - name: "theme_button_glow"; - mouse_events: 0; - description { - state: "default" 0.0; - visible: 0; - rel1 { - to: "theme_button"; - } - rel2 { - to: "theme_button"; - } - color: 255 255 255 0; - image { - normal: "theme_glow_0.png"; - } - } - description { - state: "hilited" 0.0; - inherit: "default" 0.0; - visible: 1; - color: 255 255 255 255; - } - } - } - programs { - program { - name: "theme_button_in"; - signal: "active"; - source: ""; - action: STATE_SET "hilited" 0.0; - transition: LINEAR 0.5; - target: "theme_button_glow"; - } - program { - name: "theme_button_out"; - signal: "passive"; - source: ""; - action: STATE_SET "default" 0.0; - transition: LINEAR 0.5; - target: "theme_button_glow"; - } - } - } - group { - name: "windows"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "windows.png"; - } - } - } - } - } - group { - name: "module"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "module.png"; - } - } - } - } - } - group { - name: "favorites"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "favorites.png"; - } - } - } - } - } - group { - name: "desktops"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "desktop.png"; - } - } - } - } - } - group { - name: "gadgets"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "gadget.png"; - } - } - } - } - } - group { - name: "configuration"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "configuration.png"; - } - } - } - } - } - group { - name: "run"; - max: 64 64; - parts { - part { - name: "icon"; - mouse_events: 0; - description { - state: "default" 0.0; - aspect: 1.0 1.0; - max: 64 64; - image { - normal: "run.png"; - } - } - } - } - } - -} diff --git a/data/icons/images/.cvsignore b/data/icons/images/.cvsignore deleted file mode 100644 index 3dda72986..000000000 --- a/data/icons/images/.cvsignore +++ /dev/null @@ -1,2 +0,0 @@ -Makefile.in -Makefile diff --git a/data/icons/images/Makefile.am b/data/icons/images/Makefile.am deleted file mode 100644 index 2ea665028..000000000 --- a/data/icons/images/Makefile.am +++ /dev/null @@ -1,17 +0,0 @@ -MAINTAINERCLEANFILES = Makefile.in -EXTRA_DIST = \ -e_0.png \ -e_glow_0.png \ -power_button_0.png \ -power_button_glow_0.png \ -reset_button_0.png \ -reset_button_glow_0.png \ -theme_0.png \ -theme_glow_0.png \ -windows.png \ -module.png \ -favorites.png \ -desktop.png \ -gadget.png \ -configuration.png \ -run.png diff --git a/data/icons/images/run.png b/data/icons/images/run.png deleted file mode 100644 index 791c5007e..000000000 Binary files a/data/icons/images/run.png and /dev/null differ diff --git a/data/icons/images/theme_0.png b/data/icons/images/theme_0.png deleted file mode 100644 index e0fa8c91d..000000000 Binary files a/data/icons/images/theme_0.png and /dev/null differ diff --git a/data/icons/images/theme_glow_0.png b/data/icons/images/theme_glow_0.png deleted file mode 100644 index e061bd91e..000000000 Binary files a/data/icons/images/theme_glow_0.png and /dev/null differ diff --git a/data/themes/Makefile.am b/data/themes/Makefile.am index 7ec63eabb..1cd1edf53 100644 --- a/data/themes/Makefile.am +++ b/data/themes/Makefile.am @@ -32,7 +32,8 @@ default_start.edc \ default_winlist.edc \ default_transitions.edc \ default_dialog.edc \ -default_desktopname.edc +default_desktopname.edc \ +default_icons.edc default.edj: Makefile $(EXTRA_DIST) $(EDJE_CC) $(EDJE_FLAGS) \ diff --git a/data/themes/default.edc b/data/themes/default.edc index c7d32c685..a0e8e5da9 100644 --- a/data/themes/default.edc +++ b/data/themes/default.edc @@ -41,5 +41,6 @@ collections { #include "default_transitions.edc" #include "default_dialog.edc" #include "default_desktopname.edc" +#include "default_icons.edc" } diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index 7d1fa95eb..20b76974b 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -290,5 +290,20 @@ e17_cpufreq_cpu2.png \ e17_winlist_top.png \ e17_winlist_bottom.png \ e17_pager_window_shaded.png \ -e17_transition_vswipe_gap.png +e17_transition_vswipe_gap.png \ +e17_icon_configuration.png \ +e17_icon_desktop.png \ +e17_icon_e_0.png \ +e17_icon_e_glow_0.png \ +e17_icon_favorites.png \ +e17_icon_gadget.png \ +e17_icon_module.png \ +e17_icon_power_button_0.png \ +e17_icon_power_button_glow_0.png \ +e17_icon_reset_button_0.png \ +e17_icon_reset_button_glow_0.png \ +e17_icon_run.png \ +e17_icon_theme_0.png \ +e17_icon_theme_glow_0.png \ +e17_icon_windows.png diff --git a/data/icons/images/configuration.png b/data/themes/images/e17_icon_configuration.png similarity index 59% rename from data/icons/images/configuration.png rename to data/themes/images/e17_icon_configuration.png index f867b54ee..4d4f71349 100644 Binary files a/data/icons/images/configuration.png and b/data/themes/images/e17_icon_configuration.png differ diff --git a/data/icons/images/desktop.png b/data/themes/images/e17_icon_desktop.png similarity index 100% rename from data/icons/images/desktop.png rename to data/themes/images/e17_icon_desktop.png diff --git a/data/icons/images/e_0.png b/data/themes/images/e17_icon_e_0.png similarity index 100% rename from data/icons/images/e_0.png rename to data/themes/images/e17_icon_e_0.png diff --git a/data/icons/images/e_glow_0.png b/data/themes/images/e17_icon_e_glow_0.png similarity index 100% rename from data/icons/images/e_glow_0.png rename to data/themes/images/e17_icon_e_glow_0.png diff --git a/data/icons/images/favorites.png b/data/themes/images/e17_icon_favorites.png similarity index 100% rename from data/icons/images/favorites.png rename to data/themes/images/e17_icon_favorites.png diff --git a/data/icons/images/gadget.png b/data/themes/images/e17_icon_gadget.png similarity index 100% rename from data/icons/images/gadget.png rename to data/themes/images/e17_icon_gadget.png diff --git a/data/icons/images/module.png b/data/themes/images/e17_icon_module.png similarity index 100% rename from data/icons/images/module.png rename to data/themes/images/e17_icon_module.png diff --git a/data/icons/images/power_button_0.png b/data/themes/images/e17_icon_power_button_0.png similarity index 100% rename from data/icons/images/power_button_0.png rename to data/themes/images/e17_icon_power_button_0.png diff --git a/data/icons/images/power_button_glow_0.png b/data/themes/images/e17_icon_power_button_glow_0.png similarity index 100% rename from data/icons/images/power_button_glow_0.png rename to data/themes/images/e17_icon_power_button_glow_0.png diff --git a/data/icons/images/reset_button_0.png b/data/themes/images/e17_icon_reset_button_0.png similarity index 100% rename from data/icons/images/reset_button_0.png rename to data/themes/images/e17_icon_reset_button_0.png diff --git a/data/icons/images/reset_button_glow_0.png b/data/themes/images/e17_icon_reset_button_glow_0.png similarity index 100% rename from data/icons/images/reset_button_glow_0.png rename to data/themes/images/e17_icon_reset_button_glow_0.png diff --git a/data/themes/images/e17_icon_run.png b/data/themes/images/e17_icon_run.png new file mode 100644 index 000000000..228003948 Binary files /dev/null and b/data/themes/images/e17_icon_run.png differ diff --git a/data/themes/images/e17_icon_theme_0.png b/data/themes/images/e17_icon_theme_0.png new file mode 100644 index 000000000..1a70dc58f Binary files /dev/null and b/data/themes/images/e17_icon_theme_0.png differ diff --git a/data/themes/images/e17_icon_theme_glow_0.png b/data/themes/images/e17_icon_theme_glow_0.png new file mode 100644 index 000000000..5aa6349db Binary files /dev/null and b/data/themes/images/e17_icon_theme_glow_0.png differ diff --git a/data/icons/images/windows.png b/data/themes/images/e17_icon_windows.png similarity index 100% rename from data/icons/images/windows.png rename to data/themes/images/e17_icon_windows.png diff --git a/src/bin/e_apps.c b/src/bin/e_apps.c index 9a9e0633e..3ef9bc9fe 100644 --- a/src/bin/e_apps.c +++ b/src/bin/e_apps.c @@ -720,8 +720,7 @@ _e_app_free(E_App *a) _e_apps = evas_hash_del(_e_apps, a->path, a); _e_apps_list = evas_list_remove(_e_apps_list, a); _e_app_fields_empty(a); - if (a->path) - free(a->path); + IF_FREE(a->path); free(a); } } @@ -806,6 +805,15 @@ _e_app_fields_fill(E_App *a, const char *path) a->exe = str; free(v); } + v = eet_read(ef, "app/icon/class", &size); + if (v) + { + str = malloc(size + 1); + memcpy(str, v, size); + str[size] = 0; + a->icon_class = str; + free(v); + } v = eet_read(ef, "app/window/name", &size); if (v) { @@ -860,36 +868,15 @@ _e_app_fields_fill(E_App *a, const char *path) static void _e_app_fields_empty(E_App *a) { - if (a->name) - { - free(a->name); - a->name = NULL; - } - if (a->generic) - { - free(a->generic); - a->generic = NULL; - } - if (a->comment) - { - free(a->comment); - a->comment = NULL; - } - if (a->exe) - { - free(a->exe); - a->exe = NULL; - } - if (a->win_name) - { - free(a->win_name); - a->win_name = NULL; - } - if (a->win_class) - { - free(a->win_class); - a->win_class = NULL; - } + IF_FREE(a->name); + IF_FREE(a->generic); + IF_FREE(a->comment); + IF_FREE(a->exe); + IF_FREE(a->icon_class); + IF_FREE(a->win_name); + IF_FREE(a->win_class); + IF_FREE(a->win_title); + IF_FREE(a->win_role); } static Ecore_List * diff --git a/src/bin/e_apps.h b/src/bin/e_apps.h index 3d287fbc6..693a93864 100644 --- a/src/bin/e_apps.h +++ b/src/bin/e_apps.h @@ -33,12 +33,15 @@ struct _E_App char *generic; /* generic app name */ char *comment; /* a longer description */ char *exe; /* command to execute, NULL if directory */ + char *path; /* path to .eet containing icons etc. etc. */ char *win_name; /* window name */ char *win_class; /* window class */ char *win_title; /* window title */ char *win_role; /* window role */ + + char *icon_class; /* icon_class */ Evas_List *subapps; /* if this a directory, a list of more E_App's */ diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 917eb4378..1e2d3d7bd 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -1748,7 +1748,8 @@ e_border_icon_add(E_Border *bd, Evas *evas) if (a) { o = edje_object_add(evas); - edje_object_file_set(o, a->path, "icon"); + if (!e_util_edje_icon_set(o, a->icon_class)) + edje_object_file_set(o, a->path, "icon"); } } else if (bd->client.netwm.icon.data) diff --git a/src/bin/e_dnd.c b/src/bin/e_dnd.c index f8d13b4c7..83fa7eac6 100644 --- a/src/bin/e_dnd.c +++ b/src/bin/e_dnd.c @@ -811,7 +811,7 @@ _e_dnd_cb_event_dnd_selection(void *data, int type, void *event) int i, size; data = ev->data; - text = data->data; + text = (char *)data->data; size = MIN(data->length, PATH_MAX - 1); /* A moz url _shall_ contain a space */ /* FIXME: The data is two-byte unicode. Somewhere it diff --git a/src/bin/e_eapp_main.c b/src/bin/e_eapp_main.c index 9da397b61..20a97fdb0 100644 --- a/src/bin/e_eapp_main.c +++ b/src/bin/e_eapp_main.c @@ -26,6 +26,7 @@ main(int argc, char **argv) int del_win_class = 0; int del_win_title = 0; int del_win_role = 0; + int del_icon_class = 0; int del_startup_notify = 0; int del_wait_exit = 0; char *file = NULL; @@ -37,6 +38,7 @@ main(int argc, char **argv) char *set_win_class = NULL; char *set_win_title = NULL; char *set_win_role = NULL; + char *set_icon_class = NULL; int set_startup_notify = -1; int set_wait_exit = -1; int get_name = 0; @@ -47,6 +49,7 @@ main(int argc, char **argv) int get_win_class = 0; int get_win_title = 0; int get_win_role = 0; + int get_icon_class = 0; int get_startup_notify = 0; int get_wait_exit = 0; @@ -116,6 +119,13 @@ main(int argc, char **argv) valid_args++; write_ops++; } + else if ((!strcmp(argv[i], "-set-icon-class")) && (i < (argc - 1))) + { + i++; + set_icon_class = argv[i]; + valid_args++; + write_ops++; + } else if ((!strcmp(argv[i], "-set-startup-notify")) && (i < (argc - 1))) { i++; @@ -140,6 +150,7 @@ main(int argc, char **argv) del_win_class = 1; del_win_title = 1; del_win_role = 1; + del_icon_class = 1; del_startup_notify = 1; del_wait_exit = 1; valid_args++; @@ -193,6 +204,12 @@ main(int argc, char **argv) valid_args++; write_ops++; } + else if ((!strcmp(argv[i], "-del-icon-class"))) + { + del_icon_class = 1; + valid_args++; + write_ops++; + } else if ((!strcmp(argv[i], "-del-startup-notify"))) { del_startup_notify = 1; @@ -216,52 +233,57 @@ main(int argc, char **argv) else if ((!strcmp(argv[i], "-get-name"))) { get_name = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-generic"))) { get_generic = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-comment"))) { get_comment = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-exe"))) { get_exe = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-win-name"))) { get_win_name = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-win-class"))) { get_win_class = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-win-title"))) { get_win_title = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-win-role"))) { get_win_role = 1; - valid_args++; + valid_args++; + } + else if ((!strcmp(argv[i], "-get-icon-class"))) + { + get_icon_class = 1; + valid_args++; } else if ((!strcmp(argv[i], "-get-startup-notify"))) { get_startup_notify = 1; - valid_args++; + valid_args++; } else if ((!strcmp(argv[i], "-get-wait-exit"))) { get_wait_exit = 1; - valid_args++; + valid_args++; } else file = argv[i]; @@ -321,6 +343,8 @@ main(int argc, char **argv) eet_write(ef, "app/window/title", set_win_title, strlen(set_win_title), 0); if (set_win_role) eet_write(ef, "app/window/role", set_win_role, strlen(set_win_role), 0); + if (set_icon_class) + eet_write(ef, "app/icon/class", set_icon_class, strlen(set_icon_class), 0); if (set_startup_notify >= 0) { unsigned char tmp[1]; @@ -387,6 +411,8 @@ main(int argc, char **argv) eet_delete(ef, "app/window/title"); if (del_win_role) eet_delete(ef, "app/window/role"); + if (del_icon_class) + eet_delete(ef, "app/icon/class"); if (del_startup_notify) eet_delete(ef, "app/info/startup_notify"); if (del_wait_exit) @@ -511,6 +537,18 @@ main(int argc, char **argv) printf("%s\n", str); } } + if (get_icon_class) + { + v = eet_read(ef, "app/icon/class", &size); + if (v) + { + str = malloc(size + 1); + memcpy(str, v, size); + str[size] = 0; + free(v); + printf("%s\n", str); + } + } if (get_startup_notify) { v = eet_read(ef, "app/info/startup_notify", &size); @@ -571,6 +609,7 @@ _e_help(void) " -set-win-class WIN_CLASS Set the application window class glob\n" " -set-win-title WIN_TITLE Set the application window title glob\n" " -set-win-role WIN_ROLE Set the application window role glob\n" + " -set-icon-class CLASS_NAME Set the application icon class for themes\n" " -set-startup-notify [1/0] Set the application startup notify flag\n" " -set-wait-exit [1/0] Set the application wait exit flag\n" " -get-name Get the application name\n" @@ -581,6 +620,7 @@ _e_help(void) " -get-win-class Get the application window class glob\n" " -get-win-title Get the application window title glob\n" " -get-win-role Get the application window role glob\n" + " -get-icon-class Get the application icon class for themes\n" " -get-startup-notify Get the application startup notify flag\n" " -get-wait-exit Get the application wait exit flag\n" " -del-name Delete the application name\n" @@ -591,6 +631,7 @@ _e_help(void) " -del-win-class Delete the application window class\n" " -del-win-title Delete the application window title glob\n" " -del-win-role Delete the application window role glob\n" + " -del-icon-class Delete the application icon class for themes\n" " -del-startup-notify Delete the application startup notify flag\n" " -del-wait-exit Delete the application wait exit flag\n" ); diff --git a/src/bin/e_hints.c b/src/bin/e_hints.c index a382c3ea8..81dcfb05b 100644 --- a/src/bin/e_hints.c +++ b/src/bin/e_hints.c @@ -921,7 +921,7 @@ int e_hints_window_saved_size_get(E_Border *bd) { int ret; - int sizes[4]; + unsigned int sizes[4]; memset(sizes, 0, sizeof(sizes)); ret = ecore_x_window_prop_card32_get(bd->client.win, E_ATOM_SAVED_SIZE, diff --git a/src/bin/e_int_menus.c b/src/bin/e_int_menus.c index 052a6af03..367f9c406 100644 --- a/src/bin/e_int_menus.c +++ b/src/bin/e_int_menus.c @@ -54,7 +54,6 @@ e_int_menus_main_new(void) E_Menu *m, *subm; E_Menu_Item *mi; Main_Data *dat; - char *s; dat = calloc(1, sizeof(Main_Data)); m = e_menu_new(); @@ -66,9 +65,7 @@ e_int_menus_main_new(void) dat->apps = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Favorite Applications")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "favorites"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/favorites"); e_menu_item_submenu_set(mi, subm); mi = e_menu_item_new(m); @@ -78,54 +75,42 @@ e_int_menus_main_new(void) dat->modules = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Modules")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "module"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/modules"); e_menu_item_submenu_set(mi, subm); subm = e_int_menus_desktops_new(); dat->desktops = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Desktops")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "desktops"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/desktops"); e_menu_item_submenu_set(mi, subm); subm = e_int_menus_clients_new(); dat->clients = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Windows")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "windows"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/windows"); e_menu_item_submenu_set(mi, subm); subm = e_int_menus_lost_clients_new(); dat->lost_clients = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Lost Windows")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "lost_windows"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/lost_windows"); e_menu_item_submenu_set(mi, subm); subm = e_int_menus_gadgets_new(); dat->gadgets = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Gadgets")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "gadgets"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/gadgets"); e_menu_item_submenu_set(mi, subm); subm = e_int_menus_themes_new(); dat->themes = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Themes")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "theme"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/themes"); e_menu_item_submenu_set(mi, subm); mi = e_menu_item_new(m); @@ -133,18 +118,14 @@ e_int_menus_main_new(void) mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("About Enlightenment")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "e"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/e"); e_menu_item_callback_set(mi, _e_int_menus_main_about, NULL); if (ecore_file_app_installed("exige")) { mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Run Command")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "run"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/run"); e_menu_item_callback_set(mi, _e_int_menus_main_run, NULL); } @@ -152,9 +133,7 @@ e_int_menus_main_new(void) dat->config = subm; mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Configuration")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "configuration"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/configuration"); e_menu_item_submenu_set(mi, subm); mi = e_menu_item_new(m); @@ -162,16 +141,12 @@ e_int_menus_main_new(void) mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Restart Enlightenment")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "reset"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/reset"); e_menu_item_callback_set(mi, _e_int_menus_main_restart, NULL); mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Exit Enlightenment")); - s = e_path_find(path_icons, "default.edj"); - e_menu_item_icon_edje_set(mi, s, "power"); - IF_FREE(s); + e_util_menu_item_edje_icon_set(mi, "enlightenment/exit"); e_menu_item_callback_set(mi, _e_int_menus_main_exit, NULL); return m; } diff --git a/src/bin/e_theme.c b/src/bin/e_theme.c index 9915197ad..015cbf6b1 100644 --- a/src/bin/e_theme.c +++ b/src/bin/e_theme.c @@ -54,6 +54,7 @@ e_theme_init(void) * e_theme_file_set("base/theme/error", "default.edj"); * e_theme_file_set("base/theme/gadman", "default.edj"); * e_theme_file_set("base/theme/dnd", "default.edj"); + * e_theme_file_set("base/theme/icons", "default.edj"); * e_theme_file_set("base/theme/modules", "default.edj"); * e_theme_file_set("base/theme/modules/pager", "default.edj"); * e_theme_file_set("base/theme/modules/ibar", "default.edj"); diff --git a/src/bin/e_utils.c b/src/bin/e_utils.c index 2b4b4b980..83e9e31ff 100644 --- a/src/bin/e_utils.c +++ b/src/bin/e_utils.c @@ -255,3 +255,30 @@ e_util_immortal_check(void) } return 0; } + +int +e_util_edje_icon_set(Evas_Object *obj, char *name) +{ + char *file; + char buf[4096]; + + if (!name) return 0; + snprintf(buf, sizeof(buf), "icons/%s", name); + file = (char *)e_theme_edje_file_get("base/theme/icons", buf); + if (!file[0]) return; + edje_object_file_set(obj, file, buf); + return 1; +} + +void +e_util_menu_item_edje_icon_set(E_Menu_Item *mi, char *name) +{ + char *file; + char buf[4096]; + + if (!name) return; + snprintf(buf, sizeof(buf), "icons/%s", name); + file = (char *)e_theme_edje_file_get("base/theme/icons", buf); + if (!file[0]) return; + e_menu_item_icon_edje_set(mi, file, buf); +} diff --git a/src/bin/e_utils.h b/src/bin/e_utils.h index 980b2aab9..43eb613a9 100644 --- a/src/bin/e_utils.h +++ b/src/bin/e_utils.h @@ -20,6 +20,8 @@ EAPI int e_util_head_exec(int head, char *cmd); EAPI int e_util_strcmp(char *s1, char *s2); EAPI int e_util_both_str_empty(char *s1, char *s2); EAPI int e_util_immortal_check(void); +EAPI int e_util_edje_icon_set(Evas_Object *obj, char *name); +EAPI void e_util_menu_item_edje_icon_set(E_Menu_Item *mi, char *name); #endif #endif