From: ChunEon Park Date: Wed, 20 Jul 2011 08:36:40 +0000 (+0000) Subject: elementary/layout - added theme changed hook X-Git-Tag: v1.0.0~2530 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3721e4e153aeb914463cbc6f566b9bd91627fc56;p=platform%2Fupstream%2Felementary.git elementary/layout - added theme changed hook Because the user can use their' own edj objs and call the signals for the edj objs, They have a responsibility to reset the status of the edj objs when layout theme is changed. This "theme,changed" signal provides to user a chance to reset (signal-emit) again. SVN revision: 61518 --- diff --git a/src/lib/Elementary.h.in b/src/lib/Elementary.h.in index 7ab5788..843eb31 100644 --- a/src/lib/Elementary.h.in +++ b/src/lib/Elementary.h.in @@ -4794,6 +4794,7 @@ extern "C" { elm_layout_text_get((_ly), "elm.text") /* smart callbacks called: + * "theme,changed" - when elm theme is changed. */ /* notify */ diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index 34e2e61..41576a2 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -69,6 +69,13 @@ static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *eve static void _sub_del(void *data, Evas_Object *obj, void *event_info); static void _part_cursor_free(Part_Cursor *pc); +static const char SIG_THEME_CHANGED[] = "theme,changed"; + +static const Evas_Smart_Cb_Description _signals[] = { + {SIG_THEME_CHANGED, ""}, + {NULL, NULL} +}; + static void _del_hook(Evas_Object *obj) { @@ -106,6 +113,7 @@ _theme_hook(Evas_Object *obj) _elm_theme_object_set(obj, wd->lay, wd->clas, wd->group, wd->style); edje_object_scale_set(wd->lay, elm_widget_scale_get(obj) * _elm_config->scale); + evas_object_smart_callback_call(obj, SIG_THEME_CHANGED, (void *) elm_theme_get(NULL)); _sizing_eval(wd); } @@ -398,6 +406,7 @@ elm_layout_add(Evas_Object *parent) _signal_size_eval, wd); evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj); + evas_object_smart_callbacks_descriptions_set(obj, _signals); _mirrored_set(obj, elm_widget_mirrored_get(obj)); _request_sizing_eval(wd);