summaryrefslogtreecommitdiff
path: root/src/lib/elementary
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2018-11-12 18:57:24 +0200
committerDaniel Hirt <hirt.danny@gmail.com>2018-11-26 13:17:07 +0200
commitfed99f8d1352da66ae3321e7a79dad856237628e (patch)
treee018060a9e333aaaaa9e9fe1c6350b56437316fb /src/lib/elementary
parent552e7c041e95aa7fedeb7098551829819a76dfbc (diff)
Ui text: implement efl_part and part_text API to text_set
Diffstat (limited to 'src/lib/elementary')
-rw-r--r--src/lib/elementary/efl_ui_text.c51
-rw-r--r--src/lib/elementary/efl_ui_text.eo1
-rw-r--r--src/lib/elementary/efl_ui_text_part.eo8
-rw-r--r--src/lib/elementary/meson.build3
4 files changed, 56 insertions, 7 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 6cded21d5d..9c0d292356 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -6,6 +6,7 @@
6#define EFL_ACCESS_TEXT_PROTECTED 6#define EFL_ACCESS_TEXT_PROTECTED
7#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED 7#define EFL_ACCESS_EDITABLE_TEXT_PROTECTED
8#define ELM_LAYOUT_PROTECTED 8#define ELM_LAYOUT_PROTECTED
9#define EFL_PART_PROTECTED
9 10
10#include <Elementary.h> 11#include <Elementary.h>
11#include <Elementary_Cursor.h> 12#include <Elementary_Cursor.h>
@@ -15,6 +16,8 @@
15#include "elm_widget_entry.h" 16#include "elm_widget_entry.h"
16#include "efl_ui_text.eo.h" 17#include "efl_ui_text.eo.h"
17#include "elm_hoversel.eo.h" 18#include "elm_hoversel.eo.h"
19#include "efl_ui_text_part.eo.h"
20#include "elm_part_helper.h"
18 21
19typedef struct _Efl_Ui_Text_Data Efl_Ui_Text_Data; 22typedef struct _Efl_Ui_Text_Data Efl_Ui_Text_Data;
20typedef struct _Efl_Ui_Text_Rectangle Efl_Ui_Text_Rectangle; 23typedef struct _Efl_Ui_Text_Rectangle Efl_Ui_Text_Rectangle;
@@ -4002,16 +4005,52 @@ _efl_ui_text_item_factory_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd)
4002 return pd->item_factory; 4005 return pd->item_factory;
4003} 4006}
4004 4007
4005#if 0
4006/* Efl.Part begin */ 4008/* Efl.Part begin */
4007 4009
4008ELM_PART_OVERRIDE(elm_entry, EFL_UI_TEXT, Efl_Ui_Text_Data) 4010#define STRCMP(X, Y) strncmp((X), (Y), strlen(X))
4009ELM_PART_OVERRIDE_CONTENT_SET(elm_entry, EFL_UI_TEXT, Efl_Ui_Text_Data) 4011
4010ELM_PART_OVERRIDE_CONTENT_UNSET(elm_entry, EFL_UI_TEXT, Efl_Ui_Text_Data) 4012EOLIAN static Eina_Bool
4011#include "elm_entry_part.eo.c" 4013_efl_ui_text_text_set(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd,
4014 const char *part, const char *text)
4015{
4016 if (!STRCMP("efl.text_guide", part))
4017 {
4018 efl_text_set(pd->text_guide_obj, text);
4019 return EINA_TRUE;
4020 }
4021 else if (!STRCMP("efl.text", part))
4022 {
4023 efl_text_set(pd->text_obj, text);
4024 return EINA_TRUE;
4025 }
4026
4027 return EINA_FALSE;
4028}
4029
4030EOLIAN static const char *
4031_efl_ui_text_text_get(Eo *obj EINA_UNUSED, Efl_Ui_Text_Data *pd,
4032 const char *part)
4033{
4034 if (!STRCMP("efl.text_guide", part))
4035 {
4036 return efl_text_get(pd->text_guide_obj);
4037 }
4038 else if (!STRCMP("efl.text", part))
4039 {
4040 return efl_text_get(pd->text_obj);
4041 }
4042
4043 return NULL;
4044}
4045
4046#undef STRCMP
4047
4048ELM_PART_OVERRIDE(efl_ui_text, EFL_UI_TEXT, Efl_Ui_Text_Data)
4049ELM_PART_OVERRIDE_TEXT_SET(efl_ui_text, EFL_UI_TEXT, Efl_Ui_Text_Data)
4050ELM_PART_OVERRIDE_TEXT_GET(efl_ui_text, EFL_UI_TEXT, Efl_Ui_Text_Data)
4051#include "efl_ui_text_part.eo.c"
4012 4052
4013/* Efl.Part end */ 4053/* Efl.Part end */
4014#endif
4015 4054
4016/* Internal EO APIs and hidden overrides */ 4055/* Internal EO APIs and hidden overrides */
4017 4056
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index 0f4ab33a1e..6b199e8091 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -364,6 +364,7 @@ class Efl.Ui.Text (Efl.Ui.Layout, Efl.Ui.Clickable,
364 Efl.Access.Editable.Text.paste; 364 Efl.Access.Editable.Text.paste;
365 Efl.File.file { get; set; } 365 Efl.File.file { get; set; }
366 Efl.Text_Interactive.editable { set; } 366 Efl.Text_Interactive.editable { set; }
367 Efl.Part.part_get;
367 } 368 }
368 events { 369 events {
369 changed: void; [[Called when entry changes]] 370 changed: void; [[Called when entry changes]]
diff --git a/src/lib/elementary/efl_ui_text_part.eo b/src/lib/elementary/efl_ui_text_part.eo
new file mode 100644
index 0000000000..a0a4b13463
--- /dev/null
+++ b/src/lib/elementary/efl_ui_text_part.eo
@@ -0,0 +1,8 @@
1class Efl.Ui.Text_Part (Efl.Ui.Layout_Part_Text)
2{
3 [[Efl UI Text internal part class]]
4 data: null;
5 implements {
6 Efl.Text.text { set; get; }
7 }
8}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index daf89bb085..e2bed0773c 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -278,7 +278,8 @@ pub_eo_files = [
278 'elm_view_list.eo', 278 'elm_view_list.eo',
279 'elm_view_form.eo', 279 'elm_view_form.eo',
280 'elm_web.eo', 280 'elm_web.eo',
281 'elm_widget_item.eo' 281 'elm_widget_item.eo',
282 'efl_ui_text_part.eo'
282] 283]
283 284
284foreach eo_file : pub_eo_files 285foreach eo_file : pub_eo_files