summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Hirt <hirt.danny@gmail.com>2017-09-04 19:16:27 +0300
committerDaniel Hirt <hirt.danny@gmail.com>2017-09-20 14:50:09 +0300
commitb63c3620dff8930f4ad029351c6d455414062c02 (patch)
treef25c7dd8d70e2e787b89326fc8ad7f2a7a90274c
parentb1d831c5525e47a849fcfaa361dc510567849d5c (diff)
Canvas text async: add async layout functionality
This adds the 'async_layout' method. The 'async layout' method is similar to 'size_formatted_get', but done outside of the mainloop. When a call is made to this method, a thread is created (after some preparation like updating the logical text items), and the visual layout is offloaded to that thread. The result is returned as Eina.Future. The mainloop is blocked for operations that manipulate the object, if a thread has already been created but hasn't complete its work. Consecutive calls for async layout for the same object are not handled simultaneously. Each time the threads has complete its work, the next (if exists) layout will be dispatched. @feature
-rw-r--r--src/lib/evas/canvas/efl_canvas_text.eo10
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c559
2 files changed, 419 insertions, 150 deletions
diff --git a/src/lib/evas/canvas/efl_canvas_text.eo b/src/lib/evas/canvas/efl_canvas_text.eo
index 0cbe8e1031..7d7b0f9b33 100644
--- a/src/lib/evas/canvas/efl_canvas_text.eo
+++ b/src/lib/evas/canvas/efl_canvas_text.eo
@@ -252,6 +252,16 @@ Efl.Text.Font, Efl.Text.Style, Efl.Text.Format, Efl.Text.Cursor, Efl.Text.Annota
252 @since 1.18 252 @since 1.18
253 ]] 253 ]]
254 } 254 }
255 async_layout {
256 [[Requests to layout the text off the mainloop.
257
258 Once layout is complete, the result is returned as @Eina.Rect,
259 with w, h fields set.
260
261 @since 1.21
262 ]]
263 return: ptr(Eina.Future) @owned; [[Future for layout result]]
264 }
255 } 265 }
256 implements { 266 implements {
257 Efl.Object.constructor; 267 Efl.Object.constructor;
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 20b0a7913a..b63362a185 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -579,8 +579,19 @@ struct _Efl_Text_Annotate_Annotation
579 579
580/* Size of the index array */ 580/* Size of the index array */
581#define TEXTBLOCK_PAR_INDEX_SIZE 10 581#define TEXTBLOCK_PAR_INDEX_SIZE 10
582
583#define ASYNC_BLOCK do { \
584 if (o->layout_th) \
585 { \
586 ecore_thread_wait(o->layout_th, 1); \
587 }} while(0)
588
589#include "Ecore.h"
590
582struct _Evas_Object_Textblock 591struct _Evas_Object_Textblock
583{ 592{
593 Ecore_Thread *layout_th;
594 int layout_jobs;
584 Evas_Textblock_Style *style; 595 Evas_Textblock_Style *style;
585 Eina_List *styles; 596 Eina_List *styles;
586 Efl_Text_Cursor_Cursor *cursor; 597 Efl_Text_Cursor_Cursor *cursor;
@@ -2876,6 +2887,9 @@ struct _Ctxt
2876 int underline_extend; 2887 int underline_extend;
2877 int have_underline, have_underline2; 2888 int have_underline, have_underline2;
2878 double align, valign; 2889 double align, valign;
2890 struct {
2891 int l, r, t, b;
2892 } style_pad;
2879 Textblock_Position position; 2893 Textblock_Position position;
2880 Evas_Textblock_Align_Auto align_auto : 2; 2894 Evas_Textblock_Align_Auto align_auto : 2;
2881 Eina_Bool width_changed : 1; 2895 Eina_Bool width_changed : 1;
@@ -6118,12 +6132,17 @@ _layout_split_text_because_format(const Evas_Object_Textblock_Format *fmt,
6118 6132
6119/** FIXME: Document */ 6133/** FIXME: Document */
6120static void 6134static void
6121_layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t, 6135_layout_pre(Ctxt *c)
6122 int *style_pad_b)
6123{ 6136{
6137 int *style_pad_l, *style_pad_r, *style_pad_t, *style_pad_b;
6124 Evas_Object *eo_obj = c->obj; 6138 Evas_Object *eo_obj = c->obj;
6125 Efl_Canvas_Text_Data *o = c->o; 6139 Efl_Canvas_Text_Data *o = c->o;
6126 6140
6141 style_pad_l = &c->style_pad.l;
6142 style_pad_r = &c->style_pad.r;
6143 style_pad_b = &c->style_pad.b;
6144 style_pad_t = &c->style_pad.t;
6145
6127 /* Mark text nodes as dirty if format have changed. */ 6146 /* Mark text nodes as dirty if format have changed. */
6128 if (o->format_changed) 6147 if (o->format_changed)
6129 _format_changes_invalidate_text_nodes(c); 6148 _format_changes_invalidate_text_nodes(c);
@@ -6306,105 +6325,6 @@ _layout_pre(Ctxt *c, int *style_pad_l, int *style_pad_r, int *style_pad_t,
6306 if (o->style_pad.t > *style_pad_t) *style_pad_t = o->style_pad.t; 6325 if (o->style_pad.t > *style_pad_t) *style_pad_t = o->style_pad.t;
6307 if (o->style_pad.b > *style_pad_b) *style_pad_b = o->style_pad.b; 6326 if (o->style_pad.b > *style_pad_b) *style_pad_b = o->style_pad.b;
6308 } 6327 }
6309}
6310
6311/**
6312 * @internal
6313 * Create the layout from the nodes.
6314 *
6315 * @param obj the evas object - NOT NULL.
6316 * @param calc_only true if should only calc sizes false if should also create the layout.. It assumes native size is being calculated, doesn't support formatted size atm.
6317 * @param w the object's w, -1 means no wrapping (i.e infinite size)
6318 * @param h the object's h, -1 means inifinte size.
6319 * @param w_ret the object's calculated w.
6320 * @param h_ret the object's calculated h.
6321 */
6322static void
6323_layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6324{
6325 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
6326 Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
6327 Ctxt ctxt, *c;
6328 Evas *eo_e;
6329 int style_pad_l = 0, style_pad_r = 0, style_pad_t = 0, style_pad_b = 0;
6330
6331 LYDBG("ZZ: layout %p %4ix%4i | w=%4i | last_w=%4i --- '%s'\n", eo_obj, w, h, obj->cur->geometry.w, o->last_w, o->markup_text);
6332 /* setup context */
6333 c = &ctxt;
6334 c->obj = (Evas_Object *)eo_obj;
6335 c->o = o;
6336 c->paragraphs = c->par = NULL;
6337 c->format_stack = NULL;
6338 c->fmt = NULL;
6339 c->x = c->y = 0;
6340 c->w = w;
6341 c->h = h;
6342 c->wmax = c->hmax = 0;
6343 c->ascent = c->descent = 0;
6344 c->maxascent = c->maxdescent = 0;
6345 c->marginl = c->marginr = 0;
6346 c->have_underline = 0;
6347 c->have_underline2 = 0;
6348 c->underline_extend = 0;
6349 c->line_no = 0;
6350 c->align = 0.0;
6351 c->align_auto = EINA_TRUE;
6352 c->ln = NULL;
6353 c->width_changed = (obj->cur->geometry.w != o->last_w);
6354 c->obs_infos = NULL;
6355 c->hyphen_ti = NULL;
6356 c->handle_obstacles = EINA_FALSE;
6357
6358 /* Update all obstacles */
6359 if (c->o->obstacle_changed || c->width_changed)
6360 {
6361 _layout_obstacles_update(c);
6362 c->handle_obstacles = EINA_TRUE;
6363 }
6364
6365 c->evas_o = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
6366 eo_e = evas_object_evas_get(eo_obj);
6367 c->evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
6368
6369 /* Start of logical layout creation */
6370 /* setup default base style */
6371 {
6372 Eina_List *itr;
6373 Evas_Textblock_Style *style;
6374 Eina_Bool finalize = EINA_FALSE;
6375 if (!c->fmt)
6376 {
6377 c->fmt = _layout_format_push(c, NULL, NULL);
6378 finalize = EINA_TRUE;
6379 }
6380 if ((c->o->style) && (c->o->style->default_tag))
6381 {
6382 _format_fill(c->obj, c->fmt, c->o->style->default_tag);
6383 finalize = EINA_TRUE;
6384 }
6385
6386 EINA_LIST_FOREACH(c->o->styles, itr, style)
6387 {
6388 if ((style) && (style->default_tag))
6389 {
6390 _format_fill(c->obj, c->fmt, style->default_tag);
6391 finalize = EINA_TRUE;
6392 }
6393 }
6394
6395 if (finalize)
6396 _format_finalize(c->obj, c->fmt);
6397 }
6398 if (!c->fmt)
6399 {
6400 if (w_ret) *w_ret = 0;
6401 if (h_ret) *h_ret = 0;
6402 return;
6403 }
6404
6405 _layout_pre(c, &style_pad_l, &style_pad_r, &style_pad_t, &style_pad_b);
6406 c->paragraphs = o->paragraphs;
6407
6408 /* If there are no paragraphs, create the minimum needed, 6328 /* If there are no paragraphs, create the minimum needed,
6409 * if the last paragraph has no lines/text, create that as well */ 6329 * if the last paragraph has no lines/text, create that as well */
6410 if (!c->paragraphs) 6330 if (!c->paragraphs)
@@ -6422,13 +6342,16 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6422 ti->parent.text_pos = 0; 6342 ti->parent.text_pos = 0;
6423 _layout_text_add_logical_item(c, ti, NULL); 6343 _layout_text_add_logical_item(c, ti, NULL);
6424 } 6344 }
6425
6426 /* End of logical layout creation */ 6345 /* End of logical layout creation */
6346}
6427 6347
6348static void
6349_layout_visual(Ctxt *c)
6350{
6428 /* Start of visual layout creation */ 6351 /* Start of visual layout creation */
6429 { 6352 {
6430 Evas_Object_Textblock_Paragraph *last_vis_par = NULL; 6353 Evas_Object_Textblock_Paragraph *last_vis_par = NULL;
6431 int par_index_step = o->num_paragraphs / TEXTBLOCK_PAR_INDEX_SIZE; 6354 int par_index_step = c->o->num_paragraphs / TEXTBLOCK_PAR_INDEX_SIZE;
6432 int par_count = 1; /* Force it to take the first one */ 6355 int par_count = 1; /* Force it to take the first one */
6433 int par_index_pos = 0; 6356 int par_index_pos = 0;
6434 6357
@@ -6437,7 +6360,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6437 if (par_index_step == 0) par_index_step = 1; 6360 if (par_index_step == 0) par_index_step = 1;
6438 6361
6439 /* Clear all of the index */ 6362 /* Clear all of the index */
6440 memset(o->par_index, 0, sizeof(o->par_index)); 6363 memset(c->o->par_index, 0, sizeof(c->o->par_index));
6441 6364
6442 EINA_INLIST_FOREACH(c->paragraphs, c->par) 6365 EINA_INLIST_FOREACH(c->paragraphs, c->par)
6443 { 6366 {
@@ -6454,7 +6377,7 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6454 { 6377 {
6455 par_count = par_index_step; 6378 par_count = par_index_step;
6456 6379
6457 o->par_index[par_index_pos++] = c->par; 6380 c->o->par_index[par_index_pos++] = c->par;
6458 } 6381 }
6459 } 6382 }
6460 6383
@@ -6484,6 +6407,13 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6484 } 6407 }
6485 } 6408 }
6486 6409
6410}
6411
6412static void _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret);
6413
6414static void
6415_layout_done(Ctxt *c, Evas_Coord *w_ret, Evas_Coord *h_ret)
6416{
6487 /* Clean the rest of the format stack */ 6417 /* Clean the rest of the format stack */
6488 while (c->format_stack) 6418 while (c->format_stack)
6489 { 6419 {
@@ -6496,9 +6426,9 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6496 if (h_ret) *h_ret = c->hmax; 6426 if (h_ret) *h_ret = c->hmax;
6497 6427
6498 /* Vertically align the textblock */ 6428 /* Vertically align the textblock */
6499 if ((o->valign > 0.0) && (c->h > c->hmax)) 6429 if ((c->o->valign > 0.0) && (c->h > c->hmax))
6500 { 6430 {
6501 Evas_Coord adjustment = (c->h - c->hmax) * o->valign; 6431 Evas_Coord adjustment = (c->h - c->hmax) * c->o->valign;
6502 Evas_Object_Textblock_Paragraph *par; 6432 Evas_Object_Textblock_Paragraph *par;
6503 EINA_INLIST_FOREACH(c->paragraphs, par) 6433 EINA_INLIST_FOREACH(c->paragraphs, par)
6504 { 6434 {
@@ -6506,20 +6436,134 @@ _layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6506 } 6436 }
6507 } 6437 }
6508 6438
6509 if ((o->style_pad.l != style_pad_l) || (o->style_pad.r != style_pad_r) || 6439 if ((c->o->style_pad.l != c->style_pad.l) || (c->o->style_pad.r != c->style_pad.r) ||
6510 (o->style_pad.t != style_pad_t) || (o->style_pad.b != style_pad_b)) 6440 (c->o->style_pad.t != c->style_pad.t) || (c->o->style_pad.b != c->style_pad.b))
6511 { 6441 {
6512 o->style_pad.l = style_pad_l; 6442 c->o->style_pad.l = c->style_pad.l;
6513 o->style_pad.r = style_pad_r; 6443 c->o->style_pad.r = c->style_pad.r;
6514 o->style_pad.t = style_pad_t; 6444 c->o->style_pad.t = c->style_pad.t;
6515 o->style_pad.b = style_pad_b; 6445 c->o->style_pad.b = c->style_pad.b;
6516 _paragraphs_clear(c); 6446 _paragraphs_clear(c);
6517 LYDBG("ZZ: ... layout #2\n"); 6447 LYDBG("ZZ: ... layout #2\n");
6518 _layout(eo_obj, w, h, w_ret, h_ret); 6448 _layout(c->obj, c->w, c->h, w_ret, h_ret);
6519 efl_event_callback_call((Eo *) eo_obj, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, NULL); 6449 efl_event_callback_call(c->obj, EFL_CANVAS_TEXT_EVENT_STYLE_INSETS_CHANGED, NULL);
6450
6451 c->o->obstacle_changed = EINA_FALSE;
6452 }
6453}
6454
6455static Eina_Bool
6456_layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, Evas_Coord h)
6457{
6458 Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
6459 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
6460 Evas *eo_e;
6461 /* setup context */
6462 c->obj = (Evas_Object *)eo_obj;
6463 c->o = o;
6464 c->paragraphs = c->par = NULL;
6465 c->format_stack = NULL;
6466 c->fmt = NULL;
6467 c->x = c->y = 0;
6468 c->w = w;
6469 c->h = h;
6470 c->wmax = c->hmax = 0;
6471 c->ascent = c->descent = 0;
6472 c->maxascent = c->maxdescent = 0;
6473 c->marginl = c->marginr = 0;
6474 c->have_underline = 0;
6475 c->have_underline2 = 0;
6476 c->underline_extend = 0;
6477 c->line_no = 0;
6478 c->align = 0.0;
6479 c->align_auto = EINA_TRUE;
6480 c->ln = NULL;
6481 c->width_changed = (obj->cur->geometry.w != o->last_w);
6482 c->obs_infos = NULL;
6483 c->hyphen_ti = NULL;
6484 c->handle_obstacles = EINA_FALSE;
6485 c->w = w;
6486 c->h = h;
6487 c->style_pad.r = c->style_pad.l = c->style_pad.t = c->style_pad.b = 0;
6488
6489 /* Update all obstacles */
6490 if (c->o->obstacle_changed || c->width_changed)
6491 {
6492 _layout_obstacles_update(c);
6493 c->handle_obstacles = EINA_TRUE;
6494 }
6495
6496 c->evas_o = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
6497 eo_e = evas_object_evas_get(eo_obj);
6498 c->evas = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS);
6499
6500 /* Start of logical layout creation */
6501 /* setup default base style */
6502 {
6503 Eina_List *itr;
6504 Evas_Textblock_Style *style;
6505 Eina_Bool finalize = EINA_FALSE;
6506 if (!c->fmt)
6507 {
6508 c->fmt = _layout_format_push(c, NULL, NULL);
6509 finalize = EINA_TRUE;
6510 }
6511 if ((c->o->style) && (c->o->style->default_tag))
6512 {
6513 _format_fill(c->obj, c->fmt, c->o->style->default_tag);
6514 finalize = EINA_TRUE;
6515 }
6516
6517 EINA_LIST_FOREACH(c->o->styles, itr, style)
6518 {
6519 if ((style) && (style->default_tag))
6520 {
6521 _format_fill(c->obj, c->fmt, style->default_tag);
6522 finalize = EINA_TRUE;
6523 }
6524 }
6525
6526 if (finalize)
6527 _format_finalize(c->obj, c->fmt);
6528 }
6529 if (!c->fmt)
6530 {
6531 return EINA_FALSE;
6520 } 6532 }
6521 6533
6522 c->o->obstacle_changed = EINA_FALSE; 6534 c->paragraphs = o->paragraphs;
6535
6536 return EINA_TRUE;
6537}
6538
6539/**
6540 * @internal
6541 * Create the layout from the nodes.
6542 *
6543 * @param obj the evas object - NOT NULL.
6544 * @param calc_only true if should only calc sizes false if should also create the layout.. It assumes native size is being calculated, doesn't support formatted size atm.
6545 * @param w the object's w, -1 means no wrapping (i.e infinite size)
6546 * @param h the object's h, -1 means inifinte size.
6547 * @param w_ret the object's calculated w.
6548 * @param h_ret the object's calculated h.
6549 */
6550static void
6551_layout(const Evas_Object *eo_obj, int w, int h, int *w_ret, int *h_ret)
6552{
6553 Ctxt ctxt, *c;
6554 c = &ctxt;
6555
6556 LYDBG("ZZ: layout %p %4ix%4i | w=%4i | last_w=%4i --- '%s'\n", eo_obj, w, h, obj->cur->geometry.w, o->last_w, o->markup_text);
6557
6558 if (!_layout_setup(c, eo_obj, w, h))
6559 {
6560 if (w_ret) *w_ret = 0;
6561 if (h_ret) *h_ret = 0;
6562 return;
6563 }
6564 _layout_pre(c);
6565 _layout_visual(c);
6566 _layout_done(c, w_ret, h_ret);
6523} 6567}
6524 6568
6525/* 6569/*
@@ -6563,17 +6607,20 @@ _relayout(const Evas_Object *eo_obj)
6563 * @internal 6607 * @internal
6564 * Check if the object needs a relayout, and if so, execute it. 6608 * Check if the object needs a relayout, and if so, execute it.
6565 */ 6609 */
6566static inline void 6610static Eina_Bool
6567_relayout_if_needed(Evas_Object *eo_obj, const Efl_Canvas_Text_Data *o) 6611_relayout_if_needed(Evas_Object *eo_obj, Efl_Canvas_Text_Data *o)
6568{ 6612{
6613 ASYNC_BLOCK;
6569 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 6614 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
6570 6615
6571 evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data); 6616 evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
6572 if (!o->formatted.valid) 6617 if (o->formatted.valid)
6573 { 6618 {
6574 LYDBG("ZZ: relayout\n"); 6619 return EINA_TRUE;
6575 _relayout(eo_obj);
6576 } 6620 }
6621 LYDBG("ZZ: relayout\n");
6622 _relayout(eo_obj);
6623 return EINA_TRUE;
6577} 6624}
6578 6625
6579/** 6626/**
@@ -7949,12 +7996,12 @@ _layout_obstacles_update(Ctxt *c)
7949} 7996}
7950 7997
7951static Evas_Textblock_Obstacle * 7998static Evas_Textblock_Obstacle *
7952_obstacle_find(Efl_Canvas_Text_Data *obj, Eo *eo_obs) 7999_obstacle_find(Efl_Canvas_Text_Data *o, Eo *eo_obs)
7953{ 8000{
7954 Evas_Textblock_Obstacle *obs; 8001 Evas_Textblock_Obstacle *obs;
7955 Eina_List *i; 8002 Eina_List *i;
7956 8003
7957 EINA_LIST_FOREACH(obj->obstacles, i, obs) 8004 EINA_LIST_FOREACH(o->obstacles, i, obs)
7958 { 8005 {
7959 if (eo_obs == obs->eo_obs) 8006 if (eo_obs == obs->eo_obs)
7960 return obs; 8007 return obs;
@@ -7966,19 +8013,19 @@ void
7966_obstacle_del_cb(void *data, const Efl_Event *event) 8013_obstacle_del_cb(void *data, const Efl_Event *event)
7967{ 8014{
7968 Eo *eo_obj = data; 8015 Eo *eo_obj = data;
7969 Efl_Canvas_Text_Data *obj = efl_data_scope_get(eo_obj, MY_CLASS); 8016 Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS);
7970 Eina_List *i; 8017 Eina_List *i;
7971 Evas_Textblock_Obstacle *obs; 8018 Evas_Textblock_Obstacle *obs;
7972 8019
7973 EINA_LIST_FOREACH(obj->obstacles, i, obs) 8020 EINA_LIST_FOREACH(o->obstacles, i, obs)
7974 { 8021 {
7975 if (event->object == obs->eo_obs) 8022 if (event->object == obs->eo_obs)
7976 break; 8023 break;
7977 } 8024 }
7978 obj->obstacles = eina_list_remove_list(obj->obstacles, i); 8025 o->obstacles = eina_list_remove_list(o->obstacles, i);
7979 free(obs); 8026 free(obs);
7980 _evas_textblock_changed(obj, data); 8027 _evas_textblock_changed(o, data);
7981 obj->obstacle_changed = EINA_TRUE; 8028 o->obstacle_changed = EINA_TRUE;
7982} 8029}
7983 8030
7984static void 8031static void
@@ -7995,11 +8042,11 @@ _obstacle_free(Eo *eo_obj, Evas_Textblock_Obstacle *obs)
7995} 8042}
7996 8043
7997static void 8044static void
7998_obstacles_free(Eo *eo_obj, Efl_Canvas_Text_Data *obj) 8045_obstacles_free(Eo *eo_obj, Efl_Canvas_Text_Data *o)
7999{ 8046{
8000 Evas_Textblock_Obstacle *obs; 8047 Evas_Textblock_Obstacle *obs;
8001 8048
8002 EINA_LIST_FREE(obj->obstacles, obs) 8049 EINA_LIST_FREE(o->obstacles, obs)
8003 { 8050 {
8004 _obstacle_free(eo_obj, obs); 8051 _obstacle_free(eo_obj, obs);
8005 } 8052 }
@@ -8007,13 +8054,13 @@ _obstacles_free(Eo *eo_obj, Efl_Canvas_Text_Data *obj)
8007 8054
8008EOLIAN static Eina_Bool 8055EOLIAN static Eina_Bool
8009_efl_canvas_text_obstacle_add(Eo *eo_obj, 8056_efl_canvas_text_obstacle_add(Eo *eo_obj,
8010 Efl_Canvas_Text_Data *obj, Eo *eo_obs) 8057 Efl_Canvas_Text_Data *o, Eo *eo_obs)
8011{ 8058{
8012 Evas_Textblock_Obstacle *obs; 8059 Evas_Textblock_Obstacle *obs;
8013 8060
8014 if (!efl_isa(eo_obs, EFL_CANVAS_OBJECT_CLASS)) 8061 if (!efl_isa(eo_obs, EFL_CANVAS_OBJECT_CLASS))
8015 return EINA_FALSE; 8062 return EINA_FALSE;
8016 obs = _obstacle_find(obj, eo_obs); 8063 obs = _obstacle_find(o, eo_obs);
8017 if (obs) return EINA_FALSE; 8064 if (obs) return EINA_FALSE;
8018 8065
8019 obs = calloc(1, sizeof(Evas_Textblock_Obstacle)); 8066 obs = calloc(1, sizeof(Evas_Textblock_Obstacle));
@@ -8022,15 +8069,15 @@ _efl_canvas_text_obstacle_add(Eo *eo_obj,
8022 obs->eo_obs = eo_obs; 8069 obs->eo_obs = eo_obs;
8023 efl_event_callback_add(eo_obs, EFL_EVENT_DEL, _obstacle_del_cb, eo_obj); 8070 efl_event_callback_add(eo_obs, EFL_EVENT_DEL, _obstacle_del_cb, eo_obj);
8024 8071
8025 obj->obstacles = eina_list_append(obj->obstacles, obs); 8072 o->obstacles = eina_list_append(o->obstacles, obs);
8026 _obstacle_update(obs, eo_obj); 8073 _obstacle_update(obs, eo_obj);
8027 _evas_textblock_changed(obj, eo_obj); 8074 _evas_textblock_changed(o, eo_obj);
8028 obj->obstacle_changed = EINA_TRUE; 8075 o->obstacle_changed = EINA_TRUE;
8029 return EINA_TRUE; 8076 return EINA_TRUE;
8030} 8077}
8031 8078
8032EOLIAN static Eina_Bool 8079EOLIAN static Eina_Bool
8033_efl_canvas_text_obstacle_del(Eo *eo_obj, Efl_Canvas_Text_Data *obj, 8080_efl_canvas_text_obstacle_del(Eo *eo_obj, Efl_Canvas_Text_Data *o,
8034 Eo *eo_obs EINA_UNUSED) 8081 Eo *eo_obs EINA_UNUSED)
8035{ 8082{
8036 Evas_Textblock_Obstacle *obs; 8083 Evas_Textblock_Obstacle *obs;
@@ -8039,7 +8086,7 @@ _efl_canvas_text_obstacle_del(Eo *eo_obj, Efl_Canvas_Text_Data *obj,
8039 if (!efl_isa(eo_obs, EFL_CANVAS_OBJECT_CLASS)) 8086 if (!efl_isa(eo_obs, EFL_CANVAS_OBJECT_CLASS))
8040 return EINA_FALSE; 8087 return EINA_FALSE;
8041 8088
8042 EINA_LIST_FOREACH(obj->obstacles, i, obs) 8089 EINA_LIST_FOREACH(o->obstacles, i, obs)
8043 { 8090 {
8044 if (eo_obs == obs->eo_obs) 8091 if (eo_obs == obs->eo_obs)
8045 { 8092 {
@@ -8047,10 +8094,10 @@ _efl_canvas_text_obstacle_del(Eo *eo_obj, Efl_Canvas_Text_Data *obj,
8047 } 8094 }
8048 } 8095 }
8049 if (!i) return EINA_FALSE; 8096 if (!i) return EINA_FALSE;
8050 obj->obstacles = eina_list_remove_list(obj->obstacles, i); 8097 o->obstacles = eina_list_remove_list(o->obstacles, i);
8051 _obstacle_free(eo_obj, obs); 8098 _obstacle_free(eo_obj, obs);
8052 _evas_textblock_changed(obj, eo_obj); 8099 _evas_textblock_changed(o, eo_obj);
8053 obj->obstacle_changed = EINA_TRUE; 8100 o->obstacle_changed = EINA_TRUE;
8054 return EINA_TRUE; 8101 return EINA_TRUE;
8055} 8102}
8056 8103
@@ -8607,6 +8654,7 @@ evas_textblock_cursor_paragraph_first(Efl_Text_Cursor_Cursor *cur)
8607EOLIAN static void 8654EOLIAN static void
8608_efl_canvas_text_efl_text_cursor_cursor_paragraph_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 8655_efl_canvas_text_efl_text_cursor_cursor_paragraph_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
8609{ 8656{
8657 ASYNC_BLOCK;
8610 evas_textblock_cursor_paragraph_first(cur); 8658 evas_textblock_cursor_paragraph_first(cur);
8611 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8659 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8612} 8660}
@@ -8638,6 +8686,7 @@ evas_textblock_cursor_paragraph_last(Efl_Text_Cursor_Cursor *cur)
8638EOLIAN static void 8686EOLIAN static void
8639_efl_canvas_text_efl_text_cursor_cursor_paragraph_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 8687_efl_canvas_text_efl_text_cursor_cursor_paragraph_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
8640{ 8688{
8689 ASYNC_BLOCK;
8641 evas_textblock_cursor_paragraph_last(cur); 8690 evas_textblock_cursor_paragraph_last(cur);
8642 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8691 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8643} 8692}
@@ -8676,6 +8725,7 @@ evas_textblock_cursor_paragraph_next(Efl_Text_Cursor_Cursor *cur)
8676EOLIAN static void 8725EOLIAN static void
8677_efl_canvas_text_efl_text_cursor_cursor_paragraph_next(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Evas_Textblock_Cursor *cur) 8726_efl_canvas_text_efl_text_cursor_cursor_paragraph_next(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Evas_Textblock_Cursor *cur)
8678{ 8727{
8728 ASYNC_BLOCK;
8679 evas_textblock_cursor_paragraph_next(cur); 8729 evas_textblock_cursor_paragraph_next(cur);
8680 efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8730 efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8681} 8731}
@@ -8720,6 +8770,7 @@ EOLIAN static void
8720_efl_canvas_text_efl_text_cursor_cursor_paragraph_prev(Eo *obj EINA_UNUSED, 8770_efl_canvas_text_efl_text_cursor_cursor_paragraph_prev(Eo *obj EINA_UNUSED,
8721 Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 8771 Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
8722{ 8772{
8773 ASYNC_BLOCK;
8723 _evas_textblock_cursor_paragraph_prev(cur); 8774 _evas_textblock_cursor_paragraph_prev(cur);
8724 efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8775 efl_event_callback_legacy_call(obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8725} 8776}
@@ -8874,6 +8925,7 @@ evas_textblock_cursor_word_start(Efl_Text_Cursor_Cursor *cur)
8874EOLIAN static void 8925EOLIAN static void
8875_efl_canvas_text_efl_text_cursor_cursor_word_start(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED) 8926_efl_canvas_text_efl_text_cursor_cursor_word_start(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED)
8876{ 8927{
8928 ASYNC_BLOCK;
8877 evas_textblock_cursor_word_start(cur); 8929 evas_textblock_cursor_word_start(cur);
8878 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8930 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8879} 8931}
@@ -8935,6 +8987,7 @@ evas_textblock_cursor_word_end(Efl_Text_Cursor_Cursor *cur)
8935EOLIAN static void 8987EOLIAN static void
8936_efl_canvas_text_efl_text_cursor_cursor_word_end(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED) 8988_efl_canvas_text_efl_text_cursor_cursor_word_end(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED)
8937{ 8989{
8990 ASYNC_BLOCK;
8938 evas_textblock_cursor_word_end(cur); 8991 evas_textblock_cursor_word_end(cur);
8939 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 8992 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8940} 8993}
@@ -8982,6 +9035,7 @@ evas_textblock_cursor_char_next(Efl_Text_Cursor_Cursor *cur)
8982EOLIAN static void 9035EOLIAN static void
8983_efl_canvas_text_efl_text_cursor_cursor_char_next(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9036_efl_canvas_text_efl_text_cursor_cursor_char_next(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
8984{ 9037{
9038 ASYNC_BLOCK;
8985 evas_textblock_cursor_char_next(cur); 9039 evas_textblock_cursor_char_next(cur);
8986 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9040 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
8987} 9041}
@@ -9011,6 +9065,7 @@ evas_textblock_cursor_char_prev(Efl_Text_Cursor_Cursor *cur)
9011EOLIAN static void 9065EOLIAN static void
9012_efl_canvas_text_efl_text_cursor_cursor_char_prev(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9066_efl_canvas_text_efl_text_cursor_cursor_char_prev(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9013{ 9067{
9068 ASYNC_BLOCK;
9014 _evas_textblock_cursor_char_prev(cur); 9069 _evas_textblock_cursor_char_prev(cur);
9015 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9070 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9016} 9071}
@@ -9027,6 +9082,7 @@ evas_textblock_cursor_paragraph_char_first(Efl_Text_Cursor_Cursor *cur)
9027EOLIAN static void 9082EOLIAN static void
9028_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9083_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9029{ 9084{
9085 ASYNC_BLOCK;
9030 evas_textblock_cursor_paragraph_char_first(cur); 9086 evas_textblock_cursor_paragraph_char_first(cur);
9031 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9087 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9032} 9088}
@@ -9055,6 +9111,7 @@ evas_textblock_cursor_paragraph_char_last(Efl_Text_Cursor_Cursor *cur)
9055EOLIAN static void 9111EOLIAN static void
9056_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9112_efl_canvas_text_efl_text_cursor_cursor_paragraph_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9057{ 9113{
9114 ASYNC_BLOCK;
9058 evas_textblock_cursor_paragraph_char_last(cur); 9115 evas_textblock_cursor_paragraph_char_last(cur);
9059 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9116 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9060} 9117}
@@ -9160,6 +9217,7 @@ evas_textblock_cursor_line_char_last(Efl_Text_Cursor_Cursor *cur)
9160EOLIAN static void 9217EOLIAN static void
9161_efl_canvas_text_efl_text_cursor_cursor_line_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9218_efl_canvas_text_efl_text_cursor_cursor_line_char_last(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9162{ 9219{
9220 ASYNC_BLOCK;
9163 evas_textblock_cursor_line_char_last(cur); 9221 evas_textblock_cursor_line_char_last(cur);
9164 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9222 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9165} 9223}
@@ -9167,6 +9225,7 @@ _efl_canvas_text_efl_text_cursor_cursor_line_char_last(Eo *eo_obj, Efl_Canvas_Te
9167EOLIAN static void 9225EOLIAN static void
9168_efl_canvas_text_efl_text_cursor_cursor_line_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9226_efl_canvas_text_efl_text_cursor_cursor_line_char_first(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9169{ 9227{
9228 ASYNC_BLOCK;
9170 evas_textblock_cursor_line_char_first(cur); 9229 evas_textblock_cursor_line_char_first(cur);
9171 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9230 efl_event_callback_legacy_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9172} 9231}
@@ -9613,6 +9672,7 @@ _evas_textblock_node_format_pos_get(const Evas_Object_Textblock_Node_Format *fmt
9613EOLIAN static int 9672EOLIAN static int
9614_efl_canvas_text_efl_text_cursor_cursor_position_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 9673_efl_canvas_text_efl_text_cursor_cursor_position_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
9615{ 9674{
9675 ASYNC_BLOCK;
9616 Evas_Object_Textblock_Node_Text *n; 9676 Evas_Object_Textblock_Node_Text *n;
9617 size_t npos = 0; 9677 size_t npos = 0;
9618 9678
@@ -9687,6 +9747,7 @@ evas_textblock_cursor_pos_set(Efl_Text_Cursor_Cursor *cur, int _pos)
9687EOLIAN static void 9747EOLIAN static void
9688_efl_canvas_text_efl_text_cursor_cursor_position_set(Eo *cur_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, int _pos) 9748_efl_canvas_text_efl_text_cursor_cursor_position_set(Eo *cur_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur, int _pos)
9689{ 9749{
9750 ASYNC_BLOCK;
9690 evas_textblock_cursor_pos_set(cur, _pos); 9751 evas_textblock_cursor_pos_set(cur, _pos);
9691 efl_event_callback_legacy_call(cur_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL); 9752 efl_event_callback_legacy_call(cur_obj, EFL_CANVAS_TEXT_EVENT_CURSOR_CHANGED, NULL);
9692} 9753}
@@ -9715,6 +9776,7 @@ evas_textblock_cursor_line_set(Evas_Textblock_Cursor *cur, int line)
9715EOLIAN static void 9776EOLIAN static void
9716_efl_canvas_text_efl_text_cursor_cursor_line_jump_by(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED, int by) 9777_efl_canvas_text_efl_text_cursor_cursor_line_jump_by(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED, int by)
9717{ 9778{
9779 ASYNC_BLOCK;
9718 int ln; 9780 int ln;
9719 9781
9720 ln = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL) + by; 9782 ln = evas_textblock_cursor_line_geometry_get(cur, NULL, NULL, NULL, NULL) + by;
@@ -9792,6 +9854,7 @@ EOLIAN static int
9792_efl_canvas_text_efl_text_cursor_cursor_compare(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, 9854_efl_canvas_text_efl_text_cursor_cursor_compare(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
9793 const Efl_Text_Cursor_Cursor *cur1, const Efl_Text_Cursor_Cursor *cur2) 9855 const Efl_Text_Cursor_Cursor *cur1, const Efl_Text_Cursor_Cursor *cur2)
9794{ 9856{
9857 ASYNC_BLOCK;
9795 Evas_Object_Protected_Data *obj = efl_data_scope_get(cur1->obj, EFL_CANVAS_OBJECT_CLASS); 9858 Evas_Object_Protected_Data *obj = efl_data_scope_get(cur1->obj, EFL_CANVAS_OBJECT_CLASS);
9796 evas_object_async_block(obj); 9859 evas_object_async_block(obj);
9797 return evas_textblock_cursor_compare(cur1, cur2); 9860 return evas_textblock_cursor_compare(cur1, cur2);
@@ -9808,6 +9871,7 @@ evas_textblock_cursor_equal(const Evas_Textblock_Cursor *cur1,
9808EOLIAN static Eina_Bool 9871EOLIAN static Eina_Bool
9809_efl_canvas_text_efl_text_cursor_cursor_equal(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, const Efl_Text_Cursor_Cursor *cur2) 9872_efl_canvas_text_efl_text_cursor_cursor_equal(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, const Efl_Text_Cursor_Cursor *cur2)
9810{ 9873{
9874 ASYNC_BLOCK;
9811 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 9875 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
9812 evas_object_async_block(obj); 9876 evas_object_async_block(obj);
9813 return ((cur->node == cur2->node) && (cur->pos == cur2->pos)); 9877 return ((cur->node == cur2->node) && (cur->pos == cur2->pos));
@@ -9838,6 +9902,7 @@ static EOLIAN void
9838_efl_canvas_text_efl_text_cursor_cursor_copy(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, 9902_efl_canvas_text_efl_text_cursor_cursor_copy(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
9839 Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src) 9903 Efl_Text_Cursor_Cursor *dst, const Efl_Text_Cursor_Cursor *src)
9840{ 9904{
9905 ASYNC_BLOCK;
9841 if (!efl_text_cursor_equal(obj, dst, src)) 9906 if (!efl_text_cursor_equal(obj, dst, src))
9842 { 9907 {
9843 _evas_textblock_cursor_copy(dst, src); 9908 _evas_textblock_cursor_copy(dst, src);
@@ -10216,6 +10281,7 @@ _efl_canvas_text_efl_text_cursor_cursor_text_insert(Eo *eo_obj,
10216 Efl_Canvas_Text_Data *o, 10281 Efl_Canvas_Text_Data *o,
10217 Efl_Text_Cursor_Cursor *cur, const char *_text) 10282 Efl_Text_Cursor_Cursor *cur, const char *_text)
10218{ 10283{
10284 ASYNC_BLOCK;
10219 int len = _efl_canvas_text_cursor_text_append(cur, _text); 10285 int len = _efl_canvas_text_cursor_text_append(cur, _text);
10220 _evas_textblock_changed(o, eo_obj); 10286 _evas_textblock_changed(o, eo_obj);
10221 efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); 10287 efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
@@ -10642,6 +10708,7 @@ evas_textblock_cursor_char_delete(Efl_Text_Cursor_Cursor *cur)
10642EOLIAN static void 10708EOLIAN static void
10643_efl_canvas_text_efl_text_cursor_cursor_char_delete(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur) 10709_efl_canvas_text_efl_text_cursor_cursor_char_delete(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur)
10644{ 10710{
10711 ASYNC_BLOCK;
10645 evas_textblock_cursor_char_delete(cur); 10712 evas_textblock_cursor_char_delete(cur);
10646 efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); 10713 efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
10647} 10714}
@@ -10761,9 +10828,10 @@ _efl_canvas_text_range_delete(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *pd E
10761} 10828}
10762 10829
10763EOLIAN static Eina_Unicode 10830EOLIAN static Eina_Unicode
10764_efl_canvas_text_efl_text_cursor_cursor_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *pd EINA_UNUSED, 10831_efl_canvas_text_efl_text_cursor_cursor_content_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
10765 const Efl_Text_Cursor_Cursor *cur) 10832 const Efl_Text_Cursor_Cursor *cur)
10766{ 10833{
10834 ASYNC_BLOCK;
10767 return eina_ustrbuf_string_get(cur->node->unicode)[cur->pos]; 10835 return eina_ustrbuf_string_get(cur->node->unicode)[cur->pos];
10768} 10836}
10769 10837
@@ -11231,11 +11299,12 @@ evas_textblock_cursor_geometry_bidi_get(const Efl_Text_Cursor_Cursor *cur, Evas_
11231EOLIAN static Eina_Bool 11299EOLIAN static Eina_Bool
11232_efl_canvas_text_efl_text_cursor_cursor_geometry_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2) 11300_efl_canvas_text_efl_text_cursor_cursor_geometry_get(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const Efl_Text_Cursor_Cursor *cur, Efl_Text_Cursor_Cursor_Type ctype, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch, Evas_Coord *cx2, Evas_Coord *cy2, Evas_Coord *cw2, Evas_Coord *ch2)
11233{ 11301{
11302 ASYNC_BLOCK;
11234 if (!cur) return EINA_FALSE; 11303 if (!cur) return EINA_FALSE;
11235 Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS); 11304 Evas_Object_Protected_Data *obj = efl_data_scope_get(cur->obj, EFL_CANVAS_OBJECT_CLASS);
11236 evas_object_async_block(obj); 11305 evas_object_async_block(obj);
11237 11306
11238 _relayout_if_needed(cur->obj, o); 11307 if (!_relayout_if_needed(cur->obj, o)) return EINA_FALSE;
11239 11308
11240 if (ctype == EFL_TEXT_CURSOR_TYPE_UNDER) 11309 if (ctype == EFL_TEXT_CURSOR_TYPE_UNDER)
11241 { 11310 {
@@ -11823,6 +11892,7 @@ EOLIAN static void
11823_efl_canvas_text_efl_text_cursor_cursor_coord_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED, 11892_efl_canvas_text_efl_text_cursor_cursor_coord_set(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Cursor_Cursor *cur EINA_UNUSED,
11824 Evas_Coord x, Evas_Coord y) 11893 Evas_Coord x, Evas_Coord y)
11825{ 11894{
11895 ASYNC_BLOCK;
11826 evas_textblock_cursor_char_coord_set(cur, x, y); 11896 evas_textblock_cursor_char_coord_set(cur, x, y);
11827} 11897}
11828 11898
@@ -13170,6 +13240,8 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED,
13170 Evas_Object_Textblock_Item *itr; 13240 Evas_Object_Textblock_Item *itr;
13171 Evas_Object_Textblock_Line *ln, *cur_ln = NULL; 13241 Evas_Object_Textblock_Line *ln, *cur_ln = NULL;
13172 Efl_Canvas_Text_Data *o = type_private_data; 13242 Efl_Canvas_Text_Data *o = type_private_data;
13243 ASYNC_BLOCK;
13244
13173 Eina_List *shadows = NULL; 13245 Eina_List *shadows = NULL;
13174 Eina_List *glows = NULL; 13246 Eina_List *glows = NULL;
13175 Eina_List *outlines = NULL; 13247 Eina_List *outlines = NULL;
@@ -13195,11 +13267,16 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED,
13195 Plus, one more scenario is that the object isn't visible but actually is visible 13267 Plus, one more scenario is that the object isn't visible but actually is visible
13196 by evas_map. */ 13268 by evas_map. */
13197 if (o->changed || o->content_changed || o->format_changed || o->obstacle_changed) 13269 if (o->changed || o->content_changed || o->format_changed || o->obstacle_changed)
13270 {
13198 _relayout_if_needed(eo_obj, o); 13271 _relayout_if_needed(eo_obj, o);
13272 }
13199 13273
13200 /* If there are no paragraphs and thus there are no lines, 13274 /* If there are no paragraphs and thus there are no lines,
13201 * there's nothing left to do. */ 13275 * there's nothing left to do. */
13202 if (!o->paragraphs) return; 13276 if (!o->paragraphs)
13277 {
13278 return;
13279 }
13203 13280
13204 /* render object to surface with context, and offxet by x,y */ 13281 /* render object to surface with context, and offxet by x,y */
13205 ENFN->context_multiplier_unset(engine, context); 13282 ENFN->context_multiplier_unset(engine, context);
@@ -14150,6 +14227,8 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
14150 void *type_private_data) 14227 void *type_private_data)
14151{ 14228{
14152 Efl_Canvas_Text_Data *o = type_private_data; 14229 Efl_Canvas_Text_Data *o = type_private_data;
14230 ASYNC_BLOCK;
14231
14153 int is_v, was_v; 14232 int is_v, was_v;
14154 14233
14155 /* dont pre-render the obj twice! */ 14234 /* dont pre-render the obj twice! */
@@ -14162,11 +14241,19 @@ evas_object_textblock_render_pre(Evas_Object *eo_obj,
14162 /* then when this is done the object needs to figure if it changed and */ 14241 /* then when this is done the object needs to figure if it changed and */
14163 /* if so what and where and add the appropriate redraw textblocks */ 14242 /* if so what and where and add the appropriate redraw textblocks */
14164 14243
14165 evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data); 14244 //evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
14245 if (!_relayout_if_needed(eo_obj, o))
14246 {
14247 o->redraw = 0;
14248 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
14249 eo_obj, obj);
14250 is_v = evas_object_is_visible(eo_obj, obj);
14251 was_v = evas_object_was_visible(eo_obj, obj);
14252 goto done;
14253 }
14166 if (o->changed) 14254 if (o->changed)
14167 { 14255 {
14168 LYDBG("ZZ: relayout 16\n"); 14256 LYDBG("ZZ: relayout 16\n");
14169 _relayout(eo_obj);
14170 o->redraw = 0; 14257 o->redraw = 0;
14171 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes, 14258 evas_object_render_pre_prev_cur_add(&obj->layer->evas->clip_changes,
14172 eo_obj, obj); 14259 eo_obj, obj);
@@ -14259,7 +14346,8 @@ evas_object_textblock_render_post(Evas_Object *eo_obj EINA_UNUSED,
14259 Evas_Object_Protected_Data *obj, 14346 Evas_Object_Protected_Data *obj,
14260 void *type_private_data) 14347 void *type_private_data)
14261{ 14348{
14262 /* Efl_Canvas_Text_Data *o; */ 14349 Efl_Canvas_Text_Data *o = type_private_data;
14350 ASYNC_BLOCK;
14263 14351
14264 /* this moves the current data to the previous state parts of the object */ 14352 /* this moves the current data to the previous state parts of the object */
14265 /* in whatever way is safest for the object. also if we don't need object */ 14353 /* in whatever way is safest for the object. also if we don't need object */
@@ -14270,8 +14358,8 @@ evas_object_textblock_render_post(Evas_Object *eo_obj EINA_UNUSED,
14270 /* move cur to prev safely for object data */ 14358 /* move cur to prev safely for object data */
14271 evas_object_cur_prev(obj); 14359 evas_object_cur_prev(obj);
14272/* o->prev = o->cur; */ 14360/* o->prev = o->cur; */
14273 EINA_SAFETY_ON_NULL_RETURN(type_private_data); 14361 EINA_SAFETY_ON_NULL_RETURN(o);
14274 _filter_output_cache_prune(obj, type_private_data); 14362 _filter_output_cache_prune(obj, o);
14275} 14363}
14276 14364
14277static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj) 14365static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj)
@@ -14474,12 +14562,13 @@ _efl_canvas_text_cursor_text_append(Efl_Text_Cursor_Cursor *cur,
14474} 14562}
14475 14563
14476EOLIAN static void 14564EOLIAN static void
14477_efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o EINA_UNUSED, 14565_efl_canvas_text_efl_text_text_set(Eo *eo_obj, Efl_Canvas_Text_Data *o,
14478 const char *text) 14566 const char *text)
14479{ 14567{
14568 ASYNC_BLOCK;
14480 evas_object_textblock_text_markup_set(eo_obj, ""); 14569 evas_object_textblock_text_markup_set(eo_obj, "");
14481 efl_text_cursor_text_insert(eo_obj, o->cursor, text); 14570 efl_text_cursor_text_insert(eo_obj, o->cursor, text);
14482 efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); 14571 //efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL);
14483} 14572}
14484 14573
14485static char * 14574static char *
@@ -14639,6 +14728,7 @@ _efl_canvas_text_efl_text_annotate_annotation_set(Eo *eo_obj,
14639 Efl_Canvas_Text_Data *o, Efl_Text_Annotate_Annotation *annotation, 14728 Efl_Canvas_Text_Data *o, Efl_Text_Annotate_Annotation *annotation,
14640 const char *format) 14729 const char *format)
14641{ 14730{
14731 ASYNC_BLOCK;
14642 Efl_Text_Cursor_Cursor start, end; 14732 Efl_Text_Cursor_Cursor start, end;
14643 Eina_Bool ret = EINA_TRUE; 14733 Eina_Bool ret = EINA_TRUE;
14644 14734
@@ -14709,6 +14799,7 @@ EOLIAN static Eina_Bool
14709_efl_canvas_text_efl_text_annotate_annotation_del(Eo *eo_obj EINA_UNUSED, 14799_efl_canvas_text_efl_text_annotate_annotation_del(Eo *eo_obj EINA_UNUSED,
14710 Efl_Canvas_Text_Data *o, Efl_Text_Annotate_Annotation *annotation) 14800 Efl_Canvas_Text_Data *o, Efl_Text_Annotate_Annotation *annotation)
14711{ 14801{
14802 ASYNC_BLOCK;
14712 if (!annotation || (annotation->obj != eo_obj)) 14803 if (!annotation || (annotation->obj != eo_obj))
14713 { 14804 {
14714 ERR("Used invalid handle or of a different object"); 14805 ERR("Used invalid handle or of a different object");
@@ -14799,6 +14890,7 @@ _efl_canvas_text_efl_text_annotate_annotation_insert(Eo *eo_obj, Efl_Canvas_Text
14799 Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end, 14890 Efl_Text_Cursor_Cursor *start, Efl_Text_Cursor_Cursor *end,
14800 const char *format) 14891 const char *format)
14801{ 14892{
14893 ASYNC_BLOCK;
14802 Efl_Text_Annotate_Annotation *ret; 14894 Efl_Text_Annotate_Annotation *ret;
14803 14895
14804 ret = _textblock_annotation_insert(eo_obj, o, start, end, format, 14896 ret = _textblock_annotation_insert(eo_obj, o, start, end, format,
@@ -14902,6 +14994,7 @@ _canvas_text_format_changed(Eo *eo_obj, Efl_Canvas_Text_Data *o)
14902static void 14994static void
14903_efl_canvas_text_efl_text_font_font_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char *font EINA_UNUSED, int size EINA_UNUSED) 14995_efl_canvas_text_efl_text_font_font_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char *font EINA_UNUSED, int size EINA_UNUSED)
14904{ 14996{
14997 ASYNC_BLOCK;
14905 Eina_Bool changed = EINA_FALSE; 14998 Eina_Bool changed = EINA_FALSE;
14906 14999
14907 Eina_Stringshare *nfont; 15000 Eina_Stringshare *nfont;
@@ -15039,6 +15132,7 @@ _efl_canvas_text_efl_text_font_font_weight_get(Eo *obj EINA_UNUSED, Efl_Canvas_T
15039static void 15132static void
15040_efl_canvas_text_efl_text_font_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Font_Slant font_slant EINA_UNUSED) 15133_efl_canvas_text_efl_text_font_font_slant_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Font_Slant font_slant EINA_UNUSED)
15041{ 15134{
15135 ASYNC_BLOCK;
15042 if (_FMT_INFO(font_slant) == font_slant) return; 15136 if (_FMT_INFO(font_slant) == font_slant) return;
15043 _FMT_INFO(font_slant) = font_slant; 15137 _FMT_INFO(font_slant) = font_slant;
15044 _canvas_text_format_changed(obj, o); 15138 _canvas_text_format_changed(obj, o);
@@ -15053,6 +15147,7 @@ _efl_canvas_text_efl_text_font_font_slant_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te
15053static void 15147static void
15054_efl_canvas_text_efl_text_font_font_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Font_Width font_width EINA_UNUSED) 15148_efl_canvas_text_efl_text_font_font_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Font_Width font_width EINA_UNUSED)
15055{ 15149{
15150 ASYNC_BLOCK;
15056 if (_FMT_INFO(font_width) == font_width) return; 15151 if (_FMT_INFO(font_width) == font_width) return;
15057 _FMT_INFO(font_width) = font_width; 15152 _FMT_INFO(font_width) = font_width;
15058 _canvas_text_format_changed(obj, o); 15153 _canvas_text_format_changed(obj, o);
@@ -15102,6 +15197,7 @@ _efl_canvas_text_efl_text_font_font_width_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te
15102static void 15197static void
15103_efl_canvas_text_efl_text_style_normal_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15198_efl_canvas_text_efl_text_style_normal_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15104{ 15199{
15200 ASYNC_BLOCK;
15105 _FMT_COLOR_SET(normal); 15201 _FMT_COLOR_SET(normal);
15106} 15202}
15107 15203
@@ -15114,6 +15210,7 @@ _efl_canvas_text_efl_text_style_normal_color_get(Eo *obj EINA_UNUSED, Efl_Canvas
15114static void 15210static void
15115_efl_canvas_text_efl_text_style_backing_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Backing_Type type EINA_UNUSED) 15211_efl_canvas_text_efl_text_style_backing_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Backing_Type type EINA_UNUSED)
15116{ 15212{
15213 ASYNC_BLOCK;
15117 _FMT_SET(backing, type); 15214 _FMT_SET(backing, type);
15118} 15215}
15119 15216
@@ -15126,6 +15223,7 @@ _efl_canvas_text_efl_text_style_backing_type_get(Eo *obj EINA_UNUSED, Efl_Canvas
15126static void 15223static void
15127_efl_canvas_text_efl_text_style_backing_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15224_efl_canvas_text_efl_text_style_backing_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15128{ 15225{
15226 ASYNC_BLOCK;
15129 _FMT_COLOR_SET(backing); 15227 _FMT_COLOR_SET(backing);
15130} 15228}
15131 15229
@@ -15138,6 +15236,7 @@ _efl_canvas_text_efl_text_style_backing_color_get(Eo *obj EINA_UNUSED, Efl_Canva
15138static void 15236static void
15139_efl_canvas_text_efl_text_style_underline_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED) 15237_efl_canvas_text_efl_text_style_underline_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED)
15140{ 15238{
15239 ASYNC_BLOCK;
15141 _FMT_SET(underline, type); 15240 _FMT_SET(underline, type);
15142} 15241}
15143 15242
@@ -15150,6 +15249,7 @@ _efl_canvas_text_efl_text_style_underline_type_get(Eo *obj EINA_UNUSED, Efl_Canv
15150static void 15249static void
15151_efl_canvas_text_efl_text_style_underline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15250_efl_canvas_text_efl_text_style_underline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15152{ 15251{
15252 ASYNC_BLOCK;
15153 _FMT_COLOR_SET(underline); 15253 _FMT_COLOR_SET(underline);
15154} 15254}
15155 15255
@@ -15162,6 +15262,7 @@ _efl_canvas_text_efl_text_style_underline_color_get(Eo *obj EINA_UNUSED, Efl_Can
15162static void 15262static void
15163_efl_canvas_text_efl_text_style_underline_height_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double height EINA_UNUSED) 15263_efl_canvas_text_efl_text_style_underline_height_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double height EINA_UNUSED)
15164{ 15264{
15265 ASYNC_BLOCK;
15165 _FMT_SET(underline_height, height); 15266 _FMT_SET(underline_height, height);
15166} 15267}
15167 15268
@@ -15174,6 +15275,7 @@ _efl_canvas_text_efl_text_style_underline_height_get(Eo *obj EINA_UNUSED, Efl_Ca
15174static void 15275static void
15175_efl_canvas_text_efl_text_style_underline_dashed_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15276_efl_canvas_text_efl_text_style_underline_dashed_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15176{ 15277{
15278 ASYNC_BLOCK;
15177 _FMT_COLOR_SET(underline_dash); 15279 _FMT_COLOR_SET(underline_dash);
15178} 15280}
15179 15281
@@ -15186,6 +15288,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_color_get(Eo *obj EINA_UNUSED,
15186static void 15288static void
15187_efl_canvas_text_efl_text_style_underline_dashed_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int width EINA_UNUSED) 15289_efl_canvas_text_efl_text_style_underline_dashed_width_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int width EINA_UNUSED)
15188{ 15290{
15291 ASYNC_BLOCK;
15189 _FMT_SET(underline_dash_width, width); 15292 _FMT_SET(underline_dash_width, width);
15190} 15293}
15191 15294
@@ -15198,6 +15301,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_width_get(Eo *obj EINA_UNUSED,
15198static void 15301static void
15199_efl_canvas_text_efl_text_style_underline_dashed_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int gap EINA_UNUSED) 15302_efl_canvas_text_efl_text_style_underline_dashed_gap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int gap EINA_UNUSED)
15200{ 15303{
15304 ASYNC_BLOCK;
15201 _FMT_SET(underline_dash_gap, gap); 15305 _FMT_SET(underline_dash_gap, gap);
15202} 15306}
15203 15307
@@ -15210,6 +15314,7 @@ _efl_canvas_text_efl_text_style_underline_dashed_gap_get(Eo *obj EINA_UNUSED, Ef
15210static void 15314static void
15211_efl_canvas_text_efl_text_style_underline2_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED) 15315_efl_canvas_text_efl_text_style_underline2_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Underline_Type type EINA_UNUSED)
15212{ 15316{
15317 ASYNC_BLOCK;
15213 _FMT_SET(underline2, type); 15318 _FMT_SET(underline2, type);
15214} 15319}
15215 15320
@@ -15222,6 +15327,7 @@ _efl_canvas_text_efl_text_style_underline2_type_get(Eo *obj EINA_UNUSED, Efl_Can
15222static void 15327static void
15223_efl_canvas_text_efl_text_style_underline2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15328_efl_canvas_text_efl_text_style_underline2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15224{ 15329{
15330 ASYNC_BLOCK;
15225 _FMT_COLOR_SET(underline2); 15331 _FMT_COLOR_SET(underline2);
15226} 15332}
15227 15333
@@ -15234,6 +15340,7 @@ _efl_canvas_text_efl_text_style_underline2_color_get(Eo *obj EINA_UNUSED, Efl_Ca
15234static void 15340static void
15235_efl_canvas_text_efl_text_style_strikethrough_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Strikethrough_Type type EINA_UNUSED) 15341_efl_canvas_text_efl_text_style_strikethrough_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Strikethrough_Type type EINA_UNUSED)
15236{ 15342{
15343 ASYNC_BLOCK;
15237 _FMT_SET(strikethrough, type); 15344 _FMT_SET(strikethrough, type);
15238} 15345}
15239 15346
@@ -15246,6 +15353,7 @@ _efl_canvas_text_efl_text_style_strikethrough_type_get(Eo *obj EINA_UNUSED, Efl_
15246static void 15353static void
15247_efl_canvas_text_efl_text_style_strikethrough_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15354_efl_canvas_text_efl_text_style_strikethrough_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15248{ 15355{
15356 ASYNC_BLOCK;
15249 _FMT_COLOR_SET(strikethrough); 15357 _FMT_COLOR_SET(strikethrough);
15250} 15358}
15251 15359
@@ -15290,6 +15398,7 @@ static const struct
15290static void 15398static void
15291_efl_canvas_text_efl_text_style_effect_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Effect_Type type EINA_UNUSED) 15399_efl_canvas_text_efl_text_style_effect_type_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Effect_Type type EINA_UNUSED)
15292{ 15400{
15401 ASYNC_BLOCK;
15293 _FMT_INFO_SET_START(effect, type); 15402 _FMT_INFO_SET_START(effect, type);
15294 _FMT(style) = _map_style_effect[type].y; 15403 _FMT(style) = _map_style_effect[type].y;
15295 // Re-apply shadow direction 15404 // Re-apply shadow direction
@@ -15306,6 +15415,7 @@ _efl_canvas_text_efl_text_style_effect_type_get(Eo *obj EINA_UNUSED, Efl_Canvas_
15306static void 15415static void
15307_efl_canvas_text_efl_text_style_outline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15416_efl_canvas_text_efl_text_style_outline_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15308{ 15417{
15418 ASYNC_BLOCK;
15309 _FMT_COLOR_SET(outline); 15419 _FMT_COLOR_SET(outline);
15310} 15420}
15311 15421
@@ -15318,6 +15428,7 @@ _efl_canvas_text_efl_text_style_outline_color_get(Eo *obj EINA_UNUSED, Efl_Canva
15318static void 15428static void
15319_efl_canvas_text_efl_text_style_shadow_direction_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Shadow_Direction type EINA_UNUSED) 15429_efl_canvas_text_efl_text_style_shadow_direction_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Style_Shadow_Direction type EINA_UNUSED)
15320{ 15430{
15431 ASYNC_BLOCK;
15321 _FMT_INFO_SET_START(shadow_direction, type); 15432 _FMT_INFO_SET_START(shadow_direction, type);
15322 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(_FMT(style), _map_shadow_dir[type].y); 15433 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(_FMT(style), _map_shadow_dir[type].y);
15323 _FMT_INFO_SET_END(); 15434 _FMT_INFO_SET_END();
@@ -15332,6 +15443,7 @@ _efl_canvas_text_efl_text_style_shadow_direction_get(Eo *obj EINA_UNUSED, Efl_Ca
15332static void 15443static void
15333_efl_canvas_text_efl_text_style_shadow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15444_efl_canvas_text_efl_text_style_shadow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15334{ 15445{
15446 ASYNC_BLOCK;
15335 _FMT_COLOR_SET(shadow); 15447 _FMT_COLOR_SET(shadow);
15336} 15448}
15337 15449
@@ -15344,6 +15456,7 @@ _efl_canvas_text_efl_text_style_shadow_color_get(Eo *obj EINA_UNUSED, Efl_Canvas
15344static void 15456static void
15345_efl_canvas_text_efl_text_style_glow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15457_efl_canvas_text_efl_text_style_glow_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15346{ 15458{
15459 ASYNC_BLOCK;
15347 _FMT_COLOR_SET(glow); 15460 _FMT_COLOR_SET(glow);
15348} 15461}
15349 15462
@@ -15356,6 +15469,7 @@ _efl_canvas_text_efl_text_style_glow_color_get(Eo *obj EINA_UNUSED, Efl_Canvas_T
15356static void 15469static void
15357_efl_canvas_text_efl_text_style_glow2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED) 15470_efl_canvas_text_efl_text_style_glow2_color_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, unsigned char r EINA_UNUSED, unsigned char g EINA_UNUSED, unsigned char b EINA_UNUSED, unsigned char a EINA_UNUSED)
15358{ 15471{
15472 ASYNC_BLOCK;
15359 _FMT_COLOR_SET(glow2); 15473 _FMT_COLOR_SET(glow2);
15360} 15474}
15361 15475
@@ -15369,6 +15483,7 @@ static void
15369_efl_canvas_text_efl_text_style_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, 15483_efl_canvas_text_efl_text_style_gfx_filter_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED,
15370 const char *gfx_filter_name) 15484 const char *gfx_filter_name)
15371{ 15485{
15486 ASYNC_BLOCK;
15372 Eina_Stringshare *ngfx_filter_name; 15487 Eina_Stringshare *ngfx_filter_name;
15373 15488
15374 if (_FMT_INFO(gfx_filter_name) != gfx_filter_name) 15489 if (_FMT_INFO(gfx_filter_name) != gfx_filter_name)
@@ -15397,6 +15512,7 @@ _efl_canvas_text_efl_text_style_gfx_filter_get(Eo *obj EINA_UNUSED, Efl_Canvas_T
15397static void 15512static void
15398_efl_canvas_text_efl_text_format_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED) 15513_efl_canvas_text_efl_text_format_ellipsis_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED)
15399{ 15514{
15515 ASYNC_BLOCK;
15400 _FMT_SET(ellipsis, value); 15516 _FMT_SET(ellipsis, value);
15401} 15517}
15402 15518
@@ -15409,6 +15525,7 @@ _efl_canvas_text_efl_text_format_ellipsis_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te
15409static void 15525static void
15410_efl_canvas_text_efl_text_format_wrap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Format_Wrap wrap EINA_UNUSED) 15526_efl_canvas_text_efl_text_format_wrap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Efl_Text_Format_Wrap wrap EINA_UNUSED)
15411{ 15527{
15528 ASYNC_BLOCK;
15412 _FMT_INFO_SET_START(wrap, wrap); 15529 _FMT_INFO_SET_START(wrap, wrap);
15413 _FMT(wrap_word) = (wrap == EFL_TEXT_FORMAT_WRAP_WORD); 15530 _FMT(wrap_word) = (wrap == EFL_TEXT_FORMAT_WRAP_WORD);
15414 _FMT(wrap_char) = (wrap == EFL_TEXT_FORMAT_WRAP_CHAR); 15531 _FMT(wrap_char) = (wrap == EFL_TEXT_FORMAT_WRAP_CHAR);
@@ -15426,6 +15543,7 @@ _efl_canvas_text_efl_text_format_wrap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text_D
15426static void 15543static void
15427_efl_canvas_text_efl_text_format_multiline_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Eina_Bool enabled EINA_UNUSED) 15544_efl_canvas_text_efl_text_format_multiline_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Eina_Bool enabled EINA_UNUSED)
15428{ 15545{
15546 ASYNC_BLOCK;
15429 if (o->multiline == enabled) return; 15547 if (o->multiline == enabled) return;
15430 o->multiline = enabled; 15548 o->multiline = enabled;
15431 _canvas_text_format_changed(obj, o); 15549 _canvas_text_format_changed(obj, o);
@@ -15440,6 +15558,7 @@ _efl_canvas_text_efl_text_format_multiline_get(Eo *obj EINA_UNUSED, Efl_Canvas_T
15440static void 15558static void
15441_efl_canvas_text_efl_text_format_halign_set(Eo *obj, Efl_Canvas_Text_Data *o, Efl_Text_Format_Horizontal_Alignment_Type type) 15559_efl_canvas_text_efl_text_format_halign_set(Eo *obj, Efl_Canvas_Text_Data *o, Efl_Text_Format_Horizontal_Alignment_Type type)
15442{ 15560{
15561 ASYNC_BLOCK;
15443 if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO) 15562 if (type == EFL_TEXT_HORIZONTAL_ALIGNMENT_AUTO)
15444 { 15563 {
15445 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL); 15564 _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL);
@@ -15494,6 +15613,7 @@ static void
15494_efl_canvas_text_efl_text_format_valign_set(Eo *obj, Efl_Canvas_Text_Data *o, 15613_efl_canvas_text_efl_text_format_valign_set(Eo *obj, Efl_Canvas_Text_Data *o,
15495 Efl_Text_Format_Vertical_Alignment_Type type) 15614 Efl_Text_Format_Vertical_Alignment_Type type)
15496{ 15615{
15616 ASYNC_BLOCK;
15497 double value = 0.0; // EFL_TEXT_VERTICAL_ALIGNMENT_TOP 15617 double value = 0.0; // EFL_TEXT_VERTICAL_ALIGNMENT_TOP
15498 if (type == EFL_TEXT_VERTICAL_ALIGNMENT_CENTER) 15618 if (type == EFL_TEXT_VERTICAL_ALIGNMENT_CENTER)
15499 { 15619 {
@@ -15519,6 +15639,7 @@ _efl_canvas_text_efl_text_format_valign_get(Eo *obj EINA_UNUSED, Efl_Canvas_Text
15519static void 15639static void
15520_efl_canvas_text_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED) 15640_efl_canvas_text_efl_text_format_linegap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED)
15521{ 15641{
15642 ASYNC_BLOCK;
15522 double linerelgap = _FMT(linerelgap); 15643 double linerelgap = _FMT(linerelgap);
15523 _FMT(linerelgap) = 0.0; 15644 _FMT(linerelgap) = 0.0;
15524 15645
@@ -15543,6 +15664,7 @@ _efl_canvas_text_efl_text_format_linegap_get(Eo *obj EINA_UNUSED, Efl_Canvas_Tex
15543static void 15664static void
15544_efl_canvas_text_efl_text_format_linerelgap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED) 15665_efl_canvas_text_efl_text_format_linerelgap_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, double value EINA_UNUSED)
15545{ 15666{
15667 ASYNC_BLOCK;
15546 double linegap = _FMT(linegap); 15668 double linegap = _FMT(linegap);
15547 _FMT(linegap) = 0.0; 15669 _FMT(linegap) = 0.0;
15548 15670
@@ -15566,6 +15688,7 @@ _efl_canvas_text_efl_text_format_linerelgap_get(Eo *obj EINA_UNUSED, Efl_Canvas_
15566static void 15688static void
15567_efl_canvas_text_efl_text_format_tabstops_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int value EINA_UNUSED) 15689_efl_canvas_text_efl_text_format_tabstops_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, int value EINA_UNUSED)
15568{ 15690{
15691 ASYNC_BLOCK;
15569 _FMT_SET(tabstops, value); 15692 _FMT_SET(tabstops, value);
15570} 15693}
15571 15694
@@ -15578,6 +15701,7 @@ _efl_canvas_text_efl_text_format_tabstops_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te
15578static void 15701static void
15579_efl_canvas_text_efl_text_format_password_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Eina_Bool enabled EINA_UNUSED) 15702_efl_canvas_text_efl_text_format_password_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, Eina_Bool enabled EINA_UNUSED)
15580{ 15703{
15704 ASYNC_BLOCK;
15581 _FMT_SET(password, enabled); 15705 _FMT_SET(password, enabled);
15582} 15706}
15583 15707
@@ -15590,6 +15714,7 @@ _efl_canvas_text_efl_text_format_password_get(Eo *obj EINA_UNUSED, Efl_Canvas_Te
15590static void 15714static void
15591_efl_canvas_text_efl_text_format_replacement_char_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char *repch EINA_UNUSED) 15715_efl_canvas_text_efl_text_format_replacement_char_set(Eo *obj EINA_UNUSED, Efl_Canvas_Text_Data *o EINA_UNUSED, const char *repch EINA_UNUSED)
15592{ 15716{
15717 ASYNC_BLOCK;
15593 Eina_Stringshare *nrepch; 15718 Eina_Stringshare *nrepch;
15594 if (o->repch != repch) 15719 if (o->repch != repch)
15595 { 15720 {
@@ -15761,4 +15886,138 @@ _efl_canvas_text_efl_text_cursor_cursor_free(Eo *eo_obj EINA_UNUSED, Efl_Canvas_
15761 evas_textblock_cursor_free(cur); 15886 evas_textblock_cursor_free(cur);
15762} 15887}
15763 15888
15889/* Async Layout */
15890
15891typedef struct _Text_Promise_Ctx Text_Promise_Ctx;
15892struct _Text_Promise_Ctx
15893{
15894 int ret;
15895 Ctxt *c;
15896 Evas_Coord style_pad_l, style_pad_r, style_pad_t, style_pad_b;
15897 Evas_Coord *w_ret, *h_ret;
15898 Eina_Promise *p;
15899 Eina_Value *v;
15900};
15901
15902static void
15903_text_layout_async_do(void *todo, Ecore_Thread *thread EINA_UNUSED)
15904{
15905 Text_Promise_Ctx *td = todo;
15906 _layout_visual(td->c);
15907}
15908
15909static void
15910_resolve_async(Text_Promise_Ctx *td, Evas_Coord w, Evas_Coord h)
15911{
15912 Eina_Value v;
15913 Eina_Rectangle r = { 0, 0, w, h };
15914 eina_value_setup(&v, EINA_VALUE_TYPE_RECTANGLE);
15915 eina_value_pset(&v, &r);
15916 eina_promise_resolve(td->p, v);
15917 free(td);
15918}
15919
15920static void
15921_text_layout_async_done(void *todo, Ecore_Thread *thread EINA_UNUSED)
15922{
15923 Text_Promise_Ctx *td = todo;
15924 Ctxt *c = td->c;
15925 Eo *obj = c->obj;
15926 Efl_Canvas_Text_Data *o = c->o;
15927 Evas_Coord w_ret, h_ret;
15928 _layout_done(c, &w_ret, &h_ret);
15929
15930 c->o->formatted.valid = 1;
15931 c->o->formatted.oneline_h = 0;
15932 c->o->last_w = c->evas_o->cur->geometry.w;
15933 c->o->wrap_changed = EINA_FALSE;
15934 c->o->last_h = c->evas_o->cur->geometry.h;
15935 if ((c->o->paragraphs) && (!EINA_INLIST_GET(c->o->paragraphs)->next) &&
15936 (c->o->paragraphs->lines) && (!EINA_INLIST_GET(c->o->paragraphs->lines)->next))
15937 {
15938 if (c->evas_o->cur->geometry.h < c->o->formatted.h)
15939 {
15940 c->o->formatted.oneline_h = c->o->formatted.h;
15941 }
15942 }
15943 c->o->changed = 0;
15944 c->o->content_changed = 0;
15945 c->o->format_changed = EINA_FALSE;
15946 c->o->redraw = 1;
15947#ifdef BIDI_SUPPORT
15948 c->o->changed_paragraph_direction = EINA_FALSE;
15949#endif
15950
15951 o->formatted.w = c->wmax;
15952 o->formatted.h = c->hmax;
15953 c->o->changed = EINA_TRUE;
15954 evas_object_change(c->obj, c->evas_o);
15955 free(c);
15956
15957 _resolve_async(td, o->formatted.w, o->formatted.h);
15958
15959 o->layout_th = NULL;
15960 o->layout_jobs--;
15961 if (o->layout_jobs > 0)
15962 {
15963 efl_canvas_text_async_layout(obj);
15964 }
15965}
15966
15967static void
15968_dummy_cancel(void *data EINA_UNUSED, const Eina_Promise *dead EINA_UNUSED)
15969{
15970}
15971
15972static Eina_Future_Scheduler *
15973_future_scheduler_get(void)
15974{
15975 return efl_loop_future_scheduler_get(ecore_main_loop_get());
15976}
15977
15978EOLIAN static Eina_Future *
15979_efl_canvas_text_async_layout(Eo *eo_obj EINA_UNUSED, Efl_Canvas_Text_Data *o)
15980{
15981 Ctxt *c;
15982 Eina_Promise *p;
15983 Eina_Future *f;
15984 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
15985
15986 Text_Promise_Ctx *ctx = calloc(1, sizeof(*ctx));
15987 p = eina_promise_new(_future_scheduler_get(), _dummy_cancel, ctx);
15988 if (!p)
15989 {
15990 CRI("Failed to allocate a promise");
15991 return NULL;
15992 }
15993 ctx->p = p;
15994 f = eina_future_new(p);
15995
15996 if (o->layout_th)
15997 {
15998 o->layout_jobs++;
15999 return f;
16000 }
16001 evas_object_textblock_coords_recalc(eo_obj, obj, obj->private_data);
16002 if (o->formatted.valid)
16003 {
16004 _resolve_async(ctx, o->formatted.w, o->formatted.w);
16005 return f;
16006 }
16007
16008 c = calloc(1, sizeof(*c));
16009 ctx->c = c;
16010
16011 if (!_layout_setup(c, eo_obj,
16012 obj->cur->geometry.w, obj->cur->geometry.h))
16013 {
16014 _resolve_async(ctx, 0, 0);
16015 return f;
16016 }
16017 _layout_pre(c);
16018 o->layout_th = ecore_thread_run(_text_layout_async_do, _text_layout_async_done,
16019 NULL, ctx);
16020 return f;
16021}
16022
15764#include "canvas/efl_canvas_text.eo.c" 16023#include "canvas/efl_canvas_text.eo.c"