summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2016-06-22 12:05:47 +0000
committerDaniel Hirt <daniel.hirt@samsung.com>2016-06-27 15:18:08 +0000
commita9546e36ec882996d292cf10f7d064c777b4f402 (patch)
treeac7cd56da83a53e2916c0a83776427ebf18943aa
parentd3d655bedf0496826cb0325d1e9d865185c52bbf (diff)
downloadefl-a9546e36ec882996d292cf10f7d064c777b4f402.tar.gz
Ui text: add cursor_new method
The cursor object is meant to be instantiated in the following manner: eo_add(EFL_CANVAS_TEXT_CURSOR_CLASS, text_obj, efl_canvas_text_cursor_text_object_set(eo_self, text_obj)); This can't be done directly on the Ui Text object, so it has to be with an method call, sadly. @feature
-rw-r--r--src/lib/elementary/efl_ui_text.c8
-rw-r--r--src/lib/elementary/efl_ui_text.eo4
2 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index f47c49f729..c4249f1a54 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -5428,6 +5428,14 @@ _efl_ui_text_elm_interface_atspi_accessible_name_get(Eo *obj, Efl_Ui_Text_Data *
return ret ? strdup(ret) : NULL;
}
+EOLIAN static Efl_Canvas_Text_Cursor *
+_efl_ui_text_cursor_new(Eo *obj, Efl_Ui_Text_Data *sd EINA_UNUSED)
+{
+ Eo *text_obj = edje_object_part_swallow_get(sd->entry_edje, "elm.text");
+ return eo_add(EFL_CANVAS_TEXT_CURSOR_CLASS, (Eo *) obj,
+ efl_canvas_text_cursor_text_object_set(eo_self, text_obj));
+}
+
static inline Eo *
_decoration_create(Efl_Ui_Text_Data *sd, const char *file,
const char *source, Eina_Bool above)
diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo
index f12ed0898a..d04c370e9e 100644
--- a/src/lib/elementary/efl_ui_text.eo
+++ b/src/lib/elementary/efl_ui_text.eo
@@ -361,6 +361,10 @@ class Efl.Ui.Text (Elm.Layout, Elm.Interface_Scrollable, Efl.Ui.Clickable,
@in data: const(void_ptr) @optional; [[The data to associate with the item for related functions.]]
}
}
+ cursor_new {
+ [[Creates and returns a new cursor for the text.]]
+ return: Efl.Canvas.Text.Cursor;
+ }
}
implements {
class.constructor;