[EGIT] [core/efl] master 01/01: elm: refactor legacy _icon_signal_emit
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cf94110b0427def60e1398c6700a26da58db6364 commit cf94110b0427def60e1398c6700a26da58db6364 Author: Mike Blumenkrantz Date: Wed May 13 10:02:36 2020 -0400 elm: refactor legacy _icon_signal_emit Summary: this was duplicated for a number of widgets in slightly different ways, so it can be unified as a private layout function to reduce maintenance costs Reviewers: Hermet, YOhoho, Jaehyun_Cho, jsuya Reviewed By: jsuya Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11818 --- src/lib/elementary/efl_ui_button.c | 24 +++- src/lib/elementary/efl_ui_check.c | 26 +++--- src/lib/elementary/efl_ui_layout.c | 20 src/lib/elementary/efl_ui_progressbar.c | 23 +++ src/lib/elementary/efl_ui_radio.c | 25 +++-- src/lib/elementary/elm_priv.h | 1 + 6 files changed, 33 insertions(+), 86 deletions(-) diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 8f8e8a664f..d91b874422 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -394,24 +394,6 @@ _efl_ui_button_legacy_efl_object_constructor(Eo *obj, void *_pd EINA_UNUSED) return obj; } -/* FIXME: replicated from elm_layout just because button's icon spot - * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we - * can changed the theme API */ -static void -_icon_signal_emit(Evas_Object *obj) -{ - char buf[64]; - - if (!elm_widget_resize_object_get(obj)) return; - if (!edje_object_part_exists(obj, "elm.swallow.content")) return; - snprintf(buf, sizeof(buf), "elm,state,icon,%s", -elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); - - elm_layout_signal_emit(obj, buf, "elm"); - edje_object_message_signal_process(elm_layout_edje_get(obj)); - efl_canvas_group_change(obj); -} - /* FIXME: replicated from elm_layout just because button's icon spot * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we * can changed the theme API */ @@ -422,7 +404,7 @@ _efl_ui_button_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS)); if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; - if (efl_finalized_get(obj)) _icon_signal_emit(obj); + if (efl_finalized_get(obj)) _elm_layout_legacy_icon_signal_emit(obj); return int_ret; } @@ -438,7 +420,7 @@ _efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EIN int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), sobj); if (!int_ret) return EINA_FALSE; - _icon_signal_emit(obj); + _elm_layout_legacy_icon_signal_emit(obj); return EINA_TRUE; } @@ -454,7 +436,7 @@ _efl_ui_button_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *pa int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_BUTTON_LEGACY_CLASS), part), content); if (!int_ret) return EINA_FALSE; - _icon_signal_emit(obj); + _elm_layout_legacy_icon_signal_emit(obj); return EINA_TRUE; } diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c index cce98bf5a0..da51f880ce 100644 --- a/src/lib/elementary/efl_ui_check.c +++ b/src/lib/elementary/efl_ui_check.c @@ -450,26 +450,6 @@ _efl_ui_check_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) return obj; } -/* FIXME: replicated from elm_layout just because check's icon spot - * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we - * can changed the theme API */ -static void -_icon_signal_emit(Evas_Object *obj) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - char buf[64]; - - if (!elm_widget_resize_object_get(obj)) return; - if (!edje_object_part_exists(obj, "elm.swallow.content")) return; - snprintf(buf, sizeof(buf), "elm,state,icon,%s", -elm_layout_content_get(obj, "icon") ? "visible" : "hidden"); - - elm_layout_signal_emit(obj, buf, "elm"); - edje_object_message_signal_process(wd->resize_obj); - - efl_canvas_group_change(obj); -} - /* FIXME: replicated from elm_layout just because check's icon spot * is elm.swallow.content, not elm.swallow.icon. Fix that whenever we * can changed the theme API */ @@ -481,7 +461,7 @@ _efl_ui_check_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED) int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_CHECK_LEGACY_CLASS)); if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; - if (efl_finalized_get(obj)) _icon_signal_emi
[EGIT] [core/efl] master 01/02: build: fix void* use in pointer maths
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef3a09499f918d575493915fd80f0d6bb232fb88 commit ef3a09499f918d575493915fd80f0d6bb232fb88 Author: Mike Blumenkrantz Date: Tue May 12 16:55:59 2020 +0200 build: fix void* use in pointer maths Summary: void* is an invalid type for calculating pointer offsets, so ensure that this is always cast to something else (e.g., char*) in the few cases where it's been misused Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11816 --- src/lib/eina/eina_accessor.c | 12 ++-- .../ecore_evas/engines/wayland/ecore_evas_wayland_common.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/eina/eina_accessor.c b/src/lib/eina/eina_accessor.c index 67494987a9..812da5c9c1 100644 --- a/src/lib/eina/eina_accessor.c +++ b/src/lib/eina/eina_accessor.c @@ -205,20 +205,20 @@ struct _Eina_Accessor_CArray_Length static Eina_Bool eina_carray_length_accessor_get_at(Eina_Accessor_CArray_Length *accessor, unsigned int idx, void **data) { - if (accessor->array + idx*accessor->step >= accessor->end) + if ((char*)accessor->array + idx*accessor->step >= (char*)accessor->end) return EINA_FALSE; - memcpy(data, (void*) accessor->array + idx*accessor->step, accessor->step); + memcpy(data, (char*) accessor->array + idx*accessor->step, accessor->step); return EINA_TRUE; } static Eina_Bool eina_carray_length_accessor_ptr_get_at(Eina_Accessor_CArray_Length *accessor, unsigned int idx, void **data) { - if (accessor->array + idx*accessor->step >= accessor->end) + if ((char*)accessor->array + idx*accessor->step >= (char*)accessor->end) return EINA_FALSE; - *data = (((void*)accessor->array) + idx*accessor->step); + *data = (((char*)accessor->array) + idx*accessor->step); return EINA_TRUE; } @@ -246,7 +246,7 @@ eina_carray_length_accessor_new(void** array, unsigned int step, unsigned int le EINA_MAGIC_SET(>accessor, EINA_MAGIC_ACCESSOR); accessor->array = array; - accessor->end = accessor->array + length * step; + accessor->end = (void**)((char*)accessor->array + length * step); accessor->step = step; accessor->accessor.version = EINA_ACCESSOR_VERSION; @@ -269,7 +269,7 @@ eina_carray_length_ptr_accessor_new(void** array, unsigned int step, unsigned in EINA_MAGIC_SET(>accessor, EINA_MAGIC_ACCESSOR); accessor->array = array; - accessor->end = accessor->array + length * step; + accessor->end = (void**)((char*)accessor->array + length * step); accessor->step = step; accessor->accessor.version = EINA_ACCESSOR_VERSION; diff --git a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c index 4722663e38..bd1022e3e5 100644 --- a/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c +++ b/src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c @@ -2588,7 +2588,7 @@ _write_to_fd(void *data, Ecore_Fd_Handler *fd_handler) fd = ecore_main_fd_handler_fd_get(fd_handler); if (fd < 0) goto end; - len = write(fd, slice->slice.mem + slice->written_bytes, + len = write(fd, (char*)slice->slice.mem + slice->written_bytes, slice->slice.len - slice->written_bytes); slice->written_bytes += len; --
[EGIT] [core/efl] master 02/02: build: enable -Wpointer-arith for dev builds
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=568359366985066b3346df0d1161d4c9cdd062cd commit 568359366985066b3346df0d1161d4c9cdd062cd Author: Mike Blumenkrantz Date: Tue May 12 16:56:01 2020 +0200 build: enable -Wpointer-arith for dev builds Summary: this is a useful warning to avoid errors when calculating pointer offsets Depends on D11816 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11817 --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 9924670a73..b55855920c 100644 --- a/meson.build +++ b/meson.build @@ -76,6 +76,7 @@ dev_cflags_try = [ '-fvisibility=hidden', '-Wall', '-Wfloat-compare', + '-Wpointer-arith', '-Wunused-parameter', '-Wsign-compare', '-Wno-missing-field-initializers', --
[EGIT] [core/efl] master 06/08: edje: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b4749dc6abb5e08ba9e53a28625e28cac014be18 commit b4749dc6abb5e08ba9e53a28625e28cac014be18 Author: Mike Blumenkrantz Date: Tue May 12 09:21:26 2020 +0200 edje: resolve float compare warnings Summary: Depends on D11797 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11798 --- src/lib/edje/edje_box_layout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_box_layout.c b/src/lib/edje/edje_box_layout.c index a3458cf281..51a91701b3 100644 --- a/src/lib/edje/edje_box_layout.c +++ b/src/lib/edje/edje_box_layout.c @@ -108,7 +108,7 @@ _edje_box_layout(Evas_Object *obj, Evas_Object_Box_Data *priv, void *data) { Edje_Part_Box_Animation *anim = data; - if (anim->progress == 0.0) + if (EINA_DBL_EQ(anim->progress, 0.0)) { if (anim->start.layout) { @@ -195,7 +195,7 @@ _edje_box_recalc_apply(Edje *ed EINA_UNUSED, Edje_Real_Part *ep, Edje_Calc_Param ep->typedata.container->anim->end.layout = NULL; } - if (ep->description_pos == 0.0 || !ep->typedata.container->anim->start.layout) + if (EINA_DBL_EQ(ep->description_pos, 0.0) || !ep->typedata.container->anim->start.layout) { _edje_box_layout_find_all(chosen_desc->box.layout, chosen_desc->box.alt_layout, >typedata.container->anim->start.layout, >typedata.container->anim->start.data, >typedata.container->anim->start.free_data); ep->typedata.container->anim->start.padding.x = chosen_desc->box.padding.x; --
[EGIT] [core/efl] master 08/08: build: enable -Wfloat-compare by default for dev builds
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6417b35ad46060f5ad5ebb42a19409d67e785714 commit 6417b35ad46060f5ad5ebb42a19409d67e785714 Author: Mike Blumenkrantz Date: Tue May 12 09:21:52 2020 +0200 build: enable -Wfloat-compare by default for dev builds Summary: Depends on D11799 Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11800 --- meson.build | 1 + 1 file changed, 1 insertion(+) diff --git a/meson.build b/meson.build index 0c30d5d042..9924670a73 100644 --- a/meson.build +++ b/meson.build @@ -75,6 +75,7 @@ dev_cflags = [] dev_cflags_try = [ '-fvisibility=hidden', '-Wall', + '-Wfloat-compare', '-Wunused-parameter', '-Wsign-compare', '-Wno-missing-field-initializers', --
[EGIT] [core/efl] master 04/08: examples: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d5b119a30a27eae27a9f85b5a818bd8608aa65ff commit d5b119a30a27eae27a9f85b5a818bd8608aa65ff Author: Mike Blumenkrantz Date: Tue May 12 09:21:09 2020 +0200 examples: resolve float compare warnings Summary: Depends on D11795 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11796 --- src/examples/edje/edje-basic.c| 6 +++--- src/examples/eldbus/client.c | 2 +- src/examples/elementary/bg_example_03.c | 8 src/examples/elementary/progressbar_example.c | 2 +- src/examples/elementary/transit_example_03.c | 8 src/examples/evas/efl-canvas-vg-simple.c | 2 +- src/examples/evas/evas-box.c | 8 src/examples/evas/evas-gl.c | 2 +- src/examples/evas/evas-vg-batman.c| 2 +- src/examples/evas/evas-vg-simple.c| 2 +- 10 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/examples/edje/edje-basic.c b/src/examples/edje/edje-basic.c index 4d56680dcb..55df12ad05 100644 --- a/src/examples/edje/edje-basic.c +++ b/src/examples/edje/edje-basic.c @@ -60,7 +60,7 @@ _on_keydown(void*data, printf("got scale %f\n", scale); -if (scale != 1.0) scale = 1.0; +if (!EINA_DBL_EQ(scale, 1.0)) scale = 1.0; else scale = 2.0; edje_scale_set(scale); @@ -75,8 +75,8 @@ _on_keydown(void*data, printf("got scale %f\n", scale); -if (!scale) scale = 1.0; -else if (scale == 1.0) scale = 2.0; +if (EINA_DBL_EQ(scale, 0)) scale = 1.0; +else if (EINA_DBL_EQ(scale, 1.0)) scale = 2.0; else scale = 0.0; edje_object_scale_set(edje_obj, scale); diff --git a/src/examples/eldbus/client.c b/src/examples/eldbus/client.c index fe8391f579..9bf71f433c 100644 --- a/src/examples/eldbus/client.c +++ b/src/examples/eldbus/client.c @@ -219,7 +219,7 @@ _on_send_double(void *data EINA_UNUSED, const Eldbus_Message *msg, Eldbus_Pendin return; } - if (d != expected.d) + if (!EINA_DBL_EQ(d, expected.d)) { ERR("Double value doesn't match expected value"); return; diff --git a/src/examples/elementary/bg_example_03.c b/src/examples/elementary/bg_example_03.c index 5337d3426a..32ba3ed6f5 100644 --- a/src/examples/elementary/bg_example_03.c +++ b/src/examples/elementary/bg_example_03.c @@ -39,13 +39,13 @@ _cb_color_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED) double val = 0.0; val = elm_spinner_value_get(obj); - if (val == 1.0) + if (EINA_DBL_EQ(val, 1.0)) elm_bg_color_set(o_bg, 255, 255, 255); - else if (val == 2.0) + else if (EINA_DBL_EQ(val, 2.0)) elm_bg_color_set(o_bg, 255, 0, 0); - else if (val == 3.0) + else if (EINA_DBL_EQ(val, 3.0)) elm_bg_color_set(o_bg, 0, 0, 255); - else if (val == 4.0) + else if (EINA_DBL_EQ(val, 4.0)) elm_bg_color_set(o_bg, 0, 255, 0); } diff --git a/src/examples/elementary/progressbar_example.c b/src/examples/elementary/progressbar_example.c index f6d2538dc0..c33b049959 100644 --- a/src/examples/elementary/progressbar_example.c +++ b/src/examples/elementary/progressbar_example.c @@ -117,7 +117,7 @@ _on_changed(void*data, Evas_Object *label = (Evas_Object *)data; val = elm_progressbar_value_get(obj); - if (val == 0) + if (EINA_DBL_EQ(val, 0)) { tstart = 0; elm_object_text_set(label, "ETA: N/A"); diff --git a/src/examples/elementary/transit_example_03.c b/src/examples/elementary/transit_example_03.c index a183201350..cea2d5b624 100644 --- a/src/examples/elementary/transit_example_03.c +++ b/src/examples/elementary/transit_example_03.c @@ -152,13 +152,13 @@ _cb_tween_changed(void *data, Evas_Object *obj, void *event EINA_UNUSED) double val = 0.0; val = elm_spinner_value_get(obj); - if (val == 1.0) + if (EINA_DBL_EQ(val, 1.0)) *mode = ELM_TRANSIT_TWEEN_MODE_LINEAR; - else if (val == 2.0) + else if (EINA_DBL_EQ(val, 2.0)) *mode = ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL; - else if (val == 3.0) + else if (EINA_DBL_EQ(val, 3.0)) *mode = ELM_TRANSIT_TWEEN_MODE_DECELERATE; - else if (val == 4.0) + else if (EINA_DBL_EQ(val, 4.0)) *mode = ELM_TRANSIT_TWEEN_MODE_ACCELERATE; } diff --git a/src/examples/evas/efl-canvas-vg-simple.c b/src/examples/evas/efl-canvas-vg-simple.c index 79a9645890..15d74aea86 100644 --- a/src/examples/evas/efl-canvas-vg-simple.c +++ b/src/examples/evas/efl-canvas-vg-simple.c @@ -411,7 +411,7 @@ _interpolation_keyframe(void *data EINA_UNUSED, double pos) eina_list_nth(d.shape_list, next), ecore_animator_pos_map(pos, ECORE_POS_MAP_SINUSOIDAL, 0.0, 0.0)); - if (
[EGIT] [core/efl] master 01/08: evas: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=235ba0e407ae1e14684da5d0d66641564d755ae2 commit 235ba0e407ae1e14684da5d0d66641564d755ae2 Author: Mike Blumenkrantz Date: Tue May 12 09:20:42 2020 +0200 evas: resolve float compare warnings Summary: Depends on D11792 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11793 --- src/lib/evas/canvas/evas_events.c | 20 +++ src/lib/evas/canvas/evas_object_textblock.c| 30 -- src/lib/evas/common/evas_map_image_internal_high.c | 6 ++--- .../gesture/efl_canvas_gesture_recognizer_flick.c | 2 +- .../gesture/efl_canvas_gesture_recognizer_zoom.c | 2 +- src/lib/evas/vg/evas_vg_cache.c| 2 +- src/modules/evas/vg_savers/svg/evas_vg_save_svg.c | 2 +- 7 files changed, 34 insertions(+), 30 deletions(-) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index ff080eb913..0a1f1b460f 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -815,7 +815,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, ev->action = EFL_POINTER_ACTION_IN; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_IN, evt, event_id2, EFL_EVENT_POINTER_IN); -if ((cur_pt.x != prev_pt.x) || (cur_pt.y != prev_pt.y)) +if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_MOVE, evt, @@ -1368,7 +1368,7 @@ _evas_event_source_mouse_in_events(Evas_Object *eo_obj, Evas *eo_e, ev->action = EFL_POINTER_ACTION_IN; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_IN, evt, event_id, EFL_EVENT_POINTER_IN); - if ((cur_pt.x != prev_pt.x) || (cur_pt.y != prev_pt.y)) + if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_MOVE, evt, @@ -2350,7 +2350,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_walk(e); /* update moved touch point */ - if ((prev_pt.x != cur_pt.x) || (prev_pt.y != cur_pt.y)) + if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) _evas_touch_point_update(eo_e, 0, pdata->seat->x, pdata->seat->y, EVAS_TOUCH_POINT_MOVE); /* if our mouse button is grabbed to any objects */ if (pdata->seat->mouse_grabbed > 0) @@ -2387,7 +2387,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da ev->cur = cur_pt; ev->prev = prev_pt; - if ((prev_pt.x != cur_pt.x) || (prev_pt.y != cur_pt.y)) + if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) { _evas_event_havemap_adjust_f(obj, >cur, >prev, obj_pdata->mouse_grabbed); @@ -2485,7 +2485,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da _evas_event_object_pointer_allow_precise(eo_obj, obj, ev->cur.x, ev->cur.y, ins) && (obj_pdata->mouse_grabbed || !evas_object_is_source_invisible(eo_obj, obj))) { - if ((prev_pt.x != cur_pt.x) || (prev_pt.y != cur_pt.y)) + if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_MOVE, evt, @@ -2540,7 +2540,7 @@ _canvas_event_feed_mouse_move_internal(Evas_Public_Data *e, Efl_Input_Pointer_Da ev->action = EFL_POINTER_ACTION_IN; evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOUSE_IN, evt, event_id, EFL_EVENT_POINTER_IN); - if ((prev_pt.x != cur_pt.x) || (prev_pt.y != cur_pt.y)) + if (!EINA_DBL_EQ(cur_pt.x, prev_pt.x) || !EINA_DBL_EQ(cur_pt.y, prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call
[EGIT] [core/efl] master 05/08: exactness: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=06258d3177d49990749ee59142cb669fd307dfc3 commit 06258d3177d49990749ee59142cb669fd307dfc3 Author: Mike Blumenkrantz Date: Tue May 12 09:21:17 2020 +0200 exactness: resolve float compare warnings Summary: Depends on D11796 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11797 --- src/bin/exactness/player.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/exactness/player.c b/src/bin/exactness/player.c index b35637f25c..44b3f36303 100644 --- a/src/bin/exactness/player.c +++ b/src/bin/exactness/player.c @@ -801,7 +801,7 @@ _src_open() last_action_type = act->type; } } -if (_speed && _speed != 1) +if (EINA_DBL_NONZERO(_speed) && (!EINA_DBL_EQ(_speed, 1))) { EINA_LIST_FOREACH(_src_unit->actions, itr, act) act->delay_ms /= _speed; --
[EGIT] [core/efl] master 03/08: evas/gl: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e893d1ab7e770b2d1df75a730a3778480c079033 commit e893d1ab7e770b2d1df75a730a3778480c079033 Author: Mike Blumenkrantz Date: Tue May 12 09:21:00 2020 +0200 evas/gl: resolve float compare warnings Summary: Depends on D11794 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11795 --- src/modules/evas/engines/gl_common/evas_gl_api.c | 12 ++-- src/modules/evas/engines/gl_common/evas_gl_api_gles1.c | 10 +- src/modules/evas/engines/gl_common/evas_gl_context.c | 5 ++--- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/modules/evas/engines/gl_common/evas_gl_api.c b/src/modules/evas/engines/gl_common/evas_gl_api.c index d66393b1e8..e33613a8bb 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api.c @@ -546,15 +546,15 @@ _evgl_glClear(GLbitfield mask) if (ctx->current_sfc->alpha && !rsc->direct.render_op_copy && (mask & GL_COLOR_BUFFER_BIT)) { - if ((rsc->clear_color.a == 0) && - (rsc->clear_color.r == 0) && - (rsc->clear_color.g == 0) && - (rsc->clear_color.b == 0)) + if (EINA_DBL_EQ(rsc->clear_color.a, 0) && + EINA_DBL_EQ(rsc->clear_color.r, 0) && + EINA_DBL_EQ(rsc->clear_color.g, 0) && + EINA_DBL_EQ(rsc->clear_color.b, 0)) { // Skip clear color as we don't want to write black mask &= ~GL_COLOR_BUFFER_BIT; } - else if (rsc->clear_color.a != 1.0) + else if (!EINA_DBL_EQ(rsc->clear_color.a, 1.0)) { // TODO: Draw a rectangle? This will never be the perfect solution though. WRN("glClear() used with a semi-transparent color and direct rendering. " @@ -1115,7 +1115,7 @@ _evgl_glGetFloatv(GLenum pname, GLfloat* params) if (ctx->current_read_fbo == 0) { glGetFloatv(pname, params); - if (*params == GL_COLOR_ATTACHMENT0) + if (EINA_DBL_EQ(*params, GL_COLOR_ATTACHMENT0)) { *params = (GLfloat)GL_BACK; return; diff --git a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c index 3e2188dfbe..c48234f55b 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c +++ b/src/modules/evas/engines/gl_common/evas_gl_api_gles1.c @@ -544,15 +544,15 @@ _evgl_gles1_glClear(GLbitfield mask) */ if (ctx->current_sfc->alpha && (mask & GL_COLOR_BUFFER_BIT)) { - if ((rsc->clear_color.a == 0) && - (rsc->clear_color.r == 0) && - (rsc->clear_color.g == 0) && - (rsc->clear_color.b == 0)) + if (EINA_DBL_EQ(rsc->clear_color.a, 0) && + EINA_DBL_EQ(rsc->clear_color.r, 0) && + EINA_DBL_EQ(rsc->clear_color.g, 0) && + EINA_DBL_EQ(rsc->clear_color.b, 0)) { // Skip clear color as we don't want to write black mask &= ~GL_COLOR_BUFFER_BIT; } - else if (rsc->clear_color.a != 1.0) + else if (EINA_DBL_EQ(rsc->clear_color.a, 1.0)) { // TODO: Draw a rectangle? This will never be the perfect solution though. WRN("glClear() used with a semi-transparent color and direct rendering. " diff --git a/src/modules/evas/engines/gl_common/evas_gl_context.c b/src/modules/evas/engines/gl_common/evas_gl_context.c index bf88cbdaf0..40d9f98a22 100644 --- a/src/modules/evas/engines/gl_common/evas_gl_context.c +++ b/src/modules/evas/engines/gl_common/evas_gl_context.c @@ -1719,8 +1719,7 @@ _push_mask(Evas_Engine_GL_Context *gc, const int pn, int nm, Evas_GL_Texture *mt int mx, int my, int mw, int mh, Shader_Sampling msam, int nms) { double glmx, glmy, glmw, glmh, yinv = -1.f; - double gw = gc->w, gh = gc->h; - int i, cnt = 6; + int gw = gc->w, gh = gc->h, i, cnt = 6; if (!((gc->pipe[0].shader.surface == gc->def_surface) || (!gc->pipe[0]
[EGIT] [core/efl] master 07/08: static/triangulator: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=500e762d64598dcd0286e32876654e407c0309f3 commit 500e762d64598dcd0286e32876654e407c0309f3 Author: Mike Blumenkrantz Date: Tue May 12 09:21:35 2020 +0200 static/triangulator: resolve float compare warnings Summary: Depends on D11798 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11799 --- src/static_libs/triangulator/triangulator_stroker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/static_libs/triangulator/triangulator_stroker.c b/src/static_libs/triangulator/triangulator_stroker.c index cf07bec5a3..12847cb51a 100644 --- a/src/static_libs/triangulator/triangulator_stroker.c +++ b/src/static_libs/triangulator/triangulator_stroker.c @@ -409,8 +409,8 @@ _end_cap_or_join_closed(Triangulator_Stroker *stroker, static inline void _skip_duplicate_points(const double **pts, const double *end_pts) { - while ((*pts + 2) < end_pts && (*pts)[0] == (*pts)[2] && - EINA_FLT_EQ((*pts)[1], (*pts)[3])) + while ((*pts + 2) < end_pts && EINA_DBL_EQ((*pts)[0], (*pts)[2]) && + EINA_DBL_EQ((*pts)[1], (*pts)[3])) { *pts += 2; } --
[EGIT] [core/efl] master 02/08: evas/filter: resolve float compare warnings
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=71dcddd6486956382d2606c3e8e75a2e745d2433 commit 71dcddd6486956382d2606c3e8e75a2e745d2433 Author: Mike Blumenkrantz Date: Tue May 12 09:20:50 2020 +0200 evas/filter: resolve float compare warnings Summary: Depends on D11793 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11794 --- src/lib/evas/filters/evas_filter.c | 6 +++--- .../evas/engines/gl_generic/filters/gl_filter_blur.c | 9 ++--- .../engines/software_generic/filters/evas_filter_blur.c | 16 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/lib/evas/filters/evas_filter.c b/src/lib/evas/filters/evas_filter.c index a35ad8131f..912e8c6882 100644 --- a/src/lib/evas/filters/evas_filter.c +++ b/src/lib/evas/filters/evas_filter.c @@ -821,7 +821,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx, } #endif - if (dx && dy) + if (EINA_DBL_NONZERO(dx) && EINA_DBL_NONZERO(dy)) { tmp = evas_filter_temporary_buffer_get(ctx, dx_in->w, dx_in->h, in->alpha_only, 1); if (!tmp) goto fail; @@ -833,7 +833,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx, dy_in = in; } - if (dx) + if (EINA_DBL_NONZERO(dx)) { XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dx_in->id, dx_out->id, dx, 0.0); cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dx_in, NULL, dx_out); @@ -844,7 +844,7 @@ evas_filter_command_blur_add_gl(Evas_Filter_Context *ctx, cmd->draw.alphaonly = alphaonly; } - if (dy) + if (EINA_DBL_NONZERO(dy)) { XDBG("Add GL blur %d -> %d (%.2fx%.2f px)", dy_in->id, dy_out->id, 0.0, dy); cmd = _command_new(ctx, EVAS_FILTER_MODE_BLUR, dy_in, NULL, dy_out); diff --git a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c index 21b78198e1..875d1baaf1 100644 --- a/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c +++ b/src/modules/evas/engines/gl_generic/filters/gl_filter_blur.c @@ -145,7 +145,10 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd) s_h = cmd->input->h; d_w = cmd->output->w; d_h = cmd->output->h; - EINA_SAFETY_ON_FALSE_RETURN_VAL(s_w && s_h && d_w && d_h, EINA_FALSE); + EINA_SAFETY_ON_FALSE_RETURN_VAL( + EINA_DBL_NONZERO(s_w) && EINA_DBL_NONZERO(s_h) && EINA_DBL_NONZERO(d_w) && EINA_DBL_NONZERO(d_h), + EINA_FALSE + ); gc = gl_generic_context_find(re, 1); @@ -157,7 +160,7 @@ _gl_filter_blur(Render_Engine_GL_Generic *re, Evas_Filter_Command *cmd) evas_gl_common_context_target_surface_set(gc, surface); - if (cmd->blur.dx) + if (EINA_DBL_NONZERO(cmd->blur.dx)) { horiz = EINA_TRUE; radius = cmd->blur.dx; @@ -274,7 +277,7 @@ gl_filter_blur_func_get(Render_Engine_GL_Generic *re EINA_UNUSED, Evas_Filter_Co EINA_SAFETY_ON_NULL_RETURN_VAL(cmd->input, NULL); // 1D blurs only, radius != 0 - EINA_SAFETY_ON_FALSE_RETURN_VAL((!cmd->blur.dx) ^ (!cmd->blur.dy), NULL); + EINA_SAFETY_ON_FALSE_RETURN_VAL(!EINA_DBL_EQ(cmd->blur.dx, 0) ^ !EINA_DBL_EQ(cmd->blur.dy, 0), NULL); return _gl_filter_blur; } diff --git a/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c b/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c index 89d20e2ba6..c5617d0096 100644 --- a/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c +++ b/src/modules/evas/engines/software_generic/filters/evas_filter_blur.c @@ -469,32 +469,32 @@ eng_filter_blur_func_get(Evas_Filter_Command *cmd) case EVAS_FILTER_BLUR_BOX: if (!cmd->output->alpha_only) { - if (cmd->blur.dx) + if (EINA_DBL_NONZERO(cmd->blur.dx)) return _box_blur_horiz_apply_rgba; - else if (cmd->blur.dy) + else if (EINA_DBL_NONZERO(cmd->blur.dy)) return _box_blur_vert_apply_rgba; } else { - if (cmd->blur.dx) + if (EINA_DBL_NONZERO(cmd->blur.dx)) return _box_blur_horiz_apply_alpha; - else if (cmd->blur.dy) + else if (EINA_DBL_NONZERO(cmd->blur.dy)) return _box_blur_vert_apply_alpha; } break; case EVAS_FILTER_BLUR_GAUSSIAN: if (!cmd->output->alpha_only) { - if (cmd->blur.dx) + if (EINA_DBL_NONZERO(cmd->blur.dx)) return _gaussian_blur_horiz_apply_rgba; - else
[EGIT] [core/efl] master 07/07: evas/events: fix conditional for emitting source mouse move events
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=27630114ef034ca15711d8565e4777a1519a7cd6 commit 27630114ef034ca15711d8565e4777a1519a7cd6 Author: Mike Blumenkrantz Date: Sat May 9 09:25:27 2020 +0100 evas/events: fix conditional for emitting source mouse move events Summary: this should match all other similar cases when determining whether to emit the event by checking whether at least one coord has changed, not both Depends on D11791 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: raster, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11792 --- src/lib/evas/canvas/evas_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 4596a26419..ff080eb913 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -815,7 +815,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, ev->action = EFL_POINTER_ACTION_IN; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_IN, evt, event_id2, EFL_EVENT_POINTER_IN); -if ((cur_pt.x != prev_pt.x) && (cur_pt.y != prev_pt.y)) +if ((cur_pt.x != prev_pt.x) || (cur_pt.y != prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_MOVE, evt, --
[EGIT] [core/efl] efl-1.24 04/07: tests: resolve float comparison warnings
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=d0209836b441df980feec4a7182a4e94861510a1 commit d0209836b441df980feec4a7182a4e94861510a1 Author: Mike Blumenkrantz Date: Sat May 9 09:25:14 2020 +0100 tests: resolve float comparison warnings Summary: Depends on D11788 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11789 --- src/tests/ecore/ecore_test_animator.c | 4 +- src/tests/ecore/ecore_test_ecore_audio.c | 46 ++--- src/tests/ecore/ecore_test_timer.c | 4 +- src/tests/ecore_con/ecore_con_test_ecore_con.c | 4 +- src/tests/eet/eet_test_common.c| 12 ++-- src/tests/eet/eet_test_data.c | 12 ++-- src/tests/eet/eet_test_file.c | 10 +-- src/tests/eina/eina_test_bezier.c | 42 ++-- src/tests/eina/eina_test_quaternion.c | 24 +++ src/tests/eina/eina_test_vector.c | 76 +++--- src/tests/elementary/efl_ui_test_config.c | 10 ++- src/tests/elementary/efl_ui_test_spin_button.c | 4 +- src/tests/elementary/efl_ui_test_spotlight.c | 8 +-- .../elementary/spec/efl_test_gfx_arrangement.c | 4 +- src/tests/elementary/spec/efl_test_range_display.c | 30 - .../elementary/spec/efl_test_range_interactive.c | 8 +-- src/tests/eolian/eolian_parsing.c | 2 +- src/tests/evas/efl_canvas_animation.c | 2 +- src/tests/evas/evas_test_filters.c | 2 +- src/tests/evas/evas_test_text.c| 2 +- src/tests/evas/evas_test_textblock.c | 10 +-- 21 files changed, 162 insertions(+), 154 deletions(-) diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c index 271f9792ef..d69407bc1e 100644 --- a/src/tests/ecore/ecore_test_animator.c +++ b/src/tests/ecore/ecore_test_animator.c @@ -15,7 +15,7 @@ static Eina_Bool _anim_cb(void *data EINA_UNUSED, double pos) fail_if(prev > pos); prev = pos; - if (pos == 1.0) + if (EINA_DBL_EQ(pos, 1.0)) ecore_main_loop_quit(); return EINA_TRUE; @@ -59,7 +59,7 @@ Eina_Bool test_pos(Ecore_Pos_Map posmap, double v1, double v2, double (*testmap) return EINA_FALSE; } } - fail_if(ecore_animator_pos_map(1.0, posmap, v1, v2) != 1.0); + fail_if(!EINA_DBL_EQ(ecore_animator_pos_map(1.0, posmap, v1, v2), 1.0)); return EINA_TRUE; } diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index 9c8a890945..6521871358 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -148,16 +148,16 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_tone) rate = ecore_audio_obj_in_samplerate_get(in); fail_if(rate != 44100); len = ecore_audio_obj_in_length_get(in); - fail_if(len != 1); + fail_if(!EINA_DBL_EQ(len, 1)); ecore_audio_obj_in_length_set(in, 2.5); len = ecore_audio_obj_in_length_get(in); - fail_if(len != 2.5); + fail_if(!EINA_DBL_EQ(len, 2.5)); ecore_audio_obj_in_looped_set(in, EINA_TRUE); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 2.5); + fail_if(!EINA_DBL_EQ(len, 2.5)); freq = (intptr_t) efl_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ); fail_if(freq != 1000); @@ -173,28 +173,28 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_tone) ck_assert_str_eq(tmp, "bar"); len = ecore_audio_obj_in_seek(in, 5.0, SEEK_SET); - fail_if(len != -1); + fail_if(!EINA_DBL_EQ(len, -1)); len = ecore_audio_obj_in_seek(in, 1.0, 42); - fail_if(len != -1); + fail_if(!EINA_DBL_EQ(len, -1)); len = ecore_audio_obj_in_seek(in, 1.0, SEEK_SET); - fail_if(len != 1.0); + fail_if(!EINA_DBL_EQ(len, 1.0)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 1.5); + fail_if(!EINA_DBL_EQ(len, 1.5)); len = ecore_audio_obj_in_seek(in, 1.0, SEEK_CUR); - fail_if(len != 2.0); + fail_if(!EINA_DBL_EQ(len, 2.0)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 0.5); + fail_if(!EINA_DBL_EQ(len, 0.5)); len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END); - fail_if(len != 1.5); + fail_if(!EINA_DBL_EQ(len, 1.5)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 1.0); + fail_if(!EINA_DBL_EQ(len, 1.0)); out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); fail_if(!out); @@ -260,18 +260,18 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_sndfile) rate = ecore_audio_obj_in_samplerate_get(in); fail_if(rate != 44100); len = ecore_audio_obj_in_length_get(in); - fail_if(len == 0); + fail_if(EINA_DBL_EQ(len, 0)); rem = ecore_audio_obj_in_remaining_get(in); - fail_if(len != rem); + fail_if(!EINA_DBL_EQ(len, rem
[EGIT] [core/efl] master 05/07: bin/elm: resolve float compare warnings
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c323199f3c8332b5a3794e93a46007273c0451b9 commit c323199f3c8332b5a3794e93a46007273c0451b9 Author: Mike Blumenkrantz Date: Sat May 9 09:25:17 2020 +0100 bin/elm: resolve float compare warnings Summary: Depends on D11789 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11790 --- src/bin/elementary/config.c| 102 ++--- src/bin/elementary/elm_prefs_cc_parse.c| 4 +- src/bin/elementary/test_gesture_layer3.c | 6 +- src/bin/elementary/test_glview_manygears.c | 2 +- src/bin/elementary/test_map.c | 2 +- src/bin/elementary/test_photocam.c | 2 +- src/bin/elementary/test_tooltip.c | 2 +- 7 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c index 71309ecf2a..17d1376f54 100644 --- a/src/bin/elementary/config.c +++ b/src/bin/elementary/config.c @@ -213,7 +213,7 @@ bf_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -224,7 +224,7 @@ bf_change(void *data EINA_UNUSED, double bf = elm_config_scroll_bounce_friction_get(); double val = elm_slider_value_get(obj); - if (bf == val) return; + if (EINA_DBL_EQ(bf, val)) return; elm_config_scroll_bounce_friction_set(val); elm_config_all_flush(); } @@ -238,7 +238,7 @@ ps_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -249,7 +249,7 @@ ps_change(void *data EINA_UNUSED, double ps = elm_config_scroll_page_scroll_friction_get(); double val = elm_slider_value_get(obj); - if (ps == val) return; + if (EINA_DBL_EQ(ps, val)) return; elm_config_scroll_page_scroll_friction_set(val); elm_config_all_flush(); } @@ -263,7 +263,7 @@ bis_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -274,7 +274,7 @@ bis_change(void *data EINA_UNUSED, double bis = elm_config_scroll_bring_in_scroll_friction_get(); double val = elm_slider_value_get(obj); - if (bis == val) return; + if (EINA_DBL_EQ(bis, val)) return; elm_config_scroll_bring_in_scroll_friction_set(val); elm_config_all_flush(); } @@ -288,7 +288,7 @@ zf_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -299,7 +299,7 @@ zf_change(void *data EINA_UNUSED, double zf = elm_config_scroll_zoom_friction_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_zoom_friction_set(val); elm_config_all_flush(); } @@ -313,7 +313,7 @@ smooth_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 100.0))) / 100.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -324,7 +324,7 @@ smooth_change(void *data EINA_UNUSED, double zf = elm_config_scroll_thumbscroll_smooth_amount_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_thumbscroll_smooth_amount_set(val); elm_config_all_flush(); } @@ -338,7 +338,7 @@ smooth_win_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 100.0))) / 100.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -349,7 +349,7 @@ smooth_win_change(void *data EINA_UNUSED, double zf = elm_config_scroll_thumbscroll_smooth_time_window_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_thumbscroll_smooth_time_window_set(val); elm_config_all_flush(); } @@ -378,7 +378,7 @@ tst_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -389,7 +389,7 @@ tst_change(void *data EINA_UNUSED, double tst = elm_config_scroll_thumbscroll_threshold_get(); double val = elm_slider_value_get(obj); - if (tst == val) return
[EGIT] [core/efl] master 06/07: elm: resolve float comparison warnings
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=823b7b05cd233d052fd92d2b1e275dd244863f17 commit 823b7b05cd233d052fd92d2b1e275dd244863f17 Author: Mike Blumenkrantz Date: Sat May 9 09:25:21 2020 +0100 elm: resolve float comparison warnings Summary: Depends on D11790 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11791 --- src/edje_external/elementary/elm_notify.c | 18 +- src/lib/elementary/efl_ui_flip.c | 4 +-- src/lib/elementary/efl_ui_image_zoomable.c | 2 +- src/lib/elementary/efl_ui_progressbar.c| 4 +-- src/lib/elementary/efl_ui_scroll_manager.c | 2 +- src/lib/elementary/efl_ui_slider.c | 8 ++--- src/lib/elementary/efl_ui_slider_interval.c| 6 ++-- src/lib/elementary/efl_ui_spotlight_container.c| 4 +-- .../elementary/efl_ui_spotlight_plain_manager.c| 2 +- src/lib/elementary/efl_ui_textpath.c | 12 +++ src/lib/elementary/efl_ui_vg_animation.c | 24 ++--- src/lib/elementary/efl_ui_widget.c | 6 ++-- src/lib/elementary/efl_ui_win.c| 6 ++-- src/lib/elementary/elm_atspi_bridge.c | 2 +- src/lib/elementary/elm_code_widget.c | 6 ++-- src/lib/elementary/elm_colorselector.c | 16 - src/lib/elementary/elm_config.c| 14 src/lib/elementary/elm_dnd.c | 2 +- src/lib/elementary/elm_flipselector.c | 8 ++--- src/lib/elementary/elm_gengrid.c | 2 +- src/lib/elementary/elm_gesture_layer.c | 2 +- src/lib/elementary/elm_interface_scrollable.c | 14 src/lib/elementary/elm_map.c | 2 +- src/lib/elementary/elm_notify.c| 40 +++--- src/lib/elementary/elm_slider.c| 2 +- src/lib/elementary/elm_slideshow.c | 2 +- src/lib/elementary/elm_spinner.c | 30 src/lib/elementary/elm_toolbar.c | 4 +-- src/lib/elementary/elm_transit.c | 8 ++--- src/lib/elementary/els_box.c | 6 ++-- src/lib/elementary/els_tooltip.c | 8 ++--- 31 files changed, 134 insertions(+), 132 deletions(-) diff --git a/src/edje_external/elementary/elm_notify.c b/src/edje_external/elementary/elm_notify.c index 801bfe473f..7f0cd1d9f6 100644 --- a/src/edje_external/elementary/elm_notify.c +++ b/src/edje_external/elementary/elm_notify.c @@ -39,23 +39,23 @@ _elm_notify_orient_get(const Evas_Object *obj) elm_notify_align_get(obj, , ); - if ((horizontal == 0.5) && (vertical == 0.0)) + if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP; - else if ((horizontal == 0.5) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_CENTER; - else if ((horizontal == 0.5) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM; - else if ((horizontal == 0.0) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_LEFT; - else if ((horizontal == 1.0) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_RIGHT; - else if ((horizontal == 0.0) && (vertical == 0.0)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP_LEFT; - else if ((horizontal == 1.0) && (vertical == 0.0)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP_RIGHT; - else if ((horizontal == 0.0) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT; - else if ((horizontal == 1.0) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT; else orient = ELM_NOTIFY_ORIENT_TOP; diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 26f8d848bf..da2284ccfb 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -536,7 +536,7 @@ _state_update(Evas_Object *obj) if (mx < 1) mx = 1; // quick hack to keep curl line visible - if (mgrad == 0.0) // special horizontal case + if (EINA_DBL_EQ(mgrad, 0.0)) // special horizontal case mgrad = 0.001;
[EGIT] [core/efl] efl-1.24 01/07: eina: resolve float comparison warnings
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=499fd1808c36597e0079a74b2d73af77ee20ba41 commit 499fd1808c36597e0079a74b2d73af77ee20ba41 Author: Mike Blumenkrantz Date: Sat May 9 09:25:04 2020 +0100 eina: resolve float comparison warnings Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11786 --- src/lib/eina/eina_convert.c | 5 +++-- src/lib/eina/eina_debug_bt.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c index f210d14d8a..4683215df5 100644 --- a/src/lib/eina/eina_convert.c +++ b/src/lib/eina/eina_convert.c @@ -39,6 +39,7 @@ #include "eina_safety_checks.h" #include "eina_convert.h" #include "eina_fp.h" +#include "eina_util.h" /** * Local * @@ -613,7 +614,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr) else if (*iter == 0) goto on_success; -if ((val == 2.2250738585072011) && ((minus_e * (int)expo_part) == -308)) +if ((eina_dbl_exact(val, 2.2250738585072011)) && ((minus_e * (int)expo_part) == -308)) { val *= 1.0e-308; a = iter; @@ -621,7 +622,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr) goto on_success; } -if ((val == 2.2250738585072012) && ((minus_e * (int)expo_part) <= -308)) +if ((eina_dbl_exact(val, 2.2250738585072012)) && ((minus_e * (int)expo_part) <= -308)) { val *= 1.0e-308; a = iter; diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c index a2510e9123..b915f23230 100644 --- a/src/lib/eina/eina_debug_bt.c +++ b/src/lib/eina/eina_debug_bt.c @@ -34,6 +34,7 @@ #include "eina_debug.h" #include "eina_debug_private.h" +#include "eina_util.h" #ifndef _WIN32 # include @@ -307,7 +308,7 @@ _trace_cb(void *data EINA_UNUSED) static int bts = 0; int i; - if (!_trace_t0) _trace_t0 = get_time(); + if (!EINA_DBL_NONZERO(_trace_t0)) _trace_t0 = get_time(); // take a lock on grabbing thread debug info like backtraces eina_spinlock_take(&_eina_debug_thread_lock); --
[EGIT] [core/efl] master 02/07: edje_cc: fix comparisons for possible non-float values
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9cd18f3de6185589b6a343cac7a77951ceca82f4 commit 9cd18f3de6185589b6a343cac7a77951ceca82f4 Author: Mike Blumenkrantz Date: Sat May 9 09:25:08 2020 +0100 edje_cc: fix comparisons for possible non-float values Summary: when defined, BUILD_EDJE_FP causes some of these struct members to not be floating types and additionally defines special macros to be used for comparisons to handle this case Depends on D11786 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11787 --- src/bin/edje/edje_cc_handlers.c | 14 +++--- src/bin/edje/edje_cc_parse.c| 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index ba1edbd8c7..22de13bf88 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -3554,7 +3554,7 @@ st_collections_base_scale(void) check_min_arg_count(1); edje_file->base_scale = FROM_DOUBLE(parse_float_range(0, 0.0, 9.0)); - if (edje_file->base_scale == ZERO) + if (EQ(edje_file->base_scale, ZERO)) { ERR("The base_scale is 0.0. The value should be bigger than 0.0."); exit(-1); @@ -4015,12 +4015,12 @@ _link_combine(void) EINA_LIST_FOREACH_SAFE(tup->data, l, ll, ell) { if (ell->pr->tween.mode != el->pr->tween.mode) continue; - if (fabs(ell->pr->tween.time - el->pr->tween.time) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v1 - el->pr->tween.v1) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v2 - el->pr->tween.v2) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v3 - el->pr->tween.v3) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v4 - el->pr->tween.v4) > DBL_EPSILON) continue; - if (fabs(ell->ed->state.value - el->ed->state.value) > DBL_EPSILON) continue; + if (!EQ(ell->pr->tween.time, el->pr->tween.time)) continue; + if (!EQ(ell->pr->tween.v1, el->pr->tween.v1)) continue; + if (!EQ(ell->pr->tween.v2, el->pr->tween.v2)) continue; + if (!EQ(ell->pr->tween.v3, el->pr->tween.v3)) continue; + if (!EQ(ell->pr->tween.v4, el->pr->tween.v4)) continue; + if (!EQ(ell->ed->state.value, el->ed->state.value)) continue; if ((!!ell->ed->state.name) != (!!el->ed->state.name)) { if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) || diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index 9b143c64f5..a656fb6783 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c @@ -1948,7 +1948,7 @@ _calcf(char op, double a, double b) return a; case '/': -if (b != 0) a /= b; +if (EINA_DBL_NONZERO(b)) a /= b; else ERR("%s:%i divide by zero", file_in, line - 1); return a; @@ -1958,7 +1958,7 @@ _calcf(char op, double a, double b) return a; case '%': -if (0 != b) a = (double)((int)a % (int)b); +if (EINA_DBL_NONZERO(b)) a = (double)((int)a % (int)b); else ERR("%s:%i modula by zero", file_in, line - 1); return a; --
[EGIT] [core/efl] master 03/07: edje_cc: consistently use eina macros for all float comparisons
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=477bfd19ea43102cdfc8845343dd8a42ace08f59 commit 477bfd19ea43102cdfc8845343dd8a42ace08f59 Author: Mike Blumenkrantz Date: Sat May 9 09:25:11 2020 +0100 edje_cc: consistently use eina macros for all float comparisons Summary: Depends on D11787 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11788 --- src/bin/edje/edje_cc_handlers.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 22de13bf88..16996932ff 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -8304,7 +8304,7 @@ st_collections_group_parts_part_description_inherit(void) exit(-1); } -if (!strcmp(parent_name, "default") && parent_val == 0.0) +if (!strcmp(parent_name, "default") && EINA_DBL_EQ(parent_val, 0.0)) parent = ep->default_desc; else { @@ -8335,7 +8335,7 @@ st_collections_group_parts_part_description_inherit(void) } } - if (min_dst) + if (EINA_DBL_NONZERO(min_dst)) { WRN("%s:%i: couldn't find an exact match in part '%s' when looking for '%s' %lf. Falling back to nearest one '%s' %lf.", file_in, line - 1, ep->name, parent_name, parent_val, parent ? parent->state.name : NULL, parent ? parent->state.value : 0); @@ -8569,8 +8569,8 @@ _part_description_state_update(Edje_Part_Description_Common *ed) Edje_Part *ep = current_part; if (ed == ep->default_desc) return; - if ((ep->default_desc->state.name && !strcmp(ed->state.name, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) || - (!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && ed->state.value == ep->default_desc->state.value)) + if ((ep->default_desc->state.name && !strcmp(ed->state.name, ep->default_desc->state.name) && EINA_DBL_EQ(ed->state.value, ep->default_desc->state.value)) || + (!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && EINA_DBL_EQ(ed->state.value, ep->default_desc->state.value))) { if (ep->type == EDJE_PART_TYPE_IMAGE) _edje_part_description_image_remove((Edje_Part_Description_Image *)ed); @@ -8586,7 +8586,7 @@ _part_description_state_update(Edje_Part_Description_Common *ed) unsigned int i; for (i = 0; i < ep->other.desc_count - 1; ++i) { - if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) + if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && EINA_DBL_EQ(ed->state.value, ep->other.desc[i]->state.value)) { if (ep->type == EDJE_PART_TYPE_IMAGE) _edje_part_description_image_remove((Edje_Part_Description_Image *)ed); @@ -8645,7 +8645,7 @@ st_collections_group_parts_part_description_state(void) val = parse_float_range(1, 0.0, 1.0); /* if only default desc exists and current desc is not default, commence paddling */ - if ((!ep->other.desc_count) && (val || (!eina_streq(s, "default" + if ((!ep->other.desc_count) && (EINA_DBL_NONZERO(val) || (!eina_streq(s, "default" { ERR("parse error %s:%i. invalid state name: '%s'. \"default\" state must always be first.", file_in, line - 1, s); @@ -15135,7 +15135,7 @@ edje_cc_handlers_wildcard(void) if (((!!ed->state.name) != (!!current_desc->state.name)) || (ed->state.name && strcmp(ed->state.name, current_desc->state.name)) || - (fabs(ed->state.value - st) > DBL_EPSILON)) continue; + (!EINA_DBL_EQ(ed->state.value, st))) continue; current_desc = ed; break; } --
[EGIT] [core/efl] efl-1.24 07/07: evas/events: fix conditional for emitting source mouse move events
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=a7bcba534a126616ff9ebf8a903f55b23078664e commit a7bcba534a126616ff9ebf8a903f55b23078664e Author: Mike Blumenkrantz Date: Sat May 9 09:25:27 2020 +0100 evas/events: fix conditional for emitting source mouse move events Summary: this should match all other similar cases when determining whether to emit the event by checking whether at least one coord has changed, not both Depends on D11791 Reviewers: devilhorns Reviewed By: devilhorns Subscribers: raster, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11792 --- src/lib/evas/canvas/evas_events.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 4596a26419..ff080eb913 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -815,7 +815,7 @@ _evas_event_source_mouse_move_events(Evas_Object *eo_obj, Evas *eo_e, ev->action = EFL_POINTER_ACTION_IN; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_IN, evt, event_id2, EFL_EVENT_POINTER_IN); -if ((cur_pt.x != prev_pt.x) && (cur_pt.y != prev_pt.y)) +if ((cur_pt.x != prev_pt.x) || (cur_pt.y != prev_pt.y)) { ev->action = EFL_POINTER_ACTION_MOVE; evas_object_event_callback_call(eo_child, child, EVAS_CALLBACK_MOUSE_MOVE, evt, --
[EGIT] [core/efl] master 04/07: tests: resolve float comparison warnings
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e0cf299ae5a98b294700bc04651a018fb779d0fc commit e0cf299ae5a98b294700bc04651a018fb779d0fc Author: Mike Blumenkrantz Date: Sat May 9 09:25:14 2020 +0100 tests: resolve float comparison warnings Summary: Depends on D11788 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11789 --- src/tests/ecore/ecore_test_animator.c | 4 +- src/tests/ecore/ecore_test_ecore_audio.c | 46 ++--- src/tests/ecore/ecore_test_timer.c | 4 +- src/tests/ecore_con/ecore_con_test_ecore_con.c | 4 +- src/tests/eet/eet_test_common.c| 12 ++-- src/tests/eet/eet_test_data.c | 12 ++-- src/tests/eet/eet_test_file.c | 10 +-- src/tests/eina/eina_test_bezier.c | 42 ++-- src/tests/eina/eina_test_quaternion.c | 24 +++ src/tests/eina/eina_test_vector.c | 76 +++--- src/tests/elementary/efl_ui_test_config.c | 10 ++- src/tests/elementary/efl_ui_test_spin_button.c | 4 +- src/tests/elementary/efl_ui_test_spotlight.c | 8 +-- .../elementary/spec/efl_test_gfx_arrangement.c | 4 +- src/tests/elementary/spec/efl_test_range_display.c | 30 - .../elementary/spec/efl_test_range_interactive.c | 8 +-- src/tests/eolian/eolian_parsing.c | 2 +- src/tests/evas/efl_canvas_animation.c | 2 +- src/tests/evas/evas_test_filters.c | 2 +- src/tests/evas/evas_test_text.c| 2 +- src/tests/evas/evas_test_textblock.c | 10 +-- 21 files changed, 162 insertions(+), 154 deletions(-) diff --git a/src/tests/ecore/ecore_test_animator.c b/src/tests/ecore/ecore_test_animator.c index 271f9792ef..d69407bc1e 100644 --- a/src/tests/ecore/ecore_test_animator.c +++ b/src/tests/ecore/ecore_test_animator.c @@ -15,7 +15,7 @@ static Eina_Bool _anim_cb(void *data EINA_UNUSED, double pos) fail_if(prev > pos); prev = pos; - if (pos == 1.0) + if (EINA_DBL_EQ(pos, 1.0)) ecore_main_loop_quit(); return EINA_TRUE; @@ -59,7 +59,7 @@ Eina_Bool test_pos(Ecore_Pos_Map posmap, double v1, double v2, double (*testmap) return EINA_FALSE; } } - fail_if(ecore_animator_pos_map(1.0, posmap, v1, v2) != 1.0); + fail_if(!EINA_DBL_EQ(ecore_animator_pos_map(1.0, posmap, v1, v2), 1.0)); return EINA_TRUE; } diff --git a/src/tests/ecore/ecore_test_ecore_audio.c b/src/tests/ecore/ecore_test_ecore_audio.c index 9c8a890945..6521871358 100644 --- a/src/tests/ecore/ecore_test_ecore_audio.c +++ b/src/tests/ecore/ecore_test_ecore_audio.c @@ -148,16 +148,16 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_tone) rate = ecore_audio_obj_in_samplerate_get(in); fail_if(rate != 44100); len = ecore_audio_obj_in_length_get(in); - fail_if(len != 1); + fail_if(!EINA_DBL_EQ(len, 1)); ecore_audio_obj_in_length_set(in, 2.5); len = ecore_audio_obj_in_length_get(in); - fail_if(len != 2.5); + fail_if(!EINA_DBL_EQ(len, 2.5)); ecore_audio_obj_in_looped_set(in, EINA_TRUE); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 2.5); + fail_if(!EINA_DBL_EQ(len, 2.5)); freq = (intptr_t) efl_key_data_get(in, ECORE_AUDIO_ATTR_TONE_FREQ); fail_if(freq != 1000); @@ -173,28 +173,28 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_tone) ck_assert_str_eq(tmp, "bar"); len = ecore_audio_obj_in_seek(in, 5.0, SEEK_SET); - fail_if(len != -1); + fail_if(!EINA_DBL_EQ(len, -1)); len = ecore_audio_obj_in_seek(in, 1.0, 42); - fail_if(len != -1); + fail_if(!EINA_DBL_EQ(len, -1)); len = ecore_audio_obj_in_seek(in, 1.0, SEEK_SET); - fail_if(len != 1.0); + fail_if(!EINA_DBL_EQ(len, 1.0)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 1.5); + fail_if(!EINA_DBL_EQ(len, 1.5)); len = ecore_audio_obj_in_seek(in, 1.0, SEEK_CUR); - fail_if(len != 2.0); + fail_if(!EINA_DBL_EQ(len, 2.0)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 0.5); + fail_if(!EINA_DBL_EQ(len, 0.5)); len = ecore_audio_obj_in_seek(in, -1.0, SEEK_END); - fail_if(len != 1.5); + fail_if(!EINA_DBL_EQ(len, 1.5)); len = ecore_audio_obj_in_remaining_get(in); - fail_if(len != 1.0); + fail_if(!EINA_DBL_EQ(len, 1.0)); out = efl_add_ref(ECORE_AUDIO_OUT_SNDFILE_CLASS, NULL); fail_if(!out); @@ -260,18 +260,18 @@ EFL_START_TEST(ecore_test_ecore_audio_obj_sndfile) rate = ecore_audio_obj_in_samplerate_get(in); fail_if(rate != 44100); len = ecore_audio_obj_in_length_get(in); - fail_if(len == 0); + fail_if(EINA_DBL_EQ(len, 0)); rem = ecore_audio_obj_in_remaining_get(in); - fail_if(len != rem); + fail_if(!EINA_DBL_EQ(len, rem
[EGIT] [core/efl] efl-1.24 03/07: edje_cc: consistently use eina macros for all float comparisons
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=7012428389f797a02d66b5e2d0085bb6cf8c90a3 commit 7012428389f797a02d66b5e2d0085bb6cf8c90a3 Author: Mike Blumenkrantz Date: Sat May 9 09:25:11 2020 +0100 edje_cc: consistently use eina macros for all float comparisons Summary: Depends on D11787 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11788 --- src/bin/edje/edje_cc_handlers.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index 22de13bf88..16996932ff 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -8304,7 +8304,7 @@ st_collections_group_parts_part_description_inherit(void) exit(-1); } -if (!strcmp(parent_name, "default") && parent_val == 0.0) +if (!strcmp(parent_name, "default") && EINA_DBL_EQ(parent_val, 0.0)) parent = ep->default_desc; else { @@ -8335,7 +8335,7 @@ st_collections_group_parts_part_description_inherit(void) } } - if (min_dst) + if (EINA_DBL_NONZERO(min_dst)) { WRN("%s:%i: couldn't find an exact match in part '%s' when looking for '%s' %lf. Falling back to nearest one '%s' %lf.", file_in, line - 1, ep->name, parent_name, parent_val, parent ? parent->state.name : NULL, parent ? parent->state.value : 0); @@ -8569,8 +8569,8 @@ _part_description_state_update(Edje_Part_Description_Common *ed) Edje_Part *ep = current_part; if (ed == ep->default_desc) return; - if ((ep->default_desc->state.name && !strcmp(ed->state.name, ep->default_desc->state.name) && ed->state.value == ep->default_desc->state.value) || - (!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && ed->state.value == ep->default_desc->state.value)) + if ((ep->default_desc->state.name && !strcmp(ed->state.name, ep->default_desc->state.name) && EINA_DBL_EQ(ed->state.value, ep->default_desc->state.value)) || + (!ep->default_desc->state.name && !strcmp(ed->state.name, "default") && EINA_DBL_EQ(ed->state.value, ep->default_desc->state.value))) { if (ep->type == EDJE_PART_TYPE_IMAGE) _edje_part_description_image_remove((Edje_Part_Description_Image *)ed); @@ -8586,7 +8586,7 @@ _part_description_state_update(Edje_Part_Description_Common *ed) unsigned int i; for (i = 0; i < ep->other.desc_count - 1; ++i) { - if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && ed->state.value == ep->other.desc[i]->state.value) + if (!strcmp(ed->state.name, ep->other.desc[i]->state.name) && EINA_DBL_EQ(ed->state.value, ep->other.desc[i]->state.value)) { if (ep->type == EDJE_PART_TYPE_IMAGE) _edje_part_description_image_remove((Edje_Part_Description_Image *)ed); @@ -8645,7 +8645,7 @@ st_collections_group_parts_part_description_state(void) val = parse_float_range(1, 0.0, 1.0); /* if only default desc exists and current desc is not default, commence paddling */ - if ((!ep->other.desc_count) && (val || (!eina_streq(s, "default" + if ((!ep->other.desc_count) && (EINA_DBL_NONZERO(val) || (!eina_streq(s, "default" { ERR("parse error %s:%i. invalid state name: '%s'. \"default\" state must always be first.", file_in, line - 1, s); @@ -15135,7 +15135,7 @@ edje_cc_handlers_wildcard(void) if (((!!ed->state.name) != (!!current_desc->state.name)) || (ed->state.name && strcmp(ed->state.name, current_desc->state.name)) || - (fabs(ed->state.value - st) > DBL_EPSILON)) continue; + (!EINA_DBL_EQ(ed->state.value, st))) continue; current_desc = ed; break; } --
[EGIT] [core/efl] master 01/07: eina: resolve float comparison warnings
raster pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e0e1dc5f6f55b12f34935ed383a9ca97e6cd6cd8 commit e0e1dc5f6f55b12f34935ed383a9ca97e6cd6cd8 Author: Mike Blumenkrantz Date: Sat May 9 09:25:04 2020 +0100 eina: resolve float comparison warnings Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11786 --- src/lib/eina/eina_convert.c | 5 +++-- src/lib/eina/eina_debug_bt.c | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/lib/eina/eina_convert.c b/src/lib/eina/eina_convert.c index f210d14d8a..4683215df5 100644 --- a/src/lib/eina/eina_convert.c +++ b/src/lib/eina/eina_convert.c @@ -39,6 +39,7 @@ #include "eina_safety_checks.h" #include "eina_convert.h" #include "eina_fp.h" +#include "eina_util.h" /** * Local * @@ -613,7 +614,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr) else if (*iter == 0) goto on_success; -if ((val == 2.2250738585072011) && ((minus_e * (int)expo_part) == -308)) +if ((eina_dbl_exact(val, 2.2250738585072011)) && ((minus_e * (int)expo_part) == -308)) { val *= 1.0e-308; a = iter; @@ -621,7 +622,7 @@ eina_convert_strtod_c(const char *nptr, char **endptr) goto on_success; } -if ((val == 2.2250738585072012) && ((minus_e * (int)expo_part) <= -308)) +if ((eina_dbl_exact(val, 2.2250738585072012)) && ((minus_e * (int)expo_part) <= -308)) { val *= 1.0e-308; a = iter; diff --git a/src/lib/eina/eina_debug_bt.c b/src/lib/eina/eina_debug_bt.c index a2510e9123..b915f23230 100644 --- a/src/lib/eina/eina_debug_bt.c +++ b/src/lib/eina/eina_debug_bt.c @@ -34,6 +34,7 @@ #include "eina_debug.h" #include "eina_debug_private.h" +#include "eina_util.h" #ifndef _WIN32 # include @@ -307,7 +308,7 @@ _trace_cb(void *data EINA_UNUSED) static int bts = 0; int i; - if (!_trace_t0) _trace_t0 = get_time(); + if (!EINA_DBL_NONZERO(_trace_t0)) _trace_t0 = get_time(); // take a lock on grabbing thread debug info like backtraces eina_spinlock_take(&_eina_debug_thread_lock); --
[EGIT] [core/efl] efl-1.24 02/07: edje_cc: fix comparisons for possible non-float values
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=15b65633573f3180ea29d343b9ac6173705bed02 commit 15b65633573f3180ea29d343b9ac6173705bed02 Author: Mike Blumenkrantz Date: Sat May 9 09:25:08 2020 +0100 edje_cc: fix comparisons for possible non-float values Summary: when defined, BUILD_EDJE_FP causes some of these struct members to not be floating types and additionally defines special macros to be used for comparisons to handle this case Depends on D11786 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11787 --- src/bin/edje/edje_cc_handlers.c | 14 +++--- src/bin/edje/edje_cc_parse.c| 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index ba1edbd8c7..22de13bf88 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c @@ -3554,7 +3554,7 @@ st_collections_base_scale(void) check_min_arg_count(1); edje_file->base_scale = FROM_DOUBLE(parse_float_range(0, 0.0, 9.0)); - if (edje_file->base_scale == ZERO) + if (EQ(edje_file->base_scale, ZERO)) { ERR("The base_scale is 0.0. The value should be bigger than 0.0."); exit(-1); @@ -4015,12 +4015,12 @@ _link_combine(void) EINA_LIST_FOREACH_SAFE(tup->data, l, ll, ell) { if (ell->pr->tween.mode != el->pr->tween.mode) continue; - if (fabs(ell->pr->tween.time - el->pr->tween.time) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v1 - el->pr->tween.v1) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v2 - el->pr->tween.v2) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v3 - el->pr->tween.v3) > DBL_EPSILON) continue; - if (fabs(ell->pr->tween.v4 - el->pr->tween.v4) > DBL_EPSILON) continue; - if (fabs(ell->ed->state.value - el->ed->state.value) > DBL_EPSILON) continue; + if (!EQ(ell->pr->tween.time, el->pr->tween.time)) continue; + if (!EQ(ell->pr->tween.v1, el->pr->tween.v1)) continue; + if (!EQ(ell->pr->tween.v2, el->pr->tween.v2)) continue; + if (!EQ(ell->pr->tween.v3, el->pr->tween.v3)) continue; + if (!EQ(ell->pr->tween.v4, el->pr->tween.v4)) continue; + if (!EQ(ell->ed->state.value, el->ed->state.value)) continue; if ((!!ell->ed->state.name) != (!!el->ed->state.name)) { if (((!!ell->ed->state.name) && strcmp(ell->ed->state.name, "default")) || diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index e6db4f5840..a369ac86ee 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c @@ -1946,7 +1946,7 @@ _calcf(char op, double a, double b) return a; case '/': -if (b != 0) a /= b; +if (EINA_DBL_NONZERO(b)) a /= b; else ERR("%s:%i divide by zero", file_in, line - 1); return a; @@ -1956,7 +1956,7 @@ _calcf(char op, double a, double b) return a; case '%': -if (0 != b) a = (double)((int)a % (int)b); +if (EINA_DBL_NONZERO(b)) a = (double)((int)a % (int)b); else ERR("%s:%i modula by zero", file_in, line - 1); return a; --
[EGIT] [core/efl] efl-1.24 06/07: elm: resolve float comparison warnings
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=f5cc8574c70e221961600e1f8a0318b286b9b0c9 commit f5cc8574c70e221961600e1f8a0318b286b9b0c9 Author: Mike Blumenkrantz Date: Sat May 9 09:25:21 2020 +0100 elm: resolve float comparison warnings Summary: Depends on D11790 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11791 --- src/edje_external/elementary/elm_notify.c | 18 +- src/lib/elementary/efl_ui_flip.c | 4 +-- src/lib/elementary/efl_ui_image_zoomable.c | 2 +- src/lib/elementary/efl_ui_progressbar.c| 4 +-- src/lib/elementary/efl_ui_scroll_manager.c | 2 +- src/lib/elementary/efl_ui_slider.c | 8 ++--- src/lib/elementary/efl_ui_slider_interval.c| 6 ++-- src/lib/elementary/efl_ui_spotlight_container.c| 4 +-- .../elementary/efl_ui_spotlight_plain_manager.c| 2 +- src/lib/elementary/efl_ui_textpath.c | 12 +++ src/lib/elementary/efl_ui_vg_animation.c | 24 ++--- src/lib/elementary/efl_ui_widget.c | 6 ++-- src/lib/elementary/efl_ui_win.c| 6 ++-- src/lib/elementary/elm_atspi_bridge.c | 2 +- src/lib/elementary/elm_code_widget.c | 6 ++-- src/lib/elementary/elm_colorselector.c | 16 - src/lib/elementary/elm_config.c| 14 src/lib/elementary/elm_dnd.c | 2 +- src/lib/elementary/elm_flipselector.c | 8 ++--- src/lib/elementary/elm_gengrid.c | 2 +- src/lib/elementary/elm_gesture_layer.c | 2 +- src/lib/elementary/elm_interface_scrollable.c | 14 src/lib/elementary/elm_map.c | 2 +- src/lib/elementary/elm_notify.c| 40 +++--- src/lib/elementary/elm_slider.c| 2 +- src/lib/elementary/elm_slideshow.c | 2 +- src/lib/elementary/elm_spinner.c | 30 src/lib/elementary/elm_toolbar.c | 4 +-- src/lib/elementary/elm_transit.c | 8 ++--- src/lib/elementary/els_box.c | 6 ++-- src/lib/elementary/els_tooltip.c | 8 ++--- 31 files changed, 134 insertions(+), 132 deletions(-) diff --git a/src/edje_external/elementary/elm_notify.c b/src/edje_external/elementary/elm_notify.c index 801bfe473f..7f0cd1d9f6 100644 --- a/src/edje_external/elementary/elm_notify.c +++ b/src/edje_external/elementary/elm_notify.c @@ -39,23 +39,23 @@ _elm_notify_orient_get(const Evas_Object *obj) elm_notify_align_get(obj, , ); - if ((horizontal == 0.5) && (vertical == 0.0)) + if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP; - else if ((horizontal == 0.5) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_CENTER; - else if ((horizontal == 0.5) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 0.5) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM; - else if ((horizontal == 0.0) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_LEFT; - else if ((horizontal == 1.0) && (vertical == 0.5)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 0.5)) orient = ELM_NOTIFY_ORIENT_RIGHT; - else if ((horizontal == 0.0) && (vertical == 0.0)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP_LEFT; - else if ((horizontal == 1.0) && (vertical == 0.0)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 0.0)) orient = ELM_NOTIFY_ORIENT_TOP_RIGHT; - else if ((horizontal == 0.0) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 0.0) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM_LEFT; - else if ((horizontal == 1.0) && (vertical == 1.0)) + else if (EINA_DBL_EQ(horizontal, 1.0) && EINA_DBL_EQ(vertical, 1.0)) orient = ELM_NOTIFY_ORIENT_BOTTOM_RIGHT; else orient = ELM_NOTIFY_ORIENT_TOP; diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c index 26f8d848bf..da2284ccfb 100644 --- a/src/lib/elementary/efl_ui_flip.c +++ b/src/lib/elementary/efl_ui_flip.c @@ -536,7 +536,7 @@ _state_update(Evas_Object *obj) if (mx < 1) mx = 1; // quick hack to keep curl line visible - if (mgrad == 0.0) // special horizontal case + if (EINA_DBL_EQ(mgrad, 0.0)) // special horizontal case mgrad = 0.001;
[EGIT] [core/efl] efl-1.24 05/07: bin/elm: resolve float compare warnings
raster pushed a commit to branch efl-1.24. http://git.enlightenment.org/core/efl.git/commit/?id=0b5121bce7449542b52b937b61b4ae017e202a37 commit 0b5121bce7449542b52b937b61b4ae017e202a37 Author: Mike Blumenkrantz Date: Sat May 9 09:25:17 2020 +0100 bin/elm: resolve float compare warnings Summary: Depends on D11789 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11790 --- src/bin/elementary/config.c| 102 ++--- src/bin/elementary/elm_prefs_cc_parse.c| 4 +- src/bin/elementary/test_gesture_layer3.c | 6 +- src/bin/elementary/test_glview_manygears.c | 2 +- src/bin/elementary/test_map.c | 2 +- src/bin/elementary/test_photocam.c | 2 +- src/bin/elementary/test_tooltip.c | 2 +- 7 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/bin/elementary/config.c b/src/bin/elementary/config.c index 71309ecf2a..17d1376f54 100644 --- a/src/bin/elementary/config.c +++ b/src/bin/elementary/config.c @@ -213,7 +213,7 @@ bf_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -224,7 +224,7 @@ bf_change(void *data EINA_UNUSED, double bf = elm_config_scroll_bounce_friction_get(); double val = elm_slider_value_get(obj); - if (bf == val) return; + if (EINA_DBL_EQ(bf, val)) return; elm_config_scroll_bounce_friction_set(val); elm_config_all_flush(); } @@ -238,7 +238,7 @@ ps_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -249,7 +249,7 @@ ps_change(void *data EINA_UNUSED, double ps = elm_config_scroll_page_scroll_friction_get(); double val = elm_slider_value_get(obj); - if (ps == val) return; + if (EINA_DBL_EQ(ps, val)) return; elm_config_scroll_page_scroll_friction_set(val); elm_config_all_flush(); } @@ -263,7 +263,7 @@ bis_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -274,7 +274,7 @@ bis_change(void *data EINA_UNUSED, double bis = elm_config_scroll_bring_in_scroll_friction_get(); double val = elm_slider_value_get(obj); - if (bis == val) return; + if (EINA_DBL_EQ(bis, val)) return; elm_config_scroll_bring_in_scroll_friction_set(val); elm_config_all_flush(); } @@ -288,7 +288,7 @@ zf_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -299,7 +299,7 @@ zf_change(void *data EINA_UNUSED, double zf = elm_config_scroll_zoom_friction_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_zoom_friction_set(val); elm_config_all_flush(); } @@ -313,7 +313,7 @@ smooth_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 100.0))) / 100.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -324,7 +324,7 @@ smooth_change(void *data EINA_UNUSED, double zf = elm_config_scroll_thumbscroll_smooth_amount_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_thumbscroll_smooth_amount_set(val); elm_config_all_flush(); } @@ -338,7 +338,7 @@ smooth_win_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 100.0))) / 100.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -349,7 +349,7 @@ smooth_win_change(void *data EINA_UNUSED, double zf = elm_config_scroll_thumbscroll_smooth_time_window_get(); double val = elm_slider_value_get(obj); - if (zf == val) return; + if (EINA_DBL_EQ(zf, val)) return; elm_config_scroll_thumbscroll_smooth_time_window_set(val); elm_config_all_flush(); } @@ -378,7 +378,7 @@ tst_round(void *data EINA_UNUSED, double v; v = ((double)((int)(val * 10.0))) / 10.0; - if (v != val) elm_slider_value_set(obj, v); + if (!EINA_DBL_EQ(v, val)) elm_slider_value_set(obj, v); } static void @@ -389,7 +389,7 @@ tst_change(void *data EINA_UNUSED, double tst = elm_config_scroll_thumbscroll_threshold_get(); double val = elm_slider_value_get(obj); - if (tst == val) return
[EGIT] [core/efl] master 01/01: tests/elm: add callback testing to image memfile test
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d commit 882e4cd50f6c0c9d4b7c2825ba66cff42d1d476d Author: Mike Blumenkrantz Date: Fri May 8 10:45:27 2020 +0900 tests/elm: add callback testing to image memfile test Summary: verify that ready is called (preload done) and error is not called ref D11758 Reviewers: Hermet, jsuya, kimcinoo Reviewed By: Hermet Subscribers: stefan_schmidt, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11760 --- src/tests/elementary/elm_test_image.c | 12 +++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c index 888069f2b7..25aac89a42 100644 --- a/src/tests/elementary/elm_test_image.c +++ b/src/tests/elementary/elm_test_image.c @@ -257,10 +257,11 @@ EFL_END_TEST EFL_START_TEST(elm_image_test_memfile_set) { - Evas_Object *win, *image; + Evas_Object *win, *image, *image2; char *mem; int size; const char *file = NULL; + int error_called = 0; win = win_add(NULL, "image", ELM_WIN_BASIC); @@ -274,6 +275,15 @@ EFL_START_TEST(elm_image_test_memfile_set) ck_assert(elm_image_file_set(image, ELM_IMAGE_DATA_DIR"/images/icon_01.png", NULL)); elm_image_file_get(image, , NULL); ck_assert_str_eq(file, ELM_IMAGE_DATA_DIR"/images/icon_01.png"); + + image2 = elm_image_add(win); + evas_object_smart_callback_add(image2, "load,ready", event_callback_that_quits_the_main_loop_when_called, NULL); + evas_object_smart_callback_add(image2, "load,error", event_callback_single_call_int_data, _called); + ck_assert(elm_image_memfile_set(image2, mem, size, "png", NULL)); + ck_assert_int_eq(error_called, 0); + ecore_main_loop_begin(); + + ck_assert_int_eq(error_called, 0); } EFL_END_TEST --
[EGIT] [core/efl] master 04/04: tests/elm: add more naviframe tests
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=55c2ffbe42c0547b1fba5d91bf4303ff0302 commit 55c2ffbe42c0547b1fba5d91bf4303ff0302 Author: Mike Blumenkrantz Date: Wed Apr 22 13:18:25 2020 -0400 tests/elm: add more naviframe tests some tests to explicitly verify callback and internal behavior Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11752 --- src/tests/elementary/elm_test_naviframe.c | 58 +++ 1 file changed, 58 insertions(+) diff --git a/src/tests/elementary/elm_test_naviframe.c b/src/tests/elementary/elm_test_naviframe.c index 01f5dfc011..4f1b6d29ae 100644 --- a/src/tests/elementary/elm_test_naviframe.c +++ b/src/tests/elementary/elm_test_naviframe.c @@ -110,10 +110,68 @@ EFL_START_TEST(elm_naviframe_test_content_preserve_on_pop) } EFL_END_TEST +static Eo * +create_content(Eo *parent) +{ + Eo *content = elm_layout_add(parent); + + evas_object_size_hint_min_set(content, 50, 50); + + return content; +} + +#define NUM_ITEMS 10 +EFL_START_TEST(elm_naviframe_test_behavior) +{ + Evas_Object *win, *naviframe; + //int title_transition = 0; + int title_clicked = 0; + Elm_Object_Item *active_it = NULL; + Elm_Object_Item *it[NUM_ITEMS]; + int i; + + win = win_add(NULL, "naviframe", ELM_WIN_BASIC); + evas_object_resize(win, 500, 500); + + naviframe = elm_naviframe_add(win); + //this seems broken beyond space and time + //evas_object_smart_callback_add(naviframe, "title,transition,finished", event_callback_single_call_int_data, _transition); + evas_object_smart_callback_add(naviframe, "title,clicked", event_callback_single_call_int_data, _clicked); + evas_object_smart_callback_add(naviframe, "transition,finished", event_callback_that_quits_the_main_loop_when_called, NULL); + evas_object_smart_callback_add(naviframe, "item,activated", smart_callback_that_stores_event_info_to_data, _it); + evas_object_resize(naviframe, 500, 500); + evas_object_show(naviframe); + + for (i = 0; i < NUM_ITEMS; i++) + { +char buf[12]; +snprintf(buf, sizeof(buf), "page%d", i); +it[i] = elm_naviframe_item_push(naviframe, buf, NULL, NULL, create_content(naviframe), NULL); +elm_naviframe_item_title_enabled_set(it[i], EINA_TRUE, EINA_TRUE); + } + ck_assert_ptr_eq(it[0], active_it); + + evas_object_show(win); + get_me_to_those_events(win); + + ecore_main_loop_begin(); + + ck_assert_ptr_eq(it[9], active_it); + click_part(naviframe, "elm.text.title"); + get_me_to_those_events(win); + ck_assert_int_eq(title_clicked, 1); + + click_part(naviframe, "elm.swallow.prev_btn"); + ecore_main_loop_begin(); + /* reaching this point verifies that the back button works */ +} +EFL_END_TEST + void elm_test_naviframe(TCase *tc) { tcase_add_test(tc, elm_naviframe_test_legacy_type_check); tcase_add_test(tc, elm_naviframe_test_atspi_role_get); tcase_add_test(tc, elm_naviframe_test_content_preserve_on_pop); + tcase_add_test(tc, elm_naviframe_test_behavior); } --
[EGIT] [core/efl] master 03/04: tests/elm: add util callback for capturing event_info in smart callbacks
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=03d56674c3a02e7a5cc380467368d576676696df commit 03d56674c3a02e7a5cc380467368d576676696df Author: Mike Blumenkrantz Date: Wed Apr 22 13:16:50 2020 -0400 tests/elm: add util callback for capturing event_info in smart callbacks useful when we want to verify that e.g., a certain object item is passed Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11751 --- src/tests/elementary/suite_helpers.c | 8 src/tests/elementary/suite_helpers.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index 34e9de772d..62fe6deb77 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -619,6 +619,14 @@ event_callback_that_quits_the_main_loop_when_called() ecore_main_loop_quit(); } +void +smart_callback_that_stores_event_info_to_data(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + void **real_data = data; + + *real_data = event_info; +} + void click_object_at(Eo *obj, int x, int y) { diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index 29aa03522a..7e5a0ad105 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -45,6 +45,7 @@ void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down); void event_callback_single_call_int_data(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); void event_callback_that_quits_the_main_loop_when_called(); void event_callback_that_increments_an_int_when_called(void *data, Evas_Object *obj, void *event_info); +void smart_callback_that_stores_event_info_to_data(void *data, Evas_Object *obj EINA_UNUSED, void *event_info); void force_render(Eo *win); --
[EGIT] [core/efl] master 01/04: tests/elm: check all objects for signal interface before calling signal funcs
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c6a9574f10d556bfb35b3e01aff981331431fcc6 commit c6a9574f10d556bfb35b3e01aff981331431fcc6 Author: Mike Blumenkrantz Date: Wed Apr 22 13:15:45 2020 -0400 tests/elm: check all objects for signal interface before calling signal funcs just being extra paranoid here since there's some classes which implement some layout/content interfaces without implementing signals Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11749 --- src/tests/elementary/suite_helpers.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index a5d8b051de..34e9de772d 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -524,7 +524,9 @@ click_part_flags_internal(Eo *obj, const char *part, int flags, Eina_Bool up) click_object_internal(content, dir, flags, up); if (efl_isa(content, EFL_LAYOUT_SIGNAL_INTERFACE)) edje_object_message_signal_process(content); - edje_object_message_signal_process(obj); + /* can be false if obj is an elm_widget_item */ + if (efl_isa(obj, EFL_LAYOUT_SIGNAL_INTERFACE)) + edje_object_message_signal_process(obj); efl_unref(part_obj); } --
[EGIT] [core/efl] master 02/04: tests/elm: add some more specific convenience macros for size checks
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=faed679d532a84c3e8ab8b164c10a5420bf395d9 commit faed679d532a84c3e8ab8b164c10a5420bf395d9 Author: Mike Blumenkrantz Date: Wed Apr 22 13:17:43 2020 -0400 tests/elm: add some more specific convenience macros for size checks sometimes a test might only want to verify the width or height of an object Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11750 --- src/tests/elementary/suite_helpers.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index 4afae79024..29aa03522a 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -56,6 +56,20 @@ do \ ck_assert_int_eq(_sz.h, (height)); \ } while (0) +#define assert_object_width_eq(obj, width) \ +do \ +{ \ + Eina_Size2D _sz = efl_gfx_entity_size_get((obj)); \ + ck_assert_int_eq(_sz.w, (width)); \ +} while (0) + +#define assert_object_height_eq(obj, height) \ +do \ +{ \ + Eina_Size2D _sz = efl_gfx_entity_size_get((obj)); \ + ck_assert_int_eq(_sz.h, (height)); \ +} while (0) + #define assert_object_pos_eq(obj, _x, _y) \ do \ { \ --
[EGIT] [core/efl] master 02/02: tests/elm: add a list sizing test
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c622bd2e2353518dda6edf2742213fae6ba17d6b commit c622bd2e2353518dda6edf2742213fae6ba17d6b Author: Mike Blumenkrantz Date: Wed Apr 22 13:14:48 2020 -0400 tests/elm: add a list sizing test basic test to ensure that list sizing is homogeneous and works as it "should", even though list sizing internals are a black hole of lost time and dreams Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11748 --- src/tests/elementary/elm_test_list.c | 46 1 file changed, 46 insertions(+) diff --git a/src/tests/elementary/elm_test_list.c b/src/tests/elementary/elm_test_list.c index 063384b235..ab5b5ed20c 100644 --- a/src/tests/elementary/elm_test_list.c +++ b/src/tests/elementary/elm_test_list.c @@ -291,6 +291,51 @@ EFL_START_TEST(elm_list_test_callbacks) } EFL_END_TEST +static Eo * +create_content_with_size(Eo *parent, int mw, int mh) +{ + Evas *e = evas_object_evas_get(parent); + Eo *rect = evas_object_rectangle_add(e); + + evas_object_size_hint_min_set(rect, mw, mh); + evas_object_show(rect); + + return rect; +} + +EFL_START_TEST(elm_list_test_sizing) +{ + Evas_Object *win, *list; + unsigned int i; + int count[NUM_ITEMS] = {0}; + Elm_Object_Item *it; + + win = win_add(NULL, "list", ELM_WIN_BASIC); + evas_object_resize(win, 100, 100); + + list = elm_list_add(win); + evas_object_resize(list, 100, 100); + for (i = 0; i < NUM_ITEMS; i++) + elm_list_item_append(list, "item", create_content_with_size(list, i * 5, i * 5), NULL, (void*)event_callback_single_call_int_data, &(count[i])); + + elm_list_go(list); + evas_object_show(list); + evas_object_show(win); + get_me_to_those_events(win); + + for (i = 0, it = elm_list_first_item_get(list); i < NUM_ITEMS; i++, it = elm_list_item_next(it)) + { +Eo *rect = elm_object_item_content_get(it); +ck_assert(rect); +/* list is always homogeneous, so these should all have the size of the largest min size */ +assert_object_size_eq(rect, (NUM_ITEMS - 1) * 5, (NUM_ITEMS - 1) * 5); + } + + /* weird SIGILL in shutdown if the list isn't deleted here */ + evas_object_del(list); +} +EFL_END_TEST + void elm_test_list(TCase *tc) { tcase_add_test(tc, elm_list_legacy_type_check); @@ -306,4 +351,5 @@ void elm_test_list(TCase *tc) #endif tcase_add_test(tc, elm_atspi_children_parent); tcase_add_test(tc, elm_list_test_callbacks); + tcase_add_test(tc, elm_list_test_sizing); } --
[EGIT] [core/efl] master 01/02: elm/list: avoid erroring on non-elm item contents
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=02ad4d18ba86c9160a6e75829a6ec16a9d79ef7c commit 02ad4d18ba86c9160a6e75829a6ec16a9d79ef7c Author: Mike Blumenkrantz Date: Wed Apr 22 13:13:57 2020 -0400 elm/list: avoid erroring on non-elm item contents putting raw evas and edje objects in here has historically been done, so handle it without errors Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11747 --- src/lib/elementary/elm_list.c | 14 ++ 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c index 7414bd2559..4447ea2f05 100644 --- a/src/lib/elementary/elm_list.c +++ b/src/lib/elementary/elm_list.c @@ -2328,8 +2328,11 @@ _item_new(Evas_Object *obj, evas_object_event_callback_add (it->icon, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, obj); -efl_access_object_access_type_set(it->icon, EFL_ACCESS_TYPE_DISABLED); -elm_widget_tree_unfocusable_set(it->icon, EINA_TRUE); +if (elm_widget_is(it->icon)) + { + efl_access_object_access_type_set(it->icon, EFL_ACCESS_TYPE_DISABLED); + elm_widget_tree_unfocusable_set(it->icon, EINA_TRUE); + } } if (it->end) { @@ -2337,8 +2340,11 @@ _item_new(Evas_Object *obj, evas_object_event_callback_add (it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _size_hints_changed_cb, obj); -efl_access_object_access_type_set(it->end, EFL_ACCESS_TYPE_DISABLED); -elm_widget_tree_unfocusable_set(it->end, EINA_TRUE); +if (elm_widget_is(it->end)) + { + efl_access_object_access_type_set(it->end, EFL_ACCESS_TYPE_DISABLED); + elm_widget_tree_unfocusable_set(it->end, EINA_TRUE); + } } if (_elm_config->atspi_mode) --
[EGIT] [core/efl] master 01/01: elm/cnp: remove const from static function return
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0de64f2d91ffa4bcf106b0b0bef2fb5f8783e122 commit 0de64f2d91ffa4bcf106b0b0bef2fb5f8783e122 Author: Mike Blumenkrantz Date: Mon Apr 27 09:46:45 2020 -0400 elm/cnp: remove const from static function return this makes no sense ../src/lib/elementary/elm_cnp.c:54:15: warning: type qualifiers ignored on function return type [-Wignored-qualifiers] 54 | static inline const Elm_Sel_Format Reviewed-by: Christopher Michael Differential Revision: https://phab.enlightenment.org/D11759 --- src/lib/elementary/elm_cnp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_cnp.c b/src/lib/elementary/elm_cnp.c index 1833c0b3d4..81963a65d9 100644 --- a/src/lib/elementary/elm_cnp.c +++ b/src/lib/elementary/elm_cnp.c @@ -51,7 +51,7 @@ _elm_sel_format_to_mime_type(Elm_Sel_Format format) return ret; } -static inline const Elm_Sel_Format +static inline Elm_Sel_Format _mime_type_to_elm_sel_format(const char *mime_type) { if (eina_streq(mime_type, "text/vcard")) --
[EGIT] [core/efl] master 01/02: tests/elm: add image tests to verify internal object size is clamped to object size
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e2365a0ed326e9c82301eb8036207f1632a6214e commit e2365a0ed326e9c82301eb8036207f1632a6214e Author: Mike Blumenkrantz Date: Wed Mar 25 10:07:56 2020 -0400 tests/elm: add image tests to verify internal object size is clamped to object size ensure that this doesn't break again ref 11587 Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11599 --- src/tests/elementary/efl_ui_test_image.c | 27 +++ src/tests/elementary/elm_test_image.c| 26 ++ 2 files changed, 53 insertions(+) diff --git a/src/tests/elementary/efl_ui_test_image.c b/src/tests/elementary/efl_ui_test_image.c index 244f1047e4..bd7d125323 100644 --- a/src/tests/elementary/efl_ui_test_image.c +++ b/src/tests/elementary/efl_ui_test_image.c @@ -30,7 +30,34 @@ EFL_START_TEST(efl_ui_image_test_icon) } EFL_END_TEST +extern Eo *elm_image_object_get(Eo*); +EFL_START_TEST(efl_ui_image_test_scale_method) +{ + Eo *win, *image; + Eina_Size2D sz; + + win = win_add(NULL, "image", EFL_UI_WIN_TYPE_BASIC); + efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 100)); + + image = efl_add(EFL_UI_IMAGE_CLASS, win, + efl_file_set(efl_added, ELM_IMAGE_DATA_DIR"/images/logo.png"), + efl_gfx_arrangement_content_align_set(efl_added, 0.5, 0.0), + efl_gfx_image_scale_method_set(efl_added, EFL_GFX_IMAGE_SCALE_METHOD_FIT_WIDTH) + ); + efl_gfx_entity_size_set(image, EINA_SIZE2D(100, 100)); + get_me_to_those_events(win); + sz = efl_gfx_entity_size_get(image); + ck_assert_int_eq(sz.w, 100); + ck_assert_int_eq(sz.h, 100); + /* legacy operation on eo object: very illegal */ + sz = efl_gfx_entity_size_get(elm_image_object_get(image)); + ck_assert_int_eq(sz.w, 100); + ck_assert_int_eq(sz.h, 100); +} +EFL_END_TEST + void efl_ui_test_image(TCase *tc) { tcase_add_test(tc, efl_ui_image_test_icon); + tcase_add_test(tc, efl_ui_image_test_scale_method); } diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c index 108ee9f373..888069f2b7 100644 --- a/src/tests/elementary/elm_test_image.c +++ b/src/tests/elementary/elm_test_image.c @@ -277,6 +277,31 @@ EFL_START_TEST(elm_image_test_memfile_set) } EFL_END_TEST +EFL_START_TEST(elm_image_test_scale_method) +{ + Evas_Object *win, *image; + int w, h; + + win = win_add(NULL, "image", ELM_WIN_BASIC); + evas_object_resize(win, 100, 100); + + image = elm_image_add(win); + ck_assert(elm_image_file_set(image, ELM_IMAGE_DATA_DIR"/images/logo.png", NULL)); + evas_object_size_hint_align_set(image, 0.5, 0.0); + efl_gfx_image_scale_method_set(image, EFL_GFX_IMAGE_SCALE_METHOD_FIT_WIDTH); + evas_object_resize(image, 100, 100); + evas_object_show(image); + evas_object_show(win); + get_me_to_those_events(win); + evas_object_geometry_get(image, NULL, NULL, , ); + ck_assert_int_eq(w, 100); + ck_assert_int_eq(h, 100); + evas_object_geometry_get(elm_image_object_get(image), NULL, NULL, , ); + ck_assert_int_eq(w, 100); + ck_assert_int_eq(h, 100); +} +EFL_END_TEST + #ifdef BUILD_LOADER_GIF static void _test_render(void *data, Evas *e EINA_UNUSED, void *event_info) @@ -332,6 +357,7 @@ void elm_test_image(TCase *tc) tcase_add_test(tc, elm_image_evas_object_color_set); tcase_add_test(tc, elm_image_evas_image_get); tcase_add_test(tc, elm_image_test_memfile_set); + tcase_add_test(tc, elm_image_test_scale_method); #ifdef BUILD_LOADER_GIF tcase_add_test(tc, elm_image_test_gif); #endif --
[EGIT] [core/efl] master 01/02: eina/value: use correct time types when comparing time types
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=bc52776fd621e91fb013fbe31c0a5fdc0da3b20d commit bc52776fd621e91fb013fbe31c0a5fdc0da3b20d Author: Mike Blumenkrantz Date: Thu Apr 16 10:44:03 2020 -0400 eina/value: use correct time types when comparing time types these functions all expect struct timeval, as the name implies ../src/lib/eina/eina_value.c: In function ‘_eina_value_type_tm_compare’: ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds] 3358 |struct timeval ret = *input; | ^~~ ../src/lib/eina/eina_value.c:3569:11: note: while referencing ‘ta’ 3569 |time_t ta, tb; | ^~ ../src/lib/eina/eina_value.c:3358:19: warning: array subscript 1 is outside array bounds of ‘time_t[1]’ {aka ‘long int[1]’} [-Warray-bounds] 3358 |struct timeval ret = *input; | ^~~ ../src/lib/eina/eina_value.c:3569:15: note: while referencing ‘tb’ 3569 |time_t ta, tb; Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11715 --- src/lib/eina/eina_value.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/eina/eina_value.c b/src/lib/eina/eina_value.c index c18f369006..b71fa7da96 100644 --- a/src/lib/eina/eina_value.c +++ b/src/lib/eina/eina_value.c @@ -3567,11 +3567,14 @@ _eina_value_type_tm_compare(const Eina_Value_Type *type, const void *a, const vo struct tm tma = *(struct tm*)a; struct tm tmb = *(struct tm*)b; time_t ta, tb; + struct timeval tva = {0}, tvb = {0}; ta = mktime(); tb = mktime(); + tva.tv_sec = ta; + tvb.tv_sec = tb; - return _eina_value_type_timeval_compare(type, , ); + return _eina_value_type_timeval_compare(type, , ); } static Eina_Bool --
[EGIT] [core/efl] master 01/02: elm/win: declare prototype for ecore_evas_dnd_mark_motion_used
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9edce200816b699defea77b1082ffcbf79f3475a commit 9edce200816b699defea77b1082ffcbf79f3475a Author: Mike Blumenkrantz Date: Thu Apr 16 12:10:52 2020 -0400 elm/win: declare prototype for ecore_evas_dnd_mark_motion_used ../src/lib/elementary/efl_ui_win.c: In function ‘_motion_cb’: ../src/lib/elementary/efl_ui_win.c:9271:14: warning: implicit declaration of function ‘ecore_evas_dnd_mark_motion_used’ [-Wimplicit-function-declaration] 9271 | ecore_evas_dnd_mark_motion_used(ee, seat); | ^~~ Differential Revision: https://phab.enlightenment.org/D11717 --- src/lib/elementary/efl_ui_win.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 0c1e960ce5..1ceda1513b 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -40,6 +40,8 @@ #define FRAME_OBJ_THEME_MIN_VERSION 119 +extern void ecore_evas_dnd_mark_motion_used(Ecore_Evas *ee, unsigned int seat); + Ecore_Evas *_wayland_shm_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame); Ecore_Evas *_wayland_egl_new(const char *disp_name, Ecore_Window parent, int x, int y, int w, int h, Eina_Bool frame, const int *opt); --
[EGIT] [core/efl] master 04/07: tests/elm: add hoversel behavior tests
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=034d42855b08c2d43c3593587c7d7aaeb54351d5 commit 034d42855b08c2d43c3593587c7d7aaeb54351d5 Author: Mike Blumenkrantz Date: Thu Apr 2 13:59:28 2020 -0400 tests/elm: add hoversel behavior tests this verifies all smart callbacks for a hoversel to ensure they're triggered as expected Reviewed-by: Stefan Schmidt Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11644 --- src/tests/elementary/elm_test_hoversel.c | 68 1 file changed, 68 insertions(+) diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c index 91de6afee0..0ccc5834da 100644 --- a/src/tests/elementary/elm_test_hoversel.c +++ b/src/tests/elementary/elm_test_hoversel.c @@ -6,6 +6,9 @@ #include #include "elm_suite.h" +#include "elm_priv.h" +#include "elm_widget_hoversel.h" + EFL_START_TEST(elm_hoversel_legacy_type_check) { Evas_Object *win, *hoversel; @@ -41,8 +44,73 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST +EFL_START_TEST(elm_test_hoversel_behavior) +{ + Eo *hoversel, *win = win_add(); + unsigned int i; + const char *callbacks[] = + { + "expanded", + "clicked", + "selected", + "item,focused", + "item,unfocused", + "dismissed", + }; + int count[EINA_C_ARRAY_LENGTH(callbacks)] = {0}; + + evas_object_resize(win, 500, 500); + hoversel = elm_hoversel_add(win); + evas_object_geometry_set(hoversel, 25, 25, 50, 50); + elm_hoversel_hover_parent_set(hoversel, win); + elm_object_text_set(hoversel, "Vertical"); + elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close", ELM_ICON_STANDARD, NULL, NULL); + + evas_object_show(win); + evas_object_show(hoversel); + elm_object_focus_set(hoversel, EINA_TRUE); + for (i = 0; i < EINA_C_ARRAY_LENGTH(count); i++) + { +evas_object_smart_callback_add(hoversel, callbacks[i], + (void*)event_callback_single_call_int_data, [i]); + } + evas_object_smart_callback_add(hoversel, "dismissed", + (void*)event_callback_that_quits_the_main_loop_when_called, NULL); + get_me_to_those_events(win); + assert_object_size_eq(hoversel, 50, 50); + click_object(hoversel); + get_me_to_those_events(win); + + /* expanded */ + ck_assert_int_eq(count[0], 1); + wait_timer(0.6); // from default theme + ecore_main_loop_iterate(); + + ELM_HOVERSEL_DATA_GET(hoversel, sd); + click_object(eina_list_data_get(elm_box_children_get(sd->bx))); + get_me_to_those_events(win); + + /* clicked */ + ck_assert_int_eq(count[1], 1); + /* selected */ + ck_assert_int_eq(count[2], 1); + /* item,focused */ + ck_assert_int_eq(count[3], 1); + /* item,focused */ + ck_assert_int_eq(count[4], 1); + ecore_main_loop_begin(); + + /* dismissed */ + ck_assert_int_eq(count[5], 1); +} +EFL_END_TEST + void elm_test_hoversel(TCase *tc) { tcase_add_test(tc, elm_hoversel_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_test_hoversel_behavior); } --
[EGIT] [core/efl] master 07/07: tests/elm: explicitly destroy hoversel while active
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e1e1e5cf830e725594d8e38ef5c6711ca7d3de4 commit 8e1e1e5cf830e725594d8e38ef5c6711ca7d3de4 Author: Mike Blumenkrantz Date: Wed Apr 8 13:21:27 2020 -0400 tests/elm: explicitly destroy hoversel while active verify that there's no errors when this happens Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11704 --- src/tests/elementary/elm_test_hoversel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c index 58b18b94ce..e00a073b09 100644 --- a/src/tests/elementary/elm_test_hoversel.c +++ b/src/tests/elementary/elm_test_hoversel.c @@ -144,6 +144,8 @@ EFL_START_TEST(elm_test_hoversel_position) ck_assert_int_le(x + w, 500); ck_assert_int_le(y + h, 500); } + + evas_object_del(hoversel); } EFL_END_TEST --
[EGIT] [core/efl] master 01/07: tests/elm: add callback tests for elm_list
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=276c9ed26de31853b26a517ed8564cc47b29447c commit 276c9ed26de31853b26a517ed8564cc47b29447c Author: Mike Blumenkrantz Date: Mon Apr 13 12:43:21 2020 -0400 tests/elm: add callback tests for elm_list basic tests to verify behavior for triggering callbacks when selecting items Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11703 --- src/tests/elementary/elm_test_list.c | 50 1 file changed, 50 insertions(+) diff --git a/src/tests/elementary/elm_test_list.c b/src/tests/elementary/elm_test_list.c index d15fb249f7..063384b235 100644 --- a/src/tests/elementary/elm_test_list.c +++ b/src/tests/elementary/elm_test_list.c @@ -242,6 +242,55 @@ EFL_START_TEST(elm_atspi_children_parent) } EFL_END_TEST +#define NUM_ITEMS 10 +EFL_START_TEST(elm_list_test_callbacks) +{ + Evas_Object *win, *list; + unsigned int i; + int count[NUM_ITEMS] = {0}; + Elm_Object_Item *it; + int selected = 0, unselected = 0; + int highlighted = 0, unhighlighted = 0; + + win = win_add(NULL, "list", ELM_WIN_BASIC); + evas_object_resize(win, 100, 100); + + list = elm_list_add(win); + evas_object_smart_callback_add(list, "selected", (void*)event_callback_that_increments_an_int_when_called, ); + evas_object_smart_callback_add(list, "unselected", (void*)event_callback_that_increments_an_int_when_called, ); + evas_object_smart_callback_add(list, "highlighted", (void*)event_callback_that_increments_an_int_when_called, ); + evas_object_smart_callback_add(list, "unhighlighted", (void*)event_callback_that_increments_an_int_when_called, ); + evas_object_resize(list, 100, 100); + for (i = 0; i < NUM_ITEMS; i++) + elm_list_item_append(list, "item", NULL, NULL, (void*)event_callback_single_call_int_data, &(count[i])); + + elm_list_go(list); + evas_object_show(list); + evas_object_show(win); + get_me_to_those_events(win); + + for (i = 0, it = elm_list_first_item_get(list); i < NUM_ITEMS; i++, it = elm_list_item_next(it)) + { +elm_list_item_selected_set(it, EINA_TRUE); +ck_assert_int_eq(count[i], 1); + +ck_assert_int_eq(selected, i + 1); +ck_assert_int_eq(unselected, i); + +ck_assert_int_eq(highlighted, i + 1); +ck_assert_int_eq(unhighlighted, i); + } + ck_assert_int_eq(selected, 10); + ck_assert_int_eq(unselected, 9); + + ck_assert_int_eq(highlighted, 10); + ck_assert_int_eq(unhighlighted, 9); + + /* weird SIGILL in shutdown if the list isn't deleted here */ + evas_object_del(list); +} +EFL_END_TEST + void elm_test_list(TCase *tc) { tcase_add_test(tc, elm_list_legacy_type_check); @@ -256,4 +305,5 @@ void elm_test_list(TCase *tc) tcase_add_test(tc, elm_list_atspi_selection_child_deselect); #endif tcase_add_test(tc, elm_atspi_children_parent); + tcase_add_test(tc, elm_list_test_callbacks); } --
[EGIT] [core/efl] master 06/07: tests/elm: add hoversel test to verify edge of canvas positioning
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2797827e6b60a640a7ae2c4059445d657c5a79ac commit 2797827e6b60a640a7ae2c4059445d657c5a79ac Author: Mike Blumenkrantz Date: Fri Apr 3 11:50:19 2020 -0400 tests/elm: add hoversel test to verify edge of canvas positioning ensure that T8642 doesn't reoccur Reviewed-by: Stefan Schmidt Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11647 --- src/tests/elementary/elm_test_hoversel.c | 40 1 file changed, 40 insertions(+) diff --git a/src/tests/elementary/elm_test_hoversel.c b/src/tests/elementary/elm_test_hoversel.c index 0ccc5834da..58b18b94ce 100644 --- a/src/tests/elementary/elm_test_hoversel.c +++ b/src/tests/elementary/elm_test_hoversel.c @@ -108,9 +108,49 @@ EFL_START_TEST(elm_test_hoversel_behavior) } EFL_END_TEST +EFL_START_TEST(elm_test_hoversel_position) +{ + Eo *hoversel, *win = win_add(); + + evas_object_resize(win, 500, 500); + hoversel = elm_hoversel_add(win); + evas_object_geometry_set(hoversel, 450, 450, 50, 50); + elm_hoversel_hover_parent_set(hoversel, win); + elm_object_text_set(hoversel, "Vertical"); + elm_hoversel_item_add(hoversel, "Item 1", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 2", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 3", NULL, ELM_ICON_NONE, NULL, NULL); + elm_hoversel_item_add(hoversel, "Item 4 - Long Label Here", "close", ELM_ICON_STANDARD, NULL, NULL); + + evas_object_show(win); + evas_object_show(hoversel); + elm_object_focus_set(hoversel, EINA_TRUE); + + get_me_to_those_events(win); + assert_object_size_eq(hoversel, 50, 50); + click_object(hoversel); + get_me_to_those_events(win); + + wait_timer(0.6); // from default theme + ecore_main_loop_iterate(); + + ELM_HOVERSEL_DATA_GET(hoversel, sd); + { + int x, y, w, h; + Eo *item = eina_list_data_get(elm_box_children_get(sd->bx)); + evas_object_geometry_get(item, , , , ); + + /* verify that all buttons are in-canvas */ + ck_assert_int_le(x + w, 500); + ck_assert_int_le(y + h, 500); + } +} +EFL_END_TEST + void elm_test_hoversel(TCase *tc) { tcase_add_test(tc, elm_hoversel_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_test_hoversel_behavior); + tcase_add_test(tc, elm_test_hoversel_position); } --
[EGIT] [core/efl] master 05/07: elm/hoversel: force calc on internal hover object during activate
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=27f55105334f9d48d8c647610331915cbc4d89dc commit 27f55105334f9d48d8c647610331915cbc4d89dc Author: Mike Blumenkrantz Date: Fri Apr 3 11:38:11 2020 -0400 elm/hoversel: force calc on internal hover object during activate hoversel can't accurately determine its location until the hover object has been calculated, so this needs to always happen before the hoversel is made visible in order to correctly position the hover fix T8642 Reviewed-by: Stefan Schmidt Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11646 --- src/lib/elementary/elc_hoversel.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index 666031f59f..b94aa6177b 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -523,6 +523,8 @@ _activate(Evas_Object *obj) if (_elm_config->access_mode) _access_widget_item_register(sd); efl_event_callback_legacy_call(obj, ELM_HOVERSEL_EVENT_EXPANDED, NULL); + efl_canvas_group_calculate(sd->hover); + _sizing_eval(obj); evas_object_show(sd->hover); } --
[EGIT] [core/efl] master 02/07: elm/hoversel: use a wref to accurately track internal hover object
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=df0a201021f4e83e52f38ebda52b5fd042fe5356 commit df0a201021f4e83e52f38ebda52b5fd042fe5356 Author: Mike Blumenkrantz Date: Thu Apr 2 13:57:21 2020 -0400 elm/hoversel: use a wref to accurately track internal hover object this pointer is never unset, which can cause errors when attempting to access it after the hoversel has been deactivated Differential Revision: https://phab.enlightenment.org/D11642 --- src/lib/elementary/elc_hoversel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index 2f742f2051..857fe81dc2 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -478,7 +478,7 @@ _activate(Evas_Object *obj) sd->expanded = EINA_TRUE; - sd->hover = elm_hover_add(sd->hover_parent); + efl_wref_add(elm_hover_add(sd->hover_parent), >hover); efl_event_callback_add(sd->hover, EFL_EVENT_KEY_DOWN, _hover_key_down, obj); elm_widget_sub_object_add(obj, sd->hover); --
[EGIT] [core/efl] master 03/07: elm/hoversel: remove unnecessary internal callback deletion
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=272c3d9a665039711c1045b6fc540b2486139d9c commit 272c3d9a665039711c1045b6fc540b2486139d9c Author: Mike Blumenkrantz Date: Thu Apr 2 13:58:26 2020 -0400 elm/hoversel: remove unnecessary internal callback deletion this already happens automatically on every item destruction and passes the item data through there to ensure the correct callback is removed Reviewed-by: Stefan Schmidt Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11643 --- src/lib/elementary/elc_hoversel.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/elementary/elc_hoversel.c b/src/lib/elementary/elc_hoversel.c index 857fe81dc2..666031f59f 100644 --- a/src/lib/elementary/elc_hoversel.c +++ b/src/lib/elementary/elc_hoversel.c @@ -667,7 +667,6 @@ _elm_hoversel_efl_canvas_group_group_del(Eo *obj, Elm_Hoversel_Data *sd) { Elm_Object_Item *eo_item; - evas_object_event_callback_del(sd->hover, EVAS_CALLBACK_DEL, _auto_update); EINA_LIST_FREE(sd->items, eo_item) { ELM_HOVERSEL_ITEM_DATA_GET(eo_item, it); @@ -820,7 +819,6 @@ _elm_hoversel_clear(Eo *obj EINA_UNUSED, Elm_Hoversel_Data *sd) { Elm_Object_Item *it; - evas_object_event_callback_del(sd->hover, EVAS_CALLBACK_DEL, _auto_update); EINA_LIST_FREE(sd->items, it) { efl_del(it); --
[EGIT] [core/efl] master 01/01: tests/efl: use alloca for composite model test future to avoid leak
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e88311ae955b2d54356c455fc05e7c2ff7abaa66 commit e88311ae955b2d54356c455fc05e7c2ff7abaa66 Author: Mike Blumenkrantz Date: Wed Apr 15 10:44:09 2020 -0400 tests/efl: use alloca for composite model test future to avoid leak CID 1407236 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11711 --- src/tests/efl/efl_test_composite_model.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/tests/efl/efl_test_composite_model.c b/src/tests/efl/efl_test_composite_model.c index d91b243519..b2e0fa630b 100644 --- a/src/tests/efl/efl_test_composite_model.c +++ b/src/tests/efl/efl_test_composite_model.c @@ -43,8 +43,7 @@ _children_slice_get_then(Eo *o EINA_UNUSED, Efl_Model *child; Eina_Future **all; - all = calloc(1, sizeof (Eina_Future *) * (eina_value_array_count() + 1)); - if (!all) return eina_value_error_init(ENOMEM); + all = alloca(sizeof (Eina_Future *) * (eina_value_array_count() + 1)); EINA_VALUE_ARRAY_FOREACH(, len, i, child) { --
[EGIT] [core/efl] master 05/05: efl/wl: fix namespacing conflict in rotation enum
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=63e5216951b5c0e78f8cfdb8d046647dfcf91acf commit 63e5216951b5c0e78f8cfdb8d046647dfcf91acf Author: Mike Blumenkrantz Date: Wed Apr 8 09:47:53 2020 -0400 efl/wl: fix namespacing conflict in rotation enum Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11667 --- src/lib/efl_canvas_wl/efl_canvas_wl.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.eo b/src/lib/efl_canvas_wl/efl_canvas_wl.eo index 4481ef4f12..843f034dc2 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.eo @@ -11,7 +11,7 @@ struct @beta @extern Efl.Canvas.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ] struct @beta @extern Efl.Canvas.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]] -enum @beta Efl.Canvas.Wl.Rotation +enum @beta Efl.Canvas.Wl_Rotation { [[Orientation of the internal compositor object in degrees. These values are COUNTER-CLOCKWISE. ]] @@ -122,7 +122,7 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group Note that the rotation provided here is counter-clockwise. ]] values { -rotation: Efl.Canvas.Wl.Rotation; [[The rotation to apply to the internal output.]] +rotation: Efl.Canvas.Wl_Rotation; [[The rotation to apply to the internal output.]] rtl: bool; [[The horizontal flip to apply to the internal output.]] } } --
[EGIT] [core/efl] master 02/07: ci: force system zlib on osx
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c9f9582753b9e0c4091af544a2be54ee2fdea70f commit c9f9582753b9e0c4091af544a2be54ee2fdea70f Author: Mike Blumenkrantz Date: Mon Apr 6 17:24:07 2020 -0400 ci: force system zlib on osx osx doesn't ship a pkgconfig file for its own zlib, so now we're shipping a pkgconfig file for their zlib to avoid future issues Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11661 --- .ci/ci-configure.sh | 5 - .ci/zlib.pc | 13 + 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/.ci/ci-configure.sh b/.ci/ci-configure.sh index 10730003e6..41e63ad24a 100755 --- a/.ci/ci-configure.sh +++ b/.ci/ci-configure.sh @@ -94,8 +94,11 @@ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then export CFLAGS="-I/usr/local/opt/openssl/include -frewrite-includes $CFLAGS" export LDFLAGS="-L/usr/local/opt/openssl/lib $LDFLAGS" LIBFFI_VER=$(brew list --versions libffi|head -n1|cut -d' ' -f2) - export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig" export CC="ccache gcc" + #force using system zlib, which doesn't have a pc file provided because that's the smartest thing possible + zlib_vers=$(grep ZLIB_VERSION /usr/include/zlib.h|head -n1|awk '{print $3}'|cut -d'"' -f2) + sed -iE "s/REPLACE_THIS/$zlib_vers/" .ci/zlib.pc + export PKG_CONFIG_PATH="/usr/local/opt/openssl/lib/pkgconfig:/usr/local/Cellar/libffi/$LIBFFI_VER/lib/pkgconfig:$(pwd)/.ci" travis_fold meson meson mkdir build && meson build -Dopengl=full -Decore-imf-loaders-disabler=scim,ibus -Dx11=false -Davahi=false -Deeze=false -Dsystemd=false -Dnls=false -Dcocoa=true -Dgstreamer=false travis_endfold meson diff --git a/.ci/zlib.pc b/.ci/zlib.pc new file mode 100644 index 00..e217860219 --- /dev/null +++ b/.ci/zlib.pc @@ -0,0 +1,13 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib64 +sharedlibdir=${libdir} +includedir=/usr/include + +Name: zlib +Description: zlib compression library +Version: REPLACE_THIS + +Requires: +Libs: -L${libdir} -L${sharedlibdir} -lz +Cflags: -I${includedir} --
[EGIT] [core/efl] master 04/05: tests/layout: add explicit test for freeze and thaw no-op correctness
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6f933e01c708341e09ad6803925dc8e04765a418 commit 6f933e01c708341e09ad6803925dc8e04765a418 Author: Mike Blumenkrantz Date: Tue Mar 31 12:58:09 2020 -0400 tests/layout: add explicit test for freeze and thaw no-op correctness this shouldn't trigger any canvas changes since nothing is happening during the freeze Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11631 --- src/tests/elementary/efl_ui_test_layout.c | 21 + 1 file changed, 21 insertions(+) diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c index 4d6e7c848b..4e1b117b6c 100644 --- a/src/tests/elementary/efl_ui_test_layout.c +++ b/src/tests/elementary/efl_ui_test_layout.c @@ -223,6 +223,26 @@ EFL_START_TEST(efl_ui_layout_test_versioning) } EFL_END_TEST +EFL_START_TEST(efl_ui_layout_test_freeze) +{ + Evas_Object *win; + int count = 0; + + win = win_add(NULL, "layout", EFL_UI_WIN_TYPE_BASIC); + efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 100)); + Eo *layout = efl_add(EFL_UI_BUTTON_CLASS, win); + efl_gfx_entity_size_set(layout, EINA_SIZE2D(100, 100)); + efl_text_set(layout, "button"); + get_me_to_those_events(layout); + + efl_event_callback_add(win, EFL_CANVAS_SCENE_EVENT_RENDER_PRE, (void*)event_callback_single_call_int_data, ); + efl_layout_calc_freeze(layout); + efl_layout_calc_thaw(layout); + force_render(win); + ck_assert_int_eq(count, 0); +} +EFL_END_TEST + void efl_ui_test_layout(TCase *tc) { tcase_add_test(tc, efl_ui_layout_test_property_bind); @@ -234,4 +254,5 @@ void efl_ui_test_layout(TCase *tc) tcase_add_test(tc, efl_ui_layout_test_callback); tcase_add_test(tc, efl_ui_layout_test_property_bind_provider); tcase_add_test(tc, efl_ui_layout_test_versioning); + tcase_add_test(tc, efl_ui_layout_test_freeze); } --
[EGIT] [core/efl] master 01/05: efl_ui/layout: correctly batch object changed state when using freeze/thaw
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=39b7069a0ba7dc2d3df2766c83a609ed8299cda5 commit 39b7069a0ba7dc2d3df2766c83a609ed8299cda5 Author: Mike Blumenkrantz Date: Tue Mar 31 12:40:25 2020 -0400 efl_ui/layout: correctly batch object changed state when using freeze/thaw previously this would always queue a recalc when calling thaw even if the object hadn't changed also mimic edje internal behavior with unsetting 'frozen' during force calc for possible future handling even though it has no effect presently Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11628 --- src/lib/elementary/efl_ui_layout.c | 19 +-- src/lib/elementary/efl_ui_layout_base.eo | 1 + src/lib/elementary/elm_widget_layout.h | 1 + 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index cc1f8e93a0..209665b1ad 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -1925,6 +1925,16 @@ _efl_ui_layout_base_efl_layout_group_part_exist_get(const Eo *obj, Efl_Ui_Layout return efl_layout_group_part_exist_get(wd->resize_obj, part); } +EOLIAN static void +_efl_ui_layout_base_efl_canvas_group_group_change(Eo *obj, Efl_Ui_Layout_Data *sd) +{ + if (sd->frozen) + /* cleared in thaw */ + sd->frozen_changed = EINA_TRUE; + else + efl_canvas_group_change(efl_super(obj, MY_CLASS)); +} + EOLIAN static void _elm_layout_efl_canvas_group_change(Eo *obj, Elm_Layout_Data *ld) { @@ -1991,7 +2001,9 @@ _efl_ui_layout_base_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd) if (!ret) { sd->frozen = EINA_FALSE; -efl_canvas_group_change(obj); +if (sd->frozen_changed) + efl_canvas_group_change(obj); +sd->frozen_changed = EINA_FALSE; } return ret; @@ -2026,10 +2038,13 @@ _efl_ui_layout_base_efl_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Efl_ } EOLIAN void -_efl_ui_layout_base_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED) +_efl_ui_layout_base_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd) { + Eina_Bool prev_frozen = sd->frozen; ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + sd->frozen = EINA_FALSE; efl_layout_calc_force(wd->resize_obj); + sd->frozen = prev_frozen; } static Eina_Bool diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo index 8cd206c310..91b4f49049 100644 --- a/src/lib/elementary/efl_ui_layout_base.eo +++ b/src/lib/elementary/efl_ui_layout_base.eo @@ -110,6 +110,7 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container, Efl.Object.finalize; Efl.Object.invalidate; Efl.Canvas.Group.group_calculate; + Efl.Canvas.Group.group_change; Efl.Layout.Calc.calc_freeze; Efl.Layout.Calc.calc_thaw; Efl.Layout.Calc.calc_auto_update_hints { get; set; } diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index 69565b6fd9..a024656c7d 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h @@ -76,6 +76,7 @@ typedef struct _Efl_Ui_Layout_Data Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ Eina_Bool cb_theme_changed : 1; /**< if theme,changed event subscriber has been added */ Eina_Bool needs_theme_apply : 1; /**< if theme has not been manually set during construction */ + Eina_Bool frozen_changed : 1; /**< only set if object was changed while frozen */ } Efl_Ui_Layout_Data; typedef struct _Elm_Layout_Data --
[EGIT] [core/efl] master 02/05: tests/elm: add helper macros for asserting size and position of objects
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8aaff3ba0771e9fa17abb3325b44eb4940361edd commit 8aaff3ba0771e9fa17abb3325b44eb4940361edd Author: Mike Blumenkrantz Date: Tue Mar 31 12:53:10 2020 -0400 tests/elm: add helper macros for asserting size and position of objects Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11629 --- src/tests/elementary/suite_helpers.h | 18 ++ 1 file changed, 18 insertions(+) diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index b2a394b981..cf7b1e7490 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -45,4 +45,22 @@ void wheel_object_at(Eo *obj, int x, int y, Eina_Bool horiz, Eina_Bool down); void event_callback_single_call_int_data(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED); void event_callback_that_quits_the_main_loop_when_called(); void event_callback_that_increments_an_int_when_called(void *data, Evas_Object *obj, void *event_info); + + + +#define assert_object_size_eq(obj, width, height) \ +do \ +{ \ + Eina_Size2D _sz = efl_gfx_entity_size_get((obj)); \ + ck_assert_int_eq(_sz.w, (width)); \ + ck_assert_int_eq(_sz.h, (height)); \ +} while (0) + +#define assert_object_pos_eq(obj, _x, _y) \ +do \ +{ \ + Eina_Position2D _pos = efl_gfx_entity_position_get((obj)); \ + ck_assert_int_eq(_pos.x, (_x)); \ + ck_assert_int_eq(_pos.y, (_y)); \ +} while (0) #endif --
[EGIT] [core/efl] master 05/05: tests/hover: add behavior tests for elm_hover
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5565e904795ce32ba734a3022f01753acb1dd738 commit 5565e904795ce32ba734a3022f01753acb1dd738 Author: Mike Blumenkrantz Date: Tue Mar 31 12:58:47 2020 -0400 tests/hover: add behavior tests for elm_hover verify geometry and smart callback triggering Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11632 --- src/tests/elementary/elm_test_hover.c | 48 +++ 1 file changed, 48 insertions(+) diff --git a/src/tests/elementary/elm_test_hover.c b/src/tests/elementary/elm_test_hover.c index de275216f2..323eb5c8d6 100644 --- a/src/tests/elementary/elm_test_hover.c +++ b/src/tests/elementary/elm_test_hover.c @@ -41,8 +41,56 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST +EFL_START_TEST(elm_test_hover_behavior) +{ + Evas_Object *win, *hover, *target, *rect; + int count = 0; + int count_dismiss = 0; + int count_clicked = 0; + + win = win_add(NULL, "hover", ELM_WIN_BASIC); + evas_object_resize(win, 100, 100); + + hover = elm_hover_add(win); + evas_object_smart_callback_add(hover, "smart,changed", event_callback_that_increments_an_int_when_called, ); + evas_object_smart_callback_add(hover, "dismissed", event_callback_single_call_int_data, _dismiss); + evas_object_smart_callback_add(hover, "clicked", event_callback_single_call_int_data, _clicked); + + target = elm_box_add(win); + + elm_hover_parent_set(hover, win); + elm_hover_target_set(hover, target); + + rect = evas_object_rectangle_add(evas_object_evas_get(win)); + evas_object_size_hint_min_set(rect, 20, 20); + evas_object_show(rect); + elm_object_part_content_set(hover, "smart", rect); + + evas_object_move(target, 40, 40); + evas_object_show(win); + evas_object_show(hover); + get_me_to_those_events(hover); + + /* 1 from setting content, 1 from moving target object */ + ck_assert_int_eq(count, 2); + + assert_object_size_eq(rect, 20, 20); + assert_object_size_eq(hover, 0, 0); + assert_object_pos_eq(hover, 40, 40); + /* using non-centered slot */ + assert_object_pos_eq(rect, 40, 30); + + elm_hover_dismiss(hover); + get_me_to_those_events(hover); + /* these are both triggered on dismiss */ + ck_assert_int_eq(count_dismiss, 1); + ck_assert_int_eq(count_clicked, 1); +} +EFL_END_TEST + void elm_test_hover(TCase *tc) { tcase_add_test(tc, elm_hover_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_test_hover_behavior); } --
[EGIT] [core/efl] master 03/05: tests/elm: add wrapper for forcing manual render in tests
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=426967c7781ccb7d5bb0aa3ddfdaa7055dd6a27e commit 426967c7781ccb7d5bb0aa3ddfdaa7055dd6a27e Author: Mike Blumenkrantz Date: Tue Mar 31 12:57:28 2020 -0400 tests/elm: add wrapper for forcing manual render in tests this can be useful when a test needs to immediately verify whether a render is occurring Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D11630 --- src/tests/elementary/suite_helpers.c | 6 ++ src/tests/elementary/suite_helpers.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index e6c6441957..a5d8b051de 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -821,3 +821,9 @@ write_key_sequence(Eo *obj, const char *seqence) ecore_main_loop_iterate(); } } + +void +force_render(Eo *win) +{ + _win_manual_render(win, NULL); +} diff --git a/src/tests/elementary/suite_helpers.h b/src/tests/elementary/suite_helpers.h index cf7b1e7490..4afae79024 100644 --- a/src/tests/elementary/suite_helpers.h +++ b/src/tests/elementary/suite_helpers.h @@ -46,7 +46,7 @@ void event_callback_single_call_int_data(void *data, Evas_Object *obj EINA_UNUSE void event_callback_that_quits_the_main_loop_when_called(); void event_callback_that_increments_an_int_when_called(void *data, Evas_Object *obj, void *event_info); - +void force_render(Eo *win); #define assert_object_size_eq(obj, width, height) \ do \ --
[EGIT] [core/efl] master 03/03: evas/text: remove paragraph_direction inherit during render
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6fb79af116a7202c997a6799bb479b390e3b4dbd commit 6fb79af116a7202c997a6799bb479b390e3b4dbd Author: Mike Blumenkrantz Date: Fri Mar 20 11:27:42 2020 -0400 evas/text: remove paragraph_direction inherit during render this is unnecessary: * for the text object itself, the value is correctly set whenever the paragraph_direction property is changed * for inheritance, smart object already implements propagation which triggers on member add or property change Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11549 --- src/lib/evas/canvas/evas_object_text.c | 16 1 file changed, 16 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_text.c b/src/lib/evas/canvas/evas_object_text.c index 8d13082d24..b054302a6d 100644 --- a/src/lib/evas/canvas/evas_object_text.c +++ b/src/lib/evas/canvas/evas_object_text.c @@ -2067,22 +2067,6 @@ evas_object_text_render_pre(Evas_Object *eo_obj, obj->cur->clipper->private_data); } -#ifdef BIDI_SUPPORT - if (o->inherit_paragraph_direction) - { -Evas_BiDi_Direction parent_dir = EVAS_BIDI_DIRECTION_NEUTRAL; - -if (obj->smart.parent) - parent_dir = evas_object_paragraph_direction_get(obj->smart.parent); - -if (parent_dir != o->paragraph_direction) - { - o->paragraph_direction = parent_dir; - o->changed_paragraph_direction = EINA_TRUE; - } - } -#endif - /* If object size changed and ellipsis is set */ if (((o->cur.ellipsis >= 0.0) && ((obj->cur->geometry.w != o->last_computed.w) || --
[EGIT] [core/efl] master 02/03: ecore-evas/cocoa: fix cnp leak
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=00a93423a6965574e78b6fcc7223e0409c1ecf82 commit 00a93423a6965574e78b6fcc7223e0409c1ecf82 Author: Mike Blumenkrantz Date: Thu Mar 26 10:46:20 2020 -0400 ecore-evas/cocoa: fix cnp leak this pointer needs to be freed if it's being copied Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11604 --- src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c index c8e2895358..b876f0da47 100644 --- a/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c +++ b/src/modules/ecore_evas/engines/cocoa/ecore_evas_cocoa.c @@ -523,6 +523,7 @@ _ecore_evas_cocoa_selection_request(Ecore_Evas *ee EINA_UNUSED, unsigned int sea //ensure that we always have a \0 at the end, there is no assertion that \0 is included here. slice.len = size + 1; slice.mem = eina_memdup(data, size, EINA_TRUE); + free(data); } else { --
[EGIT] [core/efl] master 09/15: edje/multisense: track and destroy multisense inputs on shutdown
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e45767b00443e7a5ea3a13e22b9620f6eedc872e commit e45767b00443e7a5ea3a13e22b9620f6eedc872e Author: Mike Blumenkrantz Date: Tue Mar 17 12:07:49 2020 -0400 edje/multisense: track and destroy multisense inputs on shutdown leaking these means leaking file references, and there's no reason for it Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11533 --- src/lib/edje/edje_multisense.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c index b1575f464c..1bbb457ae3 100644 --- a/src/lib/edje/edje_multisense.c +++ b/src/lib/edje/edje_multisense.c @@ -5,11 +5,13 @@ static Eo *out = NULL; static int outs = 0; +static Eina_List *ins = NULL; static Eina_Bool outfail = EINA_FALSE; static void _play_finished(void *data EINA_UNUSED, const Efl_Event *event) { + ins = eina_list_remove(ins, event->object); efl_unref(event->object); } @@ -245,6 +247,7 @@ _edje_multisense_internal_sound_sample_play(Edje *ed, const char *sample_name, c efl_unref(in); return EINA_FALSE; } + ins = eina_list_append(ins, in); } } return EINA_TRUE; @@ -348,6 +351,7 @@ void _edje_multisense_shutdown(void) { #ifdef ENABLE_MULTISENSE + Eo *in; if (outs > 0) { WRN("Shutting down audio while samples still playing"); @@ -358,6 +362,8 @@ _edje_multisense_shutdown(void) out = NULL; outs = 0; } + EINA_LIST_FREE(ins, in) + efl_unref(in); ecore_audio_shutdown(); #endif } --
[EGIT] [core/efl] master 08/15: edje/multisense: free multisense output on shutdown
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d10882ef141579239a585ba9610dfa524e8685c9 commit d10882ef141579239a585ba9610dfa524e8685c9 Author: Mike Blumenkrantz Date: Tue Mar 17 12:07:28 2020 -0400 edje/multisense: free multisense output on shutdown this comment has now been addressed Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11532 --- src/lib/edje/edje_multisense.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c index 7bf2b8f363..b1575f464c 100644 --- a/src/lib/edje/edje_multisense.c +++ b/src/lib/edje/edje_multisense.c @@ -354,8 +354,7 @@ _edje_multisense_shutdown(void) } if (out) { -// XXX: this causes an abort inside of pa! -//efl_unref(out); +efl_unref(out); out = NULL; outs = 0; } --
[EGIT] [core/efl] master 07/15: ecore/audio: rewrite pulseaudio output to not use global variables
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9324bcc3617caf76ef50a6eefb7e51b6d987a0b4 commit 9324bcc3617caf76ef50a6eefb7e51b6d987a0b4 Author: Mike Blumenkrantz Date: Tue Mar 17 12:06:13 2020 -0400 ecore/audio: rewrite pulseaudio output to not use global variables this breaks down immediately when calling init/shutdown in quick succession due to the async nature of pulseaudio. we have object-based private data, so we can just use that instead Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11531 --- src/lib/ecore_audio/ecore_audio_obj_out_pulse.c | 125 ++-- 1 file changed, 76 insertions(+), 49 deletions(-) diff --git a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c index 5d61e0eb3e..edcc924acb 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c +++ b/src/lib/ecore_audio/ecore_audio_obj_out_pulse.c @@ -25,27 +25,19 @@ extern pa_mainloop_api functable; #define MY_CLASS ECORE_AUDIO_OUT_PULSE_CLASS #define MY_CLASS_NAME "Ecore_Audio_Out_Pulse" -struct _Ecore_Audio_Pulse_Class { - pa_mainloop_api *api; - pa_context *context; - pa_context_state_t state; - Ecore_Job *state_job; - Eina_List *outputs; -}; - -static struct _Ecore_Audio_Pulse_Class class_vars = { -.api = , -}; - struct _Ecore_Audio_Out_Pulse_Data { - char *foo; + pa_mainloop_api *api; + pa_context *context; + pa_context_state_t state; + Ecore_Job *state_job; + Eina_List *outputs; }; typedef struct _Ecore_Audio_Out_Pulse_Data Ecore_Audio_Out_Pulse_Data; EOLIAN static void -_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, double volume) +_ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd, double volume) { Eo *in; pa_stream *stream = NULL; @@ -65,7 +57,7 @@ _ecore_audio_out_pulse_ecore_audio_volume_set(Eo *eo_obj, Ecore_Audio_Out_Pulse_ EINA_LIST_FOREACH(out_obj->inputs, input, in) { stream = efl_key_data_get(in, "pulse_data"); idx = EPA_CALL(pa_stream_get_index)(stream); - EPA_CALL(pa_operation_unref)(EPA_CALL(pa_context_set_sink_input_volume)(class_vars.context, idx, _volume, NULL, NULL)); + EPA_CALL(pa_operation_unref)(EPA_CALL(pa_context_set_sink_input_volume)(pd->context, idx, _volume, NULL, NULL)); } } @@ -114,6 +106,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in) pa_stream *stream; Eina_Bool ret = EINA_FALSE; Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); + Ecore_Audio_Out_Pulse_Data *pd = efl_data_scope_get(eo_obj, MY_CLASS); if (!EPA_LOAD()) return EINA_FALSE; ret = ecore_audio_obj_out_input_attach(efl_super(eo_obj, MY_CLASS), in); @@ -128,7 +121,7 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in) ss.rate = ss.rate * speed; - stream = EPA_CALL(pa_stream_new)(class_vars.context, name, , NULL); + stream = EPA_CALL(pa_stream_new)(pd->context, name, , NULL); if (!stream) { ERR("Could not create stream"); ecore_audio_obj_out_input_detach(efl_super(eo_obj, MY_CLASS), in); @@ -151,18 +144,27 @@ static Eina_Bool _input_attach_internal(Eo *eo_obj, Eo *in) static void _delayed_attach_cb(void *data, const Efl_Event *event) { - Eo *in = data; - efl_event_callback_del(event->object, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in); + efl_event_callback_del(event->object, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, data); - _input_attach_internal(event->object, in); + _input_attach_internal(event->object, data); +} + +static Eina_Bool +_is_input_attached(Eo *eo_obj, Eo *in) +{ + Ecore_Audio_Output *out_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_OUT_CLASS); + if (!out_obj->inputs) return EINA_FALSE; + return !!eina_list_data_find(out_obj->inputs, in); } EOLIAN static Eina_Bool -_ecore_audio_out_pulse_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in) +_ecore_audio_out_pulse_ecore_audio_out_input_attach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *pd, Eo *in) { Eina_Bool retval = EINA_TRUE; - if (class_vars.state != PA_CONTEXT_READY) { + if (_is_input_attached(eo_obj, in)) return EINA_TRUE; + + if (pd->state != PA_CONTEXT_READY) { DBG("Delaying input_attach because PA context is not ready."); efl_event_callback_add(eo_obj, ECORE_AUDIO_OUT_PULSE_EVENT_CONTEXT_READY, _delayed_attach_cb, in); } else { @@ -180,16 +182,32 @@ static void _drain_cb(pa_stream *stream, int success EINA_UNUSED, void *data EIN } EOLIAN static Eina_Bool -_ecore_audio_out_pulse_ecore_audio_out_input_detach(Eo *eo_obj, Ecore_Audio_Out_Pulse_Data *_pd EINA_UNUSED, Eo *in) +_ecore_audio_out_pulse_ecore_
[EGIT] [core/efl] master 05/15: ecore/audio: remove duplicated vio code from sndfile input
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a29d54d1d81a85a0927b4973b1fbfc0c6ed4a162 commit a29d54d1d81a85a0927b4973b1fbfc0c6ed4a162 Author: Mike Blumenkrantz Date: Tue Mar 17 12:04:38 2020 -0400 ecore/audio: remove duplicated vio code from sndfile input this is already done in the base implementation Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11529 --- src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c | 30 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c index bebfba59d2..93cf66ff49 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c @@ -135,15 +135,6 @@ _ecore_audio_in_sndfile_ecore_audio_format_get(const Eo *eo_obj, Ecore_Audio_In_ return obj->format;; } -static void _free_vio(Ecore_Audio_Object *ea_obj) -{ - if (ea_obj->vio->free_func) -ea_obj->vio->free_func(ea_obj->vio->data); - - free(ea_obj->vio); - ea_obj->vio = NULL; -} - EOLIAN static void _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj, Ecore_Audio_Vio *vio, void *data, efl_key_data_free_func free_func) { @@ -156,22 +147,16 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D obj->handle = NULL; } - eina_stringshare_replace(_obj->source, "VIO"); - - if (!ea_obj->source) -return; - if (ea_obj->vio) -_free_vio(ea_obj); + if (vio) +eina_stringshare_replace(_obj->source, "VIO"); + else +eina_stringshare_replace(_obj->source, NULL); in_obj->seekable = EINA_FALSE; + ecore_audio_obj_vio_set(efl_super(eo_obj, MY_CLASS), vio, data, free_func); if (!vio) return; - - ea_obj->vio = calloc(1, sizeof(Ecore_Audio_Vio_Internal)); - ea_obj->vio->vio = vio; - ea_obj->vio->data = data; - ea_obj->vio->free_func = free_func; in_obj->seekable = (vio->seek != NULL); obj->handle = ESF_CALL(sf_open_virtual)(_wrapper, SFM_READ, >sfinfo, eo_obj); @@ -201,14 +186,9 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D EOLIAN static void _ecore_audio_in_sndfile_efl_object_destructor(Eo *eo_obj, Ecore_Audio_In_Sndfile_Data *obj) { - Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); - if (obj->handle) ESF_CALL(sf_close)(obj->handle); - if (ea_obj->vio) -_free_vio(ea_obj); - efl_destructor(efl_super(eo_obj, MY_CLASS)); } --
[EGIT] [core/efl] master 06/15: ecore/audio: correctly handle sndfile error when setting new vio
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=1af46ef30251c47480f93b2774ab87146021cede commit 1af46ef30251c47480f93b2774ab87146021cede Author: Mike Blumenkrantz Date: Tue Mar 17 12:05:01 2020 -0400 ecore/audio: correctly handle sndfile error when setting new vio need to immediately call the free here to avoid leaking the callback data Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11530 --- src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c index 93cf66ff49..dc4bd4578d 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c @@ -162,6 +162,10 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_In_Sndfile_D obj->handle = ESF_CALL(sf_open_virtual)(_wrapper, SFM_READ, >sfinfo, eo_obj); if (!obj->handle) { +if (ea_obj->vio->free_func) + ea_obj->vio->free_func(ea_obj->vio->data); +free(ea_obj->vio); +ea_obj->vio = NULL; eina_stringshare_del(ea_obj->source); ea_obj->source = NULL; return; --
[EGIT] [core/efl] master 03/15: ecore/audio: free vio on in/out object destruction
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c697965a8c72e13be834b5a1e10dc5ff8d4766ea commit c697965a8c72e13be834b5a1e10dc5ff8d4766ea Author: Mike Blumenkrantz Date: Tue Mar 17 12:03:03 2020 -0400 ecore/audio: free vio on in/out object destruction ensure we don't leak these since that means we also leak the user's free data and callback Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11527 --- src/lib/ecore_audio/ecore_audio_obj_in.c | 8 +++- src/lib/ecore_audio/ecore_audio_obj_out.c | 4 +++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c index dcb792c8af..64ce45ba54 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in.c @@ -187,9 +187,15 @@ _ecore_audio_in_efl_object_constructor(Eo *eo_obj, Ecore_Audio_Input *obj) EOLIAN static void _ecore_audio_in_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Input *obj) { + Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); if(obj->output) -ecore_audio_obj_out_input_detach(obj->output, eo_obj); +{ + if (!ecore_audio_obj_out_input_detach(obj->output, eo_obj)) + ERR("Failed to detach output %p!", obj->output); +} + if (ea_obj->vio) +_free_vio(ea_obj); efl_destructor(efl_super(eo_obj, MY_CLASS)); } diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c index 4c05b218da..7a51e8c73d 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_out.c +++ b/src/lib/ecore_audio/ecore_audio_obj_out.c @@ -147,11 +147,13 @@ _ecore_audio_out_efl_object_destructor(Eo *eo_obj, Ecore_Audio_Output *obj) { Eina_List *cur, *tmp; Eo *in; + Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); EINA_LIST_FOREACH_SAFE(obj->inputs, cur, tmp, in) { ecore_audio_obj_out_input_detach(eo_obj, in); } - + if (ea_obj->vio) +_free_vio(ea_obj); efl_destructor(efl_super(eo_obj, MY_CLASS)); } --
[EGIT] [core/efl] master 04/15: ecore/audio: add a couple more functions to the pulse callback struct
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e5625dbe66a82cb892d7e1b0ad204bdc7379bff commit 8e5625dbe66a82cb892d7e1b0ad204bdc7379bff Author: Mike Blumenkrantz Date: Tue Mar 17 12:03:52 2020 -0400 ecore/audio: add a couple more functions to the pulse callback struct to be used later Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11528 --- src/lib/ecore_audio/ecore_audio.c | 2 ++ src/lib/ecore_audio/ecore_audio_private.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/lib/ecore_audio/ecore_audio.c b/src/lib/ecore_audio/ecore_audio.c index 1c0345ed73..be2e40c74c 100644 --- a/src/lib/ecore_audio/ecore_audio.c +++ b/src/lib/ecore_audio/ecore_audio.c @@ -144,6 +144,7 @@ ecore_audio_pulse_lib_load(void) goto err; \ } SYM(pa_context_new); + SYM(pa_context_unref); SYM(pa_context_connect); SYM(pa_context_set_sink_input_volume); SYM(pa_context_get_state); @@ -155,6 +156,7 @@ ecore_audio_pulse_lib_load(void) SYM(pa_stream_connect_playback); SYM(pa_stream_disconnect); SYM(pa_stream_drain); + SYM(pa_stream_flush); SYM(pa_stream_cork); SYM(pa_stream_write); SYM(pa_stream_begin_write); diff --git a/src/lib/ecore_audio/ecore_audio_private.h b/src/lib/ecore_audio/ecore_audio_private.h index 03947b120f..f406f4a1e7 100644 --- a/src/lib/ecore_audio/ecore_audio_private.h +++ b/src/lib/ecore_audio/ecore_audio_private.h @@ -168,6 +168,7 @@ struct _Ecore_Audio_Lib_Pulse Eina_Module *mod; pa_context *(*pa_context_new) (pa_mainloop_api *mainloop, const char *name); + pa_context *(*pa_context_unref) (pa_context *c); int (*pa_context_connect) (pa_context *c, const char *server, pa_context_flags_t flags, const pa_spawn_api *api); pa_operation *(*pa_context_set_sink_input_volume) (pa_context *c, uint32_t idx, const pa_cvolume *volume, pa_context_success_cb_t cb, void *userdata); pa_context_state_t (*pa_context_get_state) (pa_context *c); @@ -179,6 +180,7 @@ struct _Ecore_Audio_Lib_Pulse int (*pa_stream_connect_playback) (pa_stream *s, const char *dev, const pa_buffer_attr *attr, pa_stream_flags_t flags, const pa_cvolume *volume, pa_stream *sync_stream); int (*pa_stream_disconnect) (pa_stream *s); pa_operation *(*pa_stream_drain) (pa_stream *s, pa_stream_success_cb_t cb, void *userdata); + pa_operation *(*pa_stream_flush) (pa_stream *s, pa_stream_success_cb_t cb, void *userdata); pa_operation *(*pa_stream_cork) (pa_stream *s, int b, pa_stream_success_cb_t cb, void *userdata); int (*pa_stream_write) (pa_stream *p, const void *data, size_t nbytes, pa_free_cb_t free_cb, int64_t offset, pa_seek_mode_t seek); int (*pa_stream_begin_write)(pa_stream *p, void **data, size_t *nbytes); --
[EGIT] [core/efl] master 02/15: ecore/audio: add ERR messages when trying to overwrite existing vio
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e8eb67a557485caaca3733ae66f4da4c36517134 commit e8eb67a557485caaca3733ae66f4da4c36517134 Author: Mike Blumenkrantz Date: Tue Mar 17 12:02:23 2020 -0400 ecore/audio: add ERR messages when trying to overwrite existing vio this probably causes a crash or a leak at some point Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11526 --- src/lib/ecore_audio/ecore_audio_obj_in.c | 5 - src/lib/ecore_audio/ecore_audio_obj_out.c | 5 - 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore_audio/ecore_audio_obj_in.c b/src/lib/ecore_audio/ecore_audio_obj_in.c index b2a8f912c3..dcb792c8af 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_in.c +++ b/src/lib/ecore_audio/ecore_audio_obj_in.c @@ -155,7 +155,10 @@ _ecore_audio_in_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Input *obj, Ecore_Au Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); if (ea_obj->vio) -_free_vio(ea_obj); +{ + ERR("VIO already set!"); + _free_vio(ea_obj); +} obj->seekable = obj->seekable_prev; diff --git a/src/lib/ecore_audio/ecore_audio_obj_out.c b/src/lib/ecore_audio/ecore_audio_obj_out.c index 7e1d39beca..4c05b218da 100644 --- a/src/lib/ecore_audio/ecore_audio_obj_out.c +++ b/src/lib/ecore_audio/ecore_audio_obj_out.c @@ -118,7 +118,10 @@ _ecore_audio_out_ecore_audio_vio_set(Eo *eo_obj, Ecore_Audio_Output *_pd EINA_UN Ecore_Audio_Object *ea_obj = efl_data_scope_get(eo_obj, ECORE_AUDIO_CLASS); if (ea_obj->vio) -_free_vio(ea_obj); +{ + ERR("VIO already set!"); + _free_vio(ea_obj); +} if (!vio) return; --
[EGIT] [core/efl] master 01/01: evas/render: minor cleanups for norender functions
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6068cc9039243d493d001df7a35426cd7c5acfea commit 6068cc9039243d493d001df7a35426cd7c5acfea Author: Mike Blumenkrantz Date: Wed Mar 25 09:27:16 2020 -0400 evas/render: minor cleanups for norender functions Summary: evas_norender cannot produce update regions, so there's nothing to free remove commented lines no functional changes Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11584 --- src/lib/evas/canvas/evas_render.c | 12 +--- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 6a0d7fab0f..27cf2c52d6 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -4081,17 +4081,8 @@ _evas_canvas_render(Eo *eo_e, Evas_Public_Data *e) EOLIAN void _evas_canvas_norender(Eo *eo_e, Evas_Public_Data *e) { - Eina_List *ret; - Render_Updates *ru; - evas_canvas_async_block(e); - // if (!e->changed) return; - ret = evas_render_updates_internal_wait(eo_e, 0, 0); - EINA_LIST_FREE(ret, ru) - { -eina_rectangle_free(ru->area); -free(ru); - } + evas_render_updates_internal_wait(eo_e, 0, 0); } EAPI void @@ -4102,7 +4093,6 @@ evas_norender_with_updates(Eo *eo_e) Render_Updates *ru; evas_canvas_async_block(e); - // if (!e->changed) return; ret = evas_render_updates_internal_wait(eo_e, 1, 0); EINA_LIST_FREE(ret, ru) { --
[EGIT] [core/efl] master 01/04: evas/render: produce update regions when do_draw isn't set but make_updates is
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b37ebdad253f1505df7f95eea3a8e8830d7b58b3 commit b37ebdad253f1505df7f95eea3a8e8830d7b58b3 Author: Mike Blumenkrantz Date: Tue Mar 24 13:22:09 2020 -0400 evas/render: produce update regions when do_draw isn't set but make_updates is Summary: this is a valid combination of parameters that should be handled Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11581 --- src/lib/evas/canvas/evas_render.c | 42 +-- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index db9f14bf1f..c7dff56336 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -3618,6 +3618,33 @@ evas_render_updates_internal(Evas *eo_e, eina_evlog("-render_surface", eo_e, 0.0, NULL); } +else if (make_updates) + { + Render_Updates *ru; + void *surface; + int ux, uy, uw, uh; + int cx, cy, cw, ch; + while ((surface = + ENFN->output_redraws_next_update_get + (ENC, out->output, + , , , , + , , , ))) + { + haveup = EINA_TRUE; + + /* adjust the rendering rectangle to the output offset */ + ux += out->geometry.x; + uy += out->geometry.y; + ru = malloc(sizeof(*ru)); + ru->surface = surface; + //XXX: need a way of reffing output surfaces + NEW_RECT(ru->area, ux, uy, uw, uh); + eina_spinlock_take(&(e->render.lock)); + out->updates = eina_list_append(out->updates, ru); + eina_spinlock_release(&(e->render.lock)); + } + + } } /* First process all output, then flush */ @@ -3789,14 +3816,17 @@ evas_render_updates_internal(Evas *eo_e, Render_Updates *ru; post.updated_area = NULL; -EINA_LIST_FOREACH(e->outputs, l1, out) +if (haveup) { - if (!out->output) continue ; - EINA_LIST_FOREACH(out->updates, l2, ru) + EINA_LIST_FOREACH(e->outputs, l1, out) { - post.updated_area = eina_list_append(post.updated_area, ru->area); - //XXX: need a way of unreffing output surfaces - ru->surface = NULL; + if (!out->output) continue ; + EINA_LIST_FOREACH(out->updates, l2, ru) +{ + post.updated_area = eina_list_append(post.updated_area, ru->area); + //XXX: need a way of unreffing output surfaces + ru->surface = NULL; +} } } eina_spinlock_take(&(e->render.lock)); --
[EGIT] [core/efl] master 03/04: tests/elm: use norender_with_updates
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=6268bb36ead96702ac3edf2c15e5fe7e4fb6af1d commit 6268bb36ead96702ac3edf2c15e5fe7e4fb6af1d Author: Mike Blumenkrantz Date: Tue Mar 24 13:22:16 2020 -0400 tests/elm: use norender_with_updates Summary: Depends on D11582 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11583 --- src/tests/elementary/suite_helpers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tests/elementary/suite_helpers.c b/src/tests/elementary/suite_helpers.c index e31e302c9f..6ecb9ac2b0 100644 --- a/src/tests/elementary/suite_helpers.c +++ b/src/tests/elementary/suite_helpers.c @@ -166,7 +166,7 @@ _win_manual_render(void *data, const Efl_Event *event EINA_UNUSED) ecore_loop_time_set(t + LOOP_INCREMENT); ecore_animator_custom_tick(); ecore_evas_render_prepare(ecore_evas_ecore_evas_get(evas_object_evas_get(data))); - evas_norender(evas_object_evas_get(data)); + evas_norender_with_updates(evas_object_evas_get(data)); } static void --
[EGIT] [core/efl] master 02/04: evas: add function for norendering with updates
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8fe64fb70c38ccc583e0708a62f33e22245e9175 commit 8fe64fb70c38ccc583e0708a62f33e22245e9175 Author: Mike Blumenkrantz Date: Tue Mar 24 13:22:12 2020 -0400 evas: add function for norendering with updates Summary: the same as norender, but useful Depends on D11581 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11582 --- src/lib/evas/canvas/evas_canvas_eo.legacy.h | 15 +++ src/lib/evas/canvas/evas_render.c | 17 + 2 files changed, 32 insertions(+) diff --git a/src/lib/evas/canvas/evas_canvas_eo.legacy.h b/src/lib/evas/canvas/evas_canvas_eo.legacy.h index 88a6591168..edd47fd76b 100644 --- a/src/lib/evas/canvas/evas_canvas_eo.legacy.h +++ b/src/lib/evas/canvas/evas_canvas_eo.legacy.h @@ -533,6 +533,21 @@ EAPI void evas_focus_out(Evas_Canvas *obj); */ EAPI void evas_norender(Evas_Canvas *obj); +/** + * @brief Update the canvas internal objects but not triggering immediate + * renderization and producing update regions in post-render event. + * + * This function updates the canvas internal objects not triggering + * renderization. To force renderization function @ref evas_render should be + * used. + * @param[in] obj The object. + * + * @since 1.24 + * + * @ingroup Evas_Group + */ +EAPI void evas_norender_with_updates(Eo *eo_e); + /** * @brief Pop the nochange flag down 1. * diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index c7dff56336..08252d2326 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -4104,6 +4104,23 @@ _evas_canvas_norender(Eo *eo_e, Evas_Public_Data *e) } } +EAPI void +evas_norender_with_updates(Eo *eo_e) +{ + Evas_Public_Data *e = efl_data_scope_get(eo_e, EVAS_CANVAS_CLASS); + Eina_List *ret; + Render_Updates *ru; + + evas_canvas_async_block(e); + // if (!e->changed) return; + ret = evas_render_updates_internal_wait(eo_e, 1, 0); + EINA_LIST_FREE(ret, ru) + { +eina_rectangle_free(ru->area); +free(ru); + } +} + EOLIAN void _evas_canvas_render_idle_flush(Eo *eo_e, Evas_Public_Data *evas) { --
[EGIT] [core/efl] master 04/04: tests/elm: add strict test to verify elm image gif support
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f4a877d17d62430be1395fa64c9a18f4c43d06cf commit f4a877d17d62430be1395fa64c9a18f4c43d06cf Author: Mike Blumenkrantz Date: Tue Mar 24 13:22:19 2020 -0400 tests/elm: add strict test to verify elm image gif support Summary: Depends on D11583 Reviewers: kimcinoo, Hermet, raster, cedric, bu5hm4n Reviewed By: bu5hm4n Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11484 --- src/tests/elementary/elm_test_image.c | 49 +++ 1 file changed, 49 insertions(+) diff --git a/src/tests/elementary/elm_test_image.c b/src/tests/elementary/elm_test_image.c index bfd6dad3dd..108ee9f373 100644 --- a/src/tests/elementary/elm_test_image.c +++ b/src/tests/elementary/elm_test_image.c @@ -277,6 +277,52 @@ EFL_START_TEST(elm_image_test_memfile_set) } EFL_END_TEST +#ifdef BUILD_LOADER_GIF +static void +_test_render(void *data, Evas *e EINA_UNUSED, void *event_info) +{ + int *pass = data; + Evas_Event_Render_Post *ev = event_info; + *pass = eina_list_count(ev->updated_area); + ecore_main_loop_quit(); +} + +static void +_test_preload(void *data, Evas *e, Evas_Object *obj, void *event_info EINA_UNUSED) +{ + if (evas_object_image_load_error_get(obj) == EVAS_LOAD_ERROR_NONE) + evas_event_callback_add(e, EVAS_CALLBACK_RENDER_POST, _test_render, data); + else + ecore_main_loop_quit(); +} + +EFL_START_TEST(elm_image_test_gif) +{ + Evas_Object *win, *image; + int pass = 0; + + win = win_add(NULL, "image", ELM_WIN_BASIC); + + image = elm_image_add(win); + evas_object_resize(win, 100, 100); + evas_object_resize(image, 100, 100); + evas_object_show(win); + evas_object_show(image); + + get_me_to_those_events(win); + ck_assert(elm_image_file_set(image, ELM_IMAGE_DATA_DIR"/images/fire.gif", NULL)); + elm_image_animated_set(image, EINA_TRUE); + elm_image_animated_play_set(image, EINA_TRUE); + evas_object_event_callback_add(elm_image_object_get(image), EVAS_CALLBACK_IMAGE_PRELOADED, _test_preload, ); + /* verify that we haven't tried to set a frame with index 0, as this is an error */ + ck_assert_int_gt(evas_object_image_animated_frame_get(elm_image_object_get(image)), 0); + ecore_main_loop_begin(); + ck_assert_int_gt(pass, 0); +} +EFL_END_TEST + +#endif + void elm_test_image(TCase *tc) { tcase_add_test(tc, elm_image_legacy_type_check); @@ -286,4 +332,7 @@ void elm_test_image(TCase *tc) tcase_add_test(tc, elm_image_evas_object_color_set); tcase_add_test(tc, elm_image_evas_image_get); tcase_add_test(tc, elm_image_test_memfile_set); +#ifdef BUILD_LOADER_GIF + tcase_add_test(tc, elm_image_test_gif); +#endif } --
[EGIT] [core/efl] master 03/03: efl/wl: explicitly use restricted size hints for min/max
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2f033a801e97cfc75cb05826746ff77f1ee659b2 commit 2f033a801e97cfc75cb05826746ff77f1ee659b2 Author: Mike Blumenkrantz Date: Thu Mar 12 13:17:14 2020 -0400 efl/wl: explicitly use restricted size hints for min/max need to be clear here since we own these objects Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11500 --- src/lib/efl_canvas_wl/efl_canvas_wl.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 23413110ef..6430ff84a0 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -1192,18 +1192,18 @@ shell_surface_activate_recurse(Comp_Surface *cs) static void shell_surface_minmax_update(Comp_Surface *cs) { - int w, h; + Eina_Size2D sz; if (!cs) return; if (!cs->c->minmax) return; if (cs->extracted) return; if (cs->parent) return; - evas_object_size_hint_min_get(cs->obj, , ); - evas_object_size_hint_min_set(cs->c->obj, w, h); - evas_object_size_hint_max_get(cs->obj, , ); - if (!w) w = -1; - if (!h) h = -1; - evas_object_size_hint_max_set(cs->c->obj, w, h); + sz = efl_gfx_hint_size_restricted_min_get(cs->obj); + efl_gfx_hint_size_restricted_min_set(cs->c->obj, sz); + sz = efl_gfx_hint_size_restricted_max_get(cs->obj); + if (!sz.w) sz.w = -1; + if (!sz.h) sz.h = -1; + efl_gfx_hint_size_restricted_max_set(cs->c->obj, sz); } static void @@ -3209,7 +3209,7 @@ static void shell_surface_toplevel_set_max_size(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t w, int32_t h) { Comp_Surface *cs = wl_resource_get_user_data(resource); - evas_object_size_hint_max_set(cs->obj, w, h); + efl_gfx_hint_size_restricted_max_set(cs->obj, EINA_SIZE2D(w, h)); if (cs == cs->c->active_surface) shell_surface_minmax_update(cs); } @@ -3218,7 +3218,7 @@ static void shell_surface_toplevel_set_min_size(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, int32_t w, int32_t h) { Comp_Surface *cs = wl_resource_get_user_data(resource); - evas_object_size_hint_min_set(cs->obj, w, h); + efl_gfx_hint_size_restricted_min_set(cs->obj, EINA_SIZE2D(w, h)); if (cs == cs->c->active_surface) shell_surface_minmax_update(cs); } @@ -5725,8 +5725,8 @@ _efl_canvas_wl_minmax_propagate_set(Eo *obj, Comp *c, Eina_Bool set) shell_surface_minmax_update(c->active_surface); else { -evas_object_size_hint_min_set(obj, 0, 0); -evas_object_size_hint_max_set(obj, -1, -1); +efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(0, 0)); +efl_gfx_hint_size_restricted_max_set(obj, EINA_SIZE2D(-1, -1)); } } --
[EGIT] [core/efl] master 02/09: efl_ui/image: implement efl.player::autoplay for image widgets
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c18327d5df1735b7d18f4d7194692079f3879c6c commit c18327d5df1735b7d18f4d7194692079f3879c6c Author: Mike Blumenkrantz Date: Mon Feb 10 11:05:35 2020 -0500 efl_ui/image: implement efl.player::autoplay for image widgets this just calls efl.player::playing_set any time autoplay is true and the internal image object is preloaded ref T8589 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11306 --- src/bin/elementary/test_photocam.c | 4 +- src/lib/elementary/efl_ui_image.c | 46 -- src/lib/elementary/efl_ui_image.eo | 2 +- src/lib/elementary/efl_ui_image_zoomable.c | 23 +++ src/lib/elementary/efl_ui_image_zoomable.eo| 2 +- src/lib/elementary/efl_ui_image_zoomable_private.h | 1 + src/lib/elementary/efl_ui_widget_image.h | 1 + 7 files changed, 71 insertions(+), 8 deletions(-) diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index de7b827a84..9f357d9ef0 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -153,7 +153,7 @@ my_bt_open(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) if (file && eina_str_has_extension(file, ".gif") && efl_playable_get(ph)) - efl_player_playing_set(ph, EINA_TRUE); + efl_player_autoplay_set(ph, EINA_TRUE); } static void @@ -834,7 +834,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE if (efl_playable_get(zoomable)) { printf("animation is available for this image.\n"); -efl_player_playing_set(zoomable, EINA_TRUE); +efl_player_autoplay_set(zoomable, EINA_TRUE); } rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index 2684b0f364..c1e0eb80f2 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -103,7 +103,11 @@ _on_image_preloaded(void *data, if (sd->show) evas_object_show(obj); _prev_img_del(sd); err = evas_object_image_load_error_get(obj); - if (!err) evas_object_smart_callback_call(sd->self, SIG_LOAD_READY, NULL); + if (!err) + { +evas_object_smart_callback_call(sd->self, SIG_LOAD_READY, NULL); +if (sd->autoplay) efl_player_playing_set(sd->self, EINA_TRUE); + } else evas_object_smart_callback_call(sd->self, SIG_LOAD_ERROR, NULL); } @@ -436,7 +440,11 @@ _efl_ui_image_async_open_done(void *data, Ecore_Thread *thread) ok = !_efl_ui_image_smart_internal_file_set(sd->self, sd); } } - if (ok) evas_object_smart_callback_call(sd->self, SIG_LOAD_OPEN, NULL); + if (ok) +{ + evas_object_smart_callback_call(sd->self, SIG_LOAD_OPEN, NULL); + if (sd->autoplay) efl_player_playing_set(sd->self, EINA_TRUE); +} else evas_object_smart_callback_call(sd->self, SIG_LOAD_ERROR, NULL); } } @@ -528,6 +536,7 @@ _efl_ui_image_edje_file_set(Evas_Object *obj) } else return _efl_ui_image_async_file_set(obj, sd); + if (sd->autoplay) efl_player_playing_set(sd->self, EINA_TRUE); /* FIXME: do i want to update icon on file change ? */ efl_canvas_group_change(obj); @@ -1036,7 +1045,10 @@ _efl_ui_image_smart_internal_file_set(Eo *obj, Efl_Ui_Image_Data *sd) } if (sd->preload_status == EFL_UI_IMAGE_PRELOAD_DISABLED) - _prev_img_del(sd); + { +_prev_img_del(sd); +if (sd->autoplay) efl_player_playing_set(sd->self, EINA_TRUE); + } else { evas_object_hide(sd->img); @@ -1808,6 +1820,29 @@ _efl_ui_image_efl_player_playing_get(const Eo *obj, Efl_Ui_Image_Data *sd) return _efl_ui_image_animated_get_internal(obj, sd); } +EOLIAN static void +_efl_ui_image_efl_player_autoplay_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool autoplay) +{ + autoplay = !!autoplay; + if (sd->autoplay == autoplay) return; + sd->autoplay = autoplay; + if (sd->img && (!sd->edje)) + { +/* filter cases where we aren't going to immediately start playing */ +if (!autoplay) return; +if ((sd->preload_status != EFL_UI_IMAGE_PRELOADED) && +(sd->preload_status != EFL_UI_IMAGE_PRELOAD_DISABLED)) + return; + } + efl_player_playing_set(obj, EINA_TRUE); +} + +EOLIAN static Eina_Bool +_efl_ui_image_efl_player_autoplay_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) +{ + return sd->autoplay; +
[EGIT] [core/efl] master 05/09: efl/layout: add @empty for missing efl.player methods
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e66a3bc5588650228cb59ced3671d05dcc19db7e commit e66a3bc5588650228cb59ced3671d05dcc19db7e Author: Mike Blumenkrantz Date: Mon Feb 10 12:14:39 2020 -0500 efl/layout: add @empty for missing efl.player methods need to at least track these Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11309 --- src/lib/edje/efl_canvas_layout.eo | 5 + 1 file changed, 5 insertions(+) diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo index ef33c5bd8f..b6ef1cbb71 100644 --- a/src/lib/edje/efl_canvas_layout.eo +++ b/src/lib/edje/efl_canvas_layout.eo @@ -127,7 +127,12 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl. Efl.Part.part_get; [[Returns @Efl.Canvas.Layout_Part]] Efl.Observer.update; Efl.Playable.playable { get; } + @empty Efl.Player.playing { get; set; } Efl.Player.paused { get; set; } + @empty Efl.Player.playback_position { get; set; } + @empty Efl.Player.playback_progress { get; set; } Efl.Player.playback_speed { get; set; } + @empty Efl.Player.autoplay { set; get; } + @empty Efl.Player.playback_loop { set; get; } } } --
[EGIT] [core/efl] master 07/09: efl/layout: add explicit doc note about efl.player property defaults
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=41299c2b095394a0fca4abed874b84261d8319ba commit 41299c2b095394a0fca4abed874b84261d8319ba Author: Mike Blumenkrantz Date: Mon Feb 10 12:21:11 2020 -0500 efl/layout: add explicit doc note about efl.player property defaults Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D11311 --- src/lib/edje/efl_canvas_layout.eo | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/edje/efl_canvas_layout.eo b/src/lib/edje/efl_canvas_layout.eo index b6ef1cbb71..348cb719e1 100644 --- a/src/lib/edje/efl_canvas_layout.eo +++ b/src/lib/edje/efl_canvas_layout.eo @@ -6,7 +6,10 @@ class @beta Efl.Canvas.Layout extends Efl.Canvas.Group implements Efl.File, Efl. Efl.Player, Efl.Playable, Efl.Gfx.Color_Class, Efl.Gfx.Text_Class, Efl.Gfx.Size_Class { - [[Edje object class]] + [[Edje object class + + The @Efl.Player.autoplay and @Efl.Player.playback_loop properties both default to $true in this class. + ]] event_c_prefix: efl_layout; data: Edje; methods { --
[EGIT] [core/efl] master 06/09: efl/player: add doc note about default values for new (1.24) properties
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=220daf5664d3ce411b0498d2fbe6d864e0785d6e commit 220daf5664d3ce411b0498d2fbe6d864e0785d6e Author: Mike Blumenkrantz Date: Mon Feb 10 12:15:57 2020 -0500 efl/player: add doc note about default values for new (1.24) properties we're going to be overriding the default in at least some classes, so make sure we make it explicit that the behavior is documented Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D11310 --- src/lib/efl/interfaces/efl_player.eo | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/efl/interfaces/efl_player.eo b/src/lib/efl/interfaces/efl_player.eo index 82411fa7f4..9ec9b2b1ad 100644 --- a/src/lib/efl/interfaces/efl_player.eo +++ b/src/lib/efl/interfaces/efl_player.eo @@ -112,7 +112,7 @@ interface Efl.Player get { } values { - autoplay: bool; [[Auto play mode, Default is $false.]] + autoplay: bool; [[Auto play mode, Default is $false unless specified by the implementing class.]] } } @property playback_loop { @@ -129,7 +129,7 @@ interface Efl.Player get { } values { - looping: bool; [[Loop mode, Default is $false.]] + looping: bool; [[Loop mode, Default is $false unless specified by the implementing class.]] } } } --
[EGIT] [core/efl] master 08/09: evas/render: fix log ptr access in render thread
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e4ecb159e7701fe4b7a3595fcb7541dfb3d3649d commit e4ecb159e7701fe4b7a3595fcb7541dfb3d3649d Author: Mike Blumenkrantz Date: Wed Mar 18 12:29:21 2020 -0400 evas/render: fix log ptr access in render thread when this lock is released, the evas may be immediately freed, leading to invalid access in the log call Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11536 --- src/lib/evas/canvas/evas_render.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_render.c b/src/lib/evas/canvas/evas_render.c index 4738c80480..db9f14bf1f 100644 --- a/src/lib/evas/canvas/evas_render.c +++ b/src/lib/evas/canvas/evas_render.c @@ -3943,9 +3943,11 @@ evas_render_pipe_wakeup(void *data) Render_Updates *ru; Evas_Public_Data *evas = data; Efl_Canvas_Output *out; + Evas *e; eina_evlog("+render_pipe_wakeup", evas->evas, 0.0, NULL); eina_spinlock_take(&(evas->render.lock)); + e = evas->evas; EINA_LIST_FOREACH(evas->outputs, ll, out) { if (!out->output) continue ; @@ -3967,7 +3969,8 @@ evas_render_pipe_wakeup(void *data) } eina_spinlock_release(&(evas->render.lock)); evas_async_events_put(data, 0, NULL, evas_render_async_wakeup); - eina_evlog("-render_pipe_wakeup", evas->evas, 0.0, NULL); + /* use local pointer to avoid data race with 'evas' deref after releasing lock */ + eina_evlog("-render_pipe_wakeup", e, 0.0, NULL); } EAPI void --
[EGIT] [core/efl] master 03/09: efl_ui/image_zoomable: unset timer pointer when canceling animation timer
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=df561eb725b7c20c43e56893c9825b7ae990f9a1 commit df561eb725b7c20c43e56893c9825b7ae990f9a1 Author: Mike Blumenkrantz Date: Mon Feb 10 12:10:09 2020 -0500 efl_ui/image_zoomable: unset timer pointer when canceling animation timer make sure we have no stale pointers later on in this case Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11307 --- src/lib/elementary/efl_ui_image_zoomable.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 8045ec6363..64f6ce210f 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -3004,7 +3004,11 @@ _efl_ui_image_zoomable_animate_cb(void *data) EFL_UI_IMAGE_ZOOMABLE_DATA_GET(data, sd); _grid_clear_all(data); - if (!sd->anim) return ECORE_CALLBACK_CANCEL; + if (!sd->anim) + { +sd->anim_timer = NULL; +return ECORE_CALLBACK_CANCEL; + } sd->cur_frame++; if ((sd->frame_count > 0) && (sd->cur_frame > sd->frame_count)) --
[EGIT] [core/efl] master 04/09: efl_ui/image: implement efl.player::playback_loop property
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=831d445cc01decc3dddf0e62d3878821ee932ba7 commit 831d445cc01decc3dddf0e62d3878821ee932ba7 Author: Mike Blumenkrantz Date: Mon Feb 10 12:11:03 2020 -0500 efl_ui/image: implement efl.player::playback_loop property this enables the existing looping functionality only when playback_loop is set (which is always set for legacy widgets) fix T8589 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11308 --- src/bin/elementary/test_photocam.c | 5 +--- src/lib/elementary/efl_ui_image.c | 26 ++- src/lib/elementary/efl_ui_image.eo | 2 +- src/lib/elementary/efl_ui_image_zoomable.c | 30 -- src/lib/elementary/efl_ui_image_zoomable.eo| 2 +- src/lib/elementary/efl_ui_image_zoomable_private.h | 1 + src/lib/elementary/efl_ui_widget_image.h | 1 + 7 files changed, 58 insertions(+), 9 deletions(-) diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index 9f357d9ef0..558b221c9a 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -150,10 +150,6 @@ my_bt_open(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) eina_list_free(grps); } - - if (file && eina_str_has_extension(file, ".gif") - && efl_playable_get(ph)) - efl_player_autoplay_set(ph, EINA_TRUE); } static void @@ -835,6 +831,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE { printf("animation is available for this image.\n"); efl_player_autoplay_set(zoomable, EINA_TRUE); +efl_player_playback_loop_set(zoomable, EINA_TRUE); } rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win, diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index c1e0eb80f2..9cc59b0dd0 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -137,7 +137,16 @@ _efl_ui_image_animate_cb(void *data) sd->cur_frame++; if ((sd->frame_count > 0) && (sd->cur_frame > sd->frame_count)) - sd->cur_frame = sd->cur_frame % sd->frame_count; + { +if (sd->playback_loop) + sd->cur_frame = sd->cur_frame % sd->frame_count; +else + { + sd->anim_timer = NULL; + sd->cur_frame = 0; + return EINA_FALSE; + } + } evas_object_image_animated_frame_set(sd->img, sd->cur_frame); @@ -593,6 +602,7 @@ _efl_ui_image_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Data *priv) { evas_object_event_callback_add (priv->hit_rect, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up, obj); +priv->playback_loop = EINA_TRUE; } else { @@ -1753,6 +1763,7 @@ _efl_ui_image_animated_set_internal(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool an { edje_object_animation_set(sd->img, anim); sd->anim = anim; +efl_player_playback_loop_set(sd->img, sd->playback_loop); return EINA_TRUE; } sd->img = elm_image_object_get(obj); @@ -1820,6 +1831,19 @@ _efl_ui_image_efl_player_playing_get(const Eo *obj, Efl_Ui_Image_Data *sd) return _efl_ui_image_animated_get_internal(obj, sd); } +EOLIAN static void +_efl_ui_image_efl_player_playback_loop_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd, Eina_Bool playback_loop) +{ + playback_loop = !!playback_loop; + sd->playback_loop = playback_loop; +} + +EOLIAN static Eina_Bool +_efl_ui_image_efl_player_playback_loop_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Data *sd) +{ + return sd->playback_loop; +} + EOLIAN static void _efl_ui_image_efl_player_autoplay_set(Eo *obj, Efl_Ui_Image_Data *sd, Eina_Bool autoplay) { diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo index 392251e4de..9ebb14982c 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -104,7 +104,7 @@ class Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui. Efl.Player.playback_progress { get; set; } Efl.Player.playback_speed { get; set; } Efl.Player.autoplay { set; get; } - @empty Efl.Player.playback_loop { set; get; } + Efl.Player.playback_loop { set; get; } Efl.Layout.Signal.signal_emit; Efl.Layout.Signal.message_send; Efl.Layout.Signal.signal_callback_add; diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 64f6ce210f..6b7370350c 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -1835,7 +1835,10 @@ _efl_ui_image_zoomable_ef
[EGIT] [core/efl] master 01/01: efl/hint: update doc for default weight hint value
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b5c24af2e14c9a56dbba0f61119281c06da66758 commit b5c24af2e14c9a56dbba0f61119281c06da66758 Author: Mike Blumenkrantz Date: Fri Mar 20 11:59:58 2020 +0100 efl/hint: update doc for default weight hint value Summary: the default is actually 1.0 and always has been for unified api Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11544 --- src/lib/efl/interfaces/efl_gfx_hint.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_gfx_hint.eo b/src/lib/efl/interfaces/efl_gfx_hint.eo index 676c5ba1ec..d60ee1b297 100644 --- a/src/lib/efl/interfaces/efl_gfx_hint.eo +++ b/src/lib/efl/interfaces/efl_gfx_hint.eo @@ -229,7 +229,7 @@ interface Efl.Gfx.Hint use this hint as a boolean, but some others might consider it as a proportion, see documentation of each container. - Note: Default weight hint values are 0.0, for both axis. + Note: Default weight hint values are 1.0, for both axis. ]] values { x: double; [[Non-negative double value to use as horizontal weight hint.]] --
[EGIT] [core/efl] master 01/01: efl/wl: auto-unset weight if popups provide a size in their positioner
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b631aae420f269dc68e089604d3b8ae73790efd6 commit b631aae420f269dc68e089604d3b8ae73790efd6 Author: Mike Blumenkrantz Date: Thu Mar 19 12:06:18 2020 -0400 efl/wl: auto-unset weight if popups provide a size in their positioner Summary: we "sometimes" set this to EXPAND,EXPAND in the base efl object constructor, so we need to unset that in this case Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11543 --- src/lib/efl_canvas_wl/efl_canvas_wl.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 521e41d191..23413110ef 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -983,7 +983,12 @@ _apply_positioner(Comp_Surface *cs, Shell_Positioner *sp) h = zy + zh - y; } evas_object_move(cs->obj, zx + x, zy + y); - if (w > 0) evas_object_resize(cs->obj, w, h); + if (w > 0) + { +if (!cs->hint_set_weight) + evas_object_size_hint_weight_set(cs->obj, 0, 0); +evas_object_resize(cs->obj, w, h); + } } static const struct wl_data_offer_interface data_device_offer_interface = --
[EGIT] [core/efl] master 01/01: efl/wl: don't delete group clipper on object destruction
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=33d17369acff1d80dbf46363583b1bd9899e28d1 commit 33d17369acff1d80dbf46363583b1bd9899e28d1 Author: Mike Blumenkrantz Date: Thu Mar 19 11:14:54 2020 -0400 efl/wl: don't delete group clipper on object destruction Summary: this is already handled internally in evas Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11542 --- src/lib/efl_canvas_wl/efl_canvas_wl.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 734378fcff..521e41d191 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -5369,7 +5369,6 @@ _efl_canvas_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) EOLIAN static void _efl_canvas_wl_efl_canvas_group_group_del(Eo *obj, Comp *c) { - evas_object_del(c->clip); evas_object_del(c->events); free(c->env); if (c->gl) comp_gl_shutdown(c); --
[EGIT] [core/enlightenment] master 01/01: update gadget runner smart events to stable api
zmike pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=a08304fdd00f71de0d828ed85377adadeecc186c commit a08304fdd00f71de0d828ed85377adadeecc186c Author: Mike Blumenkrantz Date: Thu Mar 19 10:54:58 2020 -0400 update gadget runner smart events to stable api the legacy events here are no longer emitted fix T8633 --- src/bin/e_gadget_runner.c | 20 +++- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c index f3ec13d6f..39a008ed9 100644 --- a/src/bin/e_gadget_runner.c +++ b/src/bin/e_gadget_runner.c @@ -558,10 +558,11 @@ child_close(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info } static void -child_added(void *data, Evas_Object *obj, void *event_info) +child_added(void *data, const Efl_Event *ev) { Evas_Object *popup, *bx; - E_Zone *zone = e_comp_object_util_zone_get(obj); + Eo *event_info = ev->info; + E_Zone *zone = e_comp_object_util_zone_get(ev->object); Instance *inst = data; if (!efl_canvas_wl_surface_extract(event_info)) return; @@ -712,9 +713,10 @@ tooltip_content_cb(void *data, Evas_Object *obj EINA_UNUSED, Evas_Object *toolti } static void -popup_added(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +popup_added(void *data, const Efl_Event *ev) { Instance *inst = data; + Eo *event_info = ev->info; Evas_Object *bx; if (!efl_canvas_wl_surface_extract(event_info)) return; @@ -787,10 +789,10 @@ popup_added(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) } static void -seat_added(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_UNUSED) +seat_added(void *data EINA_UNUSED, const Efl_Event *ev) { - efl_canvas_wl_seat_keymap_set(obj, NULL, e_comp_wl->xkb.state, e_comp_wl->xkb.map_string, _comp_wl->kbd.keys); - efl_canvas_wl_seat_key_repeat_set(obj, NULL, e_config->keyboard.repeat_rate, e_config->keyboard.repeat_delay); + efl_canvas_wl_seat_keymap_set(ev->object, NULL, e_comp_wl->xkb.state, e_comp_wl->xkb.map_string, _comp_wl->kbd.keys); + efl_canvas_wl_seat_key_repeat_set(ev->object, NULL, e_config->keyboard.repeat_rate, e_config->keyboard.repeat_delay); } static void @@ -887,10 +889,10 @@ gadget_create(Evas_Object *parent, Config_Item *ci, int *id, E_Gadget_Site_Orien efl_canvas_wl_aspect_propagate_set(inst->obj, 1); efl_canvas_wl_minmax_propagate_set(inst->obj, 1); efl_canvas_wl_global_add(inst->obj, _gadget_interface, 1, inst, gadget_bind); - evas_object_smart_callback_add(inst->obj, "child_added", child_added, inst); - evas_object_smart_callback_add(inst->obj, "popup_added", popup_added, inst); + efl_event_callback_add(inst->obj, EFL_CANVAS_WL_EVENT_CHILD_ADDED, child_added, inst); + efl_event_callback_add(inst->obj, EFL_CANVAS_WL_EVENT_POPUP_ADDED, popup_added, inst); if (e_comp->comp_type == E_PIXMAP_TYPE_WL) - evas_object_smart_callback_add(inst->obj, "seat_added", seat_added, inst); + efl_event_callback_add(inst->obj, EFL_CANVAS_WL_EVENT_SEAT_ADDED, seat_added, inst); e_comp_wl_extension_action_route_interface_get(_version); efl_canvas_wl_global_add(inst->obj, _route_interface, ar_version, inst, ar_bind); evas_object_event_callback_add(inst->obj, EVAS_CALLBACK_MOUSE_DOWN, mouse_down, inst); --
[EGIT] [core/enlightenment] master 01/01: final gadget runner efl.canvas.wl api update
zmike pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=0cce17f3cc2b59236c4ec2eb003e261e34b6bef2 commit 0cce17f3cc2b59236c4ec2eb003e261e34b6bef2 Author: Mike Blumenkrantz Date: Fri Mar 13 12:19:39 2020 -0400 final gadget runner efl.canvas.wl api update --- src/bin/e_gadget_runner.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c index bf8c8e80f..f3ec13d6f 100644 --- a/src/bin/e_gadget_runner.c +++ b/src/bin/e_gadget_runner.c @@ -884,8 +884,8 @@ gadget_create(Evas_Object *parent, Config_Item *ci, int *id, E_Gadget_Site_Orien } E_EXPAND(inst->obj); E_FILL(inst->obj); - efl_canvas_wl_aspect_set(inst->obj, 1); - efl_canvas_wl_minmax_set(inst->obj, 1); + efl_canvas_wl_aspect_propagate_set(inst->obj, 1); + efl_canvas_wl_minmax_propagate_set(inst->obj, 1); efl_canvas_wl_global_add(inst->obj, _gadget_interface, 1, inst, gadget_bind); evas_object_smart_callback_add(inst->obj, "child_added", child_added, inst); evas_object_smart_callback_add(inst->obj, "popup_added", popup_added, inst); --
[EGIT] [core/efl] master 01/03: efl/wl: add docs for base compositor object
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=af96a44ef7af66f9b8e969a211bfee1e42fa03a3 commit af96a44ef7af66f9b8e969a211bfee1e42fa03a3 Author: Mike Blumenkrantz Date: Fri Mar 13 12:16:51 2020 -0400 efl/wl: add docs for base compositor object Summary: also rename some methods Depends on D11500 Reviewers: bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11501 --- src/bin/efl_canvas_wl/efl_canvas_wl_test.c | 4 +- src/lib/efl_canvas_wl/efl_canvas_wl.c | 8 +- src/lib/efl_canvas_wl/efl_canvas_wl.eo | 126 + 3 files changed, 99 insertions(+), 39 deletions(-) diff --git a/src/bin/efl_canvas_wl/efl_canvas_wl_test.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c index 4bb7e616af..6bedb9ce47 100644 --- a/src/bin/efl_canvas_wl/efl_canvas_wl_test.c +++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c @@ -63,8 +63,8 @@ main(int argc, char *argv[]) elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); o = efl_add(EFL_CANVAS_WL_CLASS, win); - efl_canvas_wl_aspect_set(o, 1); - efl_canvas_wl_minmax_set(o, 1); + efl_canvas_wl_aspect_propagate_set(o, 1); + efl_canvas_wl_minmax_propagate_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win); diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 997703299f..734378fcff 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -5690,13 +5690,13 @@ _efl_canvas_wl_efl_gfx_entity_scale_set(Eo *obj EINA_UNUSED, Comp *c, double sca } EOLIAN static Eina_Bool -_efl_canvas_wl_aspect_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_aspect_propagate_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->aspect; } EOLIAN static void -_efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_aspect_propagate_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->aspect == (!!set)) return; c->aspect = !!set; @@ -5707,13 +5707,13 @@ _efl_canvas_wl_aspect_set(Eo *obj, Comp *c, Eina_Bool set) } EOLIAN static Eina_Bool -_efl_canvas_wl_minmax_get(const Eo *obj EINA_UNUSED, Comp *c) +_efl_canvas_wl_minmax_propagate_get(const Eo *obj EINA_UNUSED, Comp *c) { return c->minmax; } EOLIAN static void -_efl_canvas_wl_minmax_set(Eo *obj, Comp *c, Eina_Bool set) +_efl_canvas_wl_minmax_propagate_set(Eo *obj, Comp *c, Eina_Bool set) { if (c->minmax == (!!set)) return; c->minmax = !!set; diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.eo b/src/lib/efl_canvas_wl/efl_canvas_wl.eo index 9924ce9a1f..4b0e4fa353 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.eo @@ -23,87 +23,147 @@ enum @beta Efl.Canvas.Wl.Rotation class @beta Efl.Canvas.Wl extends Efl.Canvas.Group { - [[ + [[A multiseat xdg-shell compliant Wayland compositor which runs in a canvas object. + + All toplevel windows will be sized to the size of the compositor object unless extracted with + @Efl.Canvas.Wl.Surface.extract. + + Only clients executed with @Efl.Canvas.Wl.run or added with @.allowed_pid_add will + be permitted to connect to this compositor. + + If no surface is activated at the time of the first toplevel surface's first buffer commit, this + first surface will automatically be activated so long as its geometry is not externally modified + during this time. If regularly modifying geometry is necessary, surfaces should be manually activated + with the @.active_surface property. + @since 1.24 ]] data: Comp; methods { run { - [[This runs a command in the compositor using the @Efl.Exe_Flags.term_with_parent flag. + [[ + Run a specified command in the compositor widget. + If GL is available, the ELM_ACCEL environment variable will be set to "gl" while executing the command. ]] params { -cmd: string; +cmd: string; [[The command to execute.]] } - return: Efl.Exe; + return: Efl.Exe; [[The exe object for the executed process. $NULL on failure.]] } @property exec_flags { + [[The flags to be used when running commands with @Efl.Canvas.Wl.run. + Changing this value will only affect commands run after this call. + + The default is @Efl.Exe_Flags.term_with_parent. + ]] values { -flags: Efl.Exe_Flags; +flags: Efl.Exe_Flags; [[A bitmask of flags.]] } } allow
[EGIT] [core/efl] master 02/03: efl/wl: add docs for surface object and re-namespace
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=57d6d9bfcedfb45932d8b34a4383257cf6346fcf commit 57d6d9bfcedfb45932d8b34a4383257cf6346fcf Author: Mike Blumenkrantz Date: Fri Mar 13 12:16:57 2020 -0400 efl/wl: add docs for surface object and re-namespace Summary: Depends on D11501 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11504 --- src/lib/efl_canvas_wl/efl_canvas_wl.eo | 14 src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo | 46 ++ 2 files changed, 47 insertions(+), 13 deletions(-) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.eo b/src/lib/efl_canvas_wl/efl_canvas_wl.eo index 4b0e4fa353..4481ef4f12 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.eo @@ -26,7 +26,7 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group [[A multiseat xdg-shell compliant Wayland compositor which runs in a canvas object. All toplevel windows will be sized to the size of the compositor object unless extracted with - @Efl.Canvas.Wl.Surface.extract. + @Efl.Canvas.Wl_Surface.extract. Only clients executed with @Efl.Canvas.Wl.run or added with @.allowed_pid_add will be permitted to connect to this compositor. @@ -82,11 +82,11 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group } surface_next { [[Activate and raise the bottom-most toplevel surface.]] - return: Efl.Canvas.Wl.Surface; [[The surface that was activated, or $NULL if no change was made.]] + return: Efl.Canvas.Wl_Surface; [[The surface that was activated, or $NULL if no change was made.]] } surface_prev { [[Activate and raise the second top-most toplevel surface.]] - return: Efl.Canvas.Wl.Surface; [[The surface that was activated, or $NULL if no change was made.]] + return: Efl.Canvas.Wl_Surface; [[The surface that was activated, or $NULL if no change was made.]] } @property active_surface { [[This is the currently activated surface in the compositor widget. @@ -97,7 +97,7 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group return: bool; [[Returns $true if a change was successfully made.]] } values { -surface: Efl.Canvas.Wl.Surface; [[The activated surface.]] +surface: Efl.Canvas.Wl_Surface; [[The activated surface.]] } } @property aspect_propagate { @@ -175,9 +175,9 @@ class @beta Efl.Canvas.Wl extends Efl.Canvas.Group Efl.Gfx.Entity.scale { get; set; } } events { - toplevel,added: Efl.Canvas.Wl.Surface; [[Contains the toplevel surface which was added.]] - child,added: Efl.Canvas.Wl.Surface; [[Contains the toplevel child surface which was added.]] - popup,added: Efl.Canvas.Wl.Surface; [[Contains the popup surface which was added.]] + toplevel,added: Efl.Canvas.Wl_Surface; [[Contains the toplevel surface which was added.]] + child,added: Efl.Canvas.Wl_Surface; [[Contains the toplevel child surface which was added.]] + popup,added: Efl.Canvas.Wl_Surface; [[Contains the popup surface which was added.]] seat,added: Efl.Input.Device; [[Contains the seat object that was added.]] } } diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo index f2a351becc..d2646f8431 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo @@ -1,27 +1,61 @@ -class @beta Efl.Canvas.Wl.Surface extends Efl.Canvas.Group +class @beta Efl.Canvas.Wl_Surface extends Efl.Canvas.Group { - [[@since 1.24]] + [[A canvas object representing a Wayland toplevel or popup surface. + + This object's geometry properties reflect the properties of the underlying surface. If + the client is using a protocol to export its size hints, those hints will be directly + applied to this object any time they change in the application. + + Changes to geometry and visibility of this object must not be made while @.extracted + is $false. + + Changes to size of this object will be immediately propagated to the underlying application. + + Hiding this object will have differing effects based on the surface's xdg-shell role. + If the surface is a popup, it will be sent the 'done' protocol event which will close it. + If the surface is a toplevel, it will be deactivated if it was active. + + This object's lifetime is bound to the lifetime of the underlying surface or the compositor widget. + + This object must not be manually deleted. + @since 1.24 + ]] data: Comp_Surface; methods { extract { - return: bool; + [[Extract a surface from
[EGIT] [core/efl] master 03/03: efl/wl: remove old doxygen docs
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7b29d07e420246cf1a9e14ec3949188d077370fb commit 7b29d07e420246cf1a9e14ec3949188d077370fb Author: Mike Blumenkrantz Date: Fri Mar 13 12:17:03 2020 -0400 efl/wl: remove old doxygen docs Summary: these are no longer applicable Depends on D11504 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11505 --- src/lib/efl_canvas_wl/Efl_Canvas_Wl.h | 198 +- 1 file changed, 1 insertion(+), 197 deletions(-) diff --git a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h index 0fae48a3a9..b0c0772ab8 100644 --- a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h +++ b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h @@ -44,164 +44,6 @@ typedef struct Efl_Canvas_Wl_Xkb_State Efl_Canvas_Wl_Xkb_State; #endif #include #include -/** - * @defgroup Efl_Wl_Group EFL Wayland - * - * A multiseat xdg-shell compliant Wayland compositor in an Evas object. - * All toplevel windows will be sized to the size of the compositor object. - * @since 1.20 - * @{ - */ -#if 0 -/** - * Add a compositor widget to the given canvas. - * - * The following smart callbacks will trigger on the compositor object: - * "toplevel_added" - A toplevel surface has been added; event info is Evas_Object *surface @since 1.24 - * "child_added" - A toplevel surface with a parent has been added; event info is Evas_Object *surface - * "popup_added" - A popup surface has been added; event info is Evas_Object *surface - * "seat_added" - A compositor seat has been added; event info is Eo *dev - * - * @param e The canvas - * @return The compositor object, @c NULL on failure - */ -EAPI Evas_Object *efl_canvas_wl_add(Evas *e); - -/** - * Run a command in the compositor widget. - * - * @note If GL is available, the ELM_ACCEL environment variable will be - * set to "gl" while executing the command. - * - * @param obj The compositor widget - * @param cmd The command to run - * @return The Ecore_Exe from the executed process, @c NULL on failure - */ -EAPI Ecore_Exe *efl_canvas_wl_run(Evas_Object *obj, const char *cmd); - -/** - * Run a command in the compositor widget with specified flags. - * - * @note If GL is available, the ELM_ACCEL environment variable will be - * set to "gl" while executing the command. - * - * @param obj The compositor widget - * @param cmd The command to run - * @param flags The flags to use - * @return The Ecore_Exe from the executed process, @c NULL on failure - */ -Ecore_Exe *efl_canvas_wl_flags_run(Evas_Object *obj, const char *cmd, Ecore_Exe_Flags flags); - -/** - * Add a process to the list of allowed clients for the compositor widget - * - * @param obj The compositor widget - * @param pid The process to allow - * @since 1.21 - */ -EAPI void efl_canvas_wl_pid_add(Evas_Object *obj, int32_t pid); - -/** - * Remove a process from the list of allowed clients for the compositor widget - * - * @param obj The compositor widget - * @param pid The process to deny - * @since 1.21 - */ -EAPI void efl_canvas_wl_pid_del(Evas_Object *obj, int32_t pid); - -/** - * Put the bottom-most toplevel window on top and apply focus to it - * - * @param obj The compositor widget - * @return EINA_TRUE if the window stacking was changed - */ -EAPI Eina_Bool efl_canvas_wl_surface_next(Evas_Object *obj); - -/** - * Put the second top-most toplevel window on top and apply focus to it - * - * @param obj The compositor widget - * @return EINA_TRUE if the window stacking was changed - */ -EAPI Eina_Bool efl_canvas_wl_surface_prev(Evas_Object *obj); - -/** - * Set rotation and flip for the compositor's output - * - * @param obj The compositor widget - * @param rot The rotation to apply - * @param rtl If set, the output will apply a flip around the Y axis - * @note rtl is equivalent to WL_OUTPUT_TRANSFORM_FLIPPED and rotations are applied - * on top - */ -EAPI void efl_canvas_wl_rotate(Evas_Object *obj, Efl_Wl_Rotation rot, Eina_Bool rtl); - -/** - * Set the scale factor for the compositor's output - * - * @param obj The compositor widget - * @param scale The scale factor to set - */ -EAPI void efl_canvas_wl_scale_set(Evas_Object *obj, double scale); - -/** - * Transfer aspect hints from top-most surface onto the efl_canvas_wl object - * - * @param obj The compositor widget - * @param set Whether to enable aspect setting - * @since 1.21 - */ -EAPI void efl_canvas_wl_aspect_set(Evas_Object *obj, Eina_Bool set); - -/** - * Transfer min/max hints from top-most surface onto the efl_canvas_wl object - * - * @param obj The compositor widget - * @param set Whether to enable min/max setting - * @since 1.21 - */ -EAPI void efl_canvas_wl_minmax_set(Evas_Object *obj, Eina_Bool set); - -/** - *
[EGIT] [core/efl] master 01/01: efl/gesture: remove duplicated line
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=907a2fb640aee4508ccc99a87ccba6e7a4eb4d2d commit 907a2fb640aee4508ccc99a87ccba6e7a4eb4d2d Author: Mike Blumenkrantz Date: Fri Mar 13 09:08:25 2020 -0400 efl/gesture: remove duplicated line Summary: this was somehow duplicated Reviewers: CHAN, bu5hm4n, devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11503 --- src/lib/evas/gesture/efl_canvas_gesture_manager.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index 29745843bb..4a1239637f 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -162,7 +162,6 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ROTATE_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ZOOM_CLASS, obj)); /* realistically this will never fail, but the whole gesture layer breaks if this is 0 */ - finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); if (!getenv("EFL_RUN_IN_TREE")) finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); if (finger_size < 1) finger_size = 10; --
[EGIT] [core/efl] master 01/03: efl/gesture: add fallback for glayer_tap_finger_size not being found
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=35727d29c37a9cb4a60b83475ced265fdb92e0a9 commit 35727d29c37a9cb4a60b83475ced265fdb92e0a9 Author: Mike Blumenkrantz Date: Thu Mar 12 09:11:53 2020 -0400 efl/gesture: add fallback for glayer_tap_finger_size not being found just in case Differential Revision: https://phab.enlightenment.org/D11494 --- src/lib/evas/gesture/efl_canvas_gesture_manager.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/gesture/efl_canvas_gesture_manager.c b/src/lib/evas/gesture/efl_canvas_gesture_manager.c index 48f515471c..29745843bb 100644 --- a/src/lib/evas/gesture/efl_canvas_gesture_manager.c +++ b/src/lib/evas/gesture/efl_canvas_gesture_manager.c @@ -139,6 +139,7 @@ EOLIAN static Efl_Object * _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_Manager_Data *pd) { Eo *config; + int finger_size = 0; obj = efl_constructor(efl_super(obj, MY_CLASS)); pd->m_recognizers = eina_hash_pointer_new(EINA_FREE_CB(_hash_unref_cb)); @@ -160,7 +161,12 @@ _efl_canvas_gesture_manager_efl_object_constructor(Eo *obj, Efl_Canvas_Gesture_M efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_FLICK_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ROTATE_CLASS, obj)); efl_gesture_manager_recognizer_register(obj, efl_add(EFL_CANVAS_GESTURE_RECOGNIZER_ZOOM_CLASS, obj)); - _update_finger_sizes(pd, efl_config_int_get(config, "glayer_tap_finger_size")); + /* realistically this will never fail, but the whole gesture layer breaks if this is 0 */ + finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); + if (!getenv("EFL_RUN_IN_TREE")) + finger_size = efl_config_int_get(config, "glayer_tap_finger_size"); + if (finger_size < 1) finger_size = 10; + _update_finger_sizes(pd, finger_size); return obj; } --
[EGIT] [core/efl] master 03/03: efl: check config values before passing to non-null function
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=eaa06230ddf53a444e37e66034b0e4f8f4b2b0af commit eaa06230ddf53a444e37e66034b0e4f8f4b2b0af Author: Mike Blumenkrantz Date: Thu Mar 12 12:50:26 2020 -0400 efl: check config values before passing to non-null function if these config values don't exist, we should return the inlined defaults Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11499 --- src/lib/efl/Efl.h | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index 81e274883b..ec6f168a8b 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -253,7 +253,7 @@ efl_config_bool_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); Eina_Bool b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_UCHAR) eina_value_get(v, ); eina_value_free(v); return b; @@ -275,7 +275,7 @@ efl_config_int_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); int b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_INT) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_INT) eina_value_get(v, ); eina_value_free(v); return b; @@ -297,7 +297,7 @@ efl_config_double_get(const Efl_Config *obj, const char * name) { Eina_Value *v = efl_config_get(obj, name); double b = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_DOUBLE) eina_value_get(v, ); eina_value_free(v); return b; @@ -319,7 +319,7 @@ efl_config_string_get(const Efl_Config *obj, const char *name) { Eina_Value *v = efl_config_get(obj, name); Eina_Stringshare *s = 0; - if (eina_value_type_get(v) == EINA_VALUE_TYPE_STRING) + if (v && eina_value_type_get(v) == EINA_VALUE_TYPE_STRING) { const char *b = 0; eina_value_get(v, ); --
[EGIT] [core/efl] master 02/15: efl-wl: start conversion to eo
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e6573154dcb291dc38099fba1055293b1e7b85d7 commit e6573154dcb291dc38099fba1055293b1e7b85d7 Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:27 2020 -0400 efl-wl: start conversion to eo Summary: this converts the main efl-wl object to an eo-based canvas group object Depends on D11465 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11454 --- meson.build| 2 +- src/bin/efl_wl/efl_wl_test.c | 13 +- src/bin/efl_wl/efl_wl_test_stack.c | 6 +- src/bin/efl_wl/meson.build | 4 +- src/lib/efl_wl/Efl_Wl.h| 58 ++--- src/lib/efl_wl/efl_wl.c| 440 +++-- src/lib/efl_wl/efl_wl.eo | 99 + src/lib/efl_wl/meson.build | 37 +++- 8 files changed, 345 insertions(+), 314 deletions(-) diff --git a/meson.build b/meson.build index 256256d8a8..6ad434980c 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,7 @@ subprojects = [ ['ethumb' ,[], true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client',[], false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], ['elementary' ,[], true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']], -['efl_wl' ,['wl'], false, true, true, false, false, false, ['evas', 'ecore'], []], +['efl_wl' ,['wl'], false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], ['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []], ['ecore_wayland',['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []], ['ecore_drm',['drm-deprecated'], false, true, false, false, false, false, ['eina'], []], diff --git a/src/bin/efl_wl/efl_wl_test.c b/src/bin/efl_wl/efl_wl_test.c index bf5b2ad4d1..b9f9f6b450 100644 --- a/src/bin/efl_wl/efl_wl_test.c +++ b/src/bin/efl_wl/efl_wl_test.c @@ -6,13 +6,12 @@ static Evas_Object *win; static Eina_Strbuf *buf; -static Ecore_Exe *exe; +static Eo *exe; -static Eina_Bool -del_handler(void *d EINA_UNUSED, int t EINA_UNUSED, Ecore_Exe_Event_Del *ev) +static void +del_handler(void *d EINA_UNUSED, const Efl_Event *ev) { - if (ev->exe == exe) ecore_main_loop_quit(); - return ECORE_CALLBACK_RENEW; + if (ev->object == exe) ecore_main_loop_quit(); } static void @@ -25,7 +24,7 @@ static Eina_Bool dostuff(void *data) { exe = efl_wl_run(data, eina_strbuf_string_get(buf)); - ecore_event_handler_add(ECORE_EXE_EVENT_DEL, (Ecore_Event_Handler_Cb)del_handler, NULL); + efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, del_handler, NULL); evas_object_focus_set(data, 1); return EINA_FALSE; } @@ -63,7 +62,7 @@ main(int argc, char *argv[]) elm_win_autodel_set(win, 1); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); - o = efl_wl_add(evas_object_evas_get(win)); + o = efl_add(EFL_WL_CLASS, win); efl_wl_aspect_set(o, 1); efl_wl_minmax_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_wl/efl_wl_test_stack.c index 51cd598984..e6eaa34760 100644 --- a/src/bin/efl_wl/efl_wl_test_stack.c +++ b/src/bin/efl_wl/efl_wl_test_stack.c @@ -26,13 +26,13 @@ dostuff(void *data) static void prev_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_prev(data); + efl_wl_surface_prev(data); } static void next_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { - efl_wl_next(data); + efl_wl_surface_next(data); } int @@ -69,7 +69,7 @@ main(int argc, char *argv[]) evas_object_show(next); elm_table_pack(o, next, 1, 0, 1, 1); - comp = efl_wl_add(evas_object_evas_get(win)); + comp = efl_add(EFL_WL_CLASS, win); evas_object_size_hint_min_set(comp, 640, 480); elm_table_pack(o, comp, 0, 1, 2, 1); evas_object_size_hint_align_set(comp, EVAS_HINT_FILL, EVAS_HINT_FILL); diff --git a/src/bin/efl_wl/meson.build b/src/bin/efl_wl/meson.build index c95cd0e767..dc0f0d248c 100644 --- a/src/bin/efl_wl/meson.build +++ b/src/bin/efl_wl/meson.build @@ -1,13 +1,13 @@ executable('efl_wl_test', 'efl_wl_test.c', include_directories : config_dir, - dependencies: [efl_wl, elementary], + dependencies: [efl_wl, efl_w
[EGIT] [core/efl] master 10/15: efl-wl: rename to efl.canvas.wl
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=42480c5ebf32be52c3d5c5e484d5e8d5eac92fcb commit 42480c5ebf32be52c3d5c5e484d5e8d5eac92fcb Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:14 2020 -0400 efl-wl: rename to efl.canvas.wl Summary: this is a canvas object so it needs to be in the canvas namespace Depends on D11475 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11476 --- meson.build| 2 +- .../efl_canvas_wl_test.c} | 10 +- .../efl_canvas_wl_test_stack.c}| 10 +- src/bin/efl_canvas_wl/meson.build | 13 ++ src/bin/efl_wl/meson.build | 13 -- .../Efl_Wl.h => efl_canvas_wl/Efl_Canvas_Wl.h} | 66 +- .../{efl_wl => efl_canvas_wl}/copiedfromweston.x | 0 src/lib/{efl_wl => efl_canvas_wl}/dmabuf.c | 0 src/lib/{efl_wl => efl_canvas_wl}/dmabuf.h | 0 .../efl_wl.c => efl_canvas_wl/efl_canvas_wl.c} | 141 +++-- .../efl_wl.eo => efl_canvas_wl/efl_canvas_wl.eo} | 46 +++ .../efl_canvas_wl_surface.eo} | 4 +- src/lib/{efl_wl => efl_canvas_wl}/meson.build | 36 +++--- src/lib/{efl_wl => efl_canvas_wl}/x11.x| 0 14 files changed, 171 insertions(+), 170 deletions(-) diff --git a/meson.build b/meson.build index 6ad434980c..bbf99d427a 100644 --- a/meson.build +++ b/meson.build @@ -331,7 +331,7 @@ subprojects = [ ['ethumb' ,[], true, true, true, false, false, false, ['eina', 'efl', 'eo'], []], ['ethumb_client',[], false, true, true, false, false, true, ['eina', 'efl', 'eo', 'ethumb'], []], ['elementary' ,[], true, true, true, true, true, true, ['eina', 'efl', 'eo', 'eet', 'evas', 'ecore', 'ecore-evas', 'ecore-file', 'ecore-input', 'edje', 'ethumb-client', 'emotion', 'ecore-imf', 'ecore-con', 'eldbus', 'efreet', 'efreet-mime', 'efreet-trash', 'eio'], ['atspi']], -['efl_wl' ,['wl'], false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], +['efl_canvas_wl',['wl'], false, true, true, false, false, false, ['eina', 'efl', 'eo', 'evas', 'ecore'], []], ['elua' ,['elua'] , false, true, true, false, true, false, ['eina', 'luajit'], []], ['ecore_wayland',['wl-deprecated'] , false, true, false, false, false, false, ['eina'], []], ['ecore_drm',['drm-deprecated'], false, true, false, false, false, false, ['eina'], []], diff --git a/src/bin/efl_wl/efl_wl_test.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c similarity index 90% rename from src/bin/efl_wl/efl_wl_test.c rename to src/bin/efl_canvas_wl/efl_canvas_wl_test.c index b9f9f6b450..4bb7e616af 100644 --- a/src/bin/efl_wl/efl_wl_test.c +++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test.c @@ -1,7 +1,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "Efl_Wl.h" +#include "Efl_Canvas_Wl.h" #include "Elementary.h" static Evas_Object *win; @@ -23,7 +23,7 @@ focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev static Eina_Bool dostuff(void *data) { - exe = efl_wl_run(data, eina_strbuf_string_get(buf)); + exe = efl_canvas_wl_run(data, eina_strbuf_string_get(buf)); efl_event_callback_add(exe, EFL_TASK_EVENT_EXIT, del_handler, NULL); evas_object_focus_set(data, 1); return EINA_FALSE; @@ -62,9 +62,9 @@ main(int argc, char *argv[]) elm_win_autodel_set(win, 1); elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); - o = efl_add(EFL_WL_CLASS, win); - efl_wl_aspect_set(o, 1); - efl_wl_minmax_set(o, 1); + o = efl_add(EFL_CANVAS_WL_CLASS, win); + efl_canvas_wl_aspect_set(o, 1); + efl_canvas_wl_minmax_set(o, 1); evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_event_callback_add(o, EVAS_CALLBACK_CHANGED_SIZE_HINTS, hints_changed, win); diff --git a/src/bin/efl_wl/efl_wl_test_stack.c b/src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c similarity index 92% rename from src/bin/efl_wl/efl_wl_test_stack.c rename to src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c index e6eaa34760..49849e07e8 100644 --- a/src/bin/efl_wl/efl_wl_test_stack.c +++ b/src/bin/efl_canvas_wl/efl_canvas_wl_test_stack.c @@ -1,7 +1,7 @@ #ifdef HAVE_CONFIG_H # include "config.h" #endif -#include "Efl_Wl.h" +#include "Efl_Canvas_Wl.h" #include "Elementary.h" static Evas_Object *win; @@ -18
[EGIT] [core/efl] master 06/15: efl-wl: move keymap functions to eo
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=12854eac34d8d1decc3c61867d242887a288ac6e commit 12854eac34d8d1decc3c61867d242887a288ac6e Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:50 2020 -0400 efl-wl: move keymap functions to eo Summary: more 1:1 changes Depends on D11467 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11468 --- src/lib/efl_wl/Efl_Wl.h | 6 -- src/lib/efl_wl/efl_wl.c | 20 +++- src/lib/efl_wl/efl_wl.eo | 17 + 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 5676d892ae..71b3c2c190 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -26,8 +26,10 @@ typedef struct Efl_Wl_Wl_Surface Efl_Wl_Wl_Surface; typedef struct Efl_Wl_Wl_Global Efl_Wl_Wl_Global; typedef struct Efl_Wl_Wl_Interface Efl_Wl_Wl_Interface; +typedef struct Efl_Wl_Wl_Array Efl_Wl_Wl_Array; typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; +typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; #include #include @@ -210,7 +212,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); -#endif + /** * Set external xkbcommon resources to be used read-only by the compositor object * @@ -236,7 +238,7 @@ EAPI void efl_wl_seat_keymap_set(Evas_Object *obj, Eo *seat, void *state, char * * @since 1.21 */ EAPI void efl_wl_seat_key_repeat_set(Evas_Object *obj, Eo *seat, int repeat_rate, int repeat_delay); - +#endif #undef EAPI #define EAPI #undef EAPI_WEAK diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index c56ec323f7..0aa1d23096 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -210,7 +210,7 @@ typedef struct Comp_Seat struct xkb_context *context; struct xkb_keymap *keymap; struct xkb_state *state; - char *keymap_str; + const char *keymap_str; int keymap_str_size; int repeat_rate; int repeat_delay; @@ -5782,14 +5782,11 @@ _efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) return NULL; } -void -efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_array) +static EOLIAN void +_efl_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Wl_Xkb_State *state, const char *str, Efl_Wl_Wl_Array *key_array) { - Comp *c; Comp_Seat *s; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_keymap_set(obj, s->dev, state, str, key_array); @@ -5799,8 +5796,8 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra EINA_SAFETY_ON_NULL_RETURN(s); seat_kbd_destroy(s); s->kbd.external = 1; - s->kbd.keys_external = key_array; - s->kbd.state = state; + s->kbd.keys_external = (void*)key_array; + s->kbd.state = (void*)state; s->kbd.keymap_str = str; if (str) s->kbd.keymap_str_size = strlen(str) + 1; @@ -5812,14 +5809,11 @@ efl_wl_seat_keymap_set(Eo *obj, Eo *seat, void *state, char *str, void *key_arra seat_kbd_external_init(s); } -void -efl_wl_seat_key_repeat_set(Eo *obj, Eo *seat, int repeat_rate, int repeat_delay) +static EOLIAN void +_efl_wl_seat_key_repeat_set(Eo *obj, Comp *c, Eo *seat, int repeat_rate, int repeat_delay) { - Comp *c; Comp_Seat *s; - if (!eina_streq(evas_object_type_get(obj), "comp")) abort(); - c = efl_data_scope_get(obj, MY_CLASS); EINA_INLIST_FOREACH(c->seats, s) { if (!seat) efl_wl_seat_key_repeat_set(obj, s->dev, repeat_rate, repeat_delay); diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index ffd2e9d5c7..20663624cb 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -7,6 +7,8 @@ struct @beta @extern Efl.Wl_Wl_Global; [[ struct wl_global. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface; [[ A libwayland callback interface struct. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface_Data; [[ A data pointer to send with the bind callback. @since 1.24 ]] struct @beta @extern Efl.Wl_Wl_Interface_Bind_Cb; [[ A callback with the type (*void)(struct wl_client *client, void *data, uint32_t version, uint32_t id). @since 1.24 ]] +struct @beta @extern Efl.Wl_Xkb_State; [[ struct xkb_state. @since 1.24 ]] +struct @beta @extern Efl.Wl_Wl_Array; [[ struct wl_array. @since 1.24 ]] enum @beta Efl.Wl.Rotation @@ -82,6 +84,21 @@ class @beta Efl.Wl extends Efl.Canvas.Group } return: Efl.
[EGIT] [core/efl] master 03/15: efl/exe: add term_with_parent flag
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=043a2c90ff5f56abcb39c382af85f6bd3019f6fc commit 043a2c90ff5f56abcb39c382af85f6bd3019f6fc Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:34 2020 -0400 efl/exe: add term_with_parent flag Summary: same as ecore_exe Depends on D11451 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11465 --- src/lib/ecore/efl_exe.c | 13 - src/lib/ecore/efl_exe.eo | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 4580a41351..1cb0276205 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -552,7 +552,18 @@ _efl_exe_efl_task_run(Eo *obj, Efl_Exe_Data *pd) int except[2] = { 0, -1 }; except[0] = pd->fd.exited_write; eina_file_close_from(3, except); - +#ifdef HAVE_PRCTL + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { +prctl(PR_SET_PDEATHSIG, SIGTERM); + } +#elif defined(HAVE_PROCCTL) + if ((pd->flags & EFL_EXE_FLAGS_TERM_WITH_PARENT)) + { +int sig = SIGTERM; +procctl(P_PID, 0, PROC_PDEATHSIG_CTL, ); + } +#endif // actually execute! _exec(cmd, pd->flags, td->flags); // we couldn't exec... uh oh. HLP! diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 11f6519be3..c4cc2d7ebf 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -18,7 +18,8 @@ enum @beta Efl.Exe_Flags { [[Flags to customize process behavior.]] none = 0, [[No special flags.]] group_leader = 1, [[Process will be executed in its own session.]] - hide_io = 4 [[All console IO will be hidden.]] + hide_io = 4, [[All console IO will be hidden.]] + term_with_parent = 8, [[Makes child receive SIGTERM when parent dies.]] } class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Efl.Io.Closer, Efl.Core.Command_Line --
[EGIT] [core/efl] master 05/15: efl-wl: rework parent surface getter to a more useful property
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b51d45835c534970361845e4f666d405d5b66d6a commit b51d45835c534970361845e4f666d405d5b66d6a Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:43 2020 -0400 efl-wl: rework parent surface getter to a more useful property Summary: getting any parent is probably fine Depends on D11466 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11467 --- src/lib/efl_wl/Efl_Wl.h | 4 ++-- src/lib/efl_wl/efl_wl.c | 16 +++- src/lib/efl_wl/efl_wl_surface.eo | 6 ++ 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 06fca3f5b5..5676d892ae 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -199,7 +199,7 @@ EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); - +#if 0 /** * Get the Evas_Object for an extracted surface's parent, or NULL if the parent is not extracted * @@ -210,7 +210,7 @@ EAPI Evas_Object *efl_wl_extracted_surface_object_find(void *surface_resource); * @since 1.21 */ EAPI Evas_Object *efl_wl_extracted_surface_extracted_parent_get(Evas_Object *surface); - +#endif /** * Set external xkbcommon resources to be used read-only by the compositor object * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index d6b77f4f44..c56ec323f7 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5773,22 +5773,12 @@ efl_wl_extracted_surface_object_find(void *surface_resource) return cs->obj; } -Eo * -efl_wl_extracted_surface_extracted_parent_get(Eo *surface) +static EOLIAN Eo * +_efl_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) { - Comp_Surface *cs; - - EINA_SAFETY_ON_NULL_RETURN_VAL(surface, NULL); - cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); - if (!cs) abort(); - EINA_SAFETY_ON_TRUE_RETURN_VAL(!cs->extracted, NULL); EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, NULL); - if (cs->parent) - { -if (!cs->parent->extracted) return NULL; -return cs->parent->obj; - } + if (cs->parent && cs->role) return cs->parent->obj; return NULL; } diff --git a/src/lib/efl_wl/efl_wl_surface.eo b/src/lib/efl_wl/efl_wl_surface.eo index 8f8e44c893..65c7327c95 100644 --- a/src/lib/efl_wl/efl_wl_surface.eo +++ b/src/lib/efl_wl/efl_wl_surface.eo @@ -12,6 +12,12 @@ class @beta Efl.Wl.Surface extends Efl.Canvas.Group pid: int; } } + @property parent_surface { + get {} + values { +parent: Efl.Wl.Surface; + } + } } implements { Efl.Object.constructor; --
[EGIT] [core/efl] master 08/15: efl-wl: add active_surface property
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2754b24cdd2901e839a070e88b899907a1496406 commit 2754b24cdd2901e839a070e88b899907a1496406 Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:04 2020 -0400 efl-wl: add active_surface property Summary: this is probably useful? Depends on D11469 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11470 --- src/lib/efl_wl/efl_wl.c | 22 ++ src/lib/efl_wl/efl_wl.eo | 9 + 2 files changed, 31 insertions(+) diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 84a61e83ae..56efb5c6d7 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5620,6 +5620,28 @@ _efl_wl_surface_prev(Eo *obj, Comp *c) return NULL; } +EOLIAN static Eo * +_efl_wl_active_surface_get(const Eo *obj, Comp *c) +{ + if (c->active_surface && (!c->active_surface->dead)) + return c->active_surface->obj; + return NULL; +} + +EOLIAN static Eina_Bool +_efl_wl_active_surface_set(Eo *obj, Comp *c, Eo *surface) +{ + Comp_Surface *cs = efl_data_scope_get(surface, EFL_WL_SURFACE_CLASS); + EINA_SAFETY_ON_NULL_RETURN_VAL(cs, EINA_FALSE); + if (cs->dead) return EINA_FALSE; + if (c->active_surface == cs) return EINA_TRUE; + /* can't activate a popup */ + if (cs->shell.popup) return EINA_FALSE; + cs->shell.activated = 1; + shell_surface_send_configure(cs); + return EINA_TRUE; +} + EOLIAN static void _efl_wl_rotation_get(const Eo *obj EINA_UNUSED, Comp *c, Efl_Wl_Rotation *rotation, Eina_Bool *rtl) { diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index af7f79393c..b41b429871 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -59,6 +59,15 @@ class @beta Efl.Wl extends Efl.Canvas.Group surface_prev { return: Efl.Wl.Surface; } + @property active_surface { + get {} + set { +return: bool; + } + values { +surface: Efl.Wl.Surface; + } + } @property aspect { values { set: bool; --
[EGIT] [core/efl] master 13/15: efl/wl: define opaque wl/xkb types to native types when those headers are included
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=592ca5ea3b4622e971145fb9558f8d5c24f44f67 commit 592ca5ea3b4622e971145fb9558f8d5c24f44f67 Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:31 2020 -0400 efl/wl: define opaque wl/xkb types to native types when those headers are included Summary: simplify a lot of casting when we're in a native wl env Depends on D11495 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11496 --- src/lib/efl_canvas_wl/Efl_Canvas_Wl.h | 15 +-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h index b62f0de729..0fae48a3a9 100644 --- a/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h +++ b/src/lib/efl_canvas_wl/Efl_Canvas_Wl.h @@ -22,15 +22,26 @@ #define EWAPI EAPI EAPI_WEAK - +#ifdef WAYLAND_UTIL_H +typedef struct wl_surface Efl_Canvas_Wl_Wl_Surface; +typedef struct wl_global Efl_Canvas_Wl_Wl_Global; +typedef struct wl_interface Efl_Canvas_Wl_Wl_Interface; +typedef struct wl_array Efl_Canvas_Wl_Wl_Array; +typedef void Efl_Canvas_Wl_Wl_Interface_Data; +typedef void Efl_Canvas_Wl_Wl_Interface_Bind_Cb; +#else typedef struct Efl_Canvas_Wl_Wl_Surface Efl_Canvas_Wl_Wl_Surface; typedef struct Efl_Canvas_Wl_Wl_Global Efl_Canvas_Wl_Wl_Global; typedef struct Efl_Canvas_Wl_Wl_Interface Efl_Canvas_Wl_Wl_Interface; typedef struct Efl_Canvas_Wl_Wl_Array Efl_Canvas_Wl_Wl_Array; typedef void * Efl_Canvas_Wl_Wl_Interface_Data; typedef void * Efl_Canvas_Wl_Wl_Interface_Bind_Cb; +#endif +#ifdef _XKBCOMMON_H_ +typedef struct xkb_state Efl_Canvas_Wl_Xkb_State; +#else typedef struct Efl_Canvas_Wl_Xkb_State Efl_Canvas_Wl_Xkb_State; - +#endif #include #include /** --
[EGIT] [core/enlightenment] master 01/01: update gadget runner to (stabilized) efl api
zmike pushed a commit to branch master. http://git.enlightenment.org/core/enlightenment.git/commit/?id=b80ddda9fbc58b05b07e150a0fdfd3408146d5d3 commit b80ddda9fbc58b05b07e150a0fdfd3408146d5d3 Author: Mike Blumenkrantz Date: Thu Mar 12 10:25:46 2020 -0400 update gadget runner to (stabilized) efl api efl-wl -> efl-canvas-wl --- meson.build | 4 +-- src/bin/e_comp_wl_input.c | 4 +-- src/bin/e_gadget_runner.c | 67 --- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/meson.build b/meson.build index e62aa3cb2..a6e89c4c6 100644 --- a/meson.build +++ b/meson.build @@ -305,7 +305,7 @@ if get_option('wl') == true dir_wayland_protocols = wayland_protocols.get_pkgconfig_variable('pkgdatadir') wayland_version = '>= 1.11.0' dep_wayland = [ dependency('ecore-wl2'), - dependency('efl-wl'), + dependency('efl-canvas-wl'), dependency('wayland-server' , version: wayland_version), dependency('wayland-client' , version: wayland_version), wayland_protocols, @@ -321,7 +321,7 @@ if get_option('wl') == true endif requires_wayland = ' '.join([ 'wayland-protocols >= 1.12', 'ecore-wl2', -'efl-wl', +'efl-canvas-wl', requires_drm, ' '.join(['wayland-server' , wayland_version]), ' '.join(['wayland-client' , wayland_version]), diff --git a/src/bin/e_comp_wl_input.c b/src/bin/e_comp_wl_input.c index 8f89f6d14..733e0d424 100644 --- a/src/bin/e_comp_wl_input.c +++ b/src/bin/e_comp_wl_input.c @@ -5,7 +5,7 @@ #ifdef HAVE_WL_DRM #include #endif -#include +#include E_API int E_EVENT_TEXT_INPUT_PANEL_VISIBILITY_CHANGE = -1; static xkb_keycode_t (*_xkb_keymap_key_by_name)(void *, const char *); @@ -429,7 +429,7 @@ nested_keymap_update(void) Evas_Object *obj; EINA_LIST_FOREACH(e_comp_wl->efl_wls, l, obj) - efl_wl_seat_keymap_set(obj, NULL, e_comp_wl->xkb.state, e_comp_wl->xkb.map_string, _comp_wl->kbd.keys); + efl_canvas_wl_seat_keymap_set(obj, NULL, e_comp_wl->xkb.state, e_comp_wl->xkb.map_string, _comp_wl->kbd.keys); } static void diff --git a/src/bin/e_gadget_runner.c b/src/bin/e_gadget_runner.c index 00818affd..bf8c8e80f 100644 --- a/src/bin/e_gadget_runner.c +++ b/src/bin/e_gadget_runner.c @@ -1,5 +1,5 @@ #include "e.h" -#include +#include #include "e-gadget-server-protocol.h" #include "action_route-server-protocol.h" #include @@ -38,7 +38,7 @@ typedef struct Instance E_Gadget_Site_Anchor anchor; Evas_Object *box; Evas_Object *obj; - Ecore_Exe *exe; + Efl_Exe *exe; Config_Item *ci; Eina_Hash *allowed_pids; Eina_List *tooltip_surfaces; @@ -80,6 +80,7 @@ typedef struct Wizard_Item Eina_Bool sandbox E_BITFIELD; } Wizard_Item; +static void runner_exe_del(void *data, const Efl_Event *ev); static char * sandbox_name(const char *filename) @@ -147,7 +148,8 @@ runner_run(Instance *inst) unshare(CLONE_NEWPID); - inst->exe = efl_wl_run(inst->obj, inst->ci->cmd); + inst->exe = efl_canvas_wl_run(inst->obj, inst->ci->cmd); + efl_event_callback_add(inst->exe, EFL_TASK_EVENT_EXIT, runner_exe_del, inst); setns(ns_fd, CLONE_NEWPID); @@ -157,8 +159,7 @@ runner_run(Instance *inst) e_util_env_set("LD_PRELOAD", preload); free(preload); eina_hash_free_buckets(inst->allowed_pids); - pid = ecore_exe_pid_get(inst->exe); - ecore_exe_data_set(inst->exe, inst); + pid = efl_exe_pid_get(inst->exe); eina_hash_add(inst->allowed_pids, , (void*)1); } @@ -182,7 +183,7 @@ _config_close(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_inf if (!inst) ci->cmd_changed = 0; if (!ci->cmd_changed) return; ci->cmd_changed = 0; - if (inst->exe) ecore_exe_quit(inst->exe); + if (inst->exe) efl_exe_signal(inst->exe, EFL_EXE_SIGNAL_QUIT); runner_run(inst); } @@ -219,7 +220,7 @@ _config_cmd_activate(void *data, Evas_Object *obj, void *event_info EINA_UNUSED) free(cmd); e_config_save_queue(); if (!inst) return; - if (inst->exe) ecore_exe_quit(inst->exe); + if (inst->exe) efl_exe_signal(inst->exe, EFL_EXE_SIGNAL_QUIT); runner_run(inst); } @@ -422,8 +423,10 @@ runner_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj, void *event_info E if (inst->ci) inst->ci->inst = NULL; else - ecore_exe_signal(inst->exe, 2); - E_FREE_FUNC(inst->exe, ecore_exe_terminate); + efl_exe_signal(inst->exe, EFL_EXE_SIGNAL_USR2); + efl_event_callback_del(inst->exe, EFL_TASK_EVENT_EXIT, runner_exe_del, inst); + efl_exe_signal(ins
[EGIT] [core/efl] master 09/15: efl-wl: move flags_run to exec_flags property
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d284d19429d482dd0636b1f1aab8b5502c572975 commit d284d19429d482dd0636b1f1aab8b5502c572975 Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:10 2020 -0400 efl-wl: move flags_run to exec_flags property Summary: typically the compositor wants to run all exes with the same flags so this makes more sense Depends on D11470 Reviewers: segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11475 --- src/lib/efl_wl/efl_wl.c | 14 +++--- src/lib/efl_wl/efl_wl.eo | 6 ++ 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 56efb5c6d7..060c3837aa 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -123,6 +123,7 @@ typedef struct Comp Efl_Wl_Rotation rotation; double scale; char *env; + Efl_Exe_Flags flags; Ecore_Wl2_Display *disp; Ecore_Wl2_Display *parent_disp; Ecore_Wl2_Display *client_disp; @@ -5283,6 +5284,7 @@ _efl_wl_efl_canvas_group_group_add(Eo *obj, Comp *c) efl_canvas_group_add(efl_super(obj, MY_CLASS)); c->wayland_time_base = ecore_loop_time_get(); c->obj = obj; + c->flags = EFL_EXE_FLAGS_TERM_WITH_PARENT; env = getenv("WAYLAND_DISPLAY"); if (env) env = strdup(env); @@ -5563,10 +5565,16 @@ _efl_wl_run(Eo *obj, Comp *c, const char *cmd) return comp_run(obj, c, cmd, EFL_EXE_FLAGS_TERM_WITH_PARENT); } -EOLIAN static Eo * -_efl_wl_flags_run(Eo *obj, Comp *c, const char *cmd, Efl_Exe_Flags flags) +EOLIAN static Efl_Exe_Flags +_efl_wl_exec_flags_get(const Eo *obj, Comp *c) +{ + return c->flags; +} + +EOLIAN static void +_efl_wl_exec_flags_set(Eo *obj, Comp *c, Efl_Exe_Flags flags) { - return comp_run(obj, c, cmd, flags); + c->flags = flags; } EOLIAN static void diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index b41b429871..f52fa1a8c6 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -36,12 +36,10 @@ class @beta Efl.Wl extends Efl.Canvas.Group } return: Efl.Exe; } - flags_run { - params { -cmd: string; + @property exec_flags { + values { flags: Efl.Exe_Flags; } - return: Efl.Exe; } allowed_pid_add { params { --
[EGIT] [core/efl] master 04/15: efl-wl: convert comp surface object to eo
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=453a0fb82ae62757dab0590d4af00731ce5afe2b commit 453a0fb82ae62757dab0590d4af00731ce5afe2b Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:40 2020 -0400 efl-wl: convert comp surface object to eo Summary: this is a 1:1 conversion Depends on D11454 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11466 --- src/lib/efl_wl/Efl_Wl.h | 5 +- src/lib/efl_wl/efl_wl.c | 159 +++ src/lib/efl_wl/efl_wl.eo | 6 +- src/lib/efl_wl/efl_wl_surface.eo | 22 ++ src/lib/efl_wl/meson.build | 1 + 5 files changed, 71 insertions(+), 122 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index ee36eb74bb..06fca3f5b5 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -30,6 +30,7 @@ typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; #include +#include /** * @defgroup Efl_Wl_Group EFL Wayland * @@ -164,7 +165,7 @@ EAPI void efl_wl_minmax_set(Evas_Object *obj, Eina_Bool set); * @since 1.21 */ EAPI void *efl_wl_global_add(Evas_Object *obj, const void *interface, uint32_t version, void *data, void *bind_cb); -#endif + /** * Extract a child surface from the compositor * @@ -187,7 +188,7 @@ EAPI Eina_Bool efl_wl_surface_extract(Evas_Object *surface); * @since 1.24 */ EAPI int32_t efl_wl_surface_pid_get(Evas_Object *surface); - +#endif /** * Get the Evas_Object for an extracted wl_surface resource created by an efl_wl object * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index defa800066..d6b77f4f44 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -1925,8 +1925,6 @@ comp_surface_impl_destroy(struct wl_resource *resource) } -static Evas_Smart *comp_surface_smart = NULL; - static inline Eina_Bool comp_surface_check_grab(Comp_Surface *cs, Comp_Seat *s) { @@ -2379,14 +2377,19 @@ comp_surface_multi_move(void *data, Evas *e EINA_UNUSED, Eo *obj EINA_UNUSED, vo } } +EOLIAN static Eo * +_efl_wl_surface_efl_object_constructor(Eo *obj, Comp_Surface *cs EINA_UNUSED) +{ + efl_canvas_group_clipped_set(obj, EINA_TRUE); + return efl_constructor(efl_super(obj, EFL_WL_SURFACE_CLASS)); +} + static void -comp_surface_smart_add(Eo *obj) +_efl_wl_surface_efl_canvas_group_group_add(Eo *obj, Comp_Surface *cs) { - Comp_Surface *cs; Evas *e; - cs = calloc(1, sizeof(Comp_Surface)); - evas_object_smart_data_set(obj, cs); + efl_canvas_group_add(efl_super(obj, EFL_WL_SURFACE_CLASS)); cs->obj = obj; evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_DOWN, comp_surface_mouse_down, cs); evas_object_event_callback_add(cs->obj, EVAS_CALLBACK_MOUSE_UP, comp_surface_mouse_up, cs); @@ -2400,19 +2403,17 @@ comp_surface_smart_add(Eo *obj) e = evas_object_evas_get(obj); cs->img = evas_object_image_filled_add(e); evas_object_show(cs->img); - cs->clip = evas_object_rectangle_add(e); + cs->clip = (Eo*)efl_canvas_group_clipper_get(obj); + efl_gfx_entity_geometry_set(cs->clip, efl_gfx_entity_geometry_get(obj)); evas_object_smart_member_add(cs->img, cs->obj); - evas_object_smart_member_add(cs->clip, cs->obj); evas_object_image_border_center_fill_set(cs->img, EVAS_BORDER_FILL_SOLID); evas_object_image_colorspace_set(cs->img, EVAS_COLORSPACE_ARGB); } static void -comp_surface_smart_del(Eo *obj) +_efl_wl_surface_efl_canvas_group_group_del(Eo *obj, Comp_Surface *cs) { - Comp_Surface *cs = evas_object_smart_data_get(obj); - array_clear(>input_rects); array_clear(>opaque_rects); eina_tiler_free(cs->opaque); @@ -2426,7 +2427,6 @@ comp_surface_smart_del(Eo *obj) wl_resource_destroy(cs->res); } evas_object_del(cs->img); - evas_object_del(cs->clip); if (cs->shell.surface) { if (cs->role) @@ -2435,54 +2435,41 @@ comp_surface_smart_del(Eo *obj) } cs->c->surfaces = eina_inlist_remove(cs->c->surfaces, EINA_INLIST_GET(cs)); cs->c->surfaces_count--; - free(cs); } static void -comp_surface_smart_move(Eo *obj, int x, int y) +_efl_wl_surface_efl_gfx_entity_position_set(Eo *obj, Comp_Surface *cs, Eina_Position2D pos) { - Eina_List *l; - Eo *o; - int px, py, cx, cy; + efl_gfx_entity_position_set(efl_super(obj, EFL_WL_SURFACE_CLASS), pos); + efl_gfx_entity_position_set(cs->clip, pos); - evas_object_geometry_get(obj, , , NULL, NULL); //{ - //Comp_Surface *cs = evas_object_smart_data_get(obj); //if (cs->cursor) //fprintf(stderr, "COMP %sSURFACE(%p) %d,%d\n", cs->subsurfac
[EGIT] [core/efl] master 12/15: efl/wl: add 'extracted' property for surfaces
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=07b8f7f0ffe003f80bc507211d9334fe6bfd97df commit 07b8f7f0ffe003f80bc507211d9334fe6bfd97df Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:25 2020 -0400 efl/wl: add 'extracted' property for surfaces Summary: useful to be able to know whether a surface has been extracted Depends on D11476 Reviewers: segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11495 --- src/lib/efl_canvas_wl/efl_canvas_wl.c | 8 src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo | 6 ++ 2 files changed, 14 insertions(+) diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl.c b/src/lib/efl_canvas_wl/efl_canvas_wl.c index 801c3f3fd3..997703299f 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl.c +++ b/src/lib/efl_canvas_wl/efl_canvas_wl.c @@ -5813,6 +5813,14 @@ _efl_canvas_wl_surface_parent_surface_get(const Eo *surface, Comp_Surface *cs) return NULL; } +static EOLIAN Eina_Bool +_efl_canvas_wl_surface_extracted_get(const Eo *surface EINA_UNUSED, Comp_Surface *cs) +{ + EINA_SAFETY_ON_TRUE_RETURN_VAL(cs->dead, EINA_FALSE); + + return cs->extracted; +} + static EOLIAN void _efl_canvas_wl_seat_keymap_set(Eo *obj, Comp *c, Eo *seat, Efl_Canvas_Wl_Xkb_State *state, const char *str, Efl_Canvas_Wl_Wl_Array *key_array) { diff --git a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo index d93e7d1ce6..f2a351becc 100644 --- a/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo +++ b/src/lib/efl_canvas_wl/efl_canvas_wl_surface.eo @@ -18,6 +18,12 @@ class @beta Efl.Canvas.Wl.Surface extends Efl.Canvas.Group parent: Efl.Canvas.Wl.Surface; } } + @property extracted { + get {} + values { +extracted: bool; + } + } } implements { Efl.Object.constructor; --
[EGIT] [core/efl] master 07/15: efl-wl: make surface restacking functions return the current surface
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=09aba19cc9db289e4c30ff25bb61974f4afcad18 commit 09aba19cc9db289e4c30ff25bb61974f4afcad18 Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:57 2020 -0400 efl-wl: make surface restacking functions return the current surface Summary: seems more useful Depends on D11468 Reviewers: segfaultxavi, bu5hm4n Reviewed By: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11469 --- src/lib/efl_wl/Efl_Wl.h | 2 +- src/lib/efl_wl/efl_wl.c | 16 src/lib/efl_wl/efl_wl.eo | 4 ++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/efl_wl/Efl_Wl.h b/src/lib/efl_wl/Efl_Wl.h index 71b3c2c190..d24557dc1a 100644 --- a/src/lib/efl_wl/Efl_Wl.h +++ b/src/lib/efl_wl/Efl_Wl.h @@ -31,8 +31,8 @@ typedef void * Efl_Wl_Wl_Interface_Data; typedef void * Efl_Wl_Wl_Interface_Bind_Cb; typedef struct Efl_Wl_Xkb_State Efl_Wl_Xkb_State; -#include #include +#include /** * @defgroup Efl_Wl_Group EFL Wayland * diff --git a/src/lib/efl_wl/efl_wl.c b/src/lib/efl_wl/efl_wl.c index 0aa1d23096..84a61e83ae 100644 --- a/src/lib/efl_wl/efl_wl.c +++ b/src/lib/efl_wl/efl_wl.c @@ -5584,40 +5584,40 @@ _efl_wl_allowed_pid_del(Eo *obj, Comp *c, int32_t pid) eina_hash_del_by_key(c->exes, ); } -EOLIAN static Eina_Bool +EOLIAN static Eo * _efl_wl_surface_next(Eo *obj, Comp *c) { Comp_Surface *cs; - if (c->surfaces_count < 2) return EINA_FALSE; + if (c->surfaces_count < 2) return NULL; EINA_INLIST_REVERSE_FOREACH(c->surfaces, cs) { if (cs->shell.activated) continue; if ((!cs->role) || (!cs->shell.surface) || cs->dead) continue; cs->shell.activated = 1; shell_surface_send_configure(cs); -return EINA_TRUE; +return cs->obj; } - return EINA_FALSE; + return NULL; } -EOLIAN static Eina_Bool +EOLIAN static Eo * _efl_wl_surface_prev(Eo *obj, Comp *c) { Comp_Surface *cs; - if (c->surfaces_count < 2) return EINA_FALSE; + if (c->surfaces_count < 2) return NULL; EINA_INLIST_FOREACH(c->surfaces, cs) { if (cs->shell.activated) continue; if ((!cs->role) || (!cs->shell.surface) || cs->dead) continue; cs->shell.activated = 1; shell_surface_send_configure(cs); -return EINA_TRUE; +return cs->obj; } - return EINA_FALSE; + return NULL; } EOLIAN static void diff --git a/src/lib/efl_wl/efl_wl.eo b/src/lib/efl_wl/efl_wl.eo index 20663624cb..af7f79393c 100644 --- a/src/lib/efl_wl/efl_wl.eo +++ b/src/lib/efl_wl/efl_wl.eo @@ -54,10 +54,10 @@ class @beta Efl.Wl extends Efl.Canvas.Group } } surface_next { - return: bool; + return: Efl.Wl.Surface; } surface_prev { - return: bool; + return: Efl.Wl.Surface; } @property aspect { values { --
[EGIT] [core/efl] master 14/15: efl/exe: don't err on del if exe has been killed
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=65b081394dc421dd6d2283213f8cf0c7c6dd4748 commit 65b081394dc421dd6d2283213f8cf0c7c6dd4748 Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:37 2020 -0400 efl/exe: don't err on del if exe has been killed Summary: the point of this err is to inform the user that their exe is (possibly) dangling, but if the user just wants to ignore the exit callback this isn't a problem Depends on D11496 Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11497 --- src/lib/ecore/efl_exe.c | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index 1cb0276205..c5a2f57343 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -69,6 +69,7 @@ struct _Efl_Exe_Data } fd; #endif Eina_Bool exit_called : 1; + Eina_Bool exit_signalled : 1; Eina_Bool run : 1; }; @@ -269,10 +270,10 @@ _efl_exe_signal(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd, Efl_Exe_Signal sig) switch (sig) { - case EFL_EXE_SIGNAL_INT: s = SIGINT; break; - case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; break; - case EFL_EXE_SIGNAL_TERM: s = SIGTERM; break; - case EFL_EXE_SIGNAL_KILL: s = SIGKILL; break; + case EFL_EXE_SIGNAL_INT: s = SIGINT; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_QUIT: s = SIGQUIT; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_TERM: s = SIGTERM; pd->exit_signalled = EINA_TRUE; break; + case EFL_EXE_SIGNAL_KILL: s = SIGKILL; pd->exit_signalled = EINA_TRUE; break; case EFL_EXE_SIGNAL_CONT: s = SIGCONT; break; case EFL_EXE_SIGNAL_STOP: s = SIGSTOP; break; case EFL_EXE_SIGNAL_HUP: s = SIGHUP; break; @@ -581,6 +582,7 @@ _efl_exe_efl_task_end(Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) #ifdef _WIN32 #else if (pd->pid == -1) return; + pd->exit_signalled = EINA_TRUE; kill(pd->pid, SIGINT); #endif } @@ -623,7 +625,7 @@ _efl_exe_efl_object_destructor(Eo *obj, Efl_Exe_Data *pd) { #ifdef _WIN32 #else - if (!pd->exit_called) + if ((!pd->exit_called) && (!pd->exit_signalled)) ERR("Exe being destroyed while child has not exited yet."); if (pd->fd.exited_read >= 0) { --
[EGIT] [core/efl] master 01/15: efl/exe: add 'pid' property
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=798fdfbc70a8160d7ec89a5829c01a0fccb40dd9 commit 798fdfbc70a8160d7ec89a5829c01a0fccb40dd9 Author: Mike Blumenkrantz Date: Thu Mar 12 12:15:20 2020 -0400 efl/exe: add 'pid' property Reviewers: bu5hm4n, segfaultxavi Reviewed By: bu5hm4n Subscribers: bu5hm4n, vtorri, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11451 --- src/lib/ecore/efl_exe.c | 10 ++ src/lib/ecore/efl_exe.eo | 9 + 2 files changed, 19 insertions(+) diff --git a/src/lib/ecore/efl_exe.c b/src/lib/ecore/efl_exe.c index b2c6341523..4580a41351 100644 --- a/src/lib/ecore/efl_exe.c +++ b/src/lib/ecore/efl_exe.c @@ -580,6 +580,16 @@ _efl_exe_exit_signal_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) return pd->exit_signal; } +EOLIAN static int +_efl_exe_pid_get(const Eo *obj EINA_UNUSED, Efl_Exe_Data *pd) +{ +#ifndef _WIN32 + if (pd->pid != -1) + return pd->pid; +#endif + return 0; +} + EOLIAN static Efl_Object * _efl_exe_efl_object_constructor(Eo *obj, Efl_Exe_Data *pd) { diff --git a/src/lib/ecore/efl_exe.eo b/src/lib/ecore/efl_exe.eo index 23b68935e4..11f6519be3 100644 --- a/src/lib/ecore/efl_exe.eo +++ b/src/lib/ecore/efl_exe.eo @@ -51,6 +51,15 @@ class @beta Efl.Exe extends Efl.Task implements Efl.Io.Reader, Efl.Io.Writer, Ef sig: int; [[The exit signal, or -1 if no exit signal happened.]] } } + @property pid { + [[The pid of the process, which is only accessible after the object has been finalized. + @since 1.24 + ]] + get { } + values { +pid: int; [[The pid, or 0 on failure.]] + } + } @property env { [[If $env is $NULL then the process created by this object is going to inherit the environment of this process. --
[EGIT] [core/efl] master 11/15: add EFL_VERSION_1_24 define
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=955574c0448f15c717f906fc50cb8eb590884170 commit 955574c0448f15c717f906fc50cb8eb590884170 Author: Mike Blumenkrantz Date: Thu Mar 12 12:16:20 2020 -0400 add EFL_VERSION_1_24 define Summary: this needs to go in right after every release Reviewers: stefan_schmidt, devilhorns Reviewed By: stefan_schmidt, devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11477 --- src/bin/edje/edje_cc_parse.c | 4 +++- src/lib/efl/Efl.h| 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/edje/edje_cc_parse.c b/src/bin/edje/edje_cc_parse.c index ad1a2c95ac..e6db4f5840 100644 --- a/src/bin/edje/edje_cc_parse.c +++ b/src/bin/edje/edje_cc_parse.c @@ -30,6 +30,7 @@ #define EDJE_1_21_SUPPORTED " -DEFL_VERSION_1_21=1 " #define EDJE_1_22_SUPPORTED " -DEFL_VERSION_1_22=1 " #define EDJE_1_23_SUPPORTED " -DEFL_VERSION_1_23=1 " +#define EDJE_1_24_SUPPORTED " -DEFL_VERSION_1_24=1 " #define EDJE_CC_EFL_VERSION_SUPPORTED \ EDJE_1_18_SUPPORTED \ @@ -37,7 +38,8 @@ EDJE_1_20_SUPPORTED \ EDJE_1_21_SUPPORTED \ EDJE_1_22_SUPPORTED \ - EDJE_1_23_SUPPORTED + EDJE_1_23_SUPPORTED \ + EDJE_1_24_SUPPORTED static voidnew_object(void); static voidnew_statement(void); diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index ea891223e9..81e274883b 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -52,6 +52,7 @@ extern "C" { #define EFL_VERSION_1_21 1 #define EFL_VERSION_1_22 1 #define EFL_VERSION_1_23 1 +#define EFL_VERSION_1_24 1 /* Add here all the required ifdef for any @protected method */ #ifdef EFL_BUILD --