summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <daniel.hirt@samsung.com>2016-04-26 17:01:04 +0300
committerDaniel Hirt <daniel.hirt@samsung.com>2016-05-16 11:17:55 +0300
commitc54f953788f62b0de20b577d0f963e308f166633 (patch)
tree260dd2976d858be6cd99d52249699cd8509b4d79
parent296a422cf92815f8ebeff9d0f4d28095a71eb62a (diff)
downloadefl-c54f953788f62b0de20b577d0f963e308f166633.tar.gz
Evas textblock: port cursor_geometry_get to eo
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c14
-rw-r--r--src/lib/evas/canvas/evas_textblock.eo24
2 files changed, 36 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index c0cd39eff0..9e0c6fbaac 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -10725,11 +10725,21 @@ _evas_textblock_cursor_geometry_bidi_get(Eo *eo_obj,
EAPI int
evas_textblock_cursor_geometry_get(const Evas_Textblock_Cursor *cur, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype)
{
+ if (!cur) return -1;
+ return evas_obj_textblock_cursor_geometry_get(cur->obj, cur, cx, cy, cw, ch,
+ dir, ctype);
+}
+
+EOLIAN static int
+_evas_textblock_cursor_geometry_get(Eo *eo_obj,
+ Evas_Textblock_Data *o EINA_UNUSED, const Evas_Textblock_Cursor *cur,
+ Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch,
+ Evas_BiDi_Direction *dir, Evas_Textblock_Cursor_Type ctype)
+{
int ret = -1;
if (!cur) return -1;
- Evas_Object_Protected_Data *obj = eo_data_scope_get(cur->obj, EVAS_OBJECT_CLASS);
+ Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS);
evas_object_async_block(obj);
- Evas_Textblock_Data *o = eo_data_scope_get(cur->obj, MY_CLASS);
_relayout_if_needed(cur->obj, o);
diff --git a/src/lib/evas/canvas/evas_textblock.eo b/src/lib/evas/canvas/evas_textblock.eo
index ca47c7a405..bb11098fd0 100644
--- a/src/lib/evas/canvas/evas_textblock.eo
+++ b/src/lib/evas/canvas/evas_textblock.eo
@@ -508,6 +508,30 @@ class Evas.Textblock (Evas.Object)
@in ctype: Evas.Textblock.Cursor.Type; [[the type of the cursor.]]
}
}
+ cursor_geometry_get {
+ [[Returns the geometry of the cursor. Depends on the type of cursor
+ requested. This should be used instead of char_geometry_get because
+ there are weird special cases with BiDi text. in '_' cursor
+ mode (i.e a line below the char) it's the same as char_geometry
+ get, except for the case of the last char of a line which
+ depends on the paragraph direction.
+
+ in '|' cursor mode (i.e a line between two chars) it is very
+ variable. For example consider the following visual string:
+ "abcCBA" (ABC are rtl chars), a cursor pointing on A should actually
+ draw a '|' between the c and the C.
+ ]]
+ return: int; [[line number of the char on success, -1 on error.]]
+ params {
+ @in cur: const(Evas.Textblock.Cursor)*; [[The cursor to query.]]
+ @out cx: int; [[the x of the cursor (or upper cursor).]]
+ @out cy: int; [[the y of the cursor (or upper cursor).]]
+ @out cw: int; [[the width of the cursor (or upper cursor).]]
+ @out ch: int; [[the height of the cursor (or upper cursor).]]
+ @out dir: Evas.BiDi_Direction; [[the direction of the cursor, can be NULL.]]
+ @in ctype: Evas.Textblock.Cursor.Type; [[the type of the cursor.]]
+ }
+ }
style_user_peek @const {
[[Get (don't remove) the style at the top of the user style stack.