From: ChunEon P. - E. G. <no-...@en...> - 2013-04-30 09:48:01
|
hermet pushed a commit to branch master. commit 633b89c467dc38515742e28a2ed77427ae7c8fb9 Author: ChunEon Park <he...@he...> Date: Tue Apr 30 18:47:38 2013 +0900 elementary/layout - layout supports "language,changed" callback --- ChangeLog | 5 +++++ NEWS | 1 + src/lib/elm_layout.c | 11 +++++++++++ src/lib/elm_layout.h | 3 ++- 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fab69bd..90585ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1307,3 +1307,8 @@ * Add the config elm_scroll_smooth_start_enable. There's no tick when scroller starts scroll if it's set. + +2013-04-30 ChunEon Park (Hermet) + + * Layout supports "language,changed" smart callback. + diff --git a/NEWS b/NEWS index 6a1c4b6..f08af5c 100644 --- a/NEWS +++ b/NEWS @@ -65,6 +65,7 @@ Additions: * Add elm_object_domain_part_text_translatable_set(), elm_object_item_domain_part_text_translatable_set(). * Support language,changed callback (Fileselector_Button, Fileselector Entry, Spinner. * Add the config elm_scroll_smooth_start_enable. + * Add elm_layout smart callback - "language,changed". Improvements: diff --git a/src/lib/elm_layout.c b/src/lib/elm_layout.c index ffe91db..a032fda 100644 --- a/src/lib/elm_layout.c +++ b/src/lib/elm_layout.c @@ -9,10 +9,12 @@ EAPI Eo_Op ELM_OBJ_LAYOUT_BASE_ID = EO_NOOP; #define MY_CLASS_NAME "elm_layout" static const char SIG_THEME_CHANGED[] = "theme,changed"; +static const char SIG_LANG_CHANGED[] = "language,changed"; /* smart callbacks coming from elm layout objects: */ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {SIG_THEME_CHANGED, ""}, + {SIG_LANG_CHANGED, ""}, {NULL, NULL} }; @@ -62,6 +64,14 @@ struct _Elm_Layout_Sub_Object_Cursor Eina_Bool engine_only : 1; }; +static void +_elm_layout_smart_translate(Eo *obj, void *_pd EINA_UNUSED, va_list *list) +{ + Eina_Bool *ret = va_arg(*list, Eina_Bool *); + evas_object_smart_callback_call(obj, SIG_LANG_CHANGED, NULL); + if (ret) *ret = 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 @@ -2170,6 +2180,7 @@ _class_constructor(Eo_Class *klass) EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_ON_FOCUS), _elm_layout_smart_on_focus), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_DISABLE), _elm_layout_smart_disable), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_THEME), _elm_layout_smart_theme), + EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_TRANSLATE), _elm_layout_smart_translate), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT_MANAGER_IS), _elm_layout_smart_focus_next_manager_is), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_NEXT), _elm_layout_smart_focus_next), EO_OP_FUNC(ELM_WIDGET_ID(ELM_WIDGET_SUB_ID_FOCUS_DIRECTION_MANAGER_IS), _elm_layout_smart_focus_direction_manager_is), diff --git a/src/lib/elm_layout.h b/src/lib/elm_layout.h index 773b032..bd3b746 100644 --- a/src/lib/elm_layout.h +++ b/src/lib/elm_layout.h @@ -153,7 +153,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 * -- |