aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-01-28 11:10:40 -0500
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-01-30 13:32:04 +0100
commit9aca866fd13bf6e571b4ebfd1a4c219cfce7703e (patch)
tree2fc6d6a892858483b00ccac4891a52df2fcf91d8
parentmeson: fix to make results same as a way it does in autotools (diff)
downloadefl-9aca866fd13bf6e571b4ebfd1a4c219cfce7703e.tar.gz
efl.text_markup: move cursor-related methods to efl.text_markup_interactive
many users of the markup property are not interactive text cases, so splitting off the interactive methods resolves a number of unimplemented method issues ref https://phab.enlightenment.org/T5719 Differential Revision: https://phab.enlightenment.org/D7787
-rw-r--r--src/Makefile_Efl.am1
-rw-r--r--src/lib/edje/edje_part_invalid.c2
-rw-r--r--src/lib/edje/edje_part_text.c2
-rw-r--r--src/lib/edje/efl_canvas_layout_part_invalid.eo4
-rw-r--r--src/lib/edje/efl_canvas_layout_part_text.eo4
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c1
-rw-r--r--src/lib/efl/interfaces/efl_text_markup.eo20
-rw-r--r--src/lib/efl/interfaces/efl_text_markup_interactive.eo27
-rw-r--r--src/lib/efl/interfaces/meson.build1
-rw-r--r--src/lib/elementary/efl_ui_text.c4
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo6
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c4
-rw-r--r--src/tests/evas/evas_test_textblock.c4
14 files changed, 47 insertions, 34 deletions
diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am
index ada411a1d5..475a5f1eb2 100644
--- a/src/Makefile_Efl.am
+++ b/src/Makefile_Efl.am
@@ -34,6 +34,7 @@ efl_eolian_files = \
lib/efl/interfaces/efl_text_cursor.eo \
lib/efl/interfaces/efl_text_annotate.eo \
lib/efl/interfaces/efl_text_markup.eo \
+ lib/efl/interfaces/efl_text_markup_interactive.eo \
lib/efl/interfaces/efl_text_markup_util.eo \
lib/efl/interfaces/efl_gfx_stack.eo \
lib/efl/interfaces/efl_gfx_view.eo \
diff --git a/src/lib/edje/edje_part_invalid.c b/src/lib/edje/edje_part_invalid.c
index 469de82fd4..3e508b3fe0 100644
--- a/src/lib/edje/edje_part_invalid.c
+++ b/src/lib/edje/edje_part_invalid.c
@@ -71,7 +71,7 @@ EDJE_PART_INVALID_VOID(efl_text_cursor_line_jump_by, _efl_canvas_layout_part_inv
EDJE_PART_INVALID_VOID(efl_text_cursor_copy, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_copy, Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src)
EDJE_PART_INVALID_CONST(Eina_Unicode, 0, efl_text_cursor_content_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_content_get, const Efl_Text_Cursor_Cursor *cur)
EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_text_cursor_geometry_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_geometry_get, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Type ctype, int *cx, int *cy, int *cw, int *ch, int *cx2, int *cy2, int *cw2, int *ch2)
-EDJE_PART_INVALID_VOID(efl_text_markup_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_cursor_markup_insert, Efl_Text_Cursor_Cursor *cur, const char *markup)
+EDJE_PART_INVALID_VOID(efl_text_markup_interactive_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_interactive_cursor_markup_insert, Efl_Text_Cursor_Cursor *cur, const char *markup)
EDJE_PART_INVALID(Eina_Iterator *, 0, efl_content_iterate, _efl_canvas_layout_part_invalid_efl_container_content_iterate)
EDJE_PART_INVALID(int, 0, efl_content_count, _efl_canvas_layout_part_invalid_efl_container_content_count)
EDJE_PART_INVALID(Eina_Bool, 0, efl_content_remove, _efl_canvas_layout_part_invalid_efl_container_content_remove, Efl_Gfx_Entity *content)
diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c
index 31678a3697..9143ef17aa 100644
--- a/src/lib/edje/edje_part_text.c
+++ b/src/lib/edje/edje_part_text.c
@@ -187,7 +187,7 @@ _efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(const Eo *obj,
}
EOLIAN static void
-_efl_canvas_layout_part_text_efl_text_markup_cursor_markup_insert(Eo *obj,
+_efl_canvas_layout_part_text_efl_text_markup_interactive_cursor_markup_insert(Eo *obj,
void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED,
const char *text)
{
diff --git a/src/lib/edje/efl_canvas_layout_part_invalid.eo b/src/lib/edje/efl_canvas_layout_part_invalid.eo
index 6c8f3fee5d..1dbef9ffe2 100644
--- a/src/lib/edje/efl_canvas_layout_part_invalid.eo
+++ b/src/lib/edje/efl_canvas_layout_part_invalid.eo
@@ -1,7 +1,7 @@
class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content,
Efl.Pack_Linear, Efl.Ui.Direction_Readonly,
Efl.Pack_Table, Efl.Text,
- Efl.Text_Markup
+ Efl.Text_Markup, Efl.Text_Markup_Interactive
{
[[Common class for part proxy objects for @Efl.Canvas.Layout.
@@ -31,6 +31,7 @@ class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements E
// Efl.Canvas.Layout_Part_Text
Efl.Text.text { set; get; }
Efl.Text_Markup.markup { get; set; }
+ Efl.Text_Markup_Interactive.cursor_markup_insert;
Efl.Text_Cursor.text_cursor { get; }
Efl.Text_Cursor.cursor_paragraph_first;
Efl.Text_Cursor.cursor_paragraph_last;
@@ -44,7 +45,6 @@ class Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements E
Efl.Text_Cursor.cursor_copy;
Efl.Text_Cursor.cursor_content { get; }
Efl.Text_Cursor.cursor_geometry { get; }
- Efl.Text_Markup.cursor_markup_insert;
// Efl.Canvas.Layout_Part_Box
Efl.Container.content_iterate;
Efl.Container.content_count;
diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo b/src/lib/edje/efl_canvas_layout_part_text.eo
index 0546118c73..b987c915e7 100644
--- a/src/lib/edje/efl_canvas_layout_part_text.eo
+++ b/src/lib/edje/efl_canvas_layout_part_text.eo
@@ -11,7 +11,7 @@ enum Efl.Canvas.Layout_Part_Text_Expand
}
class Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text,
-Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
+Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
{
[[Represents a TEXT part of a layout
@@ -36,6 +36,7 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
implements {
Efl.Text.text { set; get; }
Efl.Text_Markup.markup { get; set; }
+ Efl.Text_Markup_Interactive.cursor_markup_insert;
Efl.Text_Cursor.text_cursor { get; }
Efl.Text_Cursor.cursor_paragraph_first;
Efl.Text_Cursor.cursor_paragraph_last;
@@ -49,7 +50,6 @@ Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
Efl.Text_Cursor.cursor_copy;
Efl.Text_Cursor.cursor_content { get; }
Efl.Text_Cursor.cursor_geometry { get; }
- Efl.Text_Markup.cursor_markup_insert;
Efl.Text_Format.ellipsis { set; get; }
Efl.Text_Format.wrap { set; get; }
Efl.Text_Font.font { set; get; }
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index f4c79916ab..7daa52d50c 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -182,6 +182,7 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
#include "interfaces/efl_text_cursor.eo.h"
#include "interfaces/efl_text_annotate.eo.h"
#include "interfaces/efl_text_markup.eo.h"
+#include "interfaces/efl_text_markup_interactive.eo.h"
#include "interfaces/efl_text_markup_util.eo.h"
EAPI void efl_observable_tuple_free(Efl_Observable_Tuple *tuple);
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 3e6f983cbd..4e2490a6c7 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -27,6 +27,7 @@
#include "interfaces/efl_text_cursor.eo.c"
#include "interfaces/efl_text_annotate.eo.c"
#include "interfaces/efl_text_markup.eo.c"
+#include "interfaces/efl_text_markup_interactive.eo.c"
#include "interfaces/efl_gfx_entity.eo.c"
#include "interfaces/efl_gfx_buffer.eo.c"
diff --git a/src/lib/efl/interfaces/efl_text_markup.eo b/src/lib/efl/interfaces/efl_text_markup.eo
index 97de5672b4..7d6968445c 100644
--- a/src/lib/efl/interfaces/efl_text_markup.eo
+++ b/src/lib/efl/interfaces/efl_text_markup.eo
@@ -1,4 +1,4 @@
-interface Efl.Text_Markup extends Efl.Text_Cursor {
+interface Efl.Text_Markup {
[[Markup data that populates the text object's style and format
@since 1.21
@@ -10,24 +10,6 @@ interface Efl.Text_Markup extends Efl.Text_Cursor {
markup: string; [[The markup-text representation set to this text.]]
}
}
- @property markup_range {
- [[Markup of a given range in the text]]
- values {
- markup: mstring @owned; [[The markup-text representation set to
- this text of a given range]]
- }
- keys {
- start: ptr(Efl.Text_Cursor_Cursor);
- end: ptr(Efl.Text_Cursor_Cursor);
- }
- }
- cursor_markup_insert {
- [[Inserts a markup text to the text object in a given cursor position]]
- params {
- cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor position to insert markup]]
- @in markup: string; [[The markup text to insert]]
- }
- }
}
}
diff --git a/src/lib/efl/interfaces/efl_text_markup_interactive.eo b/src/lib/efl/interfaces/efl_text_markup_interactive.eo
new file mode 100644
index 0000000000..4906d5931a
--- /dev/null
+++ b/src/lib/efl/interfaces/efl_text_markup_interactive.eo
@@ -0,0 +1,27 @@
+interface Efl.Text_Markup_Interactive extends Efl.Text_Cursor {
+ [[Markup data that populates the text object's style and format
+
+ @since 1.22
+ ]]
+ methods {
+ @property markup_range {
+ [[Markup of a given range in the text]]
+ values {
+ markup: mstring @owned; [[The markup-text representation set to
+ this text of a given range]]
+ }
+ keys {
+ start: ptr(Efl.Text_Cursor_Cursor);
+ end: ptr(Efl.Text_Cursor_Cursor);
+ }
+ }
+ cursor_markup_insert {
+ [[Inserts a markup text to the text object in a given cursor position]]
+ params {
+ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor position to insert markup]]
+ @in markup: string; [[The markup text to insert]]
+ }
+ }
+ }
+}
+
diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build
index e325bdc15d..61d91fbed9 100644
--- a/src/lib/efl/interfaces/meson.build
+++ b/src/lib/efl/interfaces/meson.build
@@ -59,6 +59,7 @@ pub_eo_files = [
'efl_text_cursor.eo',
'efl_text_annotate.eo',
'efl_text_markup.eo',
+ 'efl_text_markup_interactive.eo',
'efl_text_markup_util.eo',
'efl_gfx_stack.eo',
'efl_gfx_view.eo',
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index 000ba0e3bb..c13435175f 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -610,7 +610,7 @@ _selection_data_cb(void *data EINA_UNUSED, Eo *obj,
cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_MAIN);
if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP)
{
- efl_text_markup_cursor_markup_insert(obj, cur, buf);
+ efl_text_markup_interactive_cursor_markup_insert(obj, cur, buf);
}
else // TEXT
{
@@ -1161,7 +1161,7 @@ _selection_store(Efl_Ui_Selection_Type seltype,
EFL_UI_TEXT_DATA_GET(obj, sd);
efl_text_interactive_selection_cursors_get(obj, &start, &end);
- sel = efl_text_markup_range_get(obj, start, end);
+ sel = efl_text_markup_interactive_markup_range_get(obj, start, end);
if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index 9e569a67bf..644b1c4890 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -5,7 +5,7 @@ struct Efl.Canvas.Text_Style; [[EFL text style data structure]]
class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
Efl.Canvas.Filter.Internal, Efl.Text_Font,
Efl.Text_Style, Efl.Text_Format, Efl.Text_Cursor,
- Efl.Text_Annotate, Efl.Text_Markup, Efl.Ui.I18n
+ Efl.Text_Annotate, Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Ui.I18n
{
[[Efl canvas text class]]
legacy_prefix: evas_object_textblock;
@@ -353,8 +353,8 @@ class Efl.Canvas.Text extends Efl.Canvas.Object implements Efl.Text,
Efl.Text_Annotate.cursor_item_annotation { get; }
Efl.Text_Annotate.cursor_item_insert;
Efl.Text_Markup.markup { set; get; }
- Efl.Text_Markup.cursor_markup_insert;
- Efl.Text_Markup.markup_range { get;}
+ Efl.Text_Markup_Interactive.cursor_markup_insert;
+ Efl.Text_Markup_Interactive.markup_range { get;}
Efl.Gfx.Entity.scale { set; }
}
events {
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 37932a1d62..e73bea08ab 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -7890,7 +7890,7 @@ evas_object_textblock_text_markup_prepend(Efl_Text_Cursor_Cursor *cur, const cha
}
EOLIAN static void
-_efl_canvas_text_efl_text_markup_cursor_markup_insert(Eo *eo_obj,
+_efl_canvas_text_efl_text_markup_interactive_cursor_markup_insert(Eo *eo_obj,
Efl_Canvas_Text_Data *o EINA_UNUSED,
Efl_Text_Cursor_Cursor *cur, const char *markup)
{
@@ -11422,7 +11422,7 @@ _evas_textblock_cursor_range_text_markup_get(const Efl_Text_Cursor_Cursor *cur1,
}
EOLIAN char *
-_efl_canvas_text_efl_text_markup_markup_range_get(const Eo *eo_obj,
+_efl_canvas_text_efl_text_markup_interactive_markup_range_get(const Eo *eo_obj,
Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *start,
Efl_Text_Cursor_Cursor *end)
{
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 776713c912..b82e7e4aaa 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -4632,14 +4632,14 @@ EFL_START_TEST(efl_canvas_text_markup)
efl_text_cursor_position_set(txt, start, 1);
efl_text_cursor_position_set(txt, end, 2);
- res = efl_text_markup_range_get(txt, start, end);
+ res = efl_text_markup_interactive_markup_range_get(txt, start, end);
ck_assert_str_eq(res, "<br>");
free(res);
efl_text_set(txt, "a\u2029bc\ndef\n\u2029");
efl_text_cursor_position_set(txt, start, 2);
efl_text_cursor_position_set(txt, end, 5);
- res = efl_text_markup_range_get(txt, start, end);
+ res = efl_text_markup_interactive_markup_range_get(txt, start, end);
ck_assert_str_eq(res, "bc<br>");
free(res);