diff options
author | Tom Hacohen <tom@stosb.com> | 2019-10-07 15:18:08 +0300 |
---|---|---|
committer | Tom Hacohen <tom@stosb.com> | 2019-10-12 17:52:19 +0300 |
commit | e18cd47deb073ad1a357fdea61e6de90356cd608 (patch) | |
tree | 0fe0017b7dd672839dde7d198ba66600b843149a | |
parent | 7c76e1d763101791aef4cd4b406ca68d9672d54c (diff) | |
download | efl-e18cd47deb073ad1a357fdea61e6de90356cd608.tar.gz |
Cursor: add a function to set the text objcet directly.
This is instead of using the handle_set.
-rw-r--r-- | src/lib/evas/canvas/efl2_text_cursor.eo | 11 | ||||
-rw-r--r-- | src/lib/evas/canvas/efl_text_cursor.c | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/evas/canvas/efl2_text_cursor.eo b/src/lib/evas/canvas/efl2_text_cursor.eo index 7109ca966f..3a37e8e9ad 100644 --- a/src/lib/evas/canvas/efl2_text_cursor.eo +++ b/src/lib/evas/canvas/efl2_text_cursor.eo @@ -247,6 +247,17 @@ class @beta Efl2.Text.Cursor extends Efl.Object { handle: ptr(Efl2.Text.Cursor_Handle); [[The handle of the cursor object]] } } + + @property text_object { + [[The text object this cursor is associated with. Should be set on object creation. + + This is a shorter/simpler alternative to $.handle + ]] + set { } + values { + text_obj: Efl.Object; [[The text object]] + } + } } events { // FIXME: Needed for people who cache the position. diff --git a/src/lib/evas/canvas/efl_text_cursor.c b/src/lib/evas/canvas/efl_text_cursor.c index 37b6b5e239..62e15a4238 100644 --- a/src/lib/evas/canvas/efl_text_cursor.c +++ b/src/lib/evas/canvas/efl_text_cursor.c @@ -299,6 +299,12 @@ _efl2_text_cursor_handle_get(const Eo *obj EINA_UNUSED, Efl2_Text_Cursor_Data *p } EOLIAN static void +_efl2_text_cursor_text_object_set(Eo *obj, Efl2_Text_Cursor_Data *pd EINA_UNUSED, Efl_Object *text_object) +{ + efl2_text_cursor_handle_set(obj, efl2_canvas_text_cursor_handle_new(text_object)); +} + +EOLIAN static void _efl2_text_cursor_efl_object_destructor(Eo *obj EINA_UNUSED, Efl2_Text_Cursor_Data *pd) { if (pd->cur) |