jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f90d0d150163beb546e78c52786d6c2eb7706e8d
commit f90d0d150163beb546e78c52786d6c2eb7706e8d Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Wed Aug 30 18:47:21 2017 +0900 widget: Simplify & document "translate" This is a protected function. It doesn't need to return anything, as all implementation just returned true, always. Also, the legacy API was just a wrapper doing nothing special (except verify that we have a widget, which the recursive code already does). Tested with fr_FR :) Ref T5363 --- src/lib/elementary/efl_ui_clock.c | 4 +--- src/lib/elementary/elc_combobox.c | 4 +--- src/lib/elementary/elc_ctxpopup.c | 4 +--- src/lib/elementary/elc_hoversel.c | 4 +--- src/lib/elementary/elc_multibuttonentry.c | 4 +--- src/lib/elementary/elc_naviframe.c | 4 +--- src/lib/elementary/elc_popup.c | 4 +--- src/lib/elementary/elm_dayselector.c | 6 ++---- src/lib/elementary/elm_diskselector.c | 4 +--- src/lib/elementary/elm_list.c | 4 +--- src/lib/elementary/elm_menu.c | 4 +--- src/lib/elementary/elm_segment_control.c | 4 +--- src/lib/elementary/elm_toolbar.c | 4 +--- src/lib/elementary/elm_widget.c | 13 ++----------- src/lib/elementary/elm_widget.eo | 9 ++++++--- 15 files changed, 22 insertions(+), 54 deletions(-) diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c index 7f3993a8e2..58ef45dae0 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -406,15 +406,13 @@ _reload_format(Evas_Object *obj) _field_list_arrange(obj); } -EOLIAN static Eina_Bool +EOLIAN static void _efl_ui_clock_elm_widget_translate(Eo *obj, Efl_Ui_Clock_Data *sd) { if (!sd->user_format) _reload_format(obj); else _field_list_display(obj); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static Eina_List * diff --git a/src/lib/elementary/elc_combobox.c b/src/lib/elementary/elc_combobox.c index 0d8e36eb25..449305eaf1 100644 --- a/src/lib/elementary/elc_combobox.c +++ b/src/lib/elementary/elc_combobox.c @@ -44,7 +44,7 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; -EOLIAN static Eina_Bool +EOLIAN static void _elm_combobox_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd) { elm_obj_widget_translate(efl_super(obj, MY_CLASS)); @@ -53,8 +53,6 @@ _elm_combobox_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Combobox_Data *sd) if (sd->hover) elm_obj_widget_translate(sd->hover); - - return EINA_TRUE; } EOLIAN static Efl_Ui_Theme_Apply diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index d80bb3ecbb..5789135d5c 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -47,7 +47,7 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; -EOLIAN static Eina_Bool +EOLIAN static void _elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd) { Eina_List *l; @@ -59,8 +59,6 @@ _elm_ctxpopup_elm_widget_translate(Eo *obj, Elm_Ctxpopup_Data *sd) elm_wdg_item_translate(it); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index 1d2e8901d4..c4a866197e 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -48,7 +48,7 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; -EOLIAN static Eina_Bool +EOLIAN static void _elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) { Eo *it; @@ -58,8 +58,6 @@ _elm_hoversel_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) elm_wdg_item_translate(it); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } EOLIAN static Efl_Ui_Theme_Apply diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index 9ed9707053..29fceec399 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -64,7 +64,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, { EFL_UI_EVENT_CLICKED, _entry_clicked_cb } ); -EOLIAN static Eina_Bool +EOLIAN static void _elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttonentry_Data *sd) { Elm_Object_Item *it; @@ -74,8 +74,6 @@ _elm_multibuttonentry_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Multibuttone elm_wdg_item_translate(it); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static char * diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index 4897d45ddc..098cc1f8c2 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -105,7 +105,7 @@ _prev_page_focus_recover(Elm_Naviframe_Item_Data *it) } } -EOLIAN static Eina_Bool +EOLIAN static void _elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) { Elm_Naviframe_Item_Data *it; @@ -114,8 +114,6 @@ _elm_naviframe_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Naviframe_Data *sd) elm_wdg_item_translate(EO_OBJ(it)); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c index 778312c7e7..4c1c19d1c2 100644 --- a/src/lib/elementary/elc_popup.c +++ b/src/lib/elementary/elc_popup.c @@ -67,7 +67,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(_notify_cb, static void _on_content_del(void *data, Evas *e, Evas_Object *obj, void *event_info); -EOLIAN static Eina_Bool +EOLIAN static void _elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd) { Elm_Popup_Item_Data *it; @@ -78,8 +78,6 @@ _elm_popup_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Popup_Data *sd) elm_obj_widget_translate(efl_super(obj, MY_CLASS)); elm_obj_widget_translate(sd->main_layout); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_dayselector.c b/src/lib/elementary/elm_dayselector.c index 7d85d16f11..cef0cf1f59 100644 --- a/src/lib/elementary/elm_dayselector.c +++ b/src/lib/elementary/elm_dayselector.c @@ -55,7 +55,7 @@ _dayselector_resize(void *data, elm_layout_sizing_eval(data); } -EOLIAN static Eina_Bool +EOLIAN static void _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data *sd) { time_t t; @@ -65,7 +65,7 @@ _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data Elm_Dayselector_Item_Data *it; if (sd->weekdays_names_set) - return EINA_TRUE; + return; t = time(NULL); localtime_r(&t, &time_daysel); @@ -77,8 +77,6 @@ _elm_dayselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Dayselector_Data } elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_diskselector.c b/src/lib/elementary/elm_diskselector.c index 3dd23818dd..ea57e114f5 100644 --- a/src/lib/elementary/elm_diskselector.c +++ b/src/lib/elementary/elm_diskselector.c @@ -49,7 +49,7 @@ static const Elm_Action key_actions[] = { {NULL, NULL} }; -EOLIAN static Eina_Bool +EOLIAN static void _elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Data *sd) { Elm_Diskselector_Item_Data *it; @@ -57,8 +57,6 @@ _elm_diskselector_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Diskselector_Dat EINA_LIST_FOREACH(sd->items, l, it) elm_wdg_item_translate(EO_OBJ(it)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index a1c355fc38..0fa5b95d80 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -632,7 +632,7 @@ static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params EINA_UN return EINA_TRUE; } -EOLIAN static Eina_Bool +EOLIAN static void _elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd) { Elm_Object_Item *it; @@ -642,8 +642,6 @@ _elm_list_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_List_Data *sd) elm_wdg_item_translate(it); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c index 069f71dc5b..9d4b429240 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -31,7 +31,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { }; #undef ELM_PRIV_MENU_SIGNALS -EOLIAN static Eina_Bool +EOLIAN static void _elm_menu_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd) { Elm_Menu_Item_Data *it; @@ -39,8 +39,6 @@ _elm_menu_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Menu_Data *sd) EINA_LIST_FOREACH(sd->items, l, it) elm_wdg_item_translate(EO_OBJ(it)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_segment_control.c b/src/lib/elementary/elm_segment_control.c index c472e5e39d..0e40333952 100644 --- a/src/lib/elementary/elm_segment_control.c +++ b/src/lib/elementary/elm_segment_control.c @@ -26,7 +26,7 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = { {NULL, NULL} }; -EOLIAN static Eina_Bool +EOLIAN static void _elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Control_Data *sd) { Elm_Object_Item *it; @@ -36,8 +36,6 @@ _elm_segment_control_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Segment_Contr elm_wdg_item_translate(it); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } EOLIAN static void diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 67a291004d..3d145638f2 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -1719,7 +1719,7 @@ _elm_toolbar_item_elm_widget_item_part_content_unset(Eo *eo_item EINA_UNUSED, El return o; } -EOLIAN static Eina_Bool +EOLIAN static void _elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) { Elm_Toolbar_Item_Data *it; @@ -1728,8 +1728,6 @@ _elm_toolbar_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Toolbar_Data *sd) elm_wdg_item_translate(EO_OBJ(it)); elm_obj_widget_translate(efl_super(obj, MY_CLASS)); - - return EINA_TRUE; } static void diff --git a/src/lib/elementary/elm_widget.c b/src/lib/elementary/elm_widget.c index a4160ffe28..49cd51f6bc 100644 --- a/src/lib/elementary/elm_widget.c +++ b/src/lib/elementary/elm_widget.c @@ -3775,13 +3775,6 @@ _elm_widget_domain_part_text_translatable_set(Eo *obj, Elm_Widget_Smart_Data *sd sd->on_translate = EINA_FALSE; } -EAPI void -elm_widget_translate(Evas_Object *obj) -{ - ELM_WIDGET_CHECK(obj); - elm_obj_widget_translate(obj); -} - static const char* _part_text_translate(Eina_Inlist *translate_strings, const char *part, @@ -3809,12 +3802,11 @@ _elm_widget_part_text_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd, return _part_text_translate(sd->translate_strings, part, text); } -EOLIAN static Eina_Bool -_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSED) +EOLIAN static void +_elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *sd) { const Eina_List *l; Evas_Object *child; - API_ENTRY return EINA_FALSE; EINA_LIST_FOREACH(sd->subobjs, l, child) { @@ -3836,7 +3828,6 @@ _elm_widget_translate(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data *_pd EINA_UNUSE } #endif efl_event_callback_legacy_call(obj, ELM_WIDGET_EVENT_LANGUAGE_CHANGED, NULL); - return EINA_TRUE; } /** diff --git a/src/lib/elementary/elm_widget.eo b/src/lib/elementary/elm_widget.eo index 64560f1695..7beafe85c2 100644 --- a/src/lib/elementary/elm_widget.eo +++ b/src/lib/elementary/elm_widget.eo @@ -279,9 +279,12 @@ abstract Elm.Widget (Efl.Canvas.Group, Elm.Interface.Atspi_Accessible, /* Translation & Text API. */ translate @protected { - [[Virtual function handling language changes.]] - return: bool; [[$true on success, $false otherwise]] - legacy: null; + [[Virtual function handling language changes. + + If a widget is composed of multiple sub-objects, this function might + need to be reimplemented to translate all those sub-objects that + have visible (or accessible) translatable text. + ]] } @property domain_part_text_translatable { [[Translate domain text part property]] --