[EGIT] [core/efl] master 01/01: embryo: fix a integer(cell) overflow problem
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5af8301bad989a49a1feb736bc62125ac6b3ddbd commit 5af8301bad989a49a1feb736bc62125ac6b3ddbd Author: Youngbok Shin Date: Tue Aug 4 14:47:14 2020 +0900 embryo: fix a integer(cell) overflow problem Summary: The most of functions for embryo based on cell(int) types. addvariable(), defsymbol(), modstk() and etc. Because of this, if embryo script has a really big(INT_MAX / 4) stack variable, integer overflow problem has been happened. @fix Test Plan: Put a script in your EDC like the following code. Build it and try to access the variable. Or check the writen HEX value by embryo_cc. script { // It's size is 1,000,000,000. // Remember, INT_MAX is 2,147,483,647. new my_big_variable[10]; ... } Reviewers: cedric, woohyun, raster, eunue, SanghyeonLee Reviewed By: eunue, SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12081 --- src/bin/embryo/embryo_cc_sc1.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/bin/embryo/embryo_cc_sc1.c b/src/bin/embryo/embryo_cc_sc1.c index 1189ce807b..7595be8299 100644 --- a/src/bin/embryo/embryo_cc_sc1.c +++ b/src/bin/embryo/embryo_cc_sc1.c @@ -1203,10 +1203,8 @@ declloc(int fstatic) if (numdim > 0 && dim[numdim - 1] == 0) error(52); /* only last dimension may be variable length */ size = needsub(&idxtag[numdim]); /* get size; size==0 for "var[]" */ -#if INT_MAX < CELL_MAX -if (size > INT_MAX) +if ((unsigned long long)size * sizeof(cell) > MIN(INT_MAX, CELL_MAX)) error(105); /* overflow, exceeding capacity */ -#endif dim[numdim++] = (int)size; } /* while */ if (ident == iARRAY || fstatic) @@ -1237,6 +1235,9 @@ declloc(int fstatic) } else { + if (((unsigned long long)declared + (unsigned long long)size) * sizeof(cell) > + MIN(INT_MAX, CELL_MAX)) +error(105); declared += (int)size; /* variables are put on stack, * adjust "declared" */ sym = --
[EGIT] [core/efl] master 01/01: evas_textblock: remove style padding from native width and formatted height
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6e025575350276a0f43ffc33ade696e6bffca395 commit 6e025575350276a0f43ffc33ade696e6bffca395 Author: Youngbok Shin Date: Tue Sep 1 19:39:13 2020 +0900 evas_textblock: remove style padding from native width and formatted height Summary: The style padding was included in native width(not in native height) and formatted height(not in formatted width). This is so weired. In addition, there is no enough document about the relation between formatted size, native size and the style padding. This issue is caused by a confusing code which is about how to handle the style padding on item's width and height.("x_adjustment"!) When Evas calculates "c->wmax" in line finalization stage, it explicitly subtract style padding from line width. So, I assumed the formatted size has not to include style padding. It is same for the native size. The style padding will not be included in formatted size and native size by this commit. @fix Test Plan: A test case is included in this commit. Evas_Object *tb = evas_object_textblock_add(evas); newst = evas_textblock_style_new(); evas_textblock_style_set(newst, "DEFAULT='font=Sans font_size=50 color=#000 text_class=entry'"); evas_object_textblock_style_set(tb, newst); evas_object_textblock_text_markup_set(tb, "Test"); evas_object_textblock_style_insets_get(tb, &l, &r, &t, &b); fail_if((l != 0) || (r != 4) || (t != 0) || (b != 4)); /* Size with style padding */ evas_object_textblock_size_formatted_get(tb, &w, &h); evas_object_textblock_size_native_get(tb, &nw, &nh); /* It is non-sense if the following condition is true. */ fail_if((w + l + r == nw) && (h == nh + t + b)); Reviewers: raster, ali.alzyod, woohyun, bowonryu Reviewed By: ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12110 --- src/lib/evas/canvas/efl_canvas_textblock.eo | 8 + src/lib/evas/canvas/evas_object_textblock.c | 48 ++--- src/tests/evas/evas_test_textblock.c| 7 + 3 files changed, 38 insertions(+), 25 deletions(-) diff --git a/src/lib/evas/canvas/efl_canvas_textblock.eo b/src/lib/evas/canvas/efl_canvas_textblock.eo index e819d0df09..b4ef328c14 100644 --- a/src/lib/evas/canvas/efl_canvas_textblock.eo +++ b/src/lib/evas/canvas/efl_canvas_textblock.eo @@ -355,6 +355,10 @@ class Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, size after wrapping text according to the size restrictions of the object. + The formatted width and height do not include padding size. + To get the total size of text with style, you need to query padding size + from @.style_insets. + For example a text block containing the text: "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) @@ -378,6 +382,10 @@ class Efl.Canvas.Textblock extends Efl.Canvas.Object implements Efl.Text, size after wrapping text according to the size restrictions of the object. + The native width and height do not include padding size. + To get the total size of text with style, you need to query padding size + from @.style_insets. + For example a text block containing the text: "You shall not pass!" with no margins or padding and assuming a monospace font and a size of 7x10 char widths (for simplicity) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 1a46ea614c..aacc251b1b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -311,7 +311,6 @@ struct _Evas_Object_Textblock_Text_Item { Evas_Object_Textblock_Item parent; /**< Textblock item. */ Evas_Text_Props text_props; /**< Props for this item. */ - Evas_Coord x_adjustment; /**< Used to indicate by how much we adjusted sizes */ Text_Item_Filter*gfx_filter; }; @@ -4963,7 +4962,7 @@ loop_advance: /* c->o->style_pad.r is already included in the line width, so it's * not used in this calculation. . */ c->ln->x = c->marginl + c->o->style_pad.l + - ((c->w - c->ln->w - c->o->style_pad.l - + ((c->w - c->ln->w - c->o->style_pad.l - c->o->style_pad.r - c->marginl - c->marginr) * _layout_line_al
[EGIT] [core/efl] master 01/01: evas: sw font draw - protect against null pointer access
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=85a0af8281ffd8fd28f0e96657da6e0550225ca8 commit 85a0af8281ffd8fd28f0e96657da6e0550225ca8 Author: Youngbok Shin Date: Thu Sep 24 09:12:06 2020 + evas: sw font draw - protect against null pointer access The image data of dst could be null in a rare case. @fix Reviewed-by: Christopher Michael Differential Revision: https://phab.enlightenment.org/D12163 --- src/lib/evas/common/evas_font_draw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c index 241f772f49..9792e9d408 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c @@ -457,6 +457,8 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 coltab[16], col; DATA16 mtab[16], v; + if (!dst) return; + // FIXME: Use dw, dh for scaling glyphs... (void) dw; (void) dh; --
[EGIT] [core/efl] efl-1.25 01/03: evas: sw font draw - protect against null pointer access
stefan pushed a commit to branch efl-1.25. http://git.enlightenment.org/core/efl.git/commit/?id=92da0a3339e97b818d2ba787220d571efb3a5df5 commit 92da0a3339e97b818d2ba787220d571efb3a5df5 Author: Youngbok Shin Date: Thu Sep 24 09:12:06 2020 + evas: sw font draw - protect against null pointer access The image data of dst could be null in a rare case. @fix Reviewed-by: Christopher Michael Differential Revision: https://phab.enlightenment.org/D12163 --- src/lib/evas/common/evas_font_draw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/common/evas_font_draw.c b/src/lib/evas/common/evas_font_draw.c index 241f772f49..9792e9d408 100644 --- a/src/lib/evas/common/evas_font_draw.c +++ b/src/lib/evas/common/evas_font_draw.c @@ -457,6 +457,8 @@ evas_common_font_glyph_draw(RGBA_Font_Glyph *fg, DATA32 coltab[16], col; DATA16 mtab[16], v; + if (!dst) return; + // FIXME: Use dw, dh for scaling glyphs... (void) dw; (void) dh; --
[EGIT] [core/efl] master 01/01: evas/textblock: apply style paddings in fit calculation
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=94c2d2295f5effea80a21031d84a5ef370a93ef3 commit 94c2d2295f5effea80a21031d84a5ef370a93ef3 Author: Youngbok Shin Date: Wed Oct 28 14:50:23 2020 +0900 evas/textblock: apply style paddings in fit calculation Summary: The style paddings should be calculated for fitting text into the given object's size. Test Plan: 1. Put shadow effect in your style string. "... style=shadow,far_bottom shadow_color=#000 ..." 2. Apply fit option( and ellipsis to see how it goes wrong without this patch.) 3. See results. Reviewers: woohyun, ali.alzyod Reviewed By: woohyun, ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D12183 --- src/lib/evas/canvas/evas_object_textblock.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 77f3d3d07a..c8fd924b78 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -17793,10 +17793,13 @@ int fit_text_block(Evas_Object *eo_obj) } else { + int pad_l, pad_r, pad_t, pad_b; + fit_style_update(eo_obj,fc->p_size_array[mid],EINA_TRUE,bwrap); Eina_Size2D size = efl_canvas_textblock_size_formatted_get(eo_obj); - wf_new = size.w; - hf_new = size.h; + efl_canvas_textblock_style_insets_get(eo_obj, &pad_l, &pad_r, &pad_t, &pad_b); + wf_new = size.w + pad_l + pad_r; + hf_new = size.h + pad_t + pad_b; if (fc->p_size_array[mid]<255) { fc->size_cache[font_size].w = wf_new; --
[EGIT] [core/efl] master 01/01: edje: don't return negative width and height from _parts_extends
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=de9f0aff5764ff42368c0e5164d439aba19d4e0c commit de9f0aff5764ff42368c0e5164d439aba19d4e0c Author: Youngbok Shin Date: Mon Nov 6 11:06:41 2017 +0900 edje: don't return negative width and height from _parts_extends Summary: It should return width and height with positive values or zero. @fix Test Plan: make check Reviewers: raster, jpeg, cedric Reviewed By: raster Subscribers: jiin.moon Differential Revision: https://phab.enlightenment.org/D5422 --- src/lib/edje/edje_util.c| 7 +-- src/tests/edje/edje_test_edje.c | 6 ++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 8db4ffd9a3..1b772d4be7 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -3274,7 +3274,7 @@ EOLIAN Eina_Rectangle _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje *ed) { Evas_Coord xx1 = INT_MAX, yy1 = INT_MAX; - Evas_Coord xx2 = 0, yy2 = 0; + Evas_Coord xx2 = 0, yy2 = 0, w = 0, h = 0; unsigned short i; ed->calc_only = EINA_TRUE; @@ -3304,7 +3304,10 @@ _edje_object_efl_canvas_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Edje ed->calc_only = EINA_FALSE; - return (Eina_Rectangle) { xx1, yy1, xx2 - xx1, yy2 - yy1 }; + if ((xx2 - xx1) > 0) w = xx2 - xx1; + if ((yy2 - yy1) > 0) h = yy2 - yy1; + + return (Eina_Rectangle) { xx1, yy1, w, h }; } EOLIAN Eina_Size2D diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index c47dccb693..3ea0a34acf 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -151,8 +151,14 @@ START_TEST(edje_test_calculate_parens) int x, y, w, h; Evas *evas = EDJE_TEST_INIT_EVAS(); Evas_Object *obj; + Eina_Rect rect; obj = edje_object_add(evas); + + /* A negative test case for efl_canvas_layout_calc_parts_extends */ + rect = efl_canvas_layout_calc_parts_extends(obj); + fail_if(rect.w < 0 || rect.h < 0); + fail_unless(edje_object_file_set(obj, test_layout_get("test_parens.edj"), "test_group")); evas_object_resize(obj, 100, 100); --
[EGIT] [core/efl] master 01/01: evas textblock: handle ellipsis when text's height exceed its area by "br"
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a386597ad92a1022ba41f94afdb28bdf9136d551 commit a386597ad92a1022ba41f94afdb28bdf9136d551 Author: Youngbok Shin Date: Mon Nov 6 11:29:43 2017 +0900 evas textblock: handle ellipsis when text's height exceed its area by "br" Summary: Textblock's ellipsis feature only worked when text's width exceeds its area. So, it didn't work when text's height exceeds its area by "br" tags. This patch will do ellipsis when only ellipsis=1.0 is set. @fix Test Plan: make check Reviewers: herdsman, raster, cedric, jpeg, sohyun Reviewed By: raster Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D5412 --- src/lib/evas/canvas/evas_object_textblock.c | 104 +++- src/tests/evas/evas_test_textblock.c| 9 +++ 2 files changed, 112 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ea0a4ffb69..c311b58909 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -2904,6 +2904,7 @@ struct _Ctxt Evas_Textblock_Align_Auto align_auto : 2; Eina_Bool width_changed : 1; Eina_Bool handle_obstacles : 1; + Eina_Bool vertical_ellipsis : 1; /**ellipsis == 1.0) && + (c->h > 0) && (c->y + c->ln->h > c->h)) + { +/* No text is shown when the object height is smaller than actual font size's height. + * Vertical ellipsis is not handled if the object has only one line. */ +if ((EINA_INLIST_GET(c->paragraphs) != EINA_INLIST_GET(c->par)) || +EINA_INLIST_GET(c->par->lines) != EINA_INLIST_GET(c->ln)) + { + if (((c->position == TEXTBLOCK_POSITION_START) || + (c->position == TEXTBLOCK_POSITION_SINGLE)) + && (c->maxascent > c->ascent)) + c->y -= c->o->style_pad.t; + + /* Remove current line */ + c->par->lines = (Evas_Object_Textblock_Line *)eina_inlist_remove( +EINA_INLIST_GET(c->par->lines), EINA_INLIST_GET(c->ln)); + + if (c->o->ellip_ti && (_ITEM(c->o->ellip_ti)->ln == c->ln)) + _ITEM(c->o->ellip_ti)->ln = NULL; + + _line_free(c->ln); + c->ln = NULL; + c->vertical_ellipsis = EINA_TRUE; + + return; + } + } + c->ln->baseline = c->ascent; /* FIXME: Actually needs to be adjusted using the actual font value. * Also, underline_extend is actually not being used. */ @@ -3997,7 +4027,9 @@ _layout_line_advance(Ctxt *c, Evas_Object_Textblock_Format *fmt) last_fmt = _ITEM(EINA_INLIST_GET(c->ln->items)->last)->format; } _layout_line_finalize(c, last_fmt); - _layout_line_new(c, fmt); + + if (!c->vertical_ellipsis) + _layout_line_new(c, fmt); } /** @@ -5903,6 +5935,13 @@ _layout_par(Ctxt *c) else { _layout_line_advance(c, it->format); + +if (c->vertical_ellipsis) + { + ret = 1; + goto end; + } + item_preadv = EINA_FALSE; } } @@ -5954,6 +5993,12 @@ _layout_par(Ctxt *c) it = _ITEM(eina_list_data_get(i)); } _layout_line_advance(c, it->format); + + if (c->vertical_ellipsis) + { + ret = 1; + goto end; + } } } @@ -5967,6 +6012,9 @@ _layout_par(Ctxt *c) /* Here 'it' is the last format used */ _layout_line_finalize(c, it->format); + +if (c->vertical_ellipsis) + ret = 1; } end: @@ -6401,6 +6449,59 @@ _layout_visual(Ctxt *c) /* Clear the rest of the paragraphs and mark as invisible */ if (c->par) { + if (c->vertical_ellipsis) + { +c->vertical_ellipsis = EINA_FALSE; + +/* If there is no lines, go to the previous paragraph */ +if (!c->par->lines) + c->par = (Evas_Object_Textblock_Paragraph *)EINA_INLIST_GET(c->par)->prev; + +if (c->par) + { + if (c->par->lines) + c->ln = (Evas_Object_Textblock_Line *)EINA_INLIST_GET(c->par->lines)->last; + + if
[EGIT] [core/efl] efl-1.20 21/47: elementary index: fix wrong reference in its header document
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=48b74e171052aa79dce933ec7eda61fa7d903518 commit 48b74e171052aa79dce933ec7eda61fa7d903518 Author: Youngbok Shin Date: Thu Oct 26 14:36:32 2017 +0900 elementary index: fix wrong reference in its header document Summary: elm_index.h uses legacy keyword for ref tag. The patch update each keywords for widgets. And colon ":" character should be seperated from reference keyword. It will remove doxygen warning messages from elm_index.h file. Test Plan: N/A Reviewers: cedric, raster, jpeg Differential Revision: https://phab.enlightenment.org/D5387 --- src/lib/elementary/elm_index.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/elm_index.h b/src/lib/elementary/elm_index.h index 538e96b601..e10bc2e110 100644 --- a/src/lib/elementary/elm_index.h +++ b/src/lib/elementary/elm_index.h @@ -14,21 +14,21 @@ * * Index widgets are by default hidden and just appear when the * user clicks over it's reserved area in the canvas. In its - * default theme, it's an area one @ref Fingers "finger" wide on + * default theme, it's an area one @ref Elm_Fingers "finger" wide on * the right side of the index widget's container. * * When items on the index are selected, smart callbacks get * called, so that its user can make other container objects to * show a given area or child object depending on the index item * selected. You'd probably be using an index together with @ref - * List "lists", @ref Genlist "generic lists" or @ref Gengrid + * Elm_List "lists", @ref Elm_Genlist "generic lists" or @ref Elm_Gengrid * "general grids". * - * This widget inherits from the @ref Layout one, so that all the + * This widget inherits from the @ref Elm_Layout one, so that all the * functions acting on it also work for index objects. * * This widget emits the following signals, besides the ones sent from - * @ref Layout: + * @ref Elm_Layout : * - @c "changed" - When the selected index item changes. @c * event_info is the selected item's data pointer. * - @c "delay,changed" - When the selected index item changes, but --
[EGIT] [core/efl] efl-1.20 02/47: edje_cc: fix a memory leak issue when edje_cc writes images
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=eb7053a6728e4e92c522b244a519ef03abca59f5 commit eb7053a6728e4e92c522b244a519ef03abca59f5 Author: Youngbok Shin Date: Fri Oct 13 11:55:02 2017 -0700 edje_cc: fix a memory leak issue when edje_cc writes images Summary: If there is no given pathes for image files as parameter of edje_cc, "img_dirs" will be NULL. Then, a local variable "load_err" is always EVAS_LOAD_ERROR_NONE. Because of this, the "if" condition just after EINA_LIST_FOREACH() will fail. It causes memory leak from "iw". @fix Test Plan: N/A Reviewers: raster, cedric, jpeg, woohyun Differential Revision: https://phab.enlightenment.org/D5285 Signed-off-by: Cedric Bail --- src/bin/edje/edje_cc_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index 391e46cc9f..d793cacc8b 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -1390,7 +1390,7 @@ data_write_images(Eet_File *ef, int *image_num) break; } } -if (load_err != EVAS_LOAD_ERROR_NONE) +if (!img_dirs || (load_err != EVAS_LOAD_ERROR_NONE)) { evas_object_image_file_set(im, img->entry, NULL); load_err = evas_object_image_load_error_get(im); --
[EGIT] [core/efl] master 01/01: eina: add locale-independent eina_convert_strtod_c function
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bef1c5cc433b89add2cf0292e1098e1bd74ac640 commit bef1c5cc433b89add2cf0292e1098e1bd74ac640 Author: Youngbok Shin Date: Wed Aug 22 01:53:11 2018 + eina: add locale-independent eina_convert_strtod_c function strtod's behavior is changed by system locale. http://man7.org/linux/man-pages/man3/strtod.3.html https://en.wikipedia.org/wiki/Decimal_separator Because of this, strtod(0.5) returns 0.0 in some locales. When a given value string is locale-independent, strtod has to be replaced to eina_convert_strtod_c function. Internally, it calls strtod_l function with "C" locale. @feature Reviewed-by: Cedric BAIL Reviewed-by: Vincent Torri Differential Revision: https://phab.enlightenment.org/D6644 --- src/lib/eina/eina_convert.c| 10 ++ src/lib/eina/eina_convert.h| 16 src/lib/eina/eina_main.c | 19 +++ src/lib/eina/eina_private.h| 6 ++ src/tests/eina/eina_test_convert.c | 21 + 5 files changed, 72 insertions(+) diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c index 2943b37343..152ef5be4a 100644 --- a/src/lib/eina/eina_convert.c +++ b/src/lib/eina/eina_convert.c @@ -453,6 +453,16 @@ eina_convert_atofp(const char *src, int length, Eina_F32p32 *fp) return EINA_TRUE; } +EAPI double +eina_convert_strtod_c(const char *nptr, char **endptr) +{ +#ifdef _WIN32 + return _strtod_l(nptr, endptr, _eina_c_locale_get()); +#else + return strtod_l(nptr, endptr, _eina_c_locale_get()); +#endif +} + /** * @} */ diff --git a/src/lib/eina/eina_convert.h b/src/lib/eina/eina_convert.h index 026fc6c8f6..337cd88ad8 100644 --- a/src/lib/eina/eina_convert.h +++ b/src/lib/eina/eina_convert.h @@ -333,6 +333,22 @@ EAPI Eina_Bool eina_convert_atofp(const char *src, int length, Eina_F32p32 *fp) EINA_ARG_NONNULL(1, 3); +/** + * @brief Converts a string to a floating point number. + * + * @param[in] nptr a string to convert. It shouldn't be NULL. + * @param[out] endptr If endptr is not NULL, a pointer to the character after the last + *character used in the conversion is stored in the location referenced + *by endptr. + * @return a double type floating point number. + * + * This function returns converted floating point number with locale-independency. + * Actually, it use "C" locale for strtod_l function internally. If you need strtod + * without locale-dependency, this function can replace strtod. + * For more information, please refer documents of strtod, strtod_l. + */ +EAPI double eina_convert_strtod_c(const char *nptr, char **endptr); + /** * @} */ diff --git a/src/lib/eina/eina_main.c b/src/lib/eina/eina_main.c index 024d1e3eaa..535e4e7611 100644 --- a/src/lib/eina/eina_main.c +++ b/src/lib/eina/eina_main.c @@ -85,6 +85,7 @@ static int _eina_main_count = 0; static int _eina_main_thread_count = 0; #endif static int _eina_log_dom = -1; +static locale_t _eina_c_locale; #ifdef ERR #undef ERR @@ -285,6 +286,12 @@ eina_init(void) if (EINA_LIKELY(_eina_main_count > 0)) return ++_eina_main_count; +#ifdef _WIN32 + _eina_c_locale = _create_locale(LC_ALL, "C"); +#else + _eina_c_locale = newlocale(LC_ALL_MASK, "C", NULL); +#endif + srand(time(NULL)); while (eina_seed == 0) eina_seed = rand(); @@ -348,6 +355,12 @@ eina_init(void) return 1; } +locale_t +_eina_c_locale_get(void) +{ + return _eina_c_locale; +} + EAPI int eina_shutdown(void) { @@ -359,6 +372,12 @@ eina_shutdown(void) _eina_main_count--; if (EINA_UNLIKELY(_eina_main_count == 0)) { +#ifdef _WIN32 +_free_locale(_eina_c_locale); +#else +freelocale(_eina_c_locale); +#endif + eina_log_timing(_eina_log_dom, EINA_LOG_STATE_START, EINA_LOG_STATE_SHUTDOWN); diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h index eab59586c1..be826e0fb0 100644 --- a/src/lib/eina/eina_private.h +++ b/src/lib/eina/eina_private.h @@ -20,6 +20,7 @@ #define EINA_PRIVATE_H_ #include +#include #ifdef _WIN32 # include @@ -151,6 +152,11 @@ Eina_Stringshare *eina_file_sanitize(const char *path); void eina_freeq_main_set(Eina_FreeQ *fq); +#ifdef _WIN32 +typedef _locale_t locale_t; +#endif +locale_t _eina_c_locale_get(void); + #include "eina_inline_private.h" #endif /* EINA_PRIVATE_H_ */ diff --git a/src/tests/eina/eina_test_convert.c b/src/tests/eina/eina_test_convert.c index 1b08a00a19..c8ccfcb772 100644 --- a/src/tests/eina/eina_test_convert.c +++ b/src/tests/eina/eina_test_convert.c @@ -160,10 +160,31 @@ _eina_convert_fp_check(double
[EGIT] [core/efl] master 02/02: eina: fix a build failure caused by missing 'locale_t' from OSX
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=443f63c6197bf87b0ce387613a79610742fcc23f commit 443f63c6197bf87b0ce387613a79610742fcc23f Author: Youngbok Shin Date: Wed Dec 5 07:56:22 2018 + eina: fix a build failure caused by missing 'locale_t' from OSX In OSX, locale_t is included in xlocale.h @fix Differential Revision: https://phab.enlightenment.org/D7395 --- src/lib/eina/eina_private.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/eina/eina_private.h b/src/lib/eina/eina_private.h index be826e0fb0..d377357b67 100644 --- a/src/lib/eina/eina_private.h +++ b/src/lib/eina/eina_private.h @@ -21,6 +21,9 @@ #include #include +#if defined (__MacOSX__) || (defined (__MACH__) && defined (__APPLE__)) +#include +#endif #ifdef _WIN32 # include --
[EGIT] [core/efl] master 02/03: evas: remove memory leaks from deleted Textblock objects
derekf pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9201fc5a65368a40234977c3c176a806655afea2 commit 9201fc5a65368a40234977c3c176a806655afea2 Author: Youngbok Shin Date: Fri Dec 7 06:27:13 2018 + evas: remove memory leaks from deleted Textblock objects 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: https://phab.enlightenment.org/D7427 --- src/lib/evas/canvas/evas_object_textblock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index b33cb6f5eb..0a79e30472 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -6788,6 +6788,8 @@ _relayout_if_needed(const Evas_Object *eo_obj, Efl_Canvas_Text_Data *o) ASYNC_BLOCK; Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); + if (obj->delete_me) return EINA_TRUE; + /* XXX const */ evas_object_textblock_coords_recalc((Evas_Object *)eo_obj, obj, obj->private_data); if (o->formatted.valid) --
[EGIT] [core/efl] master 01/01: elm textpath: reduces differences between actual pos and modified pos
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=45b475d9d4ce00d7dd2c2334e2b29d674db2fdc0 commit 45b475d9d4ce00d7dd2c2334e2b29d674db2fdc0 Author: Youngbok Shin Date: Mon Feb 25 15:26:25 2019 +0900 elm textpath: reduces differences between actual pos and modified pos Summary: In a previous patch, textpath was modified to use differences between prev/next values to decide next position. Actually, it improved rendering quality. But, the modified position could have a big difference from actual position. It caused a distortion problem. So, this patch was made for reducing that differences. @fix Test Plan: I'll attach some screenshots of before/after. 1. Modify text in text_ui_textpath.c to see distortion of text. ex) "―――..." 2. Build and install. 3. Run "ELM_SCALE=0.8 ELM_ACCEL=gl elementary_test -to efl.ui.textpath" Reviewers: Hermet, raster, cedric Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7418 --- src/lib/elementary/efl_ui_textpath.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index 8d4076ecdc..59b85480bf 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -178,7 +178,8 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, /* Set mp1, mp2 position according to difference between * previous points and next points. - * It improves smoothness of curve's slope changing. */ + * It improves smoothness of curve's slope changing. + * But, it can cause huge differeces from actual positions. */ mp0_x = *last_x1; mp0_y = *last_y1; mp1_x = *last_x1 + (int) round(vec1.x - vec0.x); @@ -188,6 +189,12 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, mp3_x = *last_x2; mp3_y = *last_y2; +/* It reduces differences between actual position and modified position. */ +mp1_x += (int)round(((double)vec1.x - mp1_x) / 2); +mp1_y += (int)round(((double)vec1.y - mp1_y) / 2); +mp2_x += (int)round(((double)vec2.x - mp2_x) / 2); +mp2_y += (int)round(((double)vec2.y - mp2_y) / 2); + evas_map_point_coord_set(map, cmp + i * 4, mp0_x, mp0_y, 0); evas_map_point_coord_set(map, cmp + i * 4 + 1, mp1_x, mp1_y, 0); evas_map_point_coord_set(map, cmp + i * 4 + 2, mp2_x, mp2_y, 0); --
[EGIT] [core/efl] master 03/03: Evas textblock: Use a common thickness and position at a underline.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cd01636d76fd158a6253ab36e344781d0bfae3df commit cd01636d76fd158a6253ab36e344781d0bfae3df Author: Youngbok Shin Date: Wed Jan 27 13:14:52 2016 + Evas textblock: Use a common thickness and position at a underline. Summary: If a underline is drawn with seperated thickness and position, it doesn't look good. It will take the thickest and the lowest underline. @feature Test Plan: Set the following markup text in Evas Textblock. Markup text with underline tag It shows the underline is split to 3 underlines with different thickness and positions. Commonly, underline has to be drawn with same thickness ans position per each line. Reviewers: woohyun, herdsman, tasn Reviewed By: tasn Subscribers: jpeg, raster, subodh6129, cedric Differential Revision: https://phab.enlightenment.org/D2971 --- src/lib/evas/canvas/evas_object_textblock.c | 61 + 1 file changed, 45 insertions(+), 16 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 2c7472a..17c37c4 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3541,6 +3541,7 @@ _layout_line_finalize(Ctxt *c, Evas_Object_Textblock_Format *fmt) { Evas_Coord asc = 0, desc = 0; Evas_Coord maxasc = 0, maxdesc = 0; + _layout_item_ascent_descent_adjust(c->obj, &asc, &desc, it, it->format); _layout_item_max_ascent_descent_calc(c->obj, &maxasc, &maxdesc, @@ -11986,11 +11987,12 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, { Evas_Object_Textblock_Paragraph *par, *start = NULL; Evas_Object_Textblock_Item *itr; - Evas_Object_Textblock_Line *ln; + Evas_Object_Textblock_Line *ln, *cur_ln = NULL; Evas_Textblock_Data *o = type_private_data; Eina_List *shadows = NULL; Eina_List *glows = NULL; Eina_List *outlines = NULL; + int strikethrough_thickness, underline_thickness, underline_position; int i, j; int cx, cy, cw, ch, clip; int ca, cr, cg, cb; @@ -12430,11 +12432,9 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, } /* normal text and lines */ - /* Get the thickness and position, and save them for non-text items. */ - int line_thickness = - evas_common_font_instance_underline_thickness_get(NULL); - int line_position = - evas_common_font_instance_underline_position_get(NULL); + /* Get the thickness, and save it for strikethrough of non-text items. */ + strikethrough_thickness = underline_thickness = evas_common_font_instance_underline_thickness_get(NULL); + underline_position = evas_common_font_instance_underline_position_get(NULL); ENFN->context_multiplier_unset(output, context); if (obj->cur->clipper) @@ -12447,6 +12447,37 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, ITEM_WALK() { Evas_Object_Textblock_Text_Item *ti; + +if (cur_ln != ln) + { + Evas_Object_Textblock_Item *itrr; + + cur_ln = ln; + underline_thickness = +evas_common_font_instance_underline_thickness_get(NULL); + underline_position = +evas_common_font_instance_underline_position_get(NULL); + + EINA_INLIST_FOREACH(ln->items, itrr) + { + if (itrr->type == EVAS_TEXTBLOCK_ITEM_TEXT) +{ + int fi_underline_thickness, fi_underline_position; + void *fi = _ITEM_TEXT(itrr)->text_props.font_instance; + + fi_underline_thickness = + evas_common_font_instance_underline_thickness_get(fi); + fi_underline_position = + evas_common_font_instance_underline_position_get(fi); + + if (fi_underline_thickness > underline_thickness) + underline_thickness = fi_underline_thickness; + if (fi_underline_position > underline_position) + underline_position = fi_underline_position; +} + } + } + ti = (itr->type == EVAS_TEXTBLOCK_ITEM_TEXT) ? _ITEM_TEXT(itr) : NULL; /* NORMAL TEXT */ if (ti) @@ -12454,28 +12485,26 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, void *fi = _ITEM_TEXT(itr)->text_props.font_instance; COLOR_SET(normal); DRAW_TEXT(0, 0); - line_thickness = + strikethrough_thickness = evas_common_font_insta
[EGIT] [core/efl] master 01/03: edje: Reduce duplicated item obj creations and deletions.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6b12ae1e03e93a10b0120aa15d1ff40b022ec189 commit 6b12ae1e03e93a10b0120aa15d1ff40b022ec189 Author: Youngbok Shin Date: Tue Jan 12 13:20:19 2016 + edje: Reduce duplicated item obj creations and deletions. Summary: When text is changed, all of objects for item tag are deleted and recreated. It is unnecessary work and can cause performance issues. Actually, many of application developers wonder why item provider callback functions are called every text changes. @fix Test Plan: Run elementary_test -to "entry emoticon" When you make a very little change on text, 36 emoticon objects are recreated. Reviewers: woohyun, jaehwan, herdsman, tasn Reviewed By: tasn Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3537 --- src/lib/edje/edje_entry.c | 112 ++ 1 file changed, 103 insertions(+), 9 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index ffcbc11..34f98a0 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -12,6 +12,7 @@ static Eina_Bool _edje_entry_imf_retrieve_selection_cb(void *data, Ecore_IMF_Con typedef struct _Entry Entry; typedef struct _SelSel; typedef struct _Anchor Anchor; +typedef struct _Item_Obj Item_Obj; static void _edje_entry_imf_cursor_location_set(Entry *en); static void _edje_entry_imf_cursor_info_set(Entry *en); @@ -35,6 +36,7 @@ struct _Entry Eina_List *anchorlist; Eina_List *itemlist; Eina_List *seq; + Item_Obj *item_objs; char *selection; Edje_Input_Panel_Lang input_panel_lang; Eina_Bool composing : 1; @@ -70,6 +72,14 @@ struct _Anchor Eina_Bool item : 1; }; +struct _Item_Obj +{ + EINA_INLIST; + Anchor*an; + char *name; + Evas_Object *obj; +}; + #ifdef HAVE_ECORE_IMF static void _preedit_clear(Entry *en) @@ -914,6 +924,89 @@ _edje_anchor_mouse_out_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA } static void +_item_obj_del_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Item_Obj *io = data; + Anchor *an = io->an; + Entry *en; + + if (!an) + { +ERR("Failed to free item object struct. Anchor is NULL!"); +return; + } + + en = an->en; + en->item_objs = (Item_Obj *)eina_inlist_remove(EINA_INLIST_GET(en->item_objs), + EINA_INLIST_GET(io)); + io->an = NULL; + free(io->name); + free(io); +} + +static Evas_Object * +_item_obj_get(Anchor *an, Evas_Object *o, Evas_Object *smart, Evas_Object *clip) +{ + Evas_Object *obj; + Item_Obj *io; + Entry *en = an->en; + Edje *ed = en->ed; + + EINA_INLIST_FOREACH(en->item_objs, io) + { +if (!io->an && io->name && !strcmp(an->name, io->name)) + { + io->an = an; + return io->obj; + } + } + + io = calloc(1, sizeof(Item_Obj)); + + obj = ed->item_provider.func + (ed->item_provider.data, smart, + en->rp->part->name, an->name); + evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _item_obj_del_cb, io); + evas_object_smart_member_add(obj, smart); + evas_object_stack_above(obj, o); + evas_object_clip_set(obj, clip); + evas_object_pass_events_set(obj, EINA_TRUE); + evas_object_show(obj); + + io->an = an; + io->name = strdup(an->name); + io->obj = obj; + en->item_objs = (Item_Obj *)eina_inlist_append(EINA_INLIST_GET(en->item_objs), + EINA_INLIST_GET(io)); + + return io->obj; +} + +static void +_unused_item_objs_free(Entry *en) +{ + Item_Obj *io; + Eina_Inlist *l; + + EINA_INLIST_FOREACH_SAFE(en->item_objs, l, io) + { +if (!io->an) + { + if (io->obj) + { + evas_object_event_callback_del_full(io->obj, EVAS_CALLBACK_DEL, _item_obj_del_cb, io); + evas_object_del(io->obj); + } + + en->item_objs = (Item_Obj *)eina_inlist_remove(EINA_INLIST_GET(en->item_objs), + EINA_INLIST_GET(io)); + free(io->name); + free(io); + } + } +} + +static void _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) { Eina_List *l, *ll, *range = NULL; @@ -944,14 +1037,7 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) if (ed->item_p
[EGIT] [core/efl] master 02/03: Evas Text/Textblock: Use locale for lang as default.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d15d91e0da48fc589a6e38dfb9f8bca35846de70 commit d15d91e0da48fc589a6e38dfb9f8bca35846de70 Author: Youngbok Shin Date: Tue Jan 26 10:48:42 2016 + Evas Text/Textblock: Use locale for lang as default. Summary: The configuration files for Fontconfig can describe how font list is made according to language information. EFL also set the language for each Evas textblock styles and used for loading font list. But, this is inconvenient to use if we want to apply language for loading font list according to system-wide locale information. This patch will apply locale information for font list if there is no specific language in description. And it also add [lang=auto] for Evas Textblock. auto - It loads locale for language. none - It disables language. @feature Test Plan: N/A Reviewers: woohyun, herdsman, tasn Subscribers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D3344 --- src/lib/evas/canvas/evas_font_dir.c | 12 src/lib/evas/canvas/evas_object_text.c | 3 +++ src/lib/evas/canvas/evas_object_textblock.c | 10 +- src/lib/evas/include/evas_private.h | 1 + 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index ffb4423..d357ce8 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -469,6 +469,17 @@ evas_font_desc_cmp(const Evas_Font_Description *a, (a->spacing == b->spacing) && (a->lang == b->lang)); } +const char * +evas_font_lang_normalize(const char *lang) +{ + if (!lang || !strcmp(lang, "none")) return NULL; + + if (!strcmp(lang, "auto")) + return evas_common_language_from_locale_full_get(); + + return lang; +} + void evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) { @@ -520,6 +531,7 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) { const char *tmp = name + 6; eina_stringshare_replace_length(&(fdesc->lang), tmp, tend - tmp); + eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize(fdesc->lang)); } } } diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 355c8f8..0402781 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -423,6 +423,9 @@ _evas_text_efl_text_properties_font_set(Eo *eo_obj, Evas_Text_Data *o, const cha if (!(o->cur.font && !strcmp(font, o->cur.font))) { fdesc = evas_font_desc_new(); + +/* Set default language according to locale. */ +eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize("auto")); evas_font_name_parse(fdesc, font); } else diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 70a9e3a..2c7472a 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -1357,6 +1357,10 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch if (!fmt->font.fdesc) { fmt->font.fdesc = evas_font_desc_new(); + + /* Set default language according to locale. */ + eina_stringshare_replace(&(fmt->font.fdesc->lang), + evas_font_lang_normalize("auto")); } else if (!fmt->font.fdesc->is_new) { @@ -1515,11 +1519,15 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @subsection evas_textblock_style_lang Language * * Sets the language of the text for FontConfig. + * The value can either be a language text or one of presets: + * @li "auto" - Respects system locale settings as language + * @li "none" - Disable language support * @code * lang= * @endcode */ -eina_stringshare_replace(&(fmt->font.fdesc->lang), param); +eina_stringshare_replace(&(fmt->font.fdesc->lang), + evas_font_lang_normalize(param)); } else if (cmd == colorstr) /** diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index ac814ba..664c144 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -1591,6 +1591,7 @@ Evas_Font_Description *evas_font_desc_dup(const Evas_Font_Description *fdesc); void evas_font_desc_unref(Evas_Font_Description *fdesc); int evas_
[EGIT] [core/efl] master 01/01: Evas textgrid: Use default language according to locale
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=757f8429922f0f5bbb4ae503a2bac643f42c4195 commit 757f8429922f0f5bbb4ae503a2bac643f42c4195 Author: Youngbok Shin Date: Wed Feb 3 09:34:32 2016 + Evas textgrid: Use default language according to locale Summary: Use default language according to locale. It's the same as the recent changes on Evas Text, Textblock. @feature Test Plan: N/A Reviewers: herdsman, raster, tasn Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3642 --- src/lib/evas/canvas/evas_object_textgrid.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 0e10f3c..7aa7216 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -1157,6 +1157,10 @@ _evas_textgrid_efl_text_properties_font_set(Eo *eo_obj, Evas_Textgrid_Data *o, c evas_object_async_block(obj); font_description = evas_font_desc_new(); + + /* Set default language according to locale. */ + eina_stringshare_replace(&(font_description->lang), +evas_font_lang_normalize("auto")); evas_font_name_parse(font_description, font_name); if (o->cur.font_description && !evas_font_desc_cmp(font_description, o->cur.font_description) && --
[EGIT] [core/efl] master 01/01: Evas: Use proper language for harfbuzz shaping
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=33ea5653477c97072c62c7d7d32b6263b89f8509 commit 33ea5653477c97072c62c7d7d32b6263b89f8509 Author: Youngbok Shin Date: Thu Feb 4 10:07:08 2016 + Evas: Use proper language for harfbuzz shaping Summary: Evas Text, Textblock, Textgrid keeps own language information. This language information could be vary from the result of setlocale(). Especially, Evas Textblock supports tag. The language could be changed in the middle of text. All of these language has to be used for harfbuzz shaping. @fix Test Plan: N/A Reviewers: herdsman, raster, woohyun, tasn Reviewed By: tasn Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3628 --- src/lib/evas/canvas/evas_object_text.c | 3 ++- src/lib/evas/canvas/evas_object_textblock.c | 9 ++--- src/lib/evas/canvas/evas_object_textgrid.c | 6 -- src/lib/evas/common/evas_font_ot.c | 5 ++--- src/lib/evas/common/evas_font_ot.h | 2 +- src/lib/evas/common/evas_text_utils.c | 9 + src/lib/evas/common/evas_text_utils.h | 2 +- src/lib/evas/include/evas_private.h | 2 +- src/modules/evas/engines/software_generic/evas_engine.c | 4 ++-- 9 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 0402781..3ccac40 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -546,7 +546,8 @@ _evas_object_text_item_new(Evas_Object_Protected_Data *obj, { ENFN->font_text_props_info_create(ENDT, fi, str + pos, &it->text_props, - o->bidi_par_props, it->text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE); + o->bidi_par_props, it->text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE, + o->cur.fdesc->lang); _evas_object_text_item_update_sizes(obj, o, it); } o->items = (Evas_Object_Text_Item *) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 17c37c4..743f35e 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -4086,7 +4086,8 @@ skip: { ENFN->font_text_props_info_create(ENDT, cur_fi, str, &ti->text_props, c->par->bidi_props, -ti->parent.text_pos, run_len, EVAS_TEXT_PROPS_MODE_SHAPE); +ti->parent.text_pos, run_len, EVAS_TEXT_PROPS_MODE_SHAPE, +ti->parent.format->font.fdesc->lang); } while ((queue->start + queue->off) < (run_start + run_len)) @@ -4765,7 +4766,8 @@ _layout_ellipsis_item_new(Ctxt *c, const Evas_Object_Textblock_Item *cur_it) ENFN->font_text_props_info_create(ENDT, cur_fi, _ellip_str, &ellip_ti->text_props, - c->par->bidi_props, ellip_ti->parent.text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE); + c->par->bidi_props, ellip_ti->parent.text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE, + ellip_ti->parent.format->font.fdesc->lang); } _text_item_update_sizes(c, ellip_ti); @@ -7541,7 +7543,8 @@ _layout_hyphen_item_new(Ctxt *c, const Evas_Object_Textblock_Text_Item *cur_ti) ENFN->font_text_props_info_create(ENDT, cur_fi, _hyphen_str, &hyphen_ti->text_props, - c->par->bidi_props, hyphen_ti->parent.text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE); + c->par->bidi_props, hyphen_ti->parent.text_pos, len, EVAS_TEXT_PROPS_MODE_SHAPE, + hyphen_ti->parent.format->font.fdesc->lang); } _text_item_update_sizes(c, hyphen_ti); diff --git a/src/lib/evas/canvas/evas_object_textgrid.c b/src/lib/evas/canvas/evas_object_textgrid.c index 7aa7216..bc2f9d9 100644 --- a/src/lib/evas/canvas/evas_object_textgrid.c +++ b/src/lib/evas/canvas/evas_object_textgrid.c @@ -189,7 +189,8 @@ evas_object_textgrid_textprop_get(Evas_Object *eo_obj, Evas_Textgrid_Data *o, Ei evas_common_text_props_script_set(&(glyph->props[idx]), script); ENFN->font_text_props_info_create(ENDT, script_fi, &codepoint, &(glyph->props[idx]), NULL, 0, 1, - EVAS_TEXT_PROPS_MODE_NONE); + EVAS_TEXT_PROPS_MODE_NONE, + o->cur.font_description->lang); (*used)++; } else @@ -1216,7 +1217,8 @@ _evas_textgrid_ef
[EGIT] [core/efl] master 01/01: Evas textblock: Save memory space reducing unused hyphen dictionary loads
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=931b225895609f90855151700566df816dc47681 commit 931b225895609f90855151700566df816dc47681 Author: Youngbok Shin Date: Thu Feb 4 11:29:03 2016 +0200 Evas textblock: Save memory space reducing unused hyphen dictionary loads Summary: Commonly, only few hyphenation dictionaries are used at a application. So, loading all of dictionary files could cause waste of memory. Evas textblock has to load hyphenation dictionaries only when it is really needed. Test Plan: N/A Reviewers: woohyun, tasn, herdsman Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3626 --- src/lib/evas/canvas/evas_object_textblock.c | 4 +-- src/lib/evas/canvas/evas_textblock_hyphenation.x | 34 ++-- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 743f35e..841918b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -1900,7 +1900,7 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * the hyphenation dictionaries on-demand. */ if (fmt->wrap_hyphenation) { - _dicts_hyphen_update(eo_obj); + _dicts_hyphen_init(eo_obj); } #endif @@ -11976,7 +11976,7 @@ evas_object_textblock_free(Evas_Object *eo_obj) /* Hyphenation */ if (o->hyphenating) { - _dicts_hyphen_detach(); + _dicts_hyphen_detach(eo_obj); } #endif } diff --git a/src/lib/evas/canvas/evas_textblock_hyphenation.x b/src/lib/evas/canvas/evas_textblock_hyphenation.x index 930b5af..1a3f6c6 100644 --- a/src/lib/evas/canvas/evas_textblock_hyphenation.x +++ b/src/lib/evas/canvas/evas_textblock_hyphenation.x @@ -11,16 +11,12 @@ typedef struct /* Hyphenation dictionaries */ static Dict_Hyphen _dicts_hyphen[64]; -static Eina_Bool _dicts_hyphen_init = EINA_FALSE; static size_t _hyphens_num = 0; static size_t _hyphen_clients = 0; static void -_dicts_hyphen_update(Eo *eo_obj) +_dicts_hyphen_init(Eo *eo_obj) { - Eina_Iterator *it; - Eina_File_Direct_Info *dir; - Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); if (!o->hyphenating) @@ -28,18 +24,22 @@ _dicts_hyphen_update(Eo *eo_obj) _hyphen_clients++; o->hyphenating = EINA_TRUE; } +} - if (_dicts_hyphen_init) return; +static void * +_dict_hyphen_load(const char *lang) +{ + Eina_Iterator *it; + Eina_File_Direct_Info *dir; + void *dict; it = eina_file_direct_ls(EVAS_DICTS_HYPHEN_DIR); if (!it) { ERR("Couldn't list files in hyphens path: %s\n", EVAS_DICTS_HYPHEN_DIR); -return; +return NULL; } - _dicts_hyphen_init = EINA_TRUE; - /* The following is based on how files are installed in arch linux: * the files are in the pattern of "hyph_xx_XX.dic" (e.g. hyph_en_US.dic). * We are actually trying a bit more in case these are installed in another @@ -49,7 +49,6 @@ _dicts_hyphen_update(Eo *eo_obj) const char *file = dir->path + dir->name_start; char *prefix_off; /* 'hyph_' prefix (may be in some distros) */ char *dic_off; /* '.dic' file extension offset */ -void *dict; /* Check a few assumptions and reject if aren't met. */ prefix_off = strstr(file, "hyph_"); @@ -57,7 +56,7 @@ _dicts_hyphen_update(Eo *eo_obj) if (!dic_off || ((size_t) (dic_off - file) + 4 != dir->name_length) || (dic_off - file < 5) || ((dic_off - file > 0) && !prefix_off) || -strncmp(dic_off, ".dic", 4)) +strncmp(dic_off, ".dic", 4) || strncmp((dic_off - 5), lang, strlen(lang))) { continue; } @@ -70,9 +69,12 @@ _dicts_hyphen_update(Eo *eo_obj) } _dicts_hyphen[_hyphens_num].lang = strndup(dic_off - 5, 5); _dicts_hyphen[_hyphens_num++].dict = dict; +break; } if (it) eina_iterator_free(it); + + return dict; } static void @@ -86,12 +88,15 @@ _dicts_hyphen_free(void) } _hyphens_num = 0; - _dicts_hyphen_init = EINA_FALSE; } static inline void -_dicts_hyphen_detach(void) +_dicts_hyphen_detach(Eo *eo_obj) { + Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); + + if (!o->hyphenating) return; + o->hyphenating = EINA_FALSE; _hyphen_clients--; if (_hyphen_clients == 0) _dicts_hyphen_free(); } @@ -114,7 +119,8 @@ _hyphen_dict_get_from_lang(const char *lang) return _dicts_hyphen[i].dict; } } - return NULL; + + return _dict_hyphen_load(lang); } static char * --
[EGIT] [core/elementary] master 07/12: win: fix a possible crash in elm_win_add
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=adc6e4e0da809c6cb5bf284b482260bdbd42dd25 commit adc6e4e0da809c6cb5bf284b482260bdbd42dd25 Author: Youngbok Shin Date: Fri Feb 5 08:15:29 2016 +0100 win: fix a possible crash in elm_win_add Summary: The enginelist[0] can be NULL in some very rare cases. Then enginelist[0] will be used for strcmp and it make a crash. @fix Test Plan: N/A Reviewers: raster, cedric, woohyun, jypark, jaehwan Differential Revision: https://phab.enlightenment.org/D3649 Signed-off-by: Cedric BAIL --- src/lib/elm_win.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index a3d139e..24041a9 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -3514,7 +3514,8 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_ if (_accel_is_gl()) { // add all engines with selected engine first - if any - enginelist[p++] = ENGINE_GET(); + if (ENGINE_GET()) +enginelist[p++] = ENGINE_GET(); // add all engines with gl/accelerated ones first - only engines compiled #ifdef HAVE_ELEMENTARY_X @@ -3558,8 +3559,9 @@ _elm_win_finalize_internal(Eo *obj, Elm_Win_Data *sd, const char *name, Elm_Win_ if (elm_config_preferred_engine_get()) enginelist[p++] = elm_config_preferred_engine_get(); // add check _elm_gl_preference whether "none" or not - else if (!elm_config_accel_preference_get() || - strcmp(elm_config_accel_preference_get(),"none")) + else if (_elm_config->engine && + elm_config_accel_preference_get() && + !strcmp(elm_config_accel_preference_get(),"none")) enginelist[p++] = _elm_config->engine; // add all engines with gl/accelerated ones first - only engines compiled #ifdef HAVE_ELEMENTARY_X --
[EGIT] [core/efl] master 01/01: Evas font: Use proper enum value for extrabold
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b4f254e1a37d0e66d4bbf73c5e4531d52112b301 commit b4f254e1a37d0e66d4bbf73c5e4531d52112b301 Author: Youngbok Shin Date: Thu Feb 11 10:17:46 2016 + Evas font: Use proper enum value for extrabold Summary: ULTRABOLD is identical to EXTRABOLD in freetype. But, "extrabold" word is added for FC_WEIGHT_EXTRABOLD. So, it has to be changed to use EXTRABOLD instead of ULTRABOLD. It was mistake in my previous commit. @fix Test Plan: N/A Reviewers: tasn, herdsman, woohyun Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3673 --- src/lib/evas/canvas/evas_font_dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index d357ce8..3e544de 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -339,7 +339,7 @@ static Style_Map _style_weight_map[] = {"semibold", EVAS_FONT_WEIGHT_SEMIBOLD}, {"bold", EVAS_FONT_WEIGHT_BOLD}, {"ultrabold", EVAS_FONT_WEIGHT_ULTRABOLD}, - {"extrabold", EVAS_FONT_WEIGHT_ULTRABOLD}, + {"extrabold", EVAS_FONT_WEIGHT_EXTRABOLD}, {"black", EVAS_FONT_WEIGHT_BLACK}, {"extrablack", EVAS_FONT_WEIGHT_EXTRABLACK} }; --
[EGIT] [core/efl] master 01/01: Evas textblock: Fix _dict_hyphen_load could return an uninitialized pointer
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0186f87c4905340d842d79ae8ad39648eec19c3d commit 0186f87c4905340d842d79ae8ad39648eec19c3d Author: Youngbok Shin Date: Fri Feb 12 09:46:33 2016 + Evas textblock: Fix _dict_hyphen_load could return an uninitialized pointer Summary: If there are hyph_*.dic files except for requested language, "dict" pointer could be return without initialized. It doesn't make any warning messages when it is compiled. Normally, it is NULL implicitly. But, it is good to set NULL explicitly for understanding code. Test Plan: N/A Reviewers: herdsman, tasn, woohyun Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3674 --- src/lib/evas/canvas/evas_textblock_hyphenation.x | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_textblock_hyphenation.x b/src/lib/evas/canvas/evas_textblock_hyphenation.x index 1a3f6c6..9c5f47c 100644 --- a/src/lib/evas/canvas/evas_textblock_hyphenation.x +++ b/src/lib/evas/canvas/evas_textblock_hyphenation.x @@ -31,7 +31,7 @@ _dict_hyphen_load(const char *lang) { Eina_Iterator *it; Eina_File_Direct_Info *dir; - void *dict; + void *dict = NULL; it = eina_file_direct_ls(EVAS_DICTS_HYPHEN_DIR); if (!it) --
[EGIT] [core/elementary] master 01/01: label: add elm.swallow.background part to all of groups
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=f2f435614bd32b50c8d7f00beb2b443161768f26 commit f2f435614bd32b50c8d7f00beb2b443161768f26 Author: Youngbok Shin Date: Fri Feb 12 19:39:53 2016 +0900 label: add elm.swallow.background part to all of groups Summary: elm.swallow.background part will be a default part for widget's background image. Test Plan: N/A Reviewers: woohyun, cedric, kimcinoo Differential Revision: https://phab.enlightenment.org/D3675 --- data/themes/edc/elm/label.edc | 9 + 1 file changed, 9 insertions(+) diff --git a/data/themes/edc/elm/label.edc b/data/themes/edc/elm/label.edc index f8123c3..e684e0c 100644 --- a/data/themes/edc/elm/label.edc +++ b/data/themes/edc/elm/label.edc @@ -12,6 +12,11 @@ group { name: "elm/label/base/default"; description { state: "default" 0.0; } } + part { name: "elm.swallow.background"; type: SWALLOW; + clip_to: "label.text.clip"; + description { state: "default" 0.0; + } + } part { name: "elm.text"; type: TEXTBLOCK; clip_to: "label.text.clip"; scale: 1; @@ -28,6 +33,7 @@ group { name: "elm/label/base/default"; } group { name: "elm/label/base/marker"; + inherit: "elm/label/base/default"; styles { style { name: "label_style2"; base: "font="FNBD" font_size=10 text_class=tb_plain align=center color=# style=shadow,bottom shadow_color=#0080"; @@ -50,6 +56,7 @@ group { name: "elm/label/base/marker"; } group { name: "elm/label/base/slide_long"; + inherit: "elm/label/base/default"; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; @@ -167,6 +174,7 @@ group { name: "elm/label/base/slide_long"; group { name: "elm/label/base/slide_short"; + inherit: "elm/label/base/default"; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; @@ -280,6 +288,7 @@ group { name: "elm/label/base/slide_short"; } group { name: "elm/label/base/slide_bounce"; + inherit: "elm/label/base/default"; script { public g_duration, g_stopslide, g_timer_id, g_anim_id; --
[EGIT] [core/elementary] master 01/01: entry: add elm_entry_select_region_get() API
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=c0a0d801953593e51cfbf93faae98156cd55f3e4 commit c0a0d801953593e51cfbf93faae98156cd55f3e4 Author: Youngbok Shin Date: Fri Feb 12 20:18:05 2016 +0900 entry: add elm_entry_select_region_get() API Summary: Already, there is a way to set a selection region: elm_entry_select_region_set() The get() API also useful and there is needs for this inside of elm_entry.c. Add the API and replace codes in atspi_text_selection_get with the API. @feature Test Plan: 1. Run "elementary_test -to entry3" 2. Make a selection on text. 3. Press "Sel" button. Reviewers: tasn, herdsman, cedric, woohyun, Jaehyun, Hermet Subscribers: Hermet Differential Revision: https://phab.enlightenment.org/D3639 --- src/bin/test_entry.c | 9 + src/lib/elm_entry.c | 21 + src/lib/elm_entry.eo | 6 ++ 3 files changed, 32 insertions(+), 4 deletions(-) diff --git a/src/bin/test_entry.c b/src/bin/test_entry.c index b679f3a..f79505e 100644 --- a/src/bin/test_entry.c +++ b/src/bin/test_entry.c @@ -35,6 +35,9 @@ my_entry_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UN { Evas_Object *en = data; const char *s = elm_entry_selection_get(en); + int start = 0, end = 0; + elm_entry_select_region_get(en, &start, &end); + printf("SELECTION REGION: %d - %d\n", start, end); printf("SELECTION:\n"); if (s) printf("%s\n", s); printf("SELECTION PLAIN UTF8:\n"); @@ -256,6 +259,9 @@ my_scrolled_entry_bt_3(void *data, Evas_Object *obj EINA_UNUSED, void *event_inf { Evas_Object *en = data; const char *s = elm_entry_selection_get(en); + int start = 0, end = 0; + elm_entry_select_region_get(en, &start, &end); + printf("SELECTION REGION: %d - %d\n", start, end); printf("SELECTION:\n"); if (s) printf("%s\n", s); printf("SELECTION PLAIN UTF8:\n"); @@ -685,6 +691,9 @@ my_ent_bt_sel(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UN { Evas_Object *en = data; const char *s = elm_entry_selection_get(en); + int start = 0, end = 0; + elm_entry_select_region_get(en, &start, &end); + printf("SELECTION REGION: %d - %d\n", start, end); printf("SELECTION:\n"); if (s) printf("%s\n", s); printf("SELECTION PLAIN UTF8:\n"); diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index b6df9c8..70cc5ae 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -4176,6 +4176,22 @@ _elm_entry_select_region_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, int start, edje_object_part_text_select_extend(sd->entry_edje, "elm.text"); } +EOLIAN static void +_elm_entry_select_region_get(Eo *obj, Elm_Entry_Data *sd, int *start, int *end) +{ + if (!elm_entry_selection_get(obj)) + { +if (start) *start = -1; +if (end) *end = -1; +return; + } + + if (start) + *start = edje_object_part_text_cursor_pos_get(sd->entry_edje, "elm.text", EDJE_CURSOR_SELECTION_BEGIN); + if (end) + *end = edje_object_part_text_cursor_pos_get(sd->entry_edje, "elm.text", EDJE_CURSOR_SELECTION_END); +} + EOLIAN static Eina_Bool _elm_entry_cursor_geometry_get(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { @@ -5428,12 +5444,9 @@ _elm_entry_elm_interface_atspi_text_selections_count_get(Eo *obj, Elm_Entry_Data EOLIAN static void _elm_entry_elm_interface_atspi_text_selection_get(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED, int selection_number, int *start_offset, int *end_offset) { - *start_offset = *end_offset = -1; - if (!elm_entry_selection_get(obj)) return; if (selection_number != 0) return; - *start_offset = edje_object_part_text_cursor_pos_get(_pd->entry_edje, "elm.text", EDJE_CURSOR_SELECTION_BEGIN); - *end_offset = edje_object_part_text_cursor_pos_get(_pd->entry_edje, "elm.text", EDJE_CURSOR_SELECTION_END); + eo_do(obj, elm_obj_entry_select_region_get(start_offset, end_offset)); } EOLIAN static Eina_Bool diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo index 1609cb3..166c6c7 100644 --- a/src/lib/elm_entry.eo +++ b/src/lib/elm_entry.eo @@ -493,6 +493,12 @@ class Elm.Entry (Elm.Layout, Elm.Interface_Scrollable, Evas.Clickable_Interface, @since 1.9 ]] } + get { +[[Get the current position of the selection cursors in the entry. + + @since 1.18 +]] + } values { start: int; [[The starting position.]] end: int; [[The end position.]] --
[EGIT] [core/efl] master 01/01: Evas text: set NULL free'd pointers in evas_object_text_free()
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b85ae776335e2e4d8c232c263eba94ecbc309ec5 commit b85ae776335e2e4d8c232c263eba94ecbc309ec5 Author: Youngbok Shin Date: Mon Feb 15 10:41:37 2016 + Evas text: set NULL free'd pointers in evas_object_text_free() Summary: _render_pre() function could be called for an object which is going to be deleted. According to state changes of the object, text could be recalculated with free'd pointers. It caused an invalid read and crash. @fix Test Plan: 1. Apply D1747. 2. Run elementary_test. 3. Put any character in elm_entry and change paragraph direction. 4. Put any character again. 5. It can cause a crash which is caused by invalid read in Evas Text. Reviewers: herdsman, woohyun, tasn, raster Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3445 --- src/lib/evas/canvas/evas_object_text.c | 8 1 file changed, 8 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 3ccac40..91fcfa1 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1631,8 +1631,16 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) if (o->font && obj->layer && obj->layer->evas) evas_font_free(obj->layer->evas->evas, o->font); o->font = NULL; + o->cur.utf8_text = NULL; + o->cur.font = NULL; + o->cur.fdesc = NULL; + o->cur.source = NULL; + o->bidi_delimiters = NULL; + o->cur.text = NULL; + o->prev = o->cur; #ifdef BIDI_SUPPORT evas_bidi_paragraph_props_unref(o->bidi_par_props); + o->bidi_par_props = NULL; #endif } --
[EGIT] [core/efl] master 01/01: Evas Text: Update text layout when ellipsis is changed without resize
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=471c7635eed67509a24fc6dcc04de65622568f4c commit 471c7635eed67509a24fc6dcc04de65622568f4c Author: Youngbok Shin Date: Tue Feb 16 17:14:38 2016 +0200 Evas Text: Update text layout when ellipsis is changed without resize Summary: When only ellipsis is changed from 0.0~1.0 to -1.0 without resize, the text is never updated. Because, previous state for ellipsis is never kept and used properly to check when Evas Text needs to be updated. It does not have any effect when ellipsis is changed from -1.0 to 0.0~1.0. Because, Evas text always resize itself according to its text size. So, necessarily, Evas text object has to be resized to the smaller size. Commonly, Edje will handle its size if Evas text needs to be ellipsized. @fix Test Plan: Test case is included. Reviewers: tasn, woohyun, herdsman Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3448 --- src/lib/evas/canvas/evas_object_text.c | 7 --- src/tests/evas/evas_test_text.c| 30 ++ 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 91fcfa1..d6d3ee5 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -995,6 +995,7 @@ _evas_text_ellipsis_set(Eo *eo_obj, Evas_Text_Data *o, double ellipsis) if (o->cur.ellipsis == ellipsis) return; evas_object_async_block(obj); + o->prev.ellipsis = o->cur.ellipsis; o->cur.ellipsis = ellipsis; o->changed = 1; if (o->has_filter) @@ -1596,7 +1597,7 @@ evas_object_text_init(Evas_Object *eo_obj) Evas_Text_Data *o = obj->private_data; /* alloc obj private data */ - o->cur.ellipsis = -1.0; + o->prev.ellipsis = o->cur.ellipsis = -1.0; o->prev = o->cur; #ifdef BIDI_SUPPORT o->bidi_par_props = evas_bidi_paragraph_props_new(); @@ -2019,10 +2020,10 @@ evas_object_text_render_pre(Evas_Object *eo_obj, #endif /* If object size changed and ellipsis is set */ - if (((o->cur.ellipsis >= 0.0 || - o->cur.ellipsis != o->prev.ellipsis) && + if (((o->cur.ellipsis >= 0.0) && ((obj->cur->geometry.w != o->last_computed.w) || (obj->cur->geometry.h != o->last_computed.h))) || + (o->cur.ellipsis != o->prev.ellipsis) || (obj->cur->scale != obj->prev->scale) || (o->changed_paragraph_direction)) { diff --git a/src/tests/evas/evas_test_text.c b/src/tests/evas/evas_test_text.c index 746fbee..a7c3242 100644 --- a/src/tests/evas/evas_test_text.c +++ b/src/tests/evas/evas_test_text.c @@ -6,6 +6,7 @@ #include #include +#include #include "evas_suite.h" #include "evas_tests_helpers.h" @@ -624,6 +625,34 @@ START_TEST(evas_text_bidi) END_TEST #endif +START_TEST(evas_text_render) +{ + Ecore_Evas *ee = ecore_evas_buffer_new(500, 500); + Evas *evas = ecore_evas_get(ee); + Evas_Object *to; + const char *font = TEST_FONT_NAME; + Evas_Font_Size size = 14; + int w; + + evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); + to = evas_object_text_add(evas); + evas_object_text_font_source_set(to, TEST_FONT_SOURCE); + evas_object_show(to); + + /* Check the changing ellipsis is updated properly. */ + evas_object_text_font_set(to, font, size); + evas_object_text_text_set(to, "Dynamically changing ellipsis!"); + evas_object_text_ellipsis_set(to, 0.0); + evas_object_resize(to, 50, 100); + w = evas_object_text_horiz_advance_get(to); + evas_object_text_ellipsis_set(to, -1.0); + evas_render(evas); + ck_assert_int_gt(evas_object_text_horiz_advance_get(to), w); + + ecore_evas_free(ee); +} +END_TEST + void evas_test_text(TCase *tc) { tcase_add_test(tc, evas_text_simple); @@ -637,4 +666,5 @@ void evas_test_text(TCase *tc) #endif tcase_add_test(tc, evas_text_unrelated); + tcase_add_test(tc, evas_text_render); } --
[EGIT] [core/efl] master 01/01: Evas font: allow ":fallbacks" keyword when Evas parses font keyword
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d9b93542cf36e9dbc1ad649c8c47f483554ce1cd commit d9b93542cf36e9dbc1ad649c8c47f483554ce1cd Author: Youngbok Shin Date: Wed Feb 17 09:23:06 2016 + Evas font: allow ":fallbacks" keyword when Evas parses font keyword Summary: Developers could use fallback fonts using only font_fallbacks keyword. The keyword is only allowed for Evas Textblock. It has to be common feature for other text type objects. Applying this patch, Text and Textgrid can add fallback fonts. @feature Test Plan: Set font like the following example to Textblock, Text, Textgrid. Sans:fallbacks=Inconsolata Reviewers: tasn, herdsman, woohyun Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3704 --- src/lib/evas/canvas/evas_font_dir.c | 5 + 1 file changed, 5 insertions(+) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index 3e544de..bfab21f 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -533,6 +533,11 @@ evas_font_name_parse(Evas_Font_Description *fdesc, const char *name) eina_stringshare_replace_length(&(fdesc->lang), tmp, tend - tmp); eina_stringshare_replace(&(fdesc->lang), evas_font_lang_normalize(fdesc->lang)); } +else if (!strncmp(name, ":fallbacks=", 11)) + { + const char *tmp = name + 11; + eina_stringshare_replace_length(&(fdesc->fallbacks), tmp, tend - tmp); + } } } --
[EGIT] [core/elementary] master 03/06: entry: add elm.swallow.background part to all of groups
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=465c0dbeb8922ac511f25cb34bcc7bfa1b9d commit 465c0dbeb8922ac511f25cb34bcc7bfa1b9d Author: Youngbok Shin Date: Wed Feb 17 14:43:33 2016 -0800 entry: add elm.swallow.background part to all of groups Summary: elm.swallow.background part will be a default part for widget's background image. When entry widget's scrollable status is changed, the background object will be moved to scr_edje or entry_edje. Test Plan: N/A Reviewers: kimcinoo, woohyun, cedric Differential Revision: https://phab.enlightenment.org/D3677 Signed-off-by: Cedric BAIL --- data/themes/edc/elm/entry.edc | 13 + src/lib/elm_entry.c | 29 + 2 files changed, 42 insertions(+) diff --git a/data/themes/edc/elm/entry.edc b/data/themes/edc/elm/entry.edc index 9a97a03..1ed14ee 100644 --- a/data/themes/edc/elm/entry.edc +++ b/data/themes/edc/elm/entry.edc @@ -2,6 +2,13 @@ group { name: "elm/scroller/entry/default"; inherit: "elm/scroller/base/default"; image: "bg_glow_in.png" COMP; parts { + part { name: "elm.swallow.background"; type: SWALLOW; + clip_to: "clipper"; + description { state: "default" 0.0; +rel1.offset: 1 1; +rel2.offset: -2 -2; + } + } part { name: "validation_glow"; type: RECT; insert_before: "bg"; @@ -553,6 +560,12 @@ group { name: "elm/entry/base/default"; } // data.item: "context_menu_orientation" "horizontal"; parts { + part { name: "elm.swallow.background"; type: SWALLOW; + description { state: "default" 0.0; +rel1.offset: 1 1; +rel2.offset: -2 -2; + } + } part { name: "elm.guide"; type: TEXTBLOCK; mouse_events: 0; scale: 1; description { state: "default" 0.0; diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 70cc5ae..3e057b8 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -765,6 +765,31 @@ _elm_entry_elm_widget_disable(Eo *obj, Elm_Entry_Data *sd) return EINA_TRUE; } +/* It gets the background object from from_edje object and + * sets the background object to to_edje object. + * The background object has to be moved to proper Edje object + * when scrollable status is changed. */ +static void +_elm_entry_background_switch(Evas_Object *from_edje, Evas_Object *to_edje) +{ + Evas_Object *bg_obj; + + if (!from_edje || !to_edje) return; + + if (edje_object_part_exists(from_edje, "elm.swallow.background") && + edje_object_part_exists(to_edje, "elm.swallow.background") && + !edje_object_part_swallow_get(to_edje, "elm.swallow.background")) + { +bg_obj = edje_object_part_swallow_get(from_edje, "elm.swallow.background"); + +if (bg_obj) + { + edje_object_part_unswallow(from_edje, bg_obj); + edje_object_part_swallow(to_edje, "elm.swallow.background", bg_obj); + } + } +} + /* we can't issue the layout's theming code here, cause it assumes an * unique edje object, always */ EOLIAN static Eina_Bool @@ -853,10 +878,14 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) elm_widget_theme_object_set (obj, sd->scr_edje, "scroller", "entry", style); +_elm_entry_background_switch(sd->entry_edje, sd->scr_edje); + str = edje_object_data_get(sd->scr_edje, "focus_highlight"); } else { +_elm_entry_background_switch(sd->scr_edje, sd->entry_edje); + str = edje_object_data_get(sd->entry_edje, "focus_highlight"); } --
[EGIT] [core/elementary] master 02/06: calendar: add elm.swallow.background part to all of groups
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=899880fbf674b9a74a747ca20c38f3325542a86b commit 899880fbf674b9a74a747ca20c38f3325542a86b Author: Youngbok Shin Date: Wed Feb 17 14:42:03 2016 -0800 calendar: add elm.swallow.background part to all of groups Summary: elm.swallow.background part will be a default part for widget's background image. Test Plan: N/A Reviewers: woohyun, kimcinoo, cedric, Hermet Subscribers: Hermet Differential Revision: https://phab.enlightenment.org/D3676 Signed-off-by: Cedric BAIL --- data/themes/edc/elm/calendar.edc | 6 ++ 1 file changed, 6 insertions(+) diff --git a/data/themes/edc/elm/calendar.edc b/data/themes/edc/elm/calendar.edc index 9ce4353..e5edcba 100644 --- a/data/themes/edc/elm/calendar.edc +++ b/data/themes/edc/elm/calendar.edc @@ -378,6 +378,12 @@ group { name: "elm/calendar/base/default"; rel2.offset: -2 -2; } } + part { name: "elm.swallow.background"; type: SWALLOW; + description { state: "default" 0.0; +rel1.to: "bg"; +rel2.to: "bg"; + } + } part { name: "spinner-base1"; type: SPACER; description { state: "default" 0.0; min: 24 16; --
[EGIT] [core/elementary] master 01/02: modules: remove error message from dlsym() when a module is loaded
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=7e801846e9c77328f42364f5b9aebe3d4b75b812 commit 7e801846e9c77328f42364f5b9aebe3d4b75b812 Author: Youngbok Shin Date: Fri Mar 18 11:54:00 2016 -0700 modules: remove error message from dlsym() when a module is loaded Summary: dlsym() could print error message when it tried to load a nonexistent symbol. Whenever eina_module_load is called, it checks __eina_module_init symbol. Even if there is no symbol for init, module loading could be done well. But, it will print an error message. So, we need to use EINA_MODULE_INIT, EINA_MODULE_SHUTDOWN in every modules for removing error messages. Test Plan: N/A Reviewers: woohyun, raster, Hermet, seoz, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3805 Signed-off-by: Cedric Bail --- src/modules/access_output/mod.c| 14 ++ .../datetime_input_ctxpopup/datetime_input_ctxpopup.c | 14 ++ src/modules/test_entry/mod.c | 14 ++ 3 files changed, 42 insertions(+) diff --git a/src/modules/access_output/mod.c b/src/modules/access_output/mod.c index 3f15f32..0dff159 100644 --- a/src/modules/access_output/mod.c +++ b/src/modules/access_output/mod.c @@ -121,3 +121,17 @@ out_done_callback_set(void (*func) (void *data), const void *data) cb_func = func; cb_data = (void *)data; } + +static Eina_Bool +_module_init(void) +{ + return EINA_TRUE; +} + +static void +_module_shutdown(void) +{ +} + +EINA_MODULE_INIT(_module_init); +EINA_MODULE_SHUTDOWN(_module_shutdown); diff --git a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c index b8dc56c..198f095 100644 --- a/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c +++ b/src/modules/datetime_input_ctxpopup/datetime_input_ctxpopup.c @@ -382,3 +382,17 @@ elm_modapi_shutdown(void *m EINA_UNUSED) { return 1; // succeed always } + +static Eina_Bool +_module_init(void) +{ + return EINA_TRUE; +} + +static void +_module_shutdown(void) +{ +} + +EINA_MODULE_INIT(_module_init); +EINA_MODULE_SHUTDOWN(_module_shutdown); diff --git a/src/modules/test_entry/mod.c b/src/modules/test_entry/mod.c index 025d9b4..d2d5171 100644 --- a/src/modules/test_entry/mod.c +++ b/src/modules/test_entry/mod.c @@ -35,3 +35,17 @@ obj_longpress(Evas_Object *obj) { printf("longpress: %p\n", obj); } + +static Eina_Bool +_module_init(void) +{ + return EINA_TRUE; +} + +static void +_module_shutdown(void) +{ +} + +EINA_MODULE_INIT(_module_init); +EINA_MODULE_SHUTDOWN(_module_shutdown); --
[EGIT] [core/efl] master 01/01: Evas: Add API to reinit the language and use it in elementary.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f4f9753c201c569b1a31f0b394d9352c80a7d9d0 commit f4f9753c201c569b1a31f0b394d9352c80a7d9d0 Author: Youngbok Shin Date: Fri Apr 8 11:17:51 2016 +0100 Evas: Add API to reinit the language and use it in elementary. Summary: evas_common_language_from_locale_* functions kept static pointers inside of its functions. Once these function was called, it was never reset. It made big problems for harfbuzz and hyphenation. Also, Elementary provides elm_language_set() API. Then we need to support it fully. @fix Test Plan: Test case for hyphenation is included in Evas test suite. Reviewers: raster, tasn, herdsman, woohyun, z-wony, Blackmole, minudf Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3864 --- src/lib/elementary/elm_main.c | 1 + src/lib/evas/Evas_Common.h | 10 + src/lib/evas/canvas/evas_main.c| 6 ++ src/lib/evas/common/language/evas_language_utils.c | 19 ++-- src/lib/evas/common/language/evas_language_utils.h | 3 +++ src/tests/evas/evas_test_textblock.c | 25 -- 6 files changed, 56 insertions(+), 8 deletions(-) diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index eaafac4..528604c 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -1180,6 +1180,7 @@ EAPI void elm_language_set(const char *lang) { setlocale(LC_ALL, lang); + evas_language_reinit(); _elm_win_translate(); edje_language_set(lang); } diff --git a/src/lib/evas/Evas_Common.h b/src/lib/evas/Evas_Common.h index cf6fb1b..d44644b 100644 --- a/src/lib/evas/Evas_Common.h +++ b/src/lib/evas/Evas_Common.h @@ -5116,6 +5116,16 @@ EAPI int evas_string_char_prev_get(const char *str, int pos, int *decoded) EINA EAPI int evas_string_char_len_get(const char *str) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1); /** + * Reinitialize language from the environment. + * + * The locale can change while a process is running. This call tells evas to + * reload the locale from the environment like it does on start. + * @ingroup Evas_Utils + * @since 1.18 + */ +EAPI voidevas_language_reinit(void); + +/** * @defgroup Evas_Keys Key Input Functions * * Functions which feed key events to the canvas. diff --git a/src/lib/evas/canvas/evas_main.c b/src/lib/evas/canvas/evas_main.c index 38e901a..87061b6 100644 --- a/src/lib/evas/canvas/evas_main.c +++ b/src/lib/evas/canvas/evas_main.c @@ -705,4 +705,10 @@ evas_ector_get(Evas_Public_Data *e) return e->engine.ector; } +EAPI void +evas_language_reinit(void) +{ + evas_common_language_reinit(); +} + #include "canvas/evas_canvas.eo.c" diff --git a/src/lib/evas/common/language/evas_language_utils.c b/src/lib/evas/common/language/evas_language_utils.c index 19638d5..f8b38b6 100644 --- a/src/lib/evas/common/language/evas_language_utils.c +++ b/src/lib/evas/common/language/evas_language_utils.c @@ -45,6 +45,9 @@ #define EXPLICIT_SCRIPT(script) \ (((script) != EVAS_SCRIPT_UNKNOWN) && ((script) > EVAS_SCRIPT_INHERITED)) +static char lang[6]; /* FIXME: Maximum length I know about */ +static char lang_full[32]; + static Evas_Script_Type _evas_common_language_char_script_search(Eina_Unicode unicode) { @@ -135,7 +138,6 @@ evas_common_language_script_type_get(const Eina_Unicode *str, size_t len) const char * evas_common_language_from_locale_get(void) { - static char lang[6]; /* FIXME: Maximum length I know about */ if (*lang) return lang; const char *locale; @@ -163,8 +165,7 @@ evas_common_language_from_locale_get(void) const char * evas_common_language_from_locale_full_get(void) { - static char lang[32]; - if (*lang) return lang; + if (*lang_full) return lang_full; const char *locale; locale = setlocale(LC_MESSAGES, NULL); @@ -177,14 +178,20 @@ evas_common_language_from_locale_full_get(void) if ((c == '.') || (c == '@') || (c == ' ')) /* Looks like en_US.UTF8 or de_DE@euro or aa_ER UTF-8*/ break; } -strncpy(lang, locale, i); -lang[i] = '\0'; -return lang; +strncpy(lang_full, locale, i); +lang_full[i] = '\0'; +return lang_full; } return ""; } +void +evas_common_language_reinit(void) +{ + *lang = *lang_full = '\0'; +} + /* * @} */ diff --git a/src/lib/evas/common/language/evas_language_utils.h b/src/lib/evas/common/language/evas_language_utils.h index 5e24912..8c7529a 100644 --- a/src/lib/evas/common/language/evas_language_utils.h +++ b/src/lib/evas/common/language/evas_language_utils.h @@ -131,5 +131,8 @@ evas_common_language_from_locale_get(void); const char
[EGIT] [core/efl] master 01/01: Elementary Toolbar: Send order signals when a item is added/removed
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=726c6171bf8606b7c1679ae13c5720afe53c630b commit 726c6171bf8606b7c1679ae13c5720afe53c630b Author: Youngbok Shin Date: Fri Apr 15 15:10:49 2016 +0900 Elementary Toolbar: Send order signals when a item is added/removed Summary: Send order signals for changing item's state according to its order. It does not affect to existing themes. It sends the following signals. elm,order,first,item elm,order,default,item elm,order,last,item @feature Test Plan: N/A Reviewers: woohyun, jaehwan, eagleeye, cedric Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3883 --- src/lib/elementary/elm_toolbar.c | 115 +++ 1 file changed, 115 insertions(+) diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 1611969..6c1662f 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -1179,6 +1179,95 @@ _item_select(Elm_Toolbar_Item_Data *it) elm_interface_atspi_accessible_state_changed_signal_emit(EO_OBJ(it), ELM_ATSPI_STATE_SELECTED, EINA_TRUE); } +/* Send order signals when item is added/deleted. + * If the given item is on deletion, item_on_deletion should be EINA_TRUE. */ +static void +_elm_toolbar_item_order_signal_emit(Elm_Toolbar_Data *sd, +Elm_Toolbar_Item_Data *it, +Eina_List *prev_list, +Eina_Bool item_on_deletion) +{ + Elm_Toolbar_Item_Data *first_it = NULL, *last_it = NULL; + Evas_Object *first_it_view = NULL, *last_it_view = NULL; + Elm_Toolbar_Item_Data *prev_first_it = NULL, *prev_last_it = NULL; + Evas_Object *prev_first_it_view = NULL, *prev_last_it_view = NULL; + Eina_List *list; + + list = evas_object_box_children_get(sd->bx); + + if (!list) return; + + if (prev_list) + { +prev_first_it_view = eina_list_data_get(prev_list); +prev_last_it_view = eina_list_data_get(eina_list_last(prev_list)); +prev_first_it = evas_object_data_get(prev_first_it_view, "item"); +prev_last_it = evas_object_data_get(prev_last_it_view, "item"); + } + + first_it_view = eina_list_data_get(list); + last_it_view = eina_list_data_get(eina_list_last(list)); + first_it = evas_object_data_get(first_it_view, "item"); + last_it = evas_object_data_get(last_it_view, "item"); + + if (prev_first_it) + { +if ((prev_first_it != first_it) && (prev_first_it != last_it)) + elm_layout_signal_emit(VIEW(prev_first_it), "elm,order,default,item", "elm"); +else if (prev_first_it == last_it) + elm_layout_signal_emit(VIEW(prev_first_it), "elm,order,last,item", "elm"); + } + + if (prev_last_it) + { +if ((prev_last_it != last_it) && (prev_last_it != first_it)) + elm_layout_signal_emit(VIEW(prev_last_it), "elm,order,default,item", "elm"); +else if (prev_last_it == first_it) + elm_layout_signal_emit(VIEW(prev_last_it), "elm,order,first,item", "elm"); + } + + if (it) + { +if (!item_on_deletion) + { + if (first_it == last_it) + { + elm_layout_signal_emit(VIEW(it), "elm,order,first,item", "elm"); + elm_layout_signal_emit(VIEW(it), "elm,order,last,item", "elm"); + } + else if (it == first_it) + { + elm_layout_signal_emit(VIEW(it), "elm,order,first,item", "elm"); + } + else if (it == last_it) + { + elm_layout_signal_emit(VIEW(it), "elm,order,last,item", "elm"); + } + } +else if (first_it != last_it) + { + if (it == first_it) + { + Eina_List *next_l = eina_list_next(list); + first_it_view = eina_list_data_get(next_l); + first_it = evas_object_data_get(first_it_view, "item"); + + elm_layout_signal_emit(first_it_view, "elm,order,first,item", "elm"); + } + else if (it == last_it) + { + Eina_List *prev_l = eina_list_prev(eina_list_last(list)); + last_it_view = eina_list_data_get(prev_l); + last_it = evas_object_data_get(last_it_view, "item"); + + elm_layout_signal_emit(last_it_view, "elm,order,last,item", "elm"); + } + } + } + + eina_list_free(list);
[EGIT] [core/efl] master 01/01: Elementary toolbar: Fix flickering issue from resizing the box multiple times
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c0fa31d6f4f06c90a8225e1ea5d43703b7f71837 commit c0fa31d6f4f06c90a8225e1ea5d43703b7f71837 Author: Youngbok Shin Date: Mon Apr 25 19:38:03 2016 +0900 Elementary toolbar: Fix flickering issue from resizing the box multiple times Summary: The toolbar's box was resized in _sizing_eval(), _resize_job(). In _sizing_eval(), the box was resized according to its minimum size. And in _resize_job(), toolbar would recalculate it and resize the box again. If _sizing_eval() was called after resizing the box properly from _resize_job(), the box was shrank before calling the next job. If the box's minimum size is needed for calculation in the job callback, it shouldn't change box's size before the job callback. @fix Test Plan: N/A Reviewers: jaehwan, eagleeye, woohyun, cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3911 --- src/lib/elementary/elm_toolbar.c| 8 ++-- src/lib/elementary/elm_widget_toolbar.h | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c index 6c1662f..039a7e4 100644 --- a/src/lib/elementary/elm_toolbar.c +++ b/src/lib/elementary/elm_toolbar.c @@ -370,7 +370,8 @@ _resize_job(void *data) elm_interface_scrollable_content_viewport_geometry_get (obj, NULL, NULL, &vw, &vh); evas_object_size_hint_min_get(sd->bx, &mw, &mh); - evas_object_geometry_get(sd->bx, NULL, NULL, &w, &h); + w = sd->minw_bx; + h = sd->minh_bx; if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU) { @@ -1536,7 +1537,10 @@ _sizing_eval(Evas_Object *obj) minh_bx = vh; } - evas_object_resize(sd->bx, minw_bx, minh_bx); + /* Keep the box's minimum size for a moment. + It will be used for resizing the box in _resize_job() function. */ + sd->minw_bx = minw_bx; + sd->minh_bx = minh_bx; evas_object_resize(sd->more, minw_bx, minh_bx); evas_object_size_hint_min_set(obj, minw, minh); evas_object_size_hint_max_set(obj, -1, -1); diff --git a/src/lib/elementary/elm_widget_toolbar.h b/src/lib/elementary/elm_widget_toolbar.h index 51be616..bdb199b 100644 --- a/src/lib/elementary/elm_widget_toolbar.h +++ b/src/lib/elementary/elm_widget_toolbar.h @@ -43,6 +43,7 @@ struct _Elm_Toolbar_Data int theme_icon_size, priv_icon_size, icon_size; int standard_priority; + int minw_bx, minh_bx; unsigned int item_count; unsigned int separator_count; doublealign; --
[EGIT] [core/efl] master 01/02: elementary interface/scrollable: remove duplicated function calls for bars
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9e2b06cf9815a81665c58b564a2ea73f6f0dc421 commit 9e2b06cf9815a81665c58b564a2ea73f6f0dc421 Author: Youngbok Shin Date: Tue Apr 26 14:20:36 2016 -0700 elementary interface/scrollable: remove duplicated function calls for bars Summary: *_visibility_apply() functions are called from each *_visibility_adjust() function. And it is also called from _elm_scroll_scroll_bar_size_adjust(). So, calling *_visibility_apply() functions after calling _elm_scroll_scroll_bar_size_adjust() is unnecessary. @fix Test Plan: N/A Reviewers: raster, jaehwan, eagleeye, woohyun, cedric Subscribers: jpeg Differential Revision: https://phab.enlightenment.org/D3914 Signed-off-by: Cedric Bail --- src/lib/elementary/elm_interface_scrollable.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index f40552c..6c465b6 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -3513,8 +3513,6 @@ static void _elm_scroll_reconfigure(Elm_Scrollable_Smart_Interface_Data *sid) { _elm_scroll_scroll_bar_size_adjust(sid); - _elm_scroll_scroll_bar_h_visibility_apply(sid); - _elm_scroll_scroll_bar_v_visibility_apply(sid); _elm_scroll_page_adjust(sid); } --
[EGIT] [core/efl] master 05/23: edje_cc: fix a memory leak issue when edje_cc writes images
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5a24f1404a2af4437f4002f326bfa15f24332fc3 commit 5a24f1404a2af4437f4002f326bfa15f24332fc3 Author: Youngbok Shin Date: Fri Oct 13 11:55:02 2017 -0700 edje_cc: fix a memory leak issue when edje_cc writes images Summary: If there is no given pathes for image files as parameter of edje_cc, "img_dirs" will be NULL. Then, a local variable "load_err" is always EVAS_LOAD_ERROR_NONE. Because of this, the "if" condition just after EINA_LIST_FOREACH() will fail. It causes memory leak from "iw". @fix Test Plan: N/A Reviewers: raster, cedric, jpeg, woohyun Differential Revision: https://phab.enlightenment.org/D5285 Signed-off-by: Cedric Bail --- src/bin/edje/edje_cc_out.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_out.c b/src/bin/edje/edje_cc_out.c index 391e46cc9f..d793cacc8b 100644 --- a/src/bin/edje/edje_cc_out.c +++ b/src/bin/edje/edje_cc_out.c @@ -1390,7 +1390,7 @@ data_write_images(Eet_File *ef, int *image_num) break; } } -if (load_err != EVAS_LOAD_ERROR_NONE) +if (!img_dirs || (load_err != EVAS_LOAD_ERROR_NONE)) { evas_object_image_file_set(im, img->entry, NULL); load_err = evas_object_image_load_error_get(im); --
[EGIT] [core/efl] master 01/01: evas textblocke: add align=end for putting a text at the opposite side of LTR/RTL
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9906cd211f805d971733f0815617256429f0304e commit 9906cd211f805d971733f0815617256429f0304e Author: Youngbok Shin Date: Thu Oct 26 11:40:44 2017 +0900 evas textblocke: add align=end for putting a text at the opposite side of LTR/RTL Summary: There is a requirement for putting text at right side for LTR and at left side for RTL. It satisfies that reqirement easily. It also add "start" keywork for "align" tag. "start" will be same with "auto". Intuitionally, developer will try "align=start" if they once saw "align=end" in elsewhere. On the other hand, it only add "END" as new enumeration value for efl interface. @feature Test Plan: N/A Reviewers: herdsman, cedric, jpeg, raster Reviewed By: raster Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D5342 --- src/lib/efl/interfaces/efl_text_format.eo | 3 ++- src/lib/evas/canvas/evas_object_textblock.c | 36 ++--- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/lib/efl/interfaces/efl_text_format.eo b/src/lib/efl/interfaces/efl_text_format.eo index 0ec06a91d4..5e14893f06 100644 --- a/src/lib/efl/interfaces/efl_text_format.eo +++ b/src/lib/efl/interfaces/efl_text_format.eo @@ -14,7 +14,8 @@ enum Efl.Text.Format.Horizontal_Alignment_Type { locale, [[Respects locale's langauge settings]] left,[[Text is placed at the left end of the line]] right, [[Text is placed at the right end of the line]] - center [[Text is places at the center of the line]] + center, [[Text is places at the center of the line]] + end [[Text is places at opposite side of LTR/RTL (bidirectional) settings]] } enum Efl.Text.Format.Vertical_Alignment_Type { diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 44006d2860..ea0a4ffb69 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -425,7 +425,8 @@ typedef enum _Evas_Textblock_Align_Auto { EVAS_TEXTBLOCK_ALIGN_AUTO_NONE, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL, - EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE + EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE, + EVAS_TEXTBLOCK_ALIGN_AUTO_END } Evas_Textblock_Align_Auto; struct _Evas_Object_Textblock_Item @@ -1957,6 +1958,8 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "middle" - Alias for "center" * @li "left" - Puts the text at the left of the line * @li "right" - Puts the text at the right of the line + * @li "start" - Respects LTR/RTL settings. It is same with "auto" + * @li "end" - Puts the text at the opposite side of LTR/RTL settings * @li - A number between 0.0 and 1.0 where 0.0 represents * "left" and 1.0 represents "right" * @li % - A percentage between 0% and 100% where 0% @@ -1965,11 +1968,16 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * align= * @endcode */ -if (len == 4 && !strcmp(param, "auto")) +if ((len == 4 && !strcmp(param, "auto")) || +(len == 5 && !strcmp(param, "start"))) { fmt->halign_auto = EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL; } -if (len == 6 && !strcmp(param, "locale")) +else if (len == 3 && !strcmp(param, "end")) + { + fmt->halign_auto = EVAS_TEXTBLOCK_ALIGN_AUTO_END; + } +else if (len == 6 && !strcmp(param, "locale")) { fmt->halign_auto = EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE; } @@ -3537,6 +3545,20 @@ _layout_line_align_get(Ctxt *c) return 0.0; } } + else if ((c->align_auto == EVAS_TEXTBLOCK_ALIGN_AUTO_END) && c->ln) + { +if (c->ln->items && c->ln->items->text_node && + (c->ln->par->direction == EVAS_BIDI_DIRECTION_RTL)) + { + /* Align left*/ + return 0.0; + } +else + { + /* Align right */ + return 1.0; + } + } else if (c->align_auto == EVAS_TEXTBLOCK_ALIGN_AUTO_LOCALE) { if (evas_common_language_direction_get() == EVAS_BIDI_DIRECTION_RTL) @@ -15614,6 +15636,10 @@ _efl_canvas_text_efl_text_format_halign_set(Eo *obj, Efl_Canvas_Text_Data *o, Ef { _FMT_SET(halign_auto, EVAS_TEXTBLOCK_ALIGN_AUTO_NORMAL); } + else if (type
[EGIT] [core/efl] master 01/02: elementary index: fix wrong reference in its header document
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=084ce3d6e5a7ec250f6653e0f1291ba6a4c9c603 commit 084ce3d6e5a7ec250f6653e0f1291ba6a4c9c603 Author: Youngbok Shin Date: Thu Oct 26 14:36:32 2017 +0900 elementary index: fix wrong reference in its header document Summary: elm_index.h uses legacy keyword for ref tag. The patch update each keywords for widgets. And colon ":" character should be seperated from reference keyword. It will remove doxygen warning messages from elm_index.h file. Test Plan: N/A Reviewers: cedric, raster, jpeg Differential Revision: https://phab.enlightenment.org/D5387 --- src/lib/elementary/elm_index.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/elm_index.h b/src/lib/elementary/elm_index.h index 7e697c5f8d..4b124eab6c 100644 --- a/src/lib/elementary/elm_index.h +++ b/src/lib/elementary/elm_index.h @@ -11,21 +11,21 @@ * * Index widgets are by default hidden and just appear when the * user clicks over it's reserved area in the canvas. In its - * default theme, it's an area one @ref Fingers "finger" wide on + * default theme, it's an area one @ref Elm_Fingers "finger" wide on * the right side of the index widget's container. * * When items on the index are selected, smart callbacks get * called, so that its user can make other container objects to * show a given area or child object depending on the index item * selected. You'd probably be using an index together with @ref - * List "lists", @ref Genlist "generic lists" or @ref Gengrid + * Elm_List "lists", @ref Elm_Genlist "generic lists" or @ref Elm_Gengrid * "general grids". * - * This widget inherits from the @ref Layout one, so that all the + * This widget inherits from the @ref Elm_Layout one, so that all the * functions acting on it also work for index objects. * * This widget emits the following signals, besides the ones sent from - * @ref Layout: + * @ref Elm_Layout : * - @c "changed" - When the selected index item changes. @c * event_info is the selected item's data pointer. * - @c "delay,changed" - When the selected index item changes, but --
[EGIT] [core/efl] master 04/05: evas: add a missing description for a newly added parameter
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a191a052b8a80931b65a92a68ee776894f4a4c30 commit a191a052b8a80931b65a92a68ee776894f4a4c30 Author: Youngbok Shin Date: Fri Oct 27 11:45:34 2017 -0700 evas: add a missing description for a newly added parameter Summary: A new parameter "width_offset" was added to evas_common_font_query_last_up_to_pos() internal function. But, internal documentation was not updated. So, it adds a simple description for the new parameter. Test Plan: N/A Reviewers: jpeg, cedric, herdsman, shilpasingh Differential Revision: https://phab.enlightenment.org/D5035 --- src/lib/evas/common/evas_font_query.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c index 8fe82dacbb..0fd5bc1360 100644 --- a/src/lib/evas/common/evas_font_query.c +++ b/src/lib/evas/common/evas_font_query.c @@ -816,6 +816,7 @@ end: * @param text_props the string object. * @param x the x boundary. * @param y the y boundary. + * @param width_offset the additional width only for allowing glyph's. * @return the position found, -1 on failure. */ EAPI int --
[EGIT] [core/efl] master 01/01: edje: fix backward compatibility issue caused by legacy cursor funcs
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cd0bd865eb93d47d87e6e921d3743152784fc1fd commit cd0bd865eb93d47d87e6e921d3743152784fc1fd Author: Youngbok Shin Date: Wed May 2 10:33:35 2018 +0300 edje: fix backward compatibility issue caused by legacy cursor funcs Summary: edje_object_part_text_cursor_prev/next/up/down has return value. It has to return EINA_TRUE when only it successed. But, when these funcs moved to legacy, it changed to return EINA_TRUE whenever it fails or success. It must return EINA_FALSE when it fails. @fix Test Plan: - Run test suite make check Reviewers: herdsman, raster, cedric, woohyun Subscribers: zmike Differential Revision: https://phab.enlightenment.org/D5972 --- src/Makefile_Edje.am | 2 + src/lib/edje/edje_legacy.c | 64 - src/tests/edje/data/test_text_cursor.edc | 22 + src/tests/edje/edje_test_edje.c | 81 4 files changed, 157 insertions(+), 12 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 1179d5e92e..87d67b5e89 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -299,6 +299,7 @@ tests/edje/data/test_combine_keywords.edc \ tests/edje/data/test_messages.edc \ tests/edje/data/test_signals.edc \ tests/edje/data/test_signal_callback_del_full.edc \ +tests/edje/data/test_text_cursor.edc \ tests/edje/data/filter.lua @@ -342,6 +343,7 @@ EDJE_TEST_FILES = tests/edje/data/test_layout.edj \ tests/edje/data/test_messages.edj \ tests/edje/data/test_signals.edj \ tests/edje/data/test_signal_callback_del_full.edj \ + tests/edje/data/test_text_cursor.edj \ $(NULL) CLEANFILES += $(EDJE_TEST_FILES) diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c index 3549eee059..a0c51749ad 100644 --- a/src/lib/edje/edje_legacy.c +++ b/src/lib/edje/edje_legacy.c @@ -325,33 +325,73 @@ edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part, Ed EAPI Eina_Bool edje_object_part_text_cursor_prev(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_char_prev(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur)); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_char_prev(efl_part(obj, part), c); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_next(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_char_next(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur)); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_char_next(efl_part(obj, part), c); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_down(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_line_jump_by(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur), 1); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_line_jump_by(efl_part(obj, part), c, 1); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_up(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_line_jump_by(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur), -1); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_line_jump_by(efl_part(obj, part), c, -1); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI void diff --git a/src/tests/edje/data/test_text_cursor.edc b/src/tests/edje/data/test_text_cursor.edc new file mode 100644 index 00..7392e545bc --- /dev/null +++ b/src
[EGIT] [core/efl] efl-1.20 01/01: edje: fix backward compatibility issue caused by legacy cursor funcs
herdsman pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=434247391dc8ad4e66b3b11507b03e81e60746bc commit 434247391dc8ad4e66b3b11507b03e81e60746bc Author: Youngbok Shin Date: Wed May 2 10:33:35 2018 +0300 edje: fix backward compatibility issue caused by legacy cursor funcs Summary: edje_object_part_text_cursor_prev/next/up/down has return value. It has to return EINA_TRUE when only it successed. But, when these funcs moved to legacy, it changed to return EINA_TRUE whenever it fails or success. It must return EINA_FALSE when it fails. @fix Test Plan: - Run test suite make check Reviewers: herdsman, raster, cedric, woohyun Subscribers: zmike Differential Revision: https://phab.enlightenment.org/D5972 Committer's note: backported with an additional fix to tests. --- src/Makefile_Edje.am | 2 + src/lib/edje/edje_legacy.c | 64 - src/tests/edje/data/test_text_cursor.edc | 22 + src/tests/edje/edje_test_edje.c | 81 4 files changed, 157 insertions(+), 12 deletions(-) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 4ca20e570b..925880514b 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -287,6 +287,7 @@ tests/edje/data/test_combine_keywords.edc \ tests/edje/data/test_messages.edc \ tests/edje/data/test_signals.edc \ tests/edje/data/test_signal_callback_del_full.edc \ +tests/edje/data/test_text_cursor.edc \ tests/edje/data/filter.lua @@ -330,6 +331,7 @@ EDJE_TEST_FILES = tests/edje/data/test_layout.edj \ tests/edje/data/test_messages.edj \ tests/edje/data/test_signals.edj \ tests/edje/data/test_signal_callback_del_full.edj \ + tests/edje/data/test_text_cursor.edj \ $(NULL) CLEANFILES += $(EDJE_TEST_FILES) diff --git a/src/lib/edje/edje_legacy.c b/src/lib/edje/edje_legacy.c index 256f468fe9..052805cda5 100644 --- a/src/lib/edje/edje_legacy.c +++ b/src/lib/edje/edje_legacy.c @@ -250,33 +250,73 @@ edje_object_part_text_cursor_line_end_set(Edje_Object *obj, const char *part, Ed EAPI Eina_Bool edje_object_part_text_cursor_prev(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_char_prev(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur)); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_char_prev(efl_part(obj, part), c); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_next(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_char_next(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur)); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_char_next(efl_part(obj, part), c); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_down(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_line_jump_by(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur), 1); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_line_jump_by(efl_part(obj, part), c, 1); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI Eina_Bool edje_object_part_text_cursor_up(Edje_Object *obj, const char *part, Edje_Cursor cur) { - efl_text_cursor_line_jump_by(efl_part(obj, part), - efl_text_cursor_get(efl_part(obj, part), (int) cur), -1); - return EINA_TRUE; + Efl_Text_Cursor_Cursor *c; + int old_pos, new_pos; + + c = efl_text_cursor_get(efl_part(obj, part), (int) cur); + + old_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + efl_text_cursor_line_jump_by(efl_part(obj, part), c, -1); + new_pos = efl_text_cursor_position_get(efl_part(obj, part), c); + + if (old_pos != new_pos) + return EINA_TRUE; + + return EINA_FALSE; } EAPI void diff --git a/src/tests/edje/data/test_text_cursor.edc b/src/tests/edje/data/test_text_cursor.ed
[EGIT] [core/efl] master 03/03: evas textblock: remove NULL checking after dereferencing
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fa8aa7c9c85a2a5cab47f6093a2de94d74ec42e3 commit fa8aa7c9c85a2a5cab47f6093a2de94d74ec42e3 Author: Youngbok Shin Date: Sun May 6 10:49:42 2018 +0300 evas textblock: remove NULL checking after dereferencing Summary: c->paragraphs couldn't be NULL if it is created by _layout_paragraph_new() well. So, NULL checking should be moved to after _layout_paragraph_new(). Test Plan: N/A Reviewers: jpeg, tasn, raster, herdsman, cedric Subscribers: zmike, stefan_schmidt, jpeg Tags: #efl Differential Revision: https://phab.enlightenment.org/D4300 --- src/lib/evas/canvas/evas_object_textblock.c | 18 +- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index f17ae47975..1b66ce507b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -3152,13 +3152,18 @@ _layout_find_paragraph_by_line_no(Efl_Canvas_Text_Data *o, int line_no) * @param c The context to work on - Not NULL. * @param n the associated text node * @param append true to append, false to prpend. + * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. */ -static void +static Eina_Bool _layout_paragraph_new(Ctxt *c, Evas_Object_Textblock_Node_Text *n, Eina_Bool append) { Evas_Object_Textblock_Paragraph *rel_par = c->par; - c->par = calloc(1, sizeof(Evas_Object_Textblock_Paragraph)); + Evas_Object_Textblock_Paragraph *new_par = calloc(1, sizeof(Evas_Object_Textblock_Paragraph)); + + if (!new_par) return EINA_FALSE; + c->par = new_par; + if (append || !rel_par) c->paragraphs = (Evas_Object_Textblock_Paragraph *) eina_inlist_append_relative(EINA_INLIST_GET(c->paragraphs), @@ -3177,6 +3182,8 @@ _layout_paragraph_new(Ctxt *c, Evas_Object_Textblock_Node_Text *n, c->par->line_no = -1; c->par->visible = 1; c->o->num_paragraphs++; + + return EINA_TRUE; } #ifdef BIDI_SUPPORT @@ -6323,7 +6330,8 @@ _layout_pre(Ctxt *c) else { /* If it's a new paragraph, just add it. */ - _layout_paragraph_new(c, n, EINA_FALSE); + if (!_layout_paragraph_new(c, n, EINA_FALSE)) +break; } #ifdef BIDI_SUPPORT @@ -6428,7 +6436,7 @@ _layout_pre(Ctxt *c) * if the last paragraph has no lines/text, create that as well */ if (!c->paragraphs) { -_layout_paragraph_new(c, NULL, EINA_TRUE); +if (!_layout_paragraph_new(c, NULL, EINA_TRUE)) return; o->paragraphs = c->paragraphs; } c->par = (Evas_Object_Textblock_Paragraph *) @@ -6551,7 +6559,7 @@ _layout_visual(Ctxt *c) } /* Get the last visible paragraph in the layout */ - if (!last_vis_par && c->paragraphs) + if (!last_vis_par) last_vis_par = (Evas_Object_Textblock_Paragraph *) EINA_INLIST_GET(c->paragraphs)->last; --
[EGIT] [core/efl] master 01/03: evas textblock: fix double free issue from user style push/pop and free
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c33ef15d5dd68203dd0e7720aa17a83b2bed6ded commit c33ef15d5dd68203dd0e7720aa17a83b2bed6ded Author: Youngbok Shin Date: Sat May 5 22:15:54 2018 +0300 evas textblock: fix double free issue from user style push/pop and free Summary: The Textblock Style which is created for user style was managed application side. It is created and free'd from application - outside of Evas Textblock. Recently, evas_object_textblock_style_user_push/pop start to call efl_canvas_text_style_set() instead of legacy code. The problem is efl_canvas_text_style_set() is always going to call free() when a style is going to be deleted. It makes conflicts(double free issue) with application which is used to call evas_textblock_style_free(). So, the issue will be fixed by this patch. The patch also revise push/pop/peek code to make clean and avoid meaningless calculation/events. @fix Test Plan: A test case is Included in this patch. The test case try to trigger double free. Reviewers: herdsman, raster, cedric Subscribers: zmike, woohyun Tags: #efl Differential Revision: https://phab.enlightenment.org/D5812 Committer's note: formatted commit summary (80 width). --- src/lib/evas/canvas/evas_object_textblock.c | 50 ++--- src/tests/evas/evas_test_textblock.c| 25 +++ 2 files changed, 64 insertions(+), 11 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ce6e60edd8..f17ae47975 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7221,6 +7221,16 @@ _style_by_key_find(Efl_Canvas_Text_Data *o, const char *key) return NULL; } +static void +_style_remove_from_obj(Eo *eo_obj, Efl_Canvas_Text_Data *o, Evas_Textblock_Style *ts, Eina_Bool style_free) +{ + o->styles = eina_list_remove(o->styles, ts); + ts->objects = eina_list_remove(ts->objects, eo_obj); + + if (style_free || (ts->delete_me && !ts->objects)) + evas_textblock_style_free(ts); +} + EOLIAN static void _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key, const char *style) { @@ -7246,9 +7256,7 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key, } else { - o->styles = eina_list_remove(o->styles, ts); - ts->objects = eina_list_remove(ts->objects, eo_obj); - evas_textblock_style_free(ts); + _style_remove_from_obj(eo_obj, o, ts, EINA_TRUE); } } else if (!ts && style) @@ -7296,20 +7304,29 @@ EAPI void evas_object_textblock_style_user_push(Eo *eo_obj, Evas_Textblock_Style *ts) { EINA_SAFETY_ON_NULL_RETURN(eo_obj); - Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); + Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); + Evas_Textblock_Style *old_ts, *tmp = NULL; - Evas_Textblock_Style *old_ts = _style_by_key_find(o, _STYLE_USER); + old_ts = _style_by_key_find(o, _STYLE_USER); + + if (old_ts == ts) return; if (old_ts) + _style_remove_from_obj(eo_obj, o, old_ts, EINA_FALSE); + + if (ts) { -efl_canvas_text_style_set(eo_obj, _STYLE_USER, NULL); +_textblock_style_generic_set(eo_obj, ts, &tmp); +ts->key = eina_stringshare_add(_STYLE_USER); +o->styles = eina_list_append(o->styles, ts); } - Evas_Textblock_Style *tmp = NULL; - _textblock_style_generic_set(eo_obj, ts, &tmp); - ts->key = eina_stringshare_add(_STYLE_USER); - o->styles = eina_list_append(o->styles, ts); + + o->format_changed = EINA_TRUE; + _evas_textblock_invalidate_all(o); + _evas_textblock_changed(o, eo_obj); + efl_event_callback_call(eo_obj, EFL_CANVAS_TEXT_EVENT_CHANGED, NULL); } EAPI const Evas_Textblock_Style* @@ -7320,6 +7337,7 @@ evas_object_textblock_style_user_peek(const Eo *eo_obj) evas_object_async_block(obj); Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); Evas_Textblock_Style *ts = _style_by_key_find(o, _STYLE_USER); + return ts; } @@ -7329,8 +7347,18 @@ evas_object_textblock_style_user_pop(Eo *eo_obj) EINA_SAFETY_ON_NULL_RETURN(eo_obj); Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); + Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); + Evas_Textblock_Style *ts = _style_by_key_find(o, _STYLE_USER); - efl_canvas_text_style_set(eo_obj, _STYLE_USER, NULL); + if (ts) + { +
[EGIT] [core/efl] master 01/02: evas textblock: update format nodes when a Evas Textblock Style is updated
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f437a3075a867b2a62e571f0c4f39450f3dcf835 commit f437a3075a867b2a62e571f0c4f39450f3dcf835 Author: Youngbok Shin Date: Wed May 16 20:21:08 2018 +0300 evas textblock: update format nodes when a Evas Textblock Style is updated Summary: A style tag among a text has to be replcaed by its matched tag when a format node is created. If the matched tag is changed, format nodes should be updated. But, if a style text for Evas Textblock Style is changed, related format nodes are not updated without setting new text. The patch changes to update format nodes when new style text is set. @fix Test Plan: Included in Evas Test Suite. Reviewers: raster, tasn, herdsman, subodh6129, zmike Subscribers: zmike, cedric, z-wony, Blackmole Tags: #efl Differential Revision: https://phab.enlightenment.org/D4697 Committer's note: rebased. --- src/lib/evas/canvas/evas_object_textblock.c | 82 ++--- src/tests/evas/evas_test_textblock.c| 10 2 files changed, 61 insertions(+), 31 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 1b66ce507b..9ed2a33918 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -766,6 +766,7 @@ static Eina_Bool _evas_textblock_cursor_format_is_visible_get(const Efl_Text_Cur static void _evas_textblock_cursor_at_format_set(Efl_Text_Cursor_Cursor *cur, const Evas_Object_Textblock_Node_Format *fmt); static void _evas_textblock_cursor_init(Efl_Text_Cursor_Cursor *cur, const Evas_Object *tb); static Evas_Filter_Program *_format_filter_program_get(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Format *fmt); +static const char *_textblock_format_node_from_style_tag(Efl_Canvas_Text_Data *o, Evas_Object_Textblock_Node_Format *fnode, const char *format, size_t format_len); #ifdef HAVE_HYPHEN /* Hyphenation */ #include "evas_textblock_hyphenation.x" @@ -6954,6 +6955,47 @@ evas_textblock_style_free(Evas_Textblock_Style *ts) free(ts); } +static void +_evas_textblock_update_format_nodes_from_style_tag(Efl_Canvas_Text_Data *o) +{ + Evas_Object_Textblock_Node_Format *fnode = o->format_nodes; + + if (!o) + { +ERR("The given address Efl_Canvas_Text_Data is NULL"); +return; + } + + while (fnode) + { +const char *match; +size_t format_len = eina_stringshare_strlen(fnode->orig_format); +/* Is this safe to use alloca here? Strings might possibly get large */ + +if (fnode->own_closer && +(format_len > 0) && (fnode->orig_format[format_len - 1] == '/')) + { + format_len--; + } + +match = _textblock_format_node_from_style_tag(o, fnode, fnode->orig_format, + format_len); + +if (match && fnode->format && strcmp(match, fnode->format)) + { + if ((*match == '+') || (*match == '-')) + { + match++; + while (*match == ' ') match++; + } + fnode->is_new = EINA_TRUE; + eina_stringshare_replace(&fnode->format, match); + } + +fnode = _NODE_FORMAT(EINA_INLIST_GET(fnode)->next); + } +} + EAPI void evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) { @@ -6968,11 +7010,8 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) EINA_LIST_FOREACH(ts->objects, l, eo_obj) { -Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); evas_object_async_block(obj); -_evas_textblock_invalidate_all(o); -_evas_textblock_changed(o, eo_obj); } _style_replace(ts, text); @@ -7095,6 +7134,14 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) p++; } } + + EINA_LIST_FOREACH(ts->objects, l, eo_obj) + { +Efl_Canvas_Text_Data *o = efl_data_scope_get(eo_obj, MY_CLASS); +_evas_textblock_update_format_nodes_from_style_tag(o); +_evas_textblock_invalidate_all(o); +_evas_textblock_changed(o, eo_obj); + } } EAPI const char * @@ -7167,34 +7214,7 @@ _textblock_style_generic_set(Evas_Object *eo_obj, Evas_Textblock_Style *ts, } *obj_ts = ts; - Evas_Object_Textblock_Node_Format *fnode = o->format_nodes; - while (fnode) - { -const char *match; -size_t format_len = eina_stringshare_strlen(fnode->orig_format); -/* Is this safe to use a
[EGIT] [core/efl] master 02/02: evas textblock: manage default style properly for new interfaces
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f17cae08e6841bace7db1ab903d4a5841435a6f4 commit f17cae08e6841bace7db1ab903d4a5841435a6f4 Author: Youngbok Shin Date: Wed May 16 20:56:27 2018 +0300 evas textblock: manage default style properly for new interfaces Summary: Calling efl_canvas_text_style_set() with empty key means setting a default style to object. But, it counldn't store style as default properly. It caused a crash issue from elementary_test. @fix Test Plan: New test case is included. Run test suite. Or, 1. Run elementary_test 2. Find and launch "Image Zoomable animation" test. 3. Close the image test window. 4. See the crash issue. Reviewers: raster, herdsman, jpeg, cedric, zmike Subscribers: zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D5692 Committer's note: rebased and removed unrelated test. --- src/lib/evas/canvas/evas_object_textblock.c | 9 +- src/tests/evas/evas_test_textblock.c| 43 + 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 9ed2a33918..d1f6123562 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7295,7 +7295,14 @@ _efl_canvas_text_style_set(Eo *eo_obj, Efl_Canvas_Text_Data *o, const char *key, ts = evas_textblock_style_new(); evas_textblock_style_set(ts, style); ts->key = eina_stringshare_add(key); -o->styles = eina_list_append(o->styles, ts); + +/* If the given key value is NULL, newly created Evas Textblock Style + * has to be assigned to o->style. */ +if (ts->key) + o->styles = eina_list_append(o->styles, ts); +else + o->style = ts; + _textblock_style_generic_set(eo_obj, ts, &tmp); } else if (ts && style) diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 03e92adb9a..715ec1fd33 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -4480,6 +4480,48 @@ EFL_START_TEST(evas_textblock_annotation) } EFL_END_TEST; +#define START_EFL_CANVAS_TEXT_TEST() \ + Evas *evas; \ + Eo *txt; \ + Efl_Text_Cursor_Cursor *cur; \ + evas = EVAS_TEST_INIT_EVAS(); \ + evas_font_hinting_set(evas, EVAS_FONT_HINTING_AUTO); \ + txt = efl_add(EFL_CANVAS_TEXT_CLASS, evas); \ + fail_if(!txt); \ + efl_canvas_text_legacy_newline_set(txt, EINA_FALSE); \ + efl_canvas_text_style_set(txt, NULL, style_buf); \ + fail_if(!efl_canvas_text_style_get(txt, NULL) || \ + strcmp(style_buf, efl_canvas_text_style_get(txt, NULL))); \ + cur = efl_text_cursor_new(txt); \ + fail_if(!cur); \ +do \ +{ \ +} \ +while (0) + +#define END_EFL_CANVAS_TEXT_TEST() \ +do \ +{ \ + efl_text_cursor_free(txt, cur); \ + efl_del(txt); \ + evas_free(evas); \ +} \ +while (0) + +EFL_START_TEST(efl_canvas_text_simple) +{ + START_EFL_CANVAS_TEXT_TEST(); + + /* It is simple test for Efl_Canvas_Text. +* The main object is "txt". */ + const char *buf = "This is a test."; + efl_text_set(txt, buf); + fail_if(strcmp(efl_text_get(txt), buf)); + + END_EFL_CANVAS_TEXT_TEST(); +} +EFL_END_TEST + EFL_START_TEST(efl_canvas_text_cursor) { START_TB_TEST(); @@ -4541,6 +4583,7 @@ void evas_test_textblock(TCase *tc) #endif tcase_add_test(tc, evas_textblock_text_iface); tcase_add_test(tc, evas_textblock_annotation); + tcase_add_test(tc, efl_canvas_text_simple); tcase_add_test(tc, efl_canvas_text_cursor); } --
[EGIT] [core/efl] master 07/13: edje: don't give a wrong Edje data when an Edje object has group parts
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cae57ff51bc5942a28f4f98c75183dc262df5008 commit cae57ff51bc5942a28f4f98c75183dc262df5008 Author: Youngbok Shin Date: Fri May 25 10:09:13 2018 -0700 edje: don't give a wrong Edje data when an Edje object has group parts Summary: _edje_part_fetch() function gets an Edje which has the requested Edje_Real_Part. Basically, it gets main Edje of the given object. But, if a requested part is in a GROUP part, it gets the Edje of GROUP part. It shouldn't be passed to _edje_efl_text_text_get() function directly. @fix Test Plan: N/A Reviewers: herdsman, raster, cedric, woohyun Reviewed By: cedric Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6149 Reviewed-by: Cedric BAIL --- src/lib/edje/edje_util.c | 8 1 file changed, 8 insertions(+) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 71577832aa..7ab54bb4bd 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -6340,6 +6340,14 @@ edje_object_part_text_get(const Edje_Object *obj, const char *part) ERR("Invalid call on a non-text or non-textblock part: '%s' in group '%s'", part, ed->group); return NULL; } + + ed = _edje_fetch(obj); + if (!ed) + { +ERR("Failed to get Edje data from object: '%p'", obj); +return NULL; + } + return _edje_efl_text_text_get(obj, ed, part, EINA_TRUE, EINA_FALSE); } --
[EGIT] [core/efl] master 01/13: elementary textpath: improves text rendering quality of curved text
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=455775c2e32ba72919996cf9a876a89ac133029e commit 455775c2e32ba72919996cf9a876a89ac133029e Author: Youngbok Shin Date: Fri May 25 09:59:01 2018 -0700 elementary textpath: improves text rendering quality of curved text Summary: There was wrong logic for calculating # of slices, dt, dist of each segment. It caused bad rendering quality by putting too much slices on small text. In addition, textpath didn't care about smoothness of curve's slope changing. The patch fixes to check differences of previous points and next points for Evas Map. So, textpath can show more smoothly curved text. Also, it fixes "autofit" bug when text is much huge than given circle's size. @tix Test Plan: - I'll attach screenshots for comparing rendering quality. - To see "autofit" bug. 1. Run the following command. ELM_ACCEL=gl ELM_SCALE=2.0 elementary_test -to "efl.ui.textpath" 2. Toggle "autofit" check box. 3. See the bug case. Textpath can't show all text properly. Reviewers: raster, cedric, thiepha Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6195 Reviewed-by: Cedric BAIL --- src/lib/elementary/efl_ui_textpath.c | 181 --- 1 file changed, 148 insertions(+), 33 deletions(-) diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index c818380a5f..2896979373 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -47,6 +47,10 @@ struct _Efl_Ui_Textpath_Segment }; }; +/* If you need to draw slices using Evas Line, + * define the following debug flag manually. */ +//#define EFL_UI_TEXTPATH_LINE_DEBUG + struct _Efl_Ui_Textpath_Data { Evas_Object *text_obj; @@ -64,6 +68,9 @@ struct _Efl_Ui_Textpath_Data Eina_Inlist *segments; int total_length; +#ifdef EFL_UI_TEXTPATH_LINE_DEBUG + Eina_List *lines; +#endif }; #define EFL_UI_TEXTPATH_DATA_GET(o, sd) \ @@ -76,26 +83,25 @@ _deg_to_rad(double angle) } static void -_segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, Evas_Map *map, Eina_Bezier bezier) +_segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, double dt, double dist, + int w1, int cmp, Evas_Map *map, Eina_Bezier bezier, + int *last_x1, int *last_y1, int *last_x2, int *last_y2) { - int i, len, seg_len; + int i; double u0, u1, v0, v1; - double dist, t, dt; + double t; double px, py, px2, py2; double rad; Eina_Rect r; Eina_Vector2 vec, nvec, vec0, vec1, vec2, vec3; Eina_Matrix2 mat; +#ifdef EFL_UI_TEXTPATH_LINE_DEBUG + static Eina_Bool yello_color_flag = EINA_FALSE; + yello_color_flag = !yello_color_flag; +#endif - len = w2 - w1; r = efl_gfx_entity_geometry_get(pd->text_obj); - seg_len = eina_bezier_length_get(&bezier); - if (pd->autofit) - dt = len / (seg_len * (double) slice_no); - else - dt = 1.0 / (double) slice_no; - dist = len / (double)slice_no; rad = _deg_to_rad(90); eina_matrix2_values_set(&mat, cos(rad), -sin(rad), sin(rad), cos(rad)); @@ -117,19 +123,46 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, E vec2.x = (-vec.x + px); vec2.y = (-vec.y + py); + if (cmp == 0) + { +*last_x1 = (int) floor(vec1.x + r.x + 0.5); +*last_y1 = (int) floor(vec1.y + r.y + 0.5); +*last_x2 = (int) floor(vec2.x + r.x + 0.5); +*last_y2 = (int) floor(vec2.y + r.y + 0.5); + } + //add points to map for (i = 0; i < slice_no; i++) { +int mp0_x, mp0_y; +int mp1_x, mp1_y; +int mp2_x, mp2_y; +int mp3_x, mp3_y; +double next_dt = dt; + //v0, v3 vec0.x = vec1.x; vec0.y = vec1.y; vec3.x = vec2.x; vec3.y = vec2.y; +//UV +u0 = w1 + i * dist; +u1 = u0 + dist; +if (u1 > r.w) + u1 = r.w; +v0 = (double) 0; +v1 = (double) r.h; + +/* If u1 is modified not to exceed its end, + * modify next_dt according to changes of dist. */ +if (u1 < u0 + dist) + next_dt = dt * (u1 - u0) / dist; + //v1, v2 -t = ((double) (i + 1) * dt); +t = (double) (i * dt) + next_dt; eina_bezier_point_at(&bezier, t, &px, &py); -eina_bezier_point_at(&bezier, t + dt, &px2, &py2); +eina_bezier_point_at(&bezier, t + next_dt, &px2, &py2); vec.x = (px2 - px); vec.y = (py2 - py); @@ -143,21 +176,80 @@ _segment_draw(Efl_Ui_Textpath_Data *pd, int slice_no, int w1, int w2, int cmp, E
[EGIT] [core/efl] master 06/13: elementary widget: Do super's efl_gfx_color_set to apply color to widget itself
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6e6ed72921aa1fb114115e2202f92126ea04b25b commit 6e6ed72921aa1fb114115e2202f92126ea04b25b Author: Youngbok Shin Date: Fri May 25 10:08:21 2018 -0700 elementary widget: Do super's efl_gfx_color_set to apply color to widget itself Summary: The efl_gfx_color interface was not applied properly. The implementation code of evas_object_smart_color_set was moved to efl_gfx_color_set implementation code. But, these two functions are not same. In efl_gfx_color_set impl, it has to call super's color set to apply the given color values to widget object itself. This bug caused color_set/get test failure and the following bug. 1. elm_image_add 2. evas_object_color_set 3. elm_image_file_set 4. show. See the given color is not applied. It was applied in the past. Test Plan: color_set/get to elm_image object is included in test suite. Reviewers: raster, cedric, herdsman, woohyun Reviewed By: cedric Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6163 Reviewed-by: Cedric BAIL --- src/lib/elementary/efl_ui_widget.c| 2 ++ src/tests/elementary/elm_test_image.c | 23 +++ 2 files changed, 25 insertions(+) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 0f7b19f546..6140f40baa 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -997,6 +997,8 @@ _efl_ui_widget_efl_gfx_color_color_set(Eo *obj, Elm_Widget_Smart_Data *pd, int r if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 0, r, g, b, a)) return; + efl_gfx_color_set(efl_super(obj, MY_CLASS), r, g, b, a); + it = evas_object_smart_iterator_new(obj); EINA_ITERATOR_FOREACH(it, o) { diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c index 5fc727e303..109c56d122 100644 --- a/src/tests/elementary/elm_test_image.c +++ b/src/tests/elementary/elm_test_image.c @@ -195,6 +195,28 @@ EFL_START_TEST (elm_image_async_mmap) } EFL_END_TEST +EFL_START_TEST (elm_image_evas_object_color_set) +{ + Evas_Object *win, *image; + Eina_Bool ok; + Test_Data td; + Eina_File *f; + char path[PATH_MAX]; + int r = 128, g = 99, b = 3, a = 230; + int rr = 0, gg = 0, bb = 0, aa = 0; + + win = win_add(NULL, "image", ELM_WIN_BASIC); + + image = elm_image_add(win); + evas_object_color_set(image, r, g, b, a); + evas_object_color_get(image, &rr, &gg, &bb, &aa); + ck_assert(r == rr); + ck_assert(g == gg); + ck_assert(b == bb); + ck_assert(a == aa); +} +EFL_END_TEST + EFL_START_TEST (efl_ui_image_icon) { Evas_Object *win, *image; @@ -225,5 +247,6 @@ void elm_test_image(TCase *tc) tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_image_async_path); tcase_add_test(tc, elm_image_async_mmap); + tcase_add_test(tc, elm_image_evas_object_color_set); tcase_add_test(tc, efl_ui_image_icon); } --
[EGIT] [core/efl] master 01/01: elementary textpath: update Evas map when text is updated
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8d249c9445b1ebaea22fc711e3778b5623445c73 commit 8d249c9445b1ebaea22fc711e3778b5623445c73 Author: Youngbok Shin Date: Mon May 28 14:48:41 2018 +0900 elementary textpath: update Evas map when text is updated Summary: Evas map was not updated when text was updated. @fix Test Plan: 1. Run the following test case. elementary_test -to "efl.ui.textpath" 2. Toggle short text. 3. See a long line from the end of text which is wrong. If you change angle, Evas map will be updated properly. But, it should be updated when text is updated. Reviewers: raster, cedric, thiepha, Hermet Reviewed By: Hermet Subscribers: Hermet, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6216 --- src/lib/elementary/efl_ui_textpath.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index 2896979373..a378bdf7a9 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -570,6 +570,7 @@ _textpath_text_set_internal(Eo *obj, Efl_Ui_Textpath_Data *pd, const char *part, if (!text) text = ""; ret = edje_object_part_text_set(pd->text_obj, part, text); _ellipsis_set(pd); + _sizing_eval(pd); return ret; } --
[EGIT] [core/efl] master 01/01: edje: fix an issue "description.text.text" is not shown
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a99f3374135fb3728fecdaed611ede511b15b8e1 commit a99f3374135fb3728fecdaed611ede511b15b8e1 Author: Youngbok Shin Date: Mon Jun 11 16:19:38 2018 +0300 edje: fix an issue "description.text.text" is not shown Summary: "description.text.text" is not shown after applying a patch for supporting text translation of Textblock part. @fix T6997 Test Plan: - Try to show a TEXTBLOCK part which has built-in text. ex) textblock { scale; desc { "default"; text { style: "my_style"; text: "You can't see this text without this patch"; } } } Reviewers: Hermet, subodh6129, herdsman Subscribers: cedric, #committers, zmike Tags: #efl Maniphest Tasks: T6997 Differential Revision: https://phab.enlightenment.org/D6257 --- src/lib/edje/edje_textblock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_textblock.c b/src/lib/edje/edje_textblock.c index 9b9f17cc25..312238735c 100644 --- a/src/lib/edje/edje_textblock.c +++ b/src/lib/edje/edje_textblock.c @@ -438,6 +438,7 @@ _edje_part_recalc_single_textblock(FLOAT_T sc, else { ep->typedata.text->text_source = NULL; + text = NULL; if (chosen_desc->text.domain) { if (!chosen_desc->text.text.translated) --
[EGIT] [core/efl] master 01/01: edje: fix text set/get issue without edje calculation
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=69b5d67367b8ae16d6e98734d2b07e40725d4a0f commit 69b5d67367b8ae16d6e98734d2b07e40725d4a0f Author: Youngbok Shin Date: Fri Jun 22 12:15:11 2018 +0300 edje: fix text set/get issue without edje calculation Summary: Some changes broke really basical function behavior of text. I couldn't get text from an edje object which I just set to the given edje object. In the past code, edje called recalc function before trying to get text. So, this patch bring that code to fix this issue. @fix Test Plan: Included. Run "make check" Reviewers: herdsman, raster, cedric, woohyun, devilhorns Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6364 --- src/Makefile_Edje.am | 2 ++ src/lib/edje/edje_util.c | 3 +++ src/tests/edje/data/test_textblock.edc | 20 src/tests/edje/edje_test_edje.c| 20 4 files changed, 45 insertions(+) diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index 87d67b5e89..745da03501 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -300,6 +300,7 @@ tests/edje/data/test_messages.edc \ tests/edje/data/test_signals.edc \ tests/edje/data/test_signal_callback_del_full.edc \ tests/edje/data/test_text_cursor.edc \ +tests/edje/data/test_textblock.edc \ tests/edje/data/filter.lua @@ -344,6 +345,7 @@ EDJE_TEST_FILES = tests/edje/data/test_layout.edj \ tests/edje/data/test_signals.edj \ tests/edje/data/test_signal_callback_del_full.edj \ tests/edje/data/test_text_cursor.edj \ + tests/edje/data/test_textblock.edj \ $(NULL) CLEANFILES += $(EDJE_TEST_FILES) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 7ab54bb4bd..98d6c78023 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -2052,6 +2052,9 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part, if ((!ed) || (!part)) return NULL; + /* Need to recalc before providing the object. */ + _edje_recalc_do(ed); + rp = _edje_real_part_recursive_get(&ed, part); if (!rp) return NULL; if ((rp->type != EDJE_RP_TYPE_TEXT) || diff --git a/src/tests/edje/data/test_textblock.edc b/src/tests/edje/data/test_textblock.edc new file mode 100644 index 00..e3569a6467 --- /dev/null +++ b/src/tests/edje/data/test_textblock.edc @@ -0,0 +1,20 @@ +collections { + styles { + style { name: "tb_style"; + base: "font=Sans font_size=20 color=#fff"; + } + } + group { name: "test_textblock"; + parts { + part { name: "text"; +type: TEXTBLOCK; +description { state: "default" 0.0; + min: 300 300; + text { + style: "tb_style"; + } +} + } + } + } +} diff --git a/src/tests/edje/edje_test_edje.c b/src/tests/edje/edje_test_edje.c index 3a39becdb1..0f98e3cb8d 100644 --- a/src/tests/edje/edje_test_edje.c +++ b/src/tests/edje/edje_test_edje.c @@ -1072,6 +1072,25 @@ EFL_START_TEST(edje_test_part_caching) } EFL_END_TEST +EFL_START_TEST(edje_test_textblock) +{ + Evas *evas; + Evas_Object *obj; + const char *buf = "Hello"; + const char *txt; + + evas = EDJE_TEST_INIT_EVAS(); + + obj = edje_object_add(evas); + fail_unless(edje_object_file_set(obj, test_layout_get("test_textblock.edj"), "test_textblock")); + edje_object_part_text_set(obj, "text", buf); + txt = edje_object_part_text_get(obj, "text"); + fail_if(!txt || strcmp(txt, buf)); + + EDJE_TEST_FREE_EVAS(); +} +EFL_END_TEST + void edje_test_edje(TCase *tc) { tcase_add_test(tc, edje_test_edje_init); @@ -1100,4 +1119,5 @@ void edje_test_edje(TCase *tc) tcase_add_test(tc, edje_test_signal_callback_del_full); tcase_add_test(tc, edje_test_text_cursor); tcase_add_test(tc, edje_test_part_caching); + tcase_add_test(tc, edje_test_textblock); } --
[EGIT] [core/efl] master 01/01: Evas Textblock: Don't convert to after changing text
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f6acd6f9e4de945f1eee7fe6cd7cd55cff570eb9 commit f6acd6f9e4de945f1eee7fe6cd7cd55cff570eb9 Author: Youngbok Shin Date: Mon Jul 2 16:17:33 2018 +0300 Evas Textblock: Don't convert to after changing text Summary: It was only happened when legacy newline is enabled. By default, legacy newline is enabled. As I know, legacy newline option has to change textblock's internal behavior. But, it shouldn't change the given original text. It fixes T3399. Test Plan: A Test case is included in Evas test suite. Reviewers: Jaehyun_Cho, z-wony, tasn, woohyun, herdsman, Blackmole, devilhorns Subscribers: #committers, zmike, raster, cedric, jpeg Tags: #efl Maniphest Tasks: T3399 Differential Revision: https://phab.enlightenment.org/D3874 --- src/lib/evas/canvas/evas_object_textblock.c | 2 +- src/tests/evas/evas_test_textblock.c| 15 +++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index b9712a2243..652ac3e631 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -10836,7 +10836,7 @@ _evas_textblock_cursor_format_append(Efl_Text_Cursor_Cursor *cur, Eina_Unicode insert_char; /* Insert a visual representation according to the type of the format */ -if (_IS_PARAGRAPH_SEPARATOR(o, format)) +if (_IS_PARAGRAPH_SEPARATOR_SIMPLE(format)) insert_char = _PARAGRAPH_SEPARATOR; else if (_IS_LINE_SEPARATOR(format)) insert_char = _NEWLINE; diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 715ec1fd33..1f6cb139b2 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2977,6 +2977,21 @@ EFL_START_TEST(evas_textblock_editing) evas_textblock_cursor_paragraph_first(cur); fail_if(evas_textblock_cursor_paragraph_next(cur)); + /* Test cursor range delete with tags when legacy newline is enabled. +* After deleting first tag, the second tag shouldn't be changed to */ + evas_object_textblock_legacy_newline_set(tb, EINA_TRUE); + evas_object_textblock_text_markup_set(tb, "AB"); + evas_textblock_cursor_paragraph_first(cur); + evas_textblock_cursor_paragraph_first(main_cur); + evas_textblock_cursor_pos_set(main_cur, 2); + ck_assert_str_eq(evas_textblock_cursor_range_text_get(cur, main_cur, EVAS_TEXTBLOCK_TEXT_MARKUP), "A"); + + evas_textblock_cursor_range_delete(cur, main_cur); + ck_assert_str_eq(evas_object_textblock_text_markup_get(tb), "B"); + + /* Restore legacy newline disabled setting */ + evas_object_textblock_legacy_newline_set(tb, EINA_FALSE); + { /* Limit to 1000 iterations so we'll never get into an infinite loop, * even if broken */ --
[EGIT] [core/efl] master 01/01: evas textblock: adds missing legacy types
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=61e8834acc24da7fc667ae66839e8d26617e11db commit 61e8834acc24da7fc667ae66839e8d26617e11db Author: Youngbok Shin Date: Thu Jul 12 12:09:26 2018 +0300 evas textblock: adds missing legacy types Summary: Adds missing legacy types. The following types were generated in "*.eo.legacy.h" by Eolian. - Evas_Textblock evas_textblock.eo.legacy.h:7:typedef Eo Evas_Textblock; - Evas_Textblock_Node_Format evas_textblock.eo.legacy.h:14:typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format; @fix Test Plan: N/A Reviewers: raster, cedric, herdsman, devilhorns Subscribers: #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6529 --- src/lib/evas/canvas/evas_textblock_legacy.h | 9 + 1 file changed, 9 insertions(+) diff --git a/src/lib/evas/canvas/evas_textblock_legacy.h b/src/lib/evas/canvas/evas_textblock_legacy.h index f55691d48b..0d84075fa0 100644 --- a/src/lib/evas/canvas/evas_textblock_legacy.h +++ b/src/lib/evas/canvas/evas_textblock_legacy.h @@ -127,6 +127,7 @@ * * @{ */ +typedef Eo Evas_Textblock; /** * @typedef Evas_Textblock_Style @@ -157,6 +158,14 @@ typedef struct _Efl_Text_Cursor_Cursor Evas_Textblock_Cursor; typedef struct _Evas_Textblock_Node_Format Evas_Object_Textblock_Node_Format; /** + * @typedef Evas_Textblock_Node_Format + * A format node. + * + * XXX: Adapter for legacy. + */ +typedef struct _Evas_Textblock_Node_Format Evas_Textblock_Node_Format; + +/** * @typedef Evas_Textblock_Rectangle * General-purpose rectangle that represents some geometry in this object. * --
[EGIT] [core/efl] master 01/01: evas textblock: add/apply cursor cluster APIs based on grapheme cluster
discomfitor pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=517018e00897f61136418861563a49144a5fe39a commit 517018e00897f61136418861563a49144a5fe39a Author: Youngbok Shin Date: Mon Aug 20 07:21:53 2018 -0400 evas textblock: add/apply cursor cluster APIs based on grapheme cluster 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: https://phab.enlightenment.org/D5490 --- src/Makefile_Evas.am |8 +- src/lib/edje/edje_entry.c | 51 +- src/lib/efl/interfaces/efl_text_cursor.eo | 25 + src/lib/evas/canvas/efl_canvas_text.eo |3 + src/lib/evas/canvas/evas_object_textblock.c| 276 +++- src/lib/evas/canvas/evas_textblock_legacy.h| 26 + src/static_libs/libunibreak/ChangeLog | 92 ++ src/static_libs/libunibreak/LICENCE|5 +- src/static_libs/libunibreak/NEWS |7 + src/static_libs/libunibreak/README.md | 14 +- src/static_libs/libunibreak/graphemebreak.c| 283 + .../libunibreak/{wordbreak.h => graphemebreak.h} | 47 +- src/static_libs/libunibreak/graphemebreakdata.c| 1337 src/static_libs/libunibreak/graphemebreakdef.h | 82 ++ src/static_libs/libunibreak/linebreak.c| 28 +- src/static_libs/libunibreak/linebreak.h|1 - src/static_libs/libunibreak/linebreakdef.c |1 - src/static_libs/libunibreak/linebreakdef.h |1 - src/static_libs/libunibreak/unibreakbase.c |3 +- src/static_libs/libunibreak/unibreakbase.h |5 +- src/static_libs/libunibreak/unibreakdef.c |3 +- src/static_libs/libunibreak/unibreakdef.h |3 +- src/static_libs/libunibreak/wordbreak.c| 33 +- src/static_libs/libunibreak/wordbreak.h|9 +- src/static_libs/libunibreak/wordbreakdef.h |9 +- src/tests/evas/evas_test_textblock.c | 24 +- 26 files changed, 2246 insertions(+), 130 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 0699dde533..b09521cb72 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -193,7 +193,10 @@ static_libs/libunibreak/linebreak.h \ static_libs/libunibreak/linebreakdef.h \ static_libs/libunibreak/wordbreakdef.h \ static_libs/libunibreak/wordbreak.h \ -static_libs/libunibreak/wordbreakdata.c +static_libs/libunibreak/wordbreakdata.c \ +static_libs/libunibreak/graphemebreak.h \ +static_libs/libunibreak/graphemebreakdef.h \ +static_libs/libunibreak/graphemebreakdata.c # Linebreak lib_evas_libevas_la_SOURCES = \ @@ -202,7 +205,8 @@ static_libs/libunibreak/unibreakdef.c \ static_libs/libunibreak/linebreak.c \ static_libs/libunibreak/linebreakdata.c \ static_libs/libunibreak/linebreakdef.c \ -static_libs/libunibreak/wordbreak.c +static_libs/libunibreak/wordbreak.c \ +static_libs/libunibreak/graphemebreak.c # Main lib_evas_libevas_la_SOURCES += \ diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 6c1f8960ff..1ad3c30b65 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -536,7 +536,7 @@ _curs_jump_line(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en, int ln) if (!evas_object_textblock_line_number_geometry_get(o, ln, &lx, &ly, &lw, &lh)) return EINA_FALSE; - if (evas_textblock_cursor_char_coord_set(c, cx, ly + (lh / 2))) + if (evas_textblock_cursor_cluster_coord_set(c, cx, ly + (lh / 2))) return EINA_TRUE; evas_textblock_cursor_line_set(c, ln); if (cx < (lx + (lw / 2))) @@ -1607,24 +1607,33 @@ _delete_emit(Edje *ed, Evas_Textblock_Cursor *c, Entry *en, size_t pos, ERR("Running very low on memory"); return; } - char *tmp = evas_textblock_cursor_content_get(c); + char *tmp = NULL; info->insert = EINA_FALSE; if (backspace) { info->change.del.start = pos - 1; info->change.del.end = pos; +tmp = evas_textblock_cursor_content_get(c); +evas_textblock_cursor_char_delete(c); } else { -info->change.del.start = pos + 1; +Evas_Textblock_Cursor
[EGIT] [core/efl] master 01/03: elementary: remove meaningless memory allocation and leaking
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6a8f2ce86316be8ce2d7f856706822bd92338cec commit 6a8f2ce86316be8ce2d7f856706822bd92338cec Author: Youngbok Shin Date: Fri Sep 21 07:23:36 2018 + elementary: remove meaningless memory allocation and leaking 'evt_data' was allocated. Actually, it was not used in anywhere in its function. @fix Differential Revision: https://phab.enlightenment.org/D7086 --- src/lib/elementary/elc_fileselector.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c index 94abf68a82..1cbb41cea8 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c @@ -1951,19 +1951,14 @@ _elm_fileselector_efl_object_constructor(Eo *obj, Elm_Fileselector_Data *sd) static Eina_Bool _from_efl_event_call(Elm_Fileselector *fs, const Efl_Event_Description *evt_desc, Efl_Model *model) { - Legacy_Event_Path_Then_Data *evt_data; Eina_Value *fetch; char *path; - evt_data = calloc(1, sizeof(Legacy_Event_Path_Then_Data)); - evt_data->eo_obj = fs; - evt_data->evt_desc = evt_desc; - // Call legacy smart callback with path fetch = efl_model_property_get(model, "path"); path = eina_value_to_string(fetch); - _event_to_legacy_call(evt_data->eo_obj, evt_data->evt_desc, path); + _event_to_legacy_call(fs, evt_desc, path); // Call Eo event with model return efl_event_callback_call(fs, evt_desc, model); --
[EGIT] [core/efl] master 01/01: evas cache: add more null check for cache
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ed621d700302d267963aa7de72ad32942a7b48db commit ed621d700302d267963aa7de72ad32942a7b48db Author: Youngbok Shin Date: Fri Sep 21 16:32:07 2018 +0900 evas cache: add more null check for cache Summary: The 'cache' pointer is checked against null but then dereferenced anyway. It needs to add null checking conditions. Test Plan: N/A Reviewers: raster, cedric, Hermet, zmike Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7084 --- src/lib/evas/cache/evas_cache_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/evas/cache/evas_cache_image.c b/src/lib/evas/cache/evas_cache_image.c index 52440a23eb..f52e12ae91 100644 --- a/src/lib/evas/cache/evas_cache_image.c +++ b/src/lib/evas/cache/evas_cache_image.c @@ -183,17 +183,17 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie) _evas_cache_image_lru_del(ie); _evas_cache_image_lru_nodata_del(ie); - cache->func.destructor(ie); + if ((cache) && (cache->func.destructor)) cache->func.destructor(ie); FREESTRC(ie->cache_key); FREESTRC(ie->file); FREESTRC(ie->key); if (ie->f && ie->flags.given_mmap) eina_file_close(ie->f); ie->cache = NULL; - cache->func.surface_delete(ie); + if ((cache) && (cache->func.surface_delete)) cache->func.surface_delete(ie); SLKD(ie->lock); SLKD(ie->lock_cancel); - cache->func.dealloc(ie); + if ((cache) && (cache->func.dealloc)) cache->func.dealloc(ie); } #if 0 --
[EGIT] [core/efl] master 01/01: elementary: fix memory leak from Efl.Ui.Layout.Object
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0098aa66705f1736f093bbf0f15302c9c8ac3598 commit 0098aa66705f1736f093bbf0f15302c9c8ac3598 Author: Youngbok Shin Date: Fri Sep 21 16:50:30 2018 +0900 elementary: fix memory leak from Efl.Ui.Layout.Object Summary: The 'data' could not be added to hash in a condition. It has to be free'd before ending the function. @fix Test Plan: N/A Reviewers: cedric, raster, Hermet, zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7083 --- src/lib/elementary/efl_ui_layout_object.c | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout_object.c b/src/lib/elementary/efl_ui_layout_object.c index fd11223f2e..b3f5796f16 100644 --- a/src/lib/elementary/efl_ui_layout_object.c +++ b/src/lib/elementary/efl_ui_layout_object.c @@ -2165,12 +2165,16 @@ _efl_ui_layout_object_efl_ui_model_connect_connect(Eo *obj EINA_UNUSED, Efl_Ui_L } // Update display right away if possible - if (!pd->connect.model) return ; + if (pd->connect.model) + { +if (hash == pd->connect.signals) + _efl_ui_layout_view_model_signal_update(pd, data, sprop); +else + _efl_ui_layout_view_model_property_update(pd, data, sprop); + } - if (hash == pd->connect.signals) - _efl_ui_layout_view_model_signal_update(pd, data, sprop); - else - _efl_ui_layout_view_model_property_update(pd, data, sprop); + if (!sprop) + free(data); } EOLIAN static void --
[EGIT] [core/efl] master 01/01: elementary_test: use snprintf to prevent memory overflow in test_efl_ui_text
netstar pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e9e63f3c0d98346764aee01add601dd8df4af8d4 commit e9e63f3c0d98346764aee01add601dd8df4af8d4 Author: Youngbok Shin Date: Mon Sep 24 11:17:26 2018 +0100 elementary_test: use snprintf to prevent memory overflow in test_efl_ui_text Summary: To prevent memory overflow, use snprintf instead of sprintf. Test Plan: N/A Reviewers: raster, cedric, zmike, Hermet, netstar Reviewed By: netstar Subscribers: netstar, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7095 --- src/bin/elementary/test_efl_ui_text.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 9ad0e9a50a..6cfe0af008 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -218,7 +218,7 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_text_cursor_position_set(en, cur, 2); efl_text_cursor_item_insert(en, cur, "emoticon/happy", "size=32x32"); efl_text_cursor_position_set(en, cur, 50); - sprintf(buf, "file://%s/images/sky_01.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "file://%s/images/sky_01.jpg", elm_app_data_dir_get()); efl_text_cursor_item_insert(en, cur, buf, "size=32x32"); efl_text_cursor_position_set(en, main_cur, 5); @@ -416,18 +416,18 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_add(EFL_UI_TEXT_FACTORY_EMOTICONS_CLASS, en); // Test assigning file path source - sprintf(buf, "%s/images/sky_01.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/images/sky_01.jpg", elm_app_data_dir_get()); efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory, images[0], buf, NULL); - sprintf(buf, "%s/images/logo.png", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/images/logo.png", elm_app_data_dir_get()); efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory, images[1], buf, NULL); - sprintf(buf, "%s/images/mystrale.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/images/mystrale.jpg", elm_app_data_dir_get()); efl_ui_text_factory_images_matches_add(factories[FACTORY_IMAGE].item_factory, images[2], buf, NULL); // Open EET source w/ key - sprintf(buf, "%s/images/image_items.eet", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "%s/images/image_items.eet", elm_app_data_dir_get()); f = eina_file_open(buf, EINA_FALSE); if (f) { @@ -460,7 +460,7 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_text_cursor_item_insert(en, cur, "emoticon/happy", "size=32x32"); efl_text_cursor_position_set(en, cur, 50); - sprintf(buf, "file://%s/images/sky_01.jpg", elm_app_data_dir_get()); + snprintf(buf, sizeof(buf), "file://%s/images/sky_01.jpg", elm_app_data_dir_get()); efl_text_cursor_item_insert(en, cur, buf, "size=32x32"); efl_text_cursor_position_set(en, main_cur, 5); --
[EGIT] [core/efl] master 01/01: elementary entry: apply scale to all edje objects
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=75296e32df14610ec5d49316cee1966eb99f5cb2 commit 75296e32df14610ec5d49316cee1966eb99f5cb2 Author: Youngbok Shin Date: Thu Oct 4 18:53:36 2018 +0900 elementary entry: apply scale to all edje objects Summary: When an entry is scrollable, its resize object is scr_edje. So, to apply scale properly, elm_entry needs to apply scale to its entry_edje, too. @fix Test Plan: Apply scale to scrollable entry Reviewers: herdsman, woohyun, cedric, eagleeye Reviewed By: eagleeye Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7140 --- src/lib/elementary/elm_entry.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index c15b02da52..1bc579817c 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -882,6 +882,12 @@ _elm_entry_efl_ui_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) edje_object_scale_set (wd->resize_obj, efl_gfx_entity_scale_get(obj) * elm_config_scale_get()); + if (sd->scroll) + { +edje_object_scale_set + (sd->entry_edje, +efl_gfx_entity_scale_get(obj) * elm_config_scale_get()); + } _mirrored_set(obj, efl_ui_mirrored_get(obj)); --
[EGIT] [core/efl] master 01/01: eina debug: fix a double unlock issue
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=038346dce0177d474a902602b553b0306bd668d5 commit 038346dce0177d474a902602b553b0306bd668d5 Author: Youngbok Shin Date: Thu Oct 4 18:58:04 2018 +0900 eina debug: fix a double unlock issue Summary: It was caught by Covertity. This patch will remove a potential double unlock issue. @fix Test Plan: N/A Reviewers: zmike, raster, cedric, Hermet, eagleeye Reviewed By: eagleeye Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7137 --- src/lib/eina/eina_debug_cpu.c | 9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/eina/eina_debug_cpu.c b/src/lib/eina/eina_debug_cpu.c index b4c3cf49c4..931139f5c0 100644 --- a/src/lib/eina/eina_debug_cpu.c +++ b/src/lib/eina/eina_debug_cpu.c @@ -281,11 +281,14 @@ _stop_cpu_thread(void) { usleep(1000); eina_lock_take(&_sysmon_lock); -if (_eina_debug_cpu_active == -1) break; +if (_eina_debug_cpu_active == -1) + { + _eina_debug_cpu_active = 0; + eina_lock_release(&_sysmon_lock); + break; + } eina_lock_release(&_sysmon_lock); } - _eina_debug_cpu_active = 0; - eina_lock_release(&_sysmon_lock); } static Eina_Bool --
[EGIT] [core/efl] master 01/01: elementary textpath: support legacy APIs
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=32504a8cfa8639a8ff80a28bc308c73d98c25e39 commit 32504a8cfa8639a8ff80a28bc308c73d98c25e39 Author: Youngbok Shin Date: Fri Oct 12 15:42:31 2018 +0900 elementary textpath: support legacy APIs Summary: Efl.Ui.Textpath was added when we were developing new interfaces. So, basically, it does not support 'legacy' APIs. ex) elm_textpath_add But, in Tizen, the legacy APIs had been delivered in old version of EFL. To reduce maintainning cost between the platforms, this patch will be helpful. @feature Test Plan: N/A Reviewers: Hermet, woohyun, zmike, cedric, herdsman Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7033 --- src/Makefile_Elementary.am | 3 +++ src/lib/elementary/Elementary.h | 2 +- src/lib/elementary/efl_ui_textpath.c | 29 src/lib/elementary/efl_ui_textpath.eo| 1 + src/lib/elementary/efl_ui_textpath_legacy.eo | 9 + src/lib/elementary/elm_textpath.h| 15 ++ src/lib/elementary/elm_textpath_legacy.h | 15 ++ 7 files changed, 73 insertions(+), 1 deletion(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 4e906e1190..865c623841 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -56,6 +56,7 @@ elm_public_eolian_files = \ lib/elementary/efl_ui_text_factory_emoticons.eo \ lib/elementary/efl_ui_text_factory_fallback.eo \ lib/elementary/efl_ui_textpath.eo \ + lib/elementary/efl_ui_textpath_legacy.eo \ lib/elementary/efl_ui_translatable.eo \ lib/elementary/efl_ui_clock.eo \ lib/elementary/efl_ui_cursor.eo \ @@ -630,6 +631,8 @@ includesub_HEADERS = \ lib/elementary/elm_sys_notify.h \ lib/elementary/elm_table.h \ lib/elementary/elm_table_legacy.h \ + lib/elementary/elm_textpath.h \ + lib/elementary/elm_textpath_legacy.h \ lib/elementary/elm_theme.h \ lib/elementary/elm_thumb.h \ lib/elementary/elm_thumb_common.h \ diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index 9ede3d650b..97ef0838d8 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -160,7 +160,6 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include # include # include # include @@ -269,6 +268,7 @@ typedef Eo Efl_Ui_Focus_Manager; #include #include #include +#include #include #include #include diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c index 20b04092b0..be6de4de36 100644 --- a/src/lib/elementary/efl_ui_textpath.c +++ b/src/lib/elementary/efl_ui_textpath.c @@ -758,3 +758,32 @@ ELM_PART_OVERRIDE_TEXT_GET(efl_ui_textpath, EFL_UI_TEXTPATH, Efl_Ui_Textpath_Dat EFL_CANVAS_GROUP_ADD_OPS(efl_ui_textpath) #include "efl_ui_textpath.eo.c" + +#include "efl_ui_textpath_legacy.eo.h" + +#define MY_CLASS_NAME_LEGACY "elm_textpath" +/* Legacy APIs */ + +static void +_efl_ui_textpath_legacy_class_constructor(Efl_Class *klass) +{ + evas_smart_legacy_type_register(MY_CLASS_NAME_LEGACY, klass); +} + +EOLIAN static Eo * +_efl_ui_textpath_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) +{ + obj = efl_constructor(efl_super(obj, EFL_UI_TEXTPATH_LEGACY_CLASS)); + efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); + return obj; +} + +EAPI Evas_Object * +elm_textpath_add(Evas_Object *parent) +{ + EINA_SAFETY_ON_NULL_RETURN_VAL(parent, NULL); + return elm_legacy_add(EFL_UI_TEXTPATH_LEGACY_CLASS, parent); +} + +#include "efl_ui_textpath_legacy.eo.c" + diff --git a/src/lib/elementary/efl_ui_textpath.eo b/src/lib/elementary/efl_ui_textpath.eo index 8feca95bd5..d506d2b901 100644 --- a/src/lib/elementary/efl_ui_textpath.eo +++ b/src/lib/elementary/efl_ui_textpath.eo @@ -7,6 +7,7 @@ enum Efl.Ui.Textpath_Direction { class Efl.Ui.Textpath (Efl.Ui.Layout.Object, Efl.Text, Efl.Gfx.Path) { [[Efl Ui Textpath class]] + legacy_prefix: elm_textpath; methods { circle_set { [[Set a circle with given center, radius, and start angle.]] diff --git a/src/lib/elementary/efl_ui_textpath_legacy.eo b/src/lib/elementary/efl_ui_textpath_legacy.eo new file mode 100644 index 00..fd19602b1f --- /dev/null +++ b/src/lib/elementary/efl_ui_textpath_legacy.eo @@ -0,0 +1,9 @@ +class Efl.Ui.Textpath_Legacy (Efl.Ui.Textpath, Efl.Ui.Legacy) +{ + [[Textpath widget]] + data: null; + implements { + class.constructor; + Efl.Object.constructor; + } +} diff --git a/src/lib/elementary/elm_textpath.h b/src/lib/elementary/elm_textpath.h new file mode 100644 index 00.
[EGIT] [core/efl] master 01/01: evas filter: remove critical messages from Evas Filter
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4107e7644dddcc6dea819da1ae0979a03e428772 commit 4107e7644dddcc6dea819da1ae0979a03e428772 Author: Youngbok Shin Date: Fri Oct 26 19:30:28 2018 +0900 evas filter: remove critical messages from Evas Filter Summary: When you run filter examples with enabling GL engine support, you can see critical messages which say don't use efl_unref for buffer object. So, efl_unref has to be replaced with efl_del. @fix Test Plan: Run filter example with GL Reviewers: cedric, Hermet, raster, woohyun Reviewed By: Hermet Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7119 --- src/lib/evas/filters/evas_filter.c | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index fcbad016f2..055c72d555 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -41,6 +41,17 @@ static void _filter_buffer_unlock_all(Evas_Filter_Context *ctx); #define _free(ptr) free(ptr) //eina_freeq_ptr_main_add(ptr, NULL, sizeof(*ptr)) +static void +_buffer_del(Eo *buffer) +{ + if (!buffer) return; + + if (efl_parent_get(buffer)) + efl_del(buffer); + else + efl_unref(buffer); +} + Evas_Filter_Context * evas_filter_context_new(Evas_Public_Data *evas, Eina_Bool async, void *user_data) { @@ -116,7 +127,7 @@ static void _filter_buffer_backing_free(Evas_Filter_Buffer *fb) { if (!fb || !fb->buffer) return; - efl_unref(fb->buffer); + _buffer_del((Eo *)fb->buffer); fb->buffer = NULL; } @@ -600,7 +611,7 @@ evas_filter_buffer_backing_set(Evas_Filter_Context *ctx, int bufid, ret = EINA_TRUE; end: - if (fb->buffer != buffer) efl_unref(fb->buffer); + if (fb->buffer != buffer) _buffer_del((Eo *)fb->buffer); fb->buffer = buffer; return ret; } --
[EGIT] [core/efl] master 01/01: edje: fix an overflow issue for state values
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b89b221b97897a29d009fc5910274c545d33e06f commit b89b221b97897a29d009fc5910274c545d33e06f Author: Youngbok Shin Date: Wed Nov 14 16:43:13 2018 +0900 edje: fix an overflow issue for state values Summary: Whenever _edje_recalc_do() is called, a state value of Edje structure is increased. This increased value will be stored in Edje_Real_Part and Edje_Real_Part_State for calculation optimazation. But, once the state value is overflowed, it ruins calculation logic. @fix Test Plan: Run an Edje file which has infinite animation for over an hour. I'll attach an example to phab. Reviewers: raster, cedric, woohyun, Hermet Reviewed By: Hermet Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D7264 --- src/lib/edje/edje_calc.c | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 1055791495..5877ebb6ed 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -938,6 +938,9 @@ _edje_recalc_do(Edje *ed) { unsigned short i; Eina_Bool need_calc; +#ifdef EDJE_CALC_CACHE + Eina_Bool need_reinit_state = EINA_FALSE; +#endif // XXX: dont need this with current smart calc infra. remove me later // ed->postponed = EINA_FALSE; @@ -946,6 +949,16 @@ _edje_recalc_do(Edje *ed) if (!ed->dirty) return; ed->dirty = EINA_FALSE; ed->state++; + + /* Avoid overflow problem */ + if (ed->state == USHRT_MAX) + { +ed->state = 0; +#ifdef EDJE_CALC_CACHE +need_reinit_state = EINA_TRUE; +#endif + } + for (i = 0; i < ed->table_parts_size; i++) { Edje_Real_Part *ep; @@ -953,6 +966,15 @@ _edje_recalc_do(Edje *ed) ep = ed->table_parts[i]; ep->calculated = FLAG_NONE; // FIXME: this is dubious (see below) ep->calculating = FLAG_NONE; +#ifdef EDJE_CALC_CACHE +if (need_reinit_state) + { + ep->state = 0; + ep->param1.state = 0; + if (ep->param2) + ep->param2->state = 0; + } +#endif } for (i = 0; i < ed->table_parts_size; i++) { --
[EGIT] [core/efl] master 01/01: evas textblock: remove white space after line-break by a next item
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=09da85807a6447d6e9c04fc72fdb485a78192d82 commit 09da85807a6447d6e9c04fc72fdb485a78192d82 Author: Youngbok Shin Date: Wed Nov 14 09:19:30 2018 +0200 evas textblock: remove white space after line-break by a next item 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: https://phab.enlightenment.org/D7204 --- src/lib/evas/canvas/evas_object_textblock.c | 10 +- src/tests/evas/evas_test_textblock.c| 15 +-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index a194899d48..3da95a97a0 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5564,7 +5564,7 @@ _layout_item_obstacle_get(Ctxt *c, Evas_Object_Textblock_Item *it); static int _layout_par(Ctxt *c) { - Evas_Object_Textblock_Item *it; + Evas_Object_Textblock_Item *it, *prev_it; Eina_List *i; int ret = 0; int wrap = -1; @@ -5673,6 +5673,7 @@ _layout_par(Ctxt *c) Eina_Bool item_preadv = EINA_FALSE; Evas_Textblock_Obstacle *obs = NULL; c->par->last_fw = 0; + it = NULL; for (i = c->par->logical_items ; i ; ) { Evas_Coord prevdescent = 0, prevascent = 0; @@ -5681,6 +5682,7 @@ _layout_par(Ctxt *c) Evas_Textblock_Obstacle_Info *obs_info = NULL; Evas_Coord itw; +prev_it = it; it = _ITEM(eina_list_data_get(i)); /* Skip visually deleted items */ if (it->visually_deleted || @@ -5959,6 +5961,12 @@ _layout_par(Ctxt *c) else if (wrap == 0) { /* Should wrap before the item */ + if (prev_it && (prev_it->type == EVAS_TEXTBLOCK_ITEM_TEXT)) + { +_layout_item_text_split_strip_white(c, + _ITEM_TEXT(prev_it), eina_list_prev(i), + _ITEM_TEXT(prev_it)->text_props.text_len); + } /* We didn't end up using the item, so revert the ascent * and descent changes. */ diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 9246f77a52..29ab7110f7 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2717,23 +2717,26 @@ EFL_START_TEST(evas_textblock_geometries) fail_if(!it); rects = eina_iterator_container_get(it); fail_if(!rects); - ck_assert_int_eq(eina_list_count(rects), 3); + ck_assert_int_eq(eina_list_count(rects), 2); { -Evas_Coord y1, y2; +Evas_Coord x1, y1, x2, y2; void *tmp = tr; -/* We have 3 rectangles */ +/* We have 2 rectangles */ Eina_Iterator *itr = it; fail_if (!eina_iterator_next(itr, &tmp)); tr = tmp; +x1 = tr->x; y1 = tr->y; fail_if (!eina_iterator_next(itr, &tmp)); tr = tmp; +x2 = tr->x; y2 = tr->y; -/* Basically it means that the "extending" rectangle should not somehow - * reach the second line in this example. */ -ck_assert_int_eq(y1, y2); +/* These rectangles must be placed without overlapping. + * In this test case, we expect to see a rect for each line. */ +fail_if((x1 == x2) && (y1 == y2)); +ck_assert_int_ne(y1, y2); eina_iterator_free(it); } --
[EGIT] [core/efl] efl-1.21 01/01: evas textblock: remove white space after line-break by a next item
herdsman pushed a commit to branch efl-1.21. http://git.enlightenment.org/core/efl.git/commit/?id=6924ab421f0c28f4fa01f575fb3f50487ceaad3f commit 6924ab421f0c28f4fa01f575fb3f50487ceaad3f Author: Youngbok Shin Date: Wed Nov 14 09:19:30 2018 +0200 evas textblock: remove white space after line-break by a next item 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: https://phab.enlightenment.org/D7204 --- src/lib/evas/canvas/evas_object_textblock.c | 10 +- src/tests/evas/evas_test_textblock.c| 15 +-- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index f523f131e9..2bc0bbdfba 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5565,7 +5565,7 @@ _layout_item_obstacle_get(Ctxt *c, Evas_Object_Textblock_Item *it); static int _layout_par(Ctxt *c) { - Evas_Object_Textblock_Item *it; + Evas_Object_Textblock_Item *it, *prev_it; Eina_List *i; int ret = 0; int wrap = -1; @@ -5674,6 +5674,7 @@ _layout_par(Ctxt *c) Eina_Bool item_preadv = EINA_FALSE; Evas_Textblock_Obstacle *obs = NULL; c->par->last_fw = 0; + it = NULL; for (i = c->par->logical_items ; i ; ) { Evas_Coord prevdescent = 0, prevascent = 0; @@ -5682,6 +5683,7 @@ _layout_par(Ctxt *c) Evas_Textblock_Obstacle_Info *obs_info = NULL; Evas_Coord itw; +prev_it = it; it = _ITEM(eina_list_data_get(i)); /* Skip visually deleted items */ if (it->visually_deleted || @@ -5960,6 +5962,12 @@ _layout_par(Ctxt *c) else if (wrap == 0) { /* Should wrap before the item */ + if (prev_it && (prev_it->type == EVAS_TEXTBLOCK_ITEM_TEXT)) + { +_layout_item_text_split_strip_white(c, + _ITEM_TEXT(prev_it), eina_list_prev(i), + _ITEM_TEXT(prev_it)->text_props.text_len); + } /* We didn't end up using the item, so revert the ascent * and descent changes. */ diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 1f6cb139b2..bdb9505741 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2695,23 +2695,26 @@ EFL_START_TEST(evas_textblock_geometries) fail_if(!it); rects = eina_iterator_container_get(it); fail_if(!rects); - ck_assert_int_eq(eina_list_count(rects), 3); + ck_assert_int_eq(eina_list_count(rects), 2); { -Evas_Coord y1, y2; +Evas_Coord x1, y1, x2, y2; void *tmp = tr; -/* We have 3 rectangles */ +/* We have 2 rectangles */ Eina_Iterator *itr = it; fail_if (!eina_iterator_next(itr, &tmp)); tr = tmp; +x1 = tr->x; y1 = tr->y; fail_if (!eina_iterator_next(itr, &tmp)); tr = tmp; +x2 = tr->x; y2 = tr->y; -/* Basically it means that the "extending" rectangle should not somehow - * reach the second line in this example. */ -ck_assert_int_eq(y1, y2); +/* These rectangles must be placed without overlapping. + * In this test case, we expect to see a rect for each line. */ +fail_if((x1 == x2) && (y1 == y2)); +ck_assert_int_ne(y1, y2); eina_iterator_free(it); } --
[EGIT] [core/efl] master 01/01: elementary config: Fix to use ELEMENTARY_BASE_DIR for configure path
jpeg pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=32f8e0c7268182d5a6d2bb57003d8211e4e67601 commit 32f8e0c7268182d5a6d2bb57003d8211e4e67601 Author: Youngbok Shin Date: Mon Jan 22 21:01:27 2018 +0900 elementary config: Fix to use ELEMENTARY_BASE_DIR for configure path Summary: "--with-elementary-base-dir" option was ignored by recent patches on elm_config. The macro is being used in elm_theme. It should be syncronized. The default value of the macro is ".elementary". @fix Test Plan: N/A Reviewers: raster, cedric, jpeg Reviewed By: jpeg Differential Revision: https://phab.enlightenment.org/D5755 --- src/lib/elementary/elm_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 2841c140cf..ac1fae0262 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -628,7 +628,7 @@ _elm_config_user_dir_snprintf(char *dst, "(:config:)/elementary"); else file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, -"(:home:)/.elementary"); +"(:home:)/"ELEMENTARY_BASE_DIR); eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size); efl_del(file_obj); --
[EGIT] [core/efl] efl-1.20 14/45: elementary config: Fix to use ELEMENTARY_BASE_DIR for configure path
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=afeca7dda97362fada60f9944beeb94ad66f2246 commit afeca7dda97362fada60f9944beeb94ad66f2246 Author: Youngbok Shin Date: Mon Jan 22 21:01:27 2018 +0900 elementary config: Fix to use ELEMENTARY_BASE_DIR for configure path Summary: "--with-elementary-base-dir" option was ignored by recent patches on elm_config. The macro is being used in elm_theme. It should be syncronized. The default value of the macro is ".elementary". @fix Test Plan: N/A Reviewers: raster, cedric, jpeg Reviewed By: jpeg Differential Revision: https://phab.enlightenment.org/D5755 --- src/lib/elementary/elm_config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 62e5f80f01..937c9bfe76 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -626,7 +626,7 @@ _elm_config_user_dir_snprintf(char *dst, "(:config:)/elementary"); else file_obj = efl_vpath_manager_fetch(EFL_VPATH_MANAGER_CLASS, -"(:home:)/.elementary"); +"(:home:)/"ELEMENTARY_BASE_DIR); eina_strlcpy(dst, efl_vpath_file_result_get(file_obj), size); efl_del(file_obj); --
[EGIT] [core/efl] master 10/10: elementary: fix legacy widget type name for backward compat
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=855c1886b68d898722e5aab5e27a10eba4294655 commit 855c1886b68d898722e5aab5e27a10eba4294655 Author: Youngbok Shin Date: Wed Feb 14 12:04:24 2018 -0800 elementary: fix legacy widget type name for backward compat Summary: For example, the widget type of elm_button was "Elm_Button". But, the object which is created by elm_button_add() will return its widget type "Efl.Ui.Button_Legacy". It is not legacy name. It should be fixed to return "Elm_Button". I don't know when but eolian start to make class name with ".". So, it should be converted to "_" for all widgets. @fix Test Plan: All test cases are included in this patch. Run "make check" Reviewers: raster, cedric, jpeg, taxi2se Reviewed By: cedric Subscribers: taxi2se, woohyun Differential Revision: https://phab.enlightenment.org/D5782 Signed-off-by: Cedric Bail --- src/lib/elementary/efl_ui_widget.c | 91 +- src/tests/elementary/elm_test_actionslider.c | 25 +- src/tests/elementary/elm_test_bg.c | 23 ++ src/tests/elementary/elm_test_box.c| 25 +- src/tests/elementary/elm_test_bubble.c | 25 +- src/tests/elementary/elm_test_button.c | 27 ++- src/tests/elementary/elm_test_calendar.c | 25 +- src/tests/elementary/elm_test_check.c | 23 ++ src/tests/elementary/elm_test_clock.c | 25 +- src/tests/elementary/elm_test_colorselector.c | 23 ++ src/tests/elementary/elm_test_conformant.c | 25 +- src/tests/elementary/elm_test_ctxpopup.c | 25 +- src/tests/elementary/elm_test_datetime.c | 25 +- src/tests/elementary/elm_test_dayselector.c| 25 +- src/tests/elementary/elm_test_diskselector.c | 25 +- src/tests/elementary/elm_test_entry.c | 23 ++ src/tests/elementary/elm_test_fileselector.c | 22 ++ .../elementary/elm_test_fileselector_button.c | 25 +- src/tests/elementary/elm_test_fileselector_entry.c | 25 +- src/tests/elementary/elm_test_flip.c | 24 +- src/tests/elementary/elm_test_flipselector.c | 24 +- src/tests/elementary/elm_test_frame.c | 24 +- src/tests/elementary/elm_test_gengrid.c| 24 +- src/tests/elementary/elm_test_genlist.c| 22 ++ src/tests/elementary/elm_test_glview.c | 27 ++- src/tests/elementary/elm_test_grid.c | 24 +- src/tests/elementary/elm_test_hover.c | 24 +- src/tests/elementary/elm_test_hoversel.c | 24 +- src/tests/elementary/elm_test_icon.c | 24 +- src/tests/elementary/elm_test_image.c | 31 +++- src/tests/elementary/elm_test_index.c | 24 +- src/tests/elementary/elm_test_inwin.c | 24 +- src/tests/elementary/elm_test_label.c | 24 +- src/tests/elementary/elm_test_layout.c | 22 ++ src/tests/elementary/elm_test_list.c | 41 +++--- src/tests/elementary/elm_test_map.c| 24 +- src/tests/elementary/elm_test_mapbuf.c | 24 +- src/tests/elementary/elm_test_menu.c | 24 +- src/tests/elementary/elm_test_multibuttonentry.c | 24 +- src/tests/elementary/elm_test_naviframe.c | 24 +- src/tests/elementary/elm_test_notify.c | 24 +- src/tests/elementary/elm_test_panel.c | 24 +- src/tests/elementary/elm_test_panes.c | 24 +- src/tests/elementary/elm_test_photo.c | 24 +- src/tests/elementary/elm_test_photocam.c | 22 ++ src/tests/elementary/elm_test_player.c | 24 +- src/tests/elementary/elm_test_plug.c | 24 +- src/tests/elementary/elm_test_popup.c | 24 +- src/tests/elementary/elm_test_prefs.c | 25 ++ src/tests/elementary/elm_test_progressbar.c| 24 +- src/tests/elementary/elm_test_radio.c | 24 +- src/tests/elementary/elm_test_scroller.c | 24 +- src/tests/elementary/elm_test_segmentcontrol.c | 24 +- src/tests/elementary/elm_test_separator.c | 24 +- src/tests/elementary/elm_test_slider.c | 24 +- src/tests/elementary/elm_test_slideshow.c | 24 +- src/tests/elementary/elm_test_spinner.c| 24 +- src/tests/elementary/elm_test_table.c | 24 +- src/tests/elementary/elm_test_thumb.c | 25 +- src/tests/elementary/elm_test_toolbar.c| 24 +- src/tests/elementar
[EGIT] [core/efl] master 05/13: evas: increase offset by 4 to do work for next map points
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=255e9c788acdd5b64ddd18ad44aae24b3e77cbaa commit 255e9c788acdd5b64ddd18ad44aae24b3e77cbaa Author: Youngbok Shin Date: Tue Mar 6 17:01:02 2018 -0800 evas: increase offset by 4 to do work for next map points Summary: Increasing offset as 2 for next map points is wrong. If evas tries to draw for wrong combination of map points, it can cause wrong results. Actually, every drawing code for map points use and increase offset as 4. @fix Test Plan: A test case for textpach is modified for testing this issue. 1. Run elementary_test with sync render mode. ex) ECORE_EVAS_FORCE_SYNC_RENDER=1 elementary_test 2. Open textpath test. 3. Set a short text by clicking newly added check box. 4. (It will show another issues... So,) change slice number to update textpath properly. 5. See some noises at top-left side of text. It is drawn from the two of end map points to the two of empty(not used) map points. Reviewers: raster, cedric, jpeg, jypark Differential Revision: https://phab.enlightenment.org/D5833 Signed-off-by: Cedric Bail --- src/bin/elementary/test_ui_textpath.c | 23 +- .../evas/engines/software_generic/evas_engine.c| 4 ++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/src/bin/elementary/test_ui_textpath.c b/src/bin/elementary/test_ui_textpath.c index 9b27cdb7ac..094c7970fb 100644 --- a/src/bin/elementary/test_ui_textpath.c +++ b/src/bin/elementary/test_ui_textpath.c @@ -9,6 +9,9 @@ #define CY 150 #define CR 100 +#define TEST_UI_TEXTPATH_LONG_TEXT "This text follows the path which you defined. This is a <long> text designed to make it ellipsis." +#define TEST_UI_TEXTPATH_SHORT_TEXT "This text is short." + static Evas_Object *angle_sld, *slice_sld, *dir_chk; static int path_type; @@ -50,6 +53,18 @@ _angle_changed_cb(void *data, const Efl_Event *event) } static void +_short_text_changed_cb(void *data, const Efl_Event *event) +{ + Evas_Object *txtpath = data; + Eina_Bool val = elm_check_selected_get(event->object); + + if (val) + efl_text_set(txtpath, TEST_UI_TEXTPATH_SHORT_TEXT); + else + efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT); +} + +static void _change_shape_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { Evas_Object *txtpath = data; @@ -99,7 +114,7 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_box_pack_end(box, txtpath); efl_ui_textpath_autofit_set(txtpath, EINA_TRUE); - efl_text_set(txtpath, "This text follows the path which you defined. This is a <long> text designed to make it ellipsis."); + efl_text_set(txtpath, TEST_UI_TEXTPATH_LONG_TEXT); efl_ui_textpath_circle_set(txtpath, CX, CY, CR, 0, EFL_UI_TEXTPATH_DIRECTION_CCW); efl_gfx_visible_set(txtpath, EINA_TRUE); @@ -133,6 +148,12 @@ test_ui_textpath(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_gfx_visible_set(chk, EINA_TRUE); dir_chk = chk; + chk = elm_check_add(win); + elm_object_text_set(chk, "Short text"); + efl_event_callback_add(chk, EFL_UI_CHECK_EVENT_CHANGED, _short_text_changed_cb, txtpath); + elm_box_pack_end(hbox, chk); + efl_gfx_visible_set(chk, EINA_TRUE); + hbox = elm_box_add(win); elm_box_horizontal_set(hbox, EINA_TRUE); efl_gfx_size_hint_weight_set(hbox, EFL_GFX_SIZE_HINT_EXPAND, EFL_GFX_SIZE_HINT_EXPAND); diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c index a265c42d9c..46b6764081 100644 --- a/src/modules/evas/engines/software_generic/evas_engine.c +++ b/src/modules/evas/engines/software_generic/evas_engine.c @@ -2773,7 +2773,7 @@ _map_draw_thread_cmd(RGBA_Image *src, RGBA_Image *dst, RGBA_Draw_Context *dc, RG static void evas_software_image_map_draw(void *engine EINA_UNUSED, void *data, void *context, RGBA_Image *surface, RGBA_Image *im, RGBA_Map *m, int smooth, int level, int offset) { - if (m->count - offset < 3) return; + if (m->count - offset < 4) return; if ((m->pts[0 + offset].x == m->pts[3 + offset].x) && (m->pts[1 + offset].x == m->pts[2 + offset].x) && @@ -2834,7 +2834,7 @@ evas_software_image_map_draw(void *engine EINA_UNUSED, void *data, void *context if (m->count > 4) { -evas_software_image_map_draw(engine, data, context, surface, im, m, smooth, level, offset + 2); +evas_software_image_map_draw(engine, data, context, surface, im, m, smooth, level, offset + 4); } } --
[EGIT] [core/efl] master 12/13: elementary: bg - keep file path and key string for legacy bg widget
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b147b5062fc110e12efc72c81dd58439ee7ad06f commit b147b5062fc110e12efc72c81dd58439ee7ad06f Author: Youngbok Shin Date: Tue Mar 6 17:56:56 2018 -0800 elementary: bg - keep file path and key string for legacy bg widget Summary: If a file path and key string was passed to elm_bg, we could get the same file path and key string. Even if it failed to load the image file. And the file path also remained its original form. ex) Setting file path "~/image.png" => Getting file path "~/image.png" (Not "/home/user_name/image.png") @fix Test Plan: Included in elementary test suite. Reviewers: jpeg, cedric, raster Reviewed By: cedric Subscribers: woohyun Differential Revision: https://phab.enlightenment.org/D5823 Signed-off-by: Cedric Bail --- src/lib/elementary/efl_ui_bg_widget.c | 23 +- src/lib/elementary/efl_ui_bg_widget.eo| 1 + src/lib/elementary/efl_ui_bg_widget_private.h | 2 ++ src/tests/elementary/elm_test_bg.c| 28 +++ 4 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_bg_widget.c b/src/lib/elementary/efl_ui_bg_widget.c index 3cc8fb1c58..7f18b8a8c4 100644 --- a/src/lib/elementary/efl_ui_bg_widget.c +++ b/src/lib/elementary/efl_ui_bg_widget.c @@ -45,6 +45,8 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd) pd->img = efl_add(EFL_UI_IMAGE_CLASS, obj, efl_image_scale_type_set(efl_added, EFL_IMAGE_SCALE_TYPE_FIT_OUTSIDE), efl_content_set(efl_part(obj, "elm.swallow.background"), efl_added)); + pd->file = NULL; + pd->key = NULL; efl_access_type_set(obj, EFL_ACCESS_TYPE_DISABLED); @@ -53,6 +55,15 @@ _efl_ui_bg_widget_efl_object_constructor(Eo *obj, Efl_Ui_Bg_Widget_Data *pd) return obj; } +EOLIAN static void +_efl_ui_bg_widget_efl_object_destructor(Eo *obj, Efl_Ui_Bg_Widget_Data *sd) +{ + ELM_SAFE_FREE(sd->file, eina_stringshare_del); + ELM_SAFE_FREE(sd->key, eina_stringshare_del); + + efl_destructor(efl_super(obj, MY_CLASS)); +} + EAPI void elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option) { @@ -191,6 +202,9 @@ elm_bg_file_set(Eo *obj, const char *file, const char *group) EOLIAN static Eina_Bool _efl_ui_bg_widget_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, const char *file, const char *key) { + eina_stringshare_replace(&sd->file, file); + eina_stringshare_replace(&sd->key, key); + return efl_file_set(sd->img, file, key); } EAPI void @@ -200,8 +214,15 @@ elm_bg_file_get(const Eo *obj, const char **file, const char **group) } EOLIAN static void -_efl_ui_bg_widget_efl_file_file_get(Eo *obj EINA_UNUSED, Efl_Ui_Bg_Widget_Data *sd, const char **file, const char **key) +_efl_ui_bg_widget_efl_file_file_get(Eo *obj, Efl_Ui_Bg_Widget_Data *sd, const char **file, const char **key) { + if (elm_widget_is_legacy(obj)) + { +*file = sd->file; +*key = sd->key; +return; + } + efl_file_get(sd->img, file, key); } diff --git a/src/lib/elementary/efl_ui_bg_widget.eo b/src/lib/elementary/efl_ui_bg_widget.eo index ef8882d7ac..105108c750 100644 --- a/src/lib/elementary/efl_ui_bg_widget.eo +++ b/src/lib/elementary/efl_ui_bg_widget.eo @@ -9,6 +9,7 @@ class Efl.Ui.Bg_Widget (Efl.Ui.Layout, Efl.Ui.Bg, Efl.Image.Load) legacy_prefix: elm_bg; implements { Efl.Object.constructor; + Efl.Object.destructor; Efl.File.file { get; set; } Efl.File.mmap { get; set; } Efl.Gfx.Color.color { get; set; } diff --git a/src/lib/elementary/efl_ui_bg_widget_private.h b/src/lib/elementary/efl_ui_bg_widget_private.h index 0ef56c113b..e886db50ba 100644 --- a/src/lib/elementary/efl_ui_bg_widget_private.h +++ b/src/lib/elementary/efl_ui_bg_widget_private.h @@ -28,6 +28,8 @@ struct _Efl_Ui_Bg_Widget_Data { Evas_Object *rect; /*<< Used for elm_bg_color_set(): elm.swallow.rectangle */ Evas_Object *img; /*<< Used for elm_bg_file_set(): elm.swallow.content */ + const char *file; /*<< Used for elm_bg_file_set() with legacy widget */ + const char *key; /*<< Used for elm_bg_file_set() with legacy widget */ }; /** diff --git a/src/tests/elementary/elm_test_bg.c b/src/tests/elementary/elm_test_bg.c index 7a7fbd9c47..9ce43bcb5b 100644 --- a/src/tests/elementary/elm_test_bg.c +++ b/src/tests/elementary/elm_test_bg.c @@ -28,7 +28,35 @@ START_TEST (elm_bg_legacy_type_check) } END_TEST +START_TEST (elm_bg_legacy_file_set_get_check) +{ + Evas_Object *win, *bg; + const char *file = NULL, *key = NULL; + + elm_init(1, NULL); +
[EGIT] [core/efl] master 01/01: evas: apply fribidi bracket types to show paired bracket properly
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4c3646123330086dd6d7508d68b6739826407929 commit 4c3646123330086dd6d7508d68b6739826407929 Author: Youngbok Shin Date: Thu Apr 12 12:55:26 2018 +0300 evas: apply fribidi bracket types to show paired bracket properly Summary: The fribidi couldn't reorganize paired brackets (Ex. '(', ')') when there is RTL + LTR text. According to TR9(http://www.unicode.org/reports/tr9/), it has to be shown properly without LRM or RLM. Also, from the fribidi 1.0.0, fribidi_get_par_embedding_levels() was deprecated. It is replaced with fribidi_get_par_embedding_levels_ex() which is including paired brankets rules from TR9. @feature Test Plan: 1. Create a elm_entry. 2. Set a text by calling text_set. elm_entry_entry_set(entry, "مرحبا Hello (40)"); 3. Run and see the results. - Without this patch or fribidi 1.X.X, it will show text like this... "(Hello (40 مرحبا" - With this patch and fribidi >= 1.0.0 "Hello (40) مرحبا" Reviewers: raster, cedric, herdsman, woohyun Reviewed By: herdsman Differential Revision: https://phab.enlightenment.org/D5921 --- src/lib/evas/common/language/evas_bidi_utils.c | 70 ++ src/lib/evas/common/language/evas_bidi_utils.h | 3 ++ 2 files changed, 62 insertions(+), 11 deletions(-) diff --git a/src/lib/evas/common/language/evas_bidi_utils.c b/src/lib/evas/common/language/evas_bidi_utils.c index fc9a35dd9b..a4653416e7 100644 --- a/src/lib/evas/common/language/evas_bidi_utils.c +++ b/src/lib/evas/common/language/evas_bidi_utils.c @@ -234,6 +234,10 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, EvasBiDiLevel *embedding_levels = NULL; const FriBidiChar *ustr; FriBidiChar *base_ustr = NULL; + EvasBiDiLevel ret_level = 0; +#if FRIBIDI_MAJOR_VERSION >= 1 + EvasBiDiBracketType *bracket_types = NULL; +#endif if (!eina_ustr) return NULL; @@ -266,6 +270,15 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, } fribidi_get_bidi_types(ustr, len, char_types); +#if FRIBIDI_MAJOR_VERSION >= 1 + bracket_types = (EvasBiDiBracketType *) malloc(sizeof(EvasBiDiBracketType) * len); + if (!bracket_types) + { + goto cleanup; + } + fribidi_get_bracket_types(ustr, len, char_types, bracket_types); +#endif + embedding_levels = (EvasBiDiLevel *)malloc(sizeof(EvasBiDiLevel) * len); if (!embedding_levels) { @@ -282,10 +295,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, for (itr = segment_idxs ; *itr > 0 ; itr++) { direction = base_bidi; - if (!fribidi_get_par_embedding_levels(char_types + pos, - *itr - pos, - &direction, - embedding_levels + pos)) +#if FRIBIDI_MAJOR_VERSION >= 1 + ret_level = fribidi_get_par_embedding_levels_ex(char_types + pos, + bracket_types, + *itr - pos, + &direction, + embedding_levels + pos); +#else + ret_level = fribidi_get_par_embedding_levels(char_types + pos, + *itr - pos, + &direction, + embedding_levels + pos); +#endif + if (!ret_level) { goto cleanup; } @@ -308,10 +330,19 @@ evas_bidi_paragraph_props_get(const Eina_Unicode *eina_ustr, size_t len, } direction = base_bidi; -if (!fribidi_get_par_embedding_levels(char_types + pos, - len - pos, - &direction, - embedding_levels + pos)) +#if FRIBIDI_MAJOR_VERSION >= 1 +ret_level = fribidi_get_par_embedding_levels_ex(char_types + pos, +bracket_types, +len - pos, +&direction, +embedding_levels + pos); +#else +ret_level = fribidi_get_par_embedding_levels(char_types + pos, + len - pos, + &direction, + embedding_levels + pos); +#endif +if (!ret_level)
[EGIT] [core/efl] master 01/01: elementary bg: allow NULL pointers in legacy usage
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f7826ea1af61c8e379244628288a20171b5a2bcd commit f7826ea1af61c8e379244628288a20171b5a2bcd Author: Youngbok Shin Date: Mon Apr 23 21:24:13 2018 +0900 elementary bg: allow NULL pointers in legacy usage Summary: It should not cause crash with NULL parameters. @fix Reviewers: woohyun, raster, cedric Reviewed By: woohyun, raster Differential Revision: https://phab.enlightenment.org/D5979 --- src/lib/elementary/efl_ui_bg_widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_bg_widget.c b/src/lib/elementary/efl_ui_bg_widget.c index 09f07b1e63..8fe8072345 100644 --- a/src/lib/elementary/efl_ui_bg_widget.c +++ b/src/lib/elementary/efl_ui_bg_widget.c @@ -218,8 +218,8 @@ _efl_ui_bg_widget_efl_file_file_get(const Eo *obj, Efl_Ui_Bg_Widget_Data *sd, co { if (elm_widget_is_legacy(obj)) { -*file = sd->file; -*key = sd->key; +if (file) *file = sd->file; +if (key) *key = sd->key; return; } --
[EGIT] [core/efl] master 01/01: edje: add json file support feature
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2fe158ce652860b2aa5a2e883e6b2beb0ee1c670 commit 2fe158ce652860b2aa5a2e883e6b2beb0ee1c670 Author: YoungBok Shin Date: Mon Feb 17 18:59:09 2020 +0900 edje: add json file support feature Summary: It also starts to support following new edc properties. This is backported patch from Tizen 5.0 1. frame desc { "default" vector { frame: 0.5; // 0.0 ~ 1.0 } } 2. actions program { "vector_animation"; // VG_ANIM_PLAY, VG_ANIM_PLAY_BACK, VG_ANIM_LOOP, // VG_ANIM_STOP, VG_ANIM_PAUSE, VG_ANIM_RESUME action: VG_ANIM_PLAY; target: "your_vector_part"; } @feature Co-authored-by: Jaehyun Cho - Fix to remove Efl.Canvas.Animation_Player on edje Test Plan: {F3840540} {F3840542} {F3840543} make and test attached file edje_cc -beta -id ./ json_edc.edc json.edj gcc -o test test_edc.c -g `pkg-config --cflags --libs evas elementary rlottie` ./test Reviewers: Hermet, Jaehyun_Cho, id213sin Reviewed By: Hermet Subscribers: segfaultxavi, raster, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11228 --- src/bin/edje/edje_cc_handlers.c | 56 +++ src/bin/edje/edje_cc_out.c | 51 +++--- src/lib/edje/Edje_Common.h | 8 ++- src/lib/edje/edje_calc.c| 150 ++-- src/lib/edje/edje_data.c| 3 + src/lib/edje/edje_load.c| 20 ++ src/lib/edje/edje_private.h | 32 - src/lib/edje/edje_program.c | 72 +++ 8 files changed, 371 insertions(+), 21 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 6b7ec172e7..59a0f377a8 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -516,6 +516,9 @@ static void st_collections_group_parts_part_description_params_bool(void); static void st_collections_group_parts_part_description_params_choice(void); static void st_collections_group_parts_part_description_params_smart(void); +/* vector part parameter */ +static void st_collections_group_parts_part_description_vector_frame(void); + static void ob_collections_group_programs_program(void); static void st_collections_group_programs_program_name(void); static void st_collections_group_programs_program_signal(void); @@ -1047,6 +1050,7 @@ New_Statement_Handler statement_handlers[] = {"collections.group.parts.part.description.params.bool", st_collections_group_parts_part_description_params_bool}, {"collections.group.parts.part.description.params.choice", st_collections_group_parts_part_description_params_choice}, {"collections.group.parts.part.description.params.*", st_collections_group_parts_part_description_params_smart}, + {"collections.group.parts.part.description.vector.frame", st_collections_group_parts_part_description_vector_frame}, IMAGE_STATEMENTS("collections.group.parts.part.description.") { "collections.group.parts.part.description.font", st_fonts_font @@ -1590,6 +1594,7 @@ New_Object_Handler object_handlers[] = {"collections.group.parts.part.description.map.zoom", NULL}, {"collections.group.parts.part.description.perspective", NULL}, {"collections.group.parts.part.description.params", NULL}, + {"collections.group.parts.part.description.vector", NULL}, {"collections.group.parts.part.description.color_classes", NULL}, /* dup */ {"collections.group.parts.part.description.color_classes.color_class", ob_color_class}, /* dup */ {"collections.group.parts.part.description.text_classes", NULL}, /* dup */ @@ -2545,6 +2550,7 @@ _handle_vector_image(void) { ed->vg.set = EINA_TRUE; ed->vg.id = edje_file->image_dir->vectors[i].id; + ed->vg.type = edje_file->image_dir->vectors[i].type; break; } } @@ -2587,6 +2593,7 @@ st_images_vector(void) Edje_Vector_Directory_Entry *vector; const char *tmp; unsigned int i; + size_t entry_len; check_min_arg_count(1); @@ -2618,6 +2625,16 @@ st_images_vector(void) vector->entry = tmp; vector->id = edje_file->image_dir->vectors_count - 1; + + entry_len = strlen(vector->entry); + if ((entry_len > 5) && !strncmp(vector->entry + entry_len - 5, ".json", 5)) + { +vector->type = EDJE_VECTOR_FILE_TYPE_JSON; + } + else + { +vector->type = EDJE_VECTOR_FILE_TYPE_SVG; + } } /** @@ -89
[EGIT] [core/elementary] master 01/01: entry: Fix elm_entry_input_panel_layout_get API to return ELM_INPUT_PANEL_LAYOUT_INVALID when it fails.
eunue pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=c0ba5ad0f292b1e5871b1d578f69532865387b00 commit c0ba5ad0f292b1e5871b1d578f69532865387b00 Author: Youngbok Shin Date: Wed Apr 22 15:46:43 2015 +0900 entry: Fix elm_entry_input_panel_layout_get API to return ELM_INPUT_PANEL_LAYOUT_INVALID when it fails. Summary: Even if the given Evas_Object is NULL, API returns ELM_INPUT_PANEL_LAYOUT_NORMAL. But, ELM_INPUT_PANEL_LAYOUT_INVALID seems proper in that case. Test Plan: Call the following API with NULL. elm_entry_input_panel_layout_get(NULL); Reviewers: woohyun, Hermet, eunue Reviewed By: eunue Differential Revision: https://phab.enlightenment.org/D2404 --- src/lib/elm_entry.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_entry.eo b/src/lib/elm_entry.eo index f1ca920..1f70348 100644 --- a/src/lib/elm_entry.eo +++ b/src/lib/elm_entry.eo @@ -446,14 +446,14 @@ class Elm_Entry (Elm_Layout, Elm_Interface_Scrollable, Evas.Clickable_Interface, /*@ Get the input panel layout of the entry -@return layout type +@return layout type. It returns ELM_INPUT_PANEL_LAYOUT_INVALID(8) when it fails. @see elm_entry_input_panel_layout_set @ingroup Entry */ } values { -Elm_Input_Panel_Layout layout; /*@ layout type */ +Elm_Input_Panel_Layout layout(8); /*@ layout type */ } } input_panel_return_key_type { --
[EGIT] [core/elementary] master 01/01: focus/list/genlist/gengrid: fix focus highlight issues on list widgets when auto focus enable is on.
ami pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=1c7defb8ff900e399f9446807420e45576531cb3 commit 1c7defb8ff900e399f9446807420e45576531cb3 Author: Youngbok Shin Date: Wed Aug 5 12:27:11 2015 +0530 focus/list/genlist/gengrid: fix focus highlight issues on list widgets when auto focus enable is on. Summary: elm_list, elm_genlist widgets are handle focus highlight relying on only elm_widget_focus_highlight_enabled_get() API. The API is not considered about auto focus highlight feature. So, we need to check a flag for auto focus from _elm_config. It resolves T2555. @fix Test Plan: elementary_test -> List Focus or Genlist Focus Reviewers: raster, cedric, SanghyeonLee, singh.amitesh Reviewed By: SanghyeonLee, singh.amitesh Maniphest Tasks: T2555 Differential Revision: https://phab.enlightenment.org/D2914 --- src/bin/test_gengrid.c | 46 ++ src/bin/test_genlist.c | 46 ++ src/bin/test_list.c| 46 ++ src/lib/elm_gengrid.c | 6 +++--- src/lib/elm_genlist.c | 8 src/lib/elm_list.c | 6 +++--- src/lib/elm_win.c | 2 +- 7 files changed, 137 insertions(+), 23 deletions(-) diff --git a/src/bin/test_gengrid.c b/src/bin/test_gengrid.c index ffd4857..93d7f38 100644 --- a/src/bin/test_gengrid.c +++ b/src/bin/test_gengrid.c @@ -1610,6 +1610,22 @@ _gg_focus_focus_move_policy_changed_cb(void *data EINA_UNUSED, } static void +_gg_focus_win_auto_focus_enable_changed(void *data EINA_UNUSED, +Evas_Object *obj, +void *event_info EINA_UNUSED) +{ + elm_config_window_auto_focus_enable_set(elm_check_state_get(obj)); +} + +static void +_gg_focus_win_auto_focus_animate_changed(void *data EINA_UNUSED, + Evas_Object *obj, + void *event_info EINA_UNUSED) +{ + elm_config_window_auto_focus_animate_set(elm_check_state_get(obj)); +} + +static void _gg_focus_focus_highlight_changed_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) @@ -1666,8 +1682,10 @@ test_gengrid_focus(void *data EINA_UNUSED, int i, n; win = elm_win_util_standard_add("gengrid-focus", "Gengrid Focus"); - elm_win_focus_highlight_enabled_set(win, EINA_TRUE); - elm_win_focus_highlight_animate_set(win, EINA_TRUE); + elm_config_window_auto_focus_enable_set(EINA_TRUE); + elm_config_window_auto_focus_animate_set(EINA_TRUE); + elm_win_focus_highlight_enabled_set(win, EINA_FALSE); + elm_win_focus_highlight_animate_set(win, EINA_FALSE); elm_win_autodel_set(win, EINA_TRUE); bx_horiz = elm_box_add(win); @@ -1734,10 +1752,30 @@ test_gengrid_focus(void *data EINA_UNUSED, evas_object_show(bx_opt); ck = elm_check_add(bx_opt); - elm_object_text_set(ck, "Focus Highlight"); + elm_object_text_set(ck, "Window Auto Focus Enable"); + elm_check_state_set(ck, EINA_TRUE); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); + evas_object_smart_callback_add(ck, "changed", + _gg_focus_win_auto_focus_enable_changed, + NULL); + elm_box_pack_end(bx_opt, ck); + evas_object_show(ck); + + ck = elm_check_add(bx_opt); + elm_object_text_set(ck, "Window Auto Focus Animate"); elm_check_state_set(ck, EINA_TRUE); evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); evas_object_smart_callback_add(ck, "changed", + _gg_focus_win_auto_focus_animate_changed, + NULL); + elm_box_pack_end(bx_opt, ck); + evas_object_show(ck); + + ck = elm_check_add(bx_opt); + elm_object_text_set(ck, "Focus Highlight"); + elm_check_state_set(ck, EINA_FALSE); + evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); + evas_object_smart_callback_add(ck, "changed", _gg_focus_focus_highlight_changed_cb, win); elm_box_pack_end(bx_opt, ck); @@ -1745,7 +1783,7 @@ test_gengrid_focus(void *data EINA_UNUSED, ck = elm_check_add(bx_opt); elm_object_text_set(ck, "Focus Animation"); - elm_check_state_set(ck, EINA_TRUE); + elm_check_state_set(ck, EINA_FALSE); evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0); evas_object_smart_callback_add(ck, "changed", _gg_focus_focus_animate_changed_cb, diff --git a/src/bin/test_genlist.c b/src/bin/test_genlist.c index 01b5311..9114665 100644 --- a/src/bin/test_genlist.c +++ b/sr
[EGIT] [core/elementary] master 01/01: multibuttonentry/spinner: Fix memory leak when eina_strbuf_string_steal is misused.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=ba7588d21a9ec9f859ef6da6ad0282a30a376df8 commit ba7588d21a9ec9f859ef6da6ad0282a30a376df8 Author: Youngbok Shin Date: Fri Aug 7 15:15:45 2015 +0900 multibuttonentry/spinner: Fix memory leak when eina_strbuf_string_steal is misused. Summary: _elm_access_say() does not free the given text. But, the text from eina_strbuf_string_steal() is not cared from outside of _elm_access_say(), too. It should be changed to eina_strbuf_string_get(). Test Plan: N/A Reviewers: cedric, woohyun, kimcinoo, JackDanielZ, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2918 --- src/lib/elc_multibuttonentry.c | 9 +++-- src/lib/elm_spinner.c | 8 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index 9c8d15a..f8558a3 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -463,7 +463,7 @@ _item_select(Evas_Object *obj, { Evas_Object *ao, *po; Eina_Strbuf *buf; - const char *part, *text; + const char *part; part = "elm.btn.text"; po = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(VIEW(it)), part); @@ -475,8 +475,7 @@ _item_select(Evas_Object *obj, "multi button entry item %s is selected", edje_object_part_text_get(elm_layout_edje_get(VIEW(it)), part)); - text = (const char*)eina_strbuf_string_steal(buf); - _elm_access_say(text); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); } } @@ -758,7 +757,6 @@ _item_new(Elm_Multibuttonentry_Data *sd, // ACCESS if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) { -const char *text; Eina_Strbuf *buf; buf = eina_strbuf_new(); @@ -766,8 +764,7 @@ _item_new(Elm_Multibuttonentry_Data *sd, "multi button entry item %s is added", edje_object_part_text_get(elm_layout_edje_get(VIEW(item)), "elm.btn.text")); -text = (const char*)eina_strbuf_string_steal(buf); -_elm_access_say(text); +_elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); _access_multibuttonentry_item_register(obj, eo_item, EINA_TRUE); diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 46e884c..255135f 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -788,10 +788,8 @@ _access_activate_cb(void *data, eina_strbuf_append_printf(buf, "%s, %s", text, elm_layout_text_get(data, "elm.text")); - text = eina_strbuf_string_steal(buf); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); - - _elm_access_say(text); } static char * @@ -842,7 +840,6 @@ static void _access_increment_decrement_info_say(Evas_Object *obj, Eina_Bool is_incremented) { - char *text; Eina_Strbuf *buf; ELM_SPINNER_DATA_GET(obj, sd); @@ -864,9 +861,8 @@ _access_increment_decrement_info_say(Evas_Object *obj, eina_strbuf_append_printf (buf, "%s", elm_object_text_get(sd->text_button)); - text = eina_strbuf_string_steal(buf); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); - _elm_access_say(text); } static void --
[EGIT] [core/elementary] elementary-1.15 01/01: multibuttonentry/spinner: Fix memory leak when eina_strbuf_string_steal is misused.
hermet pushed a commit to branch elementary-1.15. http://git.enlightenment.org/core/elementary.git/commit/?id=8746e5ad4b96f7b4cf0c9cdacbb1480458ef832a commit 8746e5ad4b96f7b4cf0c9cdacbb1480458ef832a Author: Youngbok Shin Date: Fri Aug 7 15:15:45 2015 +0900 multibuttonentry/spinner: Fix memory leak when eina_strbuf_string_steal is misused. Summary: _elm_access_say() does not free the given text. But, the text from eina_strbuf_string_steal() is not cared from outside of _elm_access_say(), too. It should be changed to eina_strbuf_string_get(). Test Plan: N/A Reviewers: cedric, woohyun, kimcinoo, JackDanielZ, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D2918 --- src/lib/elc_multibuttonentry.c | 9 +++-- src/lib/elm_spinner.c | 8 ++-- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/lib/elc_multibuttonentry.c b/src/lib/elc_multibuttonentry.c index 8255e35..3ab5641 100644 --- a/src/lib/elc_multibuttonentry.c +++ b/src/lib/elc_multibuttonentry.c @@ -453,7 +453,7 @@ _item_select(Evas_Object *obj, { Evas_Object *ao, *po; Eina_Strbuf *buf; - const char *part, *text; + const char *part; part = "elm.btn.text"; po = (Evas_Object *)edje_object_part_object_get(elm_layout_edje_get(VIEW(it)), part); @@ -465,8 +465,7 @@ _item_select(Evas_Object *obj, "multi button entry item %s is selected", edje_object_part_text_get(elm_layout_edje_get(VIEW(it)), part)); - text = (const char*)eina_strbuf_string_steal(buf); - _elm_access_say(text); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); } } @@ -748,7 +747,6 @@ _item_new(Elm_Multibuttonentry_Data *sd, // ACCESS if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) { -const char *text; Eina_Strbuf *buf; buf = eina_strbuf_new(); @@ -756,8 +754,7 @@ _item_new(Elm_Multibuttonentry_Data *sd, "multi button entry item %s is added", edje_object_part_text_get(elm_layout_edje_get(VIEW(item)), "elm.btn.text")); -text = (const char*)eina_strbuf_string_steal(buf); -_elm_access_say(text); +_elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); _access_multibuttonentry_item_register(obj, eo_item, EINA_TRUE); diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 42ff096..9fc90a2 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -776,10 +776,8 @@ _access_activate_cb(void *data, eina_strbuf_append_printf(buf, "%s, %s", text, elm_layout_text_get(data, "elm.text")); - text = eina_strbuf_string_steal(buf); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); - - _elm_access_say(text); } static char * @@ -830,7 +828,6 @@ static void _access_increment_decrement_info_say(Evas_Object *obj, Eina_Bool is_incremented) { - char *text; Eina_Strbuf *buf; ELM_SPINNER_DATA_GET(obj, sd); @@ -852,9 +849,8 @@ _access_increment_decrement_info_say(Evas_Object *obj, eina_strbuf_append_printf (buf, "%s", elm_object_text_get(sd->text_button)); - text = eina_strbuf_string_steal(buf); + _elm_access_say(eina_strbuf_string_get(buf)); eina_strbuf_free(buf); - _elm_access_say(text); } static void --
[EGIT] [core/efl] efl-1.15 01/01: edje: Fix double free scenario caused by static pointer.
tasn pushed a commit to branch efl-1.15. http://git.enlightenment.org/core/efl.git/commit/?id=a3cc5810cbc6878e9aa458688d0fb8e397fd4d9e commit a3cc5810cbc6878e9aa458688d0fb8e397fd4d9e Author: Youngbok Shin Date: Thu Aug 27 11:04:57 2015 +0100 edje: Fix double free scenario caused by static pointer. Summary: The result of evas_object_textblock_cursor_content_get() API has to be cleaned by outside. _edje_entry_cursor_content_get() is calling free() inside of the function for handle the result using static pointer. But, the caller of _edje_entry_cursor_content_get() is already handling the result using free(). It can cause double free problem. The bigger issue is in elementary. See elm_entry_cursor_content_get() API's document. The document advice developers to free the result when it is done. @fix Test Plan: N/A Reviewers: tasn, raster, woohyun Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2991 --- src/lib/edje/edje_entry.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 4a57d56..deeac86 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -3854,18 +3854,11 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) char * _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) { - static char *s = NULL; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return NULL; - if (s) - { -free(s); -s = NULL; - } - s = evas_textblock_cursor_content_get(c); - return s; + return evas_textblock_cursor_content_get(c); } void --
[EGIT] [core/efl] master 01/01: edje: Fix double free scenario caused by static pointer.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f210e429663d9bdb0eadf46d42c0ae8742bc615c commit f210e429663d9bdb0eadf46d42c0ae8742bc615c Author: Youngbok Shin Date: Thu Aug 27 11:04:57 2015 +0100 edje: Fix double free scenario caused by static pointer. Summary: The result of evas_object_textblock_cursor_content_get() API has to be cleaned by outside. _edje_entry_cursor_content_get() is calling free() inside of the function for handle the result using static pointer. But, the caller of _edje_entry_cursor_content_get() is already handling the result using free(). It can cause double free problem. The bigger issue is in elementary. See elm_entry_cursor_content_get() API's document. The document advice developers to free the result when it is done. @fix Test Plan: N/A Reviewers: tasn, raster, woohyun Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2991 --- src/lib/edje/edje_entry.c | 9 + 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index b7289b4..237e49a 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -3871,18 +3871,11 @@ _edje_entry_cursor_is_visible_format_get(Edje_Real_Part *rp, Edje_Cursor cur) char * _edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur) { - static char *s = NULL; Evas_Textblock_Cursor *c = _cursor_get(rp, cur); if (!c) return NULL; - if (s) - { -free(s); -s = NULL; - } - s = evas_textblock_cursor_content_get(c); - return s; + return evas_textblock_cursor_content_get(c); } void --
[EGIT] [core/elementary] master 06/09: toolbar: remove a legacy code.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=c315ff1876afad4f340297291123072e6c4ee9d6 commit c315ff1876afad4f340297291123072e6c4ee9d6 Author: Youngbok Shin Date: Mon Nov 9 12:24:08 2015 -0800 toolbar: remove a legacy code. Summary: The icon is already sub object of VIEW(item) by content_set. We don't need to make icon as a sub object of obj again. It was used when VIEW(item) is Edje object. Test Plan: None Reviewers: Hermet, eagleeye, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3249 Signed-off-by: Cedric BAIL --- src/lib/elm_toolbar.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 5d46d1f..0484544 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -2412,7 +2412,6 @@ _item_new(Evas_Object *obj, elm_layout_signal_emit(VIEW(it), "elm,state,icon,visible", "elm"); elm_layout_signal_emit(VIEW(it), "elm,icon,visible", "elm"); evas_object_show(it->icon); -elm_widget_sub_object_add(obj, it->icon); } else { --
[EGIT] [core/elementary] master 08/09: toolbar: reduce changing widget parent-child relationship when an item is added.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=06c15035b4f6541fe9f2fc60934287cb2e413c25 commit 06c15035b4f6541fe9f2fc60934287cb2e413c25 Author: Youngbok Shin Date: Mon Nov 9 12:25:04 2015 -0800 toolbar: reduce changing widget parent-child relationship when an item is added. Summary: It is an legacy of old code. When the view object of item was edje, I think there was no meaningless parent-child relationship changes. But, now, the view object is elm_layout and if we add object in proper order, we don't need to make an useless parent-child realationship in any moments. Test Plan: None Reviewers: woohyun, cedric Reviewed By: cedric Differential Revision: https://phab.enlightenment.org/D3254 Signed-off-by: Cedric BAIL --- src/lib/elm_toolbar.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index c68a287..0244939 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -2354,16 +2354,10 @@ _item_new(Evas_Object *obj, ELM_TOOLBAR_DATA_GET(obj, sd); - icon_obj = elm_icon_add(obj); - elm_icon_order_lookup_set(icon_obj, sd->lookup_order); - if (!icon_obj) return NULL; - Eo *eo_it = eo_add(ELM_TOOLBAR_ITEM_CLASS, obj); - if (!eo_it) - { -evas_object_del(icon_obj); -return NULL; - } + + if (!eo_it) return NULL; + ELM_TOOLBAR_ITEM_DATA_GET(eo_it, it); it->label = eina_stringshare_add(label); @@ -2377,6 +2371,9 @@ _item_new(Evas_Object *obj, VIEW(it) = elm_layout_add(obj); evas_object_data_set(VIEW(it), "item", it); + icon_obj = elm_icon_add(VIEW(it)); + elm_icon_order_lookup_set(icon_obj, sd->lookup_order); + if (_elm_config->access_mode == ELM_ACCESS_MODE_ON) _access_widget_item_register(it); @@ -2411,7 +2408,6 @@ _item_new(Evas_Object *obj, it); evas_object_event_callback_add (VIEW(it), EVAS_CALLBACK_MOUSE_UP, (Evas_Object_Event_Cb)_mouse_up_cb, it); - elm_widget_sub_object_add(obj, VIEW(it)); if (it->icon) { --
[EGIT] [core/efl] master 06/10: edje: initialize map.zoom values to fix old *.edj compatibility issues.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1ff131841bb4e4be2aa03ec129a800ff06326ee9 commit 1ff131841bb4e4be2aa03ec129a800ff06326ee9 Author: Youngbok Shin Date: Tue Nov 10 14:52:57 2015 -0800 edje: initialize map.zoom values to fix old *.edj compatibility issues. Summary: The initial values for map.zoom.x(y) should be [1.0]: it means 100%. The values from newly builded edj has been set properly. But, if a part from old *.edj turns on map feature, map.zoom.x(y) will be set [0.0]: it means 0%. So, the part will be invisible. We need to initialize these values. @fix Test Plan: 1. Build a *.edc file which has a part with [description.map.on: 1;] in EFL 1.13. 2. See it works well in EFL 1.13. 3. Install EFL 1.14 or laters. 4. See the part is disappear. Reviewers: Hermet, jpeg, cedric Reviewed By: cedric Subscribers: jiin.moon Differential Revision: https://phab.enlightenment.org/D3302 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 1dc890b..f499181 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -95,6 +95,7 @@ Eet_Data_Descriptor *_edje_edd_edje_filter_directory = NULL; data = eina_mempool_malloc(_emp_##Type, size); \ memset(data, 0, size); \ data->clip_to_id = -1; \ + data->map.zoom.x = data->map.zoom.y = 1.0; \ return data; \ } \ \ --
[EGIT] [core/efl] efl-1.15 01/01: edje: initialize map.zoom values to fix old *.edj compatibility issues.
cedric pushed a commit to branch efl-1.15. http://git.enlightenment.org/core/efl.git/commit/?id=f61ba2bfce204c59cfd70e5d7410034d3ac4f784 commit f61ba2bfce204c59cfd70e5d7410034d3ac4f784 Author: Youngbok Shin Date: Tue Nov 10 14:52:57 2015 -0800 edje: initialize map.zoom values to fix old *.edj compatibility issues. Summary: The initial values for map.zoom.x(y) should be [1.0]: it means 100%. The values from newly builded edj has been set properly. But, if a part from old *.edj turns on map feature, map.zoom.x(y) will be set [0.0]: it means 0%. So, the part will be invisible. We need to initialize these values. @fix Test Plan: 1. Build a *.edc file which has a part with [description.map.on: 1;] in EFL 1.13. 2. See it works well in EFL 1.13. 3. Install EFL 1.14 or laters. 4. See the part is disappear. Reviewers: Hermet, jpeg, cedric Reviewed By: cedric Subscribers: jiin.moon Differential Revision: https://phab.enlightenment.org/D3302 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index cedda6d..18d81fa 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -93,6 +93,7 @@ Eet_Data_Descriptor *_edje_edd_edje_filter_directory = NULL; data = eina_mempool_malloc(_emp_##Type, size); \ memset(data, 0, size); \ data->clip_to_id = -1; \ + data->map.zoom.x = data->map.zoom.y = 1.0; \ return data; \ } \ \ --
[EGIT] [core/efl] efl-1.16 02/02: edje: initialize map.zoom values to fix old *.edj compatibility issues.
cedric pushed a commit to branch efl-1.16. http://git.enlightenment.org/core/efl.git/commit/?id=62b6a86ef2eff43dcc1422885add9887c0afa93d commit 62b6a86ef2eff43dcc1422885add9887c0afa93d Author: Youngbok Shin Date: Tue Nov 10 14:52:57 2015 -0800 edje: initialize map.zoom values to fix old *.edj compatibility issues. Summary: The initial values for map.zoom.x(y) should be [1.0]: it means 100%. The values from newly builded edj has been set properly. But, if a part from old *.edj turns on map feature, map.zoom.x(y) will be set [0.0]: it means 0%. So, the part will be invisible. We need to initialize these values. @fix Test Plan: 1. Build a *.edc file which has a part with [description.map.on: 1;] in EFL 1.13. 2. See it works well in EFL 1.13. 3. Install EFL 1.14 or laters. 4. See the part is disappear. Reviewers: Hermet, jpeg, cedric Reviewed By: cedric Subscribers: jiin.moon Differential Revision: https://phab.enlightenment.org/D3302 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_data.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/edje/edje_data.c b/src/lib/edje/edje_data.c index 1dc890b..f499181 100644 --- a/src/lib/edje/edje_data.c +++ b/src/lib/edje/edje_data.c @@ -95,6 +95,7 @@ Eet_Data_Descriptor *_edje_edd_edje_filter_directory = NULL; data = eina_mempool_malloc(_emp_##Type, size); \ memset(data, 0, size); \ data->clip_to_id = -1; \ + data->map.zoom.x = data->map.zoom.y = 1.0; \ return data; \ } \ \ --
[EGIT] [core/elementary] master 01/01: gengrid: Prevent duplicated selected function calls when item is unselected in the function.
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=df93efe12322fcc10d63cc700062ed398dca9bef commit df93efe12322fcc10d63cc700062ed398dca9bef Author: Youngbok Shin Date: Wed Nov 18 19:39:13 2015 +0900 gengrid: Prevent duplicated selected function calls when item is unselected in the function. Summary: If item is unselected in a selected function, selected function will be called once more from _elm_gengrid_elm_widget_on_focus. It is happened when elm_gengrid object has no focus and one of item is selected by mouse up event. To fix this issue, we need to set focus to item and keep the address of selected item before calling selected function. @fix Test Plan: 1. Install & Run efbb (Escape From Booty Bay: https://git.enlightenment.org/games/efbb.git/) 2. Select a level in the main menu. (It is using elm_gengrid). 3. See duplicated target images. Reviewers: cedric, SanghyeonLee Reviewed By: SanghyeonLee Differential Revision: https://phab.enlightenment.org/D3323 --- src/lib/elm_gengrid.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_gengrid.c b/src/lib/elm_gengrid.c index ce18912..1b6f0b4 100644 --- a/src/lib/elm_gengrid.c +++ b/src/lib/elm_gengrid.c @@ -4125,13 +4125,16 @@ _item_select(Elm_Gen_Item *it) evas_object_ref(obj); it->walking++; sd->walking++; + + elm_object_item_focus_set(eo_it, EINA_TRUE); + sd->last_selected_item = eo_it; + if (it->func.func) it->func.func((void *)it->func.data, WIDGET(it), eo_it); if (it->generation == sd->generation) { eo_do(WIDGET(it), eo_event_callback_call(EVAS_SELECTABLE_INTERFACE_EVENT_SELECTED, eo_it)); if (_elm_config->atspi_mode) elm_interface_atspi_accessible_state_changed_signal_emit(eo_it, ELM_ATSPI_STATE_SELECTED, EINA_TRUE); -elm_object_item_focus_set(eo_it, EINA_TRUE); } it->walking--; @@ -4144,9 +4147,8 @@ _item_select(Elm_Gen_Item *it) { it->del_cb(it); eo_del(eo_it); + sd->last_selected_item = NULL; } -else - sd->last_selected_item = eo_it; } evas_object_unref(obj); } --
[EGIT] [core/efl] master 01/01: Evas object: Add paragraph_direciton APIs
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a9b4be11e1e7525d98c08a5bb04b1f29ea8b0d4f commit a9b4be11e1e7525d98c08a5bb04b1f29ea8b0d4f Author: Youngbok Shin Date: Thu Nov 19 11:37:07 2015 + Evas object: Add paragraph_direciton APIs Summary: It adds evas_object_paragraph_direction_set, get APIs. The APIs set or get paragraph direction to/from the given object. It changes BiDi calculations and affect the direction and aligning of text. It doesn't have any effect to text without Fribidi library. The default paragraph direction is EVAS_BIDI_DIRECTION_INHERIT. If dir is EVAS_BIDI_DIRECTION_INHERIT, paragraph direction is changed according to smart parent object. If there is no smart parent object, paragraph direction works as EVAS_BIDI_DIRECTION_NEUTRAL. @feature Test Plan: Test cases included to the following files. - evas_test_textblock.c - evas_test_text.c - evas_test_object_smart.c Run "make check". Reviewers: woohyun, raster, herdsman, tasn Subscribers: c, raster, cedric Differential Revision: https://phab.enlightenment.org/D1690 --- src/Makefile_Evas.am | 1 + src/lib/edje/edje_object.eo| 1 + src/lib/edje/edje_smart.c | 11 ++ src/lib/evas/canvas/evas_object.eo | 13 ++ src/lib/evas/canvas/evas_object_main.c | 12 ++ src/lib/evas/canvas/evas_object_smart.c| 106 ++ src/lib/evas/canvas/evas_object_smart.eo | 2 + src/lib/evas/canvas/evas_object_text.c | 126 +++- src/lib/evas/canvas/evas_object_textblock.c| 112 +- src/lib/evas/canvas/evas_text.eo | 2 + src/lib/evas/canvas/evas_textblock.eo | 2 + src/lib/evas/canvas/evas_types.eot | 3 +- src/lib/evas/common/language/evas_bidi_utils.c | 13 +- src/lib/evas/common/language/evas_bidi_utils.h | 2 +- src/tests/evas/evas_suite.c| 1 + src/tests/evas/evas_suite.h| 1 + src/tests/evas/evas_test_object_smart.c| 180 +++ src/tests/evas/evas_test_text.c| 9 ++ src/tests/evas/evas_test_textblock.c | 194 - 19 files changed, 775 insertions(+), 16 deletions(-) diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am index 11ebd43..e5abebc 100644 --- a/src/Makefile_Evas.am +++ b/src/Makefile_Evas.am @@ -2121,6 +2121,7 @@ tests_evas_evas_suite_SOURCES = \ tests/evas/evas_suite.c \ tests/evas/evas_test_init.c \ tests/evas/evas_test_object.c \ +tests/evas/evas_test_object_smart.c \ tests/evas/evas_test_textblock.c \ tests/evas/evas_test_text.c \ tests/evas/evas_test_callbacks.c \ diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index 31e4aff..ff80ef3 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -2138,6 +2138,7 @@ class Edje.Object (Evas.Smart_Clipped, Efl.File) Eo.Base.constructor; Eo.Base.destructor; Eo.Base.dbg_info_get; + Evas.Object.paragraph_direction.set; Evas.Object_Smart.hide; Evas.Object_Smart.calculate; Evas.Object_Smart.show; diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 5bd5ce2..43227a0 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -389,4 +389,15 @@ edje_object_file_get(const Edje_Object *obj, const char **file, const char **gro eo_do((Edje_Object *)obj, efl_file_get(file, group)); } +EOLIAN static void +_edje_object_evas_object_paragraph_direction_set(Eo *obj, Edje *ed, Evas_BiDi_Direction dir) +{ + eo_do_super(obj, MY_CLASS, evas_obj_paragraph_direction_set(dir)); + + /* Make it dirty to recalculate edje. + It needs to move text objects according to new paragraph direction */ + ed->dirty = EINA_TRUE; + eo_do(obj, evas_obj_smart_need_recalculate_set(1)); +} + #include "edje_object.eo.c" diff --git a/src/lib/evas/canvas/evas_object.eo b/src/lib/evas/canvas/evas_object.eo index 0639af2..af5b853 100644 --- a/src/lib/evas/canvas/evas_object.eo +++ b/src/lib/evas/canvas/evas_object.eo @@ -976,6 +976,19 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx.Base, Efl.Gfx.Stac dispmode: Evas.Display_Mode; [[Display mode hint.]] } } + @property paragraph_direction { + [[This handles text paragraph direction of the given object. + Even if the given object is not textblock or text, its smart child objects + can inherit the paragraph direction from the given object. + The default paragraph direction is @Evas.BiDi_Direction.inherit.]] + set { + } + get { + } + values { +dir: Evas.BiDi_Direction; [[Paragraph dir
[EGIT] [misc/ephysics_tests] master 01/01: ephysics_test: remove error messages from edje calculations.
cedric pushed a commit to branch master. http://git.enlightenment.org/misc/ephysics_tests.git/commit/?id=23138ef8b52614be5991a57cd1e08340a34a7d67 commit 23138ef8b52614be5991a57cd1e08340a34a7d67 Author: Youngbok Shin Date: Fri Nov 20 04:08:55 2015 +0100 ephysics_test: remove error messages from edje calculations. Summary: There was missing [fixed] attributes in some parts. It caused a lot of error messages when it loads edje. @fix Test Plan: 1. Run ephysics_test and click any test cases. 2. See error messages from your console. Reviewers: cedric, dorileo, bdilly Subscribers: CHAN Differential Revision: https://phab.enlightenment.org/D3320 Signed-off-by: Cedric BAIL --- data/themes/frame.edc | 1 + data/themes/loading_bar.edc | 1 + 2 files changed, 2 insertions(+) diff --git a/data/themes/frame.edc b/data/themes/frame.edc index 48fd754..6bc634c 100644 --- a/data/themes/frame.edc +++ b/data/themes/frame.edc @@ -129,6 +129,7 @@ " Y Axis J - K" " Z Axis F - G"; } + fixed: 1 1; } description { state: "msg1" 0.0; diff --git a/data/themes/loading_bar.edc b/data/themes/loading_bar.edc index 0b962d9..1ec78a4 100644 --- a/data/themes/loading_bar.edc +++ b/data/themes/loading_bar.edc @@ -34,6 +34,7 @@ rel2.to: "bar"; align: 0 0.5; image.normal: "loading_knob.png"; + fixed: 1 1; } description { state: "end" 0.0; --
[EGIT] [core/efl] master 01/01: evas: Add ExtraLight, ExtraBold for font weight.
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=507baf4891951933bcd8bd5baee5f9e716398fee commit 507baf4891951933bcd8bd5baee5f9e716398fee Author: Youngbok Shin Date: Thu Nov 26 10:16:13 2015 +0200 evas: Add ExtraLight, ExtraBold for font weight. Summary: Evas supports UltraLight, UltraBold as font weight. These terms have same weight value as ExtraLight, ExtraBold. Some applications, for example, fontforge, use ExtraLight, ExtraBold terms for these weight values. So, it would be better to support these terms, too. @feature Test Plan: None Reviewers: tasn, woohyun, herdsman Reviewed By: herdsman Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3126 --- src/lib/evas/canvas/evas_font_dir.c | 4 src/lib/evas/canvas/evas_object_textblock.c | 2 ++ src/lib/evas/include/evas_private.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index c3491cc..df0f5ef 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -268,12 +268,14 @@ static int _fc_weight_map[] = FC_WEIGHT_NORMAL, FC_WEIGHT_THIN, FC_WEIGHT_ULTRALIGHT, + FC_WEIGHT_EXTRALIGHT, FC_WEIGHT_LIGHT, FC_WEIGHT_BOOK, FC_WEIGHT_MEDIUM, FC_WEIGHT_SEMIBOLD, FC_WEIGHT_BOLD, FC_WEIGHT_ULTRABOLD, + FC_WEIGHT_EXTRABOLD, FC_WEIGHT_BLACK, FC_WEIGHT_EXTRABLACK }; @@ -328,12 +330,14 @@ static Style_Map _style_weight_map[] = {"normal", EVAS_FONT_WEIGHT_NORMAL}, {"thin", EVAS_FONT_WEIGHT_THIN}, {"ultralight", EVAS_FONT_WEIGHT_ULTRALIGHT}, + {"extralight", EVAS_FONT_WEIGHT_EXTRALIGHT}, {"light", EVAS_FONT_WEIGHT_LIGHT}, {"book", EVAS_FONT_WEIGHT_BOOK}, {"medium", EVAS_FONT_WEIGHT_MEDIUM}, {"semibold", EVAS_FONT_WEIGHT_SEMIBOLD}, {"bold", EVAS_FONT_WEIGHT_BOLD}, {"ultrabold", EVAS_FONT_WEIGHT_ULTRABOLD}, + {"extrabold", EVAS_FONT_WEIGHT_ULTRABOLD}, {"black", EVAS_FONT_WEIGHT_BLACK}, {"extrablack", EVAS_FONT_WEIGHT_EXTRABLACK} }; diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 7a9aafc..bb9e8af 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -1443,12 +1443,14 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch * @li "normal" * @li "thin" * @li "ultralight" + * @li "extralight" * @li "light" * @li "book" * @li "medium" * @li "semibold" * @li "bold" * @li "ultrabold" + * @li "extrabold" * @li "black" * @li "extrablack" * @code diff --git a/src/lib/evas/include/evas_private.h b/src/lib/evas/include/evas_private.h index 26868c1..56407d9 100644 --- a/src/lib/evas/include/evas_private.h +++ b/src/lib/evas/include/evas_private.h @@ -485,12 +485,14 @@ enum _Evas_Font_Weight EVAS_FONT_WEIGHT_NORMAL, EVAS_FONT_WEIGHT_THIN, EVAS_FONT_WEIGHT_ULTRALIGHT, + EVAS_FONT_WEIGHT_EXTRALIGHT, EVAS_FONT_WEIGHT_LIGHT, EVAS_FONT_WEIGHT_BOOK, EVAS_FONT_WEIGHT_MEDIUM, EVAS_FONT_WEIGHT_SEMIBOLD, EVAS_FONT_WEIGHT_BOLD, EVAS_FONT_WEIGHT_ULTRABOLD, + EVAS_FONT_WEIGHT_EXTRABOLD, EVAS_FONT_WEIGHT_BLACK, EVAS_FONT_WEIGHT_EXTRABLACK }; --
[EGIT] [core/efl] master 01/01: evas: fix a NULL dereference issue in font.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=917fdbd59706145ea37eae59a6a47f7b9d1e7ff3 commit 917fdbd59706145ea37eae59a6a47f7b9d1e7ff3 Author: Youngbok Shin Date: Tue Dec 1 15:03:27 2015 -0800 evas: fix a NULL dereference issue in font. Summary: eina_list_remove returns Eina_List pointer. It could be NULL if the last list item is removed. And the returned Eina_List pointer could be different from the given list. So, calling free for fdir->data after fdir's address is changed is dangerous. @fix Test Plan: Run expedite or test app with evas_font_path_append() API. Reviewers: stefan_schmidt, jpeg Reviewed By: jpeg Subscribers: stefan, jiin.moon, cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3392 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_font_dir.c | 15 +++ 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/lib/evas/canvas/evas_font_dir.c b/src/lib/evas/canvas/evas_font_dir.c index dc9ac20..b54e6c0 100644 --- a/src/lib/evas/canvas/evas_font_dir.c +++ b/src/lib/evas/canvas/evas_font_dir.c @@ -1122,7 +1122,7 @@ static Evas_Font_Dir * object_text_font_cache_dir_add(char *dir) { Evas_Font_Dir *fd; - char *tmp, *tmp2; + char *tmp, *tmp2, *file; Eina_List *fdir; Evas_Font *fn; @@ -1183,9 +1183,9 @@ object_text_font_cache_dir_add(char *dir) /* directoy listing */ fdir = evas_file_path_list(dir, "*.ttf", 0); - while (fdir) + EINA_LIST_FREE(fdir, file) { - tmp = evas_file_path_join(dir, fdir->data); + tmp = evas_file_path_join(dir, file); if (tmp) { fn = calloc(1, sizeof(Evas_Font)); @@ -1194,12 +1194,12 @@ object_text_font_cache_dir_add(char *dir) char *p; fn->type = 0; - tmp2 = alloca(strlen(fdir->data) + 1); - strcpy(tmp2, fdir->data); + tmp2 = alloca(strlen(file) + 1); + strcpy(tmp2, file); p = strrchr(tmp2, '.'); if (p) *p = 0; fn->simple.name = eina_stringshare_add(tmp2); - tmp2 = evas_file_path_join(dir, fdir->data); + tmp2 = evas_file_path_join(dir, file); if (tmp2) { fn->path = eina_stringshare_add(tmp2); @@ -1209,8 +1209,7 @@ object_text_font_cache_dir_add(char *dir) } free(tmp); } - fdir = eina_list_remove(fdir, fdir->data); - free(fdir->data); + free(file); } /* fonts.alias */ --
[EGIT] [core/efl] master 01/01: efl: fix build failure when it builds with coverage.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c421e519b0e834053023a600e8cad5b77173b4ad commit c421e519b0e834053023a600e8cad5b77173b4ad Author: Youngbok Shin Date: Tue Dec 1 15:30:04 2015 -0800 efl: fix build failure when it builds with coverage. Summary: When src/bin/efl/ builds with [--with-tests=coverage], it fails to find gcov lib. The gcov/lcov related options has to be passed when it is builded. And it only contained in EFL_CFLAGS, EFL_LIBS. @fix Test Plan: Be sure the your enviroments to build src/bin/efl/. 1. Run ./autogen.sh --with-tests=coverage 2. make or make check 3. See the build errors. Reviewers: raster, jpeg, cedric Reviewed By: cedric Subscribers: herdsman Differential Revision: https://phab.enlightenment.org/D3370 Signed-off-by: Cedric BAIL --- src/Makefile_Efl.am | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index ea0809d..aad9686 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -90,7 +90,7 @@ bin/efl/efl_debugd.c \ bin/efl/efl_debug_common.c \ bin/efl/efl_debug_common.h bin_efl_efl_debugd_CPPFLAGS = -I$(top_builddir)/src/bin/efl @EINA_CFLAGS@ @ECORE_CFLAGS@ @ECORE_CON_CFLAGS@ -bin_efl_efl_debugd_LDADD = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ +bin_efl_efl_debugd_LDADD = @EFL_LIBS@ @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ bin_efl_efl_debugd_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ bin_efl_efl_debug_SOURCES = \ @@ -98,6 +98,6 @@ bin/efl/efl_debug.c \ bin/efl/efl_debug_common.c \ bin/efl/efl_debug_common.h bin_efl_efl_debug_CPPFLAGS = -I$(top_builddir)/src/bin/efl @EINA_CFLAGS@ @ECORE_CFLAGS@ @ECORE_CON_CFLAGS@ -bin_efl_efl_debug_LDADD = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ +bin_efl_efl_debug_LDADD = @EFL_LIBS@ @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ bin_efl_efl_debug_DEPENDENCIES = @USE_EINA_INTERNAL_LIBS@ @USE_ECORE_INTERNAL_LIBS@ @USE_ECORE_CON_INTERNAL_LIBS@ --
[EGIT] [core/efl] master 01/01: Evas Textblock: Fix text disappear issue when text is made up with multiple items.
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=809d8fdafea0b38aa21c40dd9460be82dffece3a commit 809d8fdafea0b38aa21c40dd9460be82dffece3a Author: Youngbok Shin Date: Wed Dec 2 09:36:47 2015 +0200 Evas Textblock: Fix text disappear issue when text is made up with multiple items. Summary: Text is disappearing when we resize a singleline Evas Textblock with ellipsis. It is happened by putting a Text item at logical_items list without considering about logical position. It is only happended the text is made up with multiple items. @fix Test Plan: 1. Run elementary_test 2. Click Label Ellipsis 3. Resize the window dynamically and see the result. Reviewers: woohyun, tasn, herdsman Subscribers: jpeg, subodh6129, shilpasingh, cedric Maniphest Tasks: T2709 Differential Revision: https://phab.enlightenment.org/D3022 --- src/lib/evas/canvas/evas_object_textblock.c | 11 +- src/tests/evas/evas_test_textblock.c| 31 + 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index bb9e8af..879659c 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -4803,7 +4803,16 @@ _layout_handle_ellipsis(Ctxt *c, Evas_Object_Textblock_Item *it, Eina_List *i) if ((wrap > 0) && !IS_AT_END(ti, (size_t) wrap)) { - _layout_item_text_split_strip_white(c, ti, i, wrap); + Eina_List *l = i; + + while (l) +{ + Evas_Object_Textblock_Item *iit = eina_list_data_get(l); + if (iit == _ITEM(ti)) break; + l = eina_list_prev(l); +} + + _layout_item_text_split_strip_white(c, ti, l, wrap); break; } else if (wrap < 0) diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 70592b9..ad16793 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2018,6 +2018,37 @@ START_TEST(evas_textblock_wrapping) evas_object_textblock_size_formatted_get(tb, &w, &h); ck_assert_int_le(w, ellip_w); + /* Ellipsis test for multiple items in singleline. */ + { +evas_object_resize(tb, 500, 500); +evas_object_textblock_text_markup_set(tb, "ABC 한글한글 DEF"); +evas_textblock_cursor_format_prepend(cur, "+ ellipsis=1.0"); +evas_object_textblock_size_native_get(tb, &nw, &nh); +evas_object_resize(tb, nw, nh); +evas_object_textblock_size_formatted_get(tb, &w, &h); + +/* Make the object's width smaller. */ +for (i = 1; (nw / 5) <= (nw - i); i++) + { + evas_object_resize(tb, nw - i, nh); + evas_object_textblock_size_formatted_get(tb, &bw, &bh); + ck_assert_int_le(bw, w); + } + +/* Revert the object's width to native width. */ +for (; (nw - i) <= nw; i--) + { + evas_object_resize(tb, nw - i, nh); + evas_object_textblock_size_formatted_get(tb, &bw, &bh); + ck_assert_int_le(bw, w); + } + +/* The object resized same as native size. + * So, formatted width and native width should be same + * just like our first check. */ +ck_assert_int_eq(bw, w); + } + { double ellip; for(ellip = 0.0; ellip <= 1.0; ellip = ellip + 0.1) --
[EGIT] [core/efl] master 01/01: Evas textblock: Skip layout logic for an text item which doesn't have font.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=76fa1159c5713cd8e4bdacc88dd249603eacef24 commit 76fa1159c5713cd8e4bdacc88dd249603eacef24 Author: Youngbok Shin Date: Fri Dec 4 14:46:26 2015 + Evas textblock: Skip layout logic for an text item which doesn't have font. Summary: Evas textblock could cause infinite loop if there is no fonts to use. If there is no fonts, text_props.text_len is never set. When text_props.text_len is 0, the for loop in _layout_par runs forever. It is ridiculous to use Textblock without fonts. But, it shouldn't runs infinite loop in any situation. @fix Test Plan: 1. Remove all of fonts in your EFL or Tizen device. (Or you can test it modifying some codes in Textblock by skipping load fonts.) 2. Run elementary_test -to entry3 or see any multiline textblocks. Reviewers: tasn, herdsman, woohyun Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3402 --- src/lib/evas/canvas/evas_object_textblock.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index df4734a..51d244d 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5173,7 +5173,8 @@ _layout_par(Ctxt *c) it = _ITEM(eina_list_data_get(i)); /* Skip visually deleted items */ -if (it->visually_deleted) +if (it->visually_deleted || +((it->type == EVAS_TEXTBLOCK_ITEM_TEXT) && !it->format->font.font)) { //one more chance for ellipsis special cases if (c->o->ellip_prev_it == i) --
[EGIT] [core/efl] master 01/01: Evas text: Fix Evas Text truncated text case.
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=20ef85e307818c7c92927688ee6fd5d9dec1ee8f commit 20ef85e307818c7c92927688ee6fd5d9dec1ee8f Author: Youngbok Shin Date: Wed Dec 9 09:50:33 2015 +0200 Evas text: Fix Evas Text truncated text case. Summary: Evas Text only concerns about a advance of each text item. When a width of last character is bigger than its advance, the last character can be truncated. And the different line size calculation caused different aligning between Evas Text and Evas Textblock. So, the width of last character will be considered in Evas Text just like Evas Textblock. @fix Test Plan: The following text shows how the size calculation is different between Evas Textblock and Text. Get native size from Evas Textblock and get width(geometry) of Evas Text. You can see the width of Evas Text is bigger than native size of Evas Textblock. (adv > width) こんにちは。 The following text will be truncated without this patch. (adv < width) ନୂଁ Reviewers: woohyun, tasn, herdsman Subscribers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D3004 --- src/lib/evas/canvas/evas_object_text.c | 33 ++--- src/tests/evas/evas_test_text.c| 65 ++ 2 files changed, 71 insertions(+), 27 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index ff3e761..46b2039 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -54,7 +54,7 @@ struct _Evas_Text_Data Evas_Object_Text_Item*ellipsis_end; Evas_Coordw, h; int advance; - int advance_without_ellipsis; + int width_without_ellipsis; Eina_Bool ellipsis; } last_computed; @@ -348,9 +348,9 @@ _evas_object_text_char_at_coords(const Evas_Object *eo_obj, } static Evas_Coord -_evas_object_text_horiz_advance_without_ellipsis_get(const Evas_Text_Data *o) +_evas_object_text_horiz_width_without_ellipsis_get(const Evas_Text_Data *o) { - return o->last_computed.advance_without_ellipsis; + return o->last_computed.width_without_ellipsis; } static Evas_Coord @@ -685,7 +685,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); EvasBiDiStrIndex *v_to_l = NULL; - Evas_Coord advance = 0; + Evas_Coord advance = 0, width = 0; size_t pos, visual_pos; int len = eina_unicode_strlen(text); int l = 0, r = 0; @@ -754,6 +754,8 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t if (text) { +const Evas_Object_Text_Item *last_it = NULL; + while (len > 0) { Evas_Font_Instance *script_fi = NULL; @@ -791,15 +793,22 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t pos += run_len; script_len -= run_len; len -= run_len; + + if (it->w > 0) +last_it = it; } } + +width = advance; +if (last_it) + width += last_it->w - last_it->adv; } - o->last_computed.advance_without_ellipsis = advance; + o->last_computed.width_without_ellipsis = width; _evas_object_text_pad_get(eo_obj, o, &l, &r, NULL, NULL); /* Handle ellipsis */ - if (pos && (o->cur.ellipsis >= 0.0) && (advance + l + r > obj->cur->geometry.w) && (obj->cur->geometry.w > 0)) + if (pos && (o->cur.ellipsis >= 0.0) && (width + l + r > obj->cur->geometry.w) && (obj->cur->geometry.w > 0)) { Evas_Coord ellip_frame = obj->cur->geometry.w; Evas_Object_Text_Item *start_ellip_it = NULL, *end_ellip_it = NULL; @@ -821,7 +830,7 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t start_ellip_it = _layout_ellipsis_item_new(obj, o); } o->last_computed.ellipsis_start = start_ellip_it; - ellip_frame -= start_ellip_it->adv; + ellip_frame -= start_ellip_it->w; } if (o->cur.ellipsis != 1) { @@ -837,18 +846,18 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t end_ellip_it = _layout_ellipsis_item_new(obj, o); } o->last_computed.ellipsis_end = end_ellip_it; - ellip_frame -= end_ellip_it->adv; + ellip_frame -= end_ellip_it->w;
[EGIT] [core/efl] master 01/01: Evas Textblock: Fix NULL dereferencing issue
herdsman pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fcba96384f40fbff6f3b6c7fb1fbe3d0d7e62699 commit fcba96384f40fbff6f3b6c7fb1fbe3d0d7e62699 Author: Youngbok Shin Date: Sun Dec 13 17:13:13 2015 +0200 Evas Textblock: Fix NULL dereferencing issue Summary: Even if the given two cursor is NULL, it shouldn't be crashed. @fix Test Plan: Test case included in Evas test suite. Run "make check". Reviewers: herdsman, tasn Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3422 --- src/lib/evas/canvas/evas_object_textblock.c | 14 +++--- src/tests/evas/evas_test_textblock.c| 8 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d2bd6ee..48e7b3b 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -9873,9 +9873,6 @@ _evas_textblock_cursor_range_text_markup_get(const Evas_Textblock_Cursor *cur1, Eina_Strbuf *buf; Evas_Textblock_Cursor *cur2; - if (!cur1 || !cur1->node) return NULL; - if (!_cur2 || !_cur2->node) return NULL; - if (cur1->obj != _cur2->obj) return NULL; buf = eina_strbuf_new(); if (evas_textblock_cursor_compare(cur1, _cur2) > 0) @@ -9984,9 +9981,6 @@ _evas_textblock_cursor_range_text_plain_get(const Evas_Textblock_Cursor *cur1, c Evas_Object_Textblock_Node_Text *n1, *n2; Evas_Textblock_Cursor *cur2; - if (!cur1 || !cur1->node) return NULL; - if (!_cur2 || !_cur2->node) return NULL; - if (cur1->obj != _cur2->obj) return NULL; buf = eina_ustrbuf_new(); if (evas_textblock_cursor_compare(cur1, _cur2) > 0) @@ -10111,7 +10105,13 @@ evas_textblock_cursor_range_formats_get(const Evas_Textblock_Cursor *cur1, const EAPI char * evas_textblock_cursor_range_text_get(const Evas_Textblock_Cursor *cur1, const Evas_Textblock_Cursor *cur2, Evas_Textblock_Text_Type format) { - Evas_Object_Protected_Data *obj = eo_data_scope_get(cur1->obj, EVAS_OBJECT_CLASS); + Evas_Object_Protected_Data *obj; + + if (!cur1 || !cur1->node) return NULL; + if (!cur2 || !cur2->node) return NULL; + if (cur1->obj != cur2->obj) return NULL; + + obj = eo_data_scope_get(cur1->obj, EVAS_OBJECT_CLASS); evas_object_async_block(obj); if (format == EVAS_TEXTBLOCK_TEXT_MARKUP) return _evas_textblock_cursor_range_text_markup_get(cur1, cur2); diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 6a0b7b1..467e164 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2923,6 +2923,14 @@ START_TEST(evas_textblock_text_getters) "and now in english.")); /* Range get */ + /* If one of the given cursor is NULL, it returns NULL. */ + fail_if(evas_textblock_cursor_range_text_get(NULL, NULL, +EVAS_TEXTBLOCK_TEXT_MARKUP)); + fail_if(evas_textblock_cursor_range_text_get(cur, NULL, +EVAS_TEXTBLOCK_TEXT_MARKUP)); + fail_if(evas_textblock_cursor_range_text_get(NULL, cur, +EVAS_TEXTBLOCK_TEXT_MARKUP)); + Evas_Textblock_Cursor *main_cur = evas_object_textblock_cursor_get(tb); evas_textblock_cursor_pos_set(main_cur, 2); evas_textblock_cursor_pos_set(cur, 2); --
[EGIT] [core/elementary] master 01/01: calendar: Apply elm_button widgets instead of manually implemented spinner buttons.
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=55352b09346ca541c98bdfe16832430ab5ec25c6 commit 55352b09346ca541c98bdfe16832430ab5ec25c6 Author: Youngbok Shin Date: Tue Dec 22 18:48:16 2015 +0900 calendar: Apply elm_button widgets instead of manually implemented spinner buttons. Summary: The spinner buttons in elm_calendar widget can be replaced by elm_buttons. Then, using elm_button widgets makes it much easier to maintain. And the buttons has to be focusable with "tab" key just like elm_spinner widget. The lagacy callbacks for signals from edje is not removed for backward compatibility. @feature Test Plan: elementary_test -> calendar, calendar2, calendar3 Reviewers: seoz, Hermet, kimcinoo, cedric, woohyun Reviewed By: woohyun Subscribers: CHAN Differential Revision: https://phab.enlightenment.org/D3198 --- data/themes/edc/elm/button.edc | 4 + data/themes/edc/elm/calendar.edc | 134 +++- src/lib/elm_calendar.c | 426 --- src/lib/elm_widget_calendar.h| 10 +- 4 files changed, 429 insertions(+), 145 deletions(-) diff --git a/data/themes/edc/elm/button.edc b/data/themes/edc/elm/button.edc index 92b026b..0088b6d 100644 --- a/data/themes/edc/elm/button.edc +++ b/data/themes/edc/elm/button.edc @@ -1337,6 +1337,8 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default"; /*** SPINNER BUTTONS STYLES **/ group { name: "elm/button/base/spinner/increase/default"; alias: "elm/button/base/spinner/increase/colorselector/default"; + alias: "elm/button/base/calendar/increase/default"; + alias: "elm/button/base/calendar/increase/double_spinners"; images.image: "sym_right_light_normal.png" COMP; images.image: "sym_right_glow_normal.png" COMP; images.image: "sym_right_dark_normal.png" COMP; @@ -1489,6 +1491,8 @@ group { name: "elm/button/base/hoversel_horizontal_entry/default"; group { name: "elm/button/base/spinner/decrease/default"; alias: "elm/button/base/spinner/decrease/colorselector/default"; inherit: "elm/button/base/spinner/increase/default"; + alias: "elm/button/base/calendar/decrease/default"; + alias: "elm/button/base/calendar/decrease/double_spinners"; images.image: "sym_left_light_normal.png" COMP; images.image: "sym_left_glow_normal.png" COMP; images.image: "sym_left_dark_normal.png" COMP; diff --git a/data/themes/edc/elm/calendar.edc b/data/themes/edc/elm/calendar.edc index 35a0367..b706a82 100644 --- a/data/themes/edc/elm/calendar.edc +++ b/data/themes/edc/elm/calendar.edc @@ -12,8 +12,8 @@ base: "font="FN" font_size=10 color=#151515 style=shadow_bottom shadow_color=#ffc0 align=center";\ }\ -#define CAL_SPIN(_sufix, _signal_sufix, _text, _relative)\ - part { name: "left_bt"#_sufix; type: RECT;\ +#define CAL_SPIN(_sufix, _text, _relative)\ + part { name: "left_bt"#_sufix; type: SPACER;\ scale: 1;\ description { state: "default" 0.0;\ fixed: 1 1;\ @@ -26,30 +26,6 @@ align: 0.0 0.5;\ min: 15 15;\ max: 15 15;\ -color: 0 0 0 0;\ - }\ - }\ - part { name: "left_bt"#_sufix"_over"; repeat_events: 1;\ - scale: 1;\ - description { state: "default" 0.0;\ -min: 15 15;\ -max: 15 15;\ -align: 0.5 0.5;\ -rel1.to: "left_bt"#_sufix;\ -rel2.to: "left_bt"#_sufix;\ -image.normal: "sym_left_light_normal.png";\ - }\ - description { state: "rtl" 0.0;\ -inherit: "default" 0.0;\ -image.normal: "sym_right_light_normal.png";\ - }\ - description { state: "clicked" 0.0;\ -inherit: "default" 0.0;\ -image.normal: "sym_left_glow_normal.png";\ - }\ - description { state: "clicked_rtl" 0.0;\ -inherit: "default" 0.0;\ -image.normal: "sym_right_glow_normal.png";\ }\ }\ part { name: "right_bt"#_sufix; type: RECT;\ @@ -68,26 +44,32 @@ color: 0 0 0 0;\ }\ }\ - part { name: "right_bt"#_sufix"_over"; repeat_events: 1;\ + part { name: "elm,calendar,button"#_sufix",left";\ + type: SWALLOW;\ scale: 1;\ description { state: "default" 0.0;\ -
[EGIT] [core/elementary] master 01/01: toolbar: Send a signal when shrink mode is changed.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=d1867909117123f74ac6a3561296a7bd57e5c22f commit d1867909117123f74ac6a3561296a7bd57e5c22f Author: Youngbok Shin Date: Mon Jan 4 09:31:29 2016 +0900 toolbar: Send a signal when shrink mode is changed. Summary: It is useful for changing item's state according to shrink mode. @feature Test Plan: It includes a use case for the patch in toolbar default theme. Run "elementary_test -to toolbar2". Reviewers: jaehwan, woohyun, cedric, raster Subscribers: eagleeye Differential Revision: https://phab.enlightenment.org/D3481 --- data/themes/edc/elm/toolbar.edc | 90 ++--- src/lib/elm_toolbar.c | 31 ++ src/lib/elm_toolbar.eo | 8 3 files changed, 123 insertions(+), 6 deletions(-) diff --git a/data/themes/edc/elm/toolbar.edc b/data/themes/edc/elm/toolbar.edc index d932ff2..f6cb533 100644 --- a/data/themes/edc/elm/toolbar.edc +++ b/data/themes/edc/elm/toolbar.edc @@ -379,6 +379,8 @@ group { name: "elm/toolbar/item/default"; #define DISABLE 4 script { public btmode; + public vertical = 0; + public scroll = 0; public eval_mode(m) { new m1 = m & MASK; new d = m & DISABLE; @@ -432,6 +434,44 @@ group { name: "elm/toolbar/item/default"; } } } + + public enable_scroll() { + set_int(scroll, 1); + + if (get_int(vertical)) +set_state(PART:"base", "vert_scroll", 0.0); + else +set_state(PART:"base", "scroll", 0.0); + } + + public disable_scroll() { + set_int(scroll, 0); + + if (get_int(vertical)) +set_state(PART:"base", "vert", 0.0); + else +set_state(PART:"base", "default", 0.0); + } + + public enable_vertical() { + set_int(vertical, 1); + + if (get_int(scroll)) +set_state(PART:"base", "vert_scroll", 0.0); + else +set_state(PART:"base", "vert", 0.0); + set_state(PART:"bend_clip", "vert", 0.0); + } + + public disable_vertical() { + set_int(vertical, 0); + + if (get_int(scroll)) +set_state(PART:"base", "scroll", 0.0); + else +set_state(PART:"base", "default", 0.0); + set_state(PART:"bend_clip", "default", 0.0); + } } parts { part { name: "base"; type: SPACER; @@ -441,6 +481,14 @@ group { name: "elm/toolbar/item/default"; rel1.offset: -1 0; rel2.offset: 0 -1; } + description { state: "scroll" 0.0; +inherit: "default" 0.0; +min: 80 0; + } + description { state: "vert_scroll" 0.0; +inherit: "vert" 0.0; +min: 0 80; + } } part { name: "shadow1"; mouse_events: 0; description { state: "default" 0.0; @@ -810,15 +858,45 @@ group { name: "elm/toolbar/item/default"; programs { program { signal: "elm,orient,horizontal"; source: "elm"; - action: STATE_SET "default" 0.0; - target: "base"; - target: "bend_clip"; + script { +disable_vertical(); + } } program { signal: "elm,orient,vertical"; source: "elm"; - action: STATE_SET "vert" 0.0; - target: "base"; - target: "bend_clip"; + script { +enable_vertical(); + } + } + program { + signal: "elm,state,shrink,scroll"; source: "elm"; + script { +enable_scroll(); + } + } + program { + signal: "elm,state,shrink,none"; source: "elm"; + script { +disable_scroll() + } + } + program { + signal: "elm,state,shrink,hide"; source: "elm"; + script { +disable_scroll() + } + } + program { + signal: "elm,state,shrink,menu"; source: "elm"; + script { +disable_scroll() + } + } + program { + signal: "elm,state,shrink,expand"; source: "elm"; + script { +disable_scroll() + } } program { name: "st0"; diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index d
[EGIT] [core/efl] master 01/02: Evas Textblock: Fix ellipsis when textblock is resized to formatted h.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3252e3bf78881cf03729737cd8fd2b0c746e512d commit 3252e3bf78881cf03729737cd8fd2b0c746e512d Author: Youngbok Shin Date: Mon Jan 4 15:00:56 2016 + Evas Textblock: Fix ellipsis when textblock is resized to formatted h. Summary: it->h is sum of max ascent and max descent. It shouldn't be used when handle ellipsis. Because, Evas Textblock uses these values for each lines differently according to its location. (start, end, else, single) So, for handling ellipsis exactly, it has to be fixed. Test Plan: A test case is included in Evas Test suite. Reviewers: woohyun, tasn, herdsman Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3475 --- src/lib/evas/canvas/evas_object_textblock.c | 16 +++- src/tests/evas/evas_test_textblock.c| 10 ++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index bfa7cf5..b28de11 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -5227,8 +5227,22 @@ _layout_par(Ctxt *c) * fast path. * Other values of 0.0 <= ellipsis < 1.0 are handled in * _layout_par_ellipsis_items */ + int ascent = 0, descent = 0, maxasc = 0, maxdesc = 0; + _layout_item_ascent_descent_adjust(c->obj, &ascent, &descent, +it, it->format); + + if (c->position == TEXTBLOCK_POSITION_START) + _layout_item_max_ascent_descent_calc(c->obj, &maxasc, &maxdesc, +it, TEXTBLOCK_POSITION_SINGLE); + else + _layout_item_max_ascent_descent_calc(c->obj, &maxasc, &maxdesc, +it, TEXTBLOCK_POSITION_END); + + if (ascent > maxasc) maxasc = ascent; + if (descent > maxdesc) maxdesc = descent; + if ((it->format->ellipsis == 1.0) && (c->h >= 0) && - ((2 * it->h + c->y > + ((ascent + descent + maxasc + maxdesc + c->y > c->h - c->o->style_pad.t - c->o->style_pad.b) || (!it->format->wrap_word && !it->format->wrap_char && !it->format->wrap_mixed && !it->format->wrap_hyphenation))) diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 528e640..332a658 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -2202,6 +2202,16 @@ START_TEST(evas_textblock_wrapping) ck_assert_int_eq(bh, h); + /* Check that unnecessary ellipsis is not applied */ + evas_object_textblock_text_markup_set(tb, "This is test for ellipsis with formatted height."); + evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed"); + evas_object_resize(tb, 100, 100); + evas_object_textblock_size_formatted_get(tb, NULL, &bh); + evas_object_resize(tb, 100, bh); + evas_textblock_cursor_format_prepend(cur, "+ wrap=mixed ellipsis=1.0"); + evas_object_textblock_size_formatted_get(tb, NULL, &h); + ck_assert_int_ge(h, bh); + END_TB_TEST(); } END_TEST --
[EGIT] [core/elementary] master 05/18: calendar: add color classes and text classes.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=fd142aa2fbd8b9f5a09c571ca91772142de1190e commit fd142aa2fbd8b9f5a09c571ca91772142de1190e Author: Youngbok Shin Date: Mon Jan 4 14:34:06 2016 -0800 calendar: add color classes and text classes. Summary: The following new color classes and text classes for calendar widget are added. "calendar_year_text" - Year Text in Title Area "calendar_month_text"- Month Text in Title Area "calendar_weekday_text" - Weekday Text "calendar_day_text" - Day Text "calendar_day_text_holiday" - Holiday Text "calendar_day_text_today"- Today Text "calendar_day_text_disabled" - Disabled Day Text "calendar_day_selected" - Selected Day Effect "calendar_day_highlighted" - Highlighted Day Effect "calendar_day_checked" - Checked Day Effect @feature Test Plan: N/A Reviewers: woohyun, raster, cedric, kimcinoo, jaehwan Subscribers: CHAN Differential Revision: https://phab.enlightenment.org/D3482 Signed-off-by: Cedric BAIL --- data/themes/colorclasses.edc | 32 data/themes/edc/elm/calendar.edc | 24 +++- src/lib/elm_config.c | 17 + 3 files changed, 64 insertions(+), 9 deletions(-) diff --git a/data/themes/colorclasses.edc b/data/themes/colorclasses.edc index 9cc9b9b..3d61f8a 100644 --- a/data/themes/colorclasses.edc +++ b/data/themes/colorclasses.edc @@ -110,6 +110,38 @@ color_classes { color: FN_COL_HIGHLIGHT_DISABLE; desc: "Text of a disabled anchor link"; } + color_class { name: "calendar_year_text"; + color: FN_COL_DEFAULT; + desc: "Year Text in Title Area"; + } + color_class { name: "calendar_month_text"; + color: FN_COL_DEFAULT; + desc: "Month Text in Title Area"; + } + color_class { name: "calendar_weekday_text"; + color: FN_COL_DISABLE; + desc: "Weekday Text"; + } + color_class { name: "calendar_day_text"; + color: 255 255 255 255; + color3: 0 0 0 128; + desc: "Day Text"; + } + color_class { name: "calendar_day_text_holiday"; + color: 128 128 128 255; + color3: 0 0 0 128; + desc: "Holiday Text"; + } + color_class { name: "calendar_day_text_today"; + color: 51 153 255 255; + color2: 51 153 255 24; + desc: "Today Text"; + } + color_class { name: "calendar_day_text_disabled"; + color: 21 21 21 255; + color3: 255 255 255 192; + desc: "Disabled Day Text"; + } color_class { name: "check_text"; color: FN_COL_DEFAULT; desc: "Text of a checkbox's label"; diff --git a/data/themes/edc/elm/calendar.edc b/data/themes/edc/elm/calendar.edc index b706a82..5ba602a 100644 --- a/data/themes/edc/elm/calendar.edc +++ b/data/themes/edc/elm/calendar.edc @@ -1,15 +1,15 @@ #define CIT_STYLES\ style { name: "calendar_date_style";\ - base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 align=center";\ + base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 align=center text_class=calendar_day_text color_class=calendar_day_text";\ }\ style { name: "calendar_date_holiday_style";\ - base: "font="FN" font_size=10 color=#808080 style=shadow,bottom shadow_color=#0080 align=center";\ + base: "font="FN" font_size=10 color=#808080 style=shadow,bottom shadow_color=#0080 align=center text_class=calendar_day_text_holiday color_class=calendar_day_text_holiday";\ }\ style { name: "calendar_date_today_style";\ - base: "font="FN" font_size=10 color=#3399ff style=glow glow_color=#3399ff18 align=center";\ + base: "font="FN" font_size=10 color=#3399ff style=glow glow_color=#3399ff18 align=center text_class=calendar_day_text_today color_class=calendar_day_text_today";\ }\ style { name: "calendar_date_disabled_style";\ - base: "font="FN" font_size=10 color=#151515 style=shadow_bottom shadow_color=#ffc0 align=center";\ + base: "font="FN" font_size=10 color=#151515 style=shadow_bottom shadow_color=#ffc0 align=center text_class=calendar_day_text_disabled text_class=calendar_day_text_disabled";\ }\ #define CAL_SPIN(_sufix, _text, _relative)\ @@ -83,10 +83,11 @@ rel2 { relative: 0.0 1.0;\
[EGIT] [core/elementary] master 07/18: entry: add new text classes and color classes for Entry widget
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=999b8b311484fd6d79493da7d13b0381b0223890 commit 999b8b311484fd6d79493da7d13b0381b0223890 Author: Youngbok Shin Date: Mon Jan 4 14:37:25 2016 -0800 entry: add new text classes and color classes for Entry widget Summary: Add new text classes and color classes for Entry widget according to consistency with other widget's class. And it removes legacy classes. If we need to support backward compatibility, the legacy classes have to be maintained in each widget. Test Plan: N/A Reviewers: cedric, woohyun, jaehwan, kimcinoo, raster Subscribers: CHAN Differential Revision: https://phab.enlightenment.org/D3486 Signed-off-by: Cedric BAIL --- data/themes/colorclasses.edc | 13 +++-- data/themes/edc/elm/entry.edc | 34 ++ src/lib/elm_config.c | 11 +-- 3 files changed, 38 insertions(+), 20 deletions(-) diff --git a/data/themes/colorclasses.edc b/data/themes/colorclasses.edc index 5f92a14..d625344 100644 --- a/data/themes/colorclasses.edc +++ b/data/themes/colorclasses.edc @@ -179,13 +179,22 @@ color_classes { desc: "Text in a disabled datetime separator area"; } color_class { name: "entry_text"; - color: FN_COL_DEFAULT_BASIC; + color: FN_COL_DEFAULT; desc: "Text in an entry box"; } color_class { name: "entry_text_disabled"; - color: FN_COL_DEFAULT_BASIC; + color: FN_COL_DISABLE; desc: "Text in a disabled entry box"; } + color_class { name: "entry_guide_text"; + color: 0 0 0 255; + color3: 255 255 255 25; + desc: "Guide Text in a entry box"; + } + color_class { name: "entry_scrollframe_base"; + color: DARK_GREY_BG_COLOR; + desc: "Base of a entry's scroller widget"; + } color_class { name: "label_text"; color: FN_COL_DEFAULT; desc: "Text of a generic label"; diff --git a/data/themes/edc/elm/entry.edc b/data/themes/edc/elm/entry.edc index 390a955..7214080 100644 --- a/data/themes/edc/elm/entry.edc +++ b/data/themes/edc/elm/entry.edc @@ -214,8 +214,7 @@ group { name: "elm/scroller/entry_single/default"; description { state: "default" 0.0; rel1.to: "elm.swallow.background"; rel2.to: "elm.swallow.background"; -color: DARK_GREY_BG_COLOR; -color_class: "scrollframe_base"; +color_class: "entry_scrollframe_base"; } } part { name: "clipper"; type: RECT; @@ -395,6 +394,7 @@ group { name: "elm/entry/cursor/default"; image.border: 4 4 4 4; fill.smooth: 0; color: 255 255 255 0; +color_class: "entry_cursor"; min: 9 10; } description { state: "visible" 0.0; @@ -530,23 +530,23 @@ group { name: "elm/entry/base/default"; styles { style { name: "entry_style"; - base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 wrap=word text_class=entry color_class=entry left_margin=2 right_margin=2"; + base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 wrap=word text_class=entry_text color_class=entry_text left_margin=2 right_margin=2"; ENABLED_TEXTBLOCK_TAGS } style { name: "entry_nowrap_style"; - base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 text_class=entry color_class=entry left_margin=2 right_margin=2"; + base: "font="FN" font_size=10 color=#ff style=shadow,bottom shadow_color=#0080 text_class=entry_text color_class=entry_text left_margin=2 right_margin=2"; ENABLED_TEXTBLOCK_TAGS } style { name: "entry_disabled_style"; - base: "font="FN" font_size=10 color=#151515 style=shadow,bottom shadow_color=#ff19 wrap=word text_class=entry color_class=entry_disabled left_margin=2 right_margin=2"; + base: "font="FN" font_size=10 color=#151515 style=shadow,bottom shadow_color=#ff19 wrap=word text_class=entry_text_disabled color_class=entry_text_disabled left_margin=2 right_margin=2"; DISABLED_TEXTBLOCK_TAGS } style { name: "entry_nowrap_disabled_style"; - base: "font="FN" font_size=10 color=#151515 style=shadow,bottom shadow_color=#ff19 text_class=entry color_class=entry_disabled left_margin=2 right_margin=2"; + base: "font=&quo
[EGIT] [core/elementary] master 01/01: toolbar: Revert a theme change for shrink mode signals.
jaehwan pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=352ba03e2cd782f7e2626a3f9462aef40faa3b34 commit 352ba03e2cd782f7e2626a3f9462aef40faa3b34 Author: Youngbok Shin Date: Wed Jan 6 19:38:05 2016 +0900 toolbar: Revert a theme change for shrink mode signals. Summary: It was changed for testing shrink mode signals. But, it was unnecessary change for default theme. Test Plan: N/A Reviewers: zmike, jaehwan Differential Revision: https://phab.enlightenment.org/D3536 --- data/themes/edc/elm/toolbar.edc | 90 +++-- 1 file changed, 6 insertions(+), 84 deletions(-) diff --git a/data/themes/edc/elm/toolbar.edc b/data/themes/edc/elm/toolbar.edc index f6cb533..d932ff2 100644 --- a/data/themes/edc/elm/toolbar.edc +++ b/data/themes/edc/elm/toolbar.edc @@ -379,8 +379,6 @@ group { name: "elm/toolbar/item/default"; #define DISABLE 4 script { public btmode; - public vertical = 0; - public scroll = 0; public eval_mode(m) { new m1 = m & MASK; new d = m & DISABLE; @@ -434,44 +432,6 @@ group { name: "elm/toolbar/item/default"; } } } - - public enable_scroll() { - set_int(scroll, 1); - - if (get_int(vertical)) -set_state(PART:"base", "vert_scroll", 0.0); - else -set_state(PART:"base", "scroll", 0.0); - } - - public disable_scroll() { - set_int(scroll, 0); - - if (get_int(vertical)) -set_state(PART:"base", "vert", 0.0); - else -set_state(PART:"base", "default", 0.0); - } - - public enable_vertical() { - set_int(vertical, 1); - - if (get_int(scroll)) -set_state(PART:"base", "vert_scroll", 0.0); - else -set_state(PART:"base", "vert", 0.0); - set_state(PART:"bend_clip", "vert", 0.0); - } - - public disable_vertical() { - set_int(vertical, 0); - - if (get_int(scroll)) -set_state(PART:"base", "scroll", 0.0); - else -set_state(PART:"base", "default", 0.0); - set_state(PART:"bend_clip", "default", 0.0); - } } parts { part { name: "base"; type: SPACER; @@ -481,14 +441,6 @@ group { name: "elm/toolbar/item/default"; rel1.offset: -1 0; rel2.offset: 0 -1; } - description { state: "scroll" 0.0; -inherit: "default" 0.0; -min: 80 0; - } - description { state: "vert_scroll" 0.0; -inherit: "vert" 0.0; -min: 0 80; - } } part { name: "shadow1"; mouse_events: 0; description { state: "default" 0.0; @@ -858,45 +810,15 @@ group { name: "elm/toolbar/item/default"; programs { program { signal: "elm,orient,horizontal"; source: "elm"; - script { -disable_vertical(); - } + action: STATE_SET "default" 0.0; + target: "base"; + target: "bend_clip"; } program { signal: "elm,orient,vertical"; source: "elm"; - script { -enable_vertical(); - } - } - program { - signal: "elm,state,shrink,scroll"; source: "elm"; - script { -enable_scroll(); - } - } - program { - signal: "elm,state,shrink,none"; source: "elm"; - script { -disable_scroll() - } - } - program { - signal: "elm,state,shrink,hide"; source: "elm"; - script { -disable_scroll() - } - } - program { - signal: "elm,state,shrink,menu"; source: "elm"; - script { -disable_scroll() - } - } - program { - signal: "elm,state,shrink,expand"; source: "elm"; - script { -disable_scroll() - } + action: STATE_SET "vert" 0.0; + target: "base"; + target: "bend_clip"; } program { name: "st0"; --
[EGIT] [core/efl] master 01/05: eina: print error message when eina_module_load() fails.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b9cd26c906970d3ccdd7508e2a903a89ef5c630e commit b9cd26c906970d3ccdd7508e2a903a89ef5c630e Author: Youngbok Shin Date: Tue May 19 12:36:46 2015 +0200 eina: print error message when eina_module_load() fails. Summary: When dlopen() fails, eina_module_load() print error information using dlerror(). But, it is printed with WRN. If EINA_LOG_LEVEL is lower than WRN, application developer is hard to see which has a problem. Reviewers: woohyun, Hermet, raster, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2536 Signed-off-by: Cedric BAIL --- src/lib/eina/eina_module.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/eina/eina_module.c b/src/lib/eina/eina_module.c index fbdeeeb..65c18ab 100644 --- a/src/lib/eina/eina_module.c +++ b/src/lib/eina/eina_module.c @@ -325,7 +325,7 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) if (!dl_handle) { -WRN("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), +ERR("could not dlopen(\"%s\", %s): %s", m->file, dlerror(), (flag == RTLD_NOW) ? "RTLD_NOW" : "RTLD_LAZY"); return EINA_FALSE; } @@ -337,7 +337,7 @@ EAPI Eina_Bool eina_module_load(Eina_Module *m) if ((*initcall)() == EINA_TRUE) goto ok; - WRN("could not find eina's entry symbol %s inside module %s, or the init function failed", + ERR("could not find eina's entry symbol %s inside module %s, or the init function failed", EINA_MODULE_SYMBOL_INIT, m->file); dlclose(dl_handle); return EINA_FALSE; --