From: Carsten Haitzler Date: Sat, 23 Apr 2005 05:16:25 +0000 (+0000) Subject: fix dropshadow bug X-Git-Tag: submit/efl/20131021.015651~16048 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9015e17739b4b768c388fbd7a43da09a97151ac9;p=platform%2Fupstream%2Fenlightenment.git fix dropshadow bug make e_theme stuff check contents of edje files for group requested, if not there, fallback fix shading of windows with shaped windows SVN revision: 14307 --- diff --git a/src/bin/e_border.c b/src/bin/e_border.c index 7bb4632..dd37eb5 100644 --- a/src/bin/e_border.c +++ b/src/bin/e_border.c @@ -810,6 +810,11 @@ e_border_shade(E_Border *bd, E_Direction dir) bd->changes.pos = 1; } + if ((bd->shaped) || (bd->client.shaped)) + { + bd->need_shape_merge = 1; + bd->need_shape_export = 1; + } bd->changes.size = 1; bd->shaded = 1; bd->changes.shaded = 1; @@ -892,6 +897,11 @@ e_border_unshade(E_Border *bd, E_Direction dir) bd->x = bd->x - bd->client.w; bd->changes.pos = 1; } + if ((bd->shaped) || (bd->client.shaped)) + { + bd->need_shape_merge = 1; + bd->need_shape_export = 1; + } bd->changes.size = 1; bd->shaded = 0; bd->changes.shaded = 1; @@ -2350,8 +2360,6 @@ _e_border_cb_grab_replay(void *data, int type, void *event) static void _e_border_eval(E_Border *bd) { - /* FIXME: get min/max/start size etc. gravity etc. */ - /* fetch any info queued to be fetched */ if (bd->client.icccm.fetch.title) { @@ -2618,7 +2626,7 @@ _e_border_eval(E_Border *bd) Evas_Coord cx, cy, cw, ch; int l, r, t, b; int ok; - + if (!bd->client.border.name) { bd->client.border.name = strdup("default"); @@ -2636,10 +2644,9 @@ _e_border_eval(E_Border *bd) } o = edje_object_add(bd->bg_evas); bd->bg_object = o; - path = e_theme_file_get("base/theme/borders"); snprintf(buf, sizeof(buf), "widgets/border/%s/border", bd->client.border.name); - ok = edje_object_file_set(o, path, buf); + ok = e_theme_edje_object_set(o, "base/theme/borders", buf); if (ok) { const char *shape_option; @@ -2674,7 +2681,7 @@ _e_border_eval(E_Border *bd) } edje_object_part_text_set(o, "title_text", -// "Japanese (hiragana): いろはにほへとちりぬるを"); +// "Japanese (hiragana): いろはにほへとちりぬるを"); bd->client.icccm.title); // printf("SET TITLE2 %s\n", bd->client.icccm.title); evas_object_resize(o, 1000, 1000); @@ -2715,7 +2722,7 @@ _e_border_eval(E_Border *bd) edje_object_signal_callback_add(o, "resize_r_start", "*", _e_border_cb_signal_resize_r_start, bd); edje_object_signal_callback_add(o, "resize_br_start", "*", - _e_border_cb_signal_resize_br_start, bd); + _e_border_cb_signal_resize_br_start, bd); edje_object_signal_callback_add(o, "resize_b_start", "*", _e_border_cb_signal_resize_b_start, bd); edje_object_signal_callback_add(o, "resize_bl_start", "*", @@ -2732,7 +2739,7 @@ _e_border_eval(E_Border *bd) evas_object_resize(o, bd->w, bd->h); evas_object_show(o); bd->client.border.changed = 0; - + if (bd->icon_object) { if (bd->bg_object) @@ -2746,7 +2753,7 @@ _e_border_eval(E_Border *bd) } } } - + if (bd->new_client) { E_Event_Border_Add *ev; @@ -3053,7 +3060,8 @@ _e_border_eval(E_Border *bd) { if ((bd->shaped) || (bd->client.shaped)) { - Ecore_X_Window twin; + Ecore_X_Window twin, twin2; + int x, y; twin = ecore_x_window_override_new(bd->win, 0, 0, bd->w, bd->h); if (bd->shaped) @@ -3071,18 +3079,41 @@ _e_border_eval(E_Border *bd) rects[1].x = 0; rects[1].y = bd->client_inset.t; rects[1].width = bd->client_inset.l; - rects[1].height = bd->client.h; + rects[1].height = bd->h - bd->client_inset.t - bd->client_inset.b; rects[2].x = bd->w - bd->client_inset.r; rects[2].y = bd->client_inset.t; rects[2].width = bd->client_inset.r; - rects[2].height = bd->client.h; + rects[2].height = bd->h - bd->client_inset.t - bd->client_inset.b; rects[3].x = 0; rects[3].y = bd->h - bd->client_inset.b; rects[3].width = bd->w; rects[3].height = bd->client_inset.b; ecore_x_window_shape_rectangles_set(twin, rects, 4); } - ecore_x_window_shape_window_add_xy(twin, bd->client.win, bd->client_inset.l, bd->client_inset.t); + /* FIXME: need to clip client shape to client container + * with offset for shading, if shading/shaded + */ + twin2 = ecore_x_window_override_new(bd->win, 0, 0, + bd->w - bd->client_inset.l - bd->client_inset.r, + bd->h - bd->client_inset.t - bd->client_inset.b); + x = 0; + y = 0; + if ((bd->shading) || (bd->shaded)) + { + if (bd->shade.dir == E_DIRECTION_UP) + y = bd->h - bd->client_inset.t - bd->client_inset.b - bd->client.h; + else if (bd->shade.dir == E_DIRECTION_LEFT) + x = bd->w - bd->client_inset.l - bd->client_inset.r - bd->client.w; + } + ecore_x_window_shape_window_set_xy(twin2, bd->client.win, + x, y); + ecore_x_window_shape_rectangle_clip(twin2, 0, 0, + bd->w - bd->client_inset.l - bd->client_inset.r, + bd->h - bd->client_inset.t - bd->client_inset.b); + ecore_x_window_shape_window_add_xy(twin, twin2, + bd->client_inset.l, + bd->client_inset.t); + ecore_x_window_del(twin2); ecore_x_window_shape_window_set(bd->win, twin); ecore_x_window_del(twin); } @@ -3369,7 +3400,11 @@ _e_border_shade_animator(void *data) bd->changes.pos = 1; } - + if ((bd->shaped) || (bd->client.shaped)) + { + bd->need_shape_merge = 1; + bd->need_shape_export = 1; + } bd->changes.size = 1; bd->changed = 1; @@ -3432,12 +3467,18 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y) mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Close")); e_menu_item_callback_set(mi, _e_border_menu_cb_close, bd); - e_menu_item_icon_edje_set(mi, e_theme_file_get("base/theme/borders"), "widgets/border/default/close"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/close"), + "widgets/border/default/close"); mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Iconify")); e_menu_item_callback_set(mi, _e_border_menu_cb_iconify, bd); - e_menu_item_icon_edje_set(mi, e_theme_file_get("base/theme/borders"), "widgets/border/default/minimize"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/minimize"), + "widgets/border/default/minimize"); mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); @@ -3447,21 +3488,30 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y) e_menu_item_check_set(mi, 1); e_menu_item_toggle_set(mi, (bd->shaded ? 1 : 0)); e_menu_item_callback_set(mi, _e_border_menu_cb_shade, bd); - e_menu_item_icon_edje_set(mi, e_theme_file_get("base/theme/borders"), "widgets/border/default/shade"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/shade"), + "widgets/border/default/shade"); mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Maximized")); e_menu_item_check_set(mi, 1); e_menu_item_toggle_set(mi, (bd->maximized ? 1 : 0)); e_menu_item_callback_set(mi, _e_border_menu_cb_maximize, bd); - e_menu_item_icon_edje_set(mi, e_theme_file_get("base/theme/borders"), "widgets/border/default/maximize"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/maximize"), + "widgets/border/default/maximize"); mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Sticky")); e_menu_item_check_set(mi, 1); e_menu_item_toggle_set(mi, (bd->sticky ? 1 : 0)); e_menu_item_callback_set(mi, _e_border_menu_cb_stick, bd); - e_menu_item_icon_edje_set(mi, e_theme_file_get("base/theme/borders"), "widgets/border/default/stick"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/stick"), + "widgets/border/default/stick"); mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); @@ -3469,7 +3519,10 @@ _e_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y) mi = e_menu_item_new(m); e_menu_item_label_set(mi, _("Send To")); e_menu_item_submenu_pre_callback_set(mi, _e_border_menu_sendto_pre_cb, bd); - e_menu_item_icon_edje_set(mi, e_path_find(path_themes, "default.edj"), "widgets/border/default/sendto"); + e_menu_item_icon_edje_set(mi, + e_theme_edje_file_get("base/theme/borders", + "widgets/border/default/sendto"), + "widgets/border/default/sendto"); mi = e_menu_item_new(m); e_menu_item_separator_set(mi, 1); @@ -3869,8 +3922,8 @@ _e_border_resize_begin(E_Border *bd) ecore_evas_show(resize_ee); resize_obj = edje_object_add(ecore_evas_get(resize_ee)); - edje_object_file_set(resize_obj, e_theme_file_get("base/theme/borders"), - "widgets/border/default/resize"); + e_theme_edje_object_set(resize_obj, "base/theme/borders", + "widgets/border/default/resize"); snprintf(buf, sizeof(buf), "9999x9999"); edje_object_part_text_set(resize_obj, "text", buf); @@ -3940,8 +3993,8 @@ _e_border_move_begin(E_Border *bd) ecore_evas_layer_set(move_ee, 255); move_obj = edje_object_add(ecore_evas_get(move_ee)); - edje_object_file_set(move_obj, e_theme_file_get("base/theme/borders"), - "widgets/border/default/move"); + e_theme_edje_object_set(move_obj, "base/theme/borders", + "widgets/border/default/move"); snprintf(buf, sizeof(buf), "9999 9999"); edje_object_part_text_set(move_obj, "text", buf); diff --git a/src/bin/e_error.c b/src/bin/e_error.c index 3cd8540..0f83665 100644 --- a/src/bin/e_error.c +++ b/src/bin/e_error.c @@ -78,10 +78,7 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt) e_pointer_ecore_evas_set(ee); o = edje_object_add(e); - if (!edje_object_file_set(o, - e_theme_file_get("base/theme/error"), - "error/main")) - + if (!e_theme_edje_object_set(o, "base/theme/error", "error/main")) { Evas_Coord tw, th; char *newstr; @@ -258,7 +255,7 @@ e_error_message_manager_show(E_Manager *man, char *title, char *txt) snprintf(format, sizeof(format), "source='%s' font='%s' size=%d wrap=word", - e_theme_file_get("base/theme/error"), + e_theme_edje_file_get("base/theme/error", "error/main"), "fonts/Edje Vera", 10); text = evas_object_textblock_add(e); evas_object_color_set(text, 0, 0, 0, 255); diff --git a/src/bin/e_gadman.c b/src/bin/e_gadman.c index 7e9e8b0..b505554 100644 --- a/src/bin/e_gadman.c +++ b/src/bin/e_gadman.c @@ -599,9 +599,8 @@ _e_gadman_client_edit_begin(E_Gadman_Client *gmc) evas_object_layer_set(gmc->control_object, 100); evas_object_move(gmc->control_object, gmc->x, gmc->y); evas_object_resize(gmc->control_object, gmc->w, gmc->h); - edje_object_file_set(gmc->control_object, - e_theme_file_get("base/theme/gadman"), - "gadman/control"); + e_theme_edje_object_set(gmc->control_object, "base/theme/gadman", + "gadman/control"); edje_object_signal_callback_add(gmc->control_object, "move_start", "", _e_gadman_cb_signal_move_start, gmc); edje_object_signal_callback_add(gmc->control_object, "move_stop", "", diff --git a/src/bin/e_menu.c b/src/bin/e_menu.c index 683d348..1fce44d 100644 --- a/src/bin/e_menu.c +++ b/src/bin/e_menu.c @@ -807,9 +807,8 @@ _e_menu_item_realize(E_Menu_Item *mi) { o = edje_object_add(mi->menu->evas); mi->separator_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/separator"); + e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/separator"); evas_object_show(o); edje_object_size_min_calc(mi->separator_object, &ww, &hh); mi->separator_w = ww; @@ -825,17 +824,15 @@ _e_menu_item_realize(E_Menu_Item *mi) if ((mi->submenu) || (mi->submenu_pre_cb.func)) { - if (!edje_object_file_set(mi->bg_object, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/submenu_bg")) + if (!e_theme_edje_object_set(mi->bg_object, "base/theme/menus", + "widgets/menu/default/submenu_bg")) goto no_submenu_item; } else { no_submenu_item: - edje_object_file_set(mi->bg_object, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/item_bg"); + e_theme_edje_object_set(mi->bg_object, "base/theme/menus", + "widgets/menu/default/item_bg"); } evas_object_show(o); @@ -851,9 +848,8 @@ _e_menu_item_realize(E_Menu_Item *mi) { o = edje_object_add(mi->menu->evas); mi->toggle_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/check"); + e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/check"); evas_object_pass_events_set(o, 1); evas_object_show(o); e_box_pack_end(mi->container_object, o); @@ -865,9 +861,8 @@ _e_menu_item_realize(E_Menu_Item *mi) { o = edje_object_add(mi->menu->evas); mi->toggle_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/radio"); + e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/radio"); evas_object_pass_events_set(o, 1); evas_object_show(o); e_box_pack_end(mi->container_object, o); @@ -888,9 +883,8 @@ _e_menu_item_realize(E_Menu_Item *mi) int icon_w, icon_h; o = edje_object_add(mi->menu->evas); - if (edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/icon")) + if (e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/icon")) { mi->icon_bg_object = o; evas_object_show(o); @@ -956,9 +950,8 @@ _e_menu_item_realize(E_Menu_Item *mi) { o = edje_object_add(mi->menu->evas); mi->label_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/label"); + e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/label"); /* default label */ edje_object_part_text_set(o, "label", mi->label); evas_object_pass_events_set(o, 1); @@ -980,9 +973,8 @@ _e_menu_item_realize(E_Menu_Item *mi) { o = edje_object_add(mi->menu->evas); mi->submenu_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/submenu"); + e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/submenu"); evas_object_pass_events_set(o, 1); evas_object_show(o); e_box_pack_end(mi->container_object, o); @@ -1052,9 +1044,8 @@ _e_menu_realize(E_Menu *m) evas_object_data_set(o, "e_menu", m); evas_object_move(o, 0, 0); evas_object_resize(o, m->cur.w, m->cur.h); - ok = edje_object_file_set(o, - e_theme_file_get("base/theme/menus"), - "widgets/menu/default/background"); + ok = e_theme_edje_object_set(o, "base/theme/menus", + "widgets/menu/default/background"); if (ok) { const char *shape_option; diff --git a/src/bin/e_theme.c b/src/bin/e_theme.c index bcc0607..5f0e42a 100644 --- a/src/bin/e_theme.c +++ b/src/bin/e_theme.c @@ -3,42 +3,37 @@ */ #include "e.h" -/* FIXME: need to make wrapper that can not just find the file but - * detect if the edj has that named group and if not, fall back - */ - /* local subsystem functions */ typedef struct _E_Theme_Result E_Theme_Result; struct _E_Theme_Result { - unsigned char generated : 1; char *file; char *cache; }; -static const char *_e_theme_file_get_internal(char *category, int recursion); +static Evas_Bool _e_theme_mappings_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata); /* local subsystem globals */ static Evas_Hash *mappings = NULL; +static Evas_Hash *group_cache = NULL; /* externally accessible functions */ int e_theme_init(void) { - /* this is a fallback that is ALWAYS there */ + /* this is a fallback that is ALWAYS there - if all fails things will */ + /* always fall back to the default theme. the rest after this are config */ + /* values users can set */ e_theme_file_set("base", "default.edj"); /* now add more */ - /* FIXME: load these from a config */ + /* FIXME: load these from a config and save them to a config x*/ e_theme_file_set("base/theme", "default.edj"); e_theme_file_set("base/theme/borders", "default.edj"); e_theme_file_set("base/theme/menus", "default.edj"); - e_theme_file_set("base/theme/background", "default.edj"); e_theme_file_set("base/theme/error", "default.edj"); e_theme_file_set("base/theme/gadman", "default.edj"); - e_theme_file_set("base/theme/icons", "default.edj"); - e_theme_file_set("base/theme/cursors", "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"); @@ -46,33 +41,181 @@ e_theme_init(void) e_theme_file_set("base/theme/modules/battery", "default.edj"); e_theme_file_set("base/theme/modules/cpufreq", "default.edj"); e_theme_file_set("base/theme/modules/temperature", "default.edj"); - /* FIXME: need to not just load, but save TO the config too */ return 1; } int e_theme_shutdown(void) { - /* FIXME; clear out mappings hash */ + if (mappings) + { + evas_hash_foreach(mappings, _e_theme_mappings_free_cb, NULL); + evas_hash_free(mappings); + mappings = NULL; + } + if (group_cache) + { + evas_hash_free(group_cache); + group_cache = NULL; + } return 1; } +int +e_theme_edje_object_set(Evas_Object *o, char *category, char *group) +{ + E_Theme_Result *res; + char buf[256]; + char *p; + + /* find category -> edje mapping */ + res = evas_hash_find(mappings, category); + if (res) + { + char *str; + + /* if found check cached path */ + str = res->cache; + if (!str) + { + /* no cached path */ + str = res->file; + /* if its not an absolute path find it */ + if (str[0] != '/') + str = e_path_find(path_themes, str); + /* save cached value */ + if (str) + res->cache = strdup(str); + } + if (str) + { + void *tres; + int ok; + + snprintf(buf, sizeof(buf), "%s/::/%s", str, group); + tres = evas_hash_find(group_cache, buf); + if (!tres) + { + ok = edje_object_file_set(o, str, group); + /* save in the group cache hash */ + if (ok) + group_cache = evas_hash_add(group_cache, buf, res); + else + group_cache = evas_hash_add(group_cache, buf, (void *)1); + } + else if (tres == (void *)1) + ok = 0; + else + ok = 1; + if (ok) + { + if (tres) + edje_object_file_set(o, str, group); + return 1; + } + } + } + /* no mapping or set failed - fall back */ + strncpy(buf, category, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = 0; + /* shorten string up to and not including last / char */ + p = strrchr(buf, '/'); + if (p) *p = 0; + /* no / anymore - we are already as far back as we can go */ + else return 0; + /* try this category */ + return e_theme_edje_object_set(o, buf, group); +} + const char * -e_theme_file_get(char *category) +e_theme_edje_file_get(char *category, char *group) { - return _e_theme_file_get_internal(category, 0); + E_Theme_Result *res; + char buf[4096]; + char *p; + + /* find category -> edje mapping */ + res = evas_hash_find(mappings, category); + if (res) + { + char *str; + + /* if found check cached path */ + str = res->cache; + if (!str) + { + /* no cached path */ + str = res->file; + /* if its not an absolute path find it */ + if (str[0] != '/') + str = e_path_find(path_themes, str); + /* save cached value */ + if (str) + res->cache = strdup(str); + } + if (str) + { + void *tres; + Evas_List *coll, *l; + int ok; + + snprintf(buf, sizeof(buf), "%s/::/%s", str, group); + tres = evas_hash_find(group_cache, buf); + if (!tres) + { + /* if the group exists - return */ + coll = edje_file_collection_list(str); + ok = 0; + for (l = coll; l; l = l->next) + { + if (!strcmp(coll->data, group)) + { + ok = 1; + break; + } + } + if (coll) edje_file_collection_list_free(coll); + /* save in the group cache hash */ + if (ok) + group_cache = evas_hash_add(group_cache, buf, res); + else + group_cache = evas_hash_add(group_cache, buf, (void *)1); + } + else if (tres == (void *)1) /* special pointer "1" == not there */ + ok = 0; + else + ok = 1; + if (ok) return str; + } + } + /* no mapping or set failed - fall back */ + strncpy(buf, category, sizeof(buf) - 1); + buf[sizeof(buf) - 1] = 0; + /* shorten string up to and not including last / char */ + p = strrchr(buf, '/'); + if (p) *p = 0; + /* no / anymore - we are already as far back as we can go */ + else return ""; + /* try this category */ + return e_theme_edje_file_get(buf, group); } void e_theme_file_set(char *category, char *file) { E_Theme_Result *res; - + + if (group_cache) + { + evas_hash_free(group_cache); + group_cache = NULL; + } res = evas_hash_find(mappings, category); if (res) { mappings = evas_hash_del(mappings, category, res); - free(res->file); + E_FREE(res->file); + E_FREE(res->cache); free(res); } res = calloc(1, sizeof(E_Theme_Result)); @@ -82,38 +225,14 @@ e_theme_file_set(char *category, char *file) /* local subsystem functions */ -static const char * -_e_theme_file_get_internal(char *category, int recursion) +static Evas_Bool +_e_theme_mappings_free_cb(Evas_Hash *hash, const char *key, void *data, void *fdata) { - const char *str; E_Theme_Result *res; - if (strlen(category) == 0) return NULL; - res = evas_hash_find(mappings, category); - if (!res) - { - char buf[256]; - char *p; - - strncpy(buf, category, sizeof(buf) - 1); - buf[sizeof(buf) - 1] = 0; - p = strrchr(buf, '/'); - if (p) - { - *p = 0; - return - _e_theme_file_get_internal(buf, recursion + 1); - } - return NULL; - } - str = res->cache; - if (!str) - { - str = res->file; - if (str[0] != '/') - str = e_path_find(path_themes, str); - if (str) - res->cache = strdup(str); - } - return str; + res = data; + E_FREE(res->file); + E_FREE(res->cache); + free(res); + return 1; } diff --git a/src/bin/e_theme.h b/src/bin/e_theme.h index b20250d..bf3987c 100644 --- a/src/bin/e_theme.h +++ b/src/bin/e_theme.h @@ -6,10 +6,11 @@ #ifndef E_THEME_H #define E_THEME_H -EAPI int e_theme_init(void); -EAPI int e_theme_shutdown(void); +EAPI int e_theme_init(void); +EAPI int e_theme_shutdown(void); -EAPI const char *e_theme_file_get(char *category); +EAPI int e_theme_edje_object_set(Evas_Object *o, char *category, char *group); +EAPI const char *e_theme_edje_file_get(char *category, char *group); EAPI void e_theme_file_set(char *category, char *file); #endif diff --git a/src/modules/battery/e_mod_main.c b/src/modules/battery/e_mod_main.c index c7ca64e..68c13f3 100644 --- a/src/modules/battery/e_mod_main.c +++ b/src/modules/battery/e_mod_main.c @@ -492,9 +492,8 @@ _battery_face_new(E_Container *con) o = edje_object_add(con->bg_evas); ef->bat_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/battery"), - "modules/battery/main"); + e_theme_edje_object_set(o, "base/theme/modules/battery", + "modules/battery/main"); evas_object_show(o); o = evas_object_rectangle_add(con->bg_evas); diff --git a/src/modules/clock/e_mod_main.c b/src/modules/clock/e_mod_main.c index 5a662bd..d2fe59e 100644 --- a/src/modules/clock/e_mod_main.c +++ b/src/modules/clock/e_mod_main.c @@ -220,9 +220,8 @@ _clock_face_new(E_Container *con) o = edje_object_add(con->bg_evas); face->clock_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/clock"), - "modules/clock/main"); + e_theme_edje_object_set(o, "base/theme/modules/clock", + "modules/clock/main"); evas_object_show(o); o = evas_object_rectangle_add(con->bg_evas); diff --git a/src/modules/cpufreq/e_mod_main.c b/src/modules/cpufreq/e_mod_main.c index 6647331..fafa330 100644 --- a/src/modules/cpufreq/e_mod_main.c +++ b/src/modules/cpufreq/e_mod_main.c @@ -741,9 +741,8 @@ _cpufreq_face_new(E_Container *con, Cpufreq *owner) o = edje_object_add(con->bg_evas); ef->freq_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/cpufreq"), - "modules/cpufreq/main"); + e_theme_edje_object_set(o, "base/theme/modules/cpufreq", + "modules/cpufreq/main"); edje_object_signal_callback_add(o, "next_governor", "governor", _cpufreq_face_cb_set_governor, owner); edje_object_signal_callback_add(o, "increase_frequency", "frequency", _cpufreq_face_cb_set_frequency, owner); edje_object_signal_callback_add(o, "decrease_frequency", "frequency", _cpufreq_face_cb_set_frequency, owner); diff --git a/src/modules/dropshadow/e_mod_main.c b/src/modules/dropshadow/e_mod_main.c index c675364..1e0eabc 100644 --- a/src/modules/dropshadow/e_mod_main.c +++ b/src/modules/dropshadow/e_mod_main.c @@ -974,7 +974,7 @@ _ds_edge_scan(Shpix *sp, Tilebuf *tb, int bsz, int q, int x1, int y1, int x2, in ((bsz + 1) * 2) / q, ((bsz + 1) * 2) / q); ptr += sp->w; - pptr += sp->h; + pptr += sp->w; } } else if (y1 == y2) /* scan horiz */ diff --git a/src/modules/ibar/e_mod_main.c b/src/modules/ibar/e_mod_main.c index 5bc4f0e..9ed9936 100644 --- a/src/modules/ibar/e_mod_main.c +++ b/src/modules/ibar/e_mod_main.c @@ -427,17 +427,15 @@ _ibar_bar_new(IBar *ib, E_Container *con) evas_event_freeze(ibb->evas); o = edje_object_add(ibb->evas); ibb->bar_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/ibar"), - "modules/ibar/main"); + e_theme_edje_object_set(o, "base/theme/modules/ibar", + "modules/ibar/main"); evas_object_show(o); o = edje_object_add(ibb->evas); ibb->overlay_object = o; evas_object_layer_set(o, 1); - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/ibar"), - "modules/ibar/follower"); + e_theme_edje_object_set(o, "base/theme/modules/ibar", + "modules/ibar/follower"); evas_object_show(o); o = evas_object_rectangle_add(ibb->evas); @@ -610,9 +608,8 @@ _ibar_icon_new(IBar_Bar *ibb, E_App *a) ic->bg_object = o; evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic); evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic); - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/ibar"), - "modules/ibar/icon"); + e_theme_edje_object_set(o, "base/theme/modules/ibar", + "modules/ibar/icon"); evas_object_show(o); o = edje_object_add(ibb->evas); @@ -628,9 +625,8 @@ _ibar_icon_new(IBar_Bar *ibb, E_App *a) ic->overlay_object = o; evas_object_intercept_move_callback_add(o, _ibar_icon_cb_intercept_move, ic); evas_object_intercept_resize_callback_add(o, _ibar_icon_cb_intercept_resize, ic); - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/ibar"), - "modules/ibar/icon_overlay"); + e_theme_edje_object_set(o, "base/theme/modules/ibar", + "modules/ibar/icon_overlay"); evas_object_show(o); o = edje_object_add(ibb->evas); diff --git a/src/modules/pager/e_mod_main.c b/src/modules/pager/e_mod_main.c index 1232e03..8d1ae33 100644 --- a/src/modules/pager/e_mod_main.c +++ b/src/modules/pager/e_mod_main.c @@ -329,9 +329,8 @@ _pager_face_new(E_Zone *zone) /* the bg */ o = edje_object_add(face->evas); face->pager_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/pager"), - "modules/pager/main"); + e_theme_edje_object_set(o, "base/theme/modules/pager", + "modules/pager/main"); evas_object_show(o); o = e_table_add(face->evas); @@ -510,9 +509,8 @@ _pager_desk_new(Pager_Face *face, E_Desk *desk, int xpos, int ypos) o = edje_object_add(face->evas); pd->desk_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/pager"), - "modules/pager/desk"); + e_theme_edje_object_set(o, "base/theme/modules/pager", + "modules/pager/desk"); e_table_pack(face->table_object, o, xpos, ypos, 1, 1); e_table_pack_options_set(o, 1, 1, 1, 1, 0.5, 0.5, 0, 0, -1, -1); evas_object_show(o); @@ -589,9 +587,8 @@ _pager_window_new(Pager_Desk *pd, E_Border *border) o = edje_object_add(pd->face->evas); pw->window_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/pager"), - "modules/pager/window"); + e_theme_edje_object_set(o, "base/theme/modules/pager", + "modules/pager/window"); if (visible) evas_object_show(o); e_layout_pack(pd->layout_object, pw->window_object); e_layout_child_raise(pw->window_object); diff --git a/src/modules/temperature/e_mod_main.c b/src/modules/temperature/e_mod_main.c index 856ee50..3f87900 100644 --- a/src/modules/temperature/e_mod_main.c +++ b/src/modules/temperature/e_mod_main.c @@ -635,9 +635,8 @@ _temperature_face_new(E_Container *con) o = edje_object_add(con->bg_evas); ef->temp_object = o; - edje_object_file_set(o, - e_theme_file_get("base/theme/modules/temperature"), - "modules/temperature/main"); + e_theme_edje_object_set(o, "base/theme/modules/temperature", + "modules/temperature/main"); evas_object_show(o); o = evas_object_rectangle_add(con->bg_evas);