summaryrefslogtreecommitdiff
path: root/src/tests/evas/evas_test_textblock.c
diff options
context:
space:
mode:
authorThiep Ha <thiep.ha@samsung.com>2014-10-02 08:36:35 +0100
committerTom Hacohen <tom@stosb.com>2014-10-02 08:36:35 +0100
commitdee98ea248b2eac7f6ff49afbeb8853e959d92fe (patch)
treebc7a2c03180c09d52c48af7ed6d6a0c8682eb817 /src/tests/evas/evas_test_textblock.c
parent7a1dc9b0df9bf4c51b7ab7547058425599504fce (diff)
downloadefl-dee98ea248b2eac7f6ff49afbeb8853e959d92fe.tar.gz
evas textblock: return text direction for under cursor in cursor geometry get
Summary: Currently, in cursor geometry get function, the text direction is not returned if cursor is under cursor. This patch fixs it by returning text direction for under cursor. @fix Reviewers: tasn Subscribers: herdsman, cedric Differential Revision: https://phab.enlightenment.org/D1505
Diffstat (limited to 'src/tests/evas/evas_test_textblock.c')
-rw-r--r--src/tests/evas/evas_test_textblock.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c
index 98174f59ae..928bbd303f 100644
--- a/src/tests/evas/evas_test_textblock.c
+++ b/src/tests/evas/evas_test_textblock.c
@@ -99,6 +99,7 @@ START_TEST(evas_textblock_cursor)
Evas_Coord x, y, w, h;
size_t i, len;
Evas_Coord nw, nh;
+ Evas_BiDi_Direction dir;
const char *buf = "This is a<br/> test.<ps/>Lets see if this works.<ps/>עוד פסקה.";
/* Walk the textblock using cursor_char_next */
@@ -420,6 +421,28 @@ START_TEST(evas_textblock_cursor)
fail_if(evas_textblock_cursor_compare(main_cur, cur));
}
+ /* Check direction */
+ evas_object_textblock_text_markup_set(tb, "test");
+ fail_if(strcmp(evas_object_textblock_text_markup_get(tb), "test"));
+ dir = EVAS_BIDI_DIRECTION_RTL;
+ evas_textblock_cursor_geometry_get(cur, NULL, NULL, NULL, NULL, &dir,
+ EVAS_TEXTBLOCK_CURSOR_UNDER);
+ fail_if(dir != EVAS_BIDI_DIRECTION_LTR);
+ dir = EVAS_BIDI_DIRECTION_RTL;
+ evas_textblock_cursor_geometry_get(cur, NULL, NULL, NULL, NULL, &dir,
+ EVAS_TEXTBLOCK_CURSOR_BEFORE);
+ fail_if(dir != EVAS_BIDI_DIRECTION_LTR);
+ evas_object_textblock_text_markup_set(tb, "עוד פסקה");
+ fail_if(strcmp(evas_object_textblock_text_markup_get(tb), "עוד פסקה"));
+ dir = EVAS_BIDI_DIRECTION_LTR;
+ evas_textblock_cursor_geometry_get(cur, NULL, NULL, NULL, NULL, &dir,
+ EVAS_TEXTBLOCK_CURSOR_UNDER);
+ fail_if(dir != EVAS_BIDI_DIRECTION_RTL);
+ dir = EVAS_BIDI_DIRECTION_LTR;
+ evas_textblock_cursor_geometry_get(cur, NULL, NULL, NULL, NULL, &dir,
+ EVAS_TEXTBLOCK_CURSOR_BEFORE);
+ fail_if(dir != EVAS_BIDI_DIRECTION_RTL);
+
#ifdef HAVE_FRIBIDI
evas_object_textblock_text_markup_set(tb,
"testנסיוןtestנסיון<ps/>"