elementary/layout - layout supports "language,changed" callback

This commit is contained in:
ChunEon Park 2013-04-30 18:47:38 +09:00
parent 0bde066596
commit fb78d7dbd3
4 changed files with 19 additions and 1 deletions

View File

@ -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.

View File

@ -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:

View File

@ -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),

View File

@ -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
*