diff options
Diffstat (limited to '')
-rw-r--r-- | libraries/evas/src/tests/Makefile.in | 8 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_callbacks.c | 6 | ||||
-rw-r--r-- | libraries/evas/src/tests/evas_test_textblock.c | 319 |
3 files changed, 240 insertions, 93 deletions
diff --git a/libraries/evas/src/tests/Makefile.in b/libraries/evas/src/tests/Makefile.in index c598c3d..8790c33 100644 --- a/libraries/evas/src/tests/Makefile.in +++ b/libraries/evas/src/tests/Makefile.in | |||
@@ -203,8 +203,6 @@ PATH_SEPARATOR = @PATH_SEPARATOR@ | |||
203 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ | 203 | PIXMAN_CFLAGS = @PIXMAN_CFLAGS@ |
204 | PIXMAN_LIBS = @PIXMAN_LIBS@ | 204 | PIXMAN_LIBS = @PIXMAN_LIBS@ |
205 | PKG_CONFIG = @PKG_CONFIG@ | 205 | PKG_CONFIG = @PKG_CONFIG@ |
206 | PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@ | ||
207 | PKG_CONFIG_PATH = @PKG_CONFIG_PATH@ | ||
208 | PNG_CFLAGS = @PNG_CFLAGS@ | 206 | PNG_CFLAGS = @PNG_CFLAGS@ |
209 | PNG_LIBS = @PNG_LIBS@ | 207 | PNG_LIBS = @PNG_LIBS@ |
210 | RANLIB = @RANLIB@ | 208 | RANLIB = @RANLIB@ |
@@ -221,6 +219,8 @@ VALGRIND_CFLAGS = @VALGRIND_CFLAGS@ | |||
221 | VALGRIND_LIBS = @VALGRIND_LIBS@ | 219 | VALGRIND_LIBS = @VALGRIND_LIBS@ |
222 | VERSION = @VERSION@ | 220 | VERSION = @VERSION@ |
223 | VMAJ = @VMAJ@ | 221 | VMAJ = @VMAJ@ |
222 | WAYLAND_EGL_CFLAGS = @WAYLAND_EGL_CFLAGS@ | ||
223 | WAYLAND_EGL_LIBS = @WAYLAND_EGL_LIBS@ | ||
224 | WIN32_CFLAGS = @WIN32_CFLAGS@ | 224 | WIN32_CFLAGS = @WIN32_CFLAGS@ |
225 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ | 225 | WIN32_CPPFLAGS = @WIN32_CPPFLAGS@ |
226 | XCB_CFLAGS = @XCB_CFLAGS@ | 226 | XCB_CFLAGS = @XCB_CFLAGS@ |
@@ -302,6 +302,10 @@ evas_engine_software_xcb_cflags = @evas_engine_software_xcb_cflags@ | |||
302 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ | 302 | evas_engine_software_xcb_libs = @evas_engine_software_xcb_libs@ |
303 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ | 303 | evas_engine_software_xlib_cflags = @evas_engine_software_xlib_cflags@ |
304 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ | 304 | evas_engine_software_xlib_libs = @evas_engine_software_xlib_libs@ |
305 | evas_engine_wayland_egl_cflags = @evas_engine_wayland_egl_cflags@ | ||
306 | evas_engine_wayland_egl_libs = @evas_engine_wayland_egl_libs@ | ||
307 | evas_engine_wayland_shm_cflags = @evas_engine_wayland_shm_cflags@ | ||
308 | evas_engine_wayland_shm_libs = @evas_engine_wayland_shm_libs@ | ||
305 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ | 309 | evas_image_loader_bmp_cflags = @evas_image_loader_bmp_cflags@ |
306 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ | 310 | evas_image_loader_bmp_libs = @evas_image_loader_bmp_libs@ |
307 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ | 311 | evas_image_loader_edb_cflags = @evas_image_loader_edb_cflags@ |
diff --git a/libraries/evas/src/tests/evas_test_callbacks.c b/libraries/evas/src/tests/evas_test_callbacks.c index 675ee1c..164851e 100644 --- a/libraries/evas/src/tests/evas_test_callbacks.c +++ b/libraries/evas/src/tests/evas_test_callbacks.c | |||
@@ -28,7 +28,7 @@ do \ | |||
28 | } \ | 28 | } \ |
29 | while (0) | 29 | while (0) |
30 | 30 | ||
31 | static int counter = 1; | 31 | static uintptr_t counter = 1; |
32 | 32 | ||
33 | static void | 33 | static void |
34 | _obj_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) | 34 | _obj_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) |
@@ -37,7 +37,7 @@ _obj_event_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) | |||
37 | (void) obj; | 37 | (void) obj; |
38 | (void) event_info; | 38 | (void) event_info; |
39 | 39 | ||
40 | fail_if(((int) data) != counter); | 40 | fail_if(((uintptr_t) data) != counter); |
41 | 41 | ||
42 | counter++; | 42 | counter++; |
43 | } | 43 | } |
@@ -83,7 +83,7 @@ _event_cb(void *data, Evas *e, void *event_info) | |||
83 | (void) e; | 83 | (void) e; |
84 | (void) event_info; | 84 | (void) event_info; |
85 | 85 | ||
86 | fail_if(((int) data) != counter); | 86 | fail_if(((uintptr_t) data) != counter); |
87 | 87 | ||
88 | counter++; | 88 | counter++; |
89 | } | 89 | } |
diff --git a/libraries/evas/src/tests/evas_test_textblock.c b/libraries/evas/src/tests/evas_test_textblock.c index 6a28353..cf6a78b 100644 --- a/libraries/evas/src/tests/evas_test_textblock.c +++ b/libraries/evas/src/tests/evas_test_textblock.c | |||
@@ -21,9 +21,7 @@ _evas_textblock_format_offset_get(const Evas_Object_Textblock_Node_Format *n); | |||
21 | 21 | ||
22 | static const char *style_buf = | 22 | static const char *style_buf = |
23 | "DEFAULT='font=Sans font_size=10 color=#000 text_class=entry'" | 23 | "DEFAULT='font=Sans font_size=10 color=#000 text_class=entry'" |
24 | "br='\n'" | 24 | "newline='br'" |
25 | "ps='ps'" | ||
26 | "tab='\t'" | ||
27 | "b='+ font=Sans:style=bold'"; | 25 | "b='+ font=Sans:style=bold'"; |
28 | 26 | ||
29 | #define START_TB_TEST() \ | 27 | #define START_TB_TEST() \ |
@@ -61,7 +59,7 @@ while (0) | |||
61 | START_TEST(evas_textblock_simple) | 59 | START_TEST(evas_textblock_simple) |
62 | { | 60 | { |
63 | START_TB_TEST(); | 61 | START_TB_TEST(); |
64 | const char *buf = "Th<i>i</i>s is a <br> te<b>s</b>t."; | 62 | const char *buf = "Th<i>i</i>s is a <br/> te<b>s</b>t."; |
65 | evas_object_textblock_text_markup_set(tb, buf); | 63 | evas_object_textblock_text_markup_set(tb, buf); |
66 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | 64 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); |
67 | END_TB_TEST(); | 65 | END_TB_TEST(); |
@@ -95,12 +93,12 @@ START_TEST(evas_textblock_cursor) | |||
95 | Evas_Coord x, y, w, h; | 93 | Evas_Coord x, y, w, h; |
96 | size_t i, len; | 94 | size_t i, len; |
97 | Evas_Coord nw, nh; | 95 | Evas_Coord nw, nh; |
98 | const char *buf = "This is a<br> test.<ps>Lets see if this works.<ps>עוד פסקה."; | 96 | const char *buf = "This is a<br/> test.<ps/>Lets see if this works.<ps/>עוד פסקה."; |
99 | 97 | ||
100 | /* Walk the textblock using cursor_char_next */ | 98 | /* Walk the textblock using cursor_char_next */ |
101 | evas_object_textblock_text_markup_set(tb, buf); | 99 | evas_object_textblock_text_markup_set(tb, buf); |
102 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | 100 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); |
103 | len = eina_unicode_utf8_get_len(buf) - 9; /* 9 because len(<br>) == 1 and len(<ps>) == 1 */ | 101 | len = eina_unicode_utf8_get_len(buf) - 12; /* 12 because len(<br/>) == 1 and len(<ps/>) == 1 */ |
104 | for (i = 0 ; i < len ; i++) | 102 | for (i = 0 ; i < len ; i++) |
105 | { | 103 | { |
106 | _CHECK_CURSOR_COORDS(); | 104 | _CHECK_CURSOR_COORDS(); |
@@ -284,7 +282,7 @@ START_TEST(evas_textblock_cursor) | |||
284 | /* Paragraph text get */ | 282 | /* Paragraph text get */ |
285 | evas_textblock_cursor_paragraph_first(cur); | 283 | evas_textblock_cursor_paragraph_first(cur); |
286 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | 284 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), |
287 | "This is a<br> test.")); | 285 | "This is a<br/> test.")); |
288 | evas_textblock_cursor_paragraph_next(cur); | 286 | evas_textblock_cursor_paragraph_next(cur); |
289 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | 287 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), |
290 | "Lets see if this works.")); | 288 | "Lets see if this works.")); |
@@ -294,9 +292,9 @@ START_TEST(evas_textblock_cursor) | |||
294 | 292 | ||
295 | /* Paragraph length get */ | 293 | /* Paragraph length get */ |
296 | evas_textblock_cursor_paragraph_first(cur); | 294 | evas_textblock_cursor_paragraph_first(cur); |
297 | /* -3 because len(<br>) == 1 */ | 295 | /* -4 because len(<br/>) == 1 */ |
298 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != | 296 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != |
299 | eina_unicode_utf8_get_len("This is a<br> test.") - 3); | 297 | eina_unicode_utf8_get_len("This is a<br/> test.") - 4); |
300 | evas_textblock_cursor_paragraph_next(cur); | 298 | evas_textblock_cursor_paragraph_next(cur); |
301 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != | 299 | fail_if(evas_textblock_cursor_paragraph_text_length_get(cur) != |
302 | eina_unicode_utf8_get_len("Lets see if this works.")); | 300 | eina_unicode_utf8_get_len("Lets see if this works.")); |
@@ -308,7 +306,7 @@ START_TEST(evas_textblock_cursor) | |||
308 | evas_textblock_cursor_pos_set(cur, 0); | 306 | evas_textblock_cursor_pos_set(cur, 0); |
309 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "T")); | 307 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "T")); |
310 | evas_textblock_cursor_pos_set(cur, 9); | 308 | evas_textblock_cursor_pos_set(cur, 9); |
311 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br>")); | 309 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br/>")); |
312 | evas_textblock_cursor_pos_set(cur, 43); | 310 | evas_textblock_cursor_pos_set(cur, 43); |
313 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "ד")); | 311 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "ד")); |
314 | 312 | ||
@@ -414,12 +412,12 @@ START_TEST(evas_textblock_cursor) | |||
414 | 412 | ||
415 | #ifdef HAVE_FRIBIDI | 413 | #ifdef HAVE_FRIBIDI |
416 | evas_object_textblock_text_markup_set(tb, | 414 | evas_object_textblock_text_markup_set(tb, |
417 | "testנסיוןtestנסיון<ps>" | 415 | "testנסיוןtestנסיון<ps/>" |
418 | "נסיוןtestנסיוןtest<ps>" | 416 | "נסיוןtestנסיוןtest<ps/>" |
419 | "testנסיוןtest<ps>" | 417 | "testנסיוןtest<ps/>" |
420 | "נסיוןtestנסיון<ps>" | 418 | "נסיוןtestנסיון<ps/>" |
421 | "testנסיון<br>נסיון<ps>" | 419 | "testנסיון<br/>נסיון<ps/>" |
422 | "נסיוןtest<br>test" | 420 | "נסיוןtest<br/>test" |
423 | ); | 421 | ); |
424 | 422 | ||
425 | for (i = 0 ; i < 8 ; i++) | 423 | for (i = 0 ; i < 8 ; i++) |
@@ -568,6 +566,32 @@ START_TEST(evas_textblock_cursor) | |||
568 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); | 566 | fail_if(evas_textblock_cursor_compare(main_cur, cur)); |
569 | } | 567 | } |
570 | 568 | ||
569 | { | ||
570 | const char *buf_wb = "a This is_a t:e.s't a"; | ||
571 | evas_object_textblock_text_markup_set(tb, buf_wb); | ||
572 | |||
573 | /* Word start/end */ | ||
574 | evas_textblock_cursor_pos_set(cur, 3); | ||
575 | evas_textblock_cursor_word_start(cur); | ||
576 | fail_if(2 != evas_textblock_cursor_pos_get(cur)); | ||
577 | evas_textblock_cursor_word_end(cur); | ||
578 | fail_if(5 != evas_textblock_cursor_pos_get(cur)); | ||
579 | |||
580 | evas_textblock_cursor_pos_set(cur, 13); | ||
581 | evas_textblock_cursor_word_end(cur); | ||
582 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
583 | evas_textblock_cursor_word_start(cur); | ||
584 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
585 | evas_textblock_cursor_word_start(cur); | ||
586 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
587 | evas_textblock_cursor_word_start(cur); | ||
588 | fail_if(12 != evas_textblock_cursor_pos_get(cur)); | ||
589 | evas_textblock_cursor_word_end(cur); | ||
590 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
591 | evas_textblock_cursor_word_end(cur); | ||
592 | fail_if(18 != evas_textblock_cursor_pos_get(cur)); | ||
593 | } | ||
594 | |||
571 | END_TB_TEST(); | 595 | END_TB_TEST(); |
572 | } | 596 | } |
573 | END_TEST | 597 | END_TEST |
@@ -723,7 +747,7 @@ START_TEST(evas_textblock_format_removal) | |||
723 | 747 | ||
724 | /* Range deletion across paragraphs */ | 748 | /* Range deletion across paragraphs */ |
725 | evas_object_textblock_text_markup_set(tb, | 749 | evas_object_textblock_text_markup_set(tb, |
726 | "Th<b>is a<a>te<ps>" | 750 | "Th<b>is a<a>te<ps/>" |
727 | "s</a>st</b>."); | 751 | "s</a>st</b>."); |
728 | evas_textblock_cursor_pos_set(cur, 6); | 752 | evas_textblock_cursor_pos_set(cur, 6); |
729 | evas_textblock_cursor_pos_set(main_cur, 10); | 753 | evas_textblock_cursor_pos_set(main_cur, 10); |
@@ -749,14 +773,14 @@ START_TEST(evas_textblock_format_removal) | |||
749 | fail_if (fnode); | 773 | fail_if (fnode); |
750 | 774 | ||
751 | /* Two formats across different paragraphs with notihng in between. */ | 775 | /* Two formats across different paragraphs with notihng in between. */ |
752 | evas_object_textblock_text_markup_set(tb, "<b><ps></b>"); | 776 | evas_object_textblock_text_markup_set(tb, "<b><ps/></b>"); |
753 | evas_textblock_cursor_pos_set(cur, 0); | 777 | evas_textblock_cursor_pos_set(cur, 0); |
754 | evas_textblock_cursor_char_delete(cur); | 778 | evas_textblock_cursor_char_delete(cur); |
755 | fnode = evas_textblock_node_format_first_get(tb); | 779 | fnode = evas_textblock_node_format_first_get(tb); |
756 | fail_if (fnode); | 780 | fail_if (fnode); |
757 | 781 | ||
758 | /* Try with range */ | 782 | /* Try with range */ |
759 | evas_object_textblock_text_markup_set(tb, "<b><ps></b>"); | 783 | evas_object_textblock_text_markup_set(tb, "<b><ps/></b>"); |
760 | evas_textblock_cursor_pos_set(cur, 0); | 784 | evas_textblock_cursor_pos_set(cur, 0); |
761 | evas_textblock_cursor_pos_set(main_cur, 1); | 785 | evas_textblock_cursor_pos_set(main_cur, 1); |
762 | evas_textblock_cursor_range_delete(cur, main_cur); | 786 | evas_textblock_cursor_range_delete(cur, main_cur); |
@@ -765,7 +789,7 @@ START_TEST(evas_textblock_format_removal) | |||
765 | 789 | ||
766 | /* Verify fmt position and REP_CHAR positions are the same */ | 790 | /* Verify fmt position and REP_CHAR positions are the same */ |
767 | evas_object_textblock_text_markup_set(tb, | 791 | evas_object_textblock_text_markup_set(tb, |
768 | "This is<ps>an <item absize=93x152 vsize=ascent></>a."); | 792 | "This is<ps/>an <item absize=93x152 vsize=ascent></>a."); |
769 | evas_textblock_cursor_pos_set(cur, 7); | 793 | evas_textblock_cursor_pos_set(cur, 7); |
770 | evas_textblock_cursor_char_delete(cur); | 794 | evas_textblock_cursor_char_delete(cur); |
771 | fnode = evas_textblock_node_format_first_get(tb); | 795 | fnode = evas_textblock_node_format_first_get(tb); |
@@ -1091,9 +1115,9 @@ START_TEST(evas_textblock_wrapping) | |||
1091 | evas_object_textblock_text_markup_set(tb, "a"); | 1115 | evas_object_textblock_text_markup_set(tb, "a"); |
1092 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | 1116 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); |
1093 | evas_object_textblock_text_markup_set(tb, | 1117 | evas_object_textblock_text_markup_set(tb, |
1094 | "aaaa aaaa aaa aa aaa<ps>" | 1118 | "aaaa aaaa aaa aa aaa<ps/>" |
1095 | "aaaa aaa aaa aaa aaa<ps>" | 1119 | "aaaa aaa aaa aaa aaa<ps/>" |
1096 | "a aaaaa aaaaaaaaaaaaaa<br>aaaaa<ps>" | 1120 | "a aaaaa aaaaaaaaaaaaaa<br/>aaaaa<ps/>" |
1097 | "aaaaaa" | 1121 | "aaaaaa" |
1098 | ); | 1122 | ); |
1099 | evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); | 1123 | evas_textblock_cursor_format_prepend(cur, "+ wrap=char"); |
@@ -1113,9 +1137,9 @@ START_TEST(evas_textblock_wrapping) | |||
1113 | evas_object_textblock_text_markup_set(tb, "aaaaaa"); | 1137 | evas_object_textblock_text_markup_set(tb, "aaaaaa"); |
1114 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | 1138 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); |
1115 | evas_object_textblock_text_markup_set(tb, | 1139 | evas_object_textblock_text_markup_set(tb, |
1116 | "aaaa aaaa aaa aa aaa<ps>" | 1140 | "aaaa aaaa aaa aa aaa<ps/>" |
1117 | "aaaa aaa aaa aaa aaa<ps>" | 1141 | "aaaa aaa aaa aaa aaa<ps/>" |
1118 | "a aaaaa aaaaaa<br>aaaaa<ps>" | 1142 | "a aaaaa aaaaaa<br/>aaaaa<ps/>" |
1119 | "aaaaa" | 1143 | "aaaaa" |
1120 | ); | 1144 | ); |
1121 | evas_textblock_cursor_format_prepend(cur, "+ wrap=word"); | 1145 | evas_textblock_cursor_format_prepend(cur, "+ wrap=word"); |
@@ -1134,9 +1158,9 @@ START_TEST(evas_textblock_wrapping) | |||
1134 | evas_object_textblock_text_markup_set(tb, "a"); | 1158 | evas_object_textblock_text_markup_set(tb, "a"); |
1135 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); | 1159 | evas_object_textblock_size_formatted_get(tb, &bw, &bh); |
1136 | evas_object_textblock_text_markup_set(tb, | 1160 | evas_object_textblock_text_markup_set(tb, |
1137 | "aaaa aaaa aaa aa aaa<ps>" | 1161 | "aaaa aaaa aaa aa aaa<ps/>" |
1138 | "aaaa aaa aaa aaa aaa<ps>" | 1162 | "aaaa aaa aaa aaa aaa<ps/>" |
1139 | "a aaaaa aaaaaa<br>aaaaa<ps>" | 1163 | "a aaaaa aaaaaa<br/>aaaaa<ps/>" |
1140 | "aaaaa" | 1164 | "aaaaa" |
1141 | ); | 1165 | ); |
1142 | evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); | 1166 | evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); |
@@ -1156,26 +1180,26 @@ START_TEST(evas_textblock_wrapping) | |||
1156 | int wrap_items = sizeof(wrap_style) / sizeof(*wrap_style); | 1180 | int wrap_items = sizeof(wrap_style) / sizeof(*wrap_style); |
1157 | 1181 | ||
1158 | evas_object_textblock_text_markup_set(tb, | 1182 | evas_object_textblock_text_markup_set(tb, |
1159 | "This is an entry widget in this window that<br>" | 1183 | "This is an entry widget in this window that<br/>" |
1160 | "uses markup <b>like this</> for styling and<br>" | 1184 | "uses markup <b>like this</> for styling and<br/>" |
1161 | "formatting <em>like this</>, as well as<br>" | 1185 | "formatting <em>like this</>, as well as<br/>" |
1162 | "<a href=X><link>links in the text</></a>, so enter text<br>" | 1186 | "<a href=X><link>links in the text</></a>, so enter text<br/>" |
1163 | "in here to edit it. By the way, links are<br>" | 1187 | "in here to edit it. By the way, links are<br/>" |
1164 | "called <a href=anc-02>Anchors</a> so you will need<br>" | 1188 | "called <a href=anc-02>Anchors</a> so you will need<br/>" |
1165 | "to refer to them this way.<br>" | 1189 | "to refer to them this way.<br/>" |
1166 | "<br>" | 1190 | "<br/>" |
1167 | 1191 | ||
1168 | "Also you can stick in items with (relsize + ascent): " | 1192 | "Also you can stick in items with (relsize + ascent): " |
1169 | "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>" | 1193 | "<item relsize=16x16 vsize=ascent href=emoticon/evil-laugh></item>" |
1170 | " (full) " | 1194 | " (full) " |
1171 | "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>" | 1195 | "<item relsize=16x16 vsize=full href=emoticon/guilty-smile></item>" |
1172 | " (to the left)<br>" | 1196 | " (to the left)<br/>" |
1173 | 1197 | ||
1174 | "Also (size + ascent): " | 1198 | "Also (size + ascent): " |
1175 | "<item size=16x16 vsize=ascent href=emoticon/haha></item>" | 1199 | "<item size=16x16 vsize=ascent href=emoticon/haha></item>" |
1176 | " (full) " | 1200 | " (full) " |
1177 | "<item size=16x16 vsize=full href=emoticon/happy-panting></item>" | 1201 | "<item size=16x16 vsize=full href=emoticon/happy-panting></item>" |
1178 | " (before this)<br>" | 1202 | " (before this)<br/>" |
1179 | 1203 | ||
1180 | "And as well (absize + ascent): " | 1204 | "And as well (absize + ascent): " |
1181 | "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>" | 1205 | "<item absize=64x64 vsize=ascent href=emoticon/knowing-grin></item>" |
@@ -1214,6 +1238,13 @@ START_TEST(evas_textblock_wrapping) | |||
1214 | evas_object_textblock_size_formatted_get(tb, &w, &h); | 1238 | evas_object_textblock_size_formatted_get(tb, &w, &h); |
1215 | fail_if((w > (nw / 2)) || (h != nh)); | 1239 | fail_if((w > (nw / 2)) || (h != nh)); |
1216 | 1240 | ||
1241 | evas_object_textblock_text_markup_set(tb, "aaaaaaaaaaaaaaaaaa<br/>b"); | ||
1242 | evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0 wrap=word"); | ||
1243 | evas_object_textblock_size_native_get(tb, &nw, &nh); | ||
1244 | evas_object_resize(tb, nw / 2, nh * 2); | ||
1245 | evas_object_textblock_size_formatted_get(tb, &w, &h); | ||
1246 | fail_if(w > (nw / 2)); | ||
1247 | |||
1217 | END_TB_TEST(); | 1248 | END_TB_TEST(); |
1218 | } | 1249 | } |
1219 | END_TEST | 1250 | END_TEST |
@@ -1223,7 +1254,7 @@ START_TEST(evas_textblock_various) | |||
1223 | { | 1254 | { |
1224 | Evas_Coord w, h, bw, bh; | 1255 | Evas_Coord w, h, bw, bh; |
1225 | START_TB_TEST(); | 1256 | START_TB_TEST(); |
1226 | const char *buf = "This<ps>textblock<ps>has<ps>a<ps>lot<ps>of<ps>lines<ps>."; | 1257 | const char *buf = "This<ps/>textblock<ps/>has<ps/>a<ps/>lot<ps/>of<ps/>lines<ps/>."; |
1227 | evas_object_textblock_text_markup_set(tb, buf); | 1258 | evas_object_textblock_text_markup_set(tb, buf); |
1228 | evas_object_textblock_size_formatted_get(tb, &w, &h); | 1259 | evas_object_textblock_size_formatted_get(tb, &w, &h); |
1229 | /* Move outside of the screen so it'll have to search for the correct | 1260 | /* Move outside of the screen so it'll have to search for the correct |
@@ -1241,15 +1272,15 @@ START_TEST(evas_textblock_various) | |||
1241 | /* Items have correct text node information */ | 1272 | /* Items have correct text node information */ |
1242 | evas_object_textblock_text_markup_set(tb, ""); | 1273 | evas_object_textblock_text_markup_set(tb, ""); |
1243 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1274 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1244 | evas_object_textblock_text_markup_set(tb, "<ps>"); | 1275 | evas_object_textblock_text_markup_set(tb, "<ps/>"); |
1245 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1276 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1246 | evas_object_textblock_text_markup_set(tb, "a<ps>"); | 1277 | evas_object_textblock_text_markup_set(tb, "a<ps/>"); |
1247 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1278 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1248 | evas_object_textblock_text_markup_set(tb, "a<ps>a"); | 1279 | evas_object_textblock_text_markup_set(tb, "a<ps/>a"); |
1249 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1280 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1250 | evas_object_textblock_text_markup_set(tb, "a<ps>a<ps>"); | 1281 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>"); |
1251 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1282 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1252 | evas_object_textblock_text_markup_set(tb, "a<ps>a<ps>a"); | 1283 | evas_object_textblock_text_markup_set(tb, "a<ps/>a<ps/>a"); |
1253 | fail_if(!_evas_textblock_check_item_node_link(tb)); | 1284 | fail_if(!_evas_textblock_check_item_node_link(tb)); |
1254 | 1285 | ||
1255 | END_TB_TEST(); | 1286 | END_TB_TEST(); |
@@ -1260,7 +1291,7 @@ END_TEST | |||
1260 | START_TEST(evas_textblock_geometries) | 1291 | START_TEST(evas_textblock_geometries) |
1261 | { | 1292 | { |
1262 | START_TB_TEST(); | 1293 | START_TB_TEST(); |
1263 | const char *buf = "This is a <br> test."; | 1294 | const char *buf = "This is a <br/> test."; |
1264 | evas_object_textblock_text_markup_set(tb, buf); | 1295 | evas_object_textblock_text_markup_set(tb, buf); |
1265 | 1296 | ||
1266 | /* Single line range */ | 1297 | /* Single line range */ |
@@ -1327,7 +1358,7 @@ END_TEST | |||
1327 | START_TEST(evas_textblock_editing) | 1358 | START_TEST(evas_textblock_editing) |
1328 | { | 1359 | { |
1329 | START_TB_TEST(); | 1360 | START_TB_TEST(); |
1330 | const char *buf = "First par.<ps>Second par."; | 1361 | const char *buf = "First par.<ps/>Second par."; |
1331 | evas_object_textblock_text_markup_set(tb, buf); | 1362 | evas_object_textblock_text_markup_set(tb, buf); |
1332 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); | 1363 | Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); |
1333 | 1364 | ||
@@ -1346,7 +1377,7 @@ START_TEST(evas_textblock_editing) | |||
1346 | evas_textblock_cursor_paragraph_first(cur); | 1377 | evas_textblock_cursor_paragraph_first(cur); |
1347 | evas_textblock_cursor_char_delete(cur); | 1378 | evas_textblock_cursor_char_delete(cur); |
1348 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | 1379 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), |
1349 | "irst par.<ps>Second par.")); | 1380 | "irst par.<ps/>Second par.")); |
1350 | 1381 | ||
1351 | /* Delete some arbitrary char */ | 1382 | /* Delete some arbitrary char */ |
1352 | evas_textblock_cursor_char_next(cur); | 1383 | evas_textblock_cursor_char_next(cur); |
@@ -1354,14 +1385,14 @@ START_TEST(evas_textblock_editing) | |||
1354 | evas_textblock_cursor_char_next(cur); | 1385 | evas_textblock_cursor_char_next(cur); |
1355 | evas_textblock_cursor_char_delete(cur); | 1386 | evas_textblock_cursor_char_delete(cur); |
1356 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | 1387 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), |
1357 | "irs par.<ps>Second par.")); | 1388 | "irs par.<ps/>Second par.")); |
1358 | 1389 | ||
1359 | /* Delete a range */ | 1390 | /* Delete a range */ |
1360 | evas_textblock_cursor_pos_set(main_cur, 1); | 1391 | evas_textblock_cursor_pos_set(main_cur, 1); |
1361 | evas_textblock_cursor_pos_set(cur, 6); | 1392 | evas_textblock_cursor_pos_set(cur, 6); |
1362 | evas_textblock_cursor_range_delete(cur, main_cur); | 1393 | evas_textblock_cursor_range_delete(cur, main_cur); |
1363 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | 1394 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), |
1364 | "ir.<ps>Second par.")); | 1395 | "ir.<ps/>Second par.")); |
1365 | evas_textblock_cursor_paragraph_char_first(main_cur); | 1396 | evas_textblock_cursor_paragraph_char_first(main_cur); |
1366 | evas_textblock_cursor_paragraph_char_last(cur); | 1397 | evas_textblock_cursor_paragraph_char_last(cur); |
1367 | evas_textblock_cursor_char_next(cur); | 1398 | evas_textblock_cursor_char_next(cur); |
@@ -1376,7 +1407,7 @@ START_TEST(evas_textblock_editing) | |||
1376 | evas_textblock_cursor_paragraph_char_first(main_cur); | 1407 | evas_textblock_cursor_paragraph_char_first(main_cur); |
1377 | evas_textblock_cursor_range_delete(cur, main_cur); | 1408 | evas_textblock_cursor_range_delete(cur, main_cur); |
1378 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), | 1409 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), |
1379 | "First par.<ps>")); | 1410 | "First par.<ps/>")); |
1380 | 1411 | ||
1381 | /* Merging paragraphs */ | 1412 | /* Merging paragraphs */ |
1382 | evas_object_textblock_text_markup_set(tb, buf); | 1413 | evas_object_textblock_text_markup_set(tb, buf); |
@@ -1406,6 +1437,27 @@ START_TEST(evas_textblock_editing) | |||
1406 | evas_textblock_cursor_paragraph_first(cur); | 1437 | evas_textblock_cursor_paragraph_first(cur); |
1407 | fail_if(evas_textblock_cursor_paragraph_next(cur)); | 1438 | fail_if(evas_textblock_cursor_paragraph_next(cur)); |
1408 | 1439 | ||
1440 | /* Insert illegal characters inside the format. */ | ||
1441 | { | ||
1442 | const char *content; | ||
1443 | evas_object_textblock_text_markup_set(tb, "a\n"); | ||
1444 | evas_textblock_cursor_pos_set(cur, 1); | ||
1445 | content = evas_textblock_cursor_content_get(cur); | ||
1446 | |||
1447 | evas_object_textblock_text_markup_set(tb, "a\t"); | ||
1448 | evas_textblock_cursor_pos_set(cur, 1); | ||
1449 | content = evas_textblock_cursor_content_get(cur); | ||
1450 | |||
1451 | evas_object_textblock_text_markup_set(tb, "a\xEF\xBF\xBC"); | ||
1452 | evas_textblock_cursor_pos_set(cur, 1); | ||
1453 | content = evas_textblock_cursor_content_get(cur); | ||
1454 | |||
1455 | evas_object_textblock_text_markup_set(tb, "a\xE2\x80\xA9"); | ||
1456 | evas_textblock_cursor_pos_set(cur, 1); | ||
1457 | content = evas_textblock_cursor_content_get(cur); | ||
1458 | (void) content; | ||
1459 | } | ||
1460 | |||
1409 | /* FIXME: Also add text appending/prepending */ | 1461 | /* FIXME: Also add text appending/prepending */ |
1410 | 1462 | ||
1411 | END_TB_TEST(); | 1463 | END_TB_TEST(); |
@@ -1416,13 +1468,13 @@ END_TEST | |||
1416 | START_TEST(evas_textblock_text_getters) | 1468 | START_TEST(evas_textblock_text_getters) |
1417 | { | 1469 | { |
1418 | START_TB_TEST(); | 1470 | START_TB_TEST(); |
1419 | const char *buf = "This is a <br> test.<ps>" | 1471 | const char *buf = "This is a <br/> test.<ps/>" |
1420 | "טקסט בעברית<ps>and now in english."; | 1472 | "טקסט בעברית<ps/>and now in english."; |
1421 | evas_object_textblock_text_markup_set(tb, buf); | 1473 | evas_object_textblock_text_markup_set(tb, buf); |
1422 | evas_textblock_cursor_paragraph_first(cur); | 1474 | evas_textblock_cursor_paragraph_first(cur); |
1423 | 1475 | ||
1424 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | 1476 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), |
1425 | "This is a <br> test.")); | 1477 | "This is a <br/> test.")); |
1426 | 1478 | ||
1427 | evas_textblock_cursor_paragraph_next(cur); | 1479 | evas_textblock_cursor_paragraph_next(cur); |
1428 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), | 1480 | fail_if(strcmp(evas_textblock_cursor_paragraph_text_get(cur), |
@@ -1447,17 +1499,17 @@ START_TEST(evas_textblock_text_getters) | |||
1447 | evas_textblock_cursor_pos_set(main_cur, 5); | 1499 | evas_textblock_cursor_pos_set(main_cur, 5); |
1448 | evas_textblock_cursor_pos_set(cur, 14); | 1500 | evas_textblock_cursor_pos_set(cur, 14); |
1449 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | 1501 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, |
1450 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br> te")); | 1502 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br/> te")); |
1451 | 1503 | ||
1452 | evas_textblock_cursor_pos_set(main_cur, 14); | 1504 | evas_textblock_cursor_pos_set(main_cur, 14); |
1453 | evas_textblock_cursor_pos_set(cur, 20); | 1505 | evas_textblock_cursor_pos_set(cur, 20); |
1454 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | 1506 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, |
1455 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps>טק")); | 1507 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טק")); |
1456 | 1508 | ||
1457 | evas_textblock_cursor_pos_set(main_cur, 14); | 1509 | evas_textblock_cursor_pos_set(main_cur, 14); |
1458 | evas_textblock_cursor_pos_set(cur, 32); | 1510 | evas_textblock_cursor_pos_set(cur, 32); |
1459 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, | 1511 | fail_if(strcmp(evas_textblock_cursor_range_text_get(main_cur, cur, |
1460 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps>טקסט בעברית<ps>an")); | 1512 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טקסט בעברית<ps/>an")); |
1461 | 1513 | ||
1462 | /* Backward range get */ | 1514 | /* Backward range get */ |
1463 | evas_textblock_cursor_pos_set(main_cur, 2); | 1515 | evas_textblock_cursor_pos_set(main_cur, 2); |
@@ -1473,17 +1525,17 @@ START_TEST(evas_textblock_text_getters) | |||
1473 | evas_textblock_cursor_pos_set(main_cur, 5); | 1525 | evas_textblock_cursor_pos_set(main_cur, 5); |
1474 | evas_textblock_cursor_pos_set(cur, 14); | 1526 | evas_textblock_cursor_pos_set(cur, 14); |
1475 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | 1527 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, |
1476 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br> te")); | 1528 | EVAS_TEXTBLOCK_TEXT_MARKUP), "is a <br/> te")); |
1477 | 1529 | ||
1478 | evas_textblock_cursor_pos_set(main_cur, 14); | 1530 | evas_textblock_cursor_pos_set(main_cur, 14); |
1479 | evas_textblock_cursor_pos_set(cur, 20); | 1531 | evas_textblock_cursor_pos_set(cur, 20); |
1480 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | 1532 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, |
1481 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps>טק")); | 1533 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טק")); |
1482 | 1534 | ||
1483 | evas_textblock_cursor_pos_set(main_cur, 14); | 1535 | evas_textblock_cursor_pos_set(main_cur, 14); |
1484 | evas_textblock_cursor_pos_set(cur, 32); | 1536 | evas_textblock_cursor_pos_set(cur, 32); |
1485 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | 1537 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, |
1486 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps>טקסט בעברית<ps>an")); | 1538 | EVAS_TEXTBLOCK_TEXT_MARKUP), "st.<ps/>טקסט בעברית<ps/>an")); |
1487 | 1539 | ||
1488 | /* Uninit cursors and other weird cases */ | 1540 | /* Uninit cursors and other weird cases */ |
1489 | evas_object_textblock_clear(tb); | 1541 | evas_object_textblock_clear(tb); |
@@ -1492,6 +1544,97 @@ START_TEST(evas_textblock_text_getters) | |||
1492 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, | 1544 | fail_if(strcmp(evas_textblock_cursor_range_text_get(cur, main_cur, |
1493 | EVAS_TEXTBLOCK_TEXT_MARKUP), "aaa")); | 1545 | EVAS_TEXTBLOCK_TEXT_MARKUP), "aaa")); |
1494 | 1546 | ||
1547 | /* Markup to plain and vice versa */ | ||
1548 | { | ||
1549 | char *tmp, *tmp2; | ||
1550 | |||
1551 | /* Real textblock object */ | ||
1552 | tmp = evas_textblock_text_markup_to_utf8(tb, "<br/>aa<\n/>bb<\t/>"); | ||
1553 | fail_if(strcmp(tmp, "\naa\nbb\t")); | ||
1554 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1555 | fail_if(strcmp(tmp2, "<br/>aa<br/>bb<tab/>")); | ||
1556 | free(tmp2); | ||
1557 | free(tmp); | ||
1558 | |||
1559 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<item></item>"); | ||
1560 | fail_if(strcmp(tmp, "a\xEF\xBF\xBC")); | ||
1561 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1562 | fail_if(strcmp(tmp2, "a")); | ||
1563 | free(tmp2); | ||
1564 | free(tmp); | ||
1565 | |||
1566 | tmp = evas_textblock_text_markup_to_utf8(tb, "a "); | ||
1567 | fail_if(strcmp(tmp, "a\xC2\xA0")); | ||
1568 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1569 | fail_if(strcmp(tmp2, "a\xC2\xA0")); | ||
1570 | free(tmp2); | ||
1571 | free(tmp); | ||
1572 | |||
1573 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<b>b</b><more></>a"); | ||
1574 | fail_if(strcmp(tmp, "aba")); | ||
1575 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1576 | fail_if(strcmp(tmp2, "aba")); | ||
1577 | free(tmp2); | ||
1578 | free(tmp); | ||
1579 | |||
1580 | tmp = evas_textblock_text_markup_to_utf8(tb, "a&a"); | ||
1581 | fail_if(strcmp(tmp, "a&a")); | ||
1582 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1583 | fail_if(strcmp(tmp2, "a&a")); | ||
1584 | free(tmp2); | ||
1585 | free(tmp); | ||
1586 | |||
1587 | tmp = evas_textblock_text_markup_to_utf8(tb, "a<newline/>a"); | ||
1588 | fail_if(strcmp(tmp, "a\na")); | ||
1589 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1590 | fail_if(strcmp(tmp2, "a<br/>a")); | ||
1591 | free(tmp2); | ||
1592 | free(tmp); | ||
1593 | |||
1594 | /* NULL textblock object */ | ||
1595 | tmp = evas_textblock_text_markup_to_utf8(NULL, "<br/>aa<\n/>bb<\t/>"); | ||
1596 | fail_if(strcmp(tmp, "\naa\nbb\t")); | ||
1597 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1598 | fail_if(strcmp(tmp2, "<br/>aa<br/>bb<tab/>")); | ||
1599 | free(tmp2); | ||
1600 | free(tmp); | ||
1601 | |||
1602 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<item></item>"); | ||
1603 | fail_if(strcmp(tmp, "a\xEF\xBF\xBC")); | ||
1604 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1605 | fail_if(strcmp(tmp2, "a")); | ||
1606 | free(tmp2); | ||
1607 | free(tmp); | ||
1608 | |||
1609 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a "); | ||
1610 | fail_if(strcmp(tmp, "a\xC2\xA0")); | ||
1611 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1612 | fail_if(strcmp(tmp2, "a\xC2\xA0")); | ||
1613 | free(tmp2); | ||
1614 | free(tmp); | ||
1615 | |||
1616 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<b>b</b><more></>a"); | ||
1617 | fail_if(strcmp(tmp, "aba")); | ||
1618 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1619 | fail_if(strcmp(tmp2, "aba")); | ||
1620 | free(tmp2); | ||
1621 | free(tmp); | ||
1622 | |||
1623 | tmp = evas_textblock_text_markup_to_utf8(tb, "a&a"); | ||
1624 | fail_if(strcmp(tmp, "a&a")); | ||
1625 | tmp2 = evas_textblock_text_utf8_to_markup(tb, tmp); | ||
1626 | fail_if(strcmp(tmp2, "a&a")); | ||
1627 | free(tmp2); | ||
1628 | free(tmp); | ||
1629 | |||
1630 | tmp = evas_textblock_text_markup_to_utf8(NULL, "a<newline/>a"); | ||
1631 | fail_if(strcmp(tmp, "aa")); | ||
1632 | tmp2 = evas_textblock_text_utf8_to_markup(NULL, tmp); | ||
1633 | fail_if(strcmp(tmp2, "aa")); | ||
1634 | free(tmp2); | ||
1635 | free(tmp); | ||
1636 | } | ||
1637 | |||
1495 | END_TB_TEST(); | 1638 | END_TB_TEST(); |
1496 | } | 1639 | } |
1497 | END_TEST | 1640 | END_TEST |
@@ -1500,7 +1643,7 @@ END_TEST | |||
1500 | START_TEST(evas_textblock_formats) | 1643 | START_TEST(evas_textblock_formats) |
1501 | { | 1644 | { |
1502 | START_TB_TEST(); | 1645 | START_TB_TEST(); |
1503 | const char *buf = "Th<b>i<font_size=15 wrap=none>s i</font_size=13>s</> a <br> te<ps>st<item></>."; | 1646 | const char *buf = "Th<b>i<font_size=15 wrap=none>s i</font_size=13>s</> a <br/> te<ps/>st<item></>."; |
1504 | const Evas_Object_Textblock_Node_Format *fnode; | 1647 | const Evas_Object_Textblock_Node_Format *fnode; |
1505 | evas_object_textblock_text_markup_set(tb, buf); | 1648 | evas_object_textblock_text_markup_set(tb, buf); |
1506 | 1649 | ||
@@ -1652,25 +1795,25 @@ START_TEST(evas_textblock_formats) | |||
1652 | * verify them visually, well, we can some of them. Possibly in the | 1795 | * verify them visually, well, we can some of them. Possibly in the |
1653 | * future we will */ | 1796 | * future we will */ |
1654 | evas_object_textblock_text_markup_set(tb, | 1797 | evas_object_textblock_text_markup_set(tb, |
1655 | "<font_size=40>font_size=40</><ps>" | 1798 | "<font_size=40>font_size=40</><ps/>" |
1656 | "<color=#F210B3FF>color=#F210B3FF</><ps>" | 1799 | "<color=#F210B3FF>color=#F210B3FF</><ps/>" |
1657 | "<underline=single underline_color=#A2B3C4>underline=single underline_color=#A2B3C4</><ps>" | 1800 | "<underline=single underline_color=#A2B3C4>underline=single underline_color=#A2B3C4</><ps/>" |
1658 | "<underline=double underline_color=#F00 underline2_color=#00F>underline=double underline_color=#F00 underline2_color=#00F</><ps>" | 1801 | "<underline=double underline_color=#F00 underline2_color=#00F>underline=double underline_color=#F00 underline2_color=#00F</><ps/>" |
1659 | "<underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1>underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1</><ps>" | 1802 | "<underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1>underline=dashed underline_dash_color=#0F0 underline_dash_width=2 underline_dash_gap=1</><ps/>" |
1660 | "<style=outline outline_color=#F0FA>style=outline outline_color=#F0FA</><ps>" | 1803 | "<style=outline outline_color=#F0FA>style=outline outline_color=#F0FA</><ps/>" |
1661 | "<style=shadow shadow_color=#F0F>style=shadow shadow_color=#F0F</><ps>" | 1804 | "<style=shadow shadow_color=#F0F>style=shadow shadow_color=#F0F</><ps/>" |
1662 | "<style=glow glow_color=#BBB>style=glow glow_color=#BBB</><ps>" | 1805 | "<style=glow glow_color=#BBB>style=glow glow_color=#BBB</><ps/>" |
1663 | "<style=glow glow2_color=#0F0>style=glow glow2_color=#0F0</><ps>" | 1806 | "<style=glow glow2_color=#0F0>style=glow glow2_color=#0F0</><ps/>" |
1664 | "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214>style=glow color=#fff glow2_color=#fe87 glow_color=#f214</><ps>" | 1807 | "<style=glow color=#fff glow2_color=#fe87 glow_color=#f214>style=glow color=#fff glow2_color=#fe87 glow_color=#f214</><ps/>" |
1665 | "<backing=on backing_color=#00F>backing=on backing_color=#00F</><ps>" | 1808 | "<backing=on backing_color=#00F>backing=on backing_color=#00F</><ps/>" |
1666 | "<strikethrough=on strikethrough_color=#FF0>strikethrough=on strikethrough_color=#FF0</><ps>" | 1809 | "<strikethrough=on strikethrough_color=#FF0>strikethrough=on strikethrough_color=#FF0</><ps/>" |
1667 | "<align=right>align=right</><ps>" | 1810 | "<align=right>align=right</><ps/>" |
1668 | "<backing=on backing_color=#F008 valign=0.0>valign=0.0</><ps>" | 1811 | "<backing=on backing_color=#F008 valign=0.0>valign=0.0</><ps/>" |
1669 | "<backing=on backing_color=#0F08 tabstops=50>tabstops=<\\t></>50</><ps>" | 1812 | "<backing=on backing_color=#0F08 tabstops=50>tabstops=<\\t></>50</><ps/>" |
1670 | "<backing=on backing_color=#00F8 linesize=40>linesize=40</><ps>" | 1813 | "<backing=on backing_color=#00F8 linesize=40>linesize=40</><ps/>" |
1671 | "<backing=on backing_color=#F0F8 linerelsize=200%>linerelsize=200%</><ps>" | 1814 | "<backing=on backing_color=#F0F8 linerelsize=200%>linerelsize=200%</><ps/>" |
1672 | "<backing=on backing_color=#0FF8 linegap=20>linegap=20</><ps>" | 1815 | "<backing=on backing_color=#0FF8 linegap=20>linegap=20</><ps/>" |
1673 | "<backing=on backing_color=#FF08 linerelgap=100%>linerelgap=100%</><ps>"); | 1816 | "<backing=on backing_color=#FF08 linerelgap=100%>linerelgap=100%</><ps/>"); |
1674 | 1817 | ||
1675 | /* Force a relayout */ | 1818 | /* Force a relayout */ |
1676 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); | 1819 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); |
@@ -1714,22 +1857,22 @@ START_TEST(evas_textblock_formats) | |||
1714 | } | 1857 | } |
1715 | 1858 | ||
1716 | /* Make sure we get all the types of visible formats correctly. */ | 1859 | /* Make sure we get all the types of visible formats correctly. */ |
1717 | evas_object_textblock_text_markup_set(tb, "<ps>a<br>a<tab>a<item></>"); | 1860 | evas_object_textblock_text_markup_set(tb, "<ps/>a<br/>a<tab/>a<item></>"); |
1718 | fail_if(strcmp(evas_textblock_node_format_text_get( | 1861 | fail_if(strcmp(evas_textblock_node_format_text_get( |
1719 | evas_textblock_cursor_format_get(cur)), "ps")); | 1862 | evas_textblock_cursor_format_get(cur)), "ps")); |
1720 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<ps>")); | 1863 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<ps/>")); |
1721 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | 1864 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); |
1722 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1865 | fail_if(!evas_textblock_cursor_char_next(cur)); |
1723 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1866 | fail_if(!evas_textblock_cursor_char_next(cur)); |
1724 | fail_if(strcmp(evas_textblock_node_format_text_get( | 1867 | fail_if(strcmp(evas_textblock_node_format_text_get( |
1725 | evas_textblock_cursor_format_get(cur)), "br")); | 1868 | evas_textblock_cursor_format_get(cur)), "br")); |
1726 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br>")); | 1869 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<br/>")); |
1727 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | 1870 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); |
1728 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1871 | fail_if(!evas_textblock_cursor_char_next(cur)); |
1729 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1872 | fail_if(!evas_textblock_cursor_char_next(cur)); |
1730 | fail_if(strcmp(evas_textblock_node_format_text_get( | 1873 | fail_if(strcmp(evas_textblock_node_format_text_get( |
1731 | evas_textblock_cursor_format_get(cur)), "tab")); | 1874 | evas_textblock_cursor_format_get(cur)), "tab")); |
1732 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<tab>")); | 1875 | fail_if(strcmp(evas_textblock_cursor_content_get(cur), "<tab/>")); |
1733 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); | 1876 | fail_if(!evas_textblock_cursor_format_is_visible_get(cur)); |
1734 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1877 | fail_if(!evas_textblock_cursor_char_next(cur)); |
1735 | fail_if(!evas_textblock_cursor_char_next(cur)); | 1878 | fail_if(!evas_textblock_cursor_char_next(cur)); |
@@ -1749,7 +1892,7 @@ START_TEST(evas_textblock_style) | |||
1749 | Evas_Coord l, r, t, b; | 1892 | Evas_Coord l, r, t, b; |
1750 | START_TB_TEST(); | 1893 | START_TB_TEST(); |
1751 | Evas_Textblock_Style *newst; | 1894 | Evas_Textblock_Style *newst; |
1752 | const char *buf = "Test<ps>Test2<ps>נסיון"; | 1895 | const char *buf = "Test<ps/>Test2<ps/>נסיון"; |
1753 | evas_object_textblock_text_markup_set(tb, buf); | 1896 | evas_object_textblock_text_markup_set(tb, buf); |
1754 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); | 1897 | fail_if(strcmp(evas_object_textblock_text_markup_get(tb), buf)); |
1755 | 1898 | ||
@@ -1850,7 +1993,7 @@ START_TEST(evas_textblock_set_get) | |||
1850 | fail_if(strcmp(evas_object_textblock_bidi_delimiters_get(tb), ",|")); | 1993 | fail_if(strcmp(evas_object_textblock_bidi_delimiters_get(tb), ",|")); |
1851 | 1994 | ||
1852 | /* Hinting */ | 1995 | /* Hinting */ |
1853 | evas_object_textblock_text_markup_set(tb, "This is<ps>a test<br>bla"); | 1996 | evas_object_textblock_text_markup_set(tb, "This is<ps/>a test<br/>bla"); |
1854 | /* Force relayout */ | 1997 | /* Force relayout */ |
1855 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); | 1998 | evas_object_textblock_size_formatted_get(tb, NULL, NULL); |
1856 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_NONE); | 1999 | evas_font_hinting_set(evas, EVAS_FONT_HINTING_NONE); |
@@ -1923,7 +2066,7 @@ START_TEST(evas_textblock_size) | |||
1923 | { | 2066 | { |
1924 | START_TB_TEST(); | 2067 | START_TB_TEST(); |
1925 | Evas_Coord w, h, h2, nw, nh; | 2068 | Evas_Coord w, h, h2, nw, nh; |
1926 | const char *buf = "This is a <br> test.<br>גם בעברית"; | 2069 | const char *buf = "This is a <br/> test.<br/>גם בעברית"; |
1927 | /* When wrapping is off, native size should be the same as formatted | 2070 | /* When wrapping is off, native size should be the same as formatted |
1928 | * size */ | 2071 | * size */ |
1929 | 2072 | ||
@@ -1932,7 +2075,7 @@ START_TEST(evas_textblock_size) | |||
1932 | fail_if((w != nw) || (h != nh)); | 2075 | fail_if((w != nw) || (h != nh)); |
1933 | fail_if(w != 0); | 2076 | fail_if(w != 0); |
1934 | 2077 | ||
1935 | evas_object_textblock_text_markup_set(tb, "a<br>a"); | 2078 | evas_object_textblock_text_markup_set(tb, "a<br/>a"); |
1936 | evas_object_textblock_size_formatted_get(tb, &w, &h2); | 2079 | evas_object_textblock_size_formatted_get(tb, &w, &h2); |
1937 | evas_object_textblock_size_native_get(tb, &nw, &nh); | 2080 | evas_object_textblock_size_native_get(tb, &nw, &nh); |
1938 | fail_if((w != nw) || (h2 != nh)); | 2081 | fail_if((w != nw) || (h2 != nh)); |