aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2017-06-04 17:25:36 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2017-06-05 02:08:03 +0300
commit3eb649b180eb98f7be829de5aed7e8c7f1ceb35a (patch)
treee7095c091fd648d2bf8e45aa5b9a9634bc73735e /src/lib
parentelm_colorselector: Improve ATSPI support (diff)
downloadefl-3eb649b180eb98f7be829de5aed7e8c7f1ceb35a.tar.gz
Elm layout: replace 'text' property with 'efl_part' interface
The expected usage is efl_text_set(efl_part(layout, part), text); Same for text_get. Also, added an example how to make API easier with providing efl_text_set/get for the widget itself, in efl_ui_button. Please see this example.
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_button.c2
-rw-r--r--src/lib/elementary/efl_ui_text.c258
-rw-r--r--src/lib/elementary/efl_ui_text.eo1
-rw-r--r--src/lib/elementary/elc_fileselector.c17
-rw-r--r--src/lib/elementary/elc_fileselector_entry.c10
-rw-r--r--src/lib/elementary/elc_multibuttonentry.c21
-rw-r--r--src/lib/elementary/elc_naviframe.c6
-rw-r--r--src/lib/elementary/elc_popup.c6
-rw-r--r--src/lib/elementary/elm_actionslider.c21
-rw-r--r--src/lib/elementary/elm_actionslider.eo2
-rw-r--r--src/lib/elementary/elm_actionslider_internal_part.eo8
-rw-r--r--src/lib/elementary/elm_bubble.c15
-rw-r--r--src/lib/elementary/elm_bubble.eo2
-rw-r--r--src/lib/elementary/elm_bubble_internal_part.eo8
-rw-r--r--src/lib/elementary/elm_entry.c10
-rw-r--r--src/lib/elementary/elm_entry.eo1
-rw-r--r--src/lib/elementary/elm_entry_internal_part.eo3
-rw-r--r--src/lib/elementary/elm_fileselector.eo2
-rw-r--r--src/lib/elementary/elm_fileselector_entry.eo1
-rw-r--r--src/lib/elementary/elm_fileselector_entry_internal_part.eo3
-rw-r--r--src/lib/elementary/elm_fileselector_internal_part.eo9
-rw-r--r--src/lib/elementary/elm_label.c16
-rw-r--r--src/lib/elementary/elm_label.eo2
-rw-r--r--src/lib/elementary/elm_label_internal_part.eo8
-rw-r--r--src/lib/elementary/elm_layout.c15
-rw-r--r--src/lib/elementary/elm_layout.eo15
-rw-r--r--src/lib/elementary/elm_layout_internal_part.eo3
-rw-r--r--src/lib/elementary/elm_layout_legacy.h23
-rw-r--r--src/lib/elementary/elm_multibuttonentry.eo2
-rw-r--r--src/lib/elementary/elm_multibuttonentry_internal_part.eo9
-rw-r--r--src/lib/elementary/elm_naviframe.eo1
-rw-r--r--src/lib/elementary/elm_naviframe_internal_part.eo1
-rw-r--r--src/lib/elementary/elm_part_helper.h42
-rw-r--r--src/lib/elementary/elm_popup.eo1
-rw-r--r--src/lib/elementary/elm_popup_internal_part.eo3
35 files changed, 223 insertions, 324 deletions
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index 5303386313..f8b68d51d6 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -445,7 +445,7 @@ _efl_ui_button_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
-EFL_TEXT_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
+EFL_TEXT_PART_DEFAULT_IMPLEMENT(efl_ui_button, Efl_Ui_Button_Data)
/* Efl.Part begin */
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index fbb882fae0..7440427b1c 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -2565,99 +2565,6 @@ _markup_filter_cb(void *data,
}
}
-/* This function is used to insert text by chunks in jobs */
-static Eina_Bool
-_text_append_idler(void *data)
-{
- int start;
- char backup;
- Evas_Object *obj = (Evas_Object *)data;
-
- EFL_UI_TEXT_DATA_GET(obj, sd);
-
- evas_event_freeze(evas_object_evas_get(obj));
- ELM_SAFE_FREE(sd->text, eina_stringshare_del);
- sd->changed = EINA_TRUE;
-
- start = sd->append_text_position;
- if ((start + EFL_UI_TEXT_CHUNK_SIZE) < sd->append_text_len)
- {
- int pos = start;
- int tag_start, esc_start;
-
- tag_start = esc_start = -1;
- /* Find proper markup cut place */
- while (pos - start < EFL_UI_TEXT_CHUNK_SIZE)
- {
- int prev_pos = pos;
- Eina_Unicode tmp =
- eina_unicode_utf8_next_get(sd->append_text_left, &pos);
-
- if (esc_start == -1)
- {
- if (tmp == '<')
- tag_start = prev_pos;
- else if (tmp == '>')
- tag_start = -1;
- }
- if (tag_start == -1)
- {
- if (tmp == '&')
- esc_start = prev_pos;
- else if (tmp == ';')
- esc_start = -1;
- }
- }
-
- if (tag_start >= 0)
- {
- sd->append_text_position = tag_start;
- }
- else if (esc_start >= 0)
- {
- sd->append_text_position = esc_start;
- }
- else
- {
- sd->append_text_position = pos;
- }
- }
- else
- {
- sd->append_text_position = sd->append_text_len;
- }
-
- backup = sd->append_text_left[sd->append_text_position];
- sd->append_text_left[sd->append_text_position] = '\0';
-
- edje_object_part_text_append
- (sd->entry_edje, "elm.text", sd->append_text_left + start);
-
- sd->append_text_left[sd->append_text_position] = backup;
-
- evas_event_thaw(evas_object_evas_get(obj));
- evas_event_thaw_eval(evas_object_evas_get(obj));
-
- _efl_ui_text_guide_update(obj, EINA_TRUE);
-
- /* If there's still more to go, renew the idler, else, cleanup */
- if (sd->append_text_position < sd->append_text_len)
- {
- return ECORE_CALLBACK_RENEW;
- }
- else
- {
- edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
- EDJE_CURSOR_MAIN, sd->cursor_pos);
- free(sd->append_text_left);
- sd->append_text_left = NULL;
- sd->append_text_idler = NULL;
- efl_event_callback_legacy_call
- (obj, EFL_UI_TEXT_EVENT_TEXT_SET_DONE, NULL);
- return ECORE_CALLBACK_CANCEL;
- }
-}
-
EOLIAN static void
_efl_ui_text_elm_layout_signal_emit(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *sd, const char *emission, const char *source)
{
@@ -2763,171 +2670,6 @@ _efl_ui_text_content_unset(Eo *obj, Efl_Ui_Text_Data *_pd EINA_UNUSED, const cha
}
#endif
-static void
-_entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
-{
- int len = 0;
- if (!entry) return;
-
- EFL_UI_TEXT_DATA_GET(obj, sd);
- len = strlen(entry);
-
- if (sd->append_text_left)
- {
- char *tmpbuf;
-
- tmpbuf = realloc(sd->append_text_left, sd->append_text_len + len + 1);
- if (!tmpbuf)
- {
- /* Do something */
- return;
- }
- sd->append_text_left = tmpbuf;
- memcpy(sd->append_text_left + sd->append_text_len, entry, len + 1);
- sd->append_text_len += len;
- }
- else
- {
- if (len > EFL_UI_TEXT_CHUNK_SIZE)
- {
- sd->append_text_left = (char *)malloc(len + 1);
- }
-
- if (sd->append_text_left)
- {
- memcpy(sd->append_text_left, entry, len + 1);
- sd->append_text_position = 0;
- sd->append_text_len = len;
- sd->append_text_idler = ecore_idler_add(_text_append_idler, obj);
- }
- else
- {
- if (set)
- {
- edje_object_part_text_set(sd->entry_edje, "elm.text", entry);
- }
- else
- {
- edje_object_part_text_append(sd->entry_edje, "elm.text", entry);
- }
- edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
- EDJE_CURSOR_MAIN, sd->cursor_pos);
- efl_event_callback_legacy_call(obj, EFL_UI_TEXT_EVENT_TEXT_SET_DONE, NULL);
- }
- }
-}
-
-EOLIAN static Eina_Bool
-_efl_ui_text_elm_layout_text_set(Eo *obj, Efl_Ui_Text_Data *sd, const char *part, const char *entry)
-{
- int len = 0;
-
- if (!entry) entry = "";
- if (part)
- {
- if (!strcmp(part, "guide"))
- edje_object_part_text_set(sd->entry_edje, "elm.guide", entry);
- else
- edje_object_part_text_set(sd->entry_edje, part, entry);
-
- return EINA_TRUE;
- }
-
- evas_event_freeze(evas_object_evas_get(obj));
- ELM_SAFE_FREE(sd->text, eina_stringshare_del);
- sd->changed = EINA_TRUE;
-
- /* Clear currently pending job if there is one */
- if (sd->append_text_idler)
- {
- ecore_idler_del(sd->append_text_idler);
- ELM_SAFE_FREE(sd->append_text_left, free);
- sd->append_text_idler = NULL;
- }
-
- len = strlen(entry);
- if (sd->append_text_left)
- {
- free(sd->append_text_left);
- sd->append_text_left = NULL;
- }
-
- /* Need to clear the entry first */
- edje_object_part_text_set(sd->entry_edje, "elm.text", "");
- _entry_text_append(obj, entry, EINA_TRUE);
-
- if (len > 0)
- _efl_ui_text_guide_update(obj, EINA_TRUE);
- else
- _efl_ui_text_guide_update(obj, EINA_FALSE);
-
- evas_event_thaw(evas_object_evas_get(obj));
- evas_event_thaw_eval(evas_object_evas_get(obj));
- return EINA_TRUE;
-}
-
-EOLIAN static const char *
-_efl_ui_text_elm_layout_text_get(Eo *obj, Efl_Ui_Text_Data *sd, const char *item)
-{
- const char *text;
- Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
- sd->text_obj = text_obj;
-
- if (item)
- {
- if (!strcmp(item, "default")) goto proceed;
- else if (!strcmp(item, "guide"))
- {
- return edje_object_part_text_get(sd->entry_edje, "elm.guide");
- }
- else
- {
- return edje_object_part_text_get(sd->entry_edje, item);
- }
- }
-
-proceed:
-
- text = efl_text_get(text_obj);
- if (!text)
- {
- ERR("text=NULL for edje %p, part 'elm.text'", sd->entry_edje);
-
- return NULL;
- }
-
- if (sd->append_text_len > 0)
- {
- char *tmpbuf;
- size_t len, tlen;
-
- tlen = strlen(text);
- len = tlen + sd->append_text_len - sd->append_text_position;
- /* FIXME: need that or we do copy uninitialised data */
- tmpbuf = calloc(1, len + 1);
- if (!tmpbuf)
- {
- ERR("Failed to allocate memory for entry's text %p", obj);
- return NULL;
- }
- memcpy(tmpbuf, text, tlen);
-
- if (sd->append_text_left)
- memcpy(tmpbuf + tlen, sd->append_text_left
- + sd->append_text_position, sd->append_text_len
- - sd->append_text_position);
- tmpbuf[len] = '\0';
- eina_stringshare_replace(&sd->text, tmpbuf);
- free(tmpbuf);
- }
- else
- {
- eina_stringshare_replace(&sd->text, text);
- }
-
- return sd->text;
-}
-
static char *
_access_info_cb(void *data EINA_UNUSED, Evas_Object *obj)
{
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index 9a305da920..d834c99da0 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -414,7 +414,6 @@ class Efl.Ui.Text (Elm.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Elm.Widget.focus_next_manager_is;
Elm.Layout.theme_enable;
Elm.Layout.sizing_eval;
- Elm.Layout.text { get; set; }
Elm.Layout.signal_callback_add;
Elm.Layout.signal_callback_del;
Elm.Layout.signal_emit;
diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c
index cba2001931..9db4a64c78 100644
--- a/src/lib/elementary/elc_fileselector.c
+++ b/src/lib/elementary/elc_fileselector.c
@@ -19,6 +19,9 @@
#include "elm_interface_fileselector.h"
#include "elm_widget_fileselector.h"
+#include "elm_fileselector_internal_part.eo.h"
+#include "elm_part_helper.h"
+
#define MY_CLASS ELM_FILESELECTOR_CLASS
#define MY_CLASS_NAME "Elm_Fileselector"
@@ -3108,7 +3111,7 @@ _elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselect
}
EOLIAN static Eina_Bool
-_elm_fileselector_elm_layout_text_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const char *part, const char *label)
+_elm_fileselector_text_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const char *part, const char *label)
{
if (!part) return EINA_FALSE;
@@ -3124,8 +3127,8 @@ _elm_fileselector_elm_layout_text_set(Eo *obj EINA_UNUSED, Elm_Fileselector_Data
}
else
{
- Eina_Bool int_ret = EINA_FALSE;
- int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
+ Eina_Bool int_ret = EINA_TRUE;
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
return int_ret;
}
@@ -3188,6 +3191,14 @@ _elm_fileselector_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA
return &atspi_actions[0];
}
+
+/* Efl.Part begin */
+
+ELM_PART_OVERRIDE(elm_fileselector, ELM_FILESELECTOR, ELM_LAYOUT, Elm_Fileselector_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector, ELM_FILESELECTOR, ELM_LAYOUT, Elm_Fileselector_Data, Elm_Part_Data)
+#include "elm_fileselector_internal_part.eo.c"
+
+/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
#define ELM_FILESELECTOR_EXTRA_OPS \
diff --git a/src/lib/elementary/elc_fileselector_entry.c b/src/lib/elementary/elc_fileselector_entry.c
index 2f011b7d4a..9c31c5e45a 100644
--- a/src/lib/elementary/elc_fileselector_entry.c
+++ b/src/lib/elementary/elc_fileselector_entry.c
@@ -256,11 +256,11 @@ _elm_fileselector_entry_elm_widget_disable(Eo *obj, Elm_Fileselector_Entry_Data
}
EOLIAN static Eina_Bool
-_elm_fileselector_entry_elm_layout_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, const char *label)
+_elm_fileselector_entry_text_set(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part, const char *label)
{
if (part && strcmp(part, "default"))
{
- return elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
}
elm_object_text_set(sd->button, label);
@@ -268,12 +268,12 @@ _elm_fileselector_entry_elm_layout_text_set(Eo *obj, Elm_Fileselector_Entry_Data
}
EOLIAN static const char *
-_elm_fileselector_entry_elm_layout_text_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
+_elm_fileselector_entry_text_get(Eo *obj, Elm_Fileselector_Entry_Data *sd, const char *part)
{
if (part && strcmp(part, "default"))
{
const char *text = NULL;
- text = elm_obj_layout_text_get(efl_super(obj, MY_CLASS), part);
+ text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
return text;
}
@@ -681,6 +681,8 @@ ELM_PART_OVERRIDE(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, El
ELM_PART_OVERRIDE_CONTENT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_fileselector_entry, ELM_FILESELECTOR_ENTRY, ELM_LAYOUT, Elm_Fileselector_Entry_Data, Elm_Part_Data)
#include "elm_fileselector_entry_internal_part.eo.c"
/* Efl.Part end */
diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c
index f3098eaaa4..7d00d6dd96 100644
--- a/src/lib/elementary/elc_multibuttonentry.c
+++ b/src/lib/elementary/elc_multibuttonentry.c
@@ -10,6 +10,9 @@
#include "elm_priv.h"
#include "elm_widget_multibuttonentry.h"
+#include "elm_multibuttonentry_internal_part.eo.h"
+#include "elm_part_helper.h"
+
#define MY_CLASS ELM_MULTIBUTTONENTRY_CLASS
#define MY_CLASS_NAME "Elm_Multibuttonentry"
@@ -1505,9 +1508,9 @@ _view_init(Evas_Object *obj, Elm_Multibuttonentry_Data *sd)
}
EOLIAN static Eina_Bool
-_elm_multibuttonentry_elm_layout_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label)
+_elm_multibuttonentry_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd EINA_UNUSED, const char *part, const char *label)
{
- Eina_Bool int_ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_TRUE;
if (!part || !strcmp(part, "default"))
{
@@ -1520,13 +1523,13 @@ _elm_multibuttonentry_elm_layout_text_set(Eo *obj, Elm_Multibuttonentry_Data *sd
int_ret = EINA_TRUE;
}
else
- int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
return int_ret;
}
EOLIAN static const char*
-_elm_multibuttonentry_elm_layout_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const char *part)
+_elm_multibuttonentry_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd, const char *part)
{
const char *text = NULL;
@@ -1539,7 +1542,7 @@ _elm_multibuttonentry_elm_layout_text_get(Eo *obj, Elm_Multibuttonentry_Data *sd
text = sd->guide_text_str;
}
else
- text = elm_obj_layout_text_get(efl_super(obj, MY_CLASS), part);
+ text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
return text;
}
@@ -2101,6 +2104,14 @@ _elm_multibuttonentry_item_elm_interface_atspi_widget_action_elm_actions_get(Eo
return &atspi_actions[0];
}
+/* Efl.Part begin */
+
+ELM_PART_OVERRIDE(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, ELM_LAYOUT, Elm_Multibuttonentry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, ELM_LAYOUT, Elm_Multibuttonentry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_multibuttonentry, ELM_MULTIBUTTONENTRY, ELM_LAYOUT, Elm_Multibuttonentry_Data, Elm_Part_Data)
+#include "elm_multibuttonentry_internal_part.eo.c"
+
+/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
#define ELM_MULTIBUTTONENTRY_EXTRA_OPS \
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index dbae4ec2eb..8d908eb3df 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -1028,7 +1028,7 @@ _elm_naviframe_elm_layout_signal_emit(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSE
/* content/text smart functions proxying things to the top item, which
* is the resize object of the layout */
EOLIAN static Eina_Bool
-_elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, const char *label)
+_elm_naviframe_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part, const char *label)
{
Elm_Object_Item *it;
const char *text = NULL;
@@ -1044,7 +1044,7 @@ _elm_naviframe_elm_layout_text_set(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED,
}
EOLIAN static const char*
-_elm_naviframe_elm_layout_text_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
+_elm_naviframe_text_get(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, const char *part)
{
Elm_Object_Item *it = elm_naviframe_top_item_get(obj);
if (!it) return NULL;
@@ -2074,6 +2074,8 @@ ELM_PART_OVERRIDE(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data,
ELM_PART_OVERRIDE_CONTENT_SET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_naviframe, ELM_NAVIFRAME, ELM_LAYOUT, Elm_Naviframe_Data, Elm_Part_Data)
#include "elm_naviframe_internal_part.eo.c"
/* Efl.Part end */
diff --git a/src/lib/elementary/elc_popup.c b/src/lib/elementary/elc_popup.c
index 9608630783..afeb003be8 100644
--- a/src/lib/elementary/elc_popup.c
+++ b/src/lib/elementary/elc_popup.c
@@ -1057,7 +1057,7 @@ end:
}
EOLIAN static Eina_Bool
-_elm_popup_elm_layout_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, const char *label)
+_elm_popup_text_set(Eo *obj, Elm_Popup_Data *_pd, const char *part, const char *label)
{
Eina_Bool int_ret = EINA_FALSE;
@@ -1091,7 +1091,7 @@ _content_text_get(const Elm_Popup_Data *sd)
}
EOLIAN static const char*
-_elm_popup_elm_layout_text_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part)
+_elm_popup_text_get(Eo *obj EINA_UNUSED, Elm_Popup_Data *_pd, const char *part)
{
const char *text = NULL;
@@ -1915,6 +1915,8 @@ ELM_PART_OVERRIDE(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Dat
ELM_PART_OVERRIDE_CONTENT_SET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_popup, ELM_POPUP, ELM_LAYOUT, Elm_Popup_Data, Elm_Part_Data)
#include "elm_popup_internal_part.eo.c"
/* Efl.Part end */
diff --git a/src/lib/elementary/elm_actionslider.c b/src/lib/elementary/elm_actionslider.c
index e3e09dbee1..b4a9508197 100644
--- a/src/lib/elementary/elm_actionslider.c
+++ b/src/lib/elementary/elm_actionslider.c
@@ -13,6 +13,9 @@
#include "elm_actionslider.eo.h"
+#include "elm_actionslider_internal_part.eo.h"
+#include "elm_part_helper.h"
+
#define MY_CLASS ELM_ACTIONSLIDER_CLASS
#define MY_CLASS_NAME "Elm_Actionslider"
@@ -449,24 +452,24 @@ _mirrored_part_fix(const Evas_Object *obj,
}
EOLIAN static Eina_Bool
-_elm_actionslider_elm_layout_text_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part, const char *text)
+_elm_actionslider_text_set(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part, const char *text)
{
- Eina_Bool int_ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_TRUE;
_mirrored_part_fix(obj, &part);
- int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, text);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), text);
return int_ret;
}
EOLIAN static const char*
-_elm_actionslider_elm_layout_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part)
+_elm_actionslider_text_get(Eo *obj, Elm_Actionslider_Data *_pd EINA_UNUSED, const char *part)
{
const char *text = NULL;
_mirrored_part_fix(obj, &part);
- text = elm_obj_layout_text_get(efl_super(obj, MY_CLASS), part);
+ text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
return text;
}
@@ -654,6 +657,14 @@ _elm_actionslider_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
+/* Efl.Part begin */
+ELM_PART_OVERRIDE(elm_actionslider, ELM_ACTIONSLIDER, ELM_LAYOUT, Elm_Actionslider_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_actionslider, ELM_ACTIONSLIDER, ELM_LAYOUT, Elm_Actionslider_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_actionslider, ELM_ACTIONSLIDER, ELM_LAYOUT, Elm_Actionslider_Data, Elm_Part_Data)
+
+#include "elm_actionslider_internal_part.eo.c"
+/* Efl.Part end */
+
/* Internal EO APIs and hidden overrides */
#define ELM_ACTIONSLIDER_EXTRA_OPS \
diff --git a/src/lib/elementary/elm_actionslider.eo b/src/lib/elementary/elm_actionslider.eo
index c7d4328edb..1b65127631 100644
--- a/src/lib/elementary/elm_actionslider.eo
+++ b/src/lib/elementary/elm_actionslider.eo
@@ -74,9 +74,9 @@ class Elm.Actionslider (Elm.Layout, Efl.Ui.Selectable)
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.theme_apply;
- Elm.Layout.text { get; set; }
Elm.Layout.text_aliases { get; }
Elm.Layout.sizing_eval;
+ Efl.Part.part;
}
events {
pos_changed; [[The position of the actionslider has changed]]
diff --git a/src/lib/elementary/elm_actionslider_internal_part.eo b/src/lib/elementary/elm_actionslider_internal_part.eo
new file mode 100644
index 0000000000..cd5b42fba0
--- /dev/null
+++ b/src/lib/elementary/elm_actionslider_internal_part.eo
@@ -0,0 +1,8 @@
+class Elm_Actionslider.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
+{
+ [[Elementary Actionslider internal part class]]
+ data: null;
+ implements {
+ Efl.Text.text { set; get; }
+ }
+}
diff --git a/src/lib/elementary/elm_bubble.c b/src/lib/elementary/elm_bubble.c
index 15d67e418c..520a16198d 100644
--- a/src/lib/elementary/elm_bubble.c
+++ b/src/lib/elementary/elm_bubble.c
@@ -11,6 +11,9 @@
#include "elm_widget_bubble.h"
#include "elm_widget_layout.h"
+#include "elm_bubble_internal_part.eo.h"
+#include "elm_part_helper.h"
+
#define MY_CLASS ELM_BUBBLE_CLASS
#define MY_CLASS_NAME "Elm_Bubble"
@@ -114,11 +117,11 @@ _elm_bubble_elm_widget_focus_direction(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED
}
EOLIAN static Eina_Bool
-_elm_bubble_elm_layout_text_set(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, const char *part, const char *label)
+_elm_bubble_text_set(Eo *obj, Elm_Bubble_Data *_pd EINA_UNUSED, const char *part, const char *label)
{
- Eina_Bool int_ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_TRUE;
- int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
if (!int_ret) return EINA_FALSE;
if (part && (!strcmp(part, "info") || !strcmp(part, "elm.info")))
@@ -288,6 +291,12 @@ _elm_bubble_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
+/* Efl.Part begin */
+ELM_PART_OVERRIDE(elm_bubble, ELM_BUBBLE, ELM_LAYOUT, Elm_Bubble_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_bubble, ELM_BUBBLE, ELM_LAYOUT, Elm_Bubble_Data, Elm_Part_Data)
+
+#include "elm_bubble_internal_part.eo.c"
+/* Efl.Part end */
/* Internal EO APIs and hidden overrides */
#define ELM_BUBBLE_EXTRA_OPS \
diff --git a/src/lib/elementary/elm_bubble.eo b/src/lib/elementary/elm_bubble.eo
index 2c0efbad36..0fb9557d89 100644
--- a/src/lib/elementary/elm_bubble.eo
+++ b/src/lib/elementary/elm_bubble.eo
@@ -43,9 +43,9 @@ class Elm.Bubble (Elm.Layout, Efl.Ui.Clickable)
Elm.Widget.focus_next;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.access;
- Elm.Layout.text { set; }
Elm.Layout.text_aliases { get; }
Elm.Layout.content_aliases { get; }
Elm.Layout.sizing_eval;
+ Efl.Part.part;
}
}
diff --git a/src/lib/elementary/elm_bubble_internal_part.eo b/src/lib/elementary/elm_bubble_internal_part.eo
new file mode 100644
index 0000000000..60654cf3a5
--- /dev/null
+++ b/src/lib/elementary/elm_bubble_internal_part.eo
@@ -0,0 +1,8 @@
+class Elm_Bubble.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
+{
+ [[Elementary Bubble internal part class]]
+ data: null;
+ implements {
+ Efl.Text.text { set; }
+ }
+}
diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c
index 1880a03cb9..16db1db585 100644
--- a/src/lib/elementary/elm_entry.c
+++ b/src/lib/elementary/elm_entry.c
@@ -3187,7 +3187,7 @@ _entry_text_append(Evas_Object* obj, const char* entry, Eina_Bool set)
}
EOLIAN static Eina_Bool
-_elm_entry_elm_layout_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, const char *entry)
+_elm_entry_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, const char *entry)
{
int len = 0;
@@ -3238,7 +3238,7 @@ _elm_entry_elm_layout_text_set(Eo *obj, Elm_Entry_Data *sd, const char *part, co
}
EOLIAN static const char *
-_elm_entry_elm_layout_text_get(Eo *obj, Elm_Entry_Data *sd, const char *item)
+_elm_entry_text_get(Eo *obj, Elm_Entry_Data *sd, const char *item)
{
const char *text;
@@ -4139,7 +4139,7 @@ elm_entry_entry_set(Evas_Object *obj,
const char *entry)
{
ELM_ENTRY_CHECK(obj);
- elm_obj_layout_text_set(obj, NULL, entry);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), entry);
}
EAPI const char *
@@ -4147,7 +4147,7 @@ elm_entry_entry_get(const Evas_Object *obj)
{
ELM_ENTRY_CHECK(obj) NULL;
const char *text = NULL;
- text = elm_obj_layout_text_get((Eo *)obj, NULL);
+ text = efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text"));
return text;
}
@@ -6021,6 +6021,8 @@ _elm_entry_elm_interface_atspi_accessible_name_get(Eo *obj, Elm_Entry_Data *sd)
ELM_PART_OVERRIDE(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_SET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
ELM_PART_OVERRIDE_CONTENT_UNSET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_GET(elm_entry, ELM_ENTRY, ELM_LAYOUT, Elm_Entry_Data, Elm_Part_Data)
#include "elm_entry_internal_part.eo.c"
/* Efl.Part end */
diff --git a/src/lib/elementary/elm_entry.eo b/src/lib/elementary/elm_entry.eo
index 5a208d45cc..cb028fa282 100644
--- a/src/lib/elementary/elm_entry.eo
+++ b/src/lib/elementary/elm_entry.eo
@@ -955,7 +955,6 @@ class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
Elm.Widget.focus_next_manager_is;
Elm.Layout.theme_enable;
Elm.Layout.sizing_eval;
- Elm.Layout.text { get; set; }
Elm.Layout.signal_callback_add;
Elm.Layout.signal_callback_del;
Elm.Layout.signal_emit;
diff --git a/src/lib/elementary/elm_entry_internal_part.eo b/src/lib/elementary/elm_entry_internal_part.eo
index b0c0e95ec8..c58037f832 100644
--- a/src/lib/elementary/elm_entry_internal_part.eo
+++ b/src/lib/elementary/elm_entry_internal_part.eo
@@ -1,9 +1,10 @@
-class Elm.Entry.Internal.Part (Elm.Layout.Internal.Part)
+class Elm.Entry.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
{
[[Elementary entry internal part class]]
data: null;
implements {
Efl.Container.content { set; }
Efl.Container.content_unset;
+ Efl.Text.text { set; get; }
}
}
diff --git a/src/lib/elementary/elm_fileselector.eo b/src/lib/elementary/elm_fileselector.eo
index 82ec570b1c..d9f1e82142 100644
--- a/src/lib/elementary/elm_fileselector.eo
+++ b/src/lib/elementary/elm_fileselector.eo
@@ -41,7 +41,6 @@ class Elm.Fileselector (Elm.Layout, Elm.Interface.Fileselector,
Elm.Widget.widget_event;
Elm.Widget.theme_apply;
Elm.Widget.focus_next_manager_is;
- Elm.Layout.text { set; }
Elm.Interface.Fileselector.selected_models { get; }
Elm.Interface.Fileselector.selected_model_get;
Elm.Interface.Fileselector.selected_model_set;
@@ -59,6 +58,7 @@ class Elm.Fileselector (Elm.Layout, Elm.Interface.Fileselector,
Elm.Interface.Fileselector.mode { get; set; }
Elm.Interface.Fileselector.current_name { get; set; }
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
+ Efl.Part.part;
}
events {
done; [[Called when OK button was pressed]]
diff --git a/src/lib/elementary/elm_fileselector_entry.eo b/src/lib/elementary/elm_fileselector_entry.eo
index e69505507a..50667a99f0 100644
--- a/src/lib/elementary/elm_fileselector_entry.eo
+++ b/src/lib/elementary/elm_fileselector_entry.eo
@@ -11,7 +11,6 @@ class Elm.Fileselector_Entry (Elm.Layout, Elm.Interface.Fileselector,
Elm.Widget.focus_next;
Elm.Widget.disable;
Elm.Widget.focus_direction_manager_is;
- Elm.Layout.text { get; set; }
Elm.Layout.sizing_eval;
Elm.Interface.Fileselector.selected_model_get;
Elm.Interface.Fileselector.selected_model_set;
diff --git a/src/lib/elementary/elm_fileselector_entry_internal_part.eo b/src/lib/elementary/elm_fileselector_entry_internal_part.eo
index 6c1ede2616..b5cb388083 100644
--- a/src/lib/elementary/elm_fileselector_entry_internal_part.eo
+++ b/src/lib/elementary/elm_fileselector_entry_internal_part.eo
@@ -1,9 +1,10 @@
-class Elm.Fileselector.Entry.Internal.Part (Elm.Layout.Internal.Part)
+class Elm.Fileselector.Entry.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
{
[[Elementary fileselector entry internal part class]]
data: null;
implements {
Efl.Container.content { get; set; }
Efl.Container.content_unset;
+ Efl.Text.text { set; get; }
}
}
diff --git a/src/lib/elementary/elm_fileselector_internal_part.eo b/src/lib/elementary/elm_fileselector_internal_part.eo
new file mode 100644
index 0000000000..2403b5fcb9
--- /dev/null
+++ b/src/lib/elementary/elm_fileselector_internal_part.eo
@@ -0,0 +1,9 @@
+class Elm.Fileselector.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
+{
+ [[Elementary fileselector entry internal part class]]
+ data: null;
+ implements {
+ Efl.Text.text { set; }
+ }
+}
+
diff --git a/src/lib/elementary/elm_label.c b/src/lib/elementary/elm_label.c
index 982cd49fde..10a009cda1 100644
--- a/src/lib/elementary/elm_label.c
+++ b/src/lib/elementary/elm_label.c
@@ -10,6 +10,8 @@
#include "elm_priv.h"
#include "elm_widget_layout.h"
#include "elm_widget_label.h"
+#include "elm_label_internal_part.eo.h"
+#include "elm_part_helper.h"
#define MY_CLASS ELM_LABEL_CLASS
@@ -338,15 +340,16 @@ _stringshare_key_value_replace(const char **srcstring, const char *key, const ch
}
EOLIAN static Eina_Bool
-_elm_label_elm_layout_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *label)
+_elm_label_text_set(Eo *obj, Elm_Label_Data *sd, const char *part, const char *label)
{
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, EINA_FALSE);
- Eina_Bool int_ret = EINA_FALSE;
+ Eina_Bool int_ret = EINA_TRUE;
if (!label) label = "";
_label_format_set(wd->resize_obj, sd->format);
- int_ret = elm_obj_layout_text_set(efl_super(obj, MY_CLASS), part, label);
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
+
if (int_ret)
{
sd->lastw = -1;
@@ -643,6 +646,13 @@ _elm_label_class_constructor(Efl_Class *klass)
evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass);
}
+/* Efl.Part begin */
+ELM_PART_OVERRIDE(elm_label, ELM_LABEL, ELM_LAYOUT, Elm_Label_Data, Elm_Part_Data)
+ELM_PART_OVERRIDE_TEXT_SET(elm_label, ELM_LABEL, ELM_LAYOUT, Elm_Label_Data, Elm_Part_Data)
+
+#include "elm_label_internal_part.eo.c"
+/* Efl.Part end */
+
/* Internal EO APIs and hidden overrides */
#define ELM_LABEL_EXTRA_OPS \
diff --git a/src/lib/elementary/elm_label.eo b/src/lib/elementary/elm_label.eo
index a8d6f28853..c6525c3fef 100644
--- a/src/lib/elementary/elm_label.eo
+++ b/src/lib/elementary/elm_label.eo
@@ -127,9 +127,9 @@ class Elm.Label (Elm.Layout)
Elm.Widget.focus_next_manager_is;
Elm.Widget.focus_direction_manager_is;
Elm.Widget.theme_apply;
- Elm.Layout.text { set; }
Elm.Layout.text_aliases { get; }
Elm.Layout.sizing_eval;
+ Efl.Part.part;
}
events {
slide,end; [[Called when slide stopped]]
diff --git a/src/lib/elementary/elm_label_internal_part.eo b/src/lib/elementary/elm_label_internal_part.eo
new file mode 100644
index 0000000000..881c7fd65f
--- /dev/null
+++ b/src/lib/elementary/elm_label_internal_part.eo
@@ -0,0 +1,8 @@
+class Elm_Label.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
+{
+ [[Elementary button internal part class]]
+ data: null;
+ implements {
+ Efl.Text.text { set; }
+ }
+}
diff --git a/src/lib/elementary/elm_layout.c b/src/lib/elementary/elm_layout.c
index d63b015305..18e6f5a03a 100644
--- a/src/lib/elementary/elm_layout.c
+++ b/src/lib/elementary/elm_layout.c
@@ -2315,6 +2315,19 @@ elm_layout_table_clear(Elm_Layout *obj, const char *part, Eina_Bool clear)
return efl_pack_unpack_all(efl_part(obj, part));
}
+EAPI Eina_Bool
+elm_layout_text_set(Elm_Layout *obj, const char *part, const char *text)
+{
+ efl_text_set(efl_part(obj, part), text);
+ return EINA_TRUE;
+}
+
+EAPI const char *
+elm_layout_text_get(const Elm_Layout *obj, const char *part)
+{
+ return efl_text_get(efl_part(obj, part));
+}
+
/* Efl.Part implementation */
static EOLIAN Efl_Object *
@@ -2354,6 +2367,8 @@ ELM_PART_IMPLEMENT_DESTRUCTOR(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm
ELM_PART_IMPLEMENT_CONTENT_SET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_GET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
ELM_PART_IMPLEMENT_CONTENT_UNSET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
+ELM_PART_IMPLEMENT_TEXT_SET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
+ELM_PART_IMPLEMENT_TEXT_GET(elm_layout, ELM_LAYOUT, Elm_Layout_Smart_Data, Elm_Part_Data)
#include "elm_layout_internal_part.eo.c"
/* Efl.Part end */
diff --git a/src/lib/elementary/elm_layout.eo b/src/lib/elementary/elm_layout.eo
index 2e83d1da4a..48ce1d51ab 100644
--- a/src/lib/elementary/elm_layout.eo
+++ b/src/lib/elementary/elm_layout.eo
@@ -196,21 +196,6 @@ class Elm.Layout (Elm.Widget, Efl.Part, Efl.Container, Efl.File,
@in part_name: string; [[A part from loaded edje group.]]
}
}
- @property text {
- set {
- [[Set the text of the given part.]]
- return: bool; [[$true on success, $false otherwise]]
- }
- get {
- [[Get the text set in the given part.]]
- }
- keys {
- part: string @nullable; [[The TEXT part where to set the text.]]
- }
- values {
- text: string @nullable; [[The text to set.]]
- }
- }
signal_callback_add {
[[Add a callback for a (Edje) signal emitted by a layout widget's
underlying Edje object.
diff --git a/src/lib/elementary/elm_layout_internal_part.eo b/src/lib/elementary/elm_layout_internal_part.eo
index 4ce15a3432..d790cd49f3 100644
--- a/src/lib/elementary/elm_layout_internal_part.eo
+++ b/src/lib/elementary/elm_layout_internal_part.eo
@@ -1,4 +1,4 @@
-class Elm.Layout.Internal.Part (Efl.Object, Efl.Container)
+class Elm.Layout.Internal.Part (Efl.Object, Efl.Container, Efl.Text)
{
[[Elementary layout internal part class]]
data: Elm_Part_Data;
@@ -6,5 +6,6 @@ class Elm.Layout.Internal.Part (Efl.Object, Efl.Container)
Efl.Object.destructor;
Efl.Container.content { get; set; }
Efl.Container.content_unset;
+ Efl.Text.text { set; get; }
}
}
diff --git a/src/lib/elementary/elm_layout_legacy.h b/src/lib/elementary/elm_layout_legacy.h
index c9654d23fe..0bae5a05e2 100644
--- a/src/lib/elementary/elm_layout_legacy.h
+++ b/src/lib/elementary/elm_layout_legacy.h
@@ -368,4 +368,27 @@ EAPI int elm_layout_freeze(Evas_Object *obj);
*/
EAPI int elm_layout_thaw(Evas_Object *obj);
+/**
+ * @brief Set the text of the given part.
+ *
+ * @param[in] part The TEXT part where to set the text.
+ * @param[in] text The text to set.
+ *
+ * @return @c true on success, @c false otherwise
+ *
+ * @ingroup Elm_Layout
+ */
+EAPI Eina_Bool elm_layout_text_set(Elm_Layout *obj, const char * part, const char *text);
+
+/**
+ * @brief Get the text set in the given part.
+ *
+ * @param[in] part The TEXT part where to set the text.
+ *
+ * @return The text to set.
+ *
+ * @ingroup Elm_Layout
+ */
+EAPI const char *elm_layout_text_get(const Elm_Layout *obj, const char * part);
+
#include "elm_layout.eo.legacy.h"
diff --git a/src/lib/elementary/elm_multibuttonentry.eo b/src/lib/elementary/elm_multibuttonentry.eo
index 51cfc6129f..bc32aef002 100644
--- a/src/lib/elementary/elm_multibuttonentry.eo
+++ b/src/lib/elementary/elm_multibuttonentry.eo
@@ -187,9 +187,9 @@ class Elm.Multibuttonentry (Elm.Layout)
Elm.Widget.on_focus;
Elm.Widget.translate;
Elm.Widget.widget_event;
- Elm.Layout.text { get; set; }
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Accessible.children { get; }
+ Efl.Part.part;
}
events {
item,selected; [[Called when item was selected]]
diff --git a/src/lib/elementary/elm_multibuttonentry_internal_part.eo b/src/lib/elementary/elm_multibuttonentry_internal_part.eo
new file mode 100644
index 0000000000..1471fbba0d
--- /dev/null
+++ b/src/lib/elementary/elm_multibuttonentry_internal_part.eo
@@ -0,0 +1,9 @@
+class Elm.Multibuttonentry.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
+{
+ [[Elementary multibuttonentry internal part class]]
+ data: null;
+ implements {
+ Efl.Text.text { set; get; }
+ }
+}
+
diff --git a/src/lib/elementary/elm_naviframe.eo b/src/lib/elementary/elm_naviframe.eo
index 2fe7e4ab5b..4619bd792c 100644
--- a/src/lib/elementary/elm_naviframe.eo
+++ b/src/lib/elementary/elm_naviframe.eo
@@ -152,7 +152,6 @@ class Elm.Naviframe (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
Elm.Widget.translate;
Elm.Widget.theme_apply;
Elm.Widget.widget_event;
- Elm.Layout.text { get; set; }
Elm.Layout.signal_emit;
Elm.Layout.sizing_eval;
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
diff --git a/src/lib/elementary/elm_naviframe_internal_part.eo b/src/lib/elementary/elm_naviframe_internal_part.eo
index 1427e78b8c..a3821cb265 100644
--- a/src/lib/elementary/elm_naviframe_internal_part.eo
+++ b/src/lib/elementary/elm_naviframe_internal_part.eo
@@ -5,5 +5,6 @@ class Elm.Naviframe.Internal.Part (Elm.Layout.Internal.Part)
implements {
Efl.Container.content { get; set; }
Efl.Container.content_unset;
+ Efl.Text.text { set; get; }
}
}
diff --git a/src/lib/elementary/elm_part_helper.h b/src/lib/elementary/elm_part_helper.h
index 36c7888406..71d34c91e7 100644
--- a/src/lib/elementary/elm_part_helper.h
+++ b/src/lib/elementary/elm_part_helper.h
@@ -77,6 +77,21 @@ _ ## type ## _internal_part_efl_container_content_unset(Eo *obj, partdata *pd) \
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, pd->sd, pd->part)); \
}
+#define ELM_PART_IMPLEMENT_TEXT_SET(type, TYPE, typedata, partdata) \
+static EOLIAN void \
+_ ## type ## _internal_part_efl_text_text_set(Eo *obj EINA_UNUSED, partdata *pd, const char *text) \
+{ \
+ _ ## type ## _text_set(pd->obj, pd->sd, pd->part, text); \
+}
+
+#define ELM_PART_IMPLEMENT_TEXT_GET(type, TYPE, typedata, partdata) \
+static EOLIAN const char * \
+_ ## type ## _internal_part_efl_text_text_get(Eo *obj, partdata *pd) \
+{ \
+ ELM_PART_RETURN_VAL(_ ## type ## _text_get(pd->obj, pd->sd, pd->part)); \
+}
+
+
// For widgets that inherit from something with parts (eg. from Elm.Layout)
#define ELM_PART_OVERRIDE(type, TYPE, SUPER, typedata, partdata) \
static EOLIAN Efl_Object * \
@@ -125,17 +140,34 @@ _ ## type ## _internal_part_efl_container_content_unset(Eo *obj, void *_pd EINA_
ELM_PART_RETURN_VAL(_ ## type ## _content_unset(pd->obj, sd, pd->part)); \
}
-#define EFL_TEXT_DEFAULT_IMPLEMENT(type, Type) \
+#define ELM_PART_OVERRIDE_TEXT_SET(type, TYPE, SUPER, typedata, partdata) \
+static EOLIAN void \
+_ ## type ## _internal_part_efl_text_text_set(Eo *obj, void *_pd EINA_UNUSED, const char *text) \
+{ \
+ partdata *pd = efl_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
+ typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ ELM_PART_CALL(_ ## type ## _text_set(pd->obj, sd, pd->part, text)); \
+}
+
+#define ELM_PART_OVERRIDE_TEXT_GET(type, TYPE, SUPER, typedata, partdata) \
+static EOLIAN const char *\
+_ ## type ## _internal_part_efl_text_text_get(Eo *obj, void *_pd EINA_UNUSED) \
+{ \
+ partdata *pd = efl_data_scope_get(obj, SUPER ## _INTERNAL_PART_CLASS); \
+ typedata *sd = efl_data_scope_get(pd->obj, TYPE ## _CLASS); \
+ ELM_PART_RETURN_VAL(_ ## type ## _text_get(pd->obj, sd, pd->part)); \
+}
+
+#define EFL_TEXT_PART_DEFAULT_IMPLEMENT(type, Type) \
EOLIAN static void \
_ ## type ## _efl_text_text_set(Eo *obj, Type *pd EINA_UNUSED, const char *text) \
{ \
- elm_layout_text_set(obj, NULL, text); \
+ efl_text_set(efl_part(efl_super(obj, MY_CLASS), "elm.text"), text); \
} \
-\
EOLIAN static const char * \
-_ ## type ## _efl_text_text_get(Eo *obj, Efl_Ui_Button_Data *pd EINA_UNUSED) \
+_ ## type ## _efl_text_text_get(Eo *obj, Type *pd EINA_UNUSED) \
{ \
- return elm_layout_text_get(obj, NULL); \
+ return efl_text_get(efl_part(efl_super(obj, MY_CLASS), "elm.text")); \
}
#endif
diff --git a/src/lib/elementary/elm_popup.eo b/src/lib/elementary/elm_popup.eo
index 38f220b42a..83011a08f7 100644
--- a/src/lib/elementary/elm_popup.eo
+++ b/src/lib/elementary/elm_popup.eo
@@ -178,7 +178,6 @@ class Elm.Popup (Elm.Layout, Elm.Interface.Atspi_Widget_Action)
Elm.Widget.translate;
Elm.Widget.sub_object_del;
Elm.Widget.widget_event;
- Elm.Layout.text { get; set; }
Elm.Layout.sizing_eval;
Elm.Layout.signal_emit;
Elm.Interface.Atspi_Widget_Action.elm_actions { get; }
diff --git a/src/lib/elementary/elm_popup_internal_part.eo b/src/lib/elementary/elm_popup_internal_part.eo
index 8aa84325d4..76a26ba9d8 100644
--- a/src/lib/elementary/elm_popup_internal_part.eo
+++ b/src/lib/elementary/elm_popup_internal_part.eo
@@ -1,9 +1,10 @@
-class Elm.Popup.Internal.Part (Elm.Layout.Internal.Part)
+class Elm.Popup.Internal.Part (Elm.Layout.Internal.Part, Efl.Text)
{
[[Elementary popup internal part class]]
data: null;
implements {
Efl.Container.content { get; set; }
Efl.Container.content_unset;
+ Efl.Text.text { set; get; }
}
}