jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7e76b1e7ef17b8f7169f8e1ff550144e3ea432a7
commit 7e76b1e7ef17b8f7169f8e1ff550144e3ea432a7 Author: Jean-Philippe Andre <jp.an...@samsung.com> Date: Fri Nov 24 17:22:31 2017 +0900 mbe: Fix invalid part handling Only the text parts need special handling. Ping @CHAN :) --- src/lib/elementary/efl_ui_multibuttonentry.c | 41 ++++++---------------- src/lib/elementary/efl_ui_multibuttonentry_part.eo | 4 +-- 2 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/lib/elementary/efl_ui_multibuttonentry.c b/src/lib/elementary/efl_ui_multibuttonentry.c index e15b4de90c..0ff7c5e555 100644 --- a/src/lib/elementary/efl_ui_multibuttonentry.c +++ b/src/lib/elementary/efl_ui_multibuttonentry.c @@ -57,6 +57,14 @@ static void _entry_changed_cb(void *data, const Efl_Event *event); static void _entry_focus_changed_cb(void *data, const Efl_Event *event); static void _entry_clicked_cb(void *data, const Efl_Event *event); +static const Elm_Layout_Part_Alias_Description _text_aliases[] = +{ + {"default", "elm.text"}, + {"guide", "guide"}, + {NULL, NULL} +}; + + EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb }, { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb }, @@ -1480,46 +1488,22 @@ _view_init(Evas_Object *obj, Efl_Ui_Multibuttonentry_Data *sd) } } -static Eina_Bool -_efl_ui_multibuttonentry_content_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content) -{ - return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content); -} - -static Eo* -_efl_ui_multibuttonentry_content_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part) -{ - return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part)); -} - -static Eo* -_efl_ui_multibuttonentry_content_unset(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part) -{ - return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part)); -} - -EOLIAN static Eina_Bool +static void _efl_ui_multibuttonentry_text_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label) { - Eina_Bool int_ret = EINA_TRUE; - if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text")) { if (label) _label_set(obj, label); - int_ret = EINA_TRUE; } else if (!strcmp(part, "guide")) { if (label) _guide_text_set(obj, label); - int_ret = EINA_TRUE; } else efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); - - return int_ret; } -EOLIAN static const char* +static const char* _efl_ui_multibuttonentry_text_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, const char *part) { const char *text = NULL; @@ -2088,10 +2072,7 @@ _elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA /* Efl.Part begin */ -ELM_PART_OVERRIDE(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) -ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) -ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) -ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) +ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data, _text_aliases) ELM_PART_OVERRIDE_TEXT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) ELM_PART_OVERRIDE_TEXT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) #include "efl_ui_multibuttonentry_part.eo.c" diff --git a/src/lib/elementary/efl_ui_multibuttonentry_part.eo b/src/lib/elementary/efl_ui_multibuttonentry_part.eo index 7326df1773..111cf18da4 100644 --- a/src/lib/elementary/efl_ui_multibuttonentry_part.eo +++ b/src/lib/elementary/efl_ui_multibuttonentry_part.eo @@ -1,10 +1,8 @@ -class Efl.Ui.Multibuttonentry.Part (Efl.Ui.Layout.Part_Content, Efl.Text) +class Efl.Ui.Multibuttonentry.Part (Efl.Ui.Layout.Part_Text) { [[Elementary multibuttonentry internal part class]] data: null; implements { - Efl.Content.content { set; get; } - Efl.Content.content_unset; Efl.Text.text { set; get; } } } --