path: root/src/lib/evas/canvas/evas_object_textblock.c (follow)
AgeCommit message (Collapse)Author
13 daysRevert "evas_textblock: content fit feature"Carsten Haitzler (Rasterman)
This reverts commit 2f676a6591c117e15d65f263ebd267866963b627. This causes segv's in edje_cc - i suspect the eet changes (or in combo to how they are used in edje): AddressSanitizer:DEADLYSIGNAL ================================================================= ==8991==ERROR: AddressSanitizer: SEGV on unknown address 0x000001010000 (pc 0xffff9f002604 bp 0xfffffa747700 sp 0xfffffa747700 T0) ==8991==The signal is caused by a READ memory access. #0 0xffff9f002600 in _eet_hash_gen ../src/lib/eet/eet_utils.c:25 #1 0xffff9efdd024 in eet_dictionary_string_add ../src/lib/eet/eet_dictionary.c:103 #2 0xffff9efbe324 in eet_data_put_string ../src/lib/eet/eet_data.c:849 #3 0xffff9efc1c4c in eet_data_put_type ../src/lib/eet/eet_data.c:1427 #4 0xffff9efd9128 in eet_data_put_unknown ../src/lib/eet/eet_data.c:4730 #5 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108 #6 0xffff9efd5958 in eet_data_put_variant ../src/lib/eet/eet_data.c:4309 #7 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108 #8 0xffff9efd9270 in eet_data_put_unknown ../src/lib/eet/eet_data.c:4739 #9 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108 #10 0xffff9efd8ca0 in eet_data_put_array ../src/lib/eet/eet_data.c:4692 #11 0xffff9efdb320 in _eet_data_descriptor_encode ../src/lib/eet/eet_data.c:5108 #12 0xffff9efc7768 in eet_data_write_cipher ../src/lib/eet/eet_data.c:2403 #13 0xffff9efc78a4 in eet_data_write ../src/lib/eet/eet_data.c:2420 #14 0xaaaabb151dcc in data_thread_group ../src/bin/edje/edje_cc_out.c:2045 #15 0xaaaabb152130 in data_write_groups ../src/bin/edje/edje_cc_out.c:2086 #16 0xaaaabb157734 in data_write ../src/bin/edje/edje_cc_out.c:2866 #17 0xaaaabb14122c in main ../src/bin/edje/edje_cc.c:456 #18 0xffff9dbd92a0 in __libc_start_main (/usr/lib/aarch64-linux-gnu/ #19 0xaaaabb13ea00 (/home/raster/C/git/efl/build/src/bin/edje/edje_cc+0x38a00) AddressSanitizer can not provide additional info. SUMMARY: AddressSanitizer: SEGV ../src/lib/eet/eet_utils.c:25 in _eet_hash_gen ==8991==ABORTING Aborted (core dumped) When compiling breaks... it's certainly time to revert ASAP :(
2019-11-05evas_textblock: content fit featureAli Alzyod
Summary: **Content Fit Feature for Evas_Object_Textblock** This Feature is available at **Evas **object level. And **Edje **level (where it is internally use evas functionality) This feature will allow text block to fit its content font size to proper size to fit its area. **Main Properties:** Fit Modes : None=Default, Width, Height, All [Width+Height] Fit Size Range : Contains maximum and minimum font size to be used (and in between). Fit Step Size : Step(Jump) value when trying fonts sizes between Size_Range max and min. Fit Size Array : Other way to resize font, where you explicitly select font sizes to be uses (for example [20, 50, 100] it will try 3 sizes only) Text Fit feature was available in Edje but: 1- It doesn't effected by ellipsis or warping in font style (or do not handle the in right way) 2- Accuracy is not good (specially if you have fix pixel size elements (spaces,tabs,items)) 3- No (Step size, Size Array) available. Test Plan: To check the Feature > elementary_test > fit > textbock fit You can modify all the modes and properties These are two examples, One using Evas other uses Edje **Evas** ``` #include <Elementary.h> enum BUTTON{ BUTTON_MODE = 0, BUTTON_MAX = 1, BUTTON_MIN = 2, BUTTON_STEP = 3, BUTTON_ARRAY = 4, BUTTON_CONTENT = 5, BUTTON_STYLE = 6, BUTTON_ALL = BUTTON_STYLE+1, }; char* BUTTON_STR[BUTTON_ALL] ={ "MODE", "MAX", "MIN", "STEP", "ARRAY", "CONTENT", "STYLE", }; char *contents[] = { "Hello World", "This is Line<br>THis is other Line", "This text contains <font_size=20 color=#F00>SPECIFIC SIZE</font_size> that does not effected by fit mode" }; char *styles[] = { "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed ellipsis=1.0'", "DEFAULT='font=sans font_size=30 color=#000 wrap=mixed'", "DEFAULT='font=sans font_size=30 color=#000 ellipsis=1.0'", "DEFAULT='font=sans font_size=30 color=#000'", }; char *styles_names[] = { "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>1.0</color>", "wrap=<color=#F00>mixed</color> ellipsis=<color=#F00>NONE</color>", "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>1.0</color>", "wrap=<color=#F00>NONE</color> ellipsis=<color=#F00>NONE</color>", }; typedef struct _APP { Evas_Object *win, *box, *txtblock,*bg, *boxHor, *boxHor2; Eo *btn[BUTTON_ALL]; Eo *lbl_status; char * str; unsigned int i_contnet, i_style; } APP; APP *app; char * get_fit_status(Eo * textblock); static void _btn_clicked(void *data EINA_UNUSED, Eo *obj, void *eventInfo EINA_UNUSED){ if (obj == app->btn[BUTTON_MODE]) { unsigned int options; evas_textblock_fit_options_get(app->txtblock, &options); if (options == TEXTBLOCK_FIT_MODE_NONE) evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_HEIGHT); else if (options == TEXTBLOCK_FIT_MODE_HEIGHT) evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_WIDTH); else if (options == TEXTBLOCK_FIT_MODE_WIDTH) evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_ALL); else if (options == TEXTBLOCK_FIT_MODE_ALL) evas_textblock_fit_options_set(app->txtblock, TEXTBLOCK_FIT_MODE_NONE); } else if (obj == app->btn[BUTTON_MAX]) { unsigned int min, max; evas_textblock_fit_size_range_get(app->txtblock, &min, &max); max -= 5; evas_textblock_fit_size_range_set(app->txtblock, min, max); } else if (obj == app->btn[BUTTON_MIN]) { unsigned int min, max; evas_textblock_fit_size_range_get(app->txtblock, &min, &max); min += 5; evas_textblock_fit_size_range_set(app->txtblock, min, max); } else if (obj == app->btn[BUTTON_STEP]) { unsigned int step; evas_textblock_fit_step_size_get(app->txtblock, &step); step++; evas_textblock_fit_step_size_set(app->txtblock, step); } else if (obj == app->btn[BUTTON_ARRAY]) { unsigned int font_size[] = {10, 50, 100 ,150}; evas_textblock_fit_size_array_set(app->txtblock,font_size,4); } else if (obj == app->btn[BUTTON_CONTENT]) { app->i_contnet++; if(app->i_contnet>=sizeof(contents)/sizeof(char*)) app->i_contnet=0; evas_object_textblock_text_markup_set(app->txtblock,contents[app->i_contnet]); } else if (obj == app->btn[BUTTON_STYLE]) { app->i_style++; if(app->i_style>=sizeof(styles)/sizeof(char*)) app->i_style=0; Evas_Textblock_Style *style = evas_object_textblock_style_get(app->txtblock); evas_textblock_style_set(style,styles[app->i_style]); } elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock)); } char * get_fit_status(Eo * textblock) { static char status[0xFFF]; unsigned int options,min,max,step,size_array[256]; size_t size_array_len; evas_textblock_fit_options_get(textblock,&options); evas_textblock_fit_size_range_get(textblock,&min,&max); evas_textblock_fit_step_size_get(textblock,&step); evas_textblock_fit_size_array_get(textblock,NULL,&size_array_len,0); if (size_array_len>255) size_array_len = 255; evas_textblock_fit_size_array_get(textblock,size_array,NULL,size_array_len); strcpy(status,"Mode : "); if (options == TEXTBLOCK_FIT_MODE_NONE) strcat(status,"MODE_NONE"); else if (options == TEXTBLOCK_FIT_MODE_HEIGHT) strcat(status,"MODE_HEIGHT"); else if (options == TEXTBLOCK_FIT_MODE_WIDTH) strcat(status,"MODE_WIDTH"); else if (options == TEXTBLOCK_FIT_MODE_ALL) strcat(status,"MODE_ALL"); strcat(status,"<br>"); sprintf(status + strlen(status),"Max : %d<br>",max); sprintf(status + strlen(status),"Min : %d<br>",min); sprintf(status + strlen(status),"Step : %d<br>",step); sprintf(status + strlen(status),"Array : [ "); for (size_t i = 0 ; i < 10 ; i++) { if(i<size_array_len) sprintf(status + strlen(status)," %d,",size_array[i]); } if(10<size_array_len) sprintf(status + strlen(status)," ... "); sprintf(status + strlen(status)," ]"); sprintf(status + strlen(status),"<br>"); sprintf(status + strlen(status),"%s",styles_names[app->i_style]); return status; } int elm_main(int argc, char **argv) { app = calloc(sizeof(APP), 1); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); app->win = elm_win_util_standard_add("Main", "App"); elm_win_autodel_set(app->win, EINA_TRUE); app->box = elm_box_add(app->win); app->boxHor = elm_box_add(app->box); app->boxHor2 = elm_box_add(app->box); app->txtblock = evas_object_textblock_add(app->box); app->bg = elm_bg_add(app->box); elm_bg_color_set(app->bg,255,255,255); Evas_Textblock_Style *style = evas_textblock_style_new(); evas_textblock_style_set(style,styles[0]); evas_object_textblock_style_set(app->txtblock,style); evas_object_textblock_text_markup_set(app->txtblock,contents[0]); elm_box_horizontal_set(app->boxHor, EINA_TRUE); elm_box_horizontal_set(app->boxHor2, EINA_TRUE); evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(app->box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(app->box, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(app->txtblock); evas_object_show(app->bg); evas_object_show(app->box); evas_object_show(app->boxHor); evas_object_show(app->boxHor2); elm_box_pack_end(app->box, app->bg); elm_box_pack_end(app->box, app->boxHor); elm_box_pack_end(app->box, app->boxHor2); elm_object_content_set(app->bg,app->txtblock); elm_win_resize_object_add(app->win, app->box); evas_object_resize(app->win, 320, 480); for(int i = 0 ; i < BUTTON_ALL ; i++) { app->btn[i] = elm_button_add(app->boxHor); evas_object_smart_callback_add(app->btn[i], "clicked", _btn_clicked, NULL); elm_object_text_set(app->btn[i], BUTTON_STR[i]); elm_box_pack_end(app->boxHor, app->btn[i]); evas_object_show(app->btn[i]); } app->lbl_status = elm_label_add(app->boxHor2); elm_object_text_set(app->lbl_status, get_fit_status(app->txtblock)); elm_box_pack_end(app->boxHor2, app->lbl_status); evas_object_show(app->lbl_status); evas_object_size_hint_weight_set(app->txtblock, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); evas_object_size_hint_align_set(app->txtblock, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(app->bg, EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); evas_object_size_hint_align_set(app->bg, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(app->win); elm_run(); return 0; } ELM_MAIN() ``` **Edje** ``` // compile: edje_cc source.edc // run: edje_player source.edje collections { styles { style { name: "text_style"; base: "font=sans font_size=30 color=#FFF wrap=mixed ellipsis=1.0"; tag: "br" "\n"; tag: "ps" "ps"; tag: "tab" "\t"; tag: "b" "+ font_weight=Bold"; } } group { name: "my_group"; // must be the same as in source.c parts { part { name: "background"; type: RECT; scale: 1; description { color: 0 0 0 0; rel1.relative: 0.0 0.0; rel2.relative: 1.0 1.0; } } part { name: "text"; type: TEXTBLOCK; scale: 1; entry_mode: NONE; effect: OUTLINE_SHADOW; description { state: "default" 0.0; : "background"; rel1.relative: 0.0 0.0; : "background"; rel2.relative: 1.0 1.0; text { style: "text_style"; align: 0.0 0.0; text: "Hello World This is Me"; fit: 1 1; fit_step: 1; size_range: 30 200; //fit_size_array: 20 40 60 80 100 200; } } } } } } ``` Found Task T5724 relative to this Feature Reviewers: woohyun, bowonryu, cedric, raster Subscribers: #committers, #reviewers, cedric Tags: #efl Differential Revision:
2019-10-02evas: silence compiler warning in textblockXavi Artigas
Uninitialized variable.
2019-09-11evas_textblock: fix warningali
Reviewers: zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-09-05evas_textblock: apply coding conventionAli Alzyod
Reviewed-by: Tom Hacohen <> Differential Revision:
2019-09-05evas_textblock: fix compilation without harfbuzzAli Alzyod
Differential Revision:
2019-09-05elm_entry: handle cursor delete/backspace with clusters consist of one or ↵Ali Alzyod
multible glyphs Summary: Cluster consist of one glyph, expected to be removed on backspace or delete key. Cluster consist of multible glyph, expectd to remove part of on backspace or delete key. This is behaviour founded in Android. (our current way of handling similar to Qt) **New Behaviour** {F3750386} **Old Behaviour** {F3750387} Test Plan: Auto Testing is challenging because there are no easy way to emulate keyboard down on elm_entry ``` #include <Elementary.h> EAPI_MAIN int elm_main(int argc, char **argv) { Evas_Object *win,*box,*entry; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("", ""); elm_win_autodel_set(win, EINA_TRUE); box = elm_box_add(win); entry = elm_entry_add(box); evas_object_size_hint_weight_set(box,EVAS_HINT_EXPAND,EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box,EVAS_HINT_FILL,EVAS_HINT_FILL); elm_entry_entry_set(entry,"<font=NotoColorEmoji wrap=mixed >🇧🇬อั🇧🇬อั&#x1F600;&#x1F600;&#x1F600;&#x1F600;&#x1F600;อั</font>"); evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.9); evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL); evas_object_show(entry); evas_object_show(box); elm_box_pack_end(box,entry); elm_win_resize_object_add(win,box); evas_object_resize(win,320,480); evas_object_size_hint_weight_set(entry,EVAS_HINT_EXPAND,0.1); evas_object_size_hint_align_set(entry,EVAS_HINT_FILL,EVAS_HINT_FILL); evas_object_show(win); elm_run(); return 0; } ELM_MAIN() ``` Reviewers: tasn, woohyun, bowonryu Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-08-29evas_textblock: allocator use same heap if it is large enoughAli Alzyod
Summary: allocator use same heap if it is large enough I am also think to move this struct/functionality into common place, I think we can use it in other parts too Reviewers: smohanty, Hermet, bowonryu, SanghyeonLee Reviewed By: smohanty, SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-08-19evas_textblock: markup text: improve handling invalide escape charactersali
Improve handling invalid escape characters. (*) When '&' character founded in Markup text. Old Behavior : Any text after '&' (if it is not escape), all text will be discarded New Behavior : Any text after '&' (if it is not escape), will be processes as normal plain text. Example: Markup Text : Hello X & Y & Z 1 2 3 Old output : Hello New output : Hello X & Y & Z 1 2 3 This is related to T8077 Reviewed-by: Cedric BAIL <> Differential Revision:
2019-08-19evas_common: parse color in rgb()/rgba() formatali
evas_common_format_color_parse: support rgb()/rgba() format efl user can now specify colors in text formats and styles as rgb(0-255,0-255,0-255) & rgba(0-255,0-255,0-255,0-255) format. This is related to task: T8068 Reviewed-by: Cedric BAIL <> Differential Revision:
2019-08-19evas_textblock: reduce _evas_textblock_changed calls with markup_text_appendAli Alzyod
**_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 <> Differential Revision:
2019-08-12textblock/optimization: refactor evas_textblock_style for memory and ↵subhransu mohanty
perfromance. the main user of textblock_style_set() api is the edje whcih keeps its owen edje_textblock_style tags( string_shared string) by changing the textblock to keep the string_shared string will improve the chance of sharing the same string hence reducing memory. By removing the Eina_StrBuf usage inside the loop in textblock_style_set() api we can avoid lot of temporary memory allocation and deallocation hence will improve performance. Note: I see lot of places we use Eina_Strbuf inside a loop (eina_strbuf_new() does 2 allocation) We need to be extra carefull while reviewing when the code uses those construct to see if its really necessary. Data: it reduces memory allocation by 7000 in elementary_test launch time. Reviewed-by: Cedric BAIL <> Differential Revision:
2019-08-09evas/textblock: optmize textblock format parsing.subhransu mohanty
Summary: textblock format parsing creates/delets eina_TempStr for each token. Eina_TempStr is even worse than malloc/free because it also takes a lock/unlock along with malloc/free each time we create it. Just use a stack bufefr and create string in it if the string is too big then it will fall back to heap which is anyway we are doing right now. Tested this in Tizen List view the number of allocation reduced by 16000. Reviewers: Hermet, ali.alzyod, woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-08-07Evas: migrate Evas_BiDi_Direction -> Efl_Text_Bidirectional_Type.Tom Hacohen
2019-07-31evas_textblock: change font-size/font-family only using EFL.Text.Font Interfaceali
Currently: User cannot change font size only, he needs to set both font and font size with (**efl_text_font_font_set**) To change size only, you need to make two calls, one to get font (**efl_text_font_font_get**) , then pass it again with new size to (**efl_text_font_font_set**). New Behaviour: If user want to change size only, then he passes NULL as font argument to keep same font. If user want to change font only, then he passes 0 as font-size argument, to keep same font-size. Notes: This is not best solution, but it better than current behaviour. I think best solution to have separate function to set font size, but It might break current api or duplicate functions. Reviewed-by: Cedric BAIL <> Differential Revision:
2019-07-29evas_textblock: markup: handle invalid/missing escape charactersAli Alzyod
Summary: T8088 if escape character sequence not found for example **&123;** : * (Old Behaviour) : Draw nothing * (New Behaviour) : Draw Text like it plain text I think this is the right behaviour since: 1- We print output as it is, so user can detect what was the problem. For example user write &gf; (by mistake, he wanted to write &gt;) == if we nothing is printed he would not know exactly where is the real problem. it can be font file, textblock is not visible, he may think bug in efl == if we printed &gf; as it is, it will direclty show that this is not valid escape char. 2- If user made mistake in text, it is better to show it instead of hide it, maybe there are new sequences that we do not know about. This behaviour was checked on multible systems: 1- Web Browsers like chrome 2- Qt 3- Android They all have same as our new behaviour Example : markup text = "&gt;&gf; Old : > New : >&gf; Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include <Eina.h> #include <Elementary.h> #include <Efl_Ui.h> static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); } static void _gui_setup() { Eo *win, *box; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Hello World"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); // when the user clicks "close" on a window there is a request to delete efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); box = efl_add(EFL_UI_BOX_CLASS, win, efl_content_set(win, efl_added), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); efl_add(EFL_UI_TEXT_CLASS, box, efl_text_markup_set(efl_added, "&gt;&gf;"), efl_text_interactive_selection_allowed_set(efl_added, EINA_FALSE), efl_gfx_hint_weight_set(efl_added, 1.0, 0.9), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_text_multiline_set(efl_added,EINA_FALSE), efl_pack(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Quit"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.1), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _gui_quit_cb, efl_added)); } EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { _gui_setup(); } EFL_MAIN() ``` Reviewers: woohyun, bowonryu, segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-07-09evas_object_textblock: update documentation, setting color partAli Alzyod
Summary: Now Textblock has the ability to parse color names same as hex value strings. Reviewers: segfaultxavi, woohyun, bowonryu Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2019-05-29evas_inline: Clean up evas_object_is_visible functionChristopher Michael
Summary: This file is full of functions called as: foo(eo_obj, obj); Most of them can be reduced to foo(obj); and internally get the eo_obj with obj->object This would make it impossible to screw up calling them passing an unrelated pair, and make calling code a little more readable. ref T7230 Depends on D9045 Reviewers: raster, cedric, zmike Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7230 Differential Revision:
2019-05-29evas_inline: Clean up evas_object_was_visible functionChristopher Michael
Summary: This file is full of functions called as: foo(eo_obj, obj); Most of them can be reduced to foo(obj); and internally get the eo_obj with obj->object This would make it impossible to screw up calling them passing an unrelated pair, and make calling code a little more readable. ref T7230 Reviewers: raster, cedric, zmike Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Maniphest Tasks: T7230 Differential Revision:
2019-05-16efl_canvas_text: fix to set halign correctlyJaehyun Cho
Previously, halign_auto was AUTO_NORMAL when halign was set so the given halign value could not be applied correctly. Now, halign_auto is modified to AUTO_NONE before halign is set so the given halign value is applied correctly.
2019-05-02evas_object_textblock: Fix binary search fail.Woochanlee
D8610 Makes API Testcase fault. "&lt" is never searching. @fix Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-04-25evas: change way of searching for Escape strings/values in textblockAli Alzyod
Instead of using old way for linear search for Escape Strings or Escape values, we will sort these values and string in compile time then binary search them. In simple words: Instead of having one array with pair of {escapeChar,escapeValue} and linear search it. We will have two arrays with pair of {escapeChar,escapeValue}, one with escapeChar Sorted, and one with escapeValue sorted. and we will use one of the array to binary search escape chars, and use the other to binary search escape values, 1- This will increase the speed for the search a lot for both Escape characters and Escape values. 2- Make code more easy to understand and trace 3- This will also fix bug for ``` int value; const char * value = evas_textblock_string_escape_get("",&value) //because of some unhanded case in previous code, this will return "&qout;" , which is first element in predefined escape character array ``` Reviewed-by: Xavi Artigas <> Differential Revision:
2019-04-18Freeing Global Memory list on destructorAli Alzyod
Issue with global list item, used to same styles. (in destructor we do not remove styles from it, which will cause memory leak) Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-03-08evas: restore legacy types which were defined to eo typesMike Blumenkrantz
Reviewed-by: Cedric BAIL <> Differential Revision:
2019-03-06efl_text_format: remove all legacy usage from eo filesMike Blumenkrantz
this takes the current generated output from eolian for legacy code in evas and adds it to the tree, then removes legacy references from the corresponding eo files. in the case where the entire eo file was for a legacy object, that eo file has been removed from the tree ref T7724 Reviewed-by: Cedric BAIL <> Differential Revision:
2019-03-06efl_text_cursor: remove all legacy usage from eo filesMike Blumenkrantz
this takes the current generated output from eolian for legacy code in evas and adds it to the tree, then removes legacy references from the corresponding eo files. in the case where the entire eo file was for a legacy object, that eo file has been removed from the tree ref T7724 Reviewed-by: Cedric BAIL <> Differential Revision:
2019-03-06evas: remove all legacy usage from eo filesMike Blumenkrantz
this takes the current generated output from eolian for legacy code in evas and adds it to the tree, then removes legacy references from the corresponding eo files. in the case where the entire eo file was for a legacy object, that eo file has been removed from the tree ref T7724 Reviewed-by: Marcel Hollerbach <> Differential Revision:
2019-02-13Remove individual class BETA guardsXavi Artigas
Summary: Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged as @beta. This means that any app (and the EFL code) wanting to use BETA features has to enable them class by class, which is cumbersome. This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT guard, so apps only need to define one symbol to access BETA features. Any usage of the per-class guards has been removed from the EFL code and examples. When building EFL the global guard is defined by configure, so all EFL methods already have access to BETA API. Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to use BETA API have to define this symbol before including any EFL header (It has been added to the examples requiring it). Test Plan: make && make check && make examples still work, but there's a lot less #defines in the code Reviewers: zmike, bu5hm4n, q66 Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T6788 Differential Revision:
2019-01-30efl.text_markup: move cursor-related methods to efl.text_markup_interactiveMike Blumenkrantz
many users of the markup property are not interactive text cases, so splitting off the interactive methods resolves a number of unimplemented method issues ref T5719 Differential Revision:
2019-01-11evas textblock update calculation - account for clipped color changesJaehyun Cho
if clipped color changed and not object color on textblock objects, then the updates could be missed. This bug seems to have been here a while unnoticed. This patch refers the patch 4e044fd9c27db61d792319ce566e1d3eacb553f2.
2019-01-10evas: remove memory leaks from deleted Textblock objectsYoungbok Shin
Even if a object is deleted, its render_pre function could be called. Especially, Evas Textblock is calling relayout() function if there are any changes. In relayout() function, it creates at least one paragraph and one line. Normally, all of paragraphs and its line should be removed when Evas Textblock object is deleted. But, paragraphs and lines which are created after deleting its object never be free'd. @fix Differential Revision:
2019-01-09textblock: Fix crash with filtersJean-Philippe André
Summary: A crash could happen on a bad call to free() context_dup() returns a newly malloc'ed context if passed NULL (this seems dubious to me, why not calloc?). @fix Test Plan: Add an empty efl.ui.text object Set markup text as "<gfx_filter='code'>Hello</>" Reviewers: cedric, segfaultxavi, Jaehyun, herdsman, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-12-26evas textblock: fix render_pre bug related with clipperJiyoun Park
Summary: assumtion: textblock A has the clipper rect B. 1. evas_render_updates_internal start : evas_object_clip_dirty_do( rect B) : evas_object_textblock_render_pre( textblock A) - if textlock A's o->redraw is EINA_TRUE (o->changed=1 is also same case) - textblock A's vis 1->0 - clipper rect B lose the chance to call render_pre function. - clipper rect B's evas_render_mapped function is not called : pending_change(Rect B) - obj->pre_render_done = 0, so rect cannot be get the change to call evas_object_change_reset when rect b remained the pending list and changed value is EINA_TRUE, it cause textblock's rendering problem Reviewers: raster, Hermet, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-12-18silence most left over compiler warningsJérémy Zurcher
Summary: silence -Wshadow -Wunused-variable -Wunused-parameter Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-11-18Canvas text: emit 'changed' event on markup setDaniel Hirt
2018-11-14evas textblock: remove white space after line-break by a next itemYoungbok Shin
Summary: In some cases, white space at end of line is remained after line-break. This issue is happened when Textblock do word wrap at the next item. Without spliting a previous text item. Then, Textblock just skipped calling _layout_item_text_split_strip_white() function. This patch also fixed a wrong test case based on wrong logic. The range rectangles shouldn't be overlapped. Because of remained white space, a meaningless rectangle was added. And it overlapped by next rectangle. @fix Test Plan: Fixed an exising test case for range renctangles. Run test case. Reviewers: herdsman, woohyun, raster, cedric, subodh, subodh6129 Subscribers: #reviewers, #committers Tags: #efl Differential Revision:
2018-11-09evas textblock - fix unused params/varsCarsten Haitzler (Rasterman)
2018-11-09evas textblock - use proepr free iterator prototypeCarsten Haitzler (Rasterman)
2018-11-06Efl text style: remove 'underline2_type' propertyDaniel Hirt
This moves the logic to the 'underline_type' property, in which we define the type.
2018-11-06Canvas text: share common style strings in style_setDaniel Hirt
Style strings will now be implicitly handled and shared by the object. Also, some of the code was simplified for better readability. @optimize
2018-11-06Canvas text: remove old style tag 'replace_len' fieldDaniel Hirt
The result isn't used at all, so the field is useless. Maybe we should use stringshare comparisons.
2018-11-05Canvas text: emit text,changed event on markup_insertDaniel Hirt
2018-11-05Text: add markup_range_getDaniel Hirt
This allows to retrieve the markup representation of the current text. @feature
2018-11-05Canvas text: don't emit 'cursor,changed' on legacy cursor_copyDaniel Hirt
2018-11-05Canvas text: fix line_jump_by logicDaniel Hirt
Some cases of line_jump_by did not emit "cursor,changed" when it should have. @fix
2018-10-11evas: remove redundant internal functions.Hermet Park
Summary: Since efl object is introduced, magic check is no more used. Plus, remove redundant object functions interfaces - type_id, - visual_id, - store - unstore Reviewers: #committers, bu5hm4n Reviewed By: #committers, bu5hm4n Subscribers: bu5hm4n, raster, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-09-28 evas_object_textblock: fix warning the dereference before null checkJiyoun Park
2018-09-04evas canvas: fix overflowed function initialization.Hermet Park
Summary: last function pointer indicates render_pre(), add one more element is unnecessary. Reviewers: #committers, netstar Reviewed By: #committers, netstar Subscribers: netstar, cedric, #reviewers, #committers Tags: #efl Differential Revision:
2018-08-20evas textblock: add/apply cursor cluster APIs based on grapheme clusterYoungbok Shin
Summary: Add a feature for moving cursor over a grapheme cluster. It is applied to edje_entry.c and elm_entry.c for improving cursor handling just like other modern text editors. ex) gedit The patch on Evas needs to update libunibreak library. So, the patch will update libunibreak, too. @feature Test Plan: 1. Put "ഹലോ" in your entry. 2. Your cursor can reach at the end of text from the beginning only in 2 right key event with this feature. Reviewers: raster, cedric, jpeg, herdsman, zmike, devilhorns Reviewed By: herdsman, zmike Subscribers: #reviewers, #committers, zmike, bowonryu, woohyun Tags: #efl Differential Revision:
2018-07-16Evas text textblock: call evas_font_free even on null fontsDaniel Hirt
A null font set can potentially be stored and passed on. There is no specific fallback in our codebase to roll-back if something like that occurs. This fixes a case where an entry of a null font was not removed from the fonts_cache and was leaked to subsequent tests (the null font entry was not removed from the fonts_cache). Note that this was only apparent when EFL was built with `--disable-fontconfig`, likely due to fontconfig succeeding to always retrieve some non-null font. @fix