summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test_efl_ui_text.c52
-rw-r--r--src/lib/edje/edje_entry.c26
-rw-r--r--src/lib/edje/edje_legacy.c252
-rw-r--r--src/lib/edje/edje_part_invalid.c15
-rw-r--r--src/lib/edje/edje_part_text.c159
-rw-r--r--src/lib/edje/edje_private.h26
-rw-r--r--src/lib/edje/edje_textblock.c99
-rw-r--r--src/lib/edje/efl_canvas_layout_part_invalid.eo16
-rw-r--r--src/lib/edje/efl_canvas_layout_part_text.eo16
-rw-r--r--src/lib/efl/Efl.h5
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c2
-rw-r--r--src/lib/efl/interfaces/efl_text_annotate.eo16
-rw-r--r--src/lib/efl/interfaces/efl_text_cursor.eo246
-rw-r--r--src/lib/efl/interfaces/efl_text_markup_interactive.eo25
-rw-r--r--src/lib/efl/interfaces/efl_text_types.eot2
-rw-r--r--src/lib/efl/interfaces/meson.build2
-rw-r--r--src/lib/elementary/efl_text_interactive.eo11
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.c322
-rw-r--r--src/lib/elementary/efl_ui_internal_text_interactive.eo1
-rw-r--r--src/lib/elementary/efl_ui_internal_text_scroller.c2
-rw-r--r--src/lib/elementary/efl_ui_text.c228
-rw-r--r--src/lib/elementary/efl_ui_text.eo13
-rw-r--r--src/lib/evas/Efl_Canvas.h1
-rw-r--r--src/lib/evas/Evas.h1
-rw-r--r--src/lib/evas/Evas_Common.h5
-rw-r--r--src/lib/evas/Evas_Eo.h2
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo109
-rw-r--r--src/lib/evas/canvas/efl_canvas_text_eo.legacy.c18
-rw-r--r--src/lib/evas/canvas/efl_canvas_text_eo.legacy.h2
-rw-r--r--src/lib/evas/canvas/efl_canvas_text_internal.h219
-rw-r--r--src/lib/evas/canvas/efl_text_cursor.c476
-rw-r--r--src/lib/evas/canvas/efl_text_cursor.eo250
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c1009
-rw-r--r--src/lib/evas/canvas/evas_textblock_legacy.h2
-rw-r--r--src/lib/evas/canvas/meson.build2
-rw-r--r--src/tests/evas/evas_test_textblock.c87
36 files changed, 1853 insertions, 1866 deletions
diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c
index e7e909b84f..d56fddb78d 100644
--- a/src/bin/elementary/test_efl_ui_text.c
+++ b/src/bin/elementary/test_efl_ui_text.c
@@ -8,18 +8,18 @@
8static void 8static void
9_apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) 9_apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style)
10{ 10{
11 Efl_Text_Cursor_Cursor *start, *end; 11 Efl_Text_Cursor *start, *end;
12 12
13 start = efl_text_cursor_new(obj); 13 start = efl_ui_text_cursor_create(obj);
14 end = efl_text_cursor_new(obj); 14 end = efl_ui_text_cursor_create(obj);
15 15
16 efl_text_cursor_position_set(obj, start, start_pos); 16 efl_text_cursor_position_set(start, start_pos);
17 efl_text_cursor_position_set(obj, end, end_pos); 17 efl_text_cursor_position_set(end, end_pos);
18 18
19 efl_text_annotation_insert(obj, start, end, style); 19 efl_text_annotation_insert(obj, efl_text_cursor_handle_get(start), efl_text_cursor_handle_get(end), style);
20 20
21 efl_text_cursor_free(obj, start); 21 efl_del(start);
22 efl_text_cursor_free(obj, end); 22 efl_del(end);
23} 23}
24 24
25static Eo * 25static Eo *
@@ -98,15 +98,15 @@ typedef struct
98static void 98static void
99_on_bt3_clicked(void *data, const Efl_Event *event EINA_UNUSED) 99_on_bt3_clicked(void *data, const Efl_Event *event EINA_UNUSED)
100{ 100{
101 Efl_Text_Cursor_Cursor *sel_start, *sel_end; 101 Efl_Text_Cursor *sel_start, *sel_end;
102 Eo *en = data; 102 Eo *en = data;
103 103
104 efl_text_interactive_selection_cursors_get(data, &sel_start, &sel_end); 104 efl_text_interactive_selection_cursors_get(en, &sel_start, &sel_end);
105 const char *s = efl_canvas_text_range_text_get(data, sel_start, sel_end); 105 const char *s = efl_text_cursor_range_text_get(sel_start, sel_end);
106 106
107 printf("SELECTION REGION: %d - %d\n", 107 printf("SELECTION REGION: %d - %d\n",
108 efl_text_cursor_position_get(en, sel_start), 108 efl_text_cursor_position_get( sel_start),
109 efl_text_cursor_position_get(en, sel_end)); 109 efl_text_cursor_position_get(sel_end));
110 printf("SELECTION:\n"); 110 printf("SELECTION:\n");
111 if (s) printf("%s\n", s); 111 if (s) printf("%s\n", s);
112} 112}
@@ -248,9 +248,9 @@ _on_factory_bt_image_clicked(void *data, const Efl_Event *event EINA_UNUSED)
248 static int image_idx = 0; 248 static int image_idx = 0;
249 249
250 image_idx = (image_idx + 1) % IMAGES_SZ; 250 image_idx = (image_idx + 1) % IMAGES_SZ;
251 efl_text_cursor_item_insert(en, 251
252 efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN), 252 efl_text_cursor_item_insert(en, efl_text_cursor_handle_get(efl_text_interactive_main_cursor_get(en)),
253 images[image_idx], "size=32x32"); 253 images[image_idx], "size=32x32");
254 printf("Inserted image: key = %s\n", images[image_idx]); 254 printf("Inserted image: key = %s\n", images[image_idx]);
255} 255}
256 256
@@ -258,8 +258,8 @@ static void
258_on_factory_bt_emoticon_clicked(void *data, const Efl_Event *event EINA_UNUSED) 258_on_factory_bt_emoticon_clicked(void *data, const Efl_Event *event EINA_UNUSED)
259{ 259{
260 Evas_Object *en = data; 260 Evas_Object *en = data;
261 efl_text_cursor_item_insert(en, efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN), 261 efl_text_cursor_item_insert(en, efl_text_cursor_handle_get(efl_text_interactive_main_cursor_get(en)),
262 "emoticon/evil-laugh", "size=32x32"); 262 "emoticon/evil-laugh", "size=32x32");
263} 263}
264 264
265static struct 265static struct
@@ -287,7 +287,7 @@ void
287test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 287test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
288{ 288{
289 Evas_Object *win, *bx, *bx2, *bt, *en; 289 Evas_Object *win, *bx, *bx2, *bt, *en;
290 Efl_Text_Cursor_Cursor *main_cur, *cur; 290 Efl_Text_Cursor *main_cur, *cur;
291 char buf[128]; 291 char buf[128];
292 Eina_File *f; 292 Eina_File *f;
293 293
@@ -350,16 +350,16 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED,
350 efl_text_font_set(en, "Sans", 14); 350 efl_text_font_set(en, "Sans", 14);
351 efl_text_normal_color_set(en, 255, 255, 255, 255); 351 efl_text_normal_color_set(en, 255, 255, 255, 255);
352 352
353 main_cur = efl_text_cursor_get(en, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 353 main_cur = efl_text_interactive_main_cursor_get(en);
354 cur = efl_text_cursor_new(en); 354 cur = efl_ui_text_cursor_create(en);
355 355
356 efl_text_cursor_position_set(en, cur, 2); 356 efl_text_cursor_position_set(cur, 2);
357 efl_text_cursor_item_insert(en, cur, "emoticon/happy", "size=32x32"); 357 efl_text_cursor_item_insert(en, efl_text_cursor_handle_get(cur), "emoticon/happy", "size=32x32");
358 efl_text_cursor_position_set(en, cur, 50); 358 efl_text_cursor_position_set(cur, 50);
359 359
360 snprintf(buf, sizeof(buf), "file://%s/images/sky_01.jpg", elm_app_data_dir_get()); 360 snprintf(buf, sizeof(buf), "file://%s/images/sky_01.jpg", elm_app_data_dir_get());
361 efl_text_cursor_item_insert(en, cur, buf, "size=32x32"); 361 efl_text_cursor_item_insert(en, efl_text_cursor_handle_get(cur), buf, "size=32x32");
362 efl_text_cursor_position_set(en, main_cur, 5); 362 efl_text_cursor_position_set(main_cur, 5);
363 363
364 efl_text_interactive_editable_set(en, EINA_TRUE); 364 efl_text_interactive_editable_set(en, EINA_TRUE);
365 efl_ui_text_scrollable_set(en, EINA_TRUE); 365 efl_ui_text_scrollable_set(en, EINA_TRUE);
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index a15bd64678..29e0f10c96 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -4083,7 +4083,7 @@ _cursor_get(Edje_Real_Part *rp, Edje_Cursor cur)
4083} 4083}
4084 4084
4085Eina_Bool 4085Eina_Bool
4086_edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4086_edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4087{ 4087{
4088 Entry *en; 4088 Entry *en;
4089 4089
@@ -4117,7 +4117,7 @@ _edje_entry_cursor_next(Edje_Real_Part *rp, Edje_Cursor cur)
4117 4117
4118 4118
4119Eina_Bool 4119Eina_Bool
4120_edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4120_edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4121{ 4121{
4122 Entry *en; 4122 Entry *en;
4123 4123
@@ -4152,7 +4152,7 @@ _edje_entry_cursor_prev(Edje_Real_Part *rp, Edje_Cursor cur)
4152} 4152}
4153 4153
4154Eina_Bool 4154Eina_Bool
4155_edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4155_edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4156{ 4156{
4157 Entry *en; 4157 Entry *en;
4158 Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; 4158 Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
@@ -4192,7 +4192,7 @@ _edje_entry_cursor_up(Edje_Real_Part *rp, Edje_Cursor cur)
4192} 4192}
4193 4193
4194Eina_Bool 4194Eina_Bool
4195_edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4195_edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4196{ 4196{
4197 Entry *en; 4197 Entry *en;
4198 Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch; 4198 Evas_Coord lx, ly, lw, lh, cx, cy, cw, ch;
@@ -4231,7 +4231,7 @@ _edje_entry_cursor_down(Edje_Real_Part *rp, Edje_Cursor cur)
4231} 4231}
4232 4232
4233void 4233void
4234_edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4234_edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4235{ 4235{
4236 Entry *en; 4236 Entry *en;
4237 int old_cur_pos; 4237 int old_cur_pos;
@@ -4266,7 +4266,7 @@ _edje_entry_cursor_begin(Edje_Real_Part *rp, Edje_Cursor cur)
4266} 4266}
4267 4267
4268void 4268void
4269_edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4269_edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4270{ 4270{
4271 Entry *en; 4271 Entry *en;
4272 int old_cur_pos; 4272 int old_cur_pos;
@@ -4300,7 +4300,7 @@ _edje_entry_cursor_end(Edje_Real_Part *rp, Edje_Cursor cur)
4300} 4300}
4301 4301
4302void 4302void
4303_edje_text_cursor_copy(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *d, Efl_Text_Cursor_Cursor *c) 4303_edje_text_cursor_copy(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *d, Efl_Text_Cursor_Handle *c)
4304{ 4304{
4305 Entry *en; 4305 Entry *en;
4306 4306
@@ -4330,7 +4330,7 @@ _edje_entry_cursor_copy(Edje_Real_Part *rp, Edje_Cursor cur, Edje_Cursor dst)
4330} 4330}
4331 4331
4332void 4332void
4333_edje_text_cursor_line_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4333_edje_text_cursor_line_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4334{ 4334{
4335 Entry *en; 4335 Entry *en;
4336 int old_cur_pos; 4336 int old_cur_pos;
@@ -4364,7 +4364,7 @@ _edje_entry_cursor_line_begin(Edje_Real_Part *rp, Edje_Cursor cur)
4364} 4364}
4365 4365
4366void 4366void
4367_edje_text_cursor_line_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c) 4367_edje_text_cursor_line_end(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c)
4368{ 4368{
4369 Entry *en; 4369 Entry *en;
4370 int old_cur_pos; 4370 int old_cur_pos;
@@ -4397,7 +4397,7 @@ _edje_entry_cursor_line_end(Edje_Real_Part *rp, Edje_Cursor cur)
4397} 4397}
4398 4398
4399Eina_Bool 4399Eina_Bool
4400_edje_text_cursor_coord_set(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c, 4400_edje_text_cursor_coord_set(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c,
4401 Evas_Coord x, Evas_Coord y) 4401 Evas_Coord x, Evas_Coord y)
4402{ 4402{
4403 Entry *en = rp->typedata.text->entry_data; 4403 Entry *en = rp->typedata.text->entry_data;
@@ -4444,7 +4444,7 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur)
4444} 4444}
4445 4445
4446char * 4446char *
4447_edje_text_cursor_content_get(Edje_Real_Part *rp EINA_UNUSED, Efl_Text_Cursor_Cursor *c) 4447_edje_text_cursor_content_get(Edje_Real_Part *rp EINA_UNUSED, Efl_Text_Cursor_Handle *c)
4448{ 4448{
4449 return evas_textblock_cursor_content_get(c); 4449 return evas_textblock_cursor_content_get(c);
4450} 4450}
@@ -4460,7 +4460,7 @@ _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur)
4460} 4460}
4461 4461
4462void 4462void
4463_edje_text_cursor_pos_set(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *c, int pos) 4463_edje_text_cursor_pos_set(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *c, int pos)
4464{ 4464{
4465 if ((rp->type != EDJE_RP_TYPE_TEXT) || 4465 if ((rp->type != EDJE_RP_TYPE_TEXT) ||
4466 (!rp->typedata.text)) return; 4466 (!rp->typedata.text)) return;
@@ -4489,7 +4489,7 @@ _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos)
4489} 4489}
4490 4490
4491int 4491int
4492_edje_text_cursor_pos_get(Edje_Real_Part *rp EINA_UNUSED, Efl_Text_Cursor_Cursor *c) 4492_edje_text_cursor_pos_get(Edje_Real_Part *rp EINA_UNUSED, Efl_Text_Cursor_Handle *c)
4493{ 4493{
4494 return evas_textblock_cursor_pos_get(c); 4494 return evas_textblock_cursor_pos_get(c);
4495} 4495}
diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c
index 5ac97c706c..f3a692b5a0 100644
--- a/src/lib/edje/edje_legacy.c
+++ b/src/lib/edje/edje_legacy.c
@@ -1,6 +1,14 @@
1/* Legacy API implementations based on internal EO calls */ 1/* Legacy API implementations based on internal EO calls */
2 2
3#include "edje_private.h" 3#include "edje_private.h"
4#include "edje_part_helper.h"
5
6#define GET_REAL_PART_ON_FAIL_RETURN(x) Edje_Real_Part *rp;\
7 Edje *ed;\
8 ed = _edje_fetch(obj);\
9 if ((!ed) || (!part)) return x;\
10 rp = _edje_real_part_recursive_get(&ed, part);\
11 if (!rp) return x;\
4 12
5EAPI Edje_Load_Error 13EAPI Edje_Load_Error
6edje_object_load_error_get(const Eo *obj) 14edje_object_load_error_get(const Eo *obj)
@@ -275,147 +283,93 @@ edje_object_part_drag_page(Evas_Object *obj, const char *part, double dx, double
275} 283}
276 284
277EAPI void 285EAPI void
278edje_object_part_text_cursor_begin_set(Edje_Object *obj, const char *part, Edje_Cursor cur) 286edje_object_part_text_cursor_begin_set(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
279{ 287{
280 efl_text_cursor_paragraph_first(efl_part(obj, part), 288 GET_REAL_PART_ON_FAIL_RETURN()
281 efl_text_cursor_get(efl_part(obj, part), (int) cur)); 289 _edje_text_cursor_begin(rp, _edje_text_cursor_get(rp, cur));
282} 290}
283 291
284EAPI void 292EAPI void
285edje_object_part_text_cursor_end_set(Edje_Object *obj, const char *part, Edje_Cursor cur) 293edje_object_part_text_cursor_end_set(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
286{ 294{
287 efl_text_cursor_paragraph_last(efl_part(obj, part), 295 GET_REAL_PART_ON_FAIL_RETURN()
288 efl_text_cursor_get(efl_part(obj, part), (int) cur)); 296 _edje_text_cursor_end(rp, _edje_text_cursor_get(rp, cur));
289} 297}
290 298
291EAPI void 299EAPI void
292edje_object_part_text_cursor_pos_set(Edje_Object *obj, const char * part, Edje_Cursor cur, int pos) 300edje_object_part_text_cursor_pos_set(Edje_Object *obj, const char * part EINA_UNUSED, Edje_Cursor cur, int pos)
293{ 301{
294 efl_text_cursor_position_set(efl_part(obj, part), 302 GET_REAL_PART_ON_FAIL_RETURN()
295 efl_text_cursor_get(efl_part(obj, part), (int) cur), pos); 303 _edje_text_cursor_pos_set(rp, _edje_text_cursor_get(rp, cur), pos);
296} 304}
297 305
298EAPI int 306EAPI int
299edje_object_part_text_cursor_pos_get(const Edje_Object *obj, const char * part, Edje_Cursor cur) 307edje_object_part_text_cursor_pos_get(const Edje_Object *obj, const char * part EINA_UNUSED, Edje_Cursor cur)
300{ 308{
301 return efl_text_cursor_position_get(efl_part(obj, part), 309 GET_REAL_PART_ON_FAIL_RETURN(0)
302 efl_text_cursor_get(efl_part(obj, part), (int) cur)); 310 return _edje_text_cursor_pos_get(rp, _edje_text_cursor_get(rp, cur));
303
304} 311}
305 312
306EAPI Eina_Bool 313EAPI Eina_Bool
307edje_object_part_text_cursor_coord_set(Edje_Object *obj, const char *part, Edje_Cursor cur, int x, int y) 314edje_object_part_text_cursor_coord_set(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur, int x, int y)
308{ 315{
309 efl_text_cursor_coord_set(efl_part(obj, part), 316 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
310 efl_text_cursor_get(efl_part(obj, part), (int) cur), x, y); 317 return _edje_text_cursor_coord_set(rp, _edje_text_cursor_get(rp, cur), x, y);
311 return EINA_TRUE;
312} 318}
313 319
314EAPI void 320EAPI void
315edje_object_part_text_cursor_line_begin_set(Edje_Object *obj, const char *part, Edje_Cursor cur) 321edje_object_part_text_cursor_line_begin_set(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
316{ 322{
317 efl_text_cursor_line_char_first(efl_part(obj, part), 323 GET_REAL_PART_ON_FAIL_RETURN()
318 efl_text_cursor_get(efl_part(obj, part), (int) cur)); 324 _edje_text_cursor_line_begin(rp, _edje_text_cursor_get(rp, cur));
319} 325}
320 326
321EAPI void 327EAPI void
322edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part, Edje_Cursor cur) 328edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
323{ 329{
324 efl_text_cursor_line_char_last(efl_part(obj, part), 330 GET_REAL_PART_ON_FAIL_RETURN()
325 efl_text_cursor_get(efl_part(obj, part), (int) cur)); 331 _edje_text_cursor_line_end(rp, _edje_text_cursor_get(rp, cur));
326} 332}
327 333
328EAPI Eina_Bool 334EAPI Eina_Bool
329edje_object_part_text_cursor_prev(Edje_Object *obj, const char *part, Edje_Cursor cur) 335edje_object_part_text_cursor_prev(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
330{ 336{
331 Efl_Text_Cursor_Cursor *c; 337 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
332 int old_pos, new_pos; 338 return _edje_text_cursor_prev(rp, _edje_text_cursor_get(rp, cur));
333
334 c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
335
336 old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
337 efl_text_cursor_char_prev(efl_part(obj, part), c);
338 new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
339
340 if (old_pos != new_pos)
341 return EINA_TRUE;
342
343 return EINA_FALSE;
344} 339}
345 340
346EAPI Eina_Bool 341EAPI Eina_Bool
347edje_object_part_text_cursor_next(Edje_Object *obj, const char *part, Edje_Cursor cur) 342edje_object_part_text_cursor_next(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
348{ 343{
349 Efl_Text_Cursor_Cursor *c; 344 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
350 int old_pos, new_pos; 345 return _edje_text_cursor_next(rp, _edje_text_cursor_get(rp, cur));
351
352 c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
353
354 old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
355 efl_text_cursor_char_next(efl_part(obj, part), c);
356 new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
357
358 if (old_pos != new_pos)
359 return EINA_TRUE;
360
361 return EINA_FALSE;
362} 346}
363 347
364EAPI Eina_Bool 348EAPI Eina_Bool
365edje_object_part_text_cursor_down(Edje_Object *obj, const char *part, Edje_Cursor cur) 349edje_object_part_text_cursor_down(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
366{ 350{
367 Efl_Text_Cursor_Cursor *c; 351 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
368 int old_pos, new_pos; 352 return _edje_text_cursor_down(rp, _edje_text_cursor_get(rp, cur));
369
370 c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
371
372 old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
373 efl_text_cursor_line_jump_by(efl_part(obj, part), c, 1);
374 new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
375
376 if (old_pos != new_pos)
377 return EINA_TRUE;
378
379 return EINA_FALSE;
380} 353}
381 354
382EAPI Eina_Bool 355EAPI Eina_Bool
383edje_object_part_text_cursor_up(Edje_Object *obj, const char *part, Edje_Cursor cur) 356edje_object_part_text_cursor_up(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
384{ 357{
385 Efl_Text_Cursor_Cursor *c; 358 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
386 int old_pos, new_pos; 359 return _edje_text_cursor_up(rp, _edje_text_cursor_get(rp, cur));
387
388 c = efl_text_cursor_get(efl_part(obj, part), (int) cur);
389
390 old_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
391 efl_text_cursor_line_jump_by(efl_part(obj, part), c, -1);
392 new_pos = efl_text_cursor_position_get(efl_part(obj, part), c);
393
394 if (old_pos != new_pos)
395 return EINA_TRUE;
396
397 return EINA_FALSE;
398} 360}
399 361
400EAPI void 362EAPI void
401edje_object_part_text_cursor_copy(Edje_Object *obj, const char *part, Edje_Cursor cur, Edje_Cursor dst) 363edje_object_part_text_cursor_copy(Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur, Edje_Cursor dst)
402{ 364{
403 efl_text_cursor_copy(efl_part(obj, part), 365 GET_REAL_PART_ON_FAIL_RETURN()
404 efl_text_cursor_get(efl_part(obj, part), (int) dst), 366 _edje_text_cursor_copy(rp, _edje_text_cursor_get(rp, cur), _edje_text_cursor_get(rp, dst));
405 efl_text_cursor_get(efl_part(obj, part), (int) cur)
406 );
407} 367}
408 368
409EAPI char * 369EAPI char *
410edje_object_part_text_cursor_content_get(const Edje_Object *obj, const char *part, Edje_Cursor cur) 370edje_object_part_text_cursor_content_get(const Edje_Object *obj, const char *part EINA_UNUSED, Edje_Cursor cur)
411{ 371{
412 Edje_Real_Part *rp; 372 GET_REAL_PART_ON_FAIL_RETURN(NULL)
413 Edje *ed;
414
415 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
416 if ((!ed) || (!part)) return NULL;
417 rp = _edje_real_part_recursive_get(&ed, part);
418 if (!rp) return NULL;
419 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 373 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
420 { 374 {
421 return _edje_entry_cursor_content_get(rp, cur); 375 return _edje_entry_cursor_content_get(rp, cur);
@@ -425,27 +379,18 @@ edje_object_part_text_cursor_content_get(const Edje_Object *obj, const char *par
425} 379}
426 380
427EAPI void 381EAPI void
428edje_object_part_text_cursor_geometry_get(const Edje_Object *obj, const char * part, int *x, int *y, int *w, int *h) 382edje_object_part_text_cursor_geometry_get(const Edje_Object *obj, const char * part EINA_UNUSED, int *x, int *y, int *w, int *h)
429{ 383{
430 efl_text_cursor_geometry_get(efl_part(obj, part), 384 GET_REAL_PART_ON_FAIL_RETURN()
431 efl_text_cursor_get(efl_part(obj, part), EFL_TEXT_CURSOR_GET_TYPE_MAIN), 385 evas_textblock_cursor_geometry_bidi_get(_edje_text_cursor_get(rp, EDJE_CURSOR_MAIN),
432 EFL_TEXT_CURSOR_TYPE_BEFORE, 386 x, y, w, h, NULL, NULL, NULL, NULL, EVAS_TEXTBLOCK_CURSOR_BEFORE);
433 x, y, w, h, NULL, NULL, NULL, NULL
434 );
435} 387}
436 388
437EAPI Eina_Bool 389EAPI Eina_Bool
438edje_object_part_text_hide_visible_password(Eo *obj, const char *part) 390edje_object_part_text_hide_visible_password(Eo *obj, const char *part)
439{ 391{
440 Edje_Real_Part *rp; 392 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
441 Eina_Bool int_ret = EINA_FALSE; 393 Eina_Bool int_ret = EINA_FALSE;
442 Edje *ed;
443
444 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
445
446 if ((!ed) || (!part)) return EINA_FALSE;
447 rp = _edje_real_part_recursive_get(&ed, part);
448 if (!rp) return EINA_FALSE;
449 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE; 394 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return EINA_FALSE;
450 if ((rp->type != EDJE_RP_TYPE_TEXT) || 395 if ((rp->type != EDJE_RP_TYPE_TEXT) ||
451 (!rp->typedata.text)) 396 (!rp->typedata.text))
@@ -462,13 +407,7 @@ edje_object_part_text_hide_visible_password(Eo *obj, const char *part)
462EAPI Eina_Bool 407EAPI Eina_Bool
463edje_object_part_text_cursor_is_format_get(const Eo *obj, const char *part, Edje_Cursor cur) 408edje_object_part_text_cursor_is_format_get(const Eo *obj, const char *part, Edje_Cursor cur)
464{ 409{
465 Edje_Real_Part *rp; 410 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
466 Edje *ed;
467
468 ed = _edje_fetch(obj);
469 if ((!ed) || (!part)) return EINA_FALSE;
470 rp = _edje_real_part_recursive_get(&ed, part);
471 if (!rp) return EINA_FALSE;
472 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 411 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
473 { 412 {
474 return _edje_entry_cursor_is_format_get(rp, cur); 413 return _edje_entry_cursor_is_format_get(rp, cur);
@@ -479,13 +418,7 @@ edje_object_part_text_cursor_is_format_get(const Eo *obj, const char *part, Edje
479EAPI Eina_Bool 418EAPI Eina_Bool
480edje_object_part_text_cursor_is_visible_format_get(const Eo *obj, const char *part, Edje_Cursor cur) 419edje_object_part_text_cursor_is_visible_format_get(const Eo *obj, const char *part, Edje_Cursor cur)
481{ 420{
482 Edje_Real_Part *rp; 421 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
483 Edje *ed;
484
485 ed = _edje_fetch(obj);
486 if ((!ed) || (!part)) return EINA_FALSE;
487 rp = _edje_real_part_recursive_get(&ed, part);
488 if (!rp) return EINA_FALSE;
489 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 422 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
490 { 423 {
491 return _edje_entry_cursor_is_visible_format_get(rp, cur); 424 return _edje_entry_cursor_is_visible_format_get(rp, cur);
@@ -497,13 +430,7 @@ edje_object_part_text_cursor_is_visible_format_get(const Eo *obj, const char *pa
497EAPI const Eina_List * 430EAPI const Eina_List *
498edje_object_part_text_anchor_list_get(const Eo *obj, const char *part) 431edje_object_part_text_anchor_list_get(const Eo *obj, const char *part)
499{ 432{
500 Edje_Real_Part *rp; 433 GET_REAL_PART_ON_FAIL_RETURN(NULL)
501 Edje *ed;
502
503 ed = _edje_fetch(obj);
504 if ((!ed) || (!part)) return NULL;
505 rp = _edje_real_part_recursive_get(&ed, part);
506 if (!rp) return NULL;
507 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 434 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
508 return _edje_entry_anchors_list(rp); 435 return _edje_entry_anchors_list(rp);
509 436
@@ -513,13 +440,7 @@ edje_object_part_text_anchor_list_get(const Eo *obj, const char *part)
513EAPI const Eina_List * 440EAPI const Eina_List *
514edje_object_part_text_anchor_geometry_get(const Eo *obj, const char *part, const char *anchor) 441edje_object_part_text_anchor_geometry_get(const Eo *obj, const char *part, const char *anchor)
515{ 442{
516 Edje_Real_Part *rp; 443 GET_REAL_PART_ON_FAIL_RETURN(NULL)
517 Edje *ed;
518
519 ed = _edje_fetch(obj);
520 if ((!ed) || (!part)) return NULL;
521 rp = _edje_real_part_recursive_get(&ed, part);
522 if (!rp) return NULL;
523 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 444 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
524 return _edje_entry_anchor_geometry_get(rp, anchor); 445 return _edje_entry_anchor_geometry_get(rp, anchor);
525 446
@@ -529,15 +450,9 @@ edje_object_part_text_anchor_geometry_get(const Eo *obj, const char *part, const
529EAPI void 450EAPI void
530edje_object_part_text_style_user_push(Eo *obj EINA_UNUSED, const char *part, const char *style) 451edje_object_part_text_style_user_push(Eo *obj EINA_UNUSED, const char *part, const char *style)
531{ 452{
532 Edje_Real_Part *rp;
533 Evas_Textblock_Style *ts; 453 Evas_Textblock_Style *ts;
534 Edje *ed; 454 GET_REAL_PART_ON_FAIL_RETURN()
535
536 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
537 455
538 if ((!ed) || (!part) || (!style)) return;
539 rp = _edje_real_part_recursive_get(&ed, part);
540 if (!rp) return;
541 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; 456 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return;
542 457
543 ts = evas_textblock_style_new(); 458 ts = evas_textblock_style_new();
@@ -552,16 +467,9 @@ edje_object_part_text_style_user_push(Eo *obj EINA_UNUSED, const char *part, con
552} 467}
553 468
554EAPI void 469EAPI void
555edje_object_part_text_style_user_pop(Eo *obj EINA_UNUSED, const char *part) 470edje_object_part_text_style_user_pop(Eo *obj, const char *part)
556{ 471{
557 Edje_Real_Part *rp; 472 GET_REAL_PART_ON_FAIL_RETURN()
558 Edje *ed;
559
560 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
561
562 if ((!ed) || (!part)) return;
563 rp = _edje_real_part_recursive_get(&ed, part);
564 if (!rp) return;
565 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return; 473 if (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) return;
566 474
567 evas_object_textblock_style_user_pop(rp->object); 475 evas_object_textblock_style_user_pop(rp->object);
@@ -579,7 +487,7 @@ edje_object_part_text_style_user_peek(const Eo *obj EINA_UNUSED, const char *par
579 const Evas_Textblock_Style *ts; 487 const Evas_Textblock_Style *ts;
580 Edje *ed; 488 Edje *ed;
581 489
582 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 490 ed = _edje_fetch(obj);
583 491
584 if ((!ed) || (!part)) return NULL; 492 if ((!ed) || (!part)) return NULL;
585 rp = _edje_real_part_recursive_get(&ed, part); 493 rp = _edje_real_part_recursive_get(&ed, part);
@@ -596,14 +504,7 @@ edje_object_part_text_style_user_peek(const Eo *obj EINA_UNUSED, const char *par
596EAPI const Eina_List * 504EAPI const Eina_List *
597edje_object_part_text_item_list_get(const Eo *obj EINA_UNUSED, const char *part) 505edje_object_part_text_item_list_get(const Eo *obj EINA_UNUSED, const char *part)
598{ 506{
599 Edje_Real_Part *rp; 507 GET_REAL_PART_ON_FAIL_RETURN(NULL)
600 Edje *ed;
601
602 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
603
604 if ((!ed) || (!part)) return NULL;
605 rp = _edje_real_part_recursive_get(&ed, part);
606 if (!rp) return NULL;
607 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 508 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
608 return _edje_entry_items_list(rp); 509 return _edje_entry_items_list(rp);
609 510
@@ -613,14 +514,7 @@ edje_object_part_text_item_list_get(const Eo *obj EINA_UNUSED, const char *part)
613EAPI Eina_Bool 514EAPI Eina_Bool
614edje_object_part_text_item_geometry_get(const Eo *obj EINA_UNUSED, const char *part, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) 515edje_object_part_text_item_geometry_get(const Eo *obj EINA_UNUSED, const char *part, const char *item, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch)
615{ 516{
616 Edje_Real_Part *rp; 517 GET_REAL_PART_ON_FAIL_RETURN(EINA_FALSE)
617 Edje *ed;
618
619 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS);
620
621 if ((!ed) || (!part)) return EINA_FALSE;
622 rp = _edje_real_part_recursive_get(&ed, part);
623 if (!rp) return EINA_FALSE;
624 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE) 518 if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
625 { 519 {
626 return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch); 520 return _edje_entry_item_geometry_get(rp, item, cx, cy, cw, ch);
@@ -635,7 +529,7 @@ edje_object_text_insert_filter_callback_add(Eo *obj EINA_UNUSED, const char *par
635 Edje_Text_Insert_Filter_Callback *cb; 529 Edje_Text_Insert_Filter_Callback *cb;
636 Edje *ed; 530 Edje *ed;
637 531
638 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 532 ed = _edje_fetch(obj);
639 533
640 if ((!ed) || (!part)) return; 534 if ((!ed) || (!part)) return;
641 cb = calloc(1, sizeof(Edje_Text_Insert_Filter_Callback)); 535 cb = calloc(1, sizeof(Edje_Text_Insert_Filter_Callback));
@@ -653,7 +547,7 @@ edje_object_text_insert_filter_callback_del(Eo *obj EINA_UNUSED, const char *par
653 Eina_List *l; 547 Eina_List *l;
654 Edje *ed; 548 Edje *ed;
655 549
656 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 550 ed = _edje_fetch(obj);
657 551
658 if ((!ed) || (!part)) return NULL; 552 if ((!ed) || (!part)) return NULL;
659 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) 553 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
@@ -679,7 +573,7 @@ edje_object_text_insert_filter_callback_del_full(Eo *obj EINA_UNUSED, const char
679 Eina_List *l; 573 Eina_List *l;
680 Edje *ed; 574 Edje *ed;
681 575
682 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 576 ed = _edje_fetch(obj);
683 577
684 if ((!ed) || (!part)) return NULL; 578 if ((!ed) || (!part)) return NULL;
685 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) 579 EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb)
@@ -705,7 +599,7 @@ edje_object_text_markup_filter_callback_add(Eo *obj EINA_UNUSED, const char *par
705 Edje_Markup_Filter_Callback *cb; 599 Edje_Markup_Filter_Callback *cb;
706 Edje *ed; 600 Edje *ed;
707 601
708 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 602 ed = _edje_fetch(obj);
709 603
710 if ((!ed) || (!part)) return; 604 if ((!ed) || (!part)) return;
711 cb = calloc(1, sizeof(Edje_Markup_Filter_Callback)); 605 cb = calloc(1, sizeof(Edje_Markup_Filter_Callback));
@@ -723,7 +617,7 @@ edje_object_text_markup_filter_callback_del(Eo *obj EINA_UNUSED, const char *par
723 Eina_List *l; 617 Eina_List *l;
724 Edje *ed; 618 Edje *ed;
725 619
726 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 620 ed = _edje_fetch(obj);
727 621
728 if ((!ed) || (!part)) return NULL; 622 if ((!ed) || (!part)) return NULL;
729 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) 623 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb)
@@ -749,7 +643,7 @@ edje_object_text_markup_filter_callback_del_full(Eo *obj EINA_UNUSED, const char
749 Eina_List *l; 643 Eina_List *l;
750 Edje *ed; 644 Edje *ed;
751 645
752 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 646 ed = _edje_fetch(obj);
753 647
754 if ((!ed) || (!part)) return NULL; 648 if ((!ed) || (!part)) return NULL;
755 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) 649 EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb)
@@ -775,7 +669,7 @@ edje_object_part_text_user_insert(const Eo *obj, const char *part, const char *t
775 Edje_Real_Part *rp; 669 Edje_Real_Part *rp;
776 Edje *ed; 670 Edje *ed;
777 671
778 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 672 ed = _edje_fetch(obj);
779 673
780 if ((!ed) || (!part)) return; 674 if ((!ed) || (!part)) return;
781 rp = _edje_real_part_recursive_get(&ed, part); 675 rp = _edje_real_part_recursive_get(&ed, part);
@@ -828,7 +722,7 @@ edje_object_part_text_append(Eo *obj, const char *part, const char *text)
828 722
829 Edje *ed; 723 Edje *ed;
830 724
831 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 725 ed = _edje_fetch(obj);
832 if ((!ed) || (!part)) return; 726 if ((!ed) || (!part)) return;
833 rp = _edje_real_part_recursive_get(&ed, part); 727 rp = _edje_real_part_recursive_get(&ed, part);
834 if (!rp) return; 728 if (!rp) return;
@@ -852,7 +746,7 @@ edje_object_part_text_escaped_set(Eo *obj, const char *part, const char *text)
852 Eina_Bool int_ret; 746 Eina_Bool int_ret;
853 Edje *ed; 747 Edje *ed;
854 748
855 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 749 ed = _edje_fetch(obj);
856 750
857 if ((!ed) || (!part)) return EINA_FALSE; 751 if ((!ed) || (!part)) return EINA_FALSE;
858 rp = _edje_real_part_recursive_get(&ed, part); 752 rp = _edje_real_part_recursive_get(&ed, part);
@@ -1038,7 +932,7 @@ edje_object_part_text_unescaped_set(Eo *obj, const char *part, const char *text_
1038 Eina_Bool int_ret = EINA_FALSE; 932 Eina_Bool int_ret = EINA_FALSE;
1039 Edje *ed; 933 Edje *ed;
1040 934
1041 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 935 ed = _edje_fetch(obj);
1042 936
1043 if ((!ed) || (!part)) return EINA_FALSE; 937 if ((!ed) || (!part)) return EINA_FALSE;
1044 rp = _edje_real_part_recursive_get(&ed, part); 938 rp = _edje_real_part_recursive_get(&ed, part);
@@ -1065,7 +959,7 @@ edje_object_part_text_unescaped_get(const Eo *obj EINA_UNUSED, const char *part)
1065 Edje_Real_Part *rp; 959 Edje_Real_Part *rp;
1066 Edje *ed; 960 Edje *ed;
1067 961
1068 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 962 ed = _edje_fetch(obj);
1069 963
1070 if ((!ed) || (!part)) return NULL; 964 if ((!ed) || (!part)) return NULL;
1071 965
@@ -1119,7 +1013,7 @@ edje_object_part_text_insert(Eo *obj, const char *part, const char *text)
1119 Edje_Real_Part *rp; 1013 Edje_Real_Part *rp;
1120 Edje *ed; 1014 Edje *ed;
1121 1015
1122 ed = efl_data_scope_get(obj, EFL_CANVAS_LAYOUT_CLASS); 1016 ed = _edje_fetch(obj);
1123 1017
1124 if ((!ed) || (!part)) return; 1018 if ((!ed) || (!part)) return;
1125 rp = _edje_real_part_recursive_get(&ed, part); 1019 rp = _edje_real_part_recursive_get(&ed, part);
diff --git a/src/lib/edje/edje_part_invalid.c b/src/lib/edje/edje_part_invalid.c
index 4c62204709..9b939d9f72 100644
--- a/src/lib/edje/edje_part_invalid.c
+++ b/src/lib/edje/edje_part_invalid.c
@@ -62,21 +62,6 @@ EDJE_PART_INVALID_VOID(efl_text_set, _efl_canvas_layout_part_invalid_efl_text_te
62EDJE_PART_INVALID_CONST(const char *, 0, efl_text_get, _efl_canvas_layout_part_invalid_efl_text_text_get) 62EDJE_PART_INVALID_CONST(const char *, 0, efl_text_get, _efl_canvas_layout_part_invalid_efl_text_text_get)
63EDJE_PART_INVALID_VOID(efl_text_markup_set, _efl_canvas_layout_part_invalid_efl_text_markup_markup_set, const char *text) 63EDJE_PART_INVALID_VOID(efl_text_markup_set, _efl_canvas_layout_part_invalid_efl_text_markup_markup_set, const char *text)
64EDJE_PART_INVALID_CONST(const char *, 0, efl_text_markup_get, _efl_canvas_layout_part_invalid_efl_text_markup_markup_get) 64EDJE_PART_INVALID_CONST(const char *, 0, efl_text_markup_get, _efl_canvas_layout_part_invalid_efl_text_markup_markup_get)
65EDJE_PART_INVALID_CONST(Efl_Text_Cursor_Cursor *, 0, efl_text_cursor_get, _efl_canvas_layout_part_invalid_efl_text_cursor_text_cursor_get, Efl_Text_Cursor_Get_Type get_type)
66EDJE_PART_INVALID_VOID(efl_text_cursor_paragraph_first, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_paragraph_first, Efl_Text_Cursor_Cursor *cur)
67EDJE_PART_INVALID_VOID(efl_text_cursor_paragraph_last, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_paragraph_last, Efl_Text_Cursor_Cursor *cur)
68EDJE_PART_INVALID_VOID(efl_text_cursor_position_set, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_position_set, Efl_Text_Cursor_Cursor *cur, int position)
69EDJE_PART_INVALID_CONST(int, 0, efl_text_cursor_position_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_position_get, Efl_Text_Cursor_Cursor *cur)
70EDJE_PART_INVALID_VOID(efl_text_cursor_coord_set, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_coord_set, Efl_Text_Cursor_Cursor *cur, int x, int y)
71EDJE_PART_INVALID_VOID(efl_text_cursor_line_char_first, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_char_first, Efl_Text_Cursor_Cursor *cur)
72EDJE_PART_INVALID_VOID(efl_text_cursor_line_char_last, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_char_last, Efl_Text_Cursor_Cursor *cur)
73EDJE_PART_INVALID_VOID(efl_text_cursor_char_next, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_char_next, Efl_Text_Cursor_Cursor *cur)
74EDJE_PART_INVALID_VOID(efl_text_cursor_char_prev, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_char_prev, Efl_Text_Cursor_Cursor *cur)
75EDJE_PART_INVALID_VOID(efl_text_cursor_line_jump_by, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_line_jump_by, Efl_Text_Cursor_Cursor *cur, int by)
76EDJE_PART_INVALID_VOID(efl_text_cursor_copy, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_copy, Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src)
77EDJE_PART_INVALID_CONST(Eina_Unicode, 0, efl_text_cursor_content_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_content_get, const Efl_Text_Cursor_Cursor *cur)
78EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_text_cursor_geometry_get, _efl_canvas_layout_part_invalid_efl_text_cursor_cursor_geometry_get, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Type ctype, int *cx, int *cy, int *cw, int *ch, int *cx2, int *cy2, int *cw2, int *ch2)
79EDJE_PART_INVALID_VOID(efl_text_markup_interactive_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_interactive_cursor_markup_insert, Efl_Text_Cursor_Cursor *cur, const char *markup)
80EDJE_PART_INVALID(Eina_Iterator *, 0, efl_content_iterate, _efl_canvas_layout_part_invalid_efl_container_content_iterate) 65EDJE_PART_INVALID(Eina_Iterator *, 0, efl_content_iterate, _efl_canvas_layout_part_invalid_efl_container_content_iterate)
81EDJE_PART_INVALID(int, 0, efl_content_count, _efl_canvas_layout_part_invalid_efl_container_content_count) 66EDJE_PART_INVALID(int, 0, efl_content_count, _efl_canvas_layout_part_invalid_efl_container_content_count)
82EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_clear, _efl_canvas_layout_part_invalid_efl_pack_pack_clear) 67EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_clear, _efl_canvas_layout_part_invalid_efl_pack_pack_clear)
diff --git a/src/lib/edje/edje_part_text.c b/src/lib/edje/edje_part_text.c
index 8f7d936cb6..01bca325c1 100644
--- a/src/lib/edje/edje_part_text.c
+++ b/src/lib/edje/edje_part_text.c
@@ -38,165 +38,6 @@ _efl_canvas_layout_part_text_efl_text_markup_markup_set(Eo *obj,
38 _edje_efl_text_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE); 38 _edje_efl_text_text_set(obj, pd->ed, pd->part, text, EINA_FALSE, EINA_TRUE);
39} 39}
40 40
41
42EOLIAN static Efl_Text_Cursor_Cursor *
43_efl_canvas_layout_part_text_efl_text_cursor_text_cursor_get(const Eo *obj,
44 void *_pd EINA_UNUSED, Efl_Text_Cursor_Get_Type get_type)
45{
46 PROXY_DATA_GET(obj, pd);
47 return _edje_text_cursor_get(pd->rp, (int) get_type);
48}
49
50EOLIAN static void
51_efl_canvas_layout_part_text_efl_text_cursor_cursor_paragraph_first(Eo *obj,
52 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
53{
54 PROXY_DATA_GET(obj, pd);
55 _edje_text_cursor_begin(pd->rp, cur);
56}
57
58EOLIAN static void
59_efl_canvas_layout_part_text_efl_text_cursor_cursor_paragraph_last(Eo *obj,
60 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
61{
62 PROXY_DATA_GET(obj, pd);
63 _edje_text_cursor_end(pd->rp, cur);
64}
65
66EOLIAN static void
67_efl_canvas_layout_part_text_efl_text_cursor_cursor_position_set(Eo *obj,
68 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, int pos)
69{
70 PROXY_DATA_GET(obj, pd);
71 _edje_text_cursor_pos_set(pd->rp, cur, pos);
72}
73
74EOLIAN static int
75_efl_canvas_layout_part_text_efl_text_cursor_cursor_position_get(const Eo *obj,
76 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
77{
78 PROXY_DATA_GET(obj, pd);
79 return _edje_text_cursor_pos_get(pd->rp, cur);
80}
81
82EOLIAN static void
83_efl_canvas_layout_part_text_efl_text_cursor_cursor_coord_set(Eo *obj,
84 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur,
85 int x, int y)
86{
87 PROXY_DATA_GET(obj, pd);
88 _edje_text_cursor_coord_set(pd->rp, cur, x, y);
89}
90
91EOLIAN static void
92_efl_canvas_layout_part_text_efl_text_cursor_cursor_line_char_first(Eo *obj,
93 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
94{
95 PROXY_DATA_GET(obj, pd);
96 _edje_text_cursor_line_begin(pd->rp, cur);
97}
98
99EOLIAN static void
100_efl_canvas_layout_part_text_efl_text_cursor_cursor_line_char_last(Eo *obj,
101 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
102{
103 PROXY_DATA_GET(obj, pd);
104 _edje_text_cursor_line_end(pd->rp, cur);
105}
106
107EOLIAN static void
108_efl_canvas_layout_part_text_efl_text_cursor_cursor_char_prev(Eo *obj,
109 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
110{
111 PROXY_DATA_GET(obj, pd);
112 _edje_text_cursor_prev(pd->rp, cur);
113}
114
115EOLIAN static void
116_efl_canvas_layout_part_text_efl_text_cursor_cursor_char_next(Eo *obj,
117 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
118{
119 PROXY_DATA_GET(obj, pd);
120 _edje_text_cursor_next(pd->rp, cur);
121}
122
123EOLIAN static void
124_efl_canvas_layout_part_text_efl_text_cursor_cursor_line_jump_by(Eo *obj,
125 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, int by)
126{
127 PROXY_DATA_GET(obj, pd);
128 if (by == 1)
129 {
130 _edje_text_cursor_down(pd->rp, cur);
131 }
132 else if (by == -1)
133 {
134 _edje_text_cursor_up(pd->rp, cur);
135 }
136}
137
138EOLIAN static void
139_efl_canvas_layout_part_text_efl_text_cursor_cursor_copy(Eo *obj,
140 void *_pd EINA_UNUSED,
141 Efl_Text_Cursor_Cursor *dst,
142 const Efl_Text_Cursor_Cursor *cur)
143{
144 PROXY_DATA_GET(obj, pd);
145 _edje_text_cursor_copy(pd->rp, (Efl_Text_Cursor_Cursor *) cur, dst);
146}
147
148EOLIAN static Eina_Unicode
149_efl_canvas_layout_part_text_efl_text_cursor_cursor_content_get(const Eo *obj,
150 void *_pd EINA_UNUSED,
151 const Efl_Text_Cursor_Cursor *cur)
152{
153 Eina_Unicode *ustr;
154 Eina_Unicode uc = { 0 };
155 char *c;
156 int len;
157
158 PROXY_DATA_GET(obj, pd);
159 c = _edje_text_cursor_content_get(pd->rp, (Efl_Text_Cursor_Cursor *) cur);
160 ustr = eina_unicode_utf8_to_unicode(c, &len);
161 free(c);
162 if (ustr)
163 {
164 uc = *ustr;
165 free(ustr);
166 }
167 return uc;
168}
169
170EOLIAN static Eina_Bool
171_efl_canvas_layout_part_text_efl_text_cursor_cursor_geometry_get(const Eo *obj,
172 void *_pd EINA_UNUSED,
173 const Efl_Text_Cursor_Cursor *cur EINA_UNUSED,
174 Efl_Text_Cursor_Type ctype EINA_UNUSED,
175 Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch,
176 Evas_Coord *cx2 EINA_UNUSED, Evas_Coord *cy2 EINA_UNUSED,
177 Evas_Coord *cw2 EINA_UNUSED, Evas_Coord *ch2 EINA_UNUSED)
178{
179 PROXY_DATA_GET(obj, pd);
180 if (pd->rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
181 {
182 _edje_entry_cursor_geometry_get(pd->rp, cx, cy, cw, ch, NULL);
183 if (cx) *cx -= pd->ed->x;
184 if (cy) *cy -= pd->ed->y;
185 }
186 return EINA_FALSE;
187}
188
189EOLIAN static void
190_efl_canvas_layout_part_text_efl_text_markup_interactive_cursor_markup_insert(Eo *obj,
191 void *_pd EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED,
192 const char *text)
193{
194 PROXY_DATA_GET(obj, pd);
195 // Ignoring cursor type and always inserting with main cursor
196 _edje_object_part_text_insert(pd->ed, pd->rp, text);
197 // FIXME: entry should report the length of inserted text (after filtering)
198}
199
200/* More Efl.Text.* API (@since 1.22) */ 41/* More Efl.Text.* API (@since 1.22) */
201 42
202EOLIAN static void 43EOLIAN static void
diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h
index 676231512f..33b07a2c26 100644
--- a/src/lib/edje/edje_private.h
+++ b/src/lib/edje/edje_private.h
@@ -3303,19 +3303,19 @@ const char *_edje_efl_text_text_get(const Eo *obj, Edje *ed, const char *part, E
3303Eina_Bool _edje_efl_text_markup_set(Eo *obj, Edje *ed, const char *part, const char *markup); 3303Eina_Bool _edje_efl_text_markup_set(Eo *obj, Edje *ed, const char *part, const char *markup);
3304const char *_edje_efl_text_markup_get(Eo *obj, Edje *ed, const char *part); 3304const char *_edje_efl_text_markup_get(Eo *obj, Edje *ed, const char *part);
3305Evas_Textblock_Cursor *_edje_text_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur); 3305Evas_Textblock_Cursor *_edje_text_cursor_get(Edje_Real_Part *rp, Edje_Cursor cur);
3306void _edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3306void _edje_text_cursor_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3307void _edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3307void _edje_text_cursor_end(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3308void _edje_text_cursor_pos_set(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur, int pos); 3308void _edje_text_cursor_pos_set(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur, int pos);
3309int _edje_text_cursor_pos_get(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3309int _edje_text_cursor_pos_get(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3310Eina_Bool _edje_text_cursor_coord_set(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur, int x, int y); 3310Eina_Bool _edje_text_cursor_coord_set(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur, int x, int y);
3311void _edje_text_cursor_line_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3311void _edje_text_cursor_line_begin(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3312void _edje_text_cursor_line_end(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3312void _edje_text_cursor_line_end(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3313Eina_Bool _edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3313Eina_Bool _edje_text_cursor_next(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3314Eina_Bool _edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3314Eina_Bool _edje_text_cursor_prev(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3315Eina_Bool _edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3315Eina_Bool _edje_text_cursor_up(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3316Eina_Bool _edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3316Eina_Bool _edje_text_cursor_down(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3317void _edje_text_cursor_copy(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *dst, Efl_Text_Cursor_Cursor *cur); 3317void _edje_text_cursor_copy(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *dst, Efl_Text_Cursor_Handle *cur);
3318char * _edje_text_cursor_content_get(Edje_Real_Part *rp, Efl_Text_Cursor_Cursor *cur); 3318char * _edje_text_cursor_content_get(Edje_Real_Part *rp, Efl_Text_Cursor_Handle *cur);
3319void _edje_object_part_text_insert(Edje *ed, Edje_Real_Part *rp, const char *text); 3319void _edje_object_part_text_insert(Edje *ed, Edje_Real_Part *rp, const char *text);
3320 3320
3321void _edje_internal_proxy_shutdown(void); 3321void _edje_internal_proxy_shutdown(void);
diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c
index ce1015e065..8b9d97ebe1 100644
--- a/src/lib/edje/edje_textblock.c
+++ b/src/lib/edje/edje_textblock.c
@@ -34,7 +34,8 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
34 int *minw, int *minh, 34 int *minw, int *minh,
35 int *maxw, int *maxh) 35 int *maxw, int *maxh)
36{ 36{
37 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b; 37 Eina_Size2D size;
38 Evas_Coord ins_l, ins_r, ins_t, ins_b;
38 unsigned char minx2 = 0, miny2 = 0, maxx2 = 0, maxy2 = 0; 39 unsigned char minx2 = 0, miny2 = 0, maxx2 = 0, maxy2 = 0;
39 40
40 minx2 = chosen_desc->text.min_x; 41 minx2 = chosen_desc->text.min_x;
@@ -57,18 +58,18 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
57 { 58 {
58 int mw = 0, mh = 0; 59 int mw = 0, mh = 0;
59 60
60 tw = th = 0; 61 size.w = size.h = 0;
61 if (!minx2) 62 if (!minx2)
62 { 63 {
63 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h))); 64 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
64 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 65 size = efl_canvas_text_size_formatted_get(ep->object);
65 } 66 }
66 else 67 else
67 evas_object_textblock_size_native_get(ep->object, &tw, &th); 68 size = efl_canvas_text_size_native_get(ep->object);
68 evas_object_textblock_style_insets_get(ep->object, &ins_l, 69 evas_object_textblock_style_insets_get(ep->object, &ins_l,
69 &ins_r, &ins_t, &ins_b); 70 &ins_r, &ins_t, &ins_b);
70 mw = ins_l + tw + ins_r; 71 mw = ins_l + size.w + ins_r;
71 mh = ins_t + th + ins_b; 72 mh = ins_t + size.h + ins_b;
72 if (minw && minx2) 73 if (minw && minx2)
73 { 74 {
74 if (mw > *minw) *minw = mw; 75 if (mw > *minw) *minw = mw;
@@ -83,18 +84,18 @@ _edje_part_recalc_single_textblock_min_max_calc_legacy(Edje_Real_Part *ep,
83 { 84 {
84 int mw = 0, mh = 0; 85 int mw = 0, mh = 0;
85 86
86 tw = th = 0; 87 size.w = size.h = 0;
87 if (!maxx2) 88 if (!maxx2)
88 { 89 {
89 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h))); 90 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(TO_INT(params->eval.w), TO_INT(params->eval.h)));
90 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 91 size = efl_canvas_text_size_formatted_get(ep->object);
91 } 92 }
92 else 93 else
93 evas_object_textblock_size_native_get(ep->object, &tw, &th); 94 size = efl_canvas_text_size_native_get(ep->object);
94 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r, 95 evas_object_textblock_style_insets_get(ep->object, &ins_l, &ins_r,
95 &ins_t, &ins_b); 96 &ins_t, &ins_b);
96 mw = ins_l + tw + ins_r; 97 mw = ins_l + size.w + ins_r;
97 mh = ins_t + th + ins_b; 98 mh = ins_t + size.h + ins_b;
98 if (maxw && maxx2) 99 if (maxw && maxx2)
99 { 100 {
100 if (mw > *maxw) *maxw = mw; 101 if (mw > *maxw) *maxw = mw;
@@ -115,6 +116,7 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
115 int *minw, int *minh, 116 int *minw, int *minh,
116 int *maxw, int *maxh) 117 int *maxw, int *maxh)
117{ 118{
119 Eina_Size2D size;
118 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b; 120 Evas_Coord tw, th, ins_l, ins_r, ins_t, ins_b;
119 Evas_Coord min_calc_w = 0, min_calc_h = 0; 121 Evas_Coord min_calc_w = 0, min_calc_h = 0;
120 122
@@ -178,14 +180,17 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
178 if (temp_w > 0) 180 if (temp_w > 0)
179 { 181 {
180 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h)); 182 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
181 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 183 size = efl_canvas_text_size_formatted_get(ep->object);
184 tw = size.w;
185 th = size.h;
182 186
183 tw += ins_l + ins_r; 187 tw += ins_l + ins_r;
184 th += ins_t + ins_b; 188 th += ins_t + ins_b;
185 } 189 }
186 else 190 else
187 { 191 {
188 efl_canvas_text_size_native_get(ep->object, NULL, &th); 192 size = efl_canvas_text_size_native_get(ep->object);
193 th = size.h;
189 194
190 th += ins_t + ins_b; 195 th += ins_t + ins_b;
191 } 196 }
@@ -216,7 +221,9 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
216 } 221 }
217 222
218 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h)); 223 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
219 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 224 size = efl_canvas_text_size_formatted_get(ep->object);
225 tw = size.w;
226 th = size.h;
220 227
221 tw += ins_l + ins_r; 228 tw += ins_l + ins_r;
222 th += ins_t + ins_b; 229 th += ins_t + ins_b;
@@ -225,7 +232,8 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
225 * don't get meaningless height for multiline */ 232 * don't get meaningless height for multiline */
226 if (temp_w <= 0) 233 if (temp_w <= 0)
227 { 234 {
228 efl_canvas_text_size_native_get(ep->object, NULL, &th); 235 size = efl_canvas_text_size_native_get(ep->object);
236 th = size.h;
229 237
230 th += ins_t + ins_b; 238 th += ins_t + ins_b;
231 } 239 }
@@ -238,7 +246,9 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
238 * text.min: 1 X 246 * text.min: 1 X
239 * text.max: 0 X without max width. 247 * text.max: 0 X without max width.
240 * It is a singleline Textblock. */ 248 * It is a singleline Textblock. */
241 efl_canvas_text_size_native_get(ep->object, &tw, &th); 249 size = efl_canvas_text_size_native_get(ep->object);
250 tw = size.w;
251 th = size.h;
242 252
243 tw += ins_l + ins_r; 253 tw += ins_l + ins_r;
244 th += ins_t + ins_b; 254 th += ins_t + ins_b;
@@ -301,14 +311,17 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
301 if (temp_w > 0) 311 if (temp_w > 0)
302 { 312 {
303 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h)); 313 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
304 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 314 size = efl_canvas_text_size_formatted_get(ep->object);
315 tw = size.w;
316 th = size.h;
305 317
306 tw += ins_l + ins_r; 318 tw += ins_l + ins_r;
307 th += ins_t + ins_b; 319 th += ins_t + ins_b;
308 } 320 }
309 else 321 else
310 { 322 {
311 efl_canvas_text_size_native_get(ep->object, NULL, &th); 323 size = efl_canvas_text_size_native_get(ep->object);
324 th = size.h;
312 325
313 th += ins_t + ins_b; 326 th += ins_t + ins_b;
314 } 327 }
@@ -322,7 +335,9 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
322 /* text.min: 1 X 335 /* text.min: 1 X
323 * text.max: 1 X 336 * text.max: 1 X
324 * Singleline. */ 337 * Singleline. */
325 efl_canvas_text_size_native_get(ep->object, &tw, &th); 338 size = efl_canvas_text_size_native_get(ep->object);
339 tw = size.w;
340 th = size.h;
326 341
327 tw += ins_l + ins_r; 342 tw += ins_l + ins_r;
328 th += ins_t + ins_b; 343 th += ins_t + ins_b;
@@ -359,7 +374,9 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
359 * text.max: 1 1 */ 374 * text.max: 1 1 */
360 375
361 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h)); 376 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
362 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 377 size = efl_canvas_text_size_formatted_get(ep->object);
378 tw = size.w;
379 th = size.h;
363 380
364 tw += ins_l + ins_r; 381 tw += ins_l + ins_r;
365 th += ins_t + ins_b; 382 th += ins_t + ins_b;
@@ -368,7 +385,8 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
368 * don't get meaningless height for multiline */ 385 * don't get meaningless height for multiline */
369 if (temp_w <= 0) 386 if (temp_w <= 0)
370 { 387 {
371 efl_canvas_text_size_native_get(ep->object, NULL, &th); 388 size = efl_canvas_text_size_native_get(ep->object);
389 th = size.h;
372 390
373 th += ins_t + ins_b; 391 th += ins_t + ins_b;
374 } 392 }
@@ -386,7 +404,9 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
386 404
387 temp_h = efl_gfx_entity_size_get(ep->object).h; 405 temp_h = efl_gfx_entity_size_get(ep->object).h;
388 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h)); 406 efl_gfx_entity_size_set(ep->object, EINA_SIZE2D(temp_w, temp_h));
389 efl_canvas_text_size_formatted_get(ep->object, &tw, &th); 407 size = efl_canvas_text_size_formatted_get(ep->object);
408 tw = size.w;
409 th = size.h;
390 410
391 tw += ins_l + ins_r; 411 tw += ins_l + ins_r;
392 th += ins_t + ins_b; 412 th += ins_t + ins_b;
@@ -395,7 +415,8 @@ _edje_part_recalc_single_textblock_min_max_calc(Edje_Real_Part *ep,
395 * don't get meaningless height for multiline */ 415 * don't get meaningless height for multiline */
396 if (temp_w <= 0) 416 if (temp_w <= 0)
397 { 417 {
398 efl_canvas_text_size_native_get(ep->object, NULL, &th); 418 size = efl_canvas_text_size_native_get(ep->object);
419 th = size.h;
399 420
400 th += ins_t + ins_b; 421 th += ins_t + ins_b;
401 } 422 }
@@ -429,9 +450,7 @@ _edje_part_textblock_style_text_set(Edje *ed,
429 if (chosen_desc->text.id_source >= 0) 450 if (chosen_desc->text.id_source >= 0)
430 { 451 {
431 Edje_Part_Description_Text *et; 452 Edje_Part_Description_Text *et;
432
433 ep->typedata.text->source = ed->table_parts[chosen_desc->text.id_source % ed->table_parts_size]; 453 ep->typedata.text->source = ed->table_parts[chosen_desc->text.id_source % ed->table_parts_size];
434
435 et = _edje_real_part_text_source_description_get(ep, NULL); 454 et = _edje_real_part_text_source_description_get(ep, NULL);
436 tmp = edje_string_get(&et->text.style); 455 tmp = edje_string_get(&et->text.style);
437 if (tmp) style = tmp; 456 if (tmp) style = tmp;
@@ -509,7 +528,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
509 528
510 if (chosen_desc) 529 if (chosen_desc)
511 { 530 {
512 Evas_Coord tw, th; 531 Eina_Size2D size;
513 532
514 if (ep->part->scale) 533 if (ep->part->scale)
515 evas_object_scale_set(ep->object, TO_DOUBLE(sc)); 534 evas_object_scale_set(ep->object, TO_DOUBLE(sc));
@@ -526,33 +545,33 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
526 545
527 if (ep->part->scale) base_s = TO_DOUBLE(sc); 546 if (ep->part->scale) base_s = TO_DOUBLE(sc);
528 efl_gfx_entity_scale_set(ep->object, base_s); 547 efl_gfx_entity_scale_set(ep->object, base_s);
529 efl_canvas_text_size_native_get(ep->object, &tw, &th); 548 size = efl_canvas_text_size_native_get(ep->object);
530 549
531 orig_s = base_s; 550 orig_s = base_s;
532 /* Now make it bigger so calculations will be more accurate 551 /* Now make it bigger so calculations will be more accurate
533 * and less influenced by hinting... */ 552 * and less influenced by hinting... */
534 { 553 {
535 orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, 554 orig_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
536 orig_s * TO_INT(params->eval.w) / tw); 555 orig_s * TO_INT(params->eval.w) / size.w);
537 efl_gfx_entity_scale_set(ep->object, orig_s); 556 efl_gfx_entity_scale_set(ep->object, orig_s);
538 efl_canvas_text_size_native_get(ep->object, &tw, &th); 557 size = efl_canvas_text_size_native_get(ep->object);
539 } 558 }
540 if (chosen_desc->text.fit_x) 559 if (chosen_desc->text.fit_x)
541 { 560 {
542 if (tw > 0) 561 if (size.w > 0)
543 { 562 {
544 s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, 563 s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
545 orig_s * TO_INT(params->eval.w) / tw); 564 orig_s * TO_INT(params->eval.w) / size.w);
546 efl_gfx_entity_scale_set(ep->object, s); 565 efl_gfx_entity_scale_set(ep->object, s);
547 efl_canvas_text_size_native_get(ep->object, NULL, NULL); 566 efl_canvas_text_size_native_get(ep->object);
548 } 567 }
549 } 568 }
550 if (chosen_desc->text.fit_y) 569 if (chosen_desc->text.fit_y)
551 { 570 {
552 if (th > 0) 571 if (size.h > 0)
553 { 572 {
554 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, 573 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s,
555 orig_s * TO_INT(params->eval.h) / th); 574 orig_s * TO_INT(params->eval.h) / size.h);
556 /* If we already have X fit, restrict Y to be no bigger 575 /* If we already have X fit, restrict Y to be no bigger
557 * than what we got with X. */ 576 * than what we got with X. */
558 if (!((chosen_desc->text.fit_x) && (tmp_s > s))) 577 if (!((chosen_desc->text.fit_x) && (tmp_s > s)))
@@ -561,7 +580,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
561 } 580 }
562 581
563 efl_gfx_entity_scale_set(ep->object, s); 582 efl_gfx_entity_scale_set(ep->object, s);
564 efl_canvas_text_size_native_get(ep->object, NULL, NULL); 583 efl_canvas_text_size_native_get(ep->object);
565 } 584 }
566 } 585 }
567 586
@@ -569,14 +588,14 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
569 * actually end up being correct. */ 588 * actually end up being correct. */
570 { 589 {
571 int i = 5; /* Tries before we give up. */ 590 int i = 5; /* Tries before we give up. */
572 Evas_Coord fw, fh; 591 Eina_Size2D size;
573 efl_canvas_text_size_native_get(ep->object, &fw, &fh); 592 size = efl_canvas_text_size_native_get(ep->object);
574 593
575 /* If we are still too big, try reducing the size to 594 /* If we are still too big, try reducing the size to
576 * 95% each try. */ 595 * 95% each try. */
577 while ((i > 0) && 596 while ((i > 0) &&
578 ((chosen_desc->text.fit_x && (fw > TO_INT(params->eval.w))) || 597 ((chosen_desc->text.fit_x && (size.w > TO_INT(params->eval.w))) ||
579 (chosen_desc->text.fit_y && (fh > TO_INT(params->eval.h))))) 598 (chosen_desc->text.fit_y && (size.h > TO_INT(params->eval.h)))))
580 { 599 {
581 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, s * 0.95); 600 double tmp_s = _edje_part_recalc_single_textblock_scale_range_adjust(chosen_desc, base_s, s * 0.95);
582 601
@@ -586,7 +605,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc,
586 s = tmp_s; 605 s = tmp_s;
587 606
588 efl_gfx_entity_scale_set(ep->object, s); 607 efl_gfx_entity_scale_set(ep->object, s);
589 efl_canvas_text_size_native_get(ep->object, &fw, &fh); 608 size = efl_canvas_text_size_native_get(ep->object);
590 i--; 609 i--;
591 } 610 }
592 } 611 }
diff --git a/src/lib/edje/efl_canvas_layout_part_invalid.eo b/src/lib/edje/efl_canvas_layout_part_invalid.eo
index 62a1afcbe1..306b585b7b 100644
--- a/src/lib/edje/efl_canvas_layout_part_invalid.eo
+++ b/src/lib/edje/efl_canvas_layout_part_invalid.eo
@@ -1,7 +1,7 @@
1class @beta Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content, 1class @beta Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implements Efl.Content,
2 Efl.Pack_Linear, Efl.Ui.Layout_Orientable_Readonly, 2 Efl.Pack_Linear, Efl.Ui.Layout_Orientable_Readonly,
3 Efl.Pack_Table, Efl.Text, 3 Efl.Pack_Table, Efl.Text,
4 Efl.Text_Markup, Efl.Text_Markup_Interactive 4 Efl.Text_Markup
5{ 5{
6 [[Common class for part proxy objects for @Efl.Canvas.Layout. 6 [[Common class for part proxy objects for @Efl.Canvas.Layout.
7 7
@@ -29,20 +29,6 @@ class @beta Efl.Canvas.Layout_Part_Invalid extends Efl.Canvas.Layout_Part implem
29 // Efl.Canvas.Layout_Part_Text 29 // Efl.Canvas.Layout_Part_Text
30 Efl.Text.text { set; get; } 30 Efl.Text.text { set; get; }
31 Efl.Text_Markup.markup { get; set; } 31 Efl.Text_Markup.markup { get; set; }
32 Efl.Text_Markup_Interactive.cursor_markup_insert;
33 Efl.Text_Cursor.text_cursor { get; }
34 Efl.Text_Cursor.cursor_paragraph_first;
35 Efl.Text_Cursor.cursor_paragraph_last;
36 Efl.Text_Cursor.cursor_position { set; get; }
37 Efl.Text_Cursor.cursor_coord_set;
38 Efl.Text_Cursor.cursor_line_char_first;
39 Efl.Text_Cursor.cursor_line_char_last;
40 Efl.Text_Cursor.cursor_char_next;
41 Efl.Text_Cursor.cursor_char_prev;
42 Efl.Text_Cursor.cursor_line_jump_by;
43 Efl.Text_Cursor.cursor_copy;
44 Efl.Text_Cursor.cursor_content { get; }
45 Efl.Text_Cursor.cursor_geometry { get; }
46 // Efl.Canvas.Layout_Part_Box 32 // Efl.Canvas.Layout_Part_Box
47 Efl.Container.content_iterate; 33 Efl.Container.content_iterate;
48 Efl.Container.content_count; 34 Efl.Container.content_count;
diff --git a/src/lib/edje/efl_canvas_layout_part_text.eo b/src/lib/edje/efl_canvas_layout_part_text.eo
index 95a484cc43..e1593addcf 100644
--- a/src/lib/edje/efl_canvas_layout_part_text.eo
+++ b/src/lib/edje/efl_canvas_layout_part_text.eo
@@ -11,7 +11,7 @@ enum @beta Efl.Canvas.Layout_Part_Text_Expand
11} 11}
12 12
13class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text, 13class @beta Efl.Canvas.Layout_Part_Text extends Efl.Canvas.Layout_Part implements Efl.Text,
14Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style 14Efl.Text_Markup, Efl.Text_Format, Efl.Text_Font, Efl.Text_Style
15{ 15{
16 [[Represents a TEXT part of a layout 16 [[Represents a TEXT part of a layout
17 17
@@ -36,20 +36,6 @@ Efl.Text_Markup, Efl.Text_Markup_Interactive, Efl.Text_Format, Efl.Text_Font, Ef
36 implements { 36 implements {
37 Efl.Text.text { set; get; } 37 Efl.Text.text { set; get; }
38 Efl.Text_Markup.markup { get; set; } 38 Efl.Text_Markup.markup { get; set; }
39 Efl.Text_Markup_Interactive.cursor_markup_insert;
40 Efl.Text_Cursor.text_cursor { get; }
41 Efl.Text_Cursor.cursor_paragraph_first;
42 Efl.Text_Cursor.cursor_paragraph_last;
43 Efl.Text_Cursor.cursor_position { set; get; }
44 Efl.Text_Cursor.cursor_coord_set;
45 Efl.Text_Cursor.cursor_line_char_first;
46 Efl.Text_Cursor.cursor_line_char_last;
47 Efl.Text_Cursor.cursor_char_next;
48 Efl.Text_Cursor.cursor_char_prev;
49 Efl.Text_Cursor.cursor_line_jump_by;
50 Efl.Text_Cursor.cursor_copy;
51 Efl.Text_Cursor.cursor_content { get; }
52 Efl.Text_Cursor.cursor_geometry { get; }
53 Efl.Text_Format.ellipsis { set; get; } 39 Efl.Text_Format.ellipsis { set; get; }
54 Efl.Text_Format.wrap { set; get; } 40 Efl.Text_Format.wrap { set; get; }
55 Efl.Text_Font.font { set; get; } 41 Efl.Text_Font.font { set; get; }
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index bcdaef98b8..c78d105c5b 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -68,7 +68,8 @@ extern "C" {
68 */ 68 */
69typedef struct tm Efl_Time; 69typedef struct tm Efl_Time;
70 70
71typedef struct _Efl_Text_Cursor_Cursor Efl_Text_Cursor_Cursor; 71typedef struct _Efl_Text_Cursor_Handle Efl_Text_Cursor_Handle;
72typedef struct _Efl_Text_Cursor_Handle _Efl_Text_Cursor_Handle;
72typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation; 73typedef struct _Efl_Text_Annotate_Annotation Efl_Text_Annotate_Annotation;
73 74
74#include "interfaces/efl_types.eot.h" 75#include "interfaces/efl_types.eot.h"
@@ -210,10 +211,8 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
210#include "interfaces/efl_text_font.eo.h" 211#include "interfaces/efl_text_font.eo.h"
211#include "interfaces/efl_text_style.eo.h" 212#include "interfaces/efl_text_style.eo.h"
212#include "interfaces/efl_text_format.eo.h" 213#include "interfaces/efl_text_format.eo.h"
213#include "interfaces/efl_text_cursor.eo.h"
214#include "interfaces/efl_text_annotate.eo.h" 214#include "interfaces/efl_text_annotate.eo.h"
215#include "interfaces/efl_text_markup.eo.h" 215#include "interfaces/efl_text_markup.eo.h"
216#include "interfaces/efl_text_markup_interactive.eo.h"
217#include "interfaces/efl_text_markup_util.eo.h" 216#include "interfaces/efl_text_markup_util.eo.h"
218 217
219#ifdef EFL_BETA_API_SUPPORT 218#ifdef EFL_BETA_API_SUPPORT
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index f1bff04ff5..71162b94fe 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -24,10 +24,8 @@
24#include "interfaces/efl_text_font.eo.c" 24#include "interfaces/efl_text_font.eo.c"
25#include "interfaces/efl_text_style.eo.c" 25#include "interfaces/efl_text_style.eo.c"
26#include "interfaces/efl_text_format.eo.c" 26#include "interfaces/efl_text_format.eo.c"
27#include "interfaces/efl_text_cursor.eo.c"
28#include "interfaces/efl_text_annotate.eo.c" 27#include "interfaces/efl_text_annotate.eo.c"
29#include "interfaces/efl_text_markup.eo.c" 28#include "interfaces/efl_text_markup.eo.c"
30#include "interfaces/efl_text_markup_interactive.eo.c"
31 29
32#include "interfaces/efl_gfx_entity.eo.c" 30#include "interfaces/efl_gfx_entity.eo.c"
33#include "interfaces/efl_gfx_buffer.eo.c" 31#include "interfaces/efl_gfx_buffer.eo.c"
diff --git a/src/lib/efl/interfaces/efl_text_annotate.eo b/src/lib/efl/interfaces/efl_text_annotate.eo
index 1226628683..5ca1df8eb8 100644
--- a/src/lib/efl/interfaces/efl_text_annotate.eo
+++ b/src/lib/efl/interfaces/efl_text_annotate.eo
@@ -30,8 +30,8 @@ interface @beta Efl.Text_Annotate {
30 [[Returns an iterator of all the handles in a range. 30 [[Returns an iterator of all the handles in a range.
31 ]] 31 ]]
32 params { 32 params {
33 @in start: ptr(const(Efl.Text_Cursor_Cursor)); [[Start of range]] 33 @in start: ptr(const(Efl.Text_Cursor_Handle)); [[Start of range]]
34 @in end: ptr(const(Efl.Text_Cursor_Cursor)); [[End of range]] 34 @in end: ptr(const(Efl.Text_Cursor_Handle)); [[End of range]]
35 } 35 }
36 return: iterator<ptr(Efl.Text_Annotate_Annotation)> @move; [[Handle of the Annotation]] 36 return: iterator<ptr(Efl.Text_Annotate_Annotation)> @move; [[Handle of the Annotation]]
37 } 37 }
@@ -42,8 +42,8 @@ interface @beta Efl.Text_Annotate {
42 handle will be returned for further handling. 42 handle will be returned for further handling.
43 ]] 43 ]]
44 params { 44 params {
45 @in start: ptr(Efl.Text_Cursor_Cursor); [[Start of range]] 45 @in start: ptr(Efl.Text_Cursor_Handle); [[Start of range]]
46 @in end: ptr(Efl.Text_Cursor_Cursor); [[End of range]] 46 @in end: ptr(Efl.Text_Cursor_Handle); [[End of range]]
47 @in format: string; [[Annotation format]] 47 @in format: string; [[Annotation format]]
48 } 48 }
49 return: ptr(Efl.Text_Annotate_Annotation); [[Handle of inserted annotation]] 49 return: ptr(Efl.Text_Annotate_Annotation); [[Handle of inserted annotation]]
@@ -69,9 +69,9 @@ interface @beta Efl.Text_Annotate {
69 params { 69 params {
70 @in annotation: ptr(const(Efl.Text_Annotate_Annotation)); [[Annotation 70 @in annotation: ptr(const(Efl.Text_Annotate_Annotation)); [[Annotation
71 handle to query]] 71 handle to query]]
72 @in start: ptr(Efl.Text_Cursor_Cursor); [[Cursor to be set to the start 72 @in start: ptr(Efl.Text_Cursor_Handle); [[Cursor to be set to the start
73 position of the annotation in the text]] 73 position of the annotation in the text]]
74 @in end: ptr(Efl.Text_Cursor_Cursor); [[Cursor to be set to the end 74 @in end: ptr(Efl.Text_Cursor_Handle); [[Cursor to be set to the end
75 position of the annotation in the text]] 75 position of the annotation in the text]]
76 } 76 }
77 } 77 }
@@ -111,7 +111,7 @@ interface @beta Efl.Text_Annotate {
111 annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation]] 111 annotation: ptr(Efl.Text_Annotate_Annotation); [[Annotation]]
112 } 112 }
113 keys { 113 keys {
114 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] 114 cur: ptr(Efl.Text_Cursor_Handle); [[Cursor object]]
115 } 115 }
116 } 116 }
117 cursor_item_insert { 117 cursor_item_insert {
@@ -122,7 +122,7 @@ interface @beta Efl.Text_Annotate {
122 OBJECT REPLACEMENT CHARACTER and set a special annotation to it. 122 OBJECT REPLACEMENT CHARACTER and set a special annotation to it.
123 ]] 123 ]]
124 params { 124 params {
125 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]] 125 cur: ptr(Efl.Text_Cursor_Handle); [[Cursor object]]
126 @in item: string; [[Item key to be used in higher-up 126 @in item: string; [[Item key to be used in higher-up
127 code to query and decided what image, emoticon 127 code to query and decided what image, emoticon
128 etc. to embed.]] 128 etc. to embed.]]
diff --git a/src/lib/efl/interfaces/efl_text_cursor.eo b/src/lib/efl/interfaces/efl_text_cursor.eo
deleted file mode 100644
index cef645a173..0000000000
--- a/src/lib/efl/interfaces/efl_text_cursor.eo
+++ /dev/null
@@ -1,246 +0,0 @@
1import eina_types;
2import efl_text_types;
3
4enum @beta Efl.Text_Cursor_Get_Type {
5 [[All available cursor states]]
6 default = 0, [[Main cursor state (alias to "main")]]
7 main, [[Main cursor state]]
8 selection_begin, [[Selection begin cursor state]]
9 selection_end, [[Selection end cursor state]]
10 preedit_start, [[Pre-edit start cursor state]]
11 preedit_end, [[Pre-edit end cursor state]]
12 user, [[User cursor state]]
13 user_extra [[User extra cursor state]]
14}
15
16enum @beta Efl.Text_Cursor_Type
17{
18 [[Text cursor types]]
19 before, [[Cursor type before]]
20 under [[Cursor type under]]
21}
22
23interface @beta Efl.Text_Cursor {
24 [[Cursor API
25 ]]
26 methods {
27 // Cursor
28 @property text_cursor {
29 [[The object's main cursor.
30 ]]
31 get {
32 return: ptr(Efl.Text_Cursor_Cursor); [[Text cursor object]]
33 }
34 keys {
35 get_type: Efl.Text_Cursor_Get_Type; [[Cursor type]]
36 }
37 }
38 @property cursor_position {
39 [[Cursor position]]
40 set { }
41 get { }
42 values {
43 position: int; [[Cursor position]]
44 }
45 keys {
46 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
47 }
48 }
49 @property cursor_content {
50 [[The content of the cursor (the character under the cursor)]]
51 get {
52 }
53 values {
54 content: Eina.Unicode; [[The unicode codepoint of the character]]
55 }
56 keys {
57 cur: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor object]]
58 }
59 }
60 @property cursor_geometry {
61 [[Returns the geometry of two cursors ("split cursor"), if logical cursor is
62 between LTR/RTL text, also considering paragraph direction.
63 Upper cursor is shown for the text of the same direction as paragraph,
64 lower cursor - for opposite.
65
66 Split cursor geometry is valid only in '|' cursor mode.
67 In this case $true is returned and $cx2, $cy2, $cw2, $ch2 are set.
68 ]]
69 get {
70 return: bool; [[ $true if split cursor, $false otherwise.]]
71 }
72 keys {
73 cur: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor object]]
74 ctype: Efl.Text_Cursor_Type; [[The type of the cursor.]]
75 }
76 values {
77 cx: int; [[The x of the cursor (or upper cursor)]]
78 cy: int; [[The y of the cursor (or upper cursor)]]
79 cw: int; [[The width of the cursor (or upper cursor)]]
80 ch: int; [[The height of the cursor (or upper cursor)]]
81 cx2: int; [[The x of the lower cursor]]
82 cy2: int; [[The y of the lower cursor]]
83 cw2: int; [[The width of the lower cursor]]
84 ch2: int; [[The height of the lower cursor]]
85 }
86 }
87 cursor_new {
88 [[Create new cursor]]
89 return: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
90 }
91 cursor_free {
92 [[Free existing cursor]]
93 params {
94 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
95 }
96 }
97 cursor_equal {
98 [[Check if two cursors are equal]]
99 params {
100 @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 1 object]]
101 @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 2 object]]
102 }
103 return: bool; [[$true if cursors are equal, $false otherwise]]
104 }
105 cursor_compare {
106 [[Compare two cursors]]
107 params {
108 @in cur1: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 1 object]]
109 @in cur2: ptr(const(Efl.Text_Cursor_Cursor)); [[Cursor 2 object]]
110 }
111 return: int; [[Difference between cursors]]
112 }
113 cursor_copy {
114 [[Copy existing cursor]]
115 params {
116 /* @out */ dst: ptr(Efl.Text_Cursor_Cursor); [[Destination cursor]]
117 @in src: ptr(const(Efl.Text_Cursor_Cursor)); [[Source cursor]]
118 }
119 }
120 cursor_char_next {
121 [[Advances to the next character]]
122 params {
123 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
124 }
125 }
126 cursor_char_prev {
127 [[Advances to the previous character]]
128 params {
129 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
130 }
131 }
132 cursor_cluster_next {
133 [[Advances to the next grapheme cluster]]
134 params {
135 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
136 }
137 }
138 cursor_cluster_prev {
139 [[Advances to the previous grapheme cluster]]
140 params {
141 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
142 }
143 }
144 cursor_paragraph_char_first {
145 [[Advances to the first character in this paragraph]]
146 params {
147 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
148 }
149 }
150 cursor_paragraph_char_last {
151 [[Advances to the last character in this paragraph]]
152 params {
153 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
154 }
155 }
156 cursor_word_start {
157 [[Advance to current word start]]
158 params {
159 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
160 }
161 }
162 cursor_word_end {
163 [[Advance to current word end]]
164 params {
165 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
166 }
167 }
168 cursor_line_char_first {
169 [[Advance to current line first character]]
170 params {
171 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
172 }
173 }
174 cursor_line_char_last {
175 [[Advance to current line last character]]
176 params {
177 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
178 }
179 }
180 cursor_paragraph_first {
181 [[Advance to current paragraph first character]]
182 params {
183 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
184 }
185 }
186 cursor_paragraph_last {
187 [[Advance to current paragraph last character]]
188 params {
189 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
190 }
191 }
192 cursor_paragraph_next {
193 [[Advances to the start of the next text node]]
194 params {
195 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
196 }
197 }
198 cursor_paragraph_prev {
199 [[Advances to the end of the previous text node]]
200 params {
201 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
202 }
203 }
204 cursor_line_jump_by {
205 [[Jump the cursor by the given number of lines]]
206 params {
207 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
208 by: int; [[Number of lines]]
209 }
210 }
211 cursor_coord_set {
212 [[Set cursor coordinates]]
213 params {
214 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
215 @in x: int; [[X coord to set by.]]
216 @in y: int; [[Y coord to set by.]]
217 }
218 }
219 cursor_cluster_coord_set {
220 [[Set cursor coordinates according to grapheme clusters.
221 It does not allow to put a cursor to the middle of a grapheme cluster.
222 ]]
223 params {
224 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
225 @in x: int; [[X coord to set by.]]
226 @in y: int; [[Y coord to set by.]]
227 }
228 }
229 cursor_text_insert {
230 [[Adds text to the current cursor position and set the cursor to
231 *after* the start of the text just added.
232 ]]
233 params {
234 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
235 @in text: string; [[Text to append (UTF-8 format).]]
236 }
237 return: int; [[Length of the appended text.]]
238 }
239 cursor_char_delete {
240 [[Deletes a single character from position pointed by given cursor.]]
241 params {
242 /* @inout */ cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor object]]
243 }
244 }
245 }
246}
diff --git a/src/lib/efl/interfaces/efl_text_markup_interactive.eo b/src/lib/efl/interfaces/efl_text_markup_interactive.eo
deleted file mode 100644
index 7b2da3a2fe..0000000000
--- a/src/lib/efl/interfaces/efl_text_markup_interactive.eo
+++ /dev/null
@@ -1,25 +0,0 @@
1interface @beta Efl.Text_Markup_Interactive extends Efl.Text_Cursor {
2 [[Markup data that populates the text object's style and format
3 ]]
4 methods {
5 @property markup_range {
6 [[Markup of a given range in the text]]
7 values {
8 markup: mstring @move; [[The markup-text representation set to
9 this text of a given range]]
10 }
11 keys {
12 start: ptr(Efl.Text_Cursor_Cursor); [[Start of the markup region]]
13 end: ptr(Efl.Text_Cursor_Cursor); [[End of markup region]]
14 }
15 }
16 cursor_markup_insert {
17 [[Inserts a markup text to the text object in a given cursor position]]
18 params {
19 cur: ptr(Efl.Text_Cursor_Cursor); [[Cursor position to insert markup]]
20 @in markup: string; [[The markup text to insert]]
21 }
22 }
23 }
24}
25
diff --git a/src/lib/efl/interfaces/efl_text_types.eot b/src/lib/efl/interfaces/efl_text_types.eot
index b71272073e..d8d2ce3a52 100644
--- a/src/lib/efl/interfaces/efl_text_types.eot
+++ b/src/lib/efl/interfaces/efl_text_types.eot
@@ -24,5 +24,5 @@ struct @beta Efl.Ui.Text_Change_Info {
24 24
25type @extern @beta Efl.Text_Annotate_Annotation: __undefined_type; [[EFL text annotations data structure]] 25type @extern @beta Efl.Text_Annotate_Annotation: __undefined_type; [[EFL text annotations data structure]]
26 26
27type @extern @beta Efl.Text_Cursor_Cursor: __undefined_type; [[Text cursor data structure]] 27type @extern @beta Efl.Text_Cursor_Handle: __undefined_type; [[Text cursor data structure]]
28 28
diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build
index ccbab1c1bd..f45e743f94 100644
--- a/src/lib/efl/interfaces/meson.build
+++ b/src/lib/efl/interfaces/meson.build
@@ -44,10 +44,8 @@ pub_eo_files = [
44 'efl_text_font.eo', 44 'efl_text_font.eo',
45 'efl_text_style.eo', 45 'efl_text_style.eo',
46 'efl_text_format.eo', 46 'efl_text_format.eo',
47 'efl_text_cursor.eo',
48 'efl_text_annotate.eo', 47 'efl_text_annotate.eo',
49 'efl_text_markup.eo', 48 'efl_text_markup.eo',
50 'efl_text_markup_interactive.eo',
51 'efl_text_markup_util.eo', 49 'efl_text_markup_util.eo',
52 'efl_gfx_stack.eo', 50 'efl_gfx_stack.eo',
53 'efl_gfx_view.eo', 51 'efl_gfx_view.eo',
diff --git a/src/lib/elementary/efl_text_interactive.eo b/src/lib/elementary/efl_text_interactive.eo
index 4d8d96d832..d5c261f5a2 100644
--- a/src/lib/elementary/efl_text_interactive.eo
+++ b/src/lib/elementary/efl_text_interactive.eo
@@ -5,6 +5,13 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
5{ 5{
6 [[This is an interface interactive text inputs should implement]] 6 [[This is an interface interactive text inputs should implement]]
7 methods { 7 methods {
8 @property main_cursor {
9 [[The user visible cursor.]]
10 get {}
11 values {
12 cursor: Efl.Text.Cursor; [[The user visible cursor.]]
13 }
14 }
8 @property selection_allowed { 15 @property selection_allowed {
9 [[Whether or not selection is allowed on this object]] 16 [[Whether or not selection is allowed on this object]]
10 set {} 17 set {}
@@ -24,8 +31,8 @@ interface @beta Efl.Text_Interactive extends Efl.Text, Efl.Text_Font,
24 ]] 31 ]]
25 get {} 32 get {}
26 values { 33 values {
27 start: ptr(Efl.Text_Cursor_Cursor); [[The start of the selection]] 34 start: Efl.Text.Cursor; [[The start of the selection]]
28 end: ptr(Efl.Text_Cursor_Cursor); [[The end of the selection]] 35 end: Efl.Text.Cursor; [[The end of the selection]]
29 } 36 }
30 } 37 }
31 @property editable { 38 @property editable {
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.c b/src/lib/elementary/efl_ui_internal_text_interactive.c
index f66f3b7656..51c66b5cbb 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.c
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.c
@@ -12,8 +12,9 @@
12 12
13typedef struct _Efl_Ui_Internal_Text_Interactive_Data 13typedef struct _Efl_Ui_Internal_Text_Interactive_Data
14{ 14{
15 Evas_Textblock_Cursor *sel_start, *sel_end; 15 Efl_Text_Cursor *sel_start, *sel_end;
16 Evas_Textblock_Cursor *preedit_start, *preedit_end; 16 Efl_Text_Cursor *main_cursor;
17 Efl_Text_Cursor *preedit_start, *preedit_end;
17 Eina_List *seq; 18 Eina_List *seq;
18 char *selection; 19 char *selection;
19 Eina_Bool composing : 1; 20 Eina_Bool composing : 1;
@@ -34,12 +35,12 @@ typedef struct _Efl_Ui_Internal_Text_Interactive_Data
34} Efl_Ui_Internal_Text_Interactive_Data; 35} Efl_Ui_Internal_Text_Interactive_Data;
35 36
36static void _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en); 37static void _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en);
37static void _sel_init(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); 38static void _sel_init(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en);
38static void _sel_enable(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); 39static void _sel_enable(Efl_Text_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en);
39static void _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en); 40static void _sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en);
40static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en); 41static void _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en);
41static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en); 42static const char *_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en);
42static void _entry_imf_cursor_info_set(Eo *obj, Evas_Textblock_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en); 43static void _entry_imf_cursor_info_set(Eo *obj, Efl_Text_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en);
43 44
44#ifdef HAVE_ECORE_IMF 45#ifdef HAVE_ECORE_IMF
45static void 46static void
@@ -47,13 +48,13 @@ _preedit_clear(Efl_Ui_Internal_Text_Interactive_Data *en)
47{ 48{
48 if (en->preedit_start) 49 if (en->preedit_start)
49 { 50 {
50 evas_textblock_cursor_free(en->preedit_start); 51 efl_del(en->preedit_start);
51 en->preedit_start = NULL; 52 en->preedit_start = NULL;
52 } 53 }
53 54
54 if (en->preedit_end) 55 if (en->preedit_end)
55 { 56 {
56 evas_textblock_cursor_free(en->preedit_end); 57 efl_del(en->preedit_end);
57 en->preedit_end = NULL; 58 en->preedit_end = NULL;
58 } 59 }
59 60
@@ -61,21 +62,21 @@ _preedit_clear(Efl_Ui_Internal_Text_Interactive_Data *en)
61} 62}
62 63
63static void 64static void
64_preedit_del(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) 65_preedit_del(Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
65{ 66{
66 if (!en || !en->have_preedit) return; 67 if (!en || !en->have_preedit) return;
67 if (!en->preedit_start || !en->preedit_end) return; 68 if (!en->preedit_start || !en->preedit_end) return;
68 if (efl_text_cursor_equal(obj, en->preedit_start, en->preedit_end)) return; 69 if (efl_text_cursor_equal(en->preedit_start, en->preedit_end)) return;
69 70
70 /* delete the preedit characters */ 71 /* delete the preedit characters */
71 evas_textblock_cursor_range_delete(en->preedit_start, en->preedit_end); 72 efl_text_cursor_range_delete(en->preedit_start, en->preedit_end);
72} 73}
73 74
74static Eina_Bool 75static Eina_Bool
75_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos) 76_entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, char **text, int *cursor_pos)
76{ 77{
77 Efl_Canvas_Text *obj = data; 78 Efl_Canvas_Text *obj = data;
78 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 79 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
79 const char *str; 80 const char *str;
80 81
81 if (text) 82 if (text)
@@ -92,7 +93,7 @@ _entry_imf_retrieve_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSE
92 if (cursor_pos) 93 if (cursor_pos)
93 { 94 {
94 if (cur) 95 if (cur)
95 *cursor_pos = evas_textblock_cursor_pos_get(cur); 96 *cursor_pos = efl_text_cursor_position_get(cur);
96 else 97 else
97 *cursor_pos = 0; 98 *cursor_pos = 0;
98 } 99 }
@@ -177,7 +178,7 @@ static void
177_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED) 178_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info EINA_UNUSED)
178{ 179{
179 Efl_Canvas_Text *obj = data; 180 Efl_Canvas_Text *obj = data;
180 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 181 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
181 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 182 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
182 int cursor_pos; 183 int cursor_pos;
183 int preedit_start_pos, preedit_end_pos; 184 int preedit_start_pos, preedit_end_pos;
@@ -215,7 +216,7 @@ _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUS
215 /* delete preedit characters */ 216 /* delete preedit characters */
216 _preedit_del(obj, en); 217 _preedit_del(obj, en);
217 218
218 preedit_start_pos = evas_textblock_cursor_pos_get(cur); 219 preedit_start_pos = efl_text_cursor_position_get(cur);
219 220
220 /* insert preedit character(s) */ 221 /* insert preedit character(s) */
221 if (strlen(preedit_string) > 0) 222 if (strlen(preedit_string) > 0)
@@ -293,25 +294,25 @@ _entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUS
293 { 294 {
294 /* set preedit start cursor */ 295 /* set preedit start cursor */
295 if (!en->preedit_start) 296 if (!en->preedit_start)
296 en->preedit_start = evas_object_textblock_cursor_new(obj); 297 en->preedit_start = efl_canvas_text_cursor_create(obj);
297 evas_textblock_cursor_copy(cur, en->preedit_start); 298 efl_text_cursor_copy(cur, en->preedit_start);
298 299
299 /* set preedit end cursor */ 300 /* set preedit end cursor */
300 if (!en->preedit_end) 301 if (!en->preedit_end)
301 en->preedit_end = evas_object_textblock_cursor_new(obj); 302 en->preedit_end = efl_canvas_text_cursor_create(obj);
302 evas_textblock_cursor_copy(cur, en->preedit_end); 303 efl_text_cursor_copy(cur, en->preedit_end);
303 304
304 preedit_end_pos = evas_textblock_cursor_pos_get(cur); 305 preedit_end_pos = efl_text_cursor_position_get(cur);
305 306
306 for (i = 0; i < (preedit_end_pos - preedit_start_pos); i++) 307 for (i = 0; i < (preedit_end_pos - preedit_start_pos); i++)
307 { 308 {
308 evas_textblock_cursor_char_prev(en->preedit_start); 309 efl_text_cursor_move(en->preedit_start, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
309 } 310 }
310 311
311 en->have_preedit = EINA_TRUE; 312 en->have_preedit = EINA_TRUE;
312 313
313 /* set cursor position */ 314 /* set cursor position */
314 evas_textblock_cursor_pos_set(cur, preedit_start_pos + cursor_pos); 315 efl_text_cursor_position_set(cur, preedit_start_pos + cursor_pos);
315 } 316 }
316 317
317 _entry_imf_cursor_info_set(obj, cur, en); 318 _entry_imf_cursor_info_set(obj, cur, en);
@@ -330,35 +331,35 @@ static void
330_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info) 331_entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
331{ 332{
332 Efl_Canvas_Text *obj = data; 333 Efl_Canvas_Text *obj = data;
333 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 334 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
334 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 335 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
335 Ecore_IMF_Event_Delete_Surrounding *ev = event_info; 336 Ecore_IMF_Event_Delete_Surrounding *ev = event_info;
336 Evas_Textblock_Cursor *del_start, *del_end; 337 Efl_Text_Cursor *del_start, *del_end;
337 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 }; 338 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
338 int cursor_pos; 339 int cursor_pos;
339 int start, end; 340 int start, end;
340 char *tmp; 341 char *tmp;
341 342
342 cursor_pos = evas_textblock_cursor_pos_get(cur); 343 cursor_pos = efl_text_cursor_position_get(cur);
343 344
344 del_start = evas_object_textblock_cursor_new(obj); 345 del_start = efl_canvas_text_cursor_create(obj);
345 evas_textblock_cursor_pos_set(del_start, cursor_pos + ev->offset); 346 efl_text_cursor_position_set(del_start, cursor_pos + ev->offset);
346 347
347 del_end = evas_object_textblock_cursor_new(obj); 348 del_end = efl_canvas_text_cursor_create(obj);
348 evas_textblock_cursor_pos_set(del_end, cursor_pos + ev->offset + ev->n_chars); 349 efl_text_cursor_position_set(del_end, cursor_pos + ev->offset + ev->n_chars);
349 350
350 start = evas_textblock_cursor_pos_get(del_start); 351 start = efl_text_cursor_position_get(del_start);
351 end = evas_textblock_cursor_pos_get(del_end); 352 end = efl_text_cursor_position_get(del_end);
352 if (start == end) goto end; 353 if (start == end) goto end;
353 354
354 tmp = efl_canvas_text_range_text_get(obj, del_start, del_end); 355 tmp = efl_text_cursor_range_text_get(del_start, del_end);
355 356
356 info.insert = EINA_FALSE; 357 info.insert = EINA_FALSE;
357 info.position = start; 358 info.position = start;
358 info.length = end - start; 359 info.length = end - start;
359 info.content = tmp; 360 info.content = tmp;
360 361
361 evas_textblock_cursor_range_delete(del_start, del_end); 362 efl_text_cursor_range_delete(del_start, del_end);
362 363
363 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 364 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
364 free(tmp); 365 free(tmp);
@@ -366,29 +367,29 @@ _entry_imf_event_delete_surrounding_cb(void *data, Ecore_IMF_Context *ctx EINA_U
366 _entry_imf_cursor_info_set(obj, cur, en); 367 _entry_imf_cursor_info_set(obj, cur, en);
367 368
368end: 369end:
369 evas_textblock_cursor_free(del_start); 370 efl_del(del_start);
370 evas_textblock_cursor_free(del_end); 371 efl_del(del_end);
371} 372}
372 373
373static void 374static void
374_entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info) 375_entry_imf_event_selection_set_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED, void *event_info)
375{ 376{
376 Efl_Canvas_Text *obj = data; 377 Efl_Canvas_Text *obj = data;
377 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 378 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
378 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 379 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
379 Ecore_IMF_Event_Selection *ev = event_info; 380 Ecore_IMF_Event_Selection *ev = event_info;
380 381
381 if (ev->start == ev->end) 382 if (ev->start == ev->end)
382 { 383 {
383 efl_text_cursor_position_set(obj, cur, ev->start); 384 efl_text_cursor_position_set(cur, ev->start);
384 } 385 }
385 else 386 else
386 { 387 {
387 _sel_clear(obj, en); 388 _sel_clear(obj, en);
388 evas_textblock_cursor_pos_set(cur, ev->start); 389 efl_text_cursor_position_set(cur, ev->start);
389 _sel_enable(cur, obj, en); 390 _sel_enable(cur, obj, en);
390 _sel_init(cur, obj, en); 391 _sel_init(cur, obj, en);
391 evas_textblock_cursor_pos_set(cur, ev->end); 392 efl_text_cursor_position_set(cur, ev->end);
392 _sel_extend(cur, obj, en); 393 _sel_extend(cur, obj, en);
393 } 394 }
394} 395}
@@ -416,14 +417,14 @@ _entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED,
416#endif 417#endif
417 418
418static void 419static void
419_entry_imf_cursor_location_set(Eo *obj, Efl_Text_Cursor_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en) 420_entry_imf_cursor_location_set(Eo *obj EINA_UNUSED, Efl_Text_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en)
420{ 421{
421#ifdef HAVE_ECORE_IMF 422#ifdef HAVE_ECORE_IMF
422 Evas_Coord cx = 0, cy = 0, cw = 0, ch = 0; 423 Eina_Rect rect;
423 if (!en->imf_context) return; 424 if (!en->imf_context) return;
424 425
425 efl_text_cursor_geometry_get(obj, cur, EFL_TEXT_CURSOR_TYPE_BEFORE, &cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL); 426 rect = efl_text_cursor_geometry_get(cur, EFL_TEXT_CURSOR_TYPE_BEFORE);
426 ecore_imf_context_cursor_location_set(en->imf_context, cx, cy, cw, ch); 427 ecore_imf_context_cursor_location_set(en->imf_context, rect.x, rect.y, rect.w, rect.h);
427 // FIXME: ecore_imf_context_bidi_direction_set(en->imf_context, (Ecore_IMF_BiDi_Direction)dir); 428 // FIXME: ecore_imf_context_bidi_direction_set(en->imf_context, (Ecore_IMF_BiDi_Direction)dir);
428#else 429#else
429 (void)en; 430 (void)en;
@@ -431,7 +432,7 @@ _entry_imf_cursor_location_set(Eo *obj, Efl_Text_Cursor_Cursor *cur, Efl_Ui_Inte
431} 432}
432 433
433static void 434static void
434_entry_imf_cursor_info_set(Eo *obj, Evas_Textblock_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en) 435_entry_imf_cursor_info_set(Eo *obj, Efl_Text_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en)
435{ 436{
436 int cursor_pos; 437 int cursor_pos;
437 438
@@ -440,13 +441,13 @@ _entry_imf_cursor_info_set(Eo *obj, Evas_Textblock_Cursor *cur, Efl_Ui_Internal_
440 441
441 if (en->have_selection) 442 if (en->have_selection)
442 { 443 {
443 if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) < 0) 444 if (efl_text_cursor_compare(en->sel_start, en->sel_end) < 0)
444 cursor_pos = evas_textblock_cursor_pos_get(en->sel_start); 445 cursor_pos = efl_text_cursor_position_get(en->sel_start);
445 else 446 else
446 cursor_pos = evas_textblock_cursor_pos_get(en->sel_end); 447 cursor_pos = efl_text_cursor_position_get(en->sel_end);
447 } 448 }
448 else 449 else
449 cursor_pos = evas_textblock_cursor_pos_get(cur); 450 cursor_pos = efl_text_cursor_position_get(cur);
450 451
451 ecore_imf_context_cursor_position_set(en->imf_context, cursor_pos); 452 ecore_imf_context_cursor_position_set(en->imf_context, cursor_pos);
452 453
@@ -461,11 +462,11 @@ _focus_in_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
461{ 462{
462#ifdef HAVE_ECORE_IMF 463#ifdef HAVE_ECORE_IMF
463 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 464 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
464 Efl_Text_Cursor_Cursor *cur; 465 Efl_Text_Cursor *cur;
465 466
466 if (!en->imf_context) return; 467 if (!en->imf_context) return;
467 468
468 cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 469 cur = efl_text_interactive_main_cursor_get(obj);
469 ecore_imf_context_focus_in(en->imf_context); 470 ecore_imf_context_focus_in(en->imf_context);
470 _entry_imf_cursor_info_set(obj, cur, en); 471 _entry_imf_cursor_info_set(obj, cur, en);
471#endif 472#endif
@@ -497,10 +498,10 @@ _focus_out_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, voi
497} 498}
498 499
499static const char * 500static const char *
500_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj, Efl_Ui_Internal_Text_Interactive_Data *en) 501_entry_selection_get(Efl_Ui_Internal_Text_Interactive *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
501{ 502{
502 if ((!en->selection) && (en->have_selection)) 503 if ((!en->selection) && (en->have_selection))
503 en->selection = efl_canvas_text_range_text_get(obj, en->sel_start, en->sel_end); 504 en->selection = efl_text_cursor_range_text_get(en->sel_start, en->sel_end);
504 return en->selection; 505 return en->selection;
505} 506}
506 507
@@ -511,13 +512,13 @@ _sel_cursor_changed(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED)
511} 512}
512 513
513static void 514static void
514_sel_init(Evas_Textblock_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) 515_sel_init(Efl_Text_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
515{ 516{
516 if (en->have_selection) 517 if (en->have_selection)
517 return; 518 return;
518 519
519 evas_textblock_cursor_copy(c, en->sel_start); 520 efl_text_cursor_copy(c, en->sel_start);
520 evas_textblock_cursor_copy(c, en->sel_end); 521 efl_text_cursor_copy(c, en->sel_end);
521 522
522 en->have_selection = EINA_FALSE; 523 en->have_selection = EINA_FALSE;
523 if (en->selection) 524 if (en->selection)
@@ -528,7 +529,7 @@ _sel_init(Evas_Textblock_Cursor *c, Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_
528} 529}
529 530
530static void 531static void
531_sel_enable(Evas_Textblock_Cursor *c EINA_UNUSED, 532_sel_enable(Efl_Text_Cursor *c EINA_UNUSED,
532 Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en) 533 Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en)
533{ 534{
534 if (en->have_selection) return; 535 if (en->have_selection) return;
@@ -543,13 +544,13 @@ _sel_enable(Evas_Textblock_Cursor *c EINA_UNUSED,
543} 544}
544 545
545static void 546static void
546_sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en) 547_sel_extend(Efl_Text_Cursor *c, Evas_Object *o, Efl_Ui_Internal_Text_Interactive_Data *en)
547{ 548{
548 if (!en->sel_end) return; 549 if (!en->sel_end) return;
549 _sel_enable(c, o, en); 550 _sel_enable(c, o, en);
550 if (efl_text_cursor_equal(o, c, en->sel_end)) return; 551 if (efl_text_cursor_equal(c, en->sel_end)) return;
551 552
552 evas_textblock_cursor_copy(c, en->sel_end); 553 efl_text_cursor_copy(c, en->sel_end);
553 554
554 _entry_imf_cursor_info_set(o, c, en); 555 _entry_imf_cursor_info_set(o, c, en);
555 556
@@ -573,7 +574,7 @@ _sel_clear(Evas_Object *o EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *en
573 if (en->have_selection) 574 if (en->have_selection)
574 { 575 {
575 en->have_selection = EINA_FALSE; 576 en->have_selection = EINA_FALSE;
576 efl_text_cursor_copy(o, en->sel_start, en->sel_end); 577 efl_text_cursor_copy(en->sel_start, en->sel_end);
577 efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, NULL); 578 efl_event_callback_call(o, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, NULL);
578 } 579 }
579} 580}
@@ -586,14 +587,14 @@ _efl_ui_internal_text_interactive_efl_text_interactive_select_none(
586} 587}
587 588
588static void 589static void
589_range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_Cursor *cur2) 590_range_del_emit(Evas_Object *obj, Efl_Text_Cursor *cur1, Efl_Text_Cursor *cur2)
590{ 591{
591 size_t start, end; 592 size_t start, end;
592 char *tmp; 593 char *tmp;
593 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 }; 594 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
594 595
595 start = evas_textblock_cursor_pos_get(cur1); 596 start = efl_text_cursor_position_get(cur1);
596 end = evas_textblock_cursor_pos_get(cur2); 597 end = efl_text_cursor_position_get(cur2);
597 if (start == end) 598 if (start == end)
598 return; 599 return;
599 600
@@ -601,10 +602,10 @@ _range_del_emit(Evas_Object *obj, Efl_Text_Cursor_Cursor *cur1, Efl_Text_Cursor_
601 info.position = start; 602 info.position = start;
602 info.length = end - start; 603 info.length = end - start;
603 604
604 tmp = efl_canvas_text_range_text_get(obj, cur1, cur2); 605 tmp = efl_text_cursor_range_text_get(cur1, cur2);
605 info.content = tmp; 606 info.content = tmp;
606 607
607 evas_textblock_cursor_range_delete(cur1, cur2); 608 efl_text_cursor_range_delete(cur1, cur2);
608 609
609 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 610 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
610 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL); 611 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
@@ -619,11 +620,11 @@ _sel_range_del_emit(Evas_Object *obj, Efl_Ui_Internal_Text_Interactive_Data *en)
619} 620}
620 621
621static void 622static void
622_delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en EINA_UNUSED, size_t pos) 623_delete_emit(Eo *obj, Efl_Text_Cursor *c, Efl_Ui_Internal_Text_Interactive_Data *en EINA_UNUSED, size_t pos)
623{ 624{
624 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 }; 625 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
625 Eina_Unicode content[2]; 626 Eina_Unicode content[2];
626 content[0] = efl_text_cursor_content_get(obj, c); 627 content[0] = efl_text_cursor_content_get(c);
627 content[1] = 0; 628 content[1] = 0;
628 if (!content[0]) 629 if (!content[0])
629 return; 630 return;
@@ -635,7 +636,7 @@ _delete_emit(Eo *obj, Evas_Textblock_Cursor *c, Efl_Ui_Internal_Text_Interactive
635 info.length = 1; 636 info.length = 1;
636 info.content = tmp; 637 info.content = tmp;
637 638
638 evas_textblock_cursor_char_delete(c); 639 efl_text_cursor_char_delete(c);
639 640
640 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 641 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
641 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL); 642 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED, NULL);
@@ -673,7 +674,7 @@ _compose_seq_reset(Efl_Ui_Internal_Text_Interactive_Data *en)
673 * movement_forward: if the movement we are going to do is forward (towards the end of the textblock) 674 * movement_forward: if the movement we are going to do is forward (towards the end of the textblock)
674 */ 675 */
675static void 676static void
676_key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool shift, Eina_Bool movement_forward) 677_key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool shift, Eina_Bool movement_forward)
677{ 678{
678 if (en->select_allow) 679 if (en->select_allow)
679 { 680 {
@@ -683,18 +684,18 @@ _key_down_sel_pre(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor_Cursor
683 } 684 }
684 else if (en->have_selection) 685 else if (en->have_selection)
685 { 686 {
686 Eina_Bool sel_forward = evas_textblock_cursor_compare(en->sel_start, en->sel_end); 687 Eina_Bool sel_forward = efl_text_cursor_compare(en->sel_start, en->sel_end);
687 if ((sel_forward && movement_forward) || (!sel_forward && !movement_forward)) 688 if ((sel_forward && movement_forward) || (!sel_forward && !movement_forward))
688 evas_textblock_cursor_copy(en->sel_end, cur); 689 efl_text_cursor_copy(en->sel_end, cur);
689 else 690 else
690 evas_textblock_cursor_copy(en->sel_start, cur); 691 efl_text_cursor_copy(en->sel_start, cur);
691 _sel_clear(obj, en); 692 _sel_clear(obj, en);
692 } 693 }
693 } 694 }
694} 695}
695 696
696static void 697static void
697_key_down_sel_post(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool shift) 698_key_down_sel_post(Efl_Ui_Internal_Text_Interactive *obj, Efl_Text_Cursor *cur, Efl_Ui_Internal_Text_Interactive_Data *en, Eina_Bool shift)
698{ 699{
699 if (en->select_allow) 700 if (en->select_allow)
700 { 701 {
@@ -707,7 +708,7 @@ static void
707_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info) 708_key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info)
708{ 709{
709 Evas_Event_Key_Down *ev = event_info; 710 Evas_Event_Key_Down *ev = event_info;
710 Efl_Text_Cursor_Cursor *cur; 711 Efl_Text_Cursor *cur;
711 Eina_Bool control, alt, shift; 712 Eina_Bool control, alt, shift;
712#if defined(__APPLE__) && defined(__MACH__) 713#if defined(__APPLE__) && defined(__MACH__)
713 Eina_Bool super, altgr; 714 Eina_Bool super, altgr;
@@ -727,8 +728,8 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
727 /* FIXME: Maybe allow selctions to happen even when not editable. */ 728 /* FIXME: Maybe allow selctions to happen even when not editable. */
728 if (!en->editable) return; 729 if (!en->editable) return;
729 730
730 cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 731 cur = efl_text_interactive_main_cursor_get(obj);
731 old_cur_pos = evas_textblock_cursor_pos_get(cur); 732 old_cur_pos = efl_text_cursor_position_get(cur);
732 if (old_cur_pos < 0) return; 733 if (old_cur_pos < 0) return;
733 734
734 control = evas_key_modifier_is_set(ev->modifiers, "Control"); 735 control = evas_key_modifier_is_set(ev->modifiers, "Control");
@@ -752,7 +753,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
752 { 753 {
753 if (multiline) 754 if (multiline)
754 { 755 {
755 if (shift || efl_canvas_text_legacy_newline_get(obj)) 756 if (shift || efl_canvas_text_newline_as_paragraph_separator_get(obj))
756 { 757 {
757 string = "\n"; 758 string = "\n";
758 } 759 }
@@ -779,7 +780,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
779 { 780 {
780 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE); 781 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
781 782
782 efl_text_cursor_line_jump_by(obj, cur, -1); 783 efl_text_cursor_line_jump_by(cur, -1);
783 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 784 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
784 785
785 _key_down_sel_post(obj, cur, en, shift); 786 _key_down_sel_post(obj, cur, en, shift);
@@ -793,7 +794,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
793 { 794 {
794 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE); 795 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
795 796
796 efl_text_cursor_line_jump_by(obj, cur, 1); 797 efl_text_cursor_line_jump_by(cur, 1);
797 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 798 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
798 799
799 _key_down_sel_post(obj, cur, en, shift); 800 _key_down_sel_post(obj, cur, en, shift);
@@ -805,12 +806,12 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
805 _compose_seq_reset(en); 806 _compose_seq_reset(en);
806 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE); 807 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
807 808
808 efl_text_cursor_char_prev(obj, cur); 809 efl_text_cursor_move(cur,EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
809#if defined(__APPLE__) && defined(__MACH__) 810#if defined(__APPLE__) && defined(__MACH__)
810 if (altgr) efl_text_cursor_word_start(obj, cur); 811 if (altgr) efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
811#else 812#else
812 /* If control is pressed, go to the start of the word */ 813 /* If control is pressed, go to the start of the word */
813 if (control) efl_text_cursor_word_start(obj, cur); 814 if (control) efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
814#endif 815#endif
815 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 816 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
816 817
@@ -823,12 +824,12 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
823 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE); 824 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
824 825
825#if defined(__APPLE__) && defined(__MACH__) 826#if defined(__APPLE__) && defined(__MACH__)
826 if (altgr) efl_text_cursor_word_end(obj, cur); 827 if (altgr) efl_text_cursor_word_end(cur);
827#else 828#else
828 /* If control is pressed, go to the end of the word */ 829 /* If control is pressed, go to the end of the word */
829 if (control) efl_text_cursor_word_end(obj, cur); 830 if (control) efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
830#endif 831#endif
831 efl_text_cursor_char_next(obj, cur); 832 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);
832 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 833 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
833 834
834 _key_down_sel_post(obj, cur, en, shift); 835 _key_down_sel_post(obj, cur, en, shift);
@@ -839,16 +840,16 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
839 if (control && !en->have_selection) 840 if (control && !en->have_selection)
840 { 841 {
841 // del to start of previous word 842 // del to start of previous word
842 Evas_Textblock_Cursor *tc = evas_object_textblock_cursor_new(obj); 843 Efl_Text_Cursor *tc = efl_canvas_text_cursor_create(obj);
843 844
844 efl_text_cursor_copy(obj, tc, cur); 845 efl_text_cursor_copy(tc, cur);
845 evas_textblock_cursor_char_prev(cur); 846 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV);
846 evas_textblock_cursor_word_start(cur); 847 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
847 848
848 _range_del_emit(obj, cur, tc); 849 _range_del_emit(obj, cur, tc);
849 850
850 //efl_del(tc); 851 //efl_del(tc);
851 efl_text_cursor_free(obj, tc); 852 efl_del(tc);
852 } 853 }
853 else if ((alt) && (shift)) 854 else if ((alt) && (shift))
854 { 855 {
@@ -862,7 +863,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
862 } 863 }
863 else 864 else
864 { 865 {
865 if (evas_textblock_cursor_char_prev(cur)) 866 if (efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_PREV))
866 { 867 {
867 _delete_emit(obj, cur, en, old_cur_pos - 1); 868 _delete_emit(obj, cur, en, old_cur_pos - 1);
868 } 869 }
@@ -878,16 +879,16 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
878 if (control) 879 if (control)
879 { 880 {
880 // del to end of next word 881 // del to end of next word
881 Evas_Textblock_Cursor *tc = evas_object_textblock_cursor_new(obj); 882 Efl_Text_Cursor *tc = efl_canvas_text_cursor_create(obj);
882 883
883 efl_text_cursor_copy(obj, tc, cur); 884 efl_text_cursor_copy(tc, cur);
884 evas_textblock_cursor_word_end(cur); 885 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
885 evas_textblock_cursor_char_next(cur); 886 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);
886 887
887 _range_del_emit(obj, cur, tc); 888 _range_del_emit(obj, cur, tc);
888 889
889 //efl_del(tc); 890 //efl_del(tc);
890 efl_text_cursor_free(obj, tc); 891 efl_del(tc);
891 } 892 }
892 else if (shift) 893 else if (shift)
893 { 894 {
@@ -915,9 +916,9 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
915 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE); 916 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
916 917
917 if ((control) && (multiline)) 918 if ((control) && (multiline))
918 efl_text_cursor_paragraph_first(obj, cur); 919 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
919 else 920 else
920 efl_text_cursor_line_char_first(obj, cur); 921 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
921 922
922 _key_down_sel_post(obj, cur, en, shift); 923 _key_down_sel_post(obj, cur, en, shift);
923 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 924 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -930,9 +931,9 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
930 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE); 931 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
931 932
932 if ((control) && (multiline)) 933 if ((control) && (multiline))
933 efl_text_cursor_paragraph_last(obj, cur); 934 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
934 else 935 else
935 efl_text_cursor_line_char_last(obj, cur); 936 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
936 937
937 _key_down_sel_post(obj, cur, en, shift); 938 _key_down_sel_post(obj, cur, en, shift);
938 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 939 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -957,7 +958,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
957 _compose_seq_reset(en); 958 _compose_seq_reset(en);
958 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE); 959 _key_down_sel_pre(obj, cur, en, shift, EINA_FALSE);
959 960
960 efl_text_cursor_line_jump_by(obj, cur, -10); 961 efl_text_cursor_line_jump_by(cur, -10);
961 962
962 _key_down_sel_post(obj, cur, en, shift); 963 _key_down_sel_post(obj, cur, en, shift);
963 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 964 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -968,7 +969,7 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
968 _compose_seq_reset(en); 969 _compose_seq_reset(en);
969 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE); 970 _key_down_sel_pre(obj, cur, en, shift, EINA_TRUE);
970 971
971 efl_text_cursor_line_jump_by(obj, cur, 10); 972 efl_text_cursor_line_jump_by(cur, 10);
972 973
973 _key_down_sel_post(obj, cur, en, shift); 974 _key_down_sel_post(obj, cur, en, shift);
974 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 975 ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
@@ -1046,11 +1047,11 @@ _key_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
1046 } 1047 }
1047 info.insert = EINA_TRUE; 1048 info.insert = EINA_TRUE;
1048 info.content = string; 1049 info.content = string;
1049 info.position = efl_text_cursor_position_get(obj, cur); 1050 info.position = efl_text_cursor_position_get(cur);
1050 info.length = eina_unicode_utf8_get_len(string); 1051 info.length = eina_unicode_utf8_get_len(string);
1051 1052
1052 efl_event_freeze(obj); 1053 efl_event_freeze(obj);
1053 efl_text_cursor_text_insert(obj, cur, string); 1054 efl_text_cursor_text_insert(cur, string);
1054 efl_event_thaw(obj); 1055 efl_event_thaw(obj);
1055 changed_user = EINA_TRUE; 1056 changed_user = EINA_TRUE;
1056 1057
@@ -1070,38 +1071,38 @@ end:
1070} 1071}
1071 1072
1072static void 1073static void
1073_cursor_char_coord_set(Efl_Canvas_Text *obj, Efl_Text_Cursor_Cursor *cur, Evas_Coord canvasx, Evas_Coord canvasy, Evas_Coord *_cx, Evas_Coord *_cy) 1074_cursor_char_coord_set(Efl_Canvas_Text *obj, Efl_Text_Cursor *cur, Evas_Coord canvasx, Evas_Coord canvasy, Evas_Coord *_cx, Evas_Coord *_cy)
1074{ 1075{
1075 Evas_Coord cx, cy; 1076 Evas_Coord cx, cy;
1076 Evas_Coord x, y, lh = 0, cly = 0; 1077 Evas_Coord x, y, lh = 0, cly = 0;
1077 Evas_Textblock_Cursor *line_cur; 1078 Efl_Text_Cursor *line_cur;
1078 Evas_Textblock_Cursor *tc; 1079 Efl_Text_Cursor *tc;
1079 1080
1080 tc = evas_object_textblock_cursor_new(obj); 1081 tc = efl_canvas_text_cursor_create(obj);
1081 evas_textblock_cursor_copy(cur, tc); 1082 efl_text_cursor_copy(cur, tc);
1082 evas_object_geometry_get(obj, &x, &y, NULL, NULL); 1083 evas_object_geometry_get(obj, &x, &y, NULL, NULL);
1083 cx = canvasx - x; 1084 cx = canvasx - x;
1084 cy = canvasy - y; 1085 cy = canvasy - y;
1085 1086
1086 line_cur = evas_object_textblock_cursor_new(obj); 1087 line_cur = efl_canvas_text_cursor_create(obj);
1087 evas_textblock_cursor_paragraph_last(line_cur); 1088 efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_LAST);
1088 evas_textblock_cursor_line_geometry_get(line_cur, NULL, &cly, NULL, &lh); 1089 evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, &lh);
1089 /* Consider a threshold of half the line height */ 1090 /* Consider a threshold of half the line height */
1090 if (cy > (cly + lh) && cy < (cly + lh + lh / 2)) 1091 if (cy > (cly + lh) && cy < (cly + lh + lh / 2))
1091 { 1092 {
1092 cy = cly + lh - 1; // Make it inside Textblock 1093 cy = cly + lh - 1; // Make it inside Textblock
1093 } 1094 }
1094 evas_textblock_cursor_paragraph_first(line_cur); 1095 efl_text_cursor_move(line_cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
1095 evas_textblock_cursor_line_geometry_get(line_cur, NULL, &cly, NULL, NULL); 1096 evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(line_cur), NULL, &cly, NULL, NULL);
1096 1097
1097 if (cy < cly && cy > (cly - lh / 2)) 1098 if (cy < cly && cy > (cly - lh / 2))
1098 { 1099 {
1099 cy = cly; 1100 cy = cly;
1100 } 1101 }
1101 evas_textblock_cursor_free(line_cur); 1102 efl_del(line_cur);
1102 /* No need to check return value if not able to set the char coord Textblock 1103 /* No need to check return value if not able to set the char coord Textblock
1103 * will take care */ 1104 * will take care */
1104 evas_textblock_cursor_char_coord_set(cur, cx, cy); 1105 efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, cy));
1105 if (_cx) *_cx = cx; 1106 if (_cx) *_cx = cx;
1106 if (_cy) *_cy = cy; 1107 if (_cy) *_cy = cy;
1107} 1108}
@@ -1112,8 +1113,8 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
1112 Evas_Coord cx, cy; 1113 Evas_Coord cx, cy;
1113 Evas_Event_Mouse_Down *ev = event_info; 1114 Evas_Event_Mouse_Down *ev = event_info;
1114 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 1115 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
1115 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 1116 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
1116 Evas_Textblock_Cursor *tc = NULL; 1117 Efl_Text_Cursor *tc = NULL;
1117 Eina_Bool dosel = EINA_FALSE; 1118 Eina_Bool dosel = EINA_FALSE;
1118 Eina_Bool shift; 1119 Eina_Bool shift;
1119 1120
@@ -1142,12 +1143,12 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
1142 { 1143 {
1143 if (shift) 1144 if (shift)
1144 { 1145 {
1145 tc = evas_object_textblock_cursor_new(obj); 1146 tc = efl_canvas_text_cursor_create(obj);
1146 evas_textblock_cursor_copy(cur, tc); 1147 efl_text_cursor_copy(cur, tc);
1147 if (evas_textblock_cursor_compare(cur, en->sel_start) < 0) 1148 if (efl_text_cursor_compare(cur, en->sel_start) < 0)
1148 evas_textblock_cursor_line_char_first(cur); 1149 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
1149 else 1150 else
1150 evas_textblock_cursor_line_char_last(cur); 1151 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
1151 _sel_extend(cur, obj, en); 1152 _sel_extend(cur, obj, en);
1152 } 1153 }
1153 else 1154 else
@@ -1155,11 +1156,11 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
1155 en->have_selection = EINA_FALSE; 1156 en->have_selection = EINA_FALSE;
1156 en->selecting = EINA_FALSE; 1157 en->selecting = EINA_FALSE;
1157 _sel_clear(obj, en); 1158 _sel_clear(obj, en);
1158 tc = evas_object_textblock_cursor_new(obj); 1159 tc = efl_canvas_text_cursor_create(obj);
1159 evas_textblock_cursor_copy(cur, tc); 1160 efl_text_cursor_copy(cur, tc);
1160 evas_textblock_cursor_line_char_first(cur); 1161 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_START);
1161 _sel_init(cur, obj, en); 1162 _sel_init(cur, obj, en);
1162 evas_textblock_cursor_line_char_last(cur); 1163 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_LINE_END);
1163 _sel_extend(cur, obj, en); 1164 _sel_extend(cur, obj, en);
1164 } 1165 }
1165 goto end; 1166 goto end;
@@ -1168,14 +1169,14 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
1168 { 1169 {
1169 if (shift) 1170 if (shift)
1170 { 1171 {
1171 tc = evas_object_textblock_cursor_new(obj); 1172 tc = efl_canvas_text_cursor_create(obj);
1172 evas_textblock_cursor_copy(cur, tc); 1173 efl_text_cursor_copy(cur, tc);
1173 if (evas_textblock_cursor_compare(cur, en->sel_start) < 0) 1174 if (efl_text_cursor_compare(cur, en->sel_start) < 0)
1174 evas_textblock_cursor_word_start(cur); 1175 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
1175 else 1176 else
1176 { 1177 {
1177 evas_textblock_cursor_word_end(cur); 1178 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
1178 evas_textblock_cursor_char_next(cur); 1179 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);
1179 } 1180 }
1180 _sel_extend(cur, obj, en); 1181 _sel_extend(cur, obj, en);
1181 } 1182 }
@@ -1184,12 +1185,12 @@ _mouse_down_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj EIN
1184 en->have_selection = EINA_FALSE; 1185 en->have_selection = EINA_FALSE;
1185 en->selecting = EINA_FALSE; 1186 en->selecting = EINA_FALSE;
1186 _sel_clear(obj, en); 1187 _sel_clear(obj, en);
1187 tc = evas_object_textblock_cursor_new(obj); 1188 tc = efl_canvas_text_cursor_create(obj);
1188 evas_textblock_cursor_copy(cur, tc); 1189 efl_text_cursor_copy(cur, tc);
1189 evas_textblock_cursor_word_start(cur); 1190 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_START);
1190 _sel_init(cur, obj, en); 1191 _sel_init(cur, obj, en);
1191 evas_textblock_cursor_word_end(cur); 1192 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_WORD_END);
1192 evas_textblock_cursor_char_next(cur); 1193 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_CHAR_NEXT);
1193 _sel_extend(cur, obj, en); 1194 _sel_extend(cur, obj, en);
1194 } 1195 }
1195 goto end; 1196 goto end;
@@ -1223,7 +1224,7 @@ _mouse_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
1223{ 1224{
1224 Evas_Coord cx, cy; 1225 Evas_Coord cx, cy;
1225 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 1226 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
1226 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 1227 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
1227 Evas_Event_Mouse_Up *ev = event_info; 1228 Evas_Event_Mouse_Up *ev = event_info;
1228 1229
1229 if ((!ev) || (ev->button != 1)) return; 1230 if ((!ev) || (ev->button != 1)) return;
@@ -1247,7 +1248,7 @@ _mouse_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, void
1247 1248
1248 if (en->select_allow) 1249 if (en->select_allow)
1249 { 1250 {
1250 efl_text_cursor_copy(obj, en->sel_end, cur); 1251 efl_text_cursor_copy(en->sel_end, cur);
1251 } 1252 }
1252 if (en->selecting) 1253 if (en->selecting)
1253 { 1254 {
@@ -1264,10 +1265,10 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo
1264{ 1265{
1265 Evas_Coord cx, cy; 1266 Evas_Coord cx, cy;
1266 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS); 1267 Efl_Ui_Internal_Text_Interactive_Data *en = efl_data_scope_get(obj, MY_CLASS);
1267 Efl_Text_Cursor_Cursor *cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 1268 Efl_Text_Cursor *cur = efl_text_interactive_main_cursor_get(obj);
1268 Evas_Event_Mouse_Move *ev = event_info; 1269 Evas_Event_Mouse_Move *ev = event_info;
1269 Evas_Coord x, y, w, h; 1270 Evas_Coord x, y, w, h;
1270 Evas_Textblock_Cursor *tc; 1271 Efl_Text_Cursor *tc;
1271 Eina_Bool multiline; 1272 Eina_Bool multiline;
1272 1273
1273 multiline = efl_text_multiline_get(obj); 1274 multiline = efl_text_multiline_get(obj);
@@ -1286,35 +1287,41 @@ _mouse_move_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *obj, vo
1286 1287
1287 if (en->selecting) 1288 if (en->selecting)
1288 { 1289 {
1289 tc = evas_object_textblock_cursor_new(obj); 1290 tc = efl_canvas_text_cursor_create(obj);
1290 evas_textblock_cursor_copy(cur, tc); 1291 efl_text_cursor_copy(cur, tc);
1291 evas_object_geometry_get(obj, &x, &y, &w, &h); 1292 evas_object_geometry_get(obj, &x, &y, &w, &h);
1292 cx = ev->cur.canvas.x - x; 1293 cx = ev->cur.canvas.x - x;
1293 cy = ev->cur.canvas.y - y; 1294 cy = ev->cur.canvas.y - y;
1294 1295
1295 if (multiline) 1296 if (multiline)
1296 { 1297 {
1297 efl_text_cursor_coord_set(obj, cur, cx, cy); 1298 efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, cy));
1298 } 1299 }
1299 else 1300 else
1300 { 1301 {
1301 Evas_Coord lx, ly, lw, lh; 1302 Evas_Coord lx, ly, lw, lh;
1302 evas_textblock_cursor_paragraph_first(cur); 1303 efl_text_cursor_move(cur, EFL_TEXT_CURSOR_MOVE_TYPE_PARAGRAPH_FIRST);
1303 evas_textblock_cursor_line_geometry_get(cur, &lx, &ly, &lw, &lh); 1304 evas_textblock_cursor_line_geometry_get(efl_text_cursor_handle_get(cur), &lx, &ly, &lw, &lh);
1304 efl_text_cursor_coord_set(obj, cur, cx, ly + (lh / 2)); 1305 efl_text_cursor_char_coord_set(cur, EINA_POSITION2D(cx, ly + (lh / 2)));
1305 } 1306 }
1306 1307
1307 if (en->select_allow) 1308 if (en->select_allow)
1308 { 1309 {
1309 _sel_extend(cur, obj, en); 1310 _sel_extend(cur, obj, en);
1310 1311
1311 if (!efl_text_cursor_equal(obj, en->sel_start, en->sel_end)) 1312 if (!efl_text_cursor_equal(en->sel_start, en->sel_end))
1312 _sel_enable(cur, obj, en); 1313 _sel_enable(cur, obj, en);
1313 } 1314 }
1314 evas_textblock_cursor_free(tc); 1315 efl_del(tc);
1315 } 1316 }
1316} 1317}
1317 1318
1319EOLIAN static Efl_Text_Cursor *
1320_efl_ui_internal_text_interactive_efl_text_interactive_main_cursor_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd)
1321{
1322 return pd->main_cursor;
1323}
1324
1318EOLIAN static Efl_Object * 1325EOLIAN static Efl_Object *
1319_efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en) 1326_efl_ui_internal_text_interactive_efl_object_constructor(Eo *obj, Efl_Ui_Internal_Text_Interactive_Data *en)
1320{ 1327{
@@ -1334,12 +1341,11 @@ _efl_ui_internal_text_interactive_efl_object_finalize(Eo *obj, Efl_Ui_Internal_T
1334 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, NULL); 1341 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_UP, _mouse_up_cb, NULL);
1335 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, NULL); 1342 evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_MOVE, _mouse_move_cb, NULL);
1336 1343
1337 en->sel_start = evas_object_textblock_cursor_new(obj); 1344 en->main_cursor = efl_canvas_text_cursor_create(obj);
1338 en->sel_end = evas_object_textblock_cursor_new(obj); 1345 en->sel_start = efl_canvas_text_cursor_create(obj);
1346 en->sel_end = efl_canvas_text_cursor_create(obj);
1339 1347
1340 efl_event_callback_add(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, 1348 efl_event_callback_add(efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_EVENT_CHANGED,
1341 _sel_cursor_changed, obj);
1342 efl_event_callback_add(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED,
1343 _sel_cursor_changed, obj); 1349 _sel_cursor_changed, obj);
1344 1350
1345 en->input_panel_enable = EINA_TRUE; 1351 en->input_panel_enable = EINA_TRUE;
@@ -1422,10 +1428,10 @@ _efl_ui_internal_text_interactive_efl_text_interactive_selection_allowed_get(con
1422} 1428}
1423 1429
1424EOLIAN static void 1430EOLIAN static void
1425_efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Efl_Text_Cursor_Cursor **start, Evas_Textblock_Cursor **end) 1431_efl_ui_internal_text_interactive_efl_text_interactive_selection_cursors_get(const Eo *obj EINA_UNUSED, Efl_Ui_Internal_Text_Interactive_Data *pd, Efl_Text_Cursor **start, Efl_Text_Cursor **end)
1426{ 1432{
1427 if (efl_text_cursor_position_get(obj, pd->sel_start) > 1433 if (efl_text_cursor_position_get(pd->sel_start) >
1428 efl_text_cursor_position_get(obj, pd->sel_end)) 1434 efl_text_cursor_position_get(pd->sel_end))
1429 { 1435 {
1430 if (start) *start = pd->sel_end; 1436 if (start) *start = pd->sel_end;
1431 if (end) *end = pd->sel_start; 1437 if (end) *end = pd->sel_start;
diff --git a/src/lib/elementary/efl_ui_internal_text_interactive.eo b/src/lib/elementary/efl_ui_internal_text_interactive.eo
index a7bf52293c..666cd83a0f 100644
--- a/src/lib/elementary/efl_ui_internal_text_interactive.eo
+++ b/src/lib/elementary/efl_ui_internal_text_interactive.eo
@@ -7,6 +7,7 @@ class @beta Efl.Ui.Internal.Text.Interactive extends Efl.Canvas.Text implements
7 implements { 7 implements {
8 Efl.Object.constructor; 8 Efl.Object.constructor;
9 Efl.Object.finalize; 9 Efl.Object.finalize;
10 Efl.Text_Interactive.main_cursor { get; }
10 Efl.Text_Interactive.selection_allowed { get; set; } 11 Efl.Text_Interactive.selection_allowed { get; set; }
11 Efl.Text_Interactive.selection_cursors { get; } 12 Efl.Text_Interactive.selection_cursors { get; }
12 Efl.Text_Interactive.editable { get; set; } 13 Efl.Text_Interactive.editable { get; set; }
diff --git a/src/lib/elementary/efl_ui_internal_text_scroller.c b/src/lib/elementary/efl_ui_internal_text_scroller.c
index b5888f5a60..f5e366deb0 100644
--- a/src/lib/elementary/efl_ui_internal_text_scroller.c
+++ b/src/lib/elementary/efl_ui_internal_text_scroller.c
@@ -101,7 +101,7 @@ _efl_ui_internal_text_scroller_efl_canvas_group_group_calculate(Eo *obj,
101 efl_event_freeze(sd->text_obj); 101 efl_event_freeze(sd->text_obj);
102 efl_gfx_entity_size_set(sd->text_table, view.size); 102 efl_gfx_entity_size_set(sd->text_table, view.size);
103 efl_gfx_entity_size_set(sd->text_obj, view.size); 103 efl_gfx_entity_size_set(sd->text_obj, view.size);
104 efl_canvas_text_size_formatted_get(sd->text_obj, &fsz.w, &fsz.h); 104 fsz = efl_canvas_text_size_formatted_get(sd->text_obj);
105 efl_gfx_entity_size_set(sd->text_table, sz); 105 efl_gfx_entity_size_set(sd->text_table, sz);
106 efl_gfx_entity_size_set(sd->text_obj, sz); 106 efl_gfx_entity_size_set(sd->text_obj, sz);
107 efl_event_thaw(sd->text_obj); 107 efl_event_thaw(sd->text_obj);
diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c
index caf84c225d..e57fc9c23d 100644
--- a/src/lib/elementary/efl_ui_text.c
+++ b/src/lib/elementary/efl_ui_text.c
@@ -18,6 +18,7 @@
18#include "elm_hoversel_eo.h" 18#include "elm_hoversel_eo.h"
19#include "efl_ui_text_part.eo.h" 19#include "efl_ui_text_part.eo.h"
20#include "elm_part_helper.h" 20#include "elm_part_helper.h"
21#include "efl_canvas_text_internal.h"
21 22
22typedef struct _Efl_Ui_Text_Data Efl_Ui_Text_Data; 23typedef struct _Efl_Ui_Text_Data Efl_Ui_Text_Data;
23typedef struct _Efl_Ui_Text_Rectangle Efl_Ui_Text_Rectangle; 24typedef struct _Efl_Ui_Text_Rectangle Efl_Ui_Text_Rectangle;
@@ -77,7 +78,7 @@ struct _Efl_Ui_Text_Data
77 Efl_Ui_Input_Panel_Language_Type input_panel_lang; 78 Efl_Ui_Input_Panel_Language_Type input_panel_lang;
78 Efl_Ui_Input_Panel_Return_Key_Type input_panel_return_key_type; 79 Efl_Ui_Input_Panel_Return_Key_Type input_panel_return_key_type;
79 Efl_Ui_Input_Hints input_hints; 80 Efl_Ui_Input_Hints input_hints;
80 Efl_Text_Cursor_Cursor *sel_handler_cursor; 81 Efl_Text_Cursor *sel_handler_cursor;
81 void *input_panel_imdata; 82 void *input_panel_imdata;
82 int input_panel_imdata_len; 83 int input_panel_imdata_len;
83 int input_panel_layout_variation; 84 int input_panel_layout_variation;
@@ -514,7 +515,8 @@ _update_selection_handler(Eo *obj)
514 Eina_Position2D off; 515 Eina_Position2D off;
515 Evas_Coord hx, hy; 516 Evas_Coord hx, hy;
516 Eina_Bool hidden = EINA_FALSE; 517 Eina_Bool hidden = EINA_FALSE;
517 Efl_Text_Cursor_Cursor *sel_start, *sel_end; 518 Efl_Text_Cursor *sel_start, *sel_end;
519 Eina_Rect rc_tmp;
518 520
519 efl_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end); 521 efl_text_interactive_selection_cursors_get(obj, &sel_start, &sel_end);
520 522
@@ -523,10 +525,11 @@ _update_selection_handler(Eo *obj)
523 525
524 //evas_object_geometry_get(sd->entry_edje, &ent_x, &ent_y, NULL, NULL); 526 //evas_object_geometry_get(sd->entry_edje, &ent_x, &ent_y, NULL, NULL);
525 527
526 efl_text_cursor_geometry_get(obj, sel_start, 528 rc_tmp = efl_text_cursor_geometry_get(sel_start, EFL_TEXT_CURSOR_TYPE_BEFORE);
527 EFL_TEXT_CURSOR_TYPE_BEFORE, 529 sx = rc_tmp.x;
528 &sx, &sy, NULL, &sh, 530 sy = rc_tmp.y;
529 NULL, NULL, NULL, NULL); 531 sh = rc_tmp.h;
532
530 off = _decoration_calc_offset(sd); 533 off = _decoration_calc_offset(sd);
531 hx = off.x + sx; 534 hx = off.x + sx;
532 hy = off.y + sy + sh; 535 hy = off.y + sy + sh;
@@ -553,10 +556,11 @@ _update_selection_handler(Eo *obj)
553 } 556 }
554 557
555 hidden = EINA_FALSE; 558 hidden = EINA_FALSE;
556 efl_text_cursor_geometry_get(obj, sel_end, 559 rc_tmp = efl_text_cursor_geometry_get(sel_end, EFL_TEXT_CURSOR_TYPE_BEFORE);
557 EFL_TEXT_CURSOR_TYPE_BEFORE, 560 ex = rc_tmp.x;
558 &ex, &ey, NULL, &eh, 561 ey = rc_tmp.y;
559 NULL, NULL, NULL, NULL); 562 eh = rc_tmp.h;
563
560 hx = off.x + ex; 564 hx = off.x + ex;
561 hy = off.y + ey + eh; 565 hy = off.y + ey + eh;
562 evas_object_move(sd->end_handler, hx, hy); 566 evas_object_move(sd->end_handler, hx, hy);
@@ -600,31 +604,31 @@ static void
600_selection_data_cb(void *data EINA_UNUSED, Eo *obj, 604_selection_data_cb(void *data EINA_UNUSED, Eo *obj,
601 Efl_Ui_Selection_Data *sel_data) 605 Efl_Ui_Selection_Data *sel_data)
602{ 606{
603 Efl_Text_Cursor_Cursor *cur, *start, *end; 607 Efl_Text_Cursor *cur, *start, *end;
604 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 }; 608 Efl_Ui_Text_Change_Info info = { NULL, 0, 0, 0, 0 };
605 609
606 char *buf = eina_slice_strdup(sel_data->content); 610 char *buf = eina_slice_strdup(sel_data->content);
607 size_t len = sel_data->content.len; 611 size_t len = sel_data->content.len;
608 612
609 efl_text_interactive_selection_cursors_get(obj, &start, &end); 613 efl_text_interactive_selection_cursors_get(obj, &start, &end);
610 if (!efl_text_cursor_equal(obj, start, end)) 614 if (!efl_text_cursor_equal(start, end))
611 { 615 {
612 efl_canvas_text_range_delete(obj, start, end); 616 efl_text_cursor_range_delete(start, end);
613 EFL_UI_TEXT_DATA_GET(obj, sd); 617 EFL_UI_TEXT_DATA_GET(obj, sd);
614 _efl_ui_text_select_none(obj, sd); 618 _efl_ui_text_select_none(obj, sd);
615 } 619 }
616 cur = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 620 cur = efl_text_interactive_main_cursor_get(obj);
617 info.insert = EINA_TRUE; 621 info.insert = EINA_TRUE;
618 info.position = efl_text_cursor_position_get(obj, cur); 622 info.position = efl_text_cursor_position_get(cur);
619 info.length = len; 623 info.length = len;
620 info.content = buf; 624 info.content = buf;
621 if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP) 625 if (sel_data->format == EFL_UI_SELECTION_FORMAT_MARKUP)
622 { 626 {
623 efl_text_markup_interactive_cursor_markup_insert(obj, cur, buf); 627 efl_text_cursor_markup_insert(cur, buf);
624 } 628 }
625 else // TEXT 629 else // TEXT
626 { 630 {
627 efl_text_cursor_text_insert(obj, cur, buf); 631 efl_text_cursor_text_insert(cur, buf);
628 } 632 }
629 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info); 633 efl_event_callback_call(obj, EFL_UI_TEXT_EVENT_CHANGED_USER, &info);
630 free(buf); 634 free(buf);
@@ -829,6 +833,7 @@ _cursor_geometry_recalc(Evas_Object *obj)
829 Evas_Coord x, y, w, h; 833 Evas_Coord x, y, w, h;
830 Evas_Coord x2, y2, w2, h2; 834 Evas_Coord x2, y2, w2, h2;
831 Evas_Coord cx, cy, cw, ch; 835 Evas_Coord cx, cy, cw, ch;
836 Eina_Rect rc;
832 837
833 if (!sd->editable) return; 838 if (!sd->editable) return;
834 839
@@ -836,12 +841,15 @@ _cursor_geometry_recalc(Evas_Object *obj)
836 x2 = y2 = w2 = h2 = 0; 841 x2 = y2 = w2 = h2 = 0;
837 x = y = w = h = 0; 842 x = y = w = h = 0;
838 843
839 Efl_Text_Cursor_Cursor *main_cur = 844 Efl_Text_Cursor *main_cur =
840 efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 845 efl_text_interactive_main_cursor_get(obj);
846
847 rc = efl_text_cursor_geometry_get(main_cur, EFL_TEXT_CURSOR_TYPE_BEFORE);
848 cx = rc.x;
849 cy = rc.y;
850 cw = rc.w;
851 ch = rc.h;
841 852
842 efl_text_cursor_geometry_get(obj, main_cur,
843 EFL_TEXT_CURSOR_TYPE_BEFORE,
844 &cx, &cy, &cw, &ch, NULL, NULL, NULL, NULL);
845 edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0); 853 edje_object_size_min_restricted_calc(sd->cursor, &cw, NULL, cw, 0);
846 if (cw < 1) cw = 1; 854 if (cw < 1) cw = 1;
847 if (ch < 1) ch = 1; 855 if (ch < 1) ch = 1;
@@ -918,9 +926,9 @@ _efl_ui_text_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Data *sd)
918 efl_gfx_entity_size_set(sd->text_obj, EINA_SIZE2D(sz.w, 0)); 926 efl_gfx_entity_size_set(sd->text_obj, EINA_SIZE2D(sz.w, 0));
919 /* ignore current object size for single-line since we always need to know the actual size */ 927 /* ignore current object size for single-line since we always need to know the actual size */
920 if (sd->single_line) 928 if (sd->single_line)
921 efl_canvas_text_size_native_get(sd->text_obj, &min.w, &min.h); 929 min = efl_canvas_text_size_native_get(sd->text_obj);
922 else 930 else
923 efl_canvas_text_size_formatted_get(sd->text_obj, &min.w, &min.h); 931 min = efl_canvas_text_size_formatted_get(sd->text_obj);
924 efl_gfx_entity_size_set(sd->text_obj, text_sz); 932 efl_gfx_entity_size_set(sd->text_obj, text_sz);
925 efl_event_thaw(sd->text_obj); 933 efl_event_thaw(sd->text_obj);
926 min.w += edmin.w; 934 min.w += edmin.w;
@@ -1008,11 +1016,8 @@ _efl_ui_text_efl_ui_widget_interest_region_get(const Eo *obj EINA_UNUSED, Efl_Ui
1008 Evas_Coord edje_x, edje_y, elm_x, elm_y; 1016 Evas_Coord edje_x, edje_y, elm_x, elm_y;
1009 Eina_Rect r = {}; 1017 Eina_Rect r = {};
1010 1018
1011 efl_text_cursor_geometry_get(obj, 1019 r = efl_text_cursor_geometry_get(
1012 efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), 1020 efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_TYPE_BEFORE);
1013 EFL_TEXT_CURSOR_TYPE_BEFORE,
1014 &r.x, &r.y, &r.w, &r.h,
1015 NULL, NULL, NULL, NULL);
1016 1021
1017 if (sd->single_line) 1022 if (sd->single_line)
1018 { 1023 {
@@ -1172,7 +1177,7 @@ _selection_store(Efl_Ui_Selection_Type seltype,
1172 Evas_Object *obj) 1177 Evas_Object *obj)
1173{ 1178{
1174 char *sel; 1179 char *sel;
1175 Efl_Text_Cursor_Cursor *start, *end; 1180 Efl_Text_Cursor *start, *end;
1176 Efl_Ui_Selection_Format selformat = EFL_UI_SELECTION_FORMAT_MARKUP; 1181 Efl_Ui_Selection_Format selformat = EFL_UI_SELECTION_FORMAT_MARKUP;
1177 Eina_Slice slice; 1182 Eina_Slice slice;
1178 Selection_Loss_Data *ldata; 1183 Selection_Loss_Data *ldata;
@@ -1181,7 +1186,7 @@ _selection_store(Efl_Ui_Selection_Type seltype,
1181 EFL_UI_TEXT_DATA_GET(obj, sd); 1186 EFL_UI_TEXT_DATA_GET(obj, sd);
1182 1187
1183 efl_text_interactive_selection_cursors_get(obj, &start, &end); 1188 efl_text_interactive_selection_cursors_get(obj, &start, &end);
1184 sel = efl_text_markup_interactive_markup_range_get(obj, start, end); 1189 sel = efl_text_cursor_range_markup_get(start, end);
1185 1190
1186 if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */ 1191 if ((!sel) || (!sel[0])) return; /* avoid deleting our own selection */
1187 1192
@@ -1228,7 +1233,7 @@ end:
1228static void 1233static void
1229_cut_cb(Eo *obj) 1234_cut_cb(Eo *obj)
1230{ 1235{
1231 Efl_Text_Cursor_Cursor *start, *end; 1236 Efl_Text_Cursor *start, *end;
1232 EFL_UI_TEXT_DATA_GET(obj, sd); 1237 EFL_UI_TEXT_DATA_GET(obj, sd);
1233 1238
1234 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_CUT, NULL); 1239 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTION_CUT, NULL);
@@ -1244,7 +1249,7 @@ _cut_cb(Eo *obj)
1244 1249
1245 _selection_store(EFL_UI_SELECTION_TYPE_CLIPBOARD, obj); 1250 _selection_store(EFL_UI_SELECTION_TYPE_CLIPBOARD, obj);
1246 efl_text_interactive_selection_cursors_get(obj, &start, &end); 1251 efl_text_interactive_selection_cursors_get(obj, &start, &end);
1247 efl_canvas_text_range_delete(obj, start, end); 1252 efl_text_cursor_range_delete(start, end);
1248 _efl_ui_text_select_none(obj, sd); 1253 _efl_ui_text_select_none(obj, sd);
1249} 1254}
1250 1255
@@ -1686,15 +1691,18 @@ _selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler)
1686 Evas_Coord cx, cy, cw, ch; 1691 Evas_Coord cx, cy, cw, ch;
1687 Evas_Coord hh; 1692 Evas_Coord hh;
1688 Eina_Position2D pos; 1693 Eina_Position2D pos;
1694 Eina_Rect rc;
1689 1695
1690 EFL_UI_TEXT_DATA_GET(obj, sd); 1696 EFL_UI_TEXT_DATA_GET(obj, sd);
1691 1697
1692 pos = efl_gfx_entity_position_get(sd->text_obj); 1698 pos = efl_gfx_entity_position_get(sd->text_obj);
1693 efl_text_cursor_geometry_get(obj, 1699 rc = efl_text_cursor_geometry_get(
1694 efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), 1700 efl_text_interactive_main_cursor_get(obj), EFL_TEXT_CURSOR_TYPE_BEFORE);
1695 EFL_TEXT_CURSOR_TYPE_BEFORE, 1701 cx = rc.x;
1696 &cx, &cy, &cw, &ch, 1702 cy = rc.y;
1697 NULL, NULL, NULL, NULL); 1703 cw = rc.w;
1704 ch = rc.h;
1705
1698 edje_object_size_min_calc(handler, NULL, &hh); 1706 edje_object_size_min_calc(handler, NULL, &hh);
1699 1707
1700 sd->ox = pos.x + cx + (cw / 2); 1708 sd->ox = pos.x + cx + (cw / 2);
@@ -1720,8 +1728,8 @@ _start_handler_mouse_down_cb(void *data,
1720 EFL_UI_TEXT_DATA_GET(data, sd); 1728 EFL_UI_TEXT_DATA_GET(data, sd);
1721 1729
1722 int start_pos, end_pos, pos; 1730 int start_pos, end_pos, pos;
1723 Efl_Text_Cursor_Cursor *sel_start, *sel_end; 1731 Efl_Text_Cursor *sel_start, *sel_end;
1724 Efl_Text_Cursor_Cursor *main_cur; 1732 Efl_Text_Cursor *main_cur;
1725 1733
1726 Eo *text_obj = sd->text_obj; 1734 Eo *text_obj = sd->text_obj;
1727 1735
@@ -1729,10 +1737,10 @@ _start_handler_mouse_down_cb(void *data,
1729 1737
1730 /* Get the cursors */ 1738 /* Get the cursors */
1731 efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end); 1739 efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
1732 main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 1740 main_cur = efl_text_interactive_main_cursor_get(text_obj);
1733 1741
1734 start_pos = efl_text_cursor_position_get(text_obj, sel_start); 1742 start_pos = efl_text_cursor_position_get(sel_start);
1735 end_pos = efl_text_cursor_position_get(text_obj, sel_end); 1743 end_pos = efl_text_cursor_position_get(sel_end);
1736 1744
1737 if (start_pos <= end_pos) 1745 if (start_pos <= end_pos)
1738 { 1746 {
@@ -1744,7 +1752,7 @@ _start_handler_mouse_down_cb(void *data,
1744 pos = end_pos; 1752 pos = end_pos;
1745 sd->sel_handler_cursor = sel_end; 1753 sd->sel_handler_cursor = sel_end;
1746 } 1754 }
1747 efl_text_cursor_position_set(text_obj, main_cur, pos); 1755 efl_text_cursor_position_set(main_cur, pos);
1748 _selection_handlers_offset_calc(data, sd->start_handler); 1756 _selection_handlers_offset_calc(data, sd->start_handler);
1749} 1757}
1750 1758
@@ -1783,12 +1791,12 @@ _start_handler_mouse_move_cb(void *data,
1783 cy = ev->cur.canvas.y - sd->oy - ey; 1791 cy = ev->cur.canvas.y - sd->oy - ey;
1784 if (cx <= 0) cx = 1; 1792 if (cx <= 0) cx = 1;
1785 1793
1786 efl_text_cursor_coord_set(sd->text_obj, sd->sel_handler_cursor, cx, cy); 1794 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy));
1787 pos = efl_text_cursor_position_get(sd->text_obj, sd->sel_handler_cursor); 1795 pos = efl_text_cursor_position_get(sd->sel_handler_cursor);
1788 1796
1789 /* Set the main cursor. */ 1797 /* Set the main cursor. */
1790 efl_text_cursor_position_set(sd->text_obj, 1798 efl_text_cursor_position_set(
1791 efl_text_cursor_get(sd->text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN), pos); 1799 efl_text_interactive_main_cursor_get(sd->text_obj), pos);
1792 1800
1793 efl_input_clickable_longpress_abort(data, 1); 1801 efl_input_clickable_longpress_abort(data, 1);
1794 sd->long_pressed = EINA_FALSE; 1802 sd->long_pressed = EINA_FALSE;
@@ -1802,8 +1810,8 @@ _end_handler_mouse_down_cb(void *data,
1802{ 1810{
1803 EFL_UI_TEXT_DATA_GET(data, sd); 1811 EFL_UI_TEXT_DATA_GET(data, sd);
1804 1812
1805 Efl_Text_Cursor_Cursor *sel_start, *sel_end; 1813 Efl_Text_Cursor *sel_start, *sel_end;
1806 Efl_Text_Cursor_Cursor *main_cur; 1814 Efl_Text_Cursor *main_cur;
1807 int pos, start_pos, end_pos; 1815 int pos, start_pos, end_pos;
1808 1816
1809 sd->end_handler_down = EINA_TRUE; 1817 sd->end_handler_down = EINA_TRUE;
@@ -1811,10 +1819,10 @@ _end_handler_mouse_down_cb(void *data,
1811 Eo *text_obj = sd->text_obj; 1819 Eo *text_obj = sd->text_obj;
1812 1820
1813 efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end); 1821 efl_text_interactive_selection_cursors_get(text_obj, &sel_start, &sel_end);
1814 main_cur = efl_text_cursor_get(text_obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 1822 main_cur = efl_text_interactive_main_cursor_get(text_obj);
1815 1823
1816 start_pos = efl_text_cursor_position_get(text_obj, sel_start); 1824 start_pos = efl_text_cursor_position_get(sel_start);
1817 end_pos = efl_text_cursor_position_get(text_obj, sel_end); 1825 end_pos = efl_text_cursor_position_get(sel_end);
1818 1826
1819 if (start_pos < end_pos) 1827 if (start_pos < end_pos)
1820 { 1828 {
@@ -1827,7 +1835,7 @@ _end_handler_mouse_down_cb(void *data,
1827 sd->sel_handler_cursor = sel_start; 1835 sd->sel_handler_cursor = sel_start;
1828 } 1836 }
1829 1837
1830 efl_text_cursor_position_set(text_obj, main_cur, pos); 1838 efl_text_cursor_position_set(main_cur, pos);
1831 _selection_handlers_offset_calc(data, sd->end_handler); 1839 _selection_handlers_offset_calc(data, sd->end_handler);
1832} 1840}
1833 1841
@@ -1866,10 +1874,10 @@ _end_handler_mouse_move_cb(void *data,
1866 cy = ev->cur.canvas.y - sd->oy - ey; 1874 cy = ev->cur.canvas.y - sd->oy - ey;
1867 if (cx <= 0) cx = 1; 1875 if (cx <= 0) cx = 1;
1868 1876
1869 efl_text_cursor_coord_set(sd->text_obj, sd->sel_handler_cursor, cx, cy); 1877 efl_text_cursor_char_coord_set(sd->sel_handler_cursor, EINA_POSITION2D(cx, cy));
1870 pos = efl_text_cursor_position_get(sd->text_obj, sd->sel_handler_cursor); 1878 pos = efl_text_cursor_position_get(sd->sel_handler_cursor);
1871 /* Set the main cursor. */ 1879 /* Set the main cursor. */
1872 efl_text_cursor_position_set(sd->text_obj, efl_text_cursor_get(data, EFL_TEXT_CURSOR_GET_TYPE_MAIN), pos); 1880 efl_text_cursor_position_set(efl_text_interactive_main_cursor_get(data), pos);
1873 efl_input_clickable_longpress_abort(data, 1); 1881 efl_input_clickable_longpress_abort(data, 1);
1874 sd->long_pressed = EINA_FALSE; 1882 sd->long_pressed = EINA_FALSE;
1875} 1883}
@@ -2195,7 +2203,7 @@ _efl_ui_text_efl_object_finalize(Eo *obj,
2195 _efl_ui_text_changed_cb, obj); 2203 _efl_ui_text_changed_cb, obj);
2196 efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED, 2204 efl_event_callback_add(sd->text_obj, EFL_TEXT_INTERACTIVE_EVENT_TEXT_SELECTION_CHANGED,
2197 _efl_ui_text_selection_changed_cb, obj); 2205 _efl_ui_text_selection_changed_cb, obj);
2198 efl_event_callback_add(sd->text_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, 2206 efl_event_callback_add(efl_text_interactive_main_cursor_get(sd->text_obj), EFL_TEXT_CURSOR_EVENT_CHANGED,
2199 _efl_ui_text_cursor_changed_cb, obj); 2207 _efl_ui_text_cursor_changed_cb, obj);
2200 efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, 2208 efl_event_callback_add(sd->text_obj, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED,
2201 _text_position_changed_cb, obj); 2209 _text_position_changed_cb, obj);
@@ -2353,12 +2361,12 @@ _efl_ui_text_calc_force(Eo *obj, Efl_Ui_Text_Data *sd)
2353static const char* 2361static const char*
2354_efl_ui_text_selection_get(const Eo *obj, Efl_Ui_Text_Data *sd) 2362_efl_ui_text_selection_get(const Eo *obj, Efl_Ui_Text_Data *sd)
2355{ 2363{
2356 Efl_Text_Cursor_Cursor *start_obj, *end_obj; 2364 Efl_Text_Cursor *start_obj, *end_obj;
2357 2365
2358 if ((sd->password)) return NULL; 2366 if ((sd->password)) return NULL;
2359 2367
2360 efl_text_interactive_selection_cursors_get(obj, &start_obj, &end_obj); 2368 efl_text_interactive_selection_cursors_get(obj, &start_obj, &end_obj);
2361 return efl_canvas_text_range_text_get(obj, start_obj, end_obj); 2369 return efl_text_cursor_range_text_get(start_obj, end_obj);
2362} 2370}
2363 2371
2364EOLIAN static void 2372EOLIAN static void
@@ -2377,13 +2385,27 @@ _efl_ui_text_selection_handler_disabled_get(const Eo *obj EINA_UNUSED, Efl_Ui_Te
2377static void 2385static void
2378_efl_ui_text_entry_insert(Eo *obj, Efl_Ui_Text_Data *sd, const char *entry) 2386_efl_ui_text_entry_insert(Eo *obj, Efl_Ui_Text_Data *sd, const char *entry)
2379{ 2387{
2380 Efl_Text_Cursor_Cursor *cur_obj = efl_text_cursor_get(obj, EFL_TEXT_CURSOR_GET_TYPE_MAIN); 2388 Efl_Text_Cursor *cur_obj = efl_text_interactive_main_cursor_get(obj);
2381 efl_text_cursor_text_insert(obj, cur_obj, entry); 2389 efl_text_cursor_text_insert(cur_obj, entry);
2382 sd->text_changed = EINA_TRUE; 2390 sd->text_changed = EINA_TRUE;
2383 efl_canvas_group_change(obj); 2391 efl_canvas_group_change(obj);
2384} 2392}
2385 2393
2386EOLIAN static void 2394EOLIAN static void