summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 17:22:31 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2017-11-24 17:25:30 +0900
commit7e76b1e7ef17b8f7169f8e1ff550144e3ea432a7 (patch)
tree6534d969aa1ceb238793836a4cdcf2d2ac04a93c
parent1aedcdaf7a6550881db258ac0fb9fcba4a5d2cc7 (diff)
mbe: Fix invalid part handling
Only the text parts need special handling. Ping @CHAN :)
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry.c41
-rw-r--r--src/lib/elementary/efl_ui_multibuttonentry_part.eo4
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 e15b4de..0ff7c5e 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);
57static void _entry_focus_changed_cb(void *data, const Efl_Event *event); 57static void _entry_focus_changed_cb(void *data, const Efl_Event *event);
58static void _entry_clicked_cb(void *data, const Efl_Event *event); 58static void _entry_clicked_cb(void *data, const Efl_Event *event);
59 59
60static const Elm_Layout_Part_Alias_Description _text_aliases[] =
61{
62 {"default", "elm.text"},
63 {"guide", "guide"},
64 {NULL, NULL}
65};
66
67
60EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, 68EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb,
61 { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb }, 69 { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb },
62 { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb }, 70 { 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)
1480 } 1488 }
1481} 1489}
1482 1490
1483static Eina_Bool 1491static void
1484_efl_ui_multibuttonentry_content_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part, Evas_Object *content)
1485{
1486 return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
1487}
1488
1489static Eo*
1490_efl_ui_multibuttonentry_content_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part)
1491{
1492 return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
1493}
1494
1495static Eo*
1496_efl_ui_multibuttonentry_content_unset(Eo *obj, Efl_Ui_Multibuttonentry_Data *_pd EINA_UNUSED, const char *part)
1497{
1498 return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
1499}
1500
1501EOLIAN static Eina_Bool
1502_efl_ui_multibuttonentry_text_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label) 1492_efl_ui_multibuttonentry_text_set(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label)
1503{ 1493{
1504 Eina_Bool int_ret = EINA_TRUE;
1505
1506 if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text")) 1494 if (!part || !strcmp(part, "default") || !strcmp(part, "elm.text"))
1507 { 1495 {
1508 if (label) _label_set(obj, label); 1496 if (label) _label_set(obj, label);
1509 int_ret = EINA_TRUE;
1510 } 1497 }
1511 else if (!strcmp(part, "guide")) 1498 else if (!strcmp(part, "guide"))
1512 { 1499 {
1513 if (label) _guide_text_set(obj, label); 1500 if (label) _guide_text_set(obj, label);
1514 int_ret = EINA_TRUE;
1515 } 1501 }
1516 else 1502 else
1517 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label); 1503 efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
1518
1519 return int_ret;
1520} 1504}
1521 1505
1522EOLIAN static const char* 1506static const char*
1523_efl_ui_multibuttonentry_text_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, const char *part) 1507_efl_ui_multibuttonentry_text_get(Eo *obj, Efl_Ui_Multibuttonentry_Data *sd, const char *part)
1524{ 1508{
1525 const char *text = NULL; 1509 const char *text = NULL;
@@ -2088,10 +2072,7 @@ _elm_multibuttonentry_item_efl_access_widget_action_elm_actions_get(Eo *obj EINA
2088 2072
2089/* Efl.Part begin */ 2073/* Efl.Part begin */
2090 2074
2091ELM_PART_OVERRIDE(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) 2075ELM_PART_OVERRIDE_ONLY_ALIASES(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data, _text_aliases)
2092ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
2093ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
2094ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
2095ELM_PART_OVERRIDE_TEXT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) 2076ELM_PART_OVERRIDE_TEXT_SET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
2096ELM_PART_OVERRIDE_TEXT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data) 2077ELM_PART_OVERRIDE_TEXT_GET(efl_ui_multibuttonentry, EFL_UI_MULTIBUTTONENTRY, Efl_Ui_Multibuttonentry_Data)
2097#include "efl_ui_multibuttonentry_part.eo.c" 2078#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 7326df1..111cf18 100644
--- a/src/lib/elementary/efl_ui_multibuttonentry_part.eo
+++ b/src/lib/elementary/efl_ui_multibuttonentry_part.eo
@@ -1,10 +1,8 @@
1class Efl.Ui.Multibuttonentry.Part (Efl.Ui.Layout.Part_Content, Efl.Text) 1class Efl.Ui.Multibuttonentry.Part (Efl.Ui.Layout.Part_Text)
2{ 2{
3 [[Elementary multibuttonentry internal part class]] 3 [[Elementary multibuttonentry internal part class]]
4 data: null; 4 data: null;
5 implements { 5 implements {
6 Efl.Content.content { set; get; }
7 Efl.Content.content_unset;
8 Efl.Text.text { set; get; } 6 Efl.Text.text { set; get; }
9 } 7 }
10} 8}