From 6492470d35c61d7a34b9fc0ffa2f13d822dd6293 Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Tue, 30 Apr 2013 18:48:48 +0900 Subject: [PATCH] elementary/layout - layout supports "language,changed" callback commit 633b89c467dc38515742e28a2ed77427ae7c8fb9 Author: ChunEon Park @hermet.pe.kr> Date: Tue Apr 30 18:47:38 2013 +0900 Change-Id: I403108560cbd7a630a28e19fcb7332250565530d --- src/lib/elm_layout.c | 10 ++++++++++ src/lib/elm_layout.h | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index 4269d76..0fb79f1 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -5,6 +5,7 @@ EAPI const char ELM_LAYOUT_SMART_NAME[] = "elm_layout"; static const char SIG_THEME_CHANGED[] = "theme,changed"; +static const char SIG_LANG_CHANGED[] = "language,changed"; /* no *direct* instantiation of this class, so far */ __UNUSED__ static Evas_Smart *_elm_layout_smart_class_new(void); @@ -12,6 +13,7 @@ __UNUSED__ static Evas_Smart *_elm_layout_smart_class_new(void); /* smart callbacks coming from elm layout objects: */ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_THEME_CHANGED, ""}, + {SIG_LANG_CHANGED, ""}, {NULL, NULL} }; @@ -61,6 +63,13 @@ struct _Elm_Layout_Sub_Object_Cursor Eina_Bool engine_only : 1; }; +static Eina_Bool +_elm_layout_smart_translate(Evas_Object *obj) +{ + evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL); + return EINA_TRUE; +} + /* layout's sizing evaluation is deferred. evaluation requests are * queued up and only flag the object as 'changed'. when it comes to * Evas's rendering phase, it will be addressed, finally (see @@ -1316,6 +1325,7 @@ _elm_layout_smart_set_user(Elm_Layout_Smart_Class *sc) ELM_WIDGET_CLASS(sc)->base.calculate = _elm_layout_smart_calculate; ELM_WIDGET_CLASS(sc)->theme = _elm_layout_smart_theme; + ELM_WIDGET_CLASS(sc)->translate = _elm_layout_smart_translate; ELM_WIDGET_CLASS(sc)->disable = _elm_layout_smart_disable; ELM_WIDGET_CLASS(sc)->focus_next = _elm_layout_smart_focus_next; ELM_WIDGET_CLASS(sc)->focus_direction = _elm_layout_smart_focus_direction; diff --git a/src/lib/elm_layout.h b/src/lib/elm_layout.h index 0f367d4..ea9b506 100644 --- a/src/lib/elm_layout.h +++ b/src/lib/elm_layout.h @@ -151,7 +151,8 @@ * * This widget emits the following signals: * - * @li "theme,changed": The theme was changed. + * @li "theme,changed" - The theme was changed. + * @li "language,changed" - The program's language changed * * @section secExamples Examples * -- 2.7.4