summaryrefslogtreecommitdiff
path: root/src/lib/evas/canvas/evas_object_textblock.c
diff options
context:
space:
mode:
authorAli Alzyod <ali198724@gmail.com>2019-07-22 15:25:17 +0000
committerCedric BAIL <cedric.bail@free.fr>2019-08-19 11:33:20 -0700
commit1d76452aa964c93cd7b8ea343f918866bf9cacb8 (patch)
treeea5a77b7d23274fc7890825dfd1fbb5b58b2caef /src/lib/evas/canvas/evas_object_textblock.c
parented22ad99a30c40931246f6d73b09cb0691cbcb73 (diff)
evas_textblock: reduce _evas_textblock_changed calls with markup_text_append
**_evas_textblock_changed** is internal function that mark that the textblock has changed. When make call for evas_object_textblock_text_markup_set(txtblock,"This is Line<br>THis is other Line<br>"); Old behaviour: multible calles for _evas_textblock_changed will happend, for each text/format appended. New behaviour: Single call for _evas_textblock_changed will happend. Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D9376
Diffstat (limited to 'src/lib/evas/canvas/evas_object_textblock.c')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index 6ecc9b1..0ffcaf7 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -657,6 +657,7 @@ struct _Evas_Object_Textblock
657 } gfx_filter; 657 } gfx_filter;
658 Eina_Bool redraw : 1; 658 Eina_Bool redraw : 1;
659 Eina_Bool changed : 1; 659 Eina_Bool changed : 1;
660 Eina_Bool pause_change : 1;
660 Eina_Bool obstacle_changed : 1; 661 Eina_Bool obstacle_changed : 1;
661 Eina_Bool content_changed : 1; 662 Eina_Bool content_changed : 1;
662 Eina_Bool format_changed : 1; 663 Eina_Bool format_changed : 1;
@@ -8075,6 +8076,10 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
8075 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); 8076 Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
8076 evas_object_async_block(obj); 8077 evas_object_async_block(obj);
8077 TB_HEAD(); 8078 TB_HEAD();
8079
8080 /* Stop calls for _evas_textblock_changed for each cursor_text_append or cursor_format_append
8081 * this should be done once, when markup_prepend finished */
8082 o->pause_change = EINA_TRUE;
8078 if (text) 8083 if (text)
8079 { 8084 {
8080 char *s, *p; 8085 char *s, *p;
@@ -8189,6 +8194,7 @@ _evas_object_textblock_text_markup_prepend(Eo *eo_obj,
8189 p++; 8194 p++;
8190 } 8195 }
8191 } 8196 }
8197 o->pause_change = EINA_FALSE;
8192 _evas_textblock_changed(o, eo_obj); 8198 _evas_textblock_changed(o, eo_obj);
8193} 8199}
8194 8200
@@ -10996,7 +11002,8 @@ _evas_textblock_cursor_text_append(Efl_Text_Cursor_Cursor *cur, const char *_tex
10996 /* Update all the cursors after our position. */ 11002 /* Update all the cursors after our position. */
10997 _evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, len); 11003 _evas_textblock_cursors_update_offset(cur, cur->node, cur->pos, len);
10998 11004
10999 _evas_textblock_changed(o, cur->obj); 11005 if (!o->pause_change)
11006 _evas_textblock_changed(o, cur->obj);
11000 n->dirty = EINA_TRUE; 11007 n->dirty = EINA_TRUE;
11001 free(text); 11008 free(text);
11002 11009
@@ -11342,7 +11349,8 @@ _evas_textblock_cursor_format_append(Efl_Text_Cursor_Cursor *cur,
11342 o->format_changed = EINA_TRUE; 11349 o->format_changed = EINA_TRUE;
11343 } 11350 }
11344 11351
11345 _evas_textblock_changed(o, cur->obj); 11352 if (!o->pause_change)
11353 _evas_textblock_changed(o, cur->obj);
11346 11354
11347 Efl_Text_Cursor_Cursor *ocur = o->cursor; 11355 Efl_Text_Cursor_Cursor *ocur = o->cursor;
11348 if (!ocur->node) 11356 if (!ocur->node)