[EGIT] [core/efl] efl-1.20 07/47: ecore_wayland: fix assigned value is never used.
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=c5efbda95952579de0ed24400e5636fb8bc16b51 commit c5efbda95952579de0ed24400e5636fb8bc16b51 Author: Subodh Kumar Date: Mon Oct 16 13:28:08 2017 -0700 ecore_wayland: fix assigned value is never used. Summary: Fix assigned value is never used. @fix Reviewers: cedric Subscribers: shilpasingh, jpeg Differential Revision: https://phab.enlightenment.org/D5283 Signed-off-by: Cedric BAIL --- src/lib/ecore_wayland/ecore_wl_dnd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c index f40eaf7e68..a7694c1587 100644 --- a/src/lib/ecore_wayland/ecore_wl_dnd.c +++ b/src/lib/ecore_wayland/ecore_wl_dnd.c @@ -769,10 +769,9 @@ static void _ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type EINA_UNUSED) { Ecore_Wl_Event_Data_Source_Target *event; - Ecore_Wl_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!(input = data)) return; + if (!data) return; if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Target return; @@ -800,11 +799,10 @@ static void _ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd) { Ecore_Wl_Event_Data_Source_Send *event; - Ecore_Wl_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!(input = data)) return; + if (!data) return; if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Send return; --
[EGIT] [core/efl] efl-1.20 06/47: edje_edit: duplicate assignment to variable.
raster pushed a commit to branch efl-1.20. http://git.enlightenment.org/core/efl.git/commit/?id=ea7d87f05f7d65651853b601f9b03ce7a807dca5 commit ea7d87f05f7d65651853b601f9b03ce7a807dca5 Author: Subodh Kumar Date: Mon Oct 16 13:27:35 2017 -0700 edje_edit: duplicate assignment to variable. Summary: Avoid duplicate assignment to same variable. @fix Reviewers: cedric, jpeg Reviewed By: cedric, jpeg Subscribers: shilpasingh, jpeg Differential Revision: https://phab.enlightenment.org/D5275 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_edit.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index 16839baea5..f3fb546bca 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -14186,9 +14186,6 @@ fill: size_abs = ((img->image.fill.abs_x == 0) && (img->image.fill.abs_y == 0)) ? EINA_FALSE : EINA_TRUE; } - - - attr_amount = smooth + type; attr_orig_amount = orig_rel + orig_abs; attr_size_amount = size_rel + size_abs; attr_amount = smooth + type + attr_orig_amount + attr_size_amount; @@ -14532,9 +14529,6 @@ fill_proxy: size_abs = ((pro->proxy.fill.abs_x == 0) && (pro->proxy.fill.abs_y == 0)) ? EINA_FALSE : EINA_TRUE; } - - - attr_amount = smooth + type; attr_orig_amount = orig_rel + orig_abs; attr_size_amount = size_rel + size_abs; attr_amount = smooth + type + attr_orig_amount + attr_size_amount; --
[EGIT] [core/efl] master 04/06: edje: Add text change signal
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f86dbae7e3621ce8766a1fc782f4304fde0f45e3 commit f86dbae7e3621ce8766a1fc782f4304fde0f45e3 Author: Subodh Kumar Date: Tue Dec 3 10:56:00 2019 + edje: Add text change signal There is no way to know about text changes in edc. This signal will help developer to know about text changes and do some operation based on that. @feature Co-authored-by: Cedric BAIL Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10780 --- src/lib/edje/edje_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 2acfce3282..f699f835ff 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -2043,6 +2043,8 @@ _edje_object_part_text_raw_generic_set(Edje *ed, Evas_Object *obj, Edje_Real_Par _edje_recalc(ed); if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part); + edje_object_signal_emit(ed->obj, "edje,text,changed", "edje"); + return EINA_TRUE; } --
[EGIT] [core/efl] master 05/05: edje_entry: Add matching tag.
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5eb7ae8b586af4dccfc267a9b773ecf1d0ee75bd commit 5eb7ae8b586af4dccfc267a9b773ecf1d0ee75bd Author: Subodh Kumar Date: Fri Jan 24 14:49:03 2020 + edje_entry: Add matching tag. When textblock has several other tags which are closing as , textblock is not able to find the matching one. @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D11172 --- src/lib/edje/edje_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index eb63c4f61f..6afd99472a 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -853,7 +853,7 @@ _edje_anchor_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EIN { an->en->have_link_pressed = EINA_TRUE; evas_textblock_cursor_format_append(an->start, ""); - evas_textblock_cursor_format_prepend(an->end, ""); + evas_textblock_cursor_format_prepend(an->end, ""); } } ev->event_flags |= rp->mask_flags; --
[EGIT] [core/elementary] master 02/03: Elm entry: Fix selection using handlers.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=6682ac891795d22e9a58209e4136dd4b62567b0d commit 6682ac891795d22e9a58209e4136dd4b62567b0d Author: Subodh Kumar Date: Thu Jan 14 16:05:08 2016 + Elm entry: Fix selection using handlers. Summary: Fix item selection using selection handler In case of selection using handler, there is a problem in case the entry has the item, mouse down over handler consider the current down coordinate to start selection and it becomes very difficult to select in the situation shown in the test plan. So I consider the next/previous line geometry to fix it. @fix Test Plan: 1.Enable selection handler 2. Have a look at the setup in the attached image {F27396} 3. Start selecting from last item and extent to cover the last text. 4.Observe that its impossible to select the last text until you move mouse out of the window So, in mobile device its almost impossible to select using handlers in this situation. Please use the attached application to test it. {F27402} Reviewers: thiepha, herdsman, tasn Reviewed By: tasn Subscribers: shilpasingh Differential Revision: https://phab.enlightenment.org/D3479 --- src/lib/elm_entry.c | 65 ++--- 1 file changed, 32 insertions(+), 33 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 226f5a5..1192f7d 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -3279,6 +3279,36 @@ _resize_cb(void *data, } static void +_selection_handlers_offset_calc(Evas_Object *obj, Evas_Object *handler, Evas_Coord canvasx, Evas_Coord canvasy) +{ + Evas_Coord ex, ey; + Evas_Coord cx, cy, cw, ch; + Evas_Coord hh; + + ELM_ENTRY_DATA_GET(obj, sd); + + evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); + edje_object_part_text_cursor_geometry_get(sd->entry_edje, "elm.text", + &cx, &cy, &cw, &ch); + edje_object_size_min_calc(handler, NULL, &hh); + + sd->ox = canvasx - (ex + cx + (cw / 2)); + if (ch > hh) + sd->oy = canvasy - (ey + cy + ch); + else + sd->oy = canvasy - (ey + cy + (ch / 2)); + + ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); + sd->long_pressed = EINA_FALSE; + if (_elm_config->magnifier_enable) + { +_magnifier_create(obj); +_magnifier_show(obj); +_magnifier_move(obj, ex + cx, ey + cy + (ch / 2)); + } +} + +static void _start_handler_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, @@ -3287,8 +3317,6 @@ _start_handler_mouse_down_cb(void *data, ELM_ENTRY_DATA_GET(data, sd); Evas_Event_Mouse_Down *ev = event_info; - Evas_Coord ex, ey; - Evas_Coord cx, cy, cw, ch; int start_pos, end_pos, main_pos, pos; sd->start_handler_down = EINA_TRUE; @@ -3311,20 +3339,7 @@ _start_handler_mouse_down_cb(void *data, if (pos != main_pos) edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, pos); - edje_object_part_text_cursor_geometry_get(sd->entry_edje, "elm.text", - &cx, &cy, &cw, &ch); - evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); - sd->ox = ev->canvas.x - (ex + cx + (cw / 2)); - sd->oy = ev->canvas.y - (ey + cy + (ch / 2)); - - ELM_SAFE_FREE(sd->longpress_timer, ecore_timer_del); - sd->long_pressed = EINA_FALSE; - if (_elm_config->magnifier_enable) - { -_magnifier_create(data); -_magnifier_show(data); -_magnifier_move(data, ex + cx, ey + cy + (ch / 2)); - } + _selection_handlers_offset_calc(data, sd->start_handler, ev->canvas.x, ev->canvas.y); } static void @@ -3388,8 +3403,6 @@ _end_handler_mouse_down_cb(void *data, ELM_ENTRY_DATA_GET(data, sd); Evas_Event_Mouse_Down *ev = event_info; - Evas_Coord ex, ey; - Evas_Coord cx, cy, cw, ch; int pos, start_pos, end_pos, main_pos; sd->end_handler_down = EINA_TRUE; @@ -3412,21 +3425,7 @@ _end_handler_mouse_down_cb(void *data, if (pos != main_pos) edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, pos); - - edje_object_part_text_cursor_geometry_get(sd->entry_edje, "elm.text", - &cx, &cy, &cw, &ch); - evas_object_geometry_get(sd->entry_edje, &ex, &ey, NULL, NULL); - sd->ox = ev->canvas.x - (ex + cx + (cw / 2)); - sd->oy = ev->canvas.y - (e
[EGIT] [core/elementary] master 01/03: Elm entry: Use edje api and simplify empty check logic
tasn pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=b82092f4f3260c71dd27909f46465c38673543fa commit b82092f4f3260c71dd27909f46465c38673543fa Author: Subodh Kumar Date: Tue Jan 12 13:25:12 2016 + Elm entry: Use edje api and simplify empty check logic Summary: Use edje api and simplify empty check logic Test Plan: NA Reviewers: herdsman, tasn Reviewed By: tasn Subscribers: shilpasingh, cedric Differential Revision: https://phab.enlightenment.org/D3505 --- src/lib/elm_entry.c | 27 --- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 6d0e4d7..226f5a5 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -3989,26 +3989,15 @@ _elm_entry_entry_append(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *ent EOLIAN static Eina_Bool _elm_entry_is_empty(const Eo *obj EINA_UNUSED, Elm_Entry_Data *sd) { - Eina_Bool ret; - /* FIXME: until there's support for that in textblock, we just -* check to see if the there is text or not. */ - const Evas_Object *tb; - Evas_Textblock_Cursor *cur; - - /* It's a hack until we get the support suggested above. We just -* create a cursor, point it to the beginning, and then try to -* advance it, if it can advance, the tb is not empty, otherwise it -* is. */ - tb = edje_object_part_object_get(sd->entry_edje, "elm.text"); - - /* This is actually, ok for the time being, these hackish stuff - will be removed once evas 1.0 is out */ - cur = evas_object_textblock_cursor_new((Evas_Object *)tb); - evas_textblock_cursor_pos_set(cur, 0); - ret = evas_textblock_cursor_char_next(cur); - evas_textblock_cursor_free(cur); + edje_object_part_text_cursor_copy + (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, EDJE_CURSOR_USER); + edje_object_part_text_cursor_pos_set + (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, 1); + if (edje_object_part_text_cursor_pos_get +(sd->entry_edje, "elm.text", EDJE_CURSOR_USER) == 1) + return EINA_FALSE; - return !ret; + return EINA_TRUE; } EOLIAN static Evas_Object* --
[EGIT] [core/elementary] master 05/06: spinner: fix vertical drag style and logic
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=cbbf08b4ed1157efaa1597cad798fb506c1853a8 commit cbbf08b4ed1157efaa1597cad798fb506c1853a8 Author: Subodh Kumar Date: Fri Feb 12 21:00:50 2016 +0100 spinner: fix vertical drag style and logic Summary: Fix vertical drag style and logic. For vertical spinner graggable should move in y direction and since drag value is inverse of spinner increment and decrement so delta should be inversed. @fix Test Plan: 1. Elementary test 2. Vertical spinner Reviewers: cedric Projects: #elementary Differential Revision: https://phab.enlightenment.org/D3662 Signed-off-by: Cedric BAIL --- data/themes/edc/elm/spinner.edc | 11 +++ src/lib/elm_spinner.c | 8 +++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/data/themes/edc/elm/spinner.edc b/data/themes/edc/elm/spinner.edc index 9b4257d..463c6c3 100644 --- a/data/themes/edc/elm/spinner.edc +++ b/data/themes/edc/elm/spinner.edc @@ -224,5 +224,16 @@ group { name: "elm/spinner/base/vertical"; align: 0.0 0.5; } } + part { name: "elm.dragable.slider"; type: RECT; + repeat_events: 1; + dragable.x: 0 0 0; + dragable.y: 1 1 0; + description { state: "default" 0.0; +fixed: 1 0; +rel1.to: "elm.swallow.text_button"; +rel2.to: "elm.swallow.text_button"; +color: 0 0 0 0; + } + } } } diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c index 45674bd..0e94cf1 100644 --- a/src/lib/elm_spinner.c +++ b/src/lib/elm_spinner.c @@ -260,15 +260,18 @@ _drag_cb(void *data, { double pos = 0.0, delta; Evas_Object *obj = data; + const char *style; ELM_SPINNER_DATA_GET(obj, sd); ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); if (sd->entry_visible) return; + style = elm_widget_style_get(obj); + if (sd->button_layout) { -if (!strncmp(elm_widget_style_get(obj), "vertical", 8)) +if (!strncmp(style, "vertical", 8)) eo_do((Eo *)wd->resize_obj, edje_obj_part_drag_value_get("elm.dragable.slider", NULL, &pos)); else @@ -288,6 +291,9 @@ _drag_cb(void *data, delta = sd->drag_val_step * sd->step * _elm_config->scale; if (pos < sd->drag_prev_pos) delta *= -1; sd->drag_prev_pos = pos; + + /* Dragable is inverse of spinner value */ + if (!strncmp(style, "vertical", 8)) delta *= -1; /* If we are on rtl mode, change the delta to be negative on such changes */ if (elm_widget_mirrored_get(obj)) delta *= -1; if (_value_set(data, sd->val + delta)) _label_write(data); --
[EGIT] [core/elementary] master 01/01: Elm entry: No use of top object if not editable.
hermet pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=25f05848ccfc087450ae6bea1da5e1d344e4743d commit 25f05848ccfc087450ae6bea1da5e1d344e4743d Author: Subodh Kumar Date: Tue Feb 23 20:33:24 2016 +0900 Elm entry: No use of top object if not editable. Summary: No use of top object if not editable. Reviewers: cedric, Hermet Reviewed By: Hermet Differential Revision: https://phab.enlightenment.org/D3719 --- src/lib/elm_entry.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 3e057b8..3165847 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1169,11 +1169,12 @@ _elm_entry_elm_widget_on_focus(Eo *obj, Elm_Entry_Data *sd, Elm_Object_Item *ite Evas_Object *top; Eina_Bool top_is_win = EINA_FALSE; + if (!sd->editable) return EINA_FALSE; + top = elm_widget_top_get(obj); if (top && eo_isa(top, ELM_WIN_CLASS)) top_is_win = EINA_TRUE; - if (!sd->editable) return EINA_FALSE; if (elm_widget_focus_get(obj)) { evas_object_focus_set(sd->entry_edje, EINA_TRUE); --
[EGIT] [core/efl] master 02/23: eina: comparing unsigned integer with less than zero.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=be63db00a71bf1b5b3da59c29e0b3fb569b0ba90 commit be63db00a71bf1b5b3da59c29e0b3fb569b0ba90 Author: Subodh Kumar Date: Fri Oct 13 11:46:28 2017 -0700 eina: comparing unsigned integer with less than zero. Summary: Unsigned integer should not be compared less than zero. Test Plan: NA Reviewers: cedric Subscribers: shilpasingh, jpeg Differential Revision: https://phab.enlightenment.org/D5274 Signed-off-by: Cedric Bail --- src/lib/eina/eina_share_common.c | 2 +- src/lib/eina/eina_strbuf.c | 8 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/lib/eina/eina_share_common.c b/src/lib/eina/eina_share_common.c index 6ad55b7053..e7ba2a72d2 100644 --- a/src/lib/eina/eina_share_common.c +++ b/src/lib/eina/eina_share_common.c @@ -740,7 +740,7 @@ eina_share_common_add_length(Eina_Share *share, eina_share_common_population_add(share, slen); - if (slen <= 0) + if (slen == 0) return NULL; hash = eina_hash_superfast(str, slen); diff --git a/src/lib/eina/eina_strbuf.c b/src/lib/eina/eina_strbuf.c index f18408d59e..a76e4418ea 100644 --- a/src/lib/eina/eina_strbuf.c +++ b/src/lib/eina/eina_strbuf.c @@ -94,7 +94,7 @@ eina_strbuf_append_printf(Eina_Strbuf *buf, const char *fmt, ...) len = vasprintf(&str, fmt, args); va_end(args); - if (len <= 0 || !str) + if (len == 0 || !str) return EINA_FALSE; ret = eina_strbuf_append_length(buf, str, len); @@ -111,7 +111,7 @@ eina_strbuf_append_vprintf(Eina_Strbuf *buf, const char *fmt, va_list args) len = vasprintf(&str, fmt, args); - if (len <= 0 || !str) + if (len == 0 || !str) return EINA_FALSE; ret = eina_strbuf_append_length(buf, str, len); @@ -131,7 +131,7 @@ eina_strbuf_insert_printf(Eina_Strbuf *buf, const char *fmt, size_t pos, ...) len = vasprintf(&str, fmt, args); va_end(args); - if (len <= 0 || !str) + if (len == 0 || !str) return EINA_FALSE; ret = eina_strbuf_insert(buf, str, pos); @@ -151,7 +151,7 @@ eina_strbuf_insert_vprintf(Eina_Strbuf *buf, len = vasprintf(&str, fmt, args); - if (len <= 0 || !str) + if (len == 0 || !str) return EINA_FALSE; ret = eina_strbuf_insert(buf, str, pos); --
[EGIT] [core/efl] master 01/06: edje_edit: duplicate assignment to variable.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=230810c4c4f03519fd3167244757983b865a94bc commit 230810c4c4f03519fd3167244757983b865a94bc Author: Subodh Kumar Date: Mon Oct 16 13:27:35 2017 -0700 edje_edit: duplicate assignment to variable. Summary: Avoid duplicate assignment to same variable. @fix Reviewers: cedric, jpeg Reviewed By: cedric, jpeg Subscribers: shilpasingh, jpeg Differential Revision: https://phab.enlightenment.org/D5275 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_edit.c | 6 -- 1 file changed, 6 deletions(-) diff --git a/src/lib/edje/edje_edit.c b/src/lib/edje/edje_edit.c index f12eeb355c..0a83ff0739 100644 --- a/src/lib/edje/edje_edit.c +++ b/src/lib/edje/edje_edit.c @@ -14186,9 +14186,6 @@ fill: size_abs = ((img->image.fill.abs_x == 0) && (img->image.fill.abs_y == 0)) ? EINA_FALSE : EINA_TRUE; } - - - attr_amount = smooth + type; attr_orig_amount = orig_rel + orig_abs; attr_size_amount = size_rel + size_abs; attr_amount = smooth + type + attr_orig_amount + attr_size_amount; @@ -14532,9 +14529,6 @@ fill_proxy: size_abs = ((pro->proxy.fill.abs_x == 0) && (pro->proxy.fill.abs_y == 0)) ? EINA_FALSE : EINA_TRUE; } - - - attr_amount = smooth + type; attr_orig_amount = orig_rel + orig_abs; attr_size_amount = size_rel + size_abs; attr_amount = smooth + type + attr_orig_amount + attr_size_amount; --
[EGIT] [core/efl] master 02/06: ecore_wayland: fix assigned value is never used.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=71f0daa9d17d0f496ba7b26b7692f8bd96b86719 commit 71f0daa9d17d0f496ba7b26b7692f8bd96b86719 Author: Subodh Kumar Date: Mon Oct 16 13:28:08 2017 -0700 ecore_wayland: fix assigned value is never used. Summary: Fix assigned value is never used. @fix Reviewers: cedric Subscribers: shilpasingh, jpeg Differential Revision: https://phab.enlightenment.org/D5283 Signed-off-by: Cedric BAIL --- src/lib/ecore_wayland/ecore_wl_dnd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/ecore_wayland/ecore_wl_dnd.c b/src/lib/ecore_wayland/ecore_wl_dnd.c index f40eaf7e68..a7694c1587 100644 --- a/src/lib/ecore_wayland/ecore_wl_dnd.c +++ b/src/lib/ecore_wayland/ecore_wl_dnd.c @@ -769,10 +769,9 @@ static void _ecore_wl_dnd_source_cb_target(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type EINA_UNUSED) { Ecore_Wl_Event_Data_Source_Target *event; - Ecore_Wl_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!(input = data)) return; + if (!data) return; if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Target return; @@ -800,11 +799,10 @@ static void _ecore_wl_dnd_source_cb_send(void *data, struct wl_data_source *source EINA_UNUSED, const char *mime_type, int32_t fd) { Ecore_Wl_Event_Data_Source_Send *event; - Ecore_Wl_Input *input; LOGFN(__FILE__, __LINE__, __FUNCTION__); - if (!(input = data)) return; + if (!data) return; if (!(event = calloc(1, sizeof(Ecore_Wl_Event_Data_Source_Send return; --
[EGIT] [core/elementary] master 01/01: elm: simulate the clicked event over the object only.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=70e5ec00a04f92aa1da3d495de0e3c7869c3287e commit 70e5ec00a04f92aa1da3d495de0e3c7869c3287e Author: Subodh Kumar Date: Wed Jul 29 21:18:17 2015 +0200 elm: simulate the clicked event over the object only. Summary: Two different behaviour are observed with clicked event. 1. When scroller is not present: a. Mouse down over object, b. mouse move outside the object c. mouse up, clicked happens 2. When scroller is present: a. Mouse down over object, b. mouse move outside the object c. mouse up, clicked NOT happens So clicked callback should happen over the object only i.e when mouse move out of the objcet clicked should be ignored, and behaviour will be consistent @fix Test Plan: NA Reviewers: shilpasingh, cedric Differential Revision: https://phab.enlightenment.org/D2856 Signed-off-by: Cedric BAIL --- src/lib/elm_image.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/elm_image.c b/src/lib/elm_image.c index 17e54cc..f1b7b57 100644 --- a/src/lib/elm_image.c +++ b/src/lib/elm_image.c @@ -67,10 +67,13 @@ _on_mouse_up(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) { + ELM_WIDGET_DATA_GET_OR_RETURN(data, wd); + Evas_Event_Mouse_Up *ev = event_info; if (ev->button != 1) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; + if (!wd->still_in) return; eo_do(data, eo_event_callback_call(EVAS_CLICKABLE_INTERFACE_EVENT_CLICKED, NULL)); } --
[EGIT] [core/efl] master 01/02: Edje entry: Make filter logic consistent across all input methods
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4284f11ca90af2764301365f3a6916ac43ac22f2 commit 4284f11ca90af2764301365f3a6916ac43ac22f2 Author: Subodh Kumar Date: Tue Aug 4 15:32:47 2015 +0100 Edje entry: Make filter logic consistent across all input methods Summary: When commit string comes from key_down text filter is applied before deleting the range but when commit string comes from imf filter is applied after deleting the range. Moreover when format is prepended range is deleted before applying insert filter. Please check the _edje_key_down_cb and _edje_entry_imf_event_commit_cb routines. @fix Test Plan: Tested in Tizen device Reviewers: herdsman, thiepha, shilpasingh, raster, tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2904 --- src/lib/edje/edje_entry.c | 27 --- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 4a57d56..eab317f 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -207,6 +207,13 @@ _text_filter_markup_prepend_internal(Edje *ed, Entry *en, Evas_Textblock_Cursor { Edje_Markup_Filter_Callback *cb; Eina_List *l; + Eina_Bool have_sel = EINA_FALSE; + + if ((clearsel) && (en->have_selection)) + { +_range_del_emit(ed, en->cursor, en->rp->object, en); +have_sel = EINA_TRUE; + } EINA_LIST_FOREACH(ed->markup_filter_callbacks, l, cb) { @@ -238,10 +245,12 @@ _text_filter_markup_prepend_internal(Edje *ed, Entry *en, Evas_Textblock_Cursor eina_unicode_utf8_get_len(info->change.insert.content); } } -if ((clearsel) && (en->have_selection)) +if (have_sel) { - _range_del_emit(ed, en->cursor, en->rp->object, en); - if (info) info->merge = EINA_TRUE; +if (info) + { + info->merge = EINA_TRUE; + } } if (info) info->change.insert.pos = @@ -266,6 +275,12 @@ _text_filter_text_prepend(Edje *ed, Entry *en, Evas_Textblock_Cursor *c, Eina_List *l; EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); + + if ((clearsel) && (en->have_selection)) + { +_range_del_emit(ed, en->cursor, en->rp->object, en); + } + text2 = strdup(text); EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) { @@ -383,6 +398,12 @@ _text_filter_markup_prepend(Edje *ed, Entry *en, Evas_Textblock_Cursor *c, Eina_List *l; EINA_SAFETY_ON_NULL_RETURN_VAL(text, NULL); + + if ((clearsel) && (en->have_selection)) + { +_range_del_emit(ed, en->cursor, en->rp->object, en); + } + text2 = strdup(text); EINA_LIST_FOREACH(ed->text_insert_filter_callbacks, l, cb) { --
[EGIT] [core/efl] master 01/01: Edje entry: Fix to delete selection when preedit status has not ended.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=20822f2008bbd3460467154b5cfd1eeaae403dc7 commit 20822f2008bbd3460467154b5cfd1eeaae403dc7 Author: Subodh Kumar Date: Wed Aug 5 11:02:53 2015 +0100 Edje entry: Fix to delete selection when preedit status has not ended. Summary: Fix to delete selection when preedit status has not ended In preedit mode when selection is made and input any letter, there is duplicate character appeared because the selection is cleared when commit happens so delete the selection in preedit last stage. @fix Test Plan: Test in Tizen devices. Reviewers: woohyun, id213sin, shilpasingh, tasn Subscribers: rajeshps, cedric, govi Differential Revision: https://phab.enlightenment.org/D2837 --- src/lib/edje/edje_entry.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index c095f16..bcdeea9 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -4226,6 +4226,9 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA if (!strcmp(preedit_string, "")) preedit_end_state = EINA_TRUE; + if (en->have_selection && !preedit_end_state) + _range_del_emit(ed, en->cursor, rp->object, en); + /* delete preedit characters */ _preedit_del(en); --
[EGIT] [core/efl] master 01/01: Edje entry: Remove useless commented code
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=46ff6f11723f8f7918a620e470bfbf1cdc6a45d5 commit 46ff6f11723f8f7918a620e470bfbf1cdc6a45d5 Author: Subodh Kumar Date: Tue Aug 11 12:10:59 2015 +0100 Edje entry: Remove useless commented code Summary: After the commit D2904 this commented code and comments are not required Test Plan: NA Reviewers: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2938 --- src/lib/edje/edje_entry.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index bcdeea9..8b4f256 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2875,9 +2875,6 @@ _edje_entry_text_markup_insert(Edje_Real_Part *rp, const char *text) if (!en) return; _edje_entry_imf_context_reset(rp); - // prepend markup @ cursor pos .. XXX: do we need to do this? maybe not? -// if (en->have_selection) -// _range_del(en->cursor, rp->object, en); _text_filter_markup_prepend(en->ed, en, en->cursor, text, NULL, NULL, EINA_TRUE, EINA_FALSE); _anchors_get(en->cursor, rp->object, en); --
[EGIT] [core/efl] master 01/01: Eina rectangle: Check for valid rectangle before taking intersection
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b35d2f976267b3b03124108aafb1d56219930ab2 commit b35d2f976267b3b03124108aafb1d56219930ab2 Author: Subodh Kumar Date: Fri Aug 28 16:27:21 2015 +0900 Eina rectangle: Check for valid rectangle before taking intersection Summary: Check for valid rectangle If any dst or src rectangle has zero width or height, intersection should not return true. @fix Test Plan: Added test cases Reviewers: cedric, herdsman, Hermet Reviewed By: Hermet Subscribers: shilpasingh, cedric Differential Revision: https://phab.enlightenment.org/D2990 --- src/lib/eina/eina_inline_rectangle.x | 22 ++ src/tests/eina/eina_test_rectangle.c | 14 +- 2 files changed, 27 insertions(+), 9 deletions(-) diff --git a/src/lib/eina/eina_inline_rectangle.x b/src/lib/eina/eina_inline_rectangle.x index fafe139..5956291 100644 --- a/src/lib/eina/eina_inline_rectangle.x +++ b/src/lib/eina/eina_inline_rectangle.x @@ -19,6 +19,14 @@ #ifndef EINA_INLINE_RECTANGLE_H__ #define EINA_INLINE_RECTANGLE_H__ +static inline Eina_Bool +eina_rectangle_is_valid(const Eina_Rectangle *r) +{ + if (r->w <= 0 || r->h <= 0) + return EINA_FALSE; + return EINA_TRUE; +} + static inline int eina_spans_intersect(int c1, int l1, int c2, int l2) { @@ -90,6 +98,9 @@ eina_rectangle_union(Eina_Rectangle *dst, const Eina_Rectangle *src) static inline Eina_Bool eina_rectangle_intersection(Eina_Rectangle *dst, const Eina_Rectangle *src) { + if (!(eina_rectangle_is_valid(dst)) || !(eina_rectangle_is_valid(src))) + return EINA_FALSE; + if (!(eina_rectangles_intersect(dst, src))) return EINA_FALSE; @@ -116,6 +127,9 @@ eina_rectangle_intersection(Eina_Rectangle *dst, const Eina_Rectangle *src) if ((dst->y + dst->h) > (src->y + src->h)) dst->h = src->y + src->h - dst->y; + if (dst->w == 0 || dst->h == 0) + return EINA_FALSE; + return EINA_TRUE; } @@ -137,14 +151,6 @@ eina_rectangle_rescale_out(const Eina_Rectangle *out, const Eina_Rectangle *in, res->h = out->h; } -static inline Eina_Bool -eina_rectangle_is_valid(const Eina_Rectangle *r) -{ - if (r->w <= 0 || r->h <= 0) - return EINA_FALSE; - return EINA_TRUE; -} - static inline int eina_rectangle_max_x(Eina_Rectangle *thiz) { diff --git a/src/tests/eina/eina_test_rectangle.c b/src/tests/eina/eina_test_rectangle.c index 089b68b..08f8384 100644 --- a/src/tests/eina/eina_test_rectangle.c +++ b/src/tests/eina/eina_test_rectangle.c @@ -74,7 +74,7 @@ END_TEST START_TEST(eina_rectangle_union_intersect) { - Eina_Rectangle r1, r2, r3, r4, r5, r6, rd; + Eina_Rectangle r1, r2, r3, r4, r5, r6, r7, r8, rd; fail_if(!eina_init()); @@ -84,6 +84,9 @@ START_TEST(eina_rectangle_union_intersect) EINA_RECTANGLE_SET(&r4, 30, 30, 50, 50); EINA_RECTANGLE_SET(&r5, 10, 10, 0, 0); EINA_RECTANGLE_SET(&r6, 30, 30, 0, 0); + EINA_RECTANGLE_SET(&r7, 10, 10, 5, 0); + EINA_RECTANGLE_SET(&r8, 10, 10, 0, 5); + rd = r1; @@ -111,6 +114,15 @@ START_TEST(eina_rectangle_union_intersect) || rd.w != r1.w || rd.h != r1.h); + rd = r6; + fail_if(eina_rectangle_intersection(&rd, &r5)); + + rd = r7; + fail_if(eina_rectangle_intersection(&rd, &r3)); + + rd = r8; + fail_if(eina_rectangle_intersection(&rd, &r3)); + rd = r1; eina_rectangle_union(&rd, &r3); fail_if(rd.x != 0 --
[EGIT] [core/efl] master 01/01: Edje entry: Make cursors to null after free
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=df190346a154822d9cead0619cb7957fcfeaefd8 commit df190346a154822d9cead0619cb7957fcfeaefd8 Author: Subodh Kumar Date: Fri Sep 25 09:49:18 2015 +0100 Edje entry: Make cursors to null after free Summary: Edje entry: Make cursors to null after free To prevent any illegal access of cursors can lead to crash @fix Test Plan: NA Reviewers: tasn Reviewed By: tasn Subscribers: shilpasingh, cedric Differential Revision: https://phab.enlightenment.org/D3093 --- src/lib/edje/edje_entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index e32a52e..b6cbf84 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -1100,8 +1100,6 @@ _anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, { Anchor *an = en->anchors->data; -evas_textblock_cursor_free(an->start); -evas_textblock_cursor_free(an->end); while (an->sel) { Sel *sel = an->sel->data; @@ -,6 +1109,8 @@ _anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, free(sel); an->sel = eina_list_remove_list(an->sel, an->sel); } +evas_textblock_cursor_free(an->start); +evas_textblock_cursor_free(an->end); free(an->name); free(an); en->anchors = eina_list_remove_list(en->anchors, en->anchors); --
[EGIT] [core/efl] master 02/02: evas_box: fix children size and position calculation when padding is used for horizontal flow layout
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4290567fd67cee39a3e36fddf0dc526190250724 commit 4290567fd67cee39a3e36fddf0dc526190250724 Author: Subodh Kumar Date: Sun Oct 4 15:23:49 2015 +0200 evas_box: fix children size and position calculation when padding is used for horizontal flow layout Summary: Fix children size and position calculation when padding is used For each child size calculation padding is adjusted but box height should include padding. Secondly, x and y position of children should not include the vertical and horizonatal padding as child size has already included the given paddings. @fix Test Plan: Please modify test_box.c file in function test_box_vert2 as follows: bx = elm_box_add(win); evas_object_size_hint_weight_set(bx, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); elm_win_resize_object_add(win, bx); elm_box_padding_set(bx, 50, 50); elm_box_layout_set(bx, evas_object_box_layout_flow_horizontal, NULL, NULL); evas_object_show(bx); Now, 1. open elementary_test 2. box 3. Box vert 2 (observe box is broken) 4. Try resizing the window (observe) Reviewers: raster, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3049 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_object_box.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c index a33a9e4..3510fb0 100644 --- a/src/lib/evas/canvas/evas_object_box.c +++ b/src/lib/evas/canvas/evas_object_box.c @@ -1333,7 +1333,7 @@ _evas_box_layout_flow_horizontal(Eo *o, Evas_Object_Box_Data *priv, Evas_Object_ (priv, w, &row_count, row_max_h, row_break, row_width, &offset_y, &min_w, &max_h); inc_y = 0; - remain_y = h - (offset_y + max_h); + remain_y = h - (priv->pad.v * row_count -1) - (offset_y + max_h); if (remain_y > 0) { @@ -1353,7 +1353,7 @@ _evas_box_layout_flow_horizontal(Eo *o, Evas_Object_Box_Data *priv, Evas_Object_ int row_size, remain_x; row_size = row_break[r] - i; -remain_x = (w - row_width[r]); +remain_x = (w - (row_width[r] - priv->pad.h)); if (priv->align.h < 0.0) { @@ -1403,6 +1403,9 @@ _evas_box_layout_flow_horizontal(Eo *o, Evas_Object_Box_Data *priv, Evas_Object_ evas_object_geometry_get(o, &x, NULL, NULL, NULL); min_h += row_max_h[r]; y += row_max_h[r] + inc_y; + +if (r > 0) + min_h += priv->pad.v; } evas_object_size_hint_min_set(o, min_w, min_h); --
[EGIT] [core/efl] master 08/08: evas textblock: fix memory leak
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=69c2b13474b84fa7c8fd9f3942ab89c0d346af79 commit 69c2b13474b84fa7c8fd9f3942ab89c0d346af79 Author: Subodh Kumar Date: Mon Oct 19 11:34:38 2015 -0700 evas textblock: fix memory leak Summary: Fix memory leak Delimiter string is being saved using eina_stringshare_replace without any del or free when object is deleted. @fix Test Plan: N/A Reviewers: tasn, herdsman Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3175 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_object_textblock.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index ca37af4..3d302e8 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -11533,6 +11533,7 @@ evas_object_textblock_free(Evas_Object *eo_obj) } if (o->repch) eina_stringshare_del(o->repch); if (o->ellip_ti) _item_free(eo_obj, NULL, _ITEM(o->ellip_ti)); + if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters); _format_command_shutdown(); /* remove obstacles */ --
[EGIT] [core/efl] master 01/03: evas: fix memory leak.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6bd863cf4ffb46f0267e96844cea37a95599e9de commit 6bd863cf4ffb46f0267e96844cea37a95599e9de Author: Subodh Kumar Date: Tue Oct 20 11:51:17 2015 -0700 evas: fix memory leak. Summary: Fix memory leak Delimiter string is being saved using eina_stringshare_replace without any del or free when object is deleted. @fix Test Plan: NA Reviewers: cedric, tasn, herdsman Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3201 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_object_text.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 5eab0eb..3e3e9ff 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -1554,6 +1554,7 @@ evas_object_text_free(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj) if (o->cur.font) eina_stringshare_del(o->cur.font); if (o->cur.fdesc) evas_font_desc_unref(o->cur.fdesc); if (o->cur.source) eina_stringshare_del(o->cur.source); + if (o->bidi_delimiters) eina_stringshare_del(o->bidi_delimiters); if (o->cur.text) free(o->cur.text); if (o->font && obj->layer && obj->layer->evas) evas_font_free(obj->layer->evas->evas, o->font); --
[EGIT] [core/efl] master 05/16: edje entry: do not create object if theme source is not available.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9cc8c470be4aee9c7f6a48f624c233194c91c368 commit 9cc8c470be4aee9c7f6a48f624c233194c91c368 Author: Subodh Kumar Date: Tue Oct 20 11:57:17 2015 -0700 edje entry: do not create object if theme source is not available. Summary: Object not created if theme source is not available. In many case we dont need or define all the theme sources for entry, even if the sources are null, edje object is being created. Test Plan: NA Reviewers: tasn, herdsman, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3199 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_entry.c | 122 ++ 1 file changed, 69 insertions(+), 53 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index b6cbf84..bf9a140 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -674,25 +674,31 @@ _sel_update(Edje *ed, Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entr sel = calloc(1, sizeof(Sel)); en->sel = eina_list_append(en->sel, sel); - ob = edje_object_add(ed->base->evas); - edje_object_file_set(ob, ed->path, en->rp->part->source); - evas_object_smart_member_add(ob, smart); - evas_object_stack_below(ob, o); - evas_object_clip_set(ob, clip); - evas_object_pass_events_set(ob, EINA_TRUE); - evas_object_show(ob); - sel->obj_bg = ob; - _edje_subobj_register(ed, sel->obj_bg); - - ob = edje_object_add(ed->base->evas); - edje_object_file_set(ob, ed->path, en->rp->part->source2); - evas_object_smart_member_add(ob, smart); - evas_object_stack_above(ob, o); - evas_object_clip_set(ob, clip); - evas_object_pass_events_set(ob, EINA_TRUE); - evas_object_show(ob); - sel->obj_fg = ob; - _edje_subobj_register(ed, sel->obj_fg); + if (en->rp->part->source) +{ + ob = edje_object_add(ed->base->evas); + edje_object_file_set(ob, ed->path, en->rp->part->source); + evas_object_smart_member_add(ob, smart); + evas_object_stack_below(ob, o); + evas_object_clip_set(ob, clip); + evas_object_pass_events_set(ob, EINA_TRUE); + evas_object_show(ob); + sel->obj_bg = ob; + _edje_subobj_register(ed, sel->obj_bg); +} + + if (en->rp->part->source2) +{ + ob = edje_object_add(ed->base->evas); + edje_object_file_set(ob, ed->path, en->rp->part->source2); + evas_object_smart_member_add(ob, smart); + evas_object_stack_above(ob, o); + evas_object_clip_set(ob, clip); + evas_object_pass_events_set(ob, EINA_TRUE); + evas_object_show(ob); + sel->obj_fg = ob; + _edje_subobj_register(ed, sel->obj_fg); +} } else { @@ -970,25 +976,31 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) sel = calloc(1, sizeof(Sel)); an->sel = eina_list_append(an->sel, sel); - ob = edje_object_add(ed->base->evas); - edje_object_file_set(ob, ed->path, en->rp->part->source5); - evas_object_smart_member_add(ob, smart); - evas_object_stack_below(ob, o); - evas_object_clip_set(ob, clip); - evas_object_pass_events_set(ob, EINA_TRUE); - evas_object_show(ob); - sel->obj_bg = ob; - _edje_subobj_register(ed, sel->obj_bg); + if (en->rp->part->source5) + { +ob = edje_object_add(ed->base->evas); +edje_object_file_set(ob, ed->path, en->rp->part->source5); +evas_object_smart_member_add(ob, smart); +evas_object_stack_below(ob, o); +evas_object_clip_set(ob,
[EGIT] [core/efl] master 06/16: edje entry: remove unreachable dead code
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=95d398b5c8bfde8d6d760ca5881d19691b522c92 commit 95d398b5c8bfde8d6d760ca5881d19691b522c92 Author: Subodh Kumar Date: Tue Oct 20 12:06:00 2015 -0700 edje entry: remove unreachable dead code Summary: Remove dead code If anchor sel is not there, code inside while can not execute. Test Plan: NA Reviewers: tasn, herdsman, cedric Reviewed By: cedric Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3190 Signed-off-by: Cedric BAIL --- src/lib/edje/edje_entry.c | 10 -- 1 file changed, 10 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index bf9a140..92c40a6 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -927,16 +927,6 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) if (!an->sel) { - while (an->sel) -{ - sel = an->sel->data; - if (sel->obj_bg) evas_object_del(sel->obj_bg); - if (sel->obj_fg) evas_object_del(sel->obj_fg); - if (sel->obj) evas_object_del(sel->obj); - free(sel); - an->sel = eina_list_remove_list(an->sel, an->sel); -} - sel = calloc(1, sizeof(Sel)); an->sel = eina_list_append(an->sel, sel); --
[EGIT] [core/efl] master 07/24: evas: fix some indentation and formatting in textblock.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3f0d0daf0d1a9b96cf112a0ee741b4549e9d2828 commit 3f0d0daf0d1a9b96cf112a0ee741b4549e9d2828 Author: Subodh Kumar Date: Mon Nov 9 15:39:10 2015 -0800 evas: fix some indentation and formatting in textblock. Summary: Fix some indentation and formatting. Reviewers: herdsman, tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3174 Signed-off-by: Cedric BAIL --- src/lib/evas/canvas/evas_object_textblock.c | 236 ++-- 1 file changed, 118 insertions(+), 118 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index d579efd..05d0050 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -431,9 +431,9 @@ struct _Evas_Object_Textblock_Format } font; struct { struct { -unsigned char r, g, b, a; + unsigned char r, g, b, a; } normal, underline, underline2, underline_dash, outline, shadow, glow, glow2, backing, - strikethrough; +strikethrough; } color; struct { int l, r; @@ -530,17 +530,17 @@ struct _Evas_Textblock_Selection_Iterator /* private methods for textblock objects */ static void evas_object_textblock_init(Evas_Object *eo_obj); static void evas_object_textblock_render(Evas_Object *eo_obj, -Evas_Object_Protected_Data *obj, -void *type_private_data, -void *output, void *context, void *surface, -int x, int y, Eina_Bool do_async); + Evas_Object_Protected_Data *obj, + void *type_private_data, + void *output, void *context, void *surface, + int x, int y, Eina_Bool do_async); static void evas_object_textblock_free(Evas_Object *eo_obj); static void evas_object_textblock_render_pre(Evas_Object *eo_obj, -Evas_Object_Protected_Data *obj, -void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static void evas_object_textblock_render_post(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static Evas_Object_Textblock_Node_Text *_evas_textblock_node_text_new(void); static unsigned int evas_object_textblock_id_get(Evas_Object *eo_obj); @@ -548,17 +548,17 @@ static unsigned int evas_object_textblock_visual_id_get(Evas_Object *eo_obj); static void *evas_object_textblock_engine_data_get(Evas_Object *eo_obj); static int evas_object_textblock_is_opaque(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static int evas_object_textblock_was_opaque(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); +Evas_Object_Protected_Data *obj, +void *type_private_data); static void evas_object_textblock_coords_recalc(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); +Evas_Object_Protected_Data *obj, +void *type_private_data); static void evas_object_textblock_scale_update(Evas_Object *eo_obj, - Evas_Object_Protected_Data *obj, - void *type_private_data); + Evas_Object_Protected_Data *obj, + void *type_private_data); static const Evas_Object_Func object_func = { @@ -705,13 +705,13 @@ _style_replace(Evas_Textblock_Style *ts, const char *style_text) if (ts->default_tag) free(ts->default_tag); while (ts->tags) { - Evas_Object_Style_Tag *tag; +Evas_Object_Style_Tag *tag; - tag = (Evas_Object_Style_Tag *)ts->tags; - ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); - free(tag->tag.tag); - free(tag->tag.replace); - free(tag); +tag = (Evas_Object_Style_Tag *)ts-
[EGIT] [core/elementary] master 04/07: hoversel: refactor a bit to avoid code duplication.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=4172fb14f3a0907905f1dc65456ef7a3b94c0611 commit 4172fb14f3a0907905f1dc65456ef7a3b94c0611 Author: Subodh Kumar Date: Mon Nov 9 16:05:05 2015 -0800 hoversel: refactor a bit to avoid code duplication. Summary: Avoid code duplication Two dismissal signals at two different places created some confusion and also code is duplicated. Also removed some extra space. Test Plan: NA Reviewers: cedric Differential Revision: https://phab.enlightenment.org/D3269 --- src/lib/elc_hoversel.c | 63 +- 1 file changed, 26 insertions(+), 37 deletions(-) diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c index 6fb1f4f..9f8ef4f 100644 --- a/src/lib/elc_hoversel.c +++ b/src/lib/elc_hoversel.c @@ -339,13 +339,35 @@ _resizing_eval(Evas_Object *obj, Elm_Hoversel_Data *sd) } static void +_hover_del(Evas_Object *obj) +{ + Elm_Object_Item *eo_item; + Eina_List *l; + + ELM_HOVERSEL_DATA_GET(obj, sd); + + sd->expanded = EINA_FALSE; + + EINA_LIST_FOREACH(sd->items, l, eo_item) + { +ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); +elm_box_unpack(sd->bx, VIEW(it)); +evas_object_hide(VIEW(it)); + } + ELM_SAFE_FREE(sd->hover, evas_object_del); + sd->bx = NULL; + sd->scr = NULL; + sd->last_location = NULL; + + eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL)); +} + +static void _hover_end_finished(void *data, Evas_Object *obj EINA_UNUSED, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) { - Elm_Object_Item *eo_item; - Eina_List *l; const char *dismissstr; ELM_HOVERSEL_DATA_GET(data, sd); @@ -354,20 +376,7 @@ _hover_end_finished(void *data, if (dismissstr && !strcmp(dismissstr, "on")) { -sd->expanded = EINA_FALSE; - -EINA_LIST_FOREACH(sd->items, l, eo_item) - { - ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); - elm_box_unpack(sd->bx, VIEW(it)); - evas_object_hide(VIEW(it)); - } -ELM_SAFE_FREE(sd->hover, evas_object_del); -sd->bx = NULL; -sd->scr = NULL; -sd->last_location = NULL; - -eo_do(data, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL)); +_hover_del(data); } } @@ -679,9 +688,6 @@ _elm_hoversel_hover_begin(Eo *obj, Elm_Hoversel_Data *sd) EOLIAN static void _elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd) { - - Elm_Object_Item *eo_item; - Eina_List *l; const char *dismissstr; if (!sd->hover) return; @@ -691,27 +697,10 @@ _elm_hoversel_hover_end(Eo *obj, Elm_Hoversel_Data *sd) if (dismissstr && !strcmp(dismissstr, "on")) { elm_hover_dismiss(sd->hover); - - - } else - { -sd->expanded = EINA_FALSE; - -EINA_LIST_FOREACH(sd->items, l, eo_item) - { - ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); - elm_box_unpack(sd->bx, VIEW(it)); - evas_object_hide(VIEW(it)); - } -ELM_SAFE_FREE(sd->hover, evas_object_del); -sd->scr = NULL; -sd->last_location = NULL; -sd->bx = NULL; - -eo_do(obj, eo_event_callback_call(ELM_HOVERSEL_EVENT_DISMISSED, NULL)); +_hover_del(obj); } // for backward compatibility } --
[EGIT] [core/efl] master 01/01: Evas text: Remove fixme marker
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f1cffd77096c4314598629e12a4c42498ba2e7cf commit f1cffd77096c4314598629e12a4c42498ba2e7cf Author: Subodh Kumar Date: Tue Nov 17 11:24:39 2015 + Evas text: Remove fixme marker Summary: Remove fixme marker Algorithm used is good enough to sort very few number of items, usually 2 to 6 items. Test Plan: NA Reviewers: herdsman, cedric, tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3312 --- src/lib/evas/canvas/evas_object_text.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 9680a86..2cf1a54 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -559,7 +559,6 @@ _evas_object_text_item_order(Evas_Object *eo_obj, Evas_Text_Data *o) { (void) eo_obj; #ifdef BIDI_SUPPORT - /*FIXME: not very efficient, sort the items arrays. */ /* Reorder if it's a bidi text */ if (o->bidi_par_props) { --
[EGIT] [core/efl] master 01/01: Evas text: Remove tabs for readability
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d14dc12d3bbaac07e88bfb99e5d189170dd6da3c commit d14dc12d3bbaac07e88bfb99e5d189170dd6da3c Author: Subodh Kumar Date: Tue Nov 17 11:22:17 2015 + Evas text: Remove tabs for readability Summary: Remove tabs Test Plan: NA Reviewers: tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3337 --- src/lib/evas/canvas/evas_object_text.c | 184 + 1 file changed, 94 insertions(+), 90 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 52b9170..9680a86 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -34,7 +34,7 @@ struct _Evas_Text_Data struct { struct { -unsigned char r, g, b, a; + unsigned char r, g, b, a; } outline, shadow, glow, glow2; const char *utf8_text; /* The text exposed to the API */ @@ -620,8 +620,8 @@ _layout_ellipsis_item_new(Evas_Object_Protected_Data *obj, Evas_Text_Data *o) { (void) ENFN->font_run_end_get(ENDT, o->font, &script_fi, &cur_fi, script, _ellip_str, 1); - ellip_ti = _evas_object_text_item_new(obj, o, cur_fi, - _ellip_str, script, 0, 0, len); + ellip_ti = _evas_object_text_item_new(obj, o, cur_fi, + _ellip_str, script, 0, 0, len); } return ellip_ti; @@ -905,7 +905,9 @@ _evas_object_text_layout(Evas_Object *eo_obj, Evas_Text_Data *o, Eina_Unicode *t { Eina_Inlist *itrn = EINA_INLIST_GET(itr)->next; if ((itr != start_ellip_it) && (itr != end_ellip_it)) - _evas_object_text_item_del(o, itr); +{ + _evas_object_text_item_del(o, itr); +} itr = (Evas_Object_Text_Item *) itrn; } } @@ -1002,8 +1004,8 @@ _evas_text_efl_text_text_set(Eo *eo_obj, Evas_Text_Data *o, const char *_text) if (!text) text = eina_unicode_strdup(EINA_UNICODE_EMPTY_STRING); was = evas_object_is_in_output_rect(eo_obj, obj, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y, 1, 1); + obj->layer->evas->pointer.x, + obj->layer->evas->pointer.y, 1, 1); /* DO II */ /*Update bidi_props*/ @@ -1022,14 +1024,14 @@ _evas_text_efl_text_text_set(Eo *eo_obj, Evas_Text_Data *o, const char *_text) evas_object_clip_dirty(eo_obj, obj); evas_object_coords_recalc(eo_obj, obj); is = evas_object_is_in_output_rect(eo_obj, obj, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y, 1, 1); + obj->layer->evas->pointer.x, + obj->layer->evas->pointer.y, 1, 1); if ((is || was) && obj->cur->visible) evas_event_feed_mouse_move(obj->layer->evas->evas, - obj->layer->evas->pointer.x, - obj->layer->evas->pointer.y, - obj->layer->evas->last_timestamp, - NULL); +obj->layer->evas->pointer.x, +obj->layer->evas->pointer.y, +obj->layer->evas->last_timestamp, +NULL); evas_object_inform_call_resize(eo_obj); } @@ -1144,15 +1146,15 @@ _evas_text_char_pos_get(const Eo *eo_obj, Evas_Text_Data *o, int pos, Evas_Coord x -= l; if (x < 0) { - w += x; - x = 0; +w += x; +x = 0; } if ((x + w) > obj->cur->geometry.w) w = obj->cur->geometry.w - x; if (w < 0) w = 0; if (y < 0) { - h += y; - y = 0; +h += y; +y = 0; } if ((y + h) > obj->cur->geometry.h) h = obj->cur->geometry.h - y; if (h < 0) h = 0; @@ -1198,16 +1200,16 @@ _evas_text_char_coords_get(const Eo *eo_obj, Evas_Text_Data *o, Evas_Coord x, Ev rx -= l; if (rx < 0) { - rw += rx; - rx = 0; +rw += rx; +rx = 0; } Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); if ((rx + rw) > obj->cur->geometry.w) rw = obj->cur->geometry.w - rx; if (rw < 0) rw = 0; if (ry < 0) { - rh += ry; - ry = 0; +rh += ry; +ry = 0; } if ((ry + rh) > obj->cur->geometry.h) rh
[EGIT] [core/elementary] master 01/01: Elm entry: Keep cursor at inserted position after dnd.
thiep pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=c63d91aa6dab37e29ccfa4a6e61348378f196e4c commit c63d91aa6dab37e29ccfa4a6e61348378f196e4c Author: Subodh Kumar Date: Wed Nov 18 11:57:49 2015 +0900 Elm entry: Keep cursor at inserted position after dnd. Summary: Keep cursor at inserted position after dnd. For good user experience, after dnd users expect the cursor should be at the last inserted position. @feature Test Plan: NA Reviewers: thiepha, herdsman, cedric, tasn Subscribers: shilpasingh Differential Revision: https://phab.enlightenment.org/D3267 --- src/lib/elm_entry.c | 5 - 1 file changed, 5 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 5cf77a5..c1984a8 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -700,8 +700,6 @@ _drag_drop_cb(void *data EINA_UNUSED, ELM_ENTRY_DATA_GET(obj, sd); - edje_object_part_text_cursor_copy - (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, /*->*/ EDJE_CURSOR_USER); rv = edje_object_part_text_cursor_coord_set (sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, drop->x, drop->y); @@ -709,9 +707,6 @@ _drag_drop_cb(void *data EINA_UNUSED, rv = _selection_data_cb(NULL, obj, drop); - edje_object_part_text_cursor_copy - (sd->entry_edje, "elm.text", EDJE_CURSOR_USER, /*->*/ EDJE_CURSOR_MAIN); - return rv; } --
[EGIT] [core/efl] master 01/02: Evas text: Fix memory leak
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=392df9479f816a641fabbf26bdab4b9cfc28 commit 392df9479f816a641fabbf26bdab4b9cfc28 Author: Subodh Kumar Date: Wed Nov 18 10:52:34 2015 + Evas text: Fix memory leak Summary: Fix memory leak Position is getting returned without freeing the temporary logical item list. @fix Test Plan: NA Reviewers: tasn, raster Reviewed By: raster Subscribers: raster, cedric Differential Revision: https://phab.enlightenment.org/D3345 --- src/lib/evas/canvas/evas_object_text.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 2cf1a54..97c0711 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -271,6 +271,7 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, { Evas_Object_Protected_Data *obj = eo_data_scope_get(eo_obj, EVAS_OBJECT_CLASS); Evas_Object_Text_Item *it; + int pos = 0; #ifdef BIDI_SUPPORT /*FIXME: not very efficient, sort the items arrays. */ @@ -291,15 +292,17 @@ _evas_object_text_last_up_to_pos(const Evas_Object *eo_obj, { if ((x <= cx) && (cx < x + it->adv)) { - return it->text_pos + ENFN->font_last_up_to_pos(ENDT, + pos = it->text_pos + ENFN->font_last_up_to_pos(ENDT, o->font, &it->text_props, cx - x, cy); + break; } x += it->adv; } eina_list_free(logical_it); +return pos; } else #endif --
[EGIT] [core/efl] master 01/01: Edje entry: Use markup text for password in preedit mode
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=320733ecd72e4c8d4b01a185d15b7f4c168cc009 commit 320733ecd72e4c8d4b01a185d15b7f4c168cc009 Author: Subodh Kumar Date: Thu Dec 3 16:04:07 2015 + Edje entry: Use markup text for password in preedit mode Summary: Use markup text for password in preedit mode Problem is that when text comes in preedit mode it is always markup text and when it is committed to entry it got committed with markup tags along with the original string, so for preedit mode password should be filtered all markup to set the proper text. @fix Test Plan: In preedit mode, enter any character say 'A' preedit markup like A will come in preedit changed callback Result: Text is set as plain text like below <preedit>A</preedit> Reviewers: thiepha, jihoon, herdsman, shilpasingh, tasn Reviewed By: shilpasingh, tasn Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D2929 --- src/lib/edje/edje_entry.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 38fb5ff..9ed6ff7 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -4297,7 +4297,7 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA Edje_Entry_Change_Info *info; _edje_entry_hide_visible_password(ed, en->rp); - info = _text_filter_text_prepend(ed, en, en->cursor, + info = _text_filter_markup_prepend(ed, en, en->cursor, eina_strbuf_string_get(buf), "+ password=off", "- password", --
[EGIT] [core/efl] master 01/01: Evas textblock: Use width of item format to position cursor.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=43f50dc7dbb159752d7913dea35e8156d0f10c7b commit 43f50dc7dbb159752d7913dea35e8156d0f10c7b Author: Subodh Kumar Date: Thu Dec 17 11:54:35 2015 + Evas textblock: Use width of item format to position cursor. Summary: Use width of item format to position cursor. Sometimes it becomes very difficult to position cursor over item and selection becomes very difficult as we position the cursor once the input X coord reached end of the item, like one attached in the test plan. So this patch decides over 50% of item width for X coord reaches to position it at start or end. @ix Test Plan: Attached setup shows how difficult to position cursor at the end when clicked over item and selection is also very difficult. Consider such case in mobile device, its becomes impossible to position cursor at the end and selection is too much difficult. {F27036} Also added test cases in evas test suite Reviewers: herdsman, tasn Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D3390 --- src/lib/evas/canvas/evas_object_textblock.c | 10 +- src/tests/evas/evas_test_textblock.c| 14 +- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 48e7b3b..54e4311 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -10786,7 +10786,15 @@ evas_textblock_cursor_char_coord_set(Evas_Textblock_Cursor *cur, Evas_Coord x, E { Evas_Object_Textblock_Format_Item *fi; fi = _ITEM_FORMAT(it); - cur->pos = fi->parent.text_pos; + /* Lets keep cur position half way for easy positioning */ + if (x > (ln->x + it->x + (it->adv / 2))) + { + cur->pos = fi->parent.text_pos + 1; + } + else + { + cur->pos = fi->parent.text_pos; + } cur->node = found_par->text_node; return EINA_TRUE; } diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index 467e164..528e640 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -1693,7 +1693,7 @@ END_TEST /* Testing items */ START_TEST(evas_textblock_items) { - Evas_Coord w, h, w2, h2, nw, nh, ih; + Evas_Coord x, y, w, h, w2, h2, nw, nh, ih; START_TB_TEST(); const char *buf = "This is an ."; @@ -1798,6 +1798,18 @@ START_TEST(evas_textblock_items) if (evas_textblock_cursor_format_item_geometry_get(cur, NULL, NULL, &w, &h)) fail_if((w != 64) || (h != 64)); + /* Test char coordinate for item at middle position of the item to decide cursor position, +* it means when char coordinate exceeds the half width of the item then only +* cursor position is changed. */ + buf = "."; + evas_object_textblock_text_markup_set(tb, buf); + evas_textblock_cursor_format_item_geometry_get(cur, &x, &y, &w, NULL); + evas_textblock_cursor_char_coord_set(cur, x + (w / 2) + 1, y); + fail_if(evas_textblock_cursor_pos_get(cur) != 1); + /* Test small increment in x and cursor position will be same */ + evas_textblock_cursor_char_coord_set(cur, x + 10, y); + fail_if(evas_textblock_cursor_pos_get(cur) != 0); + /* FIXME: Also verify x,y positions of the item. */ /* FIXME We need some item tests that involve line wrapping that make the --
[EGIT] [core/efl] master 01/01: Evas textblock: Fix some indentation and formatting.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=105960b24f15140710896710fe94080961e0bb50 commit 105960b24f15140710896710fe94080961e0bb50 Author: Subodh Kumar Date: Fri Dec 18 15:14:05 2015 + Evas textblock: Fix some indentation and formatting. Summary: Fix some indentation and formatting. Reviewers: herdsman, cedric, tasn Reviewed By: cedric Subscribers: jpeg, cedric Differential Revision: https://phab.enlightenment.org/D3174 --- src/lib/evas/canvas/evas_object_textblock.c | 185 ++-- 1 file changed, 92 insertions(+), 93 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index c615b5e..bfa7cf5 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -431,9 +431,9 @@ struct _Evas_Object_Textblock_Format } font; struct { struct { -unsigned char r, g, b, a; + unsigned char r, g, b, a; } normal, underline, underline2, underline_dash, outline, shadow, glow, glow2, backing, - strikethrough; +strikethrough; } color; struct { int l, r; @@ -719,13 +719,13 @@ _style_replace(Evas_Textblock_Style *ts, const char *style_text) if (ts->default_tag) free(ts->default_tag); while (ts->tags) { - Evas_Object_Style_Tag *tag; +Evas_Object_Style_Tag *tag; - tag = (Evas_Object_Style_Tag *)ts->tags; - ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); - free(tag->tag.tag); - free(tag->tag.replace); - free(tag); +tag = (Evas_Object_Style_Tag *)ts->tags; +ts->tags = (Evas_Object_Style_Tag *)eina_inlist_remove(EINA_INLIST_GET(ts->tags), EINA_INLIST_GET(tag)); +free(tag->tag.tag); +free(tag->tag.replace); +free(tag); } ts->default_tag = NULL; ts->tags = NULL; @@ -759,12 +759,12 @@ _style_match_tag(const Evas_Textblock_Style *ts, const char *s, size_t tag_len, /* Try the style tags */ EINA_INLIST_FOREACH(ts->tags, tag) { - if (tag->tag.tag_len != tag_len) continue; - if (!strncmp(tag->tag.tag, s, tag_len)) - { -*replace_len = tag->tag.replace_len; -return tag->tag.replace; - } +if (tag->tag.tag_len != tag_len) continue; +if (!strncmp(tag->tag.tag, s, tag_len)) + { + *replace_len = tag->tag.replace_len; + return tag->tag.replace; + } } /* Try the default tags */ @@ -799,9 +799,9 @@ _nodes_clear(const Evas_Object *eo_obj) Evas_Textblock_Data *o = eo_data_scope_get(eo_obj, MY_CLASS); while (o->text_nodes) { - Evas_Object_Textblock_Node_Text *n; +Evas_Object_Textblock_Node_Text *n; - n = o->text_nodes; +n = o->text_nodes; o->text_nodes = _NODE_TEXT(eina_inlist_remove( EINA_INLIST_GET(o->text_nodes), EINA_INLIST_GET(n))); _evas_textblock_node_text_free(n); @@ -6291,13 +6291,17 @@ evas_textblock_style_set(Evas_Textblock_Style *ts, const char *text) { if (!key_start) { -if (!isspace((unsigned char)(*p))) -key_start = p; + if (!isspace((unsigned char)(*p))) +{ + key_start = p; +} } else if (!key_stop) { -if ((*p == '=') || (isspace((unsigned char)(*p -key_stop = p; + if ((*p == '=') || (isspace((unsigned char)(*p +{ + key_stop = p; +} } else if (!val_start) { @@ -7993,15 +7997,13 @@ evas_textblock_cursor_paragraph_last(Evas_Textblock_Cursor *cur) { node = _NODE_TEXT(EINA_INLIST_GET(node)->last); cur->node = node; - cur->pos = 0; - - evas_textblock_cursor_paragraph_char_last(cur); +cur->pos = 0; +evas_textblock_cursor_paragraph_char_last(cur); } else { - cur->node = NULL; - cur->pos = 0; - +cur->node = NULL; +cur->pos = 0; } } @@ -8428,8 +8430,8 @@ evas_textblock_cursor_line_char_last(Evas_Textblock_Cursor *cur) { size_t ind; - cur->node = it->text_node; - cur->pos = it->text_pos; +cur->node = it->text_node; +cur->pos = it->text_pos; if (it->type == EVAS_TEXTBLOCK_ITEM_TEXT) { ind = _ITEM_TEXT(it)->text_props.text_len - 1; @@ -896
[EGIT] [core/elementary] master 01/01: Elm entry: Fix a typo
tasn pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=a392f2f4bc0d80973b1eed68f61e0c7faf2c5d24 commit a392f2f4bc0d80973b1eed68f61e0c7faf2c5d24 Author: Subodh Kumar Date: Mon Dec 21 11:41:34 2015 + Elm entry: Fix a typo Summary: Fix a typo. Test Plan: NA Reviewers: tasn, herdsman Differential Revision: https://phab.enlightenment.org/D3476 --- src/lib/elm_entry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index baedc27..700116c 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -3758,7 +3758,7 @@ _cb_added(void *data EINA_UNUSED, } static Eina_Bool -_cb_deled(void *data EINA_UNUSED, +_cb_deleted(void *data EINA_UNUSED, Eo *obj, const Eo_Event_Description *desc EINA_UNUSED, void *event_info) @@ -3781,7 +3781,7 @@ _elm_entry_eo_base_constructor(Eo *obj, Elm_Entry_Data *_pd EINA_UNUSED) evas_obj_smart_callbacks_descriptions_set(_smart_callbacks), elm_interface_atspi_accessible_role_set(ELM_ATSPI_ROLE_ENTRY), eo_event_callback_add(EO_EV_CALLBACK_ADD, _cb_added, NULL), - eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deled, NULL)); + eo_event_callback_add(EO_EV_CALLBACK_DEL, _cb_deleted, NULL)); return obj; } --
[EGIT] [core/efl] master 01/01: Edje entry: Fix cursor position on mouse up and down
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7684cea2267f3fdd48977319ae05cbb4d12b82e9 commit 7684cea2267f3fdd48977319ae05cbb4d12b82e9 Author: Subodh Kumar Date: Mon Dec 21 14:27:43 2015 + Edje entry: Fix cursor position on mouse up and down Summary: Fix cursor position on mouse up/down When mouse down/up over top and bottom part textblock is not able to set the char coordinate as it is not inside actual text, edje entry tries to manage it but textblock has that handling. As a result the cursor jump to first char for single line and at the last in the multiline last line. So this patch fixes this and manage to keep the the mouse coordinate inside the textblock. In mobile device this is not really acceptable when user taps over the entry at some position and cursor jumps to some arbitrary position. @fix Test Plan: 1. Elementary Test 2. Entry 3 (any entry) 3. Try to click little below or above the text in first entry single line.Observe cursor jumps to first position 4. Do as above for multiline entry (try to click at the last line little below) observe cursor jumps to last char. Reviewers: thiepha, herdsman, tasn Subscribers: jpeg, tasn, cedric Differential Revision: https://phab.enlightenment.org/D3257 --- src/lib/edje/edje_entry.c | 126 -- 1 file changed, 43 insertions(+), 83 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 9ed6ff7..9b9d194 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2052,6 +2052,44 @@ _edje_key_up_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v #endif } +static Evas_Textblock_Cursor * +_edje_cursor_char_coord_set(Edje_Real_Part *rp, Evas_Coord canvasx, Evas_Coord canvasy, Evas_Coord *cx, Evas_Coord *cy) +{ + Entry *en; + Evas_Coord x, y, lh = 0, cly = 0; + Evas_Textblock_Cursor *line_cur; + Evas_Textblock_Cursor *tc; + + en = rp->typedata.text->entry_data; + tc = evas_object_textblock_cursor_new(rp->object); + evas_textblock_cursor_copy(en->cursor, tc); + evas_object_geometry_get(rp->object, &x, &y, NULL, NULL); + *cx = canvasx - x; + *cy = canvasy - y; + + line_cur = evas_object_textblock_cursor_new(rp->object); + evas_textblock_cursor_paragraph_last(line_cur); + evas_textblock_cursor_line_geometry_get(line_cur, NULL, &cly, NULL, &lh); + /* Consider a threshold of half the line height */ + if (*cy > (cly + lh) && *cy < (cly + lh + lh / 2)) + { +*cy = cly + lh - 1; // Make it inside Textblock + } + evas_textblock_cursor_paragraph_first(line_cur); + evas_textblock_cursor_line_geometry_get(line_cur, NULL, &cly, NULL, NULL); + + if (*cy < cly && *cy > (cly - lh / 2)) + { +*cy = cly; + } + evas_textblock_cursor_free(line_cur); + /* No need to check return value if not able to set the char coord Textblock +* will take care */ + evas_textblock_cursor_char_coord_set(en->cursor, *cx, *cy); + + return tc; +} + static void _edje_part_move_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { @@ -2072,11 +2110,11 @@ _edje_part_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_ Edje_Real_Part *rp = data; Evas_Event_Mouse_Down *ev = event_info; Entry *en; - Evas_Coord x, y, w, h; // Eina_Bool multiline; Evas_Textblock_Cursor *tc = NULL; Eina_Bool dosel = EINA_FALSE; Eina_Bool shift; + if ((!rp) || (!ev)) return; if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; if ((rp->type != EDJE_RP_TYPE_TEXT) || @@ -2165,48 +2203,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_ goto end; } } - tc = evas_object_textblock_cursor_new(rp->object); - evas_textblock_cursor_copy(en->cursor, tc); - // multiline = rp->part->multiline; - evas_object_geometry_get(rp->object, &x, &y, &w, &h); - cx = ev->canvas.x - x; - cy = ev->canvas.y - y; - if (!evas_textblock_cursor_char_coord_set(en->cursor, cx, cy)) - { -Evas_Coord lx, ly, lw, lh; -int line; + tc = _edje_cursor_char_coord_set(rp, ev->canvas.x, ev->canvas.y, &cx, &cy); -line = evas_textblock_cursor_line_coord_set(en->cursor, cy); -if (line == -1) - { - if (rp->part->multiline) - _curs_end(en->cursor, rp->object, en); - else - { - evas_textblock_cursor_paragraph_first(en->cursor); - evas_textblock_cursor_line_geometry_get(en->cursor, &lx, &ly,
[EGIT] [core/elementary] master 01/02: Entry: Add newline filter for single line entry
tasn pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=b4fca621509571623f3c5b25cc547cca699d09d5 commit b4fca621509571623f3c5b25cc547cca699d09d5 Author: Subodh Kumar Date: Mon Dec 21 14:41:28 2015 + Entry: Add newline filter for single line entry Summary: Add newline filter Using the present filter infra a newline or paragraph separator filter is being added for single line entry. @fix Test Plan: Copy multiline text from and paste it to single line entry. it will fix T2660 Reviewers: herdsman, tasn Subscribers: thiepha, DaveMDS Maniphest Tasks: T2660 Differential Revision: https://phab.enlightenment.org/D3109 --- src/lib/elm_entry.c | 82 + 1 file changed, 82 insertions(+) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index 700116c..fa28a37 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -2604,6 +2604,79 @@ _item_get(void *data, return o; } +static Eina_Bool +_entry_has_new_line(const char *text) +{ + if (!text) return EINA_FALSE; + + while (*text) + { +if (!strncmp(text, "", ""); + eina_strbuf_replace_all(str, "", ""); + eina_strbuf_replace_all(str, "", ""); + eina_strbuf_replace_all(str, "", ""); + new_text = eina_strbuf_string_steal(str); + eina_strbuf_free(str); + return new_text; +} + +static void +_entry_new_line_filter_init(Evas_Object *obj) +{ + const char *text; + char *text2 = NULL; + + if (elm_entry_is_empty(obj)) return; + + text = elm_entry_entry_get(obj); + text2 = _entry_remove_new_line(text); + if (text2) + { +elm_entry_entry_set(obj, text2); +free(text2); + } +} + +static void +_entry_new_line_filter_cb(void *data EINA_UNUSED, + Evas_Object *entry EINA_UNUSED, + char **text) +{ + char *old_text; + + if (!*text) return; + + old_text = *text; + *text = _entry_remove_new_line((const char*)*text); + if (*text) + free(old_text); + else + *text = old_text; +} + static void _markup_filter_cb(void *data, Evas_Object *edje EINA_UNUSED, @@ -3816,6 +3889,15 @@ _elm_entry_single_line_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool single_line) sd->line_wrap = ELM_WRAP_NONE; if (elm_entry_cnp_mode_get(obj) == ELM_CNP_MODE_MARKUP) elm_entry_cnp_mode_set(obj, ELM_CNP_MODE_NO_IMAGE); + if (sd->single_line) + { +_entry_new_line_filter_init(obj); +elm_entry_markup_filter_append(obj, _entry_new_line_filter_cb, NULL); + } + else + { +elm_entry_markup_filter_remove(obj, _entry_new_line_filter_cb, NULL); + } eo_do(obj, elm_obj_widget_theme_apply()); if (sd->scroll) --
[EGIT] [core/elementary] master 01/01: Elm entry: Fix to hide magnifier when menu is disabled.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=319d80dd2bb26f109b2dfa942fa878481e01381f commit 319d80dd2bb26f109b2dfa942fa878481e01381f Author: Subodh Kumar Date: Wed Dec 23 13:03:45 2015 + Elm entry: Fix to hide magnifier when menu is disabled. Summary: Fix to hide magnifier when menu is disabled @fix Test Plan: 1. Enable magnifier 2. Disable menu 3. Long press and mouse up 4. observe magnifier is not hidden. Reviewers: tasn, herdsman, thiepha Subscribers: shilpasingh Differential Revision: https://phab.enlightenment.org/D3490 --- src/lib/elm_entry.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index b7c953d..811d6f6 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1857,11 +1857,13 @@ _mouse_up_cb(void *data, /* Since context menu disabled flag was checked at long press start while mouse * down, hence the same should be checked at mouse up from a long press * as well */ -if ((sd->long_pressed) && (!_elm_config->context_menu_disabled) && -(_elm_config->magnifier_enable)) +if ((sd->long_pressed) && (_elm_config->magnifier_enable)) { _magnifier_hide(data); - _menu_call(data); + if (!_elm_config->context_menu_disabled) + { + _menu_call(data); + } } else { --
[EGIT] [core/efl] master 01/01: Edje entry: Do not update cursor for non editable entry.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=593c7eac0202a95589cfac87cce35d1f8f113301 commit 593c7eac0202a95589cfac87cce35d1f8f113301 Author: Subodh Kumar Date: Tue Jan 5 14:30:20 2016 + Edje entry: Do not update cursor for non editable entry. Summary: Do not update cursor for non editable entry. If entry is not editable there must not be any need to query tb cursor geometry and run other codes related to it. This may improve some performance of non-editable entry. Test Plan: NA Reviewers: tasn, herdsman, thiepha Subscribers: shilpasingh, cedric, jpeg Projects: #efl Differential Revision: https://phab.enlightenment.org/D3532 --- src/lib/edje/edje_entry.c | 76 --- 1 file changed, 39 insertions(+), 37 deletions(-) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 9b9d194..54fd3a8 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2719,50 +2719,52 @@ _edje_entry_real_part_configure(Edje *ed, Edje_Real_Part *rp) (!rp->typedata.text)) return; en = rp->typedata.text->entry_data; if (!en) return; - switch (rp->part->cursor_mode) - { - case EDJE_ENTRY_CURSOR_MODE_BEFORE: -cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE; -break; - - case EDJE_ENTRY_CURSOR_MODE_UNDER: - /* no break for a reason */ - default: -cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER; - } _sel_update(ed, en->cursor, rp->object, en); _anchors_update_check(ed, rp); - x = y = w = h = -1; - xx = yy = ww = hh = -1; - evas_object_geometry_get(rp->object, &x, &y, &w, &h); - bidi_cursor = evas_textblock_cursor_geometry_bidi_get(en->cursor, &xx, &yy, &ww, &hh, &xx2, &yy2, NULL, NULL, cur_type); - if (ww < 1) ww = 1; - if (hh < 1) hh = 1; - if (en->cursor_bg) - { -evas_object_move(en->cursor_bg, x + xx, y + yy); -evas_object_resize(en->cursor_bg, ww, hh); - } - if (en->cursor_fg) - { -evas_object_move(en->cursor_fg, x + xx, y + yy); -evas_object_resize(en->cursor_fg, ww, hh); - } - if (en->cursor_fg2) + if (rp->part->entry_mode >= EDJE_ENTRY_EDIT_MODE_EDITABLE) { -if (bidi_cursor) +switch (rp->part->cursor_mode) + { + case EDJE_ENTRY_CURSOR_MODE_BEFORE: + cur_type = EVAS_TEXTBLOCK_CURSOR_BEFORE; +break; + + case EDJE_ENTRY_CURSOR_MODE_UNDER: + /* no break for a reason */ + default: + cur_type = EVAS_TEXTBLOCK_CURSOR_UNDER; + } +x = y = w = h = -1; +xx = yy = ww = hh = -1; +evas_object_geometry_get(rp->object, &x, &y, &w, &h); +bidi_cursor = evas_textblock_cursor_geometry_bidi_get(en->cursor, &xx, &yy, &ww, &hh, &xx2, &yy2, NULL, NULL, cur_type); +if (ww < 1) ww = 1; +if (hh < 1) hh = 1; +if (en->cursor_bg) { - evas_object_image_fill_set(en->cursor_fg2, 0, 0, ww, hh / 2); - evas_object_move(en->cursor_fg2, x + xx2, y + yy2 + (hh / 2)); - evas_object_resize(en->cursor_fg, ww, hh / 2); - evas_object_resize(en->cursor_fg2, ww, hh / 2); - - evas_object_show(en->cursor_fg2); + evas_object_move(en->cursor_bg, x + xx, y + yy); + evas_object_resize(en->cursor_bg, ww, hh); } -else +if (en->cursor_fg) { - evas_object_hide(en->cursor_fg2); + evas_object_move(en->cursor_fg, x + xx, y + yy); + evas_object_resize(en->cursor_fg, ww, hh); + } +if (en->cursor_fg2) + { + if (bidi_cursor) + { + evas_object_image_fill_set(en->cursor_fg2, 0, 0, ww, hh / 2); + evas_object_move(en->cursor_fg2, x + xx2, y + yy2 + (hh / 2)); + evas_object_resize(en->cursor_fg, ww, hh / 2); + evas_object_resize(en->cursor_fg2, ww, hh / 2); + evas_object_show(en->cursor_fg2); + } + else + { + evas_object_hide(en->cursor_fg2); + } } } } --
[EGIT] [core/elementary] master 02/03: segment_control: check item disable
cedric pushed a commit to branch master. http://git.enlightenment.org/core/elementary.git/commit/?id=fb7c19f9d6f4a3318a934d8c04261740599bdc05 commit fb7c19f9d6f4a3318a934d8c04261740599bdc05 Author: Subodh Kumar Date: Wed Jan 6 11:26:18 2016 -0800 segment_control: check item disable Summary: Elm segment_control: check item disable Signed-off by: @adrien Refer T2883 @fix Test Plan: NA Reviewers: cedric Subscribers: adrien Projects: #elementary Differential Revision: https://phab.enlightenment.org/D3531 Signed-off-by: Cedric BAIL --- src/lib/elm_segment_control.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_segment_control.c b/src/lib/elm_segment_control.c index 68d46da..2b6452a 100644 --- a/src/lib/elm_segment_control.c +++ b/src/lib/elm_segment_control.c @@ -202,7 +202,8 @@ _update_list(Elm_Segment_Control_Data *sd) else edje_object_signal_emit(VIEW(it), "elm,state,segment,normal", "elm"); -if (elm_widget_disabled_get(sd->obj)) +if (elm_widget_disabled_get(sd->obj) +|| elm_object_item_disabled_get(eo_it)) edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm"); else edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm"); @@ -309,6 +310,8 @@ _segment_on(Elm_Segment_Control_Item_Data *it) if (it == sd->selected_item) return; + if (elm_object_item_disabled_get(EO_OBJ(it))) return; + if (sd->selected_item) _segment_off(sd->selected_item); edje_object_signal_emit(VIEW(it), "elm,state,segment,selected", "elm"); --
[EGIT] [core/efl] efl-1.16 01/01: Edje entry: Fix memory leak.
tasn pushed a commit to branch efl-1.16. http://git.enlightenment.org/core/efl.git/commit/?id=06749ec24a7207ac59748f3394a593a9dacd05ca commit 06749ec24a7207ac59748f3394a593a9dacd05ca Author: Subodh Kumar Date: Fri Jan 8 16:17:29 2016 + Edje entry: Fix memory leak. Summary: Fix memory leak If user or extra cursor is used, these should be free on shutdown. @fix Test Plan: NA Reviewers: tasn, herdsman Subscribers: shilpasingh, cedric, jpeg Projects: #efl Differential Revision: https://phab.enlightenment.org/D3550 --- src/lib/edje/edje_entry.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index b6cbf84..7a45cb2 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2700,6 +2700,12 @@ _edje_entry_real_part_shutdown(Edje *ed, Edje_Real_Part *rp) evas_object_del(en->cursor_fg); evas_object_del(en->cursor_fg2); + if (en->cursor_user) + evas_textblock_cursor_free(en->cursor_user); + + if (en->cursor_user_extra) + evas_textblock_cursor_free(en->cursor_user_extra); + if (en->pw_timer) { ecore_timer_del(en->pw_timer); --
[EGIT] [core/efl] master 01/01: Edje entry: Fix memory leak.
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=97b7964e8cc0b9328e1c8c829c9f099bbc044a34 commit 97b7964e8cc0b9328e1c8c829c9f099bbc044a34 Author: Subodh Kumar Date: Fri Jan 8 16:17:29 2016 + Edje entry: Fix memory leak. Summary: Fix memory leak If user or extra cursor is used, these should be free on shutdown. @fix Test Plan: NA Reviewers: tasn, herdsman Subscribers: shilpasingh, cedric, jpeg Projects: #efl Differential Revision: https://phab.enlightenment.org/D3550 --- src/lib/edje/edje_entry.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 54fd3a8..cb64c34 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -2678,6 +2678,12 @@ _edje_entry_real_part_shutdown(Edje *ed, Edje_Real_Part *rp) evas_object_del(en->cursor_fg); evas_object_del(en->cursor_fg2); + if (en->cursor_user) + evas_textblock_cursor_free(en->cursor_user); + + if (en->cursor_user_extra) + evas_textblock_cursor_free(en->cursor_user_extra); + if (en->pw_timer) { ecore_timer_del(en->pw_timer); --
[EGIT] [core/efl] master 01/01: edje entry: Improves anchors handling
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bb13b45e800f34350a33540c22efa1c5a376ac70 commit bb13b45e800f34350a33540c22efa1c5a376ac70 Author: Subodh Kumar Date: Fri May 15 14:18:08 2015 +0900 edje entry: Improves anchors handling Summary: When edje entry is not inside the canvas view port, anchors update is aborted to improve the scrolling performance in case of large number of anchors. @feature Test Plan: 1. Should have many entries inside scroller. 2. Each entry should contain large number of anchors. 3. Scroll it, scrolling is not smooth. Reviewers: seoz, cedric, thiepha, woohyun, tasn, raster, shilpasingh, herdsman, JackDanielZ Reviewed By: shilpasingh Subscribers: poornima.srinivasan, rajeshps, cedric, govi Differential Revision: https://phab.enlightenment.org/D2108 --- AUTHORS | 1 + src/lib/edje/edje_entry.c | 57 +++ 2 files changed, 54 insertions(+), 4 deletions(-) diff --git a/AUTHORS b/AUTHORS index e9f793f..fa10193 100644 --- a/AUTHORS +++ b/AUTHORS @@ -322,6 +322,7 @@ m.biliavskyi Vyacheslav Reutskiy Kumar Navneet Katpagavalli Anantharaj +Subodh Kumar Emotion --- diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 5b73afe..1f4fadb 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -46,6 +46,7 @@ struct _Entry Eina_Bool had_sel : 1; Eina_Bool input_panel_enable : 1; Eina_Bool prediction_allow : 1; + Eina_Bool anchors_updated : 1; #ifdef HAVE_ECORE_IMF Eina_Bool have_preedit : 1; @@ -865,7 +866,7 @@ _edje_anchor_mouse_out_cb(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA } static void -_anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Entry *en) +_anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o, Entry *en) { Eina_List *l, *ll, *range = NULL; Evas_Coord x, y, w, h; @@ -874,6 +875,9 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED Anchor *an; Edje *ed = en->ed; + /* Better not to update anchors outside the view port. */ + if (en->anchors_updated) return; + smart = evas_object_smart_parent_get(o); clip = evas_object_clip_get(o); x = y = w = h = -1; @@ -1013,6 +1017,43 @@ _anchors_update(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED } static void +_anchors_update_check(Edje *ed, Edje_Real_Part *rp) +{ + Evas_Coord x, y, w, h; + Evas_Coord vx, vy, vw, vh; + Eina_Bool anchors_updated = EINA_FALSE; + Entry *en; + + en = rp->typedata.text->entry_data; + x = y = w = h = -1; + vx = vy = vw = vh = -1; + evas_object_geometry_get(rp->object, &x, &y, &w, &h); + evas_output_viewport_get(ed->base->evas, &vx, &vy, &vw, &vh); + if (((y + h) <= vy) || (y >= (vy + vh))) + anchors_updated = EINA_TRUE; + else if (((x + w) <= vx) || (x >= (vx + vw))) + anchors_updated = EINA_TRUE; + + if (en->anchors_updated) + en->anchors_updated = anchors_updated; + _anchors_update(en->cursor, rp->object, en); + en->anchors_updated = anchors_updated; +} + +static void +_anchors_need_update(Edje_Real_Part *rp) +{ + Entry *en; + Eina_Bool anchors_updated; + + en = rp->typedata.text->entry_data; + anchors_updated = en->anchors_updated; + en->anchors_updated = EINA_FALSE; + _anchors_update(en->cursor, rp->object, en); + en->anchors_updated = anchors_updated; +} + +static void _anchors_clear(Evas_Textblock_Cursor *c EINA_UNUSED, Evas_Object *o EINA_UNUSED, Entry *en) { while (en->anchorlist) @@ -2671,7 +2712,7 @@ _edje_entry_real_part_configure(Edje *ed, Edje_Real_Part *rp) } _sel_update(ed, en->cursor, rp->object, en); - _anchors_update(en->cursor, rp->object, en); + _anchors_update_check(ed, rp); x = y = w = h = -1; xx = yy = ww = hh = -1; evas_object_geometry_get(rp->object, &x, &y, &w, &h); @@ -2914,6 +2955,9 @@ _edje_entry_anchor_geometry_get(Edje_Real_Part *rp, const char *anchor) (!rp->typedata.text)) return NULL; en = rp->typedata.text->entry_data; if (!en) return NULL; + /* Update the anchors first in case entry is not inside the canvas +* viewport */ + _anchors_need_update(rp); EINA_LIST_FOREACH(en->anchors, l, an) { const char *n = an->name; @@ -2935,6 +2979,9 @@ _edje_entry_anchors_list(Edje_Real_Part *rp) (!rp->typedata.text)) return NULL; en = rp->typedata.text->entry_data; if (!en) return NULL; + /* Update the anchors first in case entry is not inside the canvas +* viewport */ + _anchors_need_update(rp); if (!en->anchorlist) { EINA_LIST_
[EGIT] [core/elementary] elementary-1.14 01/01: [ELM] elm_toolbar: Use item sizing eval function.
hermet pushed a commit to branch elementary-1.14. http://git.enlightenment.org/core/elementary.git/commit/?id=d5e0d0076e932cc5d49728358b097a7a9f6d4238 commit d5e0d0076e932cc5d49728358b097a7a9f6d4238 Author: Subodh Kumar Date: Tue May 19 21:34:29 2015 +0900 [ELM] elm_toolbar: Use item sizing eval function. Summary: Item sizing evaluation function can be used instead of repeating the same code. Test Plan: NA Reviewers: herb, shilpasingh, cedric, Hermet Reviewed By: shilpasingh Subscribers: poornima.srinivasan Differential Revision: https://phab.enlightenment.org/D2486 --- src/lib/elm_toolbar.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/lib/elm_toolbar.c b/src/lib/elm_toolbar.c index 0087a0a..9d41844 100644 --- a/src/lib/elm_toolbar.c +++ b/src/lib/elm_toolbar.c @@ -1309,7 +1309,6 @@ _inform_item_number(Evas_Object *obj) char buf[sizeof("elm,number,item,") + 4]; static int scount = 0; int count = 0; - Evas_Coord mw, mh; EINA_INLIST_FOREACH(sd->items, it) { @@ -1327,12 +1326,7 @@ _inform_item_number(Evas_Object *obj) { edje_object_signal_emit(VIEW(it), buf, "elm"); edje_object_message_signal_process(VIEW(it)); - - mw = mh = -1; - elm_coords_finger_size_adjust(1, &mw, 1, &mh); - - edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw, mh); - evas_object_size_hint_min_set(VIEW(it), mw, mh); + _resizing_eval_item(it); } } } --
[EGIT] [core/efl] master 01/01: Evas textblock: Add underline height support
tasn pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=77e3ac7f82bacdf7da2251625e6badd3b5d2123e commit 77e3ac7f82bacdf7da2251625e6badd3b5d2123e Author: Subodh Kumar Date: Wed May 27 11:14:59 2015 +0100 Evas textblock: Add underline height support Summary: For showing text error like spell error thick underline is used hence added the underline height support. @feature Test Plan: test case added in evas textblock test. Reviewers: raster, shilpasingh, tasn Subscribers: govi, rajeshps, cedric Differential Revision: https://phab.enlightenment.org/D2531 TAsn comment: I wonder if the format should be renamed to underline_relheight instead of height. If you have any thoughts, please let me know. --- AUTHORS | 1 + src/lib/evas/canvas/evas_object_textblock.c | 24 +++- src/tests/evas/evas_test_textblock.c| 1 + 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/AUTHORS b/AUTHORS index ac070ec..eab2011 100644 --- a/AUTHORS +++ b/AUTHORS @@ -146,6 +146,7 @@ MinKyoung Kim Pierre Lamot Michelle Legrand Romain Perier +Subodh Kumar Ecore - diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 6cf2648..664df75 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -444,6 +444,7 @@ struct _Evas_Object_Textblock_Format int linegap; /**< Value to set the line gap in text. */ int underline_dash_width; /**< Valule to set the width of the underline dash. */ int underline_dash_gap; /**< Value to set the gap of the underline dash. */ + double underline_height; /**< Value to set the height of the single underline. */ double linerelsize; /**< Value to set the size of line of text. */ double linerelgap; /**< Value for setting line gap. */ double linefill; /**< The value must be a percentage. */ @@ -1130,6 +1131,7 @@ static const char *ellipsisstr = NULL; static const char *passwordstr = NULL; static const char *underline_dash_widthstr = NULL; static const char *underline_dash_gapstr = NULL; +static const char *underline_heightstr = NULL; /** * @page evas_textblock_style_page Evas Textblock Style Options @@ -1190,6 +1192,7 @@ _format_command_init(void) * @li @ref evas_textblock_style_password * @li @ref evas_textblock_style_underline_dash_width * @li @ref evas_textblock_style_underline_dash_gap + * @li @ref evas_textblock_style_underline_height * * @section evas_textblock_style_contents Contents */ @@ -1231,6 +1234,7 @@ _format_command_init(void) passwordstr = eina_stringshare_add("password"); underline_dash_widthstr = eina_stringshare_add("underline_dash_width"); underline_dash_gapstr = eina_stringshare_add("underline_dash_gap"); +underline_heightstr = eina_stringshare_add("underline_height"); } format_refcount++; } @@ -1282,6 +1286,7 @@ _format_command_shutdown(void) eina_stringshare_del(passwordstr); eina_stringshare_del(underline_dash_widthstr); eina_stringshare_del(underline_dash_gapstr); + eina_stringshare_del(underline_heightstr); } /** @@ -2317,6 +2322,21 @@ _format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt, const ch fmt->underline_dash_gap = atoi(param); if (fmt->underline_dash_gap <= 0) fmt->underline_dash_gap = 1; } + else if (cmd == underline_heightstr) + { +/** + * @page evas_textblock_style_page Evas Textblock Style Options + * + * @subsection evas_textblock_style_underline_height Underline height + * + * Sets the height of the single underline. The value should be a floating number. + * @code + * underline_height= + * @endcode + */ +fmt->underline_height = atof(param); +if (fmt->underline_height <= 0.0) fmt->underline_height = 1.0; + } } /** @@ -3000,6 +3020,7 @@ _layout_format_push(Ctxt *c, Evas_Object_Textblock_Format *fmt, fmt->linegap = 0; fmt->underline_dash_width = 6; fmt->underline_dash_gap = 2; +fmt->underline_height = 1.0; fmt->linerelgap = 0.0; fmt->password = 1; fmt->ellipsis = -1; @@ -11699,7 +11720,8 @@ evas_object_textblock_render(Evas_Object *eo_obj EINA_UNUSED, DRAW_FORMAT(strikethrough, (ln->h / 2), line_thickness); /* UNDERLINE */ -DRAW_FORMAT(underline, ln->baseline + line_position, line_thickness); +DRAW_FORMAT(underli