[EGIT] [core/efl] master 02/02: evas_textblock: remove logically dead code
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=42d525e15b9ed3e8ad053def6de5fc167a98fbff commit 42d525e15b9ed3e8ad053def6de5fc167a98fbff Author: Yeongjong Lee Date: Fri Jul 31 06:44:44 2020 + evas_textblock: remove logically dead code Since `c->fmt` is allocated and dereferenced in `_layoutformat_push`, if `c->fmt` is NULL, this causes a crash before checking for NULL. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D12076 --- src/lib/evas/canvas/evas_object_textblock.c | 4 1 file changed, 4 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index b8541b3949..4c6fc865d8 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7668,10 +7668,6 @@ _layout_setup(Ctxt *c, const Eo *eo_obj, Evas_Coord w, Evas_Coord h) { c->fmt = _layout_format_push(c, o->main_fmt, NULL); } - if (!c->fmt) - { -return EINA_FALSE; - } c->paragraphs = o->paragraphs; --
[EGIT] [core/efl] master 01/01: ecore_ipc: remove duplicated condition
stefan pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4e24854f4624f8cdc73f25cda28508b58745d9ac commit 4e24854f4624f8cdc73f25cda28508b58745d9ac Author: Yeongjong Lee Date: Fri Jul 31 07:09:40 2020 + ecore_ipc: remove duplicated condition The same condition is used above. Reviewed-by: Stefan Schmidt Differential Revision: https://phab.enlightenment.org/D12077 --- src/lib/ecore_ipc/ecore_ipc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ecore_ipc/ecore_ipc.c b/src/lib/ecore_ipc/ecore_ipc.c index c21cbcc965..389d905d9e 100644 --- a/src/lib/ecore_ipc/ecore_ipc.c +++ b/src/lib/ecore_ipc/ecore_ipc.c @@ -1851,7 +1851,7 @@ ecore_ipc_server_data_process(Ecore_Ipc_Server *svr, void *data, int size, Eina_ offset += (s + msg.size); if ((svr->buf_size == offset) && (svr->buf)) { - if (svr->buf) free(svr->buf); + free(svr->buf); svr->buf = NULL; svr->buf_size = 0; return ECORE_CALLBACK_CANCEL; --
[EGIT] [core/efl] master 01/01: efl_ui_bg: disable preloading of the internal image
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=92455d42a063229338247a3b21ba0c4a06d43bfe commit 92455d42a063229338247a3b21ba0c4a06d43bfe Author: Yeongjong Lee Date: Thu May 28 16:17:58 2020 +0900 efl_ui_bg: disable preloading of the internal image Summary: preloading is elm_image feature. it is better to disable preloading for elm_bg becuase there is no way to disable preloading of internal image in elm_bg. If API user want to use preloaded image, elm_image is recommended instead of elm_bg. Test Plan: elm_bg_file_set with big image. Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11898 --- src/lib/elementary/efl_ui_bg.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_bg.c b/src/lib/elementary/efl_ui_bg.c index 51b12158db..56ccdbd72f 100644 --- a/src/lib/elementary/efl_ui_bg.c +++ b/src/lib/elementary/efl_ui_bg.c @@ -187,7 +187,11 @@ elm_bg_load_size_set(Evas_Object *obj, int w, int h) EAPI Eina_Bool elm_bg_file_set(Eo *obj, const char *file, const char *group) { - return efl_file_simple_load((Eo *) obj, file, group); + EFL_UI_BG_DATA_GET_OR_RETURN_VAL(obj, sd, EINA_FALSE); + Eina_Bool ret = efl_file_simple_load((Eo *) obj, file, group); + if (ret) elm_image_preload_disabled_set(sd->img, EINA_TRUE); + + return ret; } EOLIAN static Eina_Error --
[EGIT] [core/efl] master 01/01: efl_ui_layout: remove group_calcualte to respect legacy min size
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a227b83f41adc3d8ca5f27c36f4e708d2f508c35 commit a227b83f41adc3d8ca5f27c36f4e708d2f508c35 Author: Yeongjong Lee Date: Wed May 20 16:36:15 2020 +0900 efl_ui_layout: remove group_calcualte to respect legacy min size Summary: For legacy elm_layout, the size should be calculated based on `hint_size_combined_min` instead of `hint_size_min` in the group_calculate. Also, `_efl_ui_layout_efl_canvas_group_group_calculate` is unnecessary because it is added to allow finger size policy differentiation between inherited layout and layout object (see also, 46cf288d32f06a0c82ef227c65e55062bf494672), however, it can be set by `finger_size_multiplier` proeprty in constructor. Test Plan: Check `evas_object_size_hint_min_set` is respected. layout_example.c ``` //Compile with: //edje_cc layout_example.edc && gcc -g layout_example.c -o layout_example `pkg-config --cflags --libs elementary` #include EAPI_MAIN int elm_main(int argc EINA_UNUSED, char **argv EINA_UNUSED) { Evas_Object *win, *layout, *box; elm_policy_set(ELM_POLICY_QUIT, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED); win = elm_win_util_standard_add("layout", "Layout"); elm_win_autodel_set(win, EINA_TRUE); box = elm_box_add(win); evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL); evas_object_show(box); elm_win_resize_object_add(win, box); layout = elm_layout_add(box); evas_object_size_hint_min_set(layout, 300, 200); elm_layout_file_set(layout, "./layout_example.edj", "mylayout"); evas_object_show(layout); elm_box_pack_end(box, layout); evas_object_resize(win, 300, 300); evas_object_show(win); elm_run(); return 0; } ELM_MAIN() ``` layout_example.edc ``` collections { group { name: "mylayout"; parts { part { name: "bg"; type: RECT; description { state: "default" 0.0; color: 100 190 100 255; } } part { name: "mytext1"; type: TEXT; description { state: "default" 0.0; text { size: 30; text: "my text1"; min: 1 0; } color: 0 255 0 255; rel1.relative: 0.0 0.0; rel2.relative: 1.0 0.3; } } } parts { part { name: "mytext2"; type: TEXT; description { state: "default" 0.0; text { size: 30; text: "my text2"; min: 1 0; } color: 0 255 255 255; rel1.relative: 0.0 0.3; rel2.relative: 1.0 0.6; } } } } } ``` Reviewers: zmike, Jaehyun_Cho, woohyun Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11858 --- src/lib/elementary/efl_ui_layout.c | 7 --- src/lib/elementary/efl_ui_layout.eo | 1 - 2 files changed, 8 deletions(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 34a9c2967e..1839406cb0 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -1000,13 +1000,6 @@ _efl_ui_layout_base_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd) efl_canvas_group_del(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_efl_ui_layout_efl_canvas_group_group_calculate(Eo *obj, void *_pd EINA_UNUSED) -{ - efl_canvas_group_need_recalculate_set(obj, EINA_FALSE); - _sizing_eval(obj, efl_data_scope_get(obj, MY_CLASS), NULL); -} - /* rewrite or extend this one on your derived class as to suit your * needs */ EOLIAN static void diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo index 39a10b4a99..ab4d67c1e3 100644 --- a/src/lib/elementary/efl_ui_layout.eo +++ b/src/lib/elementary/efl_ui_layout.eo @@ -19,6 +19,5 @@ class Efl.Ui.Layout extends Efl.Ui.Layout_Base implements Efl.File Efl.File.load; Efl.File.unload; Efl.Object.constructor; - Efl.Canvas.Group.group_calculate; } } --
[EGIT] [core/efl] master 01/01: eo: null check for vtable allocation
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=aee7d74b156ad65305a62e06c2cc1fcc45c7d84a commit aee7d74b156ad65305a62e06c2cc1fcc45c7d84a Author: Yeongjong Lee Date: Mon Apr 13 19:50:43 2020 +0900 eo: null check for vtable allocation Reviewers: bu5hm4n, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11687 --- src/lib/eo/eo.c | 4 1 file changed, 4 insertions(+) diff --git a/src/lib/eo/eo.c b/src/lib/eo/eo.c index 4d3469c428..b93497372c 100644 --- a/src/lib/eo/eo.c +++ b/src/lib/eo/eo.c @@ -906,6 +906,7 @@ efl_class_functions_set(const Efl_Class *klass_id, const Efl_Object_Ops *object_ klass->class_id = _UNMASK_ID(klass->header.id) - 1; _vtable_init(>vtable); + if (!klass->vtable.chain) goto err_vtable; hitmap = alloca(klass->vtable.size); memset(hitmap, 0, klass->vtable.size); @@ -980,6 +981,9 @@ err_funcs: err_klass: _EO_POINTER_ERR(klass_id, "Class (%p) is an invalid ref.", klass_id); return EINA_FALSE; +err_vtable: + ERR("failed to allocate vtable for class '%s'", klass->desc->name); + return EINA_FALSE; } static Eo * --
[EGIT] [core/efl] master 01/01: elm_dnd: null check for safety
devilhorns pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=351e9fa23f1389f33fc8cf12ab6ed18ee2f0b72b commit 351e9fa23f1389f33fc8cf12ab6ed18ee2f0b72b Author: Yeongjong Lee Date: Wed Apr 8 10:53:17 2020 + elm_dnd: null check for safety Also, it needs to keep backward compatibility. Reviewed-by: Christopher Michael Differential Revision: https://phab.enlightenment.org/D11666 --- src/lib/elementary/elm_dnd.c | 9 + 1 file changed, 9 insertions(+) diff --git a/src/lib/elementary/elm_dnd.c b/src/lib/elementary/elm_dnd.c index 699414bb4a..bc765fdbb6 100644 --- a/src/lib/elementary/elm_dnd.c +++ b/src/lib/elementary/elm_dnd.c @@ -163,6 +163,7 @@ elm_drop_target_add(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_Pos pos_cb, void *pos_data, Elm_Drop_Cb drop_cb, void *drop_data) { + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); Elm_Drop_Target *target = calloc(1, sizeof(Elm_Drop_Target)); target->enter_cb = enter_cb; @@ -195,6 +196,8 @@ elm_drop_target_del(Evas_Object *obj, Elm_Sel_Format format, Elm_Drop_Target *target; Eina_List *n, *found = NULL; + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + if (!target_register) return EINA_TRUE; Eina_List *targets = eina_hash_find(target_register, ); @@ -769,6 +772,12 @@ elm_drag_start(Evas_Object *obj, Elm_Sel_Format format, Elm_Drag_Data *dd; const char *str_action; + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, EINA_FALSE); + + //it should return EINA_TRUE to keep backward compatibility + if (!data) + return EINA_TRUE; + str_action = _action_to_string(action); dd = calloc(1, sizeof(Elm_Drag_Data)); dd->dragposcb = dragpos; --
[EGIT] [core/efl] master 01/01: test_efl_gfx_vg_value_provider: expand buffer to avoid truncation by snprintf
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d8da207f5f4937a6a99576b04bffa8ff9bfa9cbe commit d8da207f5f4937a6a99576b04bffa8ff9bfa9cbe Author: Yeongjong Lee Date: Tue Feb 25 12:23:30 2020 +0100 test_efl_gfx_vg_value_provider: expand buffer to avoid truncation by snprintf Test Plan: compile with `-Wformat-truncation` Reviewers: raster, Hermet, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11405 --- src/bin/elementary/test_efl_gfx_vg_value_provider.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/elementary/test_efl_gfx_vg_value_provider.c b/src/bin/elementary/test_efl_gfx_vg_value_provider.c index 2b5c9ee864..991c5c4e9d 100644 --- a/src/bin/elementary/test_efl_gfx_vg_value_provider.c +++ b/src/bin/elementary/test_efl_gfx_vg_value_provider.c @@ -148,7 +148,7 @@ btn_clicked_cb(void *data , const Efl_Event *ev ) char new_path[255], new_type[255], new_values[255]; if (add_value_provider(new_path, new_type, new_values)) { - char buf[255]; + char buf[765]; //TODO: Even if there is the same path as the existing item, it is added without updating. // In efl_ui_vg_animation, duplicate paths are managed. // However, animator (lottie) does not have an implementation that manages overridden values. @@ -169,7 +169,7 @@ btn_clicked_cb(void *data , const Efl_Event *ev ) } } }*/ - sprintf(buf, "%s/%s/%s", new_path, new_type, new_values); + snprintf(buf, sizeof(buf), "%s/%s/%s", new_path, new_type, new_values); list_it = elm_list_item_append(list, buf, NULL, NULL, NULL, NULL); elm_list_item_bring_in(list_it); elm_list_go(list); --
[EGIT] [core/efl] master 01/01: efl_ui_exact_model: use eina APIs to get the nth data
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b0179deda5bceb6d5c625431d5f7fb59f239253c commit b0179deda5bceb6d5c625431d5f7fb59f239253c Author: Yeongjong Lee Date: Thu Feb 20 09:11:02 2020 -0500 efl_ui_exact_model: use eina APIs to get the nth data Summary: Also, fixes a compiler warning ``` ../src/lib/elementary/efl_ui_exact_model.c:60:17: warning: variable 'tbuf' set but not used [-Wunused-but-set-variable] ``` Test Plan: ninja Reviewers: cedric, zmike, bu5hm4n Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11380 --- src/lib/elementary/efl_ui_exact_model.c | 21 +++-- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/src/lib/elementary/efl_ui_exact_model.c b/src/lib/elementary/efl_ui_exact_model.c index b12cfba8bd..fc1b5997c7 100644 --- a/src/lib/elementary/efl_ui_exact_model.c +++ b/src/lib/elementary/efl_ui_exact_model.c @@ -54,20 +54,6 @@ _efl_ui_exact_model_efl_object_constructor(Eo *obj, Efl_Ui_Exact_Model_Data *pd) return efl_constructor(efl_super(obj, EFL_UI_EXACT_MODEL_CLASS)); } -static unsigned int -_efl_ui_exact_model_list_find(unsigned int list_index, Eina_List *start, Eina_List **l) -{ - Eina_Binbuf *tbuf; - - EINA_LIST_FOREACH(start, *l, tbuf) - { -if (list_index == 0) break; -list_index--; - } - - return list_index; -} - static Eina_List * _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, unsigned int *buffer) { @@ -78,7 +64,7 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns Eina_List *l = NULL; unsigned int i; - _efl_ui_exact_model_list_find(list_index, compressed, ); + l = eina_list_nth_list(compressed, list_index); tbuf = eina_binbuf_manage_new((unsigned char *) buffer, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); if (!tbuf) return compressed; @@ -136,16 +122,15 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns static unsigned int * _efl_ui_exact_model_buffer_expand(unsigned int list_index, unsigned int *buffer, Eina_List *list) { - unsigned int found; Eina_Binbuf *tmp; Eina_List *l = NULL; if (!buffer) buffer = malloc(EFL_UI_EXACT_MODEL_CONTENT_LENGTH); - found = _efl_ui_exact_model_list_find(list_index, list, ); + l = eina_list_nth_list(list, list_index); // Check if the data is in the list - if (!found) + if (!l) { // Not found -> everything is assumed to be zero memset(buffer, 0, EFL_UI_EXACT_MODEL_CONTENT_LENGTH); --
[EGIT] [core/efl] master 02/02: efl_ui_selection_manager: fix a compiler warning for Wayland support
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ba8c349eedd35608f94996aada44ab8d1c404d4a commit ba8c349eedd35608f94996aada44ab8d1c404d4a Author: Yeongjong Lee Date: Mon Feb 17 18:48:11 2020 +0900 efl_ui_selection_manager: fix a compiler warning for Wayland support Summary: `_sel_manager_seat_selection_get` is used only for x11. Test Plan: meson build -Dx11=false -Dwl=true Reviewers: Hermet, zmike Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11363 --- src/lib/elementary/efl_ui_selection_manager.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c index 5a2d0b18bd..76f2c03002 100644 --- a/src/lib/elementary/efl_ui_selection_manager.c +++ b/src/lib/elementary/efl_ui_selection_manager.c @@ -50,6 +50,7 @@ static void _set_selection_list(Sel_Manager_Selection *sel_list, Sel_Manager_Sea EAPI int ELM_CNP_EVENT_SELECTION_CHANGED = -1; +#ifdef HAVE_ELEMENTARY_X static Sel_Manager_Seat_Selection * _sel_manager_seat_selection_get(Efl_Ui_Selection_Manager_Data *pd, unsigned int seat) { @@ -66,6 +67,7 @@ _sel_manager_seat_selection_get(Efl_Ui_Selection_Manager_Data *pd, unsigned int return seat_sel; } +#endif static inline void _owner_change_check(Efl_Ui_Selection_Manager *manager, Efl_Object *owner, --
[EGIT] [core/efl] master 01/02: efl_ui_selection_manager: remove unnecessary variable
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef4bfd847a4f09d0cf485e7029c8fc7ef44b263b commit ef4bfd847a4f09d0cf485e7029c8fc7ef44b263b Author: Yeongjong Lee Date: Mon Feb 17 18:47:54 2020 +0900 efl_ui_selection_manager: remove unnecessary variable Summary: No logical changes. Test Plan: meson build Reviewers: Hermet, zmike Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11362 --- src/lib/elementary/efl_ui_selection_manager.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_selection_manager.c b/src/lib/elementary/efl_ui_selection_manager.c index 3a5db9713c..5a2d0b18bd 100644 --- a/src/lib/elementary/efl_ui_selection_manager.c +++ b/src/lib/elementary/efl_ui_selection_manager.c @@ -4753,7 +4753,6 @@ EOLIAN static void _efl_ui_selection_manager_selection_clear(Eo *obj, Efl_Ui_Selection_Manager_Data *pd, Efl_Object *owner, Efl_Ui_Selection_Type type, unsigned int seat) { - Eina_Bool local = EINA_FALSE; Sel_Manager_Seat_Selection *seat_sel; Sel_Manager_Selection *sel = NULL; @@ -4801,8 +4800,7 @@ _efl_ui_selection_manager_selection_clear(Eo *obj, Efl_Ui_Selection_Manager_Data free(seat_sel->sel_list[type].data.mem); seat_sel->sel_list[type].data.mem = NULL; } -if (sel->xwin != 0) local = EINA_TRUE; -if (!local) seat_sel->sel_list[type].clear(); +if (!sel->xwin) seat_sel->sel_list[type].clear(); else { Eina_List *l, *l_next; --
[EGIT] [core/efl] master 02/02: els_cursor: Fix a compiler warning for Wayland support
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=36275929af4c247d27ce157da0914b9d39dc3725 commit 36275929af4c247d27ce157da0914b9d39dc3725 Author: Yeongjong Lee Date: Mon Feb 17 15:36:03 2020 +0900 els_cursor: Fix a compiler warning for Wayland support Summary: `_curosors` is not used when Elementary is compiled for Wayland. It Fixes a compiler warning. ``` ../src/lib/elementary/els_cursor.c:46:26: warning: ‘_cursors’ defined but not used [-Wunused-variable] static struct _Cursor_Id _cursors[] = ``` Test Plan: meson build -Dx11=false -Dwl=true Reviewers: zmike, Hermet, Jaehyun_Cho Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11360 --- src/lib/elementary/els_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/els_cursor.c b/src/lib/elementary/els_cursor.c index eeb1d18f85..4b3622a39e 100644 --- a/src/lib/elementary/els_cursor.c +++ b/src/lib/elementary/els_cursor.c @@ -42,6 +42,7 @@ struct _Cursor_Id # define CURSOR(_name, _id, _cid) { _name } #endif +#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_COCOA) || defined(HAVE_ELEMENTARY_WIN32) /* Please keep order in sync with Ecore_X_Cursor.h values! */ static struct _Cursor_Id _cursors[] = { @@ -124,7 +125,6 @@ static struct _Cursor_Id _cursors[] = CURSOR(ELM_CURSOR_XTERM , XTERM , ECORE_COCOA_CURSOR_IBEAM) }; -#if defined(HAVE_ELEMENTARY_X) || defined(HAVE_ELEMENTARY_COCOA) || defined(HAVE_ELEMENTARY_WIN32) static const int _cursors_count = sizeof(_cursors)/sizeof(struct _Cursor_Id); #endif --
[EGIT] [core/efl] master 01/02: edje_multisense: fix a compiler warning for pulseaudio disable mode
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=225b8f3ad83635efcea2852cd24307a436f1f9b1 commit 225b8f3ad83635efcea2852cd24307a436f1f9b1 Author: Yeongjong Lee Date: Mon Feb 17 15:35:57 2020 +0900 edje_multisense: fix a compiler warning for pulseaudio disable mode Summary: `_out_fail` is not used when edje is compiled without pulseaudio. Test Plan: meson build -Dpulseaudio=false Reviewers: zmike, Hermet, Jaehyun_Cho Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11361 --- src/lib/edje/edje_multisense.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/edje/edje_multisense.c b/src/lib/edje/edje_multisense.c index ce4bd12e87..7bf2b8f363 100644 --- a/src/lib/edje/edje_multisense.c +++ b/src/lib/edje/edje_multisense.c @@ -13,6 +13,7 @@ _play_finished(void *data EINA_UNUSED, const Efl_Event *event) efl_unref(event->object); } +#if defined(_WIN32) || defined(HAVE_PULSE) static void _out_fail(void *data EINA_UNUSED, const Efl_Event *event) { @@ -20,6 +21,7 @@ _out_fail(void *data EINA_UNUSED, const Efl_Event *event) efl_unref(event->object); out = NULL; } +#endif struct _edje_multisense_eet_data { --
[EGIT] [core/efl] master 09/09: elm_main: remove unreachable condition
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=15973fb4dffe43652a52e264e7615e292eed2f39 commit 15973fb4dffe43652a52e264e7615e292eed2f39 Author: Yeongjong Lee Date: Fri Feb 14 08:34:36 2020 -0500 elm_main: remove unreachable condition Summary: The condition `!*p` is always false because of line 1336. Reviewers: zmike, Hermet, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11349 --- src/lib/elementary/elm_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index d6c2b2a82f..d1d0c4a183 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -1347,7 +1347,6 @@ elm_quicklaunch_exe_path_get(const char *exe, const char *cwd) } else { - if (!*p) break; p++; } } --
[EGIT] [core/efl] master 01/01: eina_rbtree: avoid defererencing null pointer
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fff6ce7f2eff52a9d97db2280124278cf08516a8 commit fff6ce7f2eff52a9d97db2280124278cf08516a8 Author: Yeongjong Lee Date: Fri Feb 14 18:17:25 2020 +0900 eina_rbtree: avoid defererencing null pointer Summary: Pointer 'it->stack' is dereferenced at `_eina_rbtree_iterator_free`. Reviewers: Hermet, zmike Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11346 --- src/lib/eina/eina_rbtree.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/eina/eina_rbtree.c b/src/lib/eina/eina_rbtree.c index b7373c7fbe..24d5b99a00 100644 --- a/src/lib/eina/eina_rbtree.c +++ b/src/lib/eina/eina_rbtree.c @@ -228,10 +228,14 @@ _eina_rbtree_iterator_build(const Eina_Rbtree *root, unsigned char mask) it = calloc(1, sizeof (Eina_Iterator_Rbtree)); if (!it) return NULL; - eina_trash_init(>trash); +eina_trash_init(>trash); - it->stack = eina_array_new(8); - if (!it->stack) goto on_error; +it->stack = eina_array_new(8); +if (!it->stack) + { + free(it); + return NULL; + } } first = _eina_rbtree_iterator_list_new(it, root); --
[EGIT] [core/efl] master 01/01: vg_common_json: use %zu for size_t
yohoho pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=17f0d23e3736fad04f1888e9611d00bb4b4b581e commit 17f0d23e3736fad04f1888e9611d00bb4b4b581e Author: Yeongjong Lee Date: Thu Feb 13 11:30:27 2020 +0900 vg_common_json: use %zu for size_t Summary: Fixes a compiler warning ``` ../src/static_libs/vg_common/vg_common_json.c: In function '_get_key_val': ../src/static_libs/vg_common/vg_common_json.c:16:34: warning: format '%ld' expects argument of type 'long int', but argument 4 has type 'unsigned int' [-Wformat=] ``` Test Plan: ninja build Reviewers: Hermet, jsuya Reviewed By: jsuya Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11327 --- src/static_libs/vg_common/vg_common_json.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/static_libs/vg_common/vg_common_json.c b/src/static_libs/vg_common/vg_common_json.c index a8f46832b8..2092b852a5 100644 --- a/src/static_libs/vg_common/vg_common_json.c +++ b/src/static_libs/vg_common/vg_common_json.c @@ -13,7 +13,7 @@ static char* _get_key_val(void *key) { static char buf[30]; - snprintf(buf, sizeof(buf), "%ld", (size_t) key); + snprintf(buf, sizeof(buf), "%zu", (size_t) key); return buf; } --
[EGIT] [core/efl] master 01/02: efl_ui_panes: remove duplicated press/unpress event
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=63e20ed28d721c8e7d61113e67917fd9d4d0586c commit 63e20ed28d721c8e7d61113e67917fd9d4d0586c Author: Yeongjong Lee Date: Fri Jan 17 07:50:07 2020 + efl_ui_panes: remove duplicated press/unpress event pressed/unpressed event will be emitted by efl_input_clickable_press/unpress. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D6 --- src/lib/elementary/efl_ui_panes.c | 4 ++-- src/lib/elementary/efl_ui_panes.eo | 4 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 3047fb3052..1b2c765ee1 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -181,7 +181,7 @@ _on_pressed(void *data, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) { - efl_event_callback_legacy_call(data, ELM_PANES_EVENT_PRESS, NULL); + evas_object_smart_callback_call(data, "press", NULL); efl_input_clickable_press(data, 1); } @@ -192,7 +192,7 @@ _on_unpressed(void *data, const char *source EINA_UNUSED) { EFL_UI_PANES_DATA_GET(data, sd); - efl_event_callback_legacy_call(data, ELM_PANES_EVENT_UNPRESS, NULL); + evas_object_smart_callback_call(data, "unpress", NULL); efl_input_clickable_unpress(data, 1); if (sd->double_clicked) { diff --git a/src/lib/elementary/efl_ui_panes.eo b/src/lib/elementary/efl_ui_panes.eo index 00d13530df..6c6402c356 100644 --- a/src/lib/elementary/efl_ui_panes.eo +++ b/src/lib/elementary/efl_ui_panes.eo @@ -53,8 +53,4 @@ class @beta Efl.Ui.Panes extends Efl.Ui.Layout_Base implements Efl.Ui.Layout_Ori Default is $vertical.]] } Efl.Part.part_get; } - events { - press: void; [[Called when panes got pressed]] - unpress: void; [[Called when panes are no longer pressed]] - } } --
[EGIT] [core/efl] master 01/02: elm_interface_scrollable: prevent calling APIs with NULL edje object
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2170a993882f28637a6b628a414863f4c00ea846 commit 2170a993882f28637a6b628a414863f4c00ea846 Author: Yeongjong Lee Date: Wed Feb 12 09:04:09 2020 -0500 elm_interface_scrollable: prevent calling APIs with NULL edje object Summary: Is is unnecessary to call edje_object_ functions if `edje_obj` is NULL. Also, It prevents printing 6 eo warnings ``` WRN<30343>:eo ../src/lib/eo/eo.c:644 _efl_object_call_resolve() NULL passed to function efl_layout_signal_emit(). ``` Test Plan: `EINA_LOG_LEVELS=eo:2 elementary_test` `EINA_LOG_LEVELS=eo:3 elementary_test -to focus` Reviewers: bu5hm4n, Jaehyun_Cho, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11315 --- src/lib/elementary/elm_interface_scrollable.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/elementary/elm_interface_scrollable.c b/src/lib/elementary/elm_interface_scrollable.c index 7130efbd94..f03ae31e63 100644 --- a/src/lib/elementary/elm_interface_scrollable.c +++ b/src/lib/elementary/elm_interface_scrollable.c @@ -4032,6 +4032,9 @@ _elm_interface_scrollable_reset_signals(Eo *obj EINA_UNUSED, Elm_Scrollable_Smar { sid->go_up = sid->go_down = sid->go_right = sid->go_left = EINA_FALSE; + if (!sid->edje_obj) + return; + edje_object_signal_emit(sid->edje_obj, "elm,action,hide,up", "elm"); edje_object_signal_emit(sid->edje_obj, "elm,action,hide,down", "elm"); edje_object_signal_emit(sid->edje_obj, "elm,action,hide,right", "elm"); --
[EGIT] [core/efl] master 02/02: elc_fileselector: add NULL check for eina_value_type_get
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b7db2edeeca402a4999b3d3a3807ec7f2ce8bc0d commit b7db2edeeca402a4999b3d3a3807ec7f2ce8bc0d Author: Yeongjong Lee Date: Wed Feb 12 09:05:42 2020 -0500 elc_fileselector: add NULL check for eina_value_type_get Reviewers: Jaehyun_Cho, Hermet, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11314 --- src/lib/elementary/elc_fileselector.c | 15 +++ 1 file changed, 15 insertions(+) diff --git a/src/lib/elementary/elc_fileselector.c b/src/lib/elementary/elc_fileselector.c index 39f1a7cd3d..eb107b14c6 100644 --- a/src/lib/elementary/elc_fileselector.c +++ b/src/lib/elementary/elc_fileselector.c @@ -2406,6 +2406,11 @@ _properties_ready(void *data, const Efl_Event *ev) Eina_Bool is_dir = EINA_FALSE; value = efl_model_property_get(ev->object, "is_dir"); + if (!eina_value_type_get(value)) +{ + ERR("Empty type for 'is_dir'"); + return; +} if (eina_value_type_get(value) != EINA_VALUE_TYPE_BOOL) { ERR("Unexpected type for 'is_dir': '%s' with value '%s'.", eina_value_type_get(value)->name, eina_value_to_string(value)); @@ -2471,6 +2476,11 @@ _elm_fileselector_selected_set_internal(Evas_Object *obj, const char *path) efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); value = efl_model_property_get(pd->target, "is_dir"); + if (!eina_value_type_get(value)) + { +ERR("Empty type for 'is_dir'"); +goto clean_up; + } if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR) { Eina_Error err = 0; @@ -2507,6 +2517,11 @@ _elm_fileselector_elm_interface_fileselector_selected_model_set(Eo *obj, Elm_Fil efl_event_callback_add(pd->target, EFL_MODEL_EVENT_PROPERTIES_CHANGED, _properties_ready, obj); value = efl_model_property_get(pd->target, "is_dir"); + if (!eina_value_type_get(value)) + { +ERR("Empty type for 'is_dir'"); +goto clean_up; + } if (eina_value_type_get(value) == EINA_VALUE_TYPE_ERROR) { Eina_Error err = 0; --
[EGIT] [core/efl] master 01/01: efl_ui_position_manager_list: add NULL check for memory allocation
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=69352e7abe36e8241b78f75771d2e397e36aac97 commit 69352e7abe36e8241b78f75771d2e397e36aac97 Author: Yeongjong Lee Date: Wed Feb 12 16:45:40 2020 +0900 efl_ui_position_manager_list: add NULL check for memory allocation Reviewers: Jaehyun_Cho, Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11312 --- src/lib/elementary/efl_ui_position_manager_list.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_position_manager_list.c b/src/lib/elementary/efl_ui_position_manager_list.c index 6424b4bf4d..dd90b12b2b 100644 --- a/src/lib/elementary/efl_ui_position_manager_list.c +++ b/src/lib/elementary/efl_ui_position_manager_list.c @@ -69,6 +69,7 @@ cache_require(Eo *obj EINA_UNUSED, Efl_Ui_Position_Manager_List_Data *pd) } pd->size_cache = calloc(pd->size + 1, sizeof(int)); + if (!pd->size_cache) return; pd->size_cache[0] = 0; pd->maximum_min_size = 0; --
[EGIT] [core/efl] master 01/02: elm perf_test: fix warning of implicit conversion of floating point
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=eb4af00c30f3f80e0d9707bfb44341ef302cda87 commit eb4af00c30f3f80e0d9707bfb44341ef302cda87 Author: Yeongjong Lee Date: Tue Feb 11 08:56:34 2020 -0500 elm perf_test: fix warning of implicit conversion of floating point Summary: The result of integral division is converted into floating point. In order to fix this warning, it changes denominator to double from integer. Reviewers: Jaehyun_Cho, Hermet, zmike Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11313 --- src/bin/elementary/perf_test_01.c | 4 ++-- src/bin/elementary/perf_test_02.c | 4 ++-- src/bin/elementary/perf_test_03.c | 4 ++-- src/bin/elementary/perf_test_04.c | 4 ++-- src/bin/elementary/perf_test_05.c | 4 ++-- src/bin/elementary/perf_test_06.c | 4 ++-- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/bin/elementary/perf_test_01.c b/src/bin/elementary/perf_test_01.c index d29f84813b..ef7f32d112 100644 --- a/src/bin/elementary/perf_test_01.c +++ b/src/bin/elementary/perf_test_01.c @@ -36,9 +36,9 @@ TST(01, tick) (Evas *e EINA_UNUSED, double f, Evas_Coord win_w, Evas_Coord win_h w = 5 + ((1.0 + cos((double)((f * 30.0) + (i * 10 * w0 * 2); h = 5 + ((1.0 + sin((double)((f * 40.0) + (i * 19 * h0 * 2); x = (win_w / 2) - (w / 2); -x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2)); +x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2.0)); y = (win_h / 2) - (h / 2); -y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2)); +y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2.0)); evas_object_geometry_set(o, x, y, w, h); } } diff --git a/src/bin/elementary/perf_test_02.c b/src/bin/elementary/perf_test_02.c index ac381c732a..e5f10f1549 100644 --- a/src/bin/elementary/perf_test_02.c +++ b/src/bin/elementary/perf_test_02.c @@ -36,9 +36,9 @@ TST(02, tick) (Evas *e EINA_UNUSED, double f, Evas_Coord win_w, Evas_Coord win_h w = 5 + ((1.0 + cos((double)((f * 30.0) + (i * 10 * w0 * 2); h = 5 + ((1.0 + sin((double)((f * 40.0) + (i * 19 * h0 * 2); x = (win_w / 2) - (w / 2); -x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2)); +x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2.0)); y = (win_h / 2) - (h / 2); -y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2)); +y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2.0)); evas_object_geometry_set(o, x, y, w, h); } } diff --git a/src/bin/elementary/perf_test_03.c b/src/bin/elementary/perf_test_03.c index 6737bedac5..ab35044538 100644 --- a/src/bin/elementary/perf_test_03.c +++ b/src/bin/elementary/perf_test_03.c @@ -36,9 +36,9 @@ TST(03, tick) (Evas *e EINA_UNUSED, double f, Evas_Coord win_w, Evas_Coord win_h w = 5 + ((1.0 + cos((double)((f * 30.0) + (i * 10 * w0 * 2); h = 5 + ((1.0 + sin((double)((f * 40.0) + (i * 19 * h0 * 2); x = (win_w / 2) - (w / 2); -x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2)); +x += (Evas_Coord)(sin((double)((f * 50.0) + (i * 13))) * (w0 / 2.0)); y = (win_h / 2) - (h / 2); -y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2)); +y += (Evas_Coord)(cos((double)((f * 45.0) + (i * 28))) * (h0 / 2.0)); evas_object_geometry_set(o, x, y, w, h); } } diff --git a/src/bin/elementary/perf_test_04.c b/src/bin/elementary/perf_test_04.c index 17aae98342..d593096f32 100644 --- a/src/bin/elementary/perf_test_04.c +++ b/src/bin/elementary/perf_test_04.c @@ -36,9 +36,9 @@ TST(04, tick) (Evas *e EINA_UNUSED, double f, Evas_Coord win_w, Evas_Coord win_h w = 5 + ((1.0 + cos((double)((f * 30.0) + (i * 10 * w0 * 2); h = 5 + ((1.0 + sin((double)((f * 40.0) + (i * 19 * h0 * 2); x = (win_w / 2) - (w / 2); -x += sin((double)((f * 50.0) + (i * 13))) * (w0 / 2); +x += sin((double)((f * 50.0) + (i * 13))) * (w0 / 2.0); y = (win_h / 2) - (h / 2); -y += cos((double)((f * 45.0) + (i * 28))) * (h0 / 2); +y += cos((double)((f * 45.0) + (i * 28))) * (h0 / 2.0); evas_object_geometry_set(o, x, y, w, h); } } diff --git a/src/bin/elementary/perf_test_05.c b/src/bin/elementary/perf_test_05.c index 64618ae608..1016952875 100644 --- a/src/bin/elementary/perf_test_05.c +++ b/src/bin/elementary/perf_test_05.c @@ -36,9 +36,9 @@ TST(05, tick) (Evas *e EINA_UNUSED, double f, Evas_Coord win_w, Evas_Coord win_h w = 5 + ((1.0 + cos((double)((f * 30.0) + (i * 10 * w0 * 2); h = 5 + ((1.0 + sin((double)((f * 40.0) + (i * 19 * h0 * 2
[EGIT] [core/efl] master 03/03: evas: prevent calling api with NULL filter image
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=723382bf5c4fb0dd08ebcf4dcda15d69cd24bdc8 commit 723382bf5c4fb0dd08ebcf4dcda15d69cd24bdc8 Author: Yeongjong Lee Date: Wed Feb 5 06:11:28 2020 + evas: prevent calling api with NULL filter image This fixes a bunch of warnings like that ``` ../src/lib/eo/eo.c:644 _efl_object_call_resolve() NULL passed to function xxx(). ``` Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D11283 --- src/lib/evas/canvas/evas_object_smart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/evas/canvas/evas_object_smart.c b/src/lib/evas/canvas/evas_object_smart.c index 0af4fb5ad6..2a27d7b1e8 100644 --- a/src/lib/evas/canvas/evas_object_smart.c +++ b/src/lib/evas/canvas/evas_object_smart.c @@ -931,7 +931,7 @@ _efl_canvas_group_efl_gfx_entity_position_set(Eo *eo_obj, Evas_Smart_Data *o, Ei if (o->clipped && !is_overridden) _evas_object_smart_clipped_smart_move_internal(eo_obj, pos.x, pos.y); efl_gfx_entity_position_set(efl_super(eo_obj, MY_CLASS), pos); - efl_gfx_entity_position_set(o->filter_img, pos); + if (o->filter_img) efl_gfx_entity_position_set(o->filter_img, pos); } EOLIAN static void @@ -941,7 +941,7 @@ _efl_canvas_group_efl_gfx_entity_size_set(Eo *obj, Evas_Smart_Data *o, Eina_Size return; efl_gfx_entity_size_set(efl_super(obj, MY_CLASS), size); - efl_gfx_entity_size_set(o->filter_img, size); + if (o->filter_img) efl_gfx_entity_size_set(o->filter_img, size); } EOLIAN static void --
[EGIT] [core/efl] master 01/01: csharp: implement GetChildrenIndex for GenericModel
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=dd4bad3037f052b5b3cc56c7715d7b89bfe3636d commit dd4bad3037f052b5b3cc56c7715d7b89bfe3636d Author: Yeongjong Lee Date: Tue Feb 4 17:17:27 2020 +0900 csharp: implement GetChildrenIndex for GenericModel Summary: This patch will fix EFL# build error. Reviewers: felipealmeida, woohyun, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11269 --- src/bindings/mono/efl_mono/GenericModel.cs | 22 ++ 1 file changed, 22 insertions(+) diff --git a/src/bindings/mono/efl_mono/GenericModel.cs b/src/bindings/mono/efl_mono/GenericModel.cs index 8d7cc813a2..ae1b69cf3e 100644 --- a/src/bindings/mono/efl_mono/GenericModel.cs +++ b/src/bindings/mono/efl_mono/GenericModel.cs @@ -167,6 +167,28 @@ public class GenericModel : Efl.Object, Efl.IModel return model.GetChildrenSliceAsync(start, count, token); } + /// Get children as specified by iterator. + /// + /// Provided index have to be between 0 and . + /// + /// This function might rely on as a fallback. + /// Indices of the requested children. + /// Array of children + public Eina.Future GetChildrenIndex(IEnumerable indices) + { + return model.GetChildrenIndex(indices); + } + + /// Async wrapper for . + /// + /// Indices of the requested children. + /// Token to notify the async operation of external request to cancel. + /// An async task wrapping the result of the operation. + public System.Threading.Tasks.Task GetChildrenIndexAsync(IEnumerable indices, System.Threading.CancellationToken token = default(System.Threading.CancellationToken)) + { + return model.GetChildrenIndexAsync(indices, token); + } + /// Event triggered when properties on the wrapped model changes. public event EventHandler PropertiesChangedEvent { --
[EGIT] [core/efl] master 01/01: eolian_mono: blacklist c-only internal APIs
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b8f5d12d4e224976d6a01937fcacc73ed5353216 commit b8f5d12d4e224976d6a01937fcacc73ed5353216 Author: Yeongjong Lee Date: Wed Jan 29 13:46:37 2020 +0900 eolian_mono: blacklist c-only internal APIs Summary: This patch prevent generating c-only internal APIs. C# doesn't need c-only APIs. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: felipealmeida, Jaehyun_Cho, woohyun Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11151 --- src/bin/eolian_mono/eolian/mono/blacklist.hh | 2 + src/bindings/mono/eo_mono/workaround.cs | 64 2 files changed, 2 insertions(+), 64 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index 3dd41208a4..683095f1dd 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -69,6 +69,8 @@ inline bool is_function_blacklisted(std::string const& c_name) || c_name == "efl_access_object_event_handler_add" || c_name == "efl_access_object_event_handler_del" || c_name == "efl_access_object_event_emit" +|| c_name == "efl_access_widget_action_elm_actions_get" +|| c_name == "efl_access_action_actions_get" ; } diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs index 3e6829feef..81aa32499e 100644 --- a/src/bindings/mono/eo_mono/workaround.cs +++ b/src/bindings/mono/eo_mono/workaround.cs @@ -224,68 +224,4 @@ internal struct Event internal delegate void EventCb(System.IntPtr data, ref Event evt); internal delegate void FreeWrapperSupervisorCb(System.IntPtr obj); -namespace Access -{ - -public struct ActionData : IEquatable -{ -public IntPtr name; -public IntPtr action; -public IntPtr param; -public IntPtr func; - - -/// -/// Gets a hash for . -/// Since EFL 1.24. -/// -/// A hash code. -public override int GetHashCode() -=> name.GetHashCode() ^ action.GetHashCode() -^ param.GetHashCode() ^ func.GetHashCode(); - -/// Returns whether this -/// is equal to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public override bool Equals(object other) -=> (!(other is ActionData)) ? false -: Equals((ActionData)other); - - -/// Returns whether this is equal -/// to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public bool Equals(ActionData other) -=> (name == other.name) && (action == other.action) -&& (param == other.param) && (func == other.func); - -/// Returns whether lhs is equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is equal -/// to rhs. -public static bool operator==(ActionData lhs, ActionData rhs) -=> lhs.Equals(rhs); - -/// Returns whether lhs is not equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is not equal -/// to rhs. -public static bool operator!=(ActionData lhs, ActionData rhs) -=> !(lhs == rhs); -} - -} // namespace Access - } // namespace Efl --
[EGIT] [core/efl] master 01/01: eolian_mono: change property name from args to Args
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5ddd384aee818504633825caf0af3afc57dc1e79 commit 5ddd384aee818504633825caf0af3afc57dc1e79 Author: Yeongjong Lee Date: Wed Jan 29 13:45:56 2020 +0900 eolian_mono: change property name from args to Args Summary: PascalCasing is always used for property names. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, segfaultxavi Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11149 --- src/bin/eolian_mono/eolian/mono/events.hh | 30 +++--- .../mono/efl_mono/efl_csharp_application.cs| 6 ++--- src/tests/efl_mono/Events.cs | 24 - src/tests/efl_mono/Model.cs| 2 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index b6cb4aa511..2040a2ef04 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -170,7 +170,7 @@ struct pack_event_info_and_call_visitor { return as_generator( indent.inc() << "Contract.Requires(e != null, nameof(e));\n" -<< indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n" +<< indent.inc() << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.Arg));\n" << indent.inc() << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n" ).generate(sink, attributes::unused, *context); } @@ -190,8 +190,8 @@ struct pack_event_info_and_call_visitor match const str_table[] = { - {"string", [] { return "e.arg"; }} - , {"stringshare", [] { return "e.arg"; }} + {"string", [] { return "e.Arg"; }} + , {"stringshare", [] { return "e.Arg"; }} }; auto str_accept_func = [&](std::string const& conversion) @@ -208,9 +208,9 @@ struct pack_event_info_and_call_visitor match const value_table [] = { - {"bool", [] { return "e.arg ? (byte) 1 : (byte) 0"; }} - , {"Eina.Error", [] { return "(int)e.arg"; }} - , {nullptr, [] { return "e.arg"; }} + {"bool", [] { return "e.Arg ? (byte) 1 : (byte) 0"; }} + , {"Eina.Error", [] { return "(int)e.Arg"; }} + , {nullptr, [] { return "e.Arg"; }} }; auto value_accept_func = [&](std::string const& conversion) @@ -225,14 +225,14 @@ struct pack_event_info_and_call_visitor if (eina::optional b = type_match::get_match(value_table, filter_func, value_accept_func)) return *b; - return value_accept_func("e.args"); + return value_accept_func("e.Args"); } bool operator()(grammar::attributes::klass_name const&) const { auto const& indent = current_indentation(*context); return as_generator( indent.inc() << "Contract.Requires(e != null, nameof(e));\n" - << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n" + << indent.inc() << "IntPtr info = e.Arg.NativeHandle;\n" << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n" ).generate(sink, attributes::unused, *context); } @@ -243,15 +243,15 @@ struct pack_event_info_and_call_visitor std::string info_variable; if (type.outer.base_type == "iterator") -info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n"; +info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.Arg, ") + (is_own ? "true" : "false") + ");\n"; else if (type.outer.base_type == "accessor") -info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n"; +info_variable = std::string("IntPtr info =
[EGIT] [core/efl] master 01/01: eolian_mono: generate Efl.IPlayer.PlaybackPosition again
yohoho pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=46c65ff0db04b6d92c13978815264e43def13205 commit 46c65ff0db04b6d92c13978815264e43def13205 Author: Yeongjong Lee Date: Wed Jan 29 13:13:10 2020 +0900 eolian_mono: generate Efl.IPlayer.PlaybackPosition again Summary: There is no reason that `efl_player_playback_position_get` is in blacklist.. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11152 --- src/bin/eolian_mono/eolian/mono/blacklist.hh | 1 - 1 file changed, 1 deletion(-) diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index 8d8de9d1bf..3dd41208a4 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -32,7 +32,6 @@ inline bool is_function_blacklisted(std::string const& c_name) return c_name == "efl_event_callback_array_priority_add" || c_name == "efl_constructor" -|| c_name == "efl_player_playback_position_get" || c_name == "efl_ui_widget_focus_set" || c_name == "efl_ui_widget_focus_get" || c_name == "efl_ui_text_password_get" --
[EGIT] [core/efl] master 01/01: eolian_mono: make struct immutable
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=581bec9598943cc9274dfe7db1a73a4c878c3cdd commit 581bec9598943cc9274dfe7db1a73a4c878c3cdd Author: Yeongjong Lee Date: Tue Jan 28 14:46:10 2020 +0900 eolian_mono: make struct immutable Summary: Immutable value type is recommeneded for struct type in cs world. `DO NOT define mutable value types.` (see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/struct) Also, this patch include refactoring of generated struct types. 1. Change field type to property type that have only getter. it will fix CA1051(ref T8397). 2. Remove internal NativeStruct. there is private field for marshalling struct instead. 3. Fix some test cases that change value inside struct. because struct is immutable. Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8397 Differential Revision: https://phab.enlightenment.org/D11146 --- .../eolian_mono/eolian/mono/marshall_type_impl.hh | 4 +- src/bin/eolian_mono/eolian/mono/name_helpers.hh| 20 +- .../eolian_mono/eolian/mono/struct_definition.hh | 212 +++-- src/bin/eolian_mono/eolian/mono/struct_fields.hh | 120 +++- src/bin/eolian_mono/eolian/mono/utils.hh | 22 +++ src/bindings/mono/eo_mono/EoWrapper.cs | 8 +- src/bindings/mono/eo_mono/workaround.cs| 61 ++ src/tests/efl_mono/Events.cs | 3 +- src/tests/efl_mono/StructHelpers.cs| 127 ++-- src/tests/efl_mono/Structs.cs | 15 +- 10 files changed, 316 insertions(+), 276 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh index 4d1e188997..60b495ea39 100644 --- a/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh +++ b/src/bin/eolian_mono/eolian/mono/marshall_type_impl.hh @@ -129,7 +129,7 @@ struct marshall_type_visitor_generate , {"event", nullptr, [&] { regular_type_def r = regular; -r.base_type = "Efl.Event.NativeStruct"; +r.base_type = "Efl.Event"; r.namespaces.clear(); return r; }} @@ -190,7 +190,7 @@ struct marshall_type_visitor_generate { if ((is_out || is_return) && is_ptr) return as_generator("System.IntPtr").generate(sink, attributes::unused, *context); - return as_generator(string << ".NativeStruct") + return as_generator(string) .generate(sink, name_helpers::type_full_managed_name(regular), *context); } else if (eina::optional b = type_match::get_match diff --git a/src/bin/eolian_mono/eolian/mono/name_helpers.hh b/src/bin/eolian_mono/eolian/mono/name_helpers.hh index ae958ba623..a6e94ea2f6 100644 --- a/src/bin/eolian_mono/eolian/mono/name_helpers.hh +++ b/src/bin/eolian_mono/eolian/mono/name_helpers.hh @@ -331,7 +331,8 @@ inline std::string enum_field_managed_name(std::string name) inline std::string to_field_name(std::string const& in) { - return utils::capitalize(in); + std::vector names = utils::split(in, '_'); + return utils::to_camel_case(names); } @@ -583,6 +584,16 @@ struct struct_field_name_generator } } const struct_field_name {}; +// Property names // +struct struct_property_name_generator +{ + template + bool generate(OutputIterator sink, attributes::struct_field_def const& field, Context const& context) const + { +return as_generator(string).generate(sink, name_helpers::managed_name(field.name), context); + } +} const struct_property_name {}; + } // namespace name_helpers } // namespace eolian_mono @@ -615,12 +626,19 @@ struct is_eager_generator struct is_generator< ::eolian_mono::name_helpers::struct_field_name_generator> : std::true_type {}; +template <> +struct is_eager_generator : std::true_type {}; +template <> +struct is_generator< ::eolian_mono::name_helpers::struct_property_name_generator> : std::true_type {}; + namespace type_traits { template <> struct attributes_needed : std::integral_constant {}; template <> struct attributes_needed< ::eolian_mono::name_helpers::struct_field_name_generator> : std::integral_constant {}; +template <> +struct attributes_needed< ::eolian_mono::name_helpers::struct_property_name_generator> : std::integral_constant {}; } diff --git a/src/bin/eolian_mono/eolian/mono/struct_definition.hh b/src/bin/eolian_mono/eolian/mono/struct_definition.hh index 48d69dc834..6f19088d52
[EGIT] [core/efl] master 01/01: csharp: cleanup concrete class
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=97098dcc50b62e51dad3469619ed55242ca01a80 commit 97098dcc50b62e51dad3469619ed55242ca01a80 Author: Yeongjong Lee Date: Thu Jan 23 07:30:13 2020 +0900 csharp: cleanup concrete class Summary: Concrete class is only used to call static member of NativeMethod. they don't need any inheritance and implementation of c functions. Depends on D9893 Test Plan: ninja test Reviewers: lauromoura, felipealmeida Subscribers: Jaehyun_Cho, woohyun, segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9894 --- src/bin/eolian_mono/eolian/mono/events.hh | 2 +- src/bin/eolian_mono/eolian/mono/klass.hh | 108 +++-- src/bin/eolian_mono/eolian/mono/name_helpers.hh| 17 +++- .../eolian_mono/eolian/mono/struct_definition.hh | 3 +- .../mono/eina_mono/eina_container_common.cs| 24 - src/bindings/mono/eo_mono/iwrapper.cs | 12 +-- src/tests/efl_mono/Eo.cs | 32 ++ src/tests/efl_mono/dummy_test_object.c | 22 + src/tests/efl_mono/dummy_test_object.eo| 17 9 files changed, 106 insertions(+), 131 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index 7405f8c2e1..b6cb4aa511 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -131,7 +131,7 @@ struct unpack_event_args_visitor } bool operator()(grammar::attributes::klass_name const& cls) const { - return as_generator("(Efl.Eo.Globals.CreateWrapperFor(info) as " + name_helpers::klass_full_concrete_name(cls) + ")").generate(sink, attributes::unused, *context); + return as_generator("(Efl.Eo.Globals.CreateWrapperFor(info) as " + name_helpers::klass_full_interface_name(cls) + ")").generate(sink, attributes::unused, *context); } bool operator()(attributes::complex_type_def const& types) const { diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 072ea6c143..da6fd6d45c 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -193,98 +193,9 @@ struct klass auto concrete_cxt = context_add_tag(class_context{class_context::concrete, name_helpers::klass_full_concrete_or_interface_name(cls)}, context); - auto concrete_name = name_helpers::klass_concrete_name(cls); - auto interface_name = name_helpers::klass_interface_name(cls); - // We can't make these internal yet as they have methods that are used by - // other classes that implement the interface. - if(!as_generator -( - documentation(1) - << scope_tab << "public sealed " << (is_partial ? "partial ":"") << "class " << concrete_name << " :\n" - << scope_tab(2) << (root ? "Efl.Eo.EoWrapper" : "") << (klass_full_concrete_or_interface_name % "") - << ",\n" << scope_tab(2) << interface_name - << *(",\n" << scope_tab(2) << name_helpers::klass_full_concrete_or_interface_name) << "\n" - << scope_tab << "{\n" -).generate(sink, std::make_tuple(cls, inherit_classes, inherit_interfaces), concrete_cxt)) - return false; - - if (!generate_fields(sink, cls, concrete_cxt)) - return false; - - if (!as_generator -( - scope_tab(2) << "/// Subclasses should override this constructor if they are expected to be instantiated from native code.\n" - << scope_tab(2) << "/// Do not call this constructor directly.\n" - << scope_tab(2) << "/// Tag struct storing the native handle of the object being constructed.\n" - << scope_tab(2) << "private " << concrete_name << "(ConstructingHandle ch) : base(ch)\n" - << scope_tab(2) << "{\n" - << scope_tab(2) << "}\n\n" -) -.generate(sink, attributes::unused, concrete_cxt)) - return false; - - if (!as_generator -( - scope_tab(2) << "[System.Runtime.InteropServices.DllImport(" << context_find_tag(concrete_cxt).actual_library_name(cls.filename)
[EGIT] [core/efl] master 01/01: eolian_mono: avoid generating set-only property
yohoho pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cade1b3c3ccacf9f47f5aeb366f5686eff232f6c commit cade1b3c3ccacf9f47f5aeb366f5686eff232f6c Author: Yeongjong Lee Date: Wed Jan 22 09:40:18 2020 +0900 eolian_mono: avoid generating set-only property Summary: According to Property Design Guidelines of MS, set-only properties are not recommeneded. (see more, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property) Furthermore, there is stylecop warnings(CA1044) ref T8396 List of removed set-only properies. ``` Efl.Access.Editable.IText.TextContent { set; } Efl.App.CommandArray { set; } Efl.App.CommandString { set; } Efl.Canvas.Filter.IInternal.FilterChanged { set; } Efl.Canvas.Filter.IInternal.FilterInvalid { set; } Efl.Canvas.ImageInternal.FilterChanged { set; } Efl.Canvas.ImageInternal.FilterInvalid { set; } Efl.Canvas.Textblock.FilterChanged { set; } Efl.Canvas.Textblock.FilterInvalid { set; } Efl.Canvas.Vg.Image.Data { set; } Efl.Canvas.Vg.Node.CompMethod { set; } Efl.Core.ICommandLine.CommandArray { set; } Efl.Core.ICommandLine.CommandString { set; } Efl.Exe.CommandArray { set; } Efl.Exe.CommandString { set; } Efl.Ui.AlertPopup.Button { set; } Efl.Ui.Collection.MatchContent { set; } Efl.Ui.CollectionView.MatchContent { set; } Efl.Ui.IScrollable.MatchContent { set; } Efl.Ui.ImageZoomable.MatchContent { set; } Efl.Ui.Panel.MatchContent { set; } Efl.Ui.PositionManager.Grid.DataAccess { set; } Efl.Ui.PositionManager.Grid.ScrollPosition { set; } Efl.Ui.PositionManager.Grid.Viewport { set; } Efl.Ui.PositionManager.IDataAccessV1.DataAccess { set; } Efl.Ui.PositionManager.IEntity.ScrollPosition { set; } Efl.Ui.PositionManager.IEntity.Viewport { set; } Efl.Ui.PositionManager.List.DataAccess { set; } Efl.Ui.PositionManager.List.ScrollPosition { set; } Efl.Ui.PositionManager.List.Viewport { set; } Efl.Ui.Scroll.Manager.MatchContent { set; } Efl.Ui.Scroll.Manager.Pan { set; } Efl.Ui.Scroller.MatchContent { set; } Efl.Ui.Spotlight.Manager.Size { set; } Efl.Ui.Textbox.TextContent { set; } Efl.Ui.Widget.ResizeObject { set; } Efl.Ui.Win.PropFocusSkip { set; } ``` Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: woohyun, felipealmeida, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8396 Differential Revision: https://phab.enlightenment.org/D11138 --- src/bin/eolian_mono/eolian/mono/function_definition.hh | 4 src/tests/efl_mono/Eo.cs | 2 +- src/tests/efl_mono/Events.cs | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/function_definition.hh b/src/bin/eolian_mono/eolian/mono/function_definition.hh index eff586b157..fcc8a88f15 100644 --- a/src/bin/eolian_mono/eolian/mono/function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/function_definition.hh @@ -428,6 +428,10 @@ struct property_wrapper_definition_generator if (is_interface && (!is_get_public && !is_set_public)) return true; + // Do not generate set-only proeprty + if (property.setter.is_engaged() && !property.getter.is_engaged()) + return true; + // C# interface members are declared automatically as public if (is_interface) { diff --git a/src/tests/efl_mono/Eo.cs b/src/tests/efl_mono/Eo.cs index 7c580480ad..70e9d29c16 100644 --- a/src/tests/efl_mono/Eo.cs +++ b/src/tests/efl_mono/Eo.cs @@ -407,7 +407,7 @@ class TestCsharpProperties var obj = new Dummy.TestObject(); int val = -1984; -obj.SetterOnly = val; +obj.SetSetterOnly(val); Test.AssertEquals(val, obj.GetSetterOnly()); obj.Dispose(); } diff --git a/src/tests/efl_mono/Events.cs b/src/tests/efl_mono/Events.cs index 5f8cc0fa52..c10c37911e 100644 --- a/src/tests/efl_mono/Events.cs +++ b/src/tests/efl_mono/Events.cs @@ -320,7 +320,7 @@ class TestEventWithDeadWrappers EventHandler cb) { var obj = new Dummy.TestObject(); -manager.Emitter = obj; +manager.SetEmitter(obj); obj.EvtWithIntEvent += cb; return new WeakReference(obj); --
[EGIT] [core/efl] master 01/01: Revert "csharp: Property Indexer implementation"
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=292f4bc0da8bf2432c344f03797f70b89267db26 commit 292f4bc0da8bf2432c344f03797f70b89267db26 Author: Yeongjong Lee Date: Tue Jan 21 07:00:44 2020 +0900 Revert "csharp: Property Indexer implementation" Summary: This reverts commit 0954e501fd4008c40b3848de1f2c91bcd53b2f71. According to Framework Design Guidelines of MS, most of indexed properties are not recommended in EFL#. (see, https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/property) It is better to leave properties which have a key as methods. Reviewers: woohyun, felipealmeida Reviewed By: woohyun Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D4 --- src/bin/eolian_mono/eolian/mono/blacklist.hh | 29 +- src/bin/eolian_mono/eolian/mono/documentation.hh | 52 +- .../eolian_mono/eolian/mono/function_definition.hh | 574 ++--- .../eolian_mono/eolian/mono/generation_contexts.hh | 7 - src/bin/eolian_mono/eolian/mono/helpers.hh | 101 src/bin/eolian_mono/eolian/mono/klass.hh | 14 +- src/bin/eolian_mono/eolian/mono/name_helpers.hh| 61 +-- src/bin/eolian_mono/eolian/mono/parameter.hh | 12 +- src/bin/eolian_mono/eolian_mono.cc | 3 +- src/bindings/mono/efl_mono/GenericModel.cs | 14 +- src/lib/eolian_cxx/grammar/klass_def.hpp | 2 +- src/tests/efl_mono/Eo.cs | 62 +-- src/tests/efl_mono/dummy_event_manager.c | 6 - src/tests/efl_mono/dummy_event_manager.eo | 2 + src/tests/efl_mono/dummy_test_object.c | 31 -- src/tests/efl_mono/dummy_test_object.eo| 25 - 16 files changed, 225 insertions(+), 770 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index 70bc34a038..8d8de9d1bf 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -150,34 +150,9 @@ inline bool is_alias_blacklisted(attributes::alias_def const& alias, Context con return name_helpers::alias_full_eolian_name(alias) == "Eina.Error"; } -inline bool is_property_blacklisted(std::string const& name) +inline bool is_property_blacklisted(std::string const&) { -auto properties = std::vector{ - // These properties encode (void* arr, int len) arrays - "Efl.Gfx.IGradient.Stop" - , "Efl.Gfx.GradientConcrete.Stop" - , "Efl.Gfx.IShape.StrokeDash" - , "Efl.Gfx.ShapeConcrete.StrokeDash" - , "Efl.Gfx.Vg.ValueProvider.Transform" - , "Efl.Canvas.Vg.Node.Transformation" - // Will be bound manually - , "Efl.Core.Env.Env" - // Setter returns a future - , "Efl.IModel.Property" - // Protected - , "Efl.Access.IAction.ActionName" - , "Efl.Access.IAction.ActionLocalizedName" - , "Efl.Access.IComponent.Extents" - , "Efl.Access.IText.AccessSelection" - , "Efl.Access.IText.AccessText" - , "Efl.Access.IText.BoundedRanges" - , "Efl.Access.IText.Character" - , "Efl.Access.IText.OffsetAtPoint" - , "Efl.Access.IText.String" - , "Efl.Access.IText.TextAttributes" -}; - -return std::find(std::begin(properties), std::end(properties), name) != std::end(properties); +return false; } template diff --git a/src/bin/eolian_mono/eolian/mono/documentation.hh b/src/bin/eolian_mono/eolian/mono/documentation.hh index db00ba8a0f..d009e4571d 100644 --- a/src/bin/eolian_mono/eolian/mono/documentation.hh +++ b/src/bin/eolian_mono/eolian/mono/documentation.hh @@ -21,7 +21,6 @@ #include "grammar/html_escaped_string.hpp" #include "using_decl.hh" #include "name_helpers.hh" -#include "helpers.hh" #include "generation_contexts.hh" #include "blacklist.hh" @@ -77,11 +76,7 @@ struct documentation_generator // The name_tail parameter is the last 4 chars of the original string, which // could be ".set" or ".get" and in this case they are ignored by Eolian. // We want them to know what the documentation intended to reference. - template - static std::string function_conversion(const ::Eolian_Object *klass - , const ::Eolian_Function *function - , std::string name_tail - , Context const& context) + static std::string function_conversion(const ::Eolian_Object *klass, const ::Eolian_
[EGIT] [core/efl] master 01/01: efl_text_cursor: correct class description name of simple class
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=478863862a4e669e652d2e6ed9b7204b39503a08 commit 478863862a4e669e652d2e6ed9b7204b39503a08 Author: Yeongjong Lee Date: Fri Jan 17 15:06:18 2020 +0900 efl_text_cursor: correct class description name of simple class Summary: Name of `Efl_Class_Description` should be eo-style class name. Please check there is no segmentation fault on Test code below. Thanks to @woohyun for reporting and test case. Test Plan: ``` //mcs test.cs -out:test.exe `pkg-config --libs efl-mono` using System; class Program { public static void Main() { Efl.All.Init(Efl.Csharp.Components.Ui); Efl.Ui.Win win = new Efl.Ui.Win(null); Efl.Ui.Box box = new Efl.Ui.Box(win); Efl.Ui.Textbox tb = new Efl.Ui.Textbox(win); Efl.Ui.Button btn = new Efl.Ui.Button(box); btn.Text = "Click Me!"; btn.ClickedEvent += (s, e) => { Efl.Text.Cursor cur1, cur2; tb.GetSelectionCursors(out cur1, out cur2); cur1.SetPosition(3); cur2.SetPosition(7); }; box.Pack(btn); box.Pack(tb); win.SetContent(box); win.SetSize(new Eina.Size2D(200, 400)); Efl.Ui.Config.Run(); Efl.All.Shutdown(); } } ``` Reviewers: woohyun, ali.alzyod, bu5hm4n Reviewed By: woohyun Subscribers: cedric, #reviewers, #committers, woohyun Tags: #efl Differential Revision: https://phab.enlightenment.org/D5 --- src/lib/evas/canvas/efl_text_cursor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/efl_text_cursor.c b/src/lib/evas/canvas/efl_text_cursor.c index c0a6c627d9..0a19a3b281 100644 --- a/src/lib/evas/canvas/efl_text_cursor.c +++ b/src/lib/evas/canvas/efl_text_cursor.c @@ -21,7 +21,7 @@ struct _Evas_Textblock_Selection_Iterator typedef struct _Evas_Textblock_Selection_Iterator Evas_Textblock_Selection_Iterator; -EFL_CLASS_SIMPLE_CLASS(efl_text_cursor, "efl_text_cursor", EFL_TEXT_CURSOR_CLASS) +EFL_CLASS_SIMPLE_CLASS(efl_text_cursor, "Efl.Text.Cursor", EFL_TEXT_CURSOR_CLASS) EOLIAN static void _efl_text_cursor_position_set(Eo *obj EINA_UNUSED, Efl_Text_Cursor_Data *pd, int position) --
[EGIT] [core/efl] master 01/01: eina_mono: replace eina_list and eina_array with IList
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ae30d3c57bc28bddd9e3a6c18163719fd8958f06 commit ae30d3c57bc28bddd9e3a6c18163719fd8958f06 Author: Yeongjong Lee Date: Tue Jan 14 17:17:04 2020 +0900 eina_mono: replace eina_list and eina_array with IList Summary: Eina.List => System.Collections.Generic.IList Eina.Array => System.Collections.Generic.IList ref T8486 Depends On D10785 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: felipealmeida, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486, T8488 Differential Revision: https://phab.enlightenment.org/D10902 --- src/bin/eolian_mono/eolian/mono/events.hh | 29 ++- src/bin/eolian_mono/eolian/mono/parameter.hh | 138 +-- .../eolian_mono/eolian/mono/struct_definition.hh | 31 +++- src/bin/eolian_mono/eolian/mono/type_impl.hh | 4 +- .../mono/efl_mono/efl_csharp_application.cs| 3 +- src/bindings/mono/eo_mono/iwrapper.cs | 98 -- src/tests/efl_mono/Eina.cs | 197 + src/tests/efl_mono/Events.cs | 6 +- src/tests/efl_mono/StructHelpers.cs| 15 +- 9 files changed, 280 insertions(+), 241 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index 2acfcbb4b5..7405f8c2e1 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -139,6 +139,10 @@ struct unpack_event_args_visitor return as_generator("Efl.Eo.Globals.IteratorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); else if (types.outer.base_type == "accessor") return as_generator("Efl.Eo.Globals.AccessorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); + else if (types.outer.base_type == "array") +return as_generator("Efl.Eo.Globals.NativeArrayTo" << eolian_mono::type << "(info)").generate(sink, type, *context); + else if (types.outer.base_type == "list") +return as_generator("Efl.Eo.Globals.NativeListTo" << eolian_mono::type << "(info)").generate(sink, type, *context); else return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context); } @@ -229,19 +233,28 @@ struct pack_event_info_and_call_visitor return as_generator( indent.inc() << "Contract.Requires(e != null, nameof(e));\n" << indent.inc() << "IntPtr info = e.arg.NativeHandle;\n" - << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" + << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", info, null);\n" ).generate(sink, attributes::unused, *context); } bool operator()(attributes::complex_type_def const& type) const { auto const& indent = current_indentation(*context); - if ((type.outer.base_type == "iterator") || (type.outer.base_type == "accessor")) -return true; - - return as_generator( - indent.inc() << "Contract.Requires(e != null, nameof(e));\n" - << indent.inc() << "IntPtr info = e.arg.Handle;\n" - << indent.inc() << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" + bool is_own = type.outer.base_qualifier & attributes::qualifier_info::is_own; + std::string info_variable; + + if (type.outer.base_type == "iterator") +info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToIterator(e.arg, ") + (is_own ? "true" : "false") + ");\n"; + else if (type.outer.base_type == "accessor") +info_variable = std::string("IntPtr info = Efl.Eo.Globals.IEnumerableToAccessor(e.arg, ") + (is_own ? "true" : "false") + ");\n"; + else if (type.outer.base_type == "array") +info_variable = std::string(
[EGIT] [core/efl] master 01/01: eolian_mono: add 1 tab inside the namespace
yohoho pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3fc78f69eb095e65c2be0bd172dd49d49b5b837f commit 3fc78f69eb095e65c2be0bd172dd49d49b5b837f Author: Yeongjong Lee Date: Mon Jan 13 09:45:16 2020 +0900 eolian_mono: add 1 tab inside the namespace Summary: Also, this patch will fix indentation of enum, struct. ### Before ``` namespace Efl.Ui { /// Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// Start moving windowSince EFL 1.22. Move = 1, /// Start resizing window to the topSince EFL 1.22. Top = 2, ... } } ``` ### After ``` namespace Efl.Ui { /// Define the move or resize mode of a window. /// /// The user can request the display server to start moving or resizing the window by combining these modes. However only limited combinations are allowed. ... [Efl.Eo.BindingEntity] public enum WinMoveResizeMode { /// Start moving windowSince EFL 1.22. Move = 1, /// Start resizing window to the topSince EFL 1.22. Top = 2, ... } } ``` Reviewers: Jaehyun_Cho, felipealmeida Reviewed By: felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11032 --- .../eolian/mono/async_function_definition.hh | 34 ++-- src/bin/eolian_mono/eolian/mono/enum_definition.hh | 14 +- src/bin/eolian_mono/eolian/mono/events.hh | 104 +-- .../eolian/mono/function_declaration.hh| 4 +- .../eolian_mono/eolian/mono/function_definition.hh | 88 - .../eolian_mono/eolian/mono/function_helpers.hh| 2 +- src/bin/eolian_mono/eolian/mono/klass.hh | 208 ++--- src/bin/eolian_mono/eolian/mono/parameter.hh | 8 +- src/bin/eolian_mono/eolian/mono/part_definition.hh | 24 +-- .../eolian_mono/eolian/mono/struct_definition.hh | 14 +- 10 files changed, 251 insertions(+), 249 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh index bf00ddadba..bc0bb6863a 100644 --- a/src/bin/eolian_mono/eolian/mono/async_function_definition.hh +++ b/src/bin/eolian_mono/eolian/mono/async_function_definition.hh @@ -72,30 +72,30 @@ struct async_function_declaration_generator return true; if (!as_generator( -scope_tab << "/// Async wrapper for .\n" +scope_tab(2) << "/// Async wrapper for .\n" ).generate(sink, attributes::unused, context)) return false; if (!f.documentation.since.empty()) if (!as_generator - (scope_tab << "/// Since EFL " + f.documentation.since + ".\n") + (scope_tab(2) << "/// Since EFL " + f.documentation.since + ".\n") .generate (sink, attributes::unused, context)) return false; if (!as_generator( -scope_tab << "/// \n" +scope_tab(2) << "/// \n" ).generate(sink, attributes::unused, context)) return false; // generate_parameter is not a proper as_generator-compatible generator, so we had to do an old fashioned loop for (auto&& param : f.parameters) - if (!documentation(1).generate_parameter(sink, param, context)) + if (!documentation(2).generate_parameter(sink, param, context)) return false; if (!as_generator( -scope_tab << "/// Token to notify the async operation of external request to cancel.\n" -<< scope_tab << "/// An async task wrapping the result of the operation.\n" -<< scope_tab << "System.Threading.Tasks.Task " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << +scope_tab(2) << "/// Token to notify the async operation of external request to cancel.\n" +<< scope_tab(2) << "/// An async task wrapping the result of the operation.\n" +<< scope_tab(2) << "System.Threading.Tasks.Task " << name_helpers::managed_async_method_name(f) << "(" << *(parameter << ", ") << " System.Threading.CancellationToken token = default(System.Threading.CancellationToken));\n\n" ).generate(sink,
[EGIT] [core/efl] master 02/02: csharp: rename ExtensionMethods
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=278376df908bf1d49e3462df0d88063ff8867023 commit 278376df908bf1d49e3462df0d88063ff8867023 Author: Yeongjong Lee Date: Mon Jan 6 19:08:44 2020 +0900 csharp: rename ExtensionMethods Summary: This patch will rename `ExtensionMethods` to `Extensions` that is commonly used in csharp project. Depends on D10972 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura, Jaehyun_Cho, felipealmeida Reviewed By: Jaehyun_Cho, felipealmeida Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10913 --- src/bin/eolian_mono/eolian/mono/klass.hh | 2 +- src/bindings/mono/eina_mono/eina_slice.cs | 5 - src/tests/efl_mono/Eina.cs| 1 + src/tests/efl_mono/EinaTestData.cs| 1 + src/tests/efl_mono/StructHelpers.cs | 1 + 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 6c6fd906cd..3a93a2b72b 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -404,7 +404,7 @@ struct klass (lit("#if EFL_BETA\n") << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes << "public static class " << name_helpers::klass_concrete_name(cls) - << "ExtensionMethods {\n" + << "Extensions {\n" << extension_method_stream.str() << "}\n" << "#pragma warning restore CS1591\n" diff --git a/src/bindings/mono/eina_mono/eina_slice.cs b/src/bindings/mono/eina_mono/eina_slice.cs index 912ddea3bd..0b9311e48c 100644 --- a/src/bindings/mono/eina_mono/eina_slice.cs +++ b/src/bindings/mono/eina_mono/eina_slice.cs @@ -232,7 +232,9 @@ public struct RwSlice : ISliceBase, IEquatable } -public static class Eina_SliceUtils +namespace Eina +{ +public static class SliceExtensions { public static byte[] GetBytes(this Eina.ISliceBase slc) { @@ -243,3 +245,4 @@ public static class Eina_SliceUtils return mArray; } } +} diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index 91e93986ff..bee62169bb 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -19,6 +19,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; +using Eina; using EinaTestData; using static EinaTestData.BaseData; diff --git a/src/tests/efl_mono/EinaTestData.cs b/src/tests/efl_mono/EinaTestData.cs index 9727548f93..411e38d576 100644 --- a/src/tests/efl_mono/EinaTestData.cs +++ b/src/tests/efl_mono/EinaTestData.cs @@ -18,6 +18,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Runtime.CompilerServices; using System.Diagnostics.Contracts; +using Eina; namespace EinaTestData { diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index 781dbc16f1..9c9f75076e 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -17,6 +17,7 @@ using System; using System.Linq; using System.Runtime.InteropServices; +using Eina; using static EinaTestData.BaseData; namespace TestSuite --
[EGIT] [core/efl] master 01/01: eina_mono: make internal classes internal
felipealmeida pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5679a5d2a2d96d076e7f0a7309b01b04f1aad606 commit 5679a5d2a2d96d076e7f0a7309b01b04f1aad606 Author: Yeongjong Lee Date: Thu Dec 19 02:46:11 2019 + eina_mono: make internal classes internal This hide internal classes.. Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D10912 --- src/bindings/mono/eina_mono/eina_array.cs | 2 +- .../mono/eina_mono/eina_container_common.cs| 36 +++--- src/bindings/mono/eina_mono/eina_hash.cs | 4 +-- src/bindings/mono/eina_mono/eina_inarray.cs| 2 +- src/bindings/mono/eina_mono/eina_inlist.cs | 2 +- src/bindings/mono/eina_mono/eina_iterator.cs | 2 +- src/bindings/mono/eina_mono/eina_list.cs | 2 +- src/bindings/mono/eina_mono/eina_stringshare.cs| 2 +- 8 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/bindings/mono/eina_mono/eina_array.cs b/src/bindings/mono/eina_mono/eina_array.cs index f5f807ad55..37251be6cd 100644 --- a/src/bindings/mono/eina_mono/eina_array.cs +++ b/src/bindings/mono/eina_mono/eina_array.cs @@ -28,7 +28,7 @@ namespace Eina { [EditorBrowsable(EditorBrowsableState.Never)] -public static class ArrayNativeFunctions +internal static class ArrayNativeFunctions { [DllImport(efl.Libs.Eina)] internal static extern IntPtr eina_array_new(uint step); diff --git a/src/bindings/mono/eina_mono/eina_container_common.cs b/src/bindings/mono/eina_mono/eina_container_common.cs index 5366fab20c..192469a033 100644 --- a/src/bindings/mono/eina_mono/eina_container_common.cs +++ b/src/bindings/mono/eina_mono/eina_container_common.cs @@ -33,7 +33,7 @@ namespace Eina { [EditorBrowsable(EditorBrowsableState.Never)] -public enum ElementType +internal enum ElementType { NumericType, StringType, @@ -43,7 +43,7 @@ public enum ElementType [EditorBrowsable(EditorBrowsableState.Never)] [StructLayout(LayoutKind.Sequential)] -public struct InlistMem : IEquatable +internal struct InlistMem : IEquatable { public IntPtr next {get;set;} public IntPtr prev {get;set;} @@ -98,7 +98,7 @@ public struct InlistMem : IEquatable [EditorBrowsable(EditorBrowsableState.Never)] [StructLayout(LayoutKind.Sequential)] -public struct InlistNode : IEquatable> +internal struct InlistNode : IEquatable> { public InlistMem __in_list {get;set;} public T Val {get;set;} @@ -151,7 +151,7 @@ public struct InlistNode : IEquatable> } [EditorBrowsable(EditorBrowsableState.Never)] -public interface IBaseElementTraits +internal interface IBaseElementTraits { IntPtr ManagedToNativeAlloc(T man); IntPtr ManagedToNativeAllocInlistNode(T man); @@ -172,7 +172,7 @@ public interface IBaseElementTraits } [EditorBrowsable(EditorBrowsableState.Never)] -public class StringElementTraits : IBaseElementTraits +internal class StringElementTraits : IBaseElementTraits { public StringElementTraits() { @@ -311,7 +311,7 @@ public class StringElementTraits : IBaseElementTraits } [EditorBrowsable(EditorBrowsableState.Never)] -public class StringshareElementTraits : IBaseElementTraits +internal class StringshareElementTraits : IBaseElementTraits { public StringshareElementTraits() { @@ -451,7 +451,7 @@ public class StringshareElementTraits : IBaseElementTraits } [EditorBrowsable(EditorBrowsableState.Never)] -public class EflObjectElementTraits : IBaseElementTraits +internal class EflObjectElementTraits : IBaseElementTraits { public IntPtr ManagedToNativeAlloc(T man) { @@ -609,7 +609,7 @@ public class EflObjectElementTraits : IBaseElementTraits } [EditorBrowsable(EditorBrowsableState.Never)] -public abstract class PrimitiveElementTraits +internal abstract class PrimitiveElementTraits { private Eina.Callbacks.EinaCompareCb dlgt = null; @@ -711,7 +711,7 @@ public abstract class PrimitiveElementTraits } [EditorBrowsable(EditorBrowsableState.Never)] -abstract public class Primitive32ElementTraits : PrimitiveElementTraits, IBaseElementTraits +internal abstract class Primitive32ElementTraits : PrimitiveElementTraits, IBaseElementTraits { private static IBaseElementTraits int32Traits = null; @@ -750,7 +750,7 @@ abstract public class Primitive32ElementTraits : PrimitiveElementTraits, I } [EditorBrowsable(EditorBrowsableState.Never)] -abstract public class Primitive64ElementTraits : PrimitiveElementTraits, IBaseElementTraits +internal abstract class Primitive64ElementTraits : PrimitiveElementTraits, IBaseElementTraits { private static IBaseElementTraits int64Traits = null; @@ -789,7 +789,7 @@ abstract public class Primitive64ElementTraits : PrimitiveElementTraits, I } [EditorBrowsable(EditorBrowsableState.Never)] -public class IntElementTraits : Primitive32ElementTraits, IBaseElementTraits +inter
[EGIT] [core/efl] master 01/01: eo_mono: make BindingEntityAttribute internal
felipealmeida pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a56b96d33c6aa26894fc373e520c9d5fcbbe03ce commit a56b96d33c6aa26894fc373e520c9d5fcbbe03ce Author: Yeongjong Lee Date: Fri Dec 20 10:24:29 2019 + eo_mono: make BindingEntityAttribute internal `BindingEntityAttribute` is used internally to check whether the object is generated binding classes or not. API user should use protected `IsGeneratedBindingClass` instead. Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D10937 --- src/bindings/mono/eo_mono/iwrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index ea7104b384..2a8ebf0620 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -981,7 +981,7 @@ class PrivateNativeClass : NativeClass AllowMultiple = false, Inherited = false) ] -public class BindingEntityAttribute: System.Attribute +internal class BindingEntityAttribute: System.Attribute { public static bool IsBindingEntity(System.Type t) { --
[EGIT] [core/efl] master 01/01: eo_mono: make Eo.Globals internal
felipealmeida pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b4846c95a2181b52bf1deb4abd7e7bf3bb1fa7df commit b4846c95a2181b52bf1deb4abd7e7bf3bb1fa7df Author: Yeongjong Lee Date: Fri Dec 20 11:00:45 2019 + eo_mono: make Eo.Globals internal All members of `Eo.Globals` are already `internal`. It is unnecessary for `Eo.Globals` to be `public`. Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D10938 --- src/bindings/mono/eo_mono/iwrapper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 29a346dcc4..ea7104b384 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -34,7 +34,7 @@ namespace Efl namespace Eo { -public static class Globals +internal static class Globals { /// Represents the type of the native Efl_Class. internal enum EflClassType --
[EGIT] [core/efl] master 01/01: eolian_mono: check extension part/property existence before generate ExtensionMethods
felipealmeida pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=934a93e39fea7ec157421af91f5cfc5ec94047b0 commit 934a93e39fea7ec157421af91f5cfc5ec94047b0 Author: Yeongjong Lee Date: Mon Dec 23 08:18:02 2019 + eolian_mono: check extension part/property existence before generate ExtensionMethods Empty ExtensionMethods class won't be generated. Reviewed-by: Felipe Magno de Almeida Differential Revision: https://phab.enlightenment.org/D10954 --- src/bin/eolian_mono/eolian/mono/klass.hh | 16 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index e26121c05d..478c6a9c80 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -385,7 +385,16 @@ struct klass std::copy(c.properties.begin(), c.properties.end(), std::back_inserter(implementable_properties)); } - if (implementable_properties.size() == 0 && cls.parts.size() == 0) + std::stringstream extension_method_stream; + std::ostream_iterator extension_method_iterator(extension_method_stream); + + if (!as_generator + (*property_extension_method_definition(cls) + << *part_extension_method_definition(cls)) + .generate(extension_method_iterator, std::make_tuple(implementable_properties, cls.parts), context)) + return false; + + if (extension_method_stream.tellp() <= 0) return true; if(!as_generator @@ -393,12 +402,11 @@ struct klass << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes <<"public static class " << (string % "_") << name_helpers::klass_inherit_name(cls) << "_ExtensionMethods {\n" - << *(property_extension_method_definition(cls)) - << *(part_extension_method_definition(cls)) + << extension_method_stream.str() << "}\n" << "#pragma warning restore CS1591\n" << "#endif\n") -.generate(sink, std::make_tuple(cls.namespaces, implementable_properties, cls.parts), context)) +.generate(sink, cls.namespaces, context)) return false; return true; --
[EGIT] [core/efl] master 01/01: efl_interface: add @since tag for Efl_Model_Children_Event
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e09919ba3fd3038adf7f2d4506b477b773dd9913 commit e09919ba3fd3038adf7f2d4506b477b773dd9913 Author: Yeongjong Lee Date: Fri Dec 20 17:37:55 2019 +0900 efl_interface: add @since tag for Efl_Model_Children_Event Summary: @since tag is necessary for stabilized class. Reviewers: SanghyeonLee, segfaultxavi Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10930 --- src/lib/efl/interfaces/efl_model.eo | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_model.eo b/src/lib/efl/interfaces/efl_model.eo index cc5d6d88c8..ee04879f68 100644 --- a/src/lib/efl/interfaces/efl_model.eo +++ b/src/lib/efl/interfaces/efl_model.eo @@ -9,7 +9,10 @@ struct Efl.Model_Property_Event { struct Efl.Model_Children_Event { [[Every time a child is added the event @[Efl.Model.child,added] is dispatched - passing along this structure.]] + passing along this structure. + + @since 1.24 + ]] index: uint; [[index is a hint and is intended to provide a way for applications to control/know children relative positions through listings.]] child: Efl.Object; [[If an object has been built for this index and it is currently tracked by --
[EGIT] [core/efl] master 02/02: csharp: remove unused code in workaround
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fb301eea87bcade60bf7b2304c805f00147276e6 commit fb301eea87bcade60bf7b2304c805f00147276e6 Author: Yeongjong Lee Date: Thu Dec 19 16:30:53 2019 +0900 csharp: remove unused code in workaround Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10914 --- src/bindings/mono/eo_mono/workaround.cs | 120 1 file changed, 120 deletions(-) diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs index 7b0ceab056..0afe95807b 100644 --- a/src/bindings/mono/eo_mono/workaround.cs +++ b/src/bindings/mono/eo_mono/workaround.cs @@ -255,126 +255,6 @@ internal struct Event internal delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt); internal delegate void FreeWrapperSupervisorCb(System.IntPtr obj); -[StructLayout(LayoutKind.Sequential)] -public struct TextCursorCursor : IEquatable -{ -IntPtr obj; -UIntPtr pos; // UIntPtr to automatically change size_t between 32/64 -IntPtr node; -[MarshalAsAttribute(UnmanagedType.U1)]bool changed; - -/// -/// Gets a hash for . -/// Since EFL 1.24. -/// -/// A hash code. -public override int GetHashCode() -=> obj.GetHashCode() ^ pos.GetHashCode() -^ node.GetHashCode() ^ changed.GetHashCode(); - -/// Returns whether this -/// is equal to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public override bool Equals(object other) -=> (!(other is TextCursorCursor)) ? false -: Equals((TextAnnotateAnnotation)other); - - -/// Returns whether this is equal -/// to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public bool Equals(TextCursorCursor other) -=> (obj == other.obj) && (pos == other.pos) -&& (node == other.node) && (changed == other.changed); - -/// Returns whether lhs is equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is equal -/// to rhs. -public static bool operator==(TextCursorCursor lhs, TextCursorCursor rhs) -=> lhs.Equals(rhs); - -/// Returns whether lhs is not equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is not equal -/// to rhs. -public static bool operator!=(TextCursorCursor lhs, TextCursorCursor rhs) -=> !(lhs == rhs); -} - -[StructLayout(LayoutKind.Sequential)] -public struct TextAnnotateAnnotation : IEquatable -{ -IntPtr list; -IntPtr obj; -IntPtr start_node; -IntPtr end_node; -[MarshalAsAttribute(UnmanagedType.U1)]bool is_item; - -/// -/// Gets a hash for . -/// Since EFL 1.24. -/// -/// A hash code. -public override int GetHashCode() -=> list.GetHashCode() ^ obj.GetHashCode() -^ start_node.GetHashCode() ^ end_node.GetHashCode() -^ is_item.GetHashCode(); - -/// Returns whether this -/// is equal to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public override bool Equals(object other) -=> (!(other is TextAnnotateAnnotation)) ? false -: Equals((TextAnnotateAnnotation)other); - - -/// Returns whether this is equal -/// to the given . -/// Since EFL 1.24. -/// -/// The to be compared to. -/// true if is equal to other. -public bool Equals(TextAnnotateAnnotation other) -=> (list == other.list) && (obj == other.obj) -&& (start_node == other.start_node) && (is_item == other.is_item); - -/// Returns whether lhs is equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is equal -/// to rhs. -public static bool operator==(TextAnnotateAnnotation lhs, TextAnnotateAnnotation rhs) -=> lhs.Equals(rhs); - -/// Returns whether lhs is not equal to rhs. -/// Since EFL 1.24. -/// -/// The left hand side of the operator. -/// The right hand side of the operator. -/// true if lhs is not equal -/// to rhs. -public static bool operator!=(TextAnnotateAnnotation lhs, TextAnnotateAnnotation rhs) -=> !(lhs == rhs); -} - namespace Access { --
[EGIT] [core/efl] master 01/02: eolina_mono: prevent empty ExtensionMethods class
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a9fa8da384bb0bcd0a095e227b7bca52f36bc615 commit a9fa8da384bb0bcd0a095e227b7bca52f36bc615 Author: Yeongjong Lee Date: Thu Dec 19 16:30:48 2019 +0900 eolina_mono: prevent empty ExtensionMethods class Test Plan: Check the code below is removed from `efl_ui_box_stack.eo.cs`. ``` #if EFL_BETA #pragma warning disable CS1591 public static class CoreUI_UIBoxStack_ExtensionMethods { } #pragma warning restore CS1591 #endif ``` Reviewers: lauromoura, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10905 --- src/bin/eolian_mono/eolian/mono/klass.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index 9108ed9775..11a7cd6627 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -381,6 +381,9 @@ struct klass std::copy(c.properties.begin(), c.properties.end(), std::back_inserter(implementable_properties)); } + if (implementable_properties.size() == 0 && cls.parts.size() == 0) + return true; + if(!as_generator (lit("#if EFL_BETA\n") << "#pragma warning disable CS1591\n" // Disabling warnings as DocFx will hide these classes --
[EGIT] [core/efl] master 03/03: csharp : add move tag info to EinaAccessor, EinaIterator converter
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8e951504f584f124ba88471fc46f1e7b6d2d3639 commit 8e951504f584f124ba88471fc46f1e7b6d2d3639 Author: Yeongjong Lee Date: Tue Dec 17 11:34:41 2019 -0300 csharp : add move tag info to EinaAccessor, EinaIterator converter Summary: Included commits in devs/lauromoura/remove_eina_mono-rebased ``` commit ed6679db1901c710cc6ddb50e7001cfd20caa77a Author: Lauro Moura Date: Mon Dec 2 13:58:04 2019 -0300 csharp: add move information to EnumerableToAccessor Still need to fix the converted accessor ownership, maybe by creating a custom accessor class that released the pinned memory when is freed. ``` ref T8486 Depends On D10878 Co-authored-by: Lauro Moura Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: YOhoho Reviewed By: YOhoho Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10879 --- src/bin/eolian_mono/eolian/mono/parameter.hh | 29 +++ .../eolian_mono/eolian/mono/struct_definition.hh | 2 +- src/bindings/mono/eo_mono/iwrapper.cs | 59 +- src/tests/efl_mono/Eina.cs | 11 ++-- src/tests/efl_mono/Eo.cs | 38 +++--- 5 files changed, 89 insertions(+), 50 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh index a5a70f2bb0..210e5f22d5 100644 --- a/src/bin/eolian_mono/eolian/mono/parameter.hh +++ b/src/bin/eolian_mono/eolian/mono/parameter.hh @@ -759,7 +759,7 @@ struct convert_in_variable_generator return false; auto var_name = in_variable_name(param.param_name); if (!as_generator( - "var " << string << " = " << "Efl.Eo.Globals.IEnumerableToIterator(" << escape_keyword(param.param_name) << ");\n" + "var " << string << " = Efl.Eo.Globals.IEnumerableToIterator(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n" ).generate(sink, var_name, context)) return false; } @@ -770,7 +770,7 @@ struct convert_in_variable_generator return false; auto var_name = in_variable_name(param.param_name); if (!as_generator( - "var " << string << " = " << "Efl.Eo.Globals.IEnumerableToAccessor(" << escape_keyword(param.param_name) << ");\n" + "var " << string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << escape_keyword(param.param_name) << ", " << (param.type.has_own ? "true" : "false")<< ");\n" ).generate(sink, var_name, context)) return false; } @@ -1291,12 +1291,6 @@ struct native_convert_out_assign_generator ).generate(sink, outvar, context)) return false; - // Iterators and Accessors can't own their content. - if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *" - || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *" - ) - return true; - if ((param.type.has_own && (complex->subtypes.front().is_value_type && complex->subtypes.front().has_own)) && !as_generator( string << ".OwnContent = false;\n" @@ -1314,7 +1308,7 @@ struct native_convert_out_assign_generator return false; auto outvar = out_variable_name(param.param_name); if (!as_generator( -string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << string << ");\n" +string << " = Efl.Eo.Globals.IEnumerableToAccessor(" << string << ", " << (param.type.has_own ? "true" : "false")<< ");\n" ).generate(sink, std::make_tuple(escape_keyword(param.param_name), outvar), context)) return false; } @@ -1329,7 +1323,7 @@ struct native_convert_out_assign_generator return false; auto outvar = out_variable_name(param.param_name); if (!as_generator( -string << " = Efl.Eo.Glo
[EGIT] [core/efl] master 02/03: eina_mono: replace EinaAccessor and EinaIerator with IEnumerable
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f90a97470d54edb20116e55739025e71cdfbbd92 commit f90a97470d54edb20116e55739025e71cdfbbd92 Author: Yeongjong Lee Date: Tue Dec 17 11:34:30 2019 -0300 eina_mono: replace EinaAccessor and EinaIerator with IEnumerable Summary: Eina.Accessor => System.Collections.IEnumerable Eina.Iterator => System.Collections.IEnumerable Unit test will work with D10879. ref T8486 Test Plan: meson build -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8486 Differential Revision: https://phab.enlightenment.org/D10878 --- src/bin/eolian_mono/eolian/mono/events.hh | 14 +- src/bin/eolian_mono/eolian/mono/parameter.hh | 141 - .../eolian_mono/eolian/mono/struct_definition.hh | 10 +- src/bin/eolian_mono/eolian/mono/type_impl.hh | 4 +- src/bindings/mono/efl_mono/GenericModel.cs | 4 +- .../mono/efl_mono/efl_csharp_application.cs| 3 +- src/bindings/mono/eina_mono/eina_accessor.cs | 8 +- src/bindings/mono/eina_mono/eina_iterator.cs | 2 + src/bindings/mono/eo_mono/iwrapper.cs | 86 + src/tests/efl_mono/Eina.cs | 72 ++- src/tests/efl_mono/Eo.cs | 2 +- 11 files changed, 235 insertions(+), 111 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index f0367c31dc..a77f6d7d9c 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -133,9 +133,14 @@ struct unpack_event_args_visitor { return as_generator("(Efl.Eo.Globals.CreateWrapperFor(info) as " + name_helpers::klass_full_concrete_name(cls) + ")").generate(sink, attributes::unused, *context); } - bool operator()(attributes::complex_type_def const&) const + bool operator()(attributes::complex_type_def const& types) const { - return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context); + if (types.outer.base_type == "iterator") +return as_generator("Efl.Eo.Globals.IteratorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); + else if (types.outer.base_type == "accessor") +return as_generator("Efl.Eo.Globals.AccessorTo" << eolian_mono::type << "(info)").generate(sink, type, *context); + else +return as_generator("new " << eolian_mono::type << "(info, false, false)").generate(sink, type, *context); } }; @@ -222,9 +227,12 @@ struct pack_event_info_and_call_visitor << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" ).generate(sink, attributes::unused, *context); } - bool operator()(attributes::complex_type_def const&) const + bool operator()(attributes::complex_type_def const& type) const { auto const& indent = current_indentation(*context); + if ((type.outer.base_type == "iterator") || (type.outer.base_type == "accessor")) +return true; + return as_generator(indent << "IntPtr info = e.arg.Handle;\n" << "CallNativeEventCallback(" << library_name << ", \"_" << evt_c_name << "\", IntPtr.Zero, null);\n" ).generate(sink, attributes::unused, *context); diff --git a/src/bin/eolian_mono/eolian/mono/parameter.hh b/src/bin/eolian_mono/eolian/mono/parameter.hh index d27889fcb4..a5a70f2bb0 100644 --- a/src/bin/eolian_mono/eolian/mono/parameter.hh +++ b/src/bin/eolian_mono/eolian/mono/parameter.hh @@ -639,16 +639,23 @@ struct native_convert_in_variable_generator << ");\n" ).generate(sink, std::make_tuple(in_variable_name(param.param_name), param.type), context); } - else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *" - || param.type.c_type == "Eina_Accessor *" || param.type.c_type == "const Eina_Accessor *" - ) + else if (param.type.c_type == "Eina_Iterator *" || param.type.c_type == "const Eina_Iterator *") { attributes::complex_type_def const* complex = efl::eina::get(_type); if (!complex)
[EGIT] [core/efl] master 02/02: efl_ui: cleanup elm headers
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4c77ee6843807cb0e27d73153203eec6ea42b8fb commit 4c77ee6843807cb0e27d73153203eec6ea42b8fb Author: Yeongjong Lee Date: Thu Dec 12 01:37:16 2019 + efl_ui: cleanup elm headers since e2980cd9812113fc4a216749eb23d7611b02fd55, `efl.ui.text` doesn't need `elm_general.h`. This partially reverts commit 96be3cd83d3426c5a9eb8d903245c51927567dc6. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D10849 --- src/bin/elementary/test_efl_ui_animation_view.c | 2 +- src/bin/elementary/test_efl_ui_text.c | 1 - src/bin/elementary/test_gfx_filters.c | 2 +- src/bin/elementary/test_part_bg.c | 2 +- src/bin/elementary/test_photocam.c | 2 +- src/bin/elementary/test_ui_clock.c | 2 +- src/bin/elementary/test_ui_collection.c | 7 +++ src/bin/elementary/test_ui_frame.c | 2 +- src/bin/elementary/test_ui_image.c | 2 +- src/bin/elementary/test_ui_items.c | 5 ++--- src/bin/elementary/test_ui_relative_container.c | 2 +- src/bin/elementary/test_ui_slider.c | 2 +- src/bin/elementary/test_ui_slider_interval.c| 2 +- src/bin/elementary/test_win_dialog.c| 2 -- src/examples/elementary/efl_ui_list_example_1.c | 6 -- src/lib/elementary/elm_priv.h | 6 -- 16 files changed, 15 insertions(+), 32 deletions(-) diff --git a/src/bin/elementary/test_efl_ui_animation_view.c b/src/bin/elementary/test_efl_ui_animation_view.c index b086a1b3bf..f5a73df745 100644 --- a/src/bin/elementary/test_efl_ui_animation_view.c +++ b/src/bin/elementary/test_efl_ui_animation_view.c @@ -3,7 +3,7 @@ #endif #include #include -#include "elm_priv.h" //FIXME remove this once efl.ui.text doesn't need elm_general.h + #ifndef EFL_BETA_API_SUPPORT #define EFL_BETA_API_SUPPORT #endif diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index f14d25d8e8..066e73295a 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -4,7 +4,6 @@ #define EO_BETA_API #include #include -#include "elm_priv.h" //FIXME remove this once efl.ui.text doesn't need elm_general.h static void _apply_style(Eo *obj, size_t start_pos, size_t end_pos, const char *style) diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index 8fb84ab671..7ab9a6372d 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -5,7 +5,7 @@ #include #include #include "elm_spinner_eo.h" -#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h + static const int default_font_size = 48; typedef struct _Filter_Image diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c index 1ee74d7786..850377b590 100644 --- a/src/bin/elementary/test_part_bg.c +++ b/src/bin/elementary/test_part_bg.c @@ -3,7 +3,7 @@ #endif #include #include -#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h + #define MAX_NUM_OF_CONTENT 17 const Efl_Class *content_class[MAX_NUM_OF_CONTENT]; diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index 6de8bde32c..166f669a42 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -3,7 +3,7 @@ #endif #include #include -#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h + static const struct { Evas_Image_Orient orient; const char *name; diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c index c2840a61ce..79e9074ead 100644 --- a/src/bin/elementary/test_ui_clock.c +++ b/src/bin/elementary/test_ui_clock.c @@ -3,7 +3,7 @@ #endif #include #include -#include "elm_priv.h" //FIXME remove this once efl.ui.textbox doesn't need elm_general.h + /* A simple test, just displaying clock in its default format */ Evas_Object *dt1, *dt2, *dt3, *dt4; diff --git a/src/bin/elementary/test_ui_collection.c b/src/bin/elementary/test_ui_collection.c index 2397e14211..6e4d8327ac 100644 --- a/src/bin/elementary/test_ui_collection.c +++ b/src/bin/elementary/test_ui_collection.c @@ -2,7 +2,6 @@ # include "elementary_config.h" #endif -#include #include static void @@ -114,7 +113,7 @@ _add_item(Efl_Ui_Collection *c, Eo *cont) snprintf(buf, sizeof(buf), "%d - Test %d", i, i%13); efl_text_set(il, buf); - rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, evas_object_evas_get(c)); + rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS, c); switch (i % 5) { case 0: @@ -312,14 +311,14 @@ void create_item_container_ui(const Efl_Class *colle
[EGIT] [core/efl] master 01/01: csharp: remove Efl.IText.Text from the blacklist
woohyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c62a7dae6316df60c6c47577743b62185ca56951 commit c62a7dae6316df60c6c47577743b62185ca56951 Author: Yeongjong Lee Date: Thu Dec 12 16:07:41 2019 +0900 csharp: remove Efl.IText.Text from the blacklist Summary: There is no conflict anymore. ref T8093 Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura, woohyun Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8093 Differential Revision: https://phab.enlightenment.org/D10861 --- src/bin/eolian_mono/eolian/mono/blacklist.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/eolian_mono/eolian/mono/blacklist.hh b/src/bin/eolian_mono/eolian/mono/blacklist.hh index 07c365fbf6..fc6f20556a 100644 --- a/src/bin/eolian_mono/eolian/mono/blacklist.hh +++ b/src/bin/eolian_mono/eolian/mono/blacklist.hh @@ -152,7 +152,7 @@ inline bool is_alias_blacklisted(attributes::alias_def const& alias, Context con inline bool is_property_blacklisted(std::string const& name) { -return name == "Efl.IText.Text"; +return false; } template --
[EGIT] [core/efl] master 01/02: eolian_mono: remove unused EventArgs parameter of OnXXXEvent
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5448c43bab7d054dde57dcc50e9d7239ff891729 commit 5448c43bab7d054dde57dcc50e9d7239ff891729 Author: Yeongjong Lee Date: Mon Dec 9 12:59:19 2019 -0300 eolian_mono: remove unused EventArgs parameter of OnXXXEvent Summary: if a event doesn't have `EventArgs`, parameter `EventArgs e` of its OnXXXEvent is naver used. ref T8414 Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8414 Differential Revision: https://phab.enlightenment.org/D10656 --- src/bin/eolian_mono/eolian/mono/events.hh | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index abd5368ccd..04789256b8 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -508,10 +508,19 @@ struct event_definition_generator } } + // Close summary + if (!as_generator(scope_tab << "/// \n").generate(sink, nullptr, context)) +return false; + + if (evt.type.is_engaged()) +{ +if (!as_generator(scope_tab << "/// Event to raise.\n" + ).generate(sink, nullptr, context)) + return false; +} + if (!as_generator( -scope_tab << "/// \n" -<< scope_tab << "/// Event to raise.\n" -<< scope_tab << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << event_args_type << " e)\n" +scope_tab << (is_concrete ? "public" : "protected virtual") << " void On" << event_name << "(" << (!evt.type.is_engaged() ? "" : event_args_type + " e") << ")\n" << scope_tab << "{\n" << scope_tab << scope_tab << "var key = \"_" << upper_c_name << "\";\n" << scope_tab << scope_tab << "IntPtr desc = Efl.EventDescription.GetNative(" << library_name << ", key);\n" --
[EGIT] [core/efl] master 02/02: eolian_mono: reduce duplicated code in OnXXXEvent
lauromoura pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=06c2bbf798ca318efe23baec8e6454f8c5b177f4 commit 06c2bbf798ca318efe23baec8e6454f8c5b177f4 Author: Yeongjong Lee Date: Mon Dec 9 13:45:56 2019 -0300 eolian_mono: reduce duplicated code in OnXXXEvent Summary: `CallNativeEventCallback` is used to reduce duplicated code. E.g. Before ``` protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e) { var key = "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED"; IntPtr desc = Efl.EventDescription.GetNative(efl.Libs.Elementary, key); if (desc == IntPtr.Zero) { Eina.Log.Error($"Failed to get native event {key}"); return; } IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0); try { Efl.Eo.Globals.efl_event_callback_call(this.NativeHandle, desc, info); } finally { Marshal.FreeHGlobal(info); } } ``` After ``` protected virtual void OnFullscreenChangedEvent(Efl.Ui.WinFullscreenChangedEventArgs e) { IntPtr info = Eina.PrimitiveConversion.ManagedToPointerAlloc(e.arg ? (byte) 1 : (byte) 0); CallNativeEventCallback("elementary", "_EFL_UI_WIN_EVENT_FULLSCREEN_CHANGED", info, (p) => Marshal.FreeHGlobal(p)); } ``` Test Plan: meson setup -Dbindings=mono,cxx -Dmono-beta=true Reviewers: lauromoura Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10661 --- src/bin/eolian_mono/eolian/mono/events.hh | 52 +-- src/bindings/mono/eo_mono/EoWrapper.cs| 19 +++ 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/events.hh b/src/bin/eolian_mono/eolian/mono/events.hh index 04789256b8..a4289af559 100644 --- a/src/bin/eolian_mono/eolian/mono/events.hh +++ b/src/bin/eolian_mono/eolian/mono/events.hh @@ -141,8 +141,8 @@ struct pack_event_info_and_call_visitor mutable OutputIterator sink; Context const* context; attributes::type_def const& type; - - static auto constexpr native_call = "Efl.Eo.Globals.CallEventCallback(this.NativeHandle, desc, info);\n"; + std::string library_name; + std::string evt_c_name; typedef pack_event_info_and_call_visitor visitor_type; typedef bool result_type; @@ -157,15 +157,7 @@ struct pack_event_info_and_call_visitor { return as_generator( indent << "IntPtr info = Marshal.AllocHGlobal(Marshal.SizeOf(e.arg));\n" -<< indent << "try\n" -<< indent << "{\n" -<< indent << scope_tab << "Marshal.StructureToPtr(e.arg, info, false);\n" -<< indent << scope_tab << this->native_call -<< indent << "}\n" -<< indent << "finally\n" -<< indent << "{\n" -<< indent << scope_tab << "Marshal.FreeHGlobal(info);\n" -<< indent << "}\n" +<< indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Marshal.FreeHGlobal(p));\n" ).generate(sink, attributes::unused, *context); } @@ -192,14 +184,8 @@ struct pack_event_info_and_call_visitor { return as_generator( indent << "IntPtr info = Eina.StringConversion.ManagedStringToNativeUtf8Alloc(" << conversion << ");\n" - << indent << "try\n" - << indent << "{\n" - << indent << scope_tab << this->native_call - << indent << "}\n" - << indent << "finally\n" - << indent << "{\n" - << indent << scope_tab << "Eina.MemoryNative.Free(info);\n" - << indent << "}\n").generate(sink, attributes::unused, *context); + << indent << "CallNativeEventCallback(" + library_name + ", \"_" + evt_c_name + "\", info, " << "(p) => Eina.MemoryNative.Free(p));\n" + ).generate(sink, attributes::unused, *context); }; if (eina::optional b = call_mat
[EGIT] [core/efl] master 01/01: efl: stabilize Efl.Gfx.Arrangement
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=519430e204c65fdd8de02e2e9518e8ac0d4cff69 commit 519430e204c65fdd8de02e2e9518e8ac0d4cff69 Author: Yeongjong Lee Date: Mon Nov 11 05:48:24 2019 + efl: stabilize Efl.Gfx.Arrangement ref T7864 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D10642 --- src/lib/efl/interfaces/efl_gfx_arrangement.eo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_gfx_arrangement.eo b/src/lib/efl/interfaces/efl_gfx_arrangement.eo index bfd5ad7247..a2ff642bf2 100644 --- a/src/lib/efl/interfaces/efl_gfx_arrangement.eo +++ b/src/lib/efl/interfaces/efl_gfx_arrangement.eo @@ -1,5 +1,5 @@ import efl_gfx_types; -interface @beta Efl.Gfx.Arrangement +interface Efl.Gfx.Arrangement { [[ This interface provides methods for manipulating how contents are arranged within a container, --
[EGIT] [core/efl] master 01/01: navigation_layout: set efl.content y-axis align to 0.0
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a47f0626339846aadbe2b691b0d11eda87a128a1 commit a47f0626339846aadbe2b691b0d11eda87a128a1 Author: Yeongjong Lee Date: Thu May 9 15:42:13 2019 +0900 navigation_layout: set efl.content y-axis align to 0.0 Summary: If `efl.content` min size is greater than edc area size, `efl.bar` and `efl.content` are overlapped because default y-align is 0.5. This patch avoid it. Test Plan: Sample code: ``` // gcc -o efl_ui_stack_example efl_ui_stack_example.c `pkg-config --cflags --libs elementary` EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { Eo *win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get()); Eo *stack = efl_add(EFL_UI_STACK_CLASS, win); efl_content_set(win, stack); Eo *nl = efl_add(EFL_UI_NAVIGATION_LAYOUT_CLASS, stack, efl_ui_stack_push(stack, efl_added)); Eo *bn = efl_add(EFL_UI_NAVIGATION_BAR_CLASS, stack); efl_text_set(bn, "Title Text"); efl_ui_navigation_layout_bar_set(nl, bn); Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, nl, efl_text_set(efl_added, "Button 1"), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(50, 80)), efl_content_set(nl, efl_added)); efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 80)); } EFL_MAIN() ``` Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8868 --- data/elementary/themes/edc/efl/navigation_layout.edc | 1 + 1 file changed, 1 insertion(+) diff --git a/data/elementary/themes/edc/efl/navigation_layout.edc b/data/elementary/themes/edc/efl/navigation_layout.edc index 4319453b96..9947d6d313 100644 --- a/data/elementary/themes/edc/efl/navigation_layout.edc +++ b/data/elementary/themes/edc/efl/navigation_layout.edc @@ -21,6 +21,7 @@ group { "efl/navigation_layout"; relative: 0.0 1.0; } rel2.to_x: "base"; +align: 0.5 0.0; } } } --
[EGIT] [core/efl] master 01/01: ui.relative_layout: implement Efl.Pack
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2426656fd6b444b5b5fa86920dc9b61ff2fa10b1 commit 2426656fd6b444b5b5fa86920dc9b61ff2fa10b1 Author: Yeongjong Lee Date: Fri May 3 09:20:17 2019 + ui.relative_layout: implement Efl.Pack Now, efl_content_iterate, efl_content_count, efl_pack, efl_pack_unpack, efl_pack_unpack_all and efl_pack_clear are available for relative_layout. Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8631 --- src/lib/elementary/efl_ui_relative_layout.c| 146 +++-- src/lib/elementary/efl_ui_relative_layout.eo | 21 +-- .../elementary/efl_ui_relative_layout_private.h| 8 ++ src/tests/elementary/efl_ui_test_relative_layout.c | 36 - src/tests/elementary/spec/efl_test_pack.c | 2 +- 5 files changed, 155 insertions(+), 58 deletions(-) diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index d0d5ff441e..530179cab4 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -27,29 +27,25 @@ _chain_sort_cb(const void *l1, const void *l2) static void _on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Efl_Ui_Relative_Layout_Data *pd = data; + Efl_Ui_Relative_Layout *obj = data; - efl_pack_layout_request(pd->obj); + efl_pack_layout_request(obj); } static void _on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Efl_Ui_Relative_Layout_Data *pd = data; + Efl_Ui_Relative_Layout *obj = data; - efl_pack_layout_request(pd->obj); + efl_pack_layout_request(obj); } static void _on_child_del(void *data, const Efl_Event *event) { - Efl_Ui_Relative_Layout_Data *pd = data; + Efl_Ui_Relative_Layout *obj = data; - if (eina_hash_del_by_key(pd->children, >object)) - efl_pack_layout_request(pd->obj); - else - ERR("child(%p(%s)) is not registered", event->object, - efl_class_name_get(event->object)); + efl_pack_unpack(obj, event->object); } EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_relative_layout_callbacks, @@ -82,7 +78,7 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) efl_key_data_set(child, "_elm_leaveme", pd->obj); efl_canvas_object_clipper_set(child, pd->clipper); - efl_event_callback_array_add(child, efl_ui_relative_layout_callbacks(), pd); + efl_event_callback_array_add(child, efl_ui_relative_layout_callbacks(), pd->obj); efl_canvas_group_member_add(pd->obj, child); efl_canvas_group_change(pd->obj); @@ -366,19 +362,26 @@ _hash_free_cb(void *data) { Efl_Ui_Relative_Layout_Child *child = data; + efl_canvas_group_member_remove(child->layout, child->obj); + efl_canvas_object_clipper_set(child->obj, NULL); + efl_key_data_set(child->obj, "_elm_leaveme", NULL); + efl_event_callback_array_del(child->obj, efl_ui_relative_layout_callbacks(), +child->layout); + + if (!efl_invalidated_get(child->obj)) + _elm_widget_sub_object_redirect_to_top(child->layout, child->obj); + free(child); } -static Eina_Bool -_hash_free_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key EINA_UNUSED, - void *data, void *fdata EINA_UNUSED) +static void +_hash_clear_cb(void *data) { Efl_Ui_Relative_Layout_Child *child = data; - _elm_widget_sub_object_redirect_to_top(child->layout, child->obj); - _hash_free_cb(child); - - return EINA_TRUE; + efl_event_callback_array_del(child->obj, efl_ui_relative_layout_callbacks(), +child->layout); + efl_del(child->obj); } static Eina_Bool @@ -558,14 +561,9 @@ _efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_D EOLIAN static void _efl_ui_relative_layout_efl_object_invalidate(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) { - Eo *child; - efl_invalidate(efl_super(obj, MY_CLASS)); - EINA_LIST_FREE(pd->children, child) - { -efl_event_callback_array_del(child, efl_ui_relative_layout_callbacks(), pd); - } + eina_hash_free_buckets(pd->children); } EOLIAN static void @@ -578,35 +576,101 @@ _efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Da efl_destructor(efl_super(obj, MY_CLASS)); } -EOLIAN static void -_efl_ui_relative_layout_unregister(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Efl_Object *child) +EOLIAN static Eina_Bool +_efl_ui_relative_layout_efl_pack_pack(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Efl_Gfx_Entity *subobj) { - _elm_widget_sub_object_redirect_to_top(obj, child); - if (eina_hash_del_by_key(pd->children, )) - { -efl_canvas_group_member_remove
[EGIT] [core/efl] efl-1.22 04/84: efl/elm_scroller: apply color_set correctly
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=8e2c3217a58616c33b2dc6f55fb4e088959b1645 commit 8e2c3217a58616c33b2dc6f55fb4e088959b1645 Author: Yeongjong Lee Date: Wed Apr 17 08:15:15 2019 + efl/elm_scroller: apply color_set correctly hit_rect/event_rect should ignore color_set. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8629 --- src/lib/elementary/efl_ui_scroll_manager.c | 1 + src/lib/elementary/elm_scroller.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index e58aa874fb..a6bf0cda22 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -2418,6 +2418,7 @@ _efl_ui_scroll_manager_efl_object_constructor(Eo *obj, Efl_Ui_Scroll_Manager_Dat sd->scrolling = EINA_FALSE; sd->event_rect = evas_object_rectangle_add(evas_object_evas_get(sd->parent)); + efl_key_data_set(sd->event_rect, "_elm_leaveme", obj); efl_canvas_group_member_add(sd->parent, sd->event_rect); efl_ui_widget_sub_object_add(sd->parent, sd->event_rect); diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index 6a1e3291b7..1eec6d866e 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -785,6 +785,7 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) CRI("Failed to set layout!"); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_data_set(priv->hit_rect, "_elm_leaveme", obj); evas_object_smart_member_add(priv->hit_rect, obj); elm_widget_sub_object_add(obj, priv->hit_rect); --
[EGIT] [core/efl] efl-1.22 53/84: ui.relative_layout: fix incorrect type casting
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=b8904f38a5ca500a8161e79c0c52afd7b1e34d67 commit b8904f38a5ca500a8161e79c0c52afd7b1e34d67 Author: Yeongjong Lee Date: Wed Apr 24 21:09:53 2019 +0900 ui.relative_layout: fix incorrect type casting Summary: `temph` can be double type. Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8695 --- src/lib/elementary/efl_ui_relative_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 827b3d601c..491c52f8af 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -125,7 +125,7 @@ static void _child_aspect_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis) { Efl_Ui_Relative_Layout_Calc *calc = >calc; - int temph; + double temph; if ((calc->aspect[0] <= 0) || (calc->aspect[1] <= 0)) { --
[EGIT] [core/efl] efl-1.22 51/84: ui.relative_layout: add callbacks to update layout
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=91accc36287bb84dbcfb913643a0eef738307a2a commit 91accc36287bb84dbcfb913643a0eef738307a2a Author: Yeongjong Lee Date: Wed Apr 24 20:32:45 2019 +0900 ui.relative_layout: add callbacks to update layout Summary: If the size or hints of a child changes, relative_layout need to update layout. And, if a child is deleted, it should be unregisterd from relative_layout. Depends on D8625 Test Plan: elementary_test -to 'efl.ui.relative_layout' Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8626 --- src/bin/elementary/test_ui_relative_layout.c | 2 -- src/lib/elementary/efl_ui_relative_layout.c | 37 +++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index dbb1647eee..f1d58af0cd 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -120,8 +120,6 @@ _slider_changed_align_cb(void *data, const Efl_Event *event) efl_gfx_hint_align_set(btn, val, y); else if (opt == 'y') efl_gfx_hint_align_set(btn, x, val); - - efl_pack_layout_request(layout); } static void diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 17bf97d8b5..827b3d601c 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -24,6 +24,40 @@ _chain_sort_cb(const void *l1, const void *l2) return calc2->comp_factor <= calc1->comp_factor ? -1 : 1; } +static void +_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + efl_pack_layout_request(pd->obj); +} + +static void +_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + efl_pack_layout_request(pd->obj); +} + +static void +_on_child_del(void *data, const Efl_Event *event) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + if (eina_hash_del_by_key(pd->children, >object)) + efl_pack_layout_request(pd->obj); + else + ERR("child(%p(%s)) is not registered", event->object, + efl_class_name_get(event->object)); +} + +EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_relative_layout_callbacks, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed }, + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed }, + { EFL_EVENT_DEL, _on_child_del } +); + static Efl_Ui_Relative_Layout_Child * _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) { @@ -48,6 +82,7 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) efl_key_data_set(child, "_elm_leaveme", pd->obj); efl_canvas_object_clipper_set(child, pd->clipper); + efl_event_callback_array_add(child, efl_ui_relative_layout_callbacks(), pd); efl_canvas_group_member_add(pd->obj, child); efl_canvas_group_change(pd->obj); @@ -539,7 +574,7 @@ _efl_ui_relative_layout_unregister(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Efl efl_canvas_group_member_remove(obj, child); efl_canvas_object_clipper_set(child, NULL); efl_key_data_set(child, "_elm_leaveme", NULL); - +efl_event_callback_array_del(child, efl_ui_relative_layout_callbacks(), pd); efl_pack_layout_request(obj); } else --
[EGIT] [core/efl] efl-1.22 02/84: ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=7947cbddebbcb734d08eff099ad8dba4885d6b87 commit 7947cbddebbcb734d08eff099ad8dba4885d6b87 Author: Yeongjong Lee Date: Fri Apr 12 05:38:00 2019 + ui.widget: remove elm_widget_sub_object_parent_add from each of widgets since commit a1addad60e, To add myself as a sub object of parent object will be done in Efl.Ui.Widget constructor. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8280 --- src/lib/elementary/efl_ui_alert_popup.c| 2 -- src/lib/elementary/efl_ui_anchor_popup.c | 2 -- src/lib/elementary/efl_ui_bg.c | 1 - src/lib/elementary/efl_ui_box.c| 1 - src/lib/elementary/efl_ui_button.c | 1 - src/lib/elementary/efl_ui_calendar.c | 2 -- src/lib/elementary/efl_ui_clock.c | 1 - src/lib/elementary/efl_ui_datepicker.c | 2 -- src/lib/elementary/efl_ui_flip.c | 1 - src/lib/elementary/efl_ui_frame.c | 1 - src/lib/elementary/efl_ui_image.c | 1 - src/lib/elementary/efl_ui_image_zoomable.c | 2 -- src/lib/elementary/efl_ui_layout.c | 2 -- src/lib/elementary/efl_ui_list_view.c | 1 - src/lib/elementary/efl_ui_navigation_bar.c | 2 -- src/lib/elementary/efl_ui_navigation_layout.c | 2 -- src/lib/elementary/efl_ui_nstate.c | 1 - src/lib/elementary/efl_ui_pager.c | 2 -- src/lib/elementary/efl_ui_panel.c | 1 - src/lib/elementary/efl_ui_panes.c | 1 - src/lib/elementary/efl_ui_popup.c | 2 -- src/lib/elementary/efl_ui_progressbar.c| 1 - src/lib/elementary/efl_ui_relative_layout.c| 1 - src/lib/elementary/efl_ui_scroll_alert_popup.c | 2 -- src/lib/elementary/efl_ui_slider.c | 1 - src/lib/elementary/efl_ui_spin.c | 2 -- src/lib/elementary/efl_ui_spin_button.c| 1 - src/lib/elementary/efl_ui_tab_bar.c| 3 --- src/lib/elementary/efl_ui_tab_page.c | 3 --- src/lib/elementary/efl_ui_tab_pager.c | 1 - src/lib/elementary/efl_ui_table.c | 2 -- src/lib/elementary/efl_ui_tags.c | 1 - src/lib/elementary/efl_ui_text.c | 2 -- src/lib/elementary/efl_ui_text_alert_popup.c | 2 -- src/lib/elementary/efl_ui_textpath.c | 1 - src/lib/elementary/efl_ui_timepicker.c | 2 -- src/lib/elementary/efl_ui_video.c | 1 - src/lib/elementary/efl_ui_widget.c | 10 +- src/lib/elementary/elc_combobox.c | 1 - src/lib/elementary/elc_ctxpopup.c | 1 - src/lib/elementary/elc_fileselector.c | 1 - src/lib/elementary/elc_fileselector_button.c | 1 - src/lib/elementary/elc_fileselector_entry.c| 1 - src/lib/elementary/elc_hoversel.c | 1 - src/lib/elementary/elc_multibuttonentry.c | 1 - src/lib/elementary/elc_naviframe.c | 1 - src/lib/elementary/elc_player.c| 1 - src/lib/elementary/elc_popup.c | 1 - src/lib/elementary/elm_access.c| 1 - src/lib/elementary/elm_actionslider.c | 1 - src/lib/elementary/elm_box.c | 1 - src/lib/elementary/elm_bubble.c| 1 - src/lib/elementary/elm_calendar.c | 1 - src/lib/elementary/elm_clock.c | 1 - src/lib/elementary/elm_colorselector.c | 1 - src/lib/elementary/elm_conform.c | 1 - src/lib/elementary/elm_dayselector.c | 1 - src/lib/elementary/elm_diskselector.c | 2 -- src/lib/elementary/elm_entry.c | 1 - src/lib/elementary/elm_flipselector.c | 1 - src/lib/elementary/elm_gengrid.c | 1 - src/lib/elementary/elm_genlist.c | 1 - src/lib/elementary/elm_gesture_layer.c | 1 - src/lib/elementary/elm_glview.c| 2 -- src/lib/elementary/elm_grid.c | 2 -- src/lib/elementary/elm_hover.c | 1 - src/lib/elementary/elm_icon.c | 1 - src/lib/elementary/elm_index.c | 1 - src/lib/elementary/elm_inwin.c | 1 - src/lib/elementary/elm_label.c | 2 -- src/lib/elementary/elm_list.c | 1 - src/lib/elementary/elm_map.c | 2 -- src/lib/elementary/elm_mapbuf.c| 1 - src/lib/elementary/elm_menu.c | 1 - src/lib/elementary/elm_notify.c| 1 - src/lib/elementary/elm_panel.c | 1 - src/lib/elementary/elm_photo.c | 1 - src/lib/elementary/elm_plug.c | 1 - src/lib/elementary/elm_prefs.c | 1 - src/lib/elementary/elm_route.c | 1
[EGIT] [core/efl] efl-1.22 60/84: edje_calc: replace eina_stringshare_ref with eina_stringshare_add
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=4c89d5021b8b11a8c6a2ea43455f46cdbd33ffae commit 4c89d5021b8b11a8c6a2ea43455f46cdbd33ffae Author: Yeongjong Lee Date: Fri Apr 26 14:55:37 2019 +0900 edje_calc: replace eina_stringshare_ref with eina_stringshare_add Summary: When there is circular dependency in edc, a bunch of CRI log is printed. This patch fixes it. ``` ERR<10159>:edje lib/edje/edje_calc.c:3919 _edje_part_recalc() Circular dependency in the group 'test' : longpartname -> longpartname -> longpartname2 ERR<10159>:edje lib/edje/edje_calc.c:3896 _edje_part_recalc() Circular dependency when calculating part "longpartname". Already calculating XY [03] axes. Need to calculate Y [02] axes CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ebf60 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 2f736e6f - (unknown) CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ec5d1 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 5f747261 - (unknown) ``` If string is already stored, `eina_stringshare_add` increase its reference count. Test Plan: test.c ``` //edje_cc test.edc && gcc -o test test.c `pkg-config --libs --cflags elementary` #include int main(int argc, char **argv) { elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add("test", "test"); Evas_Object *layout = elm_layout_add(win); elm_layout_file_set(layout, "./test.edj", "test"); elm_win_resize_object_add(win, layout); evas_object_show(layout); evas_object_resize(win, 200, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } ``` test.edc ``` collections { group { name: "test"; parts { rect { name: "longpartname"; desc { "default"; rel1.to: "longpartname2"; } } rect { name: "longpartname2"; type: RECT; desc { "default"; rel2.to: "longpartname"; } } } } } ``` Reviewers: SanghyeonLee, zmike Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8717 --- src/lib/edje/edje_calc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index 3e3bf29850..ea64b867c6 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3676,7 +3676,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param1.description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3685,7 +3685,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param1.description->rel2.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3698,7 +3698,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param2->description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3707,7 +3707,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param2->descriptio
[EGIT] [core/efl] efl-1.22 52/84: ui.relative_layout: enhance relation_xxx_set, get apis
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=19d8e815cc8d26001fc0491e41460921957392f2 commit 19d8e815cc8d26001fc0491e41460921957392f2 Author: Yeongjong Lee Date: Wed Apr 24 20:33:20 2019 +0900 ui.relative_layout: enhance relation_xxx_set,get apis Summary: I forgot `efl_pack_layout_request` after relation_xxx is changed. Unnecessary register function in `relation_xxx_get` will return unexpected result. if a object is not child of relative_layout, `relation_xxx_get` should return `target = NULL` and `relative = 0.0` with error message. Test Plan: make check Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8627 --- src/bin/elementary/test_ui_relative_layout.c | 2 - .../elementary/efl_ui_relative_layout_private.h| 20 +++-- src/tests/elementary/efl_ui_test_relative_layout.c | 51 ++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index f1d58af0cd..0e8bcbccd0 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -74,7 +74,6 @@ _btn_clicked_to_cb(void *data, const Efl_Event *event) break; } efl_text_set(obj, ((to == layout) ? "parent" : (char *)efl_text_get(to))); - efl_pack_layout_request(layout); } static void @@ -102,7 +101,6 @@ _slider_changed_relative_cb(void *data, const Efl_Event *event) efl_ui_relative_layout_relation_bottom_set(layout, btn, NULL, val); break; } - efl_pack_layout_request(layout); } static void diff --git a/src/lib/elementary/efl_ui_relative_layout_private.h b/src/lib/elementary/efl_ui_relative_layout_private.h index c58f7b0ecc..e0f2abfee0 100644 --- a/src/lib/elementary/efl_ui_relative_layout_private.h +++ b/src/lib/elementary/efl_ui_relative_layout_private.h @@ -70,23 +70,35 @@ struct _Efl_Ui_Relative_Layout_Child #define EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(direction, DIRECTION) \ EOLIAN static void \ - _efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \ + _efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \ { \ Efl_Ui_Relative_Layout_Child *rc; \ + if (!child) return; \ rc = _relative_child_get(pd, child); \ + if (!rc) return; \ if (target) rc->rel[DIRECTION].to = target; \ if (relative < 0) relative = 0; \ else if (relative > 1) relative = 1; \ rc->rel[DIRECTION].relative = relative; \ + efl_pack_layout_request(obj); \ } \ \ EOLIAN static void \ _efl_ui_relative_layout_relation_ ## direction ## _get(const Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo **target, double *relative) \ { \ Efl_Ui_Relative_Layout_Child *rc; \ - rc = _relative_child_get(pd, child); \ - if (target) *target = rc->rel[DIRECTION].to; \ - if (relative) *relative = rc->rel[DIRECTION].relative; \ + Eo *rel_to = NULL; \ + double rel_relative = 0.0; \ + rc = eina_hash_find(pd->children, ); \ + if (rc) \ +{ \ + rel_to = rc->rel[DIRECTION].to; \ + rel_relative = rc->rel[DIRECTION].relative; \ +} \ + else \ +ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child)); \ + if (target) *target = rel_to; \ + if (relative) *relative = rel_relative; \ } #endif diff --git a/src/tests/elementary/efl_ui_test_relative_layout.c b/src/tests/elementary/efl_ui_test_relative_layout.c index f769bf47ec..3027bdb082 100644 --- a/src/tests/elementary/efl_ui_test_relative_layout.c +++ b/src/tests/elementary/efl_ui_test_relative_layout.c @@ -292,10 +292,61 @@ EFL_START_TEST (efl_ui_relative_layout_layout_update_chain) } EFL_END_TEST +EFL_START_TEST (efl_ui_relative_layout_relation_set) +{ + Eo *btn; + Eo *target = NULL; + double relative; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout); + + // negative test + efl_ui_relative_layout_relation_top_get(layout, NULL, , ); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + efl_ui_relative_layout_relation_top_get(layout, btn, , ); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + efl_ui_relative_layout_relation_top_set(layout, NULL, NULL, 0.0); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + // default value test + efl_ui_relative_layout_relation_top_set(layout, btn, layout, 0.0); + + efl_
[EGIT] [core/efl] efl-1.22 50/84: ui.relative_layout: add internal clipper
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=a9394a6a5c9815cfeddeb970d24d4f12a9b15463 commit a9394a6a5c9815cfeddeb970d24d4f12a9b15463 Author: Yeongjong Lee Date: Wed Apr 24 20:23:52 2019 +0900 ui.relative_layout: add internal clipper Summary: If there is no clipper of container, color_set and clipper_set api won't work. Test Plan: 1. elementary_test -to 'efl.ui.relative_layout' 2. Click button1 3. check that buttons color are changed. Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8625 --- src/bin/elementary/test_ui_relative_layout.c | 16 +++ src/lib/elementary/efl_ui_relative_layout.c| 117 - .../elementary/efl_ui_relative_layout_private.h| 2 + 3 files changed, 87 insertions(+), 48 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index e6481ec97e..dbb1647eee 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -15,6 +15,21 @@ typedef enum { BOTTOM } Options; +static void +_btn_color_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED) +{ + Eo *layout = data; + + static Eina_Bool changed = EINA_TRUE; + + if (changed) + efl_gfx_color_set(layout, 0, 88, 204, 255); + else + efl_gfx_color_set(layout, 255, 255, 255, 255); + + changed = !changed; +} + static void _btn_clicked_to_cb(void *data, const Efl_Event *event) { @@ -297,6 +312,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "button1"), efl_gfx_hint_align_set(efl_added, 0.0, 0.0), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_color_clicked_cb, layout), efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0), efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 66bedb87ef..17bf97d8b5 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -29,6 +29,9 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) { Efl_Ui_Relative_Layout_Child *rc; + if (!efl_ui_widget_sub_object_add(pd->obj, child)) + return NULL; + rc = calloc(1, sizeof(Efl_Ui_Relative_Layout_Child)); if (!rc) return NULL; @@ -43,19 +46,10 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) rc->rel[BOTTOM].to = rc->layout; rc->rel[BOTTOM].relative = 1.0; - if (pd->obj == child) - { -rc->calc.state[0] = RELATIVE_CALC_DONE; -rc->calc.state[1] = RELATIVE_CALC_DONE; -rc->calc.chain_state[0] = RELATIVE_CALC_DONE; -rc->calc.chain_state[1] = RELATIVE_CALC_DONE; - } - else - { -efl_ui_widget_sub_object_add(pd->obj, child); -efl_canvas_group_member_add(pd->obj, child); -efl_canvas_group_change(pd->obj); - } + efl_key_data_set(child, "_elm_leaveme", pd->obj); + efl_canvas_object_clipper_set(child, pd->clipper); + efl_canvas_group_member_add(pd->obj, child); + efl_canvas_group_change(pd->obj); eina_hash_add(pd->children, , rc); @@ -75,13 +69,19 @@ _relative_child_get(Efl_Ui_Relative_Layout_Data *pd, Eo *child) } static Efl_Ui_Relative_Layout_Child * -_relative_child_find(const Eina_Hash *children, Eo *target) +_relative_child_find(Efl_Ui_Relative_Layout_Data *pd, Eo *target) { Efl_Ui_Relative_Layout_Child *child; - child = eina_hash_find(children, ); + if (pd->obj == target) + return pd->base; + + child = eina_hash_find(pd->children, ); if (!child) - ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target)); + { +ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target)); +child = pd->base; + } return child; } @@ -353,9 +353,6 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E Efl_Ui_Relative_Layout_Child *child = data; Eina_Rect want; - if (child->obj == child->layout) - return EINA_TRUE; - _child_calc(child, 0); _child_calc(child, 1); @@ -370,35 +367,18 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E static Eina_Bool -_hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED, -void *data, void *fd
[EGIT] [core/efl] efl-1.22 21/84: ui.relative_layout: replace evas_object_event_callback_xxx with efl_event_callback_xxx
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=bd5946dabe72d845a589125d89ec17826d02ec24 commit bd5946dabe72d845a589125d89ec17826d02ec24 Author: Yeongjong Lee Date: Wed Apr 17 08:24:25 2019 + ui.relative_layout: replace evas_object_event_callback_xxx with efl_event_callback_xxx remove legacy function Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8630 --- src/lib/elementary/efl_ui_relative_layout.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index fa47d7591c..66bedb87ef 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -446,10 +446,9 @@ _hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED, } static void -_on_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED, - Evas_Object *obj, void *event_info EINA_UNUSED) +_efl_ui_relative_layout_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) { - efl_pack_layout_request(obj); + efl_pack_layout_request(ev->object); } EOLIAN static void @@ -490,7 +489,8 @@ _efl_ui_relative_layout_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Relative_Lay EOLIAN static void _efl_ui_relative_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) { - evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_relative_layout_hints_changed_cb, NULL); efl_canvas_group_add(efl_super(obj, MY_CLASS)); elm_widget_highlight_ignore_set(obj, EINA_TRUE); @@ -514,6 +514,8 @@ _efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_D EOLIAN static void _efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) { + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_relative_layout_hints_changed_cb, NULL); eina_hash_free(pd->children); efl_destructor(efl_super(obj, MY_CLASS)); } --
[EGIT] [core/efl] master 01/01: edje_calc: replace eina_stringshare_ref with eina_stringshare_add
sanghyeonlee pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0921e4770e4751ec9abf7757f9d11cbb5cc7f223 commit 0921e4770e4751ec9abf7757f9d11cbb5cc7f223 Author: Yeongjong Lee Date: Fri Apr 26 14:55:37 2019 +0900 edje_calc: replace eina_stringshare_ref with eina_stringshare_add Summary: When there is circular dependency in edc, a bunch of CRI log is printed. This patch fixes it. ``` ERR<10159>:edje lib/edje/edje_calc.c:3919 _edje_part_recalc() Circular dependency in the group 'test' : longpartname -> longpartname -> longpartname2 ERR<10159>:edje lib/edje/edje_calc.c:3896 _edje_part_recalc() Circular dependency when calculating part "longpartname". Already calculating XY [03] axes. Need to calculate Y [02] axes CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ebf60 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 2f736e6f - (unknown) CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ec5d1 !!! Input handle is wrong type. Expected: 98761254 - Eina Stringshare Node Supplied: 5f747261 - (unknown) ``` If string is already stored, `eina_stringshare_add` increase its reference count. Test Plan: test.c ``` //edje_cc test.edc && gcc -o test test.c `pkg-config --libs --cflags elementary` #include int main(int argc, char **argv) { elm_init(argc, argv); Evas_Object *win = elm_win_util_standard_add("test", "test"); Evas_Object *layout = elm_layout_add(win); elm_layout_file_set(layout, "./test.edj", "test"); elm_win_resize_object_add(win, layout); evas_object_show(layout); evas_object_resize(win, 200, 200); evas_object_show(win); elm_run(); elm_shutdown(); return 0; } ``` test.edc ``` collections { group { name: "test"; parts { rect { name: "longpartname"; desc { "default"; rel1.to: "longpartname2"; } } rect { name: "longpartname2"; type: RECT; desc { "default"; rel2.to: "longpartname"; } } } } } ``` Reviewers: SanghyeonLee, zmike Reviewed By: SanghyeonLee Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8717 --- src/lib/edje/edje_calc.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index ffb46c075b..f0380e4fef 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3659,7 +3659,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param1.description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3668,7 +3668,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param1.description->rel2.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3681,7 +3681,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param2->description->rel1.id_x]; if (_circular_dependency_find(ed, ep, rp, arr)) { - eina_array_push(arr, eina_stringshare_ref(rp->part->name)); + eina_array_push(arr, eina_stringshare_add(rp->part->name)); return EINA_TRUE; } } @@ -3690,7 +3690,7 @@ _circular_dependency_find(Edje *ed, Edje_Real_Part *ep, Edje_Real_Part *cep, Ein rp = ed->table_parts[cep->param2->descriptio
[EGIT] [core/efl] master 01/01: ui.relative_layout: fix incorrect type casting
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5b2b75a7f22a59e99e5b284b3b19bc9a42e981d2 commit 5b2b75a7f22a59e99e5b284b3b19bc9a42e981d2 Author: Yeongjong Lee Date: Wed Apr 24 21:09:53 2019 +0900 ui.relative_layout: fix incorrect type casting Summary: `temph` can be double type. Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8695 --- src/lib/elementary/efl_ui_relative_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 827b3d601c..491c52f8af 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -125,7 +125,7 @@ static void _child_aspect_calc(Efl_Ui_Relative_Layout_Child *child, Eina_Bool axis) { Efl_Ui_Relative_Layout_Calc *calc = >calc; - int temph; + double temph; if ((calc->aspect[0] <= 0) || (calc->aspect[1] <= 0)) { --
[EGIT] [core/efl] master 02/02: ui.relative_layout: enhance relation_xxx_set, get apis
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=8c0ab0db425588d6e42a21ee28d8e9d96c32a272 commit 8c0ab0db425588d6e42a21ee28d8e9d96c32a272 Author: Yeongjong Lee Date: Wed Apr 24 20:33:20 2019 +0900 ui.relative_layout: enhance relation_xxx_set,get apis Summary: I forgot `efl_pack_layout_request` after relation_xxx is changed. Unnecessary register function in `relation_xxx_get` will return unexpected result. if a object is not child of relative_layout, `relation_xxx_get` should return `target = NULL` and `relative = 0.0` with error message. Test Plan: make check Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8627 --- src/bin/elementary/test_ui_relative_layout.c | 2 - .../elementary/efl_ui_relative_layout_private.h| 20 +++-- src/tests/elementary/efl_ui_test_relative_layout.c | 51 ++ 3 files changed, 67 insertions(+), 6 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index f1d58af0cd..0e8bcbccd0 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -74,7 +74,6 @@ _btn_clicked_to_cb(void *data, const Efl_Event *event) break; } efl_text_set(obj, ((to == layout) ? "parent" : (char *)efl_text_get(to))); - efl_pack_layout_request(layout); } static void @@ -102,7 +101,6 @@ _slider_changed_relative_cb(void *data, const Efl_Event *event) efl_ui_relative_layout_relation_bottom_set(layout, btn, NULL, val); break; } - efl_pack_layout_request(layout); } static void diff --git a/src/lib/elementary/efl_ui_relative_layout_private.h b/src/lib/elementary/efl_ui_relative_layout_private.h index c58f7b0ecc..e0f2abfee0 100644 --- a/src/lib/elementary/efl_ui_relative_layout_private.h +++ b/src/lib/elementary/efl_ui_relative_layout_private.h @@ -70,23 +70,35 @@ struct _Efl_Ui_Relative_Layout_Child #define EFL_UI_RELATIVE_LAYOUT_RELATION_SET_GET(direction, DIRECTION) \ EOLIAN static void \ - _efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \ + _efl_ui_relative_layout_relation_ ## direction ## _set(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo *target, double relative) \ { \ Efl_Ui_Relative_Layout_Child *rc; \ + if (!child) return; \ rc = _relative_child_get(pd, child); \ + if (!rc) return; \ if (target) rc->rel[DIRECTION].to = target; \ if (relative < 0) relative = 0; \ else if (relative > 1) relative = 1; \ rc->rel[DIRECTION].relative = relative; \ + efl_pack_layout_request(obj); \ } \ \ EOLIAN static void \ _efl_ui_relative_layout_relation_ ## direction ## _get(const Eo *obj EINA_UNUSED, Efl_Ui_Relative_Layout_Data *pd, Eo *child, Eo **target, double *relative) \ { \ Efl_Ui_Relative_Layout_Child *rc; \ - rc = _relative_child_get(pd, child); \ - if (target) *target = rc->rel[DIRECTION].to; \ - if (relative) *relative = rc->rel[DIRECTION].relative; \ + Eo *rel_to = NULL; \ + double rel_relative = 0.0; \ + rc = eina_hash_find(pd->children, ); \ + if (rc) \ +{ \ + rel_to = rc->rel[DIRECTION].to; \ + rel_relative = rc->rel[DIRECTION].relative; \ +} \ + else \ +ERR("child(%p(%s)) is not registered", child, efl_class_name_get(child)); \ + if (target) *target = rel_to; \ + if (relative) *relative = rel_relative; \ } #endif diff --git a/src/tests/elementary/efl_ui_test_relative_layout.c b/src/tests/elementary/efl_ui_test_relative_layout.c index f769bf47ec..3027bdb082 100644 --- a/src/tests/elementary/efl_ui_test_relative_layout.c +++ b/src/tests/elementary/efl_ui_test_relative_layout.c @@ -292,10 +292,61 @@ EFL_START_TEST (efl_ui_relative_layout_layout_update_chain) } EFL_END_TEST +EFL_START_TEST (efl_ui_relative_layout_relation_set) +{ + Eo *btn; + Eo *target = NULL; + double relative; + + btn = efl_add(EFL_UI_BUTTON_CLASS, layout); + + // negative test + efl_ui_relative_layout_relation_top_get(layout, NULL, , ); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + efl_ui_relative_layout_relation_top_get(layout, btn, , ); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + efl_ui_relative_layout_relation_top_set(layout, NULL, NULL, 0.0); + ck_assert_ptr_eq(target, NULL); + ck_assert(EINA_DBL_EQ(relative, 0.0)); + + // default value test + efl_ui_relative_layout_relation_top_set(layout, btn, layout, 0.0); + + efl_
[EGIT] [core/efl] master 01/02: ui.relative_layout: add callbacks to update layout
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=9b87eaee0884f55899a05d271b098b8b3e11c221 commit 9b87eaee0884f55899a05d271b098b8b3e11c221 Author: Yeongjong Lee Date: Wed Apr 24 20:32:45 2019 +0900 ui.relative_layout: add callbacks to update layout Summary: If the size or hints of a child changes, relative_layout need to update layout. And, if a child is deleted, it should be unregisterd from relative_layout. Depends on D8625 Test Plan: elementary_test -to 'efl.ui.relative_layout' Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8626 --- src/bin/elementary/test_ui_relative_layout.c | 2 -- src/lib/elementary/efl_ui_relative_layout.c | 37 +++- 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index dbb1647eee..f1d58af0cd 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -120,8 +120,6 @@ _slider_changed_align_cb(void *data, const Efl_Event *event) efl_gfx_hint_align_set(btn, val, y); else if (opt == 'y') efl_gfx_hint_align_set(btn, x, val); - - efl_pack_layout_request(layout); } static void diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 17bf97d8b5..827b3d601c 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -24,6 +24,40 @@ _chain_sort_cb(const void *l1, const void *l2) return calc2->comp_factor <= calc1->comp_factor ? -1 : 1; } +static void +_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + efl_pack_layout_request(pd->obj); +} + +static void +_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + efl_pack_layout_request(pd->obj); +} + +static void +_on_child_del(void *data, const Efl_Event *event) +{ + Efl_Ui_Relative_Layout_Data *pd = data; + + if (eina_hash_del_by_key(pd->children, >object)) + efl_pack_layout_request(pd->obj); + else + ERR("child(%p(%s)) is not registered", event->object, + efl_class_name_get(event->object)); +} + +EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_relative_layout_callbacks, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed }, + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed }, + { EFL_EVENT_DEL, _on_child_del } +); + static Efl_Ui_Relative_Layout_Child * _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) { @@ -48,6 +82,7 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) efl_key_data_set(child, "_elm_leaveme", pd->obj); efl_canvas_object_clipper_set(child, pd->clipper); + efl_event_callback_array_add(child, efl_ui_relative_layout_callbacks(), pd); efl_canvas_group_member_add(pd->obj, child); efl_canvas_group_change(pd->obj); @@ -539,7 +574,7 @@ _efl_ui_relative_layout_unregister(Eo *obj, Efl_Ui_Relative_Layout_Data *pd, Efl efl_canvas_group_member_remove(obj, child); efl_canvas_object_clipper_set(child, NULL); efl_key_data_set(child, "_elm_leaveme", NULL); - +efl_event_callback_array_del(child, efl_ui_relative_layout_callbacks(), pd); efl_pack_layout_request(obj); } else --
[EGIT] [core/efl] master 01/01: ui.relative_layout: add internal clipper
jaehyun pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=336500469ae2b2d2d4655cf5361d13612b8874b3 commit 336500469ae2b2d2d4655cf5361d13612b8874b3 Author: Yeongjong Lee Date: Wed Apr 24 20:23:52 2019 +0900 ui.relative_layout: add internal clipper Summary: If there is no clipper of container, color_set and clipper_set api won't work. Test Plan: 1. elementary_test -to 'efl.ui.relative_layout' 2. Click button1 3. check that buttons color are changed. Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8625 --- src/bin/elementary/test_ui_relative_layout.c | 16 +++ src/lib/elementary/efl_ui_relative_layout.c| 117 - .../elementary/efl_ui_relative_layout_private.h| 2 + 3 files changed, 87 insertions(+), 48 deletions(-) diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index e6481ec97e..dbb1647eee 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -15,6 +15,21 @@ typedef enum { BOTTOM } Options; +static void +_btn_color_clicked_cb(void *data, const Efl_Event *event EINA_UNUSED) +{ + Eo *layout = data; + + static Eina_Bool changed = EINA_TRUE; + + if (changed) + efl_gfx_color_set(layout, 0, 88, 204, 255); + else + efl_gfx_color_set(layout, 255, 255, 255, 255); + + changed = !changed; +} + static void _btn_clicked_to_cb(void *data, const Efl_Event *event) { @@ -297,6 +312,7 @@ test_ui_relative_layout(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo btn1 = efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "button1"), efl_gfx_hint_align_set(efl_added, 0.0, 0.0), + efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_color_clicked_cb, layout), efl_ui_relative_layout_relation_right_set(layout, efl_added, layout, 0.0), efl_ui_relative_layout_relation_bottom_set(layout, efl_added, layout, 0.0)); diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index 66bedb87ef..17bf97d8b5 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -29,6 +29,9 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) { Efl_Ui_Relative_Layout_Child *rc; + if (!efl_ui_widget_sub_object_add(pd->obj, child)) + return NULL; + rc = calloc(1, sizeof(Efl_Ui_Relative_Layout_Child)); if (!rc) return NULL; @@ -43,19 +46,10 @@ _efl_ui_relative_layout_register(Efl_Ui_Relative_Layout_Data *pd, Eo *child) rc->rel[BOTTOM].to = rc->layout; rc->rel[BOTTOM].relative = 1.0; - if (pd->obj == child) - { -rc->calc.state[0] = RELATIVE_CALC_DONE; -rc->calc.state[1] = RELATIVE_CALC_DONE; -rc->calc.chain_state[0] = RELATIVE_CALC_DONE; -rc->calc.chain_state[1] = RELATIVE_CALC_DONE; - } - else - { -efl_ui_widget_sub_object_add(pd->obj, child); -efl_canvas_group_member_add(pd->obj, child); -efl_canvas_group_change(pd->obj); - } + efl_key_data_set(child, "_elm_leaveme", pd->obj); + efl_canvas_object_clipper_set(child, pd->clipper); + efl_canvas_group_member_add(pd->obj, child); + efl_canvas_group_change(pd->obj); eina_hash_add(pd->children, , rc); @@ -75,13 +69,19 @@ _relative_child_get(Efl_Ui_Relative_Layout_Data *pd, Eo *child) } static Efl_Ui_Relative_Layout_Child * -_relative_child_find(const Eina_Hash *children, Eo *target) +_relative_child_find(Efl_Ui_Relative_Layout_Data *pd, Eo *target) { Efl_Ui_Relative_Layout_Child *child; - child = eina_hash_find(children, ); + if (pd->obj == target) + return pd->base; + + child = eina_hash_find(pd->children, ); if (!child) - ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target)); + { +ERR("target(%p(%s)) is not registered", target, efl_class_name_get(target)); +child = pd->base; + } return child; } @@ -353,9 +353,6 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E Efl_Ui_Relative_Layout_Child *child = data; Eina_Rect want; - if (child->obj == child->layout) - return EINA_TRUE; - _child_calc(child, 0); _child_calc(child, 1); @@ -370,35 +367,18 @@ _hash_child_calc_foreach_cb(const Eina_Hash *hash EINA_UNUSED, const void *key E static Eina_Bool -_hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED, -void *data, void *fd
[EGIT] [core/efl] master 02/02: ui.table: remove leagcy evas_table from Efl.Ui.Table
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=3e495010431e75afa12452d27c649bbf8b2b9bf9 commit 3e495010431e75afa12452d27c649bbf8b2b9bf9 Author: Yeongjong Lee Date: Thu Apr 18 08:22:44 2019 + ui.table: remove leagcy evas_table from Efl.Ui.Table Remove evas_table. This expect to improve performance by removing internal function call related evas_table. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8615 --- src/lib/elementary/efl_ui_table.c | 729 +++--- src/lib/elementary/efl_ui_table.eo| 3 +- src/lib/elementary/efl_ui_table_layout.c | 18 +- src/lib/elementary/efl_ui_table_private.h | 13 +- src/tests/elementary/efl_ui_test_table.c | 152 ++- 5 files changed, 545 insertions(+), 370 deletions(-) diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 7a11f2fb71..402b812bc8 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -1,136 +1,153 @@ #include "efl_ui_table_private.h" -#include "../evas/canvas/evas_table_eo.h" - #define MY_CLASS EFL_UI_TABLE_CLASS #define MY_CLASS_NAME "Efl.Ui.Table" -#define MY_CLASS_NAME_LEGACY "elm_grid" - -typedef struct _Custom_Table_Data Custom_Table_Data; - -static void _subobj_del_cb(void *data, const Efl_Event *event); -static void _item_remove(Efl_Ui_Table *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj); - -struct _Custom_Table_Data -{ - Efl_Ui_Table *parent; - Efl_Ui_Table_Data *gd; -}; -EFL_CALLBACKS_ARRAY_DEFINE(subobj_callbacks, - { EFL_EVENT_DEL, _subobj_del_cb }); +#define EFL_UI_TABLE_DATA_GET(o, pd) \ + Efl_Ui_Table_Data *pd = efl_data_scope_get(o, EFL_UI_TABLE_CLASS) -static void -_mirrored_set(Evas_Object *obj, Eina_Bool rtl) +inline static Table_Item * +_efl_ui_table_item_date_get(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj) { - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - evas_object_table_mirrored_set(wd->resize_obj, rtl); + Table_Item *gi; + if (!efl_invalidated_get(subobj) && + (obj != efl_canvas_object_render_parent_get(subobj))) + { +ERR("%p is not a child of %p", subobj, obj); +return NULL; + } + gi = efl_key_data_get(subobj, TABLE_ITEM_KEY); + if (!gi) + { +WRN("item %p has no table internal data", subobj); +EINA_INLIST_FOREACH(EINA_INLIST_GET(pd->items), gi) + { + if (gi->object == subobj) + break; + } +if (!gi) + { + ERR("item %p was not found in this table", subobj); + return NULL; + } + } + return gi; } -EOLIAN static Eina_Error -_efl_ui_table_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED) +static void +_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Eina_Error int_ret = EFL_UI_THEME_APPLY_ERROR_GENERIC; - int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); - if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; - - _mirrored_set(obj, efl_ui_mirrored_get(obj)); - - return int_ret; + Eo *table = data; + efl_pack_layout_request(table); } static void -_layout_updated_emit(Efl_Ui_Table *obj) +_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) { - efl_event_callback_legacy_call(obj, EFL_PACK_EVENT_LAYOUT_UPDATED, NULL); + Eo *table = data; + efl_pack_layout_request(table); } static void -_sizing_eval(Evas_Object *obj, Efl_Ui_Table_Data *pd EINA_UNUSED) +_on_child_del(void *data, const Efl_Event *event) { - Evas_Coord minw = 0, minh = 0, maxw = -1, maxh = -1; - Evas_Coord w, h; - - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - if (!efl_alive_get(obj)) return; + Eo *table = data; + Table_Item *gi; + EFL_UI_TABLE_DATA_GET(table, pd); - evas_object_size_hint_combined_min_get(wd->resize_obj, , ); - evas_object_size_hint_max_get(wd->resize_obj, , ); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, maxw, maxh); - evas_object_geometry_get(obj, NULL, NULL, , ); - if (w < minw) w = minw; - if (h < minh) h = minh; - if ((maxw >= 0) && (w > maxw)) w = maxw; - if ((maxh >= 0) && (h > maxh)) h = maxh; - evas_object_resize(obj, w, h); -} + gi = _efl_ui_table_item_date_get(table, pd, event->object); + if (!gi) return; -static void -_table_size_hints_changed(void *data, Evas *e EINA_UNUSED, - Evas_Object *table EINA_UNUSED, - void *event_info EINA_UNUSED) -{ - Efl_Ui_Table_Data *pd = efl_data_scope_get(data, MY_CLASS); + pd->items = (Table_Item *) + eina_inlist_remove(EINA_INLIST_GET(pd->items)
[EGIT] [core/efl] master 01/02: ui.relative_layout: replace evas_object_event_callback_xxx with efl_event_callback_xxx
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ef3281c924533e083fab9f71e3d459e7087a7da1 commit ef3281c924533e083fab9f71e3d459e7087a7da1 Author: Yeongjong Lee Date: Wed Apr 17 08:24:25 2019 + ui.relative_layout: replace evas_object_event_callback_xxx with efl_event_callback_xxx remove legacy function Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8630 --- src/lib/elementary/efl_ui_relative_layout.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_relative_layout.c b/src/lib/elementary/efl_ui_relative_layout.c index fa47d7591c..66bedb87ef 100644 --- a/src/lib/elementary/efl_ui_relative_layout.c +++ b/src/lib/elementary/efl_ui_relative_layout.c @@ -446,10 +446,9 @@ _hash_child_init_foreach_cb(const Eina_Hash *hash, const void *key EINA_UNUSED, } static void -_on_size_hints_changed(void *data EINA_UNUSED, Evas *e EINA_UNUSED, - Evas_Object *obj, void *event_info EINA_UNUSED) +_efl_ui_relative_layout_hints_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev) { - efl_pack_layout_request(obj); + efl_pack_layout_request(ev->object); } EOLIAN static void @@ -490,7 +489,8 @@ _efl_ui_relative_layout_efl_gfx_entity_position_set(Eo *obj, Efl_Ui_Relative_Lay EOLIAN static void _efl_ui_relative_layout_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Relative_Layout_Data *pd EINA_UNUSED) { - evas_object_event_callback_add(obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _on_size_hints_changed, NULL); + efl_event_callback_add(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_relative_layout_hints_changed_cb, NULL); efl_canvas_group_add(efl_super(obj, MY_CLASS)); elm_widget_highlight_ignore_set(obj, EINA_TRUE); @@ -514,6 +514,8 @@ _efl_ui_relative_layout_efl_object_constructor(Eo *obj, Efl_Ui_Relative_Layout_D EOLIAN static void _efl_ui_relative_layout_efl_object_destructor(Eo *obj, Efl_Ui_Relative_Layout_Data *pd) { + efl_event_callback_del(obj, EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, + _efl_ui_relative_layout_hints_changed_cb, NULL); eina_hash_free(pd->children); efl_destructor(efl_super(obj, MY_CLASS)); } --
[EGIT] [core/efl] master 02/04: efl/elm_scroller: apply color_set correctly
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=92a4aea61fae9848e057f8aa197f3f50108f7185 commit 92a4aea61fae9848e057f8aa197f3f50108f7185 Author: Yeongjong Lee Date: Wed Apr 17 08:15:15 2019 + efl/elm_scroller: apply color_set correctly hit_rect/event_rect should ignore color_set. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8629 --- src/lib/elementary/efl_ui_scroll_manager.c | 1 + src/lib/elementary/elm_scroller.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_scroll_manager.c b/src/lib/elementary/efl_ui_scroll_manager.c index e58aa874fb..a6bf0cda22 100644 --- a/src/lib/elementary/efl_ui_scroll_manager.c +++ b/src/lib/elementary/efl_ui_scroll_manager.c @@ -2418,6 +2418,7 @@ _efl_ui_scroll_manager_efl_object_constructor(Eo *obj, Efl_Ui_Scroll_Manager_Dat sd->scrolling = EINA_FALSE; sd->event_rect = evas_object_rectangle_add(evas_object_evas_get(sd->parent)); + efl_key_data_set(sd->event_rect, "_elm_leaveme", obj); efl_canvas_group_member_add(sd->parent, sd->event_rect); efl_ui_widget_sub_object_add(sd->parent, sd->event_rect); diff --git a/src/lib/elementary/elm_scroller.c b/src/lib/elementary/elm_scroller.c index 6a1e3291b7..1eec6d866e 100644 --- a/src/lib/elementary/elm_scroller.c +++ b/src/lib/elementary/elm_scroller.c @@ -785,6 +785,7 @@ _elm_scroller_efl_canvas_group_group_add(Eo *obj, Elm_Scroller_Data *priv) CRI("Failed to set layout!"); priv->hit_rect = evas_object_rectangle_add(evas_object_evas_get(obj)); + evas_object_data_set(priv->hit_rect, "_elm_leaveme", obj); evas_object_smart_member_add(priv->hit_rect, obj); elm_widget_sub_object_add(obj, priv->hit_rect); --
[EGIT] [core/efl] master 01/04: ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=41136db8e8adb02ce7f99c929e25b56cda2caf9e commit 41136db8e8adb02ce7f99c929e25b56cda2caf9e Author: Yeongjong Lee Date: Fri Apr 12 05:38:00 2019 + ui.widget: remove elm_widget_sub_object_parent_add from each of widgets since commit a1addad60e, To add myself as a sub object of parent object will be done in Efl.Ui.Widget constructor. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8280 --- src/lib/elementary/efl_ui_alert_popup.c| 2 -- src/lib/elementary/efl_ui_anchor_popup.c | 2 -- src/lib/elementary/efl_ui_bg.c | 1 - src/lib/elementary/efl_ui_box.c| 1 - src/lib/elementary/efl_ui_button.c | 1 - src/lib/elementary/efl_ui_calendar.c | 2 -- src/lib/elementary/efl_ui_clock.c | 1 - src/lib/elementary/efl_ui_datepicker.c | 2 -- src/lib/elementary/efl_ui_flip.c | 1 - src/lib/elementary/efl_ui_frame.c | 1 - src/lib/elementary/efl_ui_image.c | 1 - src/lib/elementary/efl_ui_image_zoomable.c | 2 -- src/lib/elementary/efl_ui_layout.c | 2 -- src/lib/elementary/efl_ui_list_view.c | 1 - src/lib/elementary/efl_ui_navigation_bar.c | 2 -- src/lib/elementary/efl_ui_navigation_layout.c | 2 -- src/lib/elementary/efl_ui_nstate.c | 1 - src/lib/elementary/efl_ui_pager.c | 2 -- src/lib/elementary/efl_ui_panel.c | 1 - src/lib/elementary/efl_ui_panes.c | 1 - src/lib/elementary/efl_ui_popup.c | 2 -- src/lib/elementary/efl_ui_progressbar.c| 1 - src/lib/elementary/efl_ui_relative_layout.c| 1 - src/lib/elementary/efl_ui_scroll_alert_popup.c | 2 -- src/lib/elementary/efl_ui_slider.c | 1 - src/lib/elementary/efl_ui_spin.c | 2 -- src/lib/elementary/efl_ui_spin_button.c| 1 - src/lib/elementary/efl_ui_tab_bar.c| 3 --- src/lib/elementary/efl_ui_tab_page.c | 3 --- src/lib/elementary/efl_ui_tab_pager.c | 1 - src/lib/elementary/efl_ui_table.c | 2 -- src/lib/elementary/efl_ui_tags.c | 1 - src/lib/elementary/efl_ui_text.c | 2 -- src/lib/elementary/efl_ui_text_alert_popup.c | 2 -- src/lib/elementary/efl_ui_textpath.c | 1 - src/lib/elementary/efl_ui_timepicker.c | 2 -- src/lib/elementary/efl_ui_video.c | 1 - src/lib/elementary/efl_ui_widget.c | 10 +- src/lib/elementary/elc_combobox.c | 1 - src/lib/elementary/elc_ctxpopup.c | 1 - src/lib/elementary/elc_fileselector.c | 1 - src/lib/elementary/elc_fileselector_button.c | 1 - src/lib/elementary/elc_fileselector_entry.c| 1 - src/lib/elementary/elc_hoversel.c | 1 - src/lib/elementary/elc_multibuttonentry.c | 1 - src/lib/elementary/elc_naviframe.c | 1 - src/lib/elementary/elc_player.c| 1 - src/lib/elementary/elc_popup.c | 1 - src/lib/elementary/elm_access.c| 1 - src/lib/elementary/elm_actionslider.c | 1 - src/lib/elementary/elm_box.c | 1 - src/lib/elementary/elm_bubble.c| 1 - src/lib/elementary/elm_calendar.c | 1 - src/lib/elementary/elm_clock.c | 1 - src/lib/elementary/elm_colorselector.c | 1 - src/lib/elementary/elm_conform.c | 1 - src/lib/elementary/elm_dayselector.c | 1 - src/lib/elementary/elm_diskselector.c | 2 -- src/lib/elementary/elm_entry.c | 1 - src/lib/elementary/elm_flipselector.c | 1 - src/lib/elementary/elm_gengrid.c | 1 - src/lib/elementary/elm_genlist.c | 1 - src/lib/elementary/elm_gesture_layer.c | 1 - src/lib/elementary/elm_glview.c| 2 -- src/lib/elementary/elm_grid.c | 2 -- src/lib/elementary/elm_hover.c | 1 - src/lib/elementary/elm_icon.c | 1 - src/lib/elementary/elm_index.c | 1 - src/lib/elementary/elm_inwin.c | 1 - src/lib/elementary/elm_label.c | 2 -- src/lib/elementary/elm_list.c | 1 - src/lib/elementary/elm_map.c | 2 -- src/lib/elementary/elm_mapbuf.c| 1 - src/lib/elementary/elm_menu.c | 1 - src/lib/elementary/elm_notify.c| 1 - src/lib/elementary/elm_panel.c | 1 - src/lib/elementary/elm_photo.c | 1 - src/lib/elementary/elm_plug.c | 1 - src/lib/elementary/elm_prefs.c | 1 - src/lib/elementary/elm_route.c | 1
[EGIT] [core/efl] efl-1.22 33/57: efl_ui_widget: avoid calling null parent
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=4e082a6be09dcdf6d0a0fa69e8ce2c1c3d3906be commit 4e082a6be09dcdf6d0a0fa69e8ce2c1c3d3906be Author: Yeongjong Lee Date: Fri Apr 12 09:12:51 2019 +0200 efl_ui_widget: avoid calling null parent Summary: This will fix unnecessary warnings on P280. Thanks to segfaultxavi for reporting. ref T7796 Reviewers: zmike, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7796 Differential Revision: https://phab.enlightenment.org/D8599 --- src/lib/elementary/efl_ui_widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index c56990f8b3..99da93aa3b 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1421,7 +1421,6 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg */ double scale, prev_scale = efl_gfx_entity_scale_get(obj); Elm_Theme *th, *prev_th = elm_widget_theme_get(obj); - Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(parent); int disabled_delta = pd->disabled - (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0); old_parent = pd->parent_obj; @@ -1430,6 +1429,7 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg // now lets sync up all states if (pd->parent_obj) { +Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(pd->parent_obj); scale = efl_gfx_entity_scale_get(obj); th = elm_widget_theme_get(obj); mirrored = efl_ui_mirrored_get(obj); --
[EGIT] [core/efl] efl-1.22 37/57: gitignore: add elm_default_config.x
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=5f603394d25f7b78758c4e4b37128ee615e066a7 commit 5f603394d25f7b78758c4e4b37128ee615e066a7 Author: Yeongjong Lee Date: Mon Apr 15 13:07:54 2019 +0200 gitignore: add elm_default_config.x Summary: elm_default_config.x is created by build script. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8605 --- src/lib/elementary/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/.gitignore b/src/lib/elementary/.gitignore index 9076648525..0a04d8032d 100644 --- a/src/lib/elementary/.gitignore +++ b/src/lib/elementary/.gitignore @@ -9,4 +9,4 @@ /eldbus_elementary_colorclass.c /eldbus_elementary_colorclass.h /eldbus_utils.h - +/elm_default_config.x --
[EGIT] [core/efl] efl-1.22 51/57: efl.pack_linear: Clarify behavior and docs
zmike pushed a commit to branch efl-1.22. http://git.enlightenment.org/core/efl.git/commit/?id=e6cb121dc0324f2f050354160b9271d94ab5932d commit e6cb121dc0324f2f050354160b9271d94ab5932d Author: Yeongjong Lee Date: Fri Apr 12 07:03:28 2019 + efl.pack_linear: Clarify behavior and docs Some APIs accept both positive and negative indices when accessing items. This patch changes the documentation for the lower limit from `-(count - 1)` to `-count` to allow accessing the very first item. For example (content_count = 5): | |first item| | | |last item| |positive index| 0 | 1| 2| 3|4| |negative index| -5 |-4|-3|-2| -1| If negative indices are limited to be >= -4 the first item cannot be accessed using negative indices. Also, range limit of `pack_at` is removed for usability. Reviewed-by: Marcel Hollerbach Reviewed-by: YeongJong Lee Differential Revision: https://phab.enlightenment.org/D8433 --- src/lib/efl/interfaces/efl_pack_linear.eo | 62 ++- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/src/lib/efl/interfaces/efl_pack_linear.eo b/src/lib/efl/interfaces/efl_pack_linear.eo index 423c6cbb6c..b82cee842f 100644 --- a/src/lib/efl/interfaces/efl_pack_linear.eo +++ b/src/lib/efl/interfaces/efl_pack_linear.eo @@ -13,12 +13,12 @@ interface @beta Efl.Pack_Linear extends Efl.Pack container without deleting it. ]] params { -@in subobj: Efl.Gfx.Entity; [[Item to pack.]] +@in subobj: Efl.Gfx.Entity; [[Item to pack at the beginning.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_end { - [[Append object at the end of this container. + [[Append item at the end of this container. This is the same as @.pack_at($subobj, -1). @@ -29,7 +29,7 @@ interface @beta Efl.Pack_Linear extends Efl.Pack params { @in subobj: Efl.Gfx.Entity; [[Item to pack at the end.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_before { [[Prepend item before other sub object. @@ -60,46 +60,72 @@ interface @beta Efl.Pack_Linear extends Efl.Pack could not be packed.]] } pack_at { - [[Inserts $subobj at the specified $index. + [[Inserts $subobj BEFORE the item at position $index. -Valid range: -$count to +$count. -1 refers to the last element. -Out of range indices will trigger an append. +$index ranges from -$count to $count-1, where positive numbers go +from first item (0) to last item ($count-1), and negative numbers go +from last item (-1) to first item (-$count). Where $count is +the number of items currently in the container. + +If $index is less than -$count, it will trigger @.pack_begin($subobj) +whereas $index greater than $count-1 will trigger @.pack_end($subobj). When this container is deleted, it will request deletion of the given $subobj. Use @Efl.Pack.unpack to remove $subobj from this container without deleting it. ]] params { - @in subobj: Efl.Gfx.Entity; [[Item to pack at given index.]] - @in index: int; [[A position.]] + @in subobj: Efl.Gfx.Entity; [[Item to pack.]] + @in index: int; [[Index of item to insert BEFORE. +Valid range is -$count to ($count-1). + ]] } return: bool; [[$false if $subobj could not be packed.]] } pack_content_get { - [[Content at a given index in this container. + [[Content at a given $index in this container. + + $index ranges from -$count to $count-1, where positive numbers go + from first item (0) to last item ($count-1), and negative numbers go + from last item (-1) to first item (-$count). Where $count is + the number of items currently in the container. - Index -1 refers to the last item. The valid range is -(count - 1) to - (count - 1). + If $index is less than -$count, it will return the first item + whereas $index greater than $count-1 will return the last item. ]] params { -index: int; [[Index number]] +@in index: int; [[Index of the item to retrieve. + Valid range is -$count to ($count-1). +]] } return: Efl.Gfx.Entity; [[The object contained at the given $index.]] } pack_index_
[EGIT] [core/efl] master 02/09: ui.box: remove leagcy evas_box from Efl.Ui.Box
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d5445918ec9fd5f6399ed7c4649df9ac72c2be85 commit d5445918ec9fd5f6399ed7c4649df9ac72c2be85 Author: Yeongjong Lee Date: Fri Apr 12 10:18:04 2019 + ui.box: remove leagcy evas_box from Efl.Ui.Box Remove legacy stuff from Efl.Ui.Box. This expect to improve performance by removing internal function call related evas_box. Reviewed-by: Xavi Artigas Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8417 --- src/lib/elementary/efl_ui_box.c | 476 src/lib/elementary/efl_ui_box.eo| 2 + src/lib/elementary/efl_ui_box_flow.c| 28 +- src/lib/elementary/efl_ui_box_layout.c | 13 +- src/lib/elementary/efl_ui_box_private.h | 20 +- src/lib/elementary/efl_ui_box_stack.c | 14 +- src/tests/elementary/efl_ui_test_box.c | 152 +- 7 files changed, 348 insertions(+), 357 deletions(-) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index eec5a645d8..5e33ed8602 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -7,86 +7,94 @@ * - removed transition stuff (TODO: add back - needs clean API first) */ -static const char SIG_CHILD_ADDED[] = "child,added"; -static const char SIG_CHILD_REMOVED[] = "child,removed"; -static const Evas_Smart_Cb_Description _smart_callbacks[] = { - {SIG_CHILD_ADDED, ""}, - {SIG_CHILD_REMOVED, ""}, - {NULL, NULL} -}; +#define EFL_UI_BOX_DATA_GET(o, sd) \ + Efl_Ui_Box_Data *sd = efl_data_scope_get(o, EFL_UI_BOX_CLASS) + +void _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Efl_Ui_Box_Data *pd); static void -_child_added_cb_proxy(void *data, const Efl_Event *event) +_on_child_size_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Evas_Object *box = data; - Evas_Object_Box_Option *opt = event->info; - - efl_event_callback_legacy_call(box, EFL_CONTAINER_EVENT_CONTENT_ADDED, opt->obj); + Eo *box = data; + efl_pack_layout_request(box); } static void -_child_removed_cb_proxy(void *data, const Efl_Event *event) +_on_child_del(void *data, const Efl_Event *event) { - Evas_Object *box = data; - Evas_Object *child = event->info; + Eo *box = data; + EFL_UI_BOX_DATA_GET(box, sd); - efl_event_callback_legacy_call(box, EFL_CONTAINER_EVENT_CONTENT_REMOVED, child); + sd->children = eina_list_remove(sd->children, event->object); + + efl_pack_layout_request(box); } static void -_sizing_eval(Evas_Object *obj, Efl_Ui_Box_Data *sd) +_on_child_hints_changed(void *data, const Efl_Event *event EINA_UNUSED) { - Evas_Coord minw = -1, minh = -1, maxw = -1, maxh = -1; - Evas_Coord w, h; + Eo *box = data; + efl_pack_layout_request(box); +} - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); +EFL_CALLBACKS_ARRAY_DEFINE(efl_ui_box_callbacks, + { EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _on_child_size_changed }, + { EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _on_child_hints_changed }, + { EFL_EVENT_DEL, _on_child_del } +); - if (!efl_alive_get(obj)) return; - if (sd->delete_me) - return; +static inline Eina_Bool +_efl_ui_box_child_register(Eo *obj, Efl_Ui_Box_Data *pd, Efl_Gfx_Entity *subobj) +{ + if (!subobj || (efl_canvas_object_render_parent_get(subobj) == obj)) + return EINA_FALSE; - evas_object_size_hint_combined_min_get(wd->resize_obj, , ); - evas_object_size_hint_max_get(wd->resize_obj, , ); - evas_object_size_hint_min_set(obj, minw, minh); - evas_object_size_hint_max_set(obj, maxw, maxh); + if (!efl_ui_widget_sub_object_add(obj, subobj)) + return EINA_FALSE; - evas_object_geometry_get(obj, NULL, NULL, , ); - if (w < minw) w = minw; - if (h < minh) h = minh; - if ((maxw >= 0) && (w > maxw)) w = maxw; - if ((maxh >= 0) && (h > maxh)) h = maxh; - evas_object_resize(obj, w, h); + efl_key_data_set(subobj, "_elm_leaveme", obj); + efl_canvas_group_member_add(obj, subobj); + efl_canvas_object_clipper_set(subobj, pd->clipper); + efl_pack_layout_request(obj); + + efl_event_callback_array_add(subobj, efl_ui_box_callbacks(), obj); + efl_event_callback_call(obj, EFL_CONTAINER_EVENT_CONTENT_ADDED, subobj); + + return EINA_TRUE; } -static void -_on_size_hints_changed(void *data, Evas *e EINA_UNUSED, - Evas_Object *resizeobj, void *event_info EINA_UNUSED) +static inline Eina_Bool +_efl_ui_box_child_unregister(Eo *obj, Efl_Ui_Box_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) { - Efl_Ui_Box *obj = data; - Efl_Ui_Box_Data *pd = efl_data_scope_get(obj, EFL_UI_BOX_CLASS); + if (!subobj || !_elm_widget_sub_object_redirect_to_top(obj, subobj)) + return EINA_FALSE; + + efl_canvas_group_member_remove(obj, subobj); + efl_canvas_object_clipper_set(subobj, NULL); + efl_key_d
[EGIT] [core/efl] master 01/09: efl.pack_linear: Clarify behavior and docs
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=058535528259a6992ba37404d70df41aa92a5330 commit 058535528259a6992ba37404d70df41aa92a5330 Author: Yeongjong Lee Date: Fri Apr 12 07:03:28 2019 + efl.pack_linear: Clarify behavior and docs Some APIs accept both positive and negative indices when accessing items. This patch changes the documentation for the lower limit from `-(count - 1)` to `-count` to allow accessing the very first item. For example (content_count = 5): | |first item| | | |last item| |positive index| 0 | 1| 2| 3|4| |negative index| -5 |-4|-3|-2| -1| If negative indices are limited to be >= -4 the first item cannot be accessed using negative indices. Also, range limit of `pack_at` is removed for usability. Reviewed-by: Marcel Hollerbach Reviewed-by: YeongJong Lee Differential Revision: https://phab.enlightenment.org/D8433 --- src/lib/efl/interfaces/efl_pack_linear.eo | 62 ++- 1 file changed, 44 insertions(+), 18 deletions(-) diff --git a/src/lib/efl/interfaces/efl_pack_linear.eo b/src/lib/efl/interfaces/efl_pack_linear.eo index 423c6cbb6c..b82cee842f 100644 --- a/src/lib/efl/interfaces/efl_pack_linear.eo +++ b/src/lib/efl/interfaces/efl_pack_linear.eo @@ -13,12 +13,12 @@ interface @beta Efl.Pack_Linear extends Efl.Pack container without deleting it. ]] params { -@in subobj: Efl.Gfx.Entity; [[Item to pack.]] +@in subobj: Efl.Gfx.Entity; [[Item to pack at the beginning.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_end { - [[Append object at the end of this container. + [[Append item at the end of this container. This is the same as @.pack_at($subobj, -1). @@ -29,7 +29,7 @@ interface @beta Efl.Pack_Linear extends Efl.Pack params { @in subobj: Efl.Gfx.Entity; [[Item to pack at the end.]] } - return: bool; [[$false if $subobj could not be packed]] + return: bool; [[$false if $subobj could not be packed.]] } pack_before { [[Prepend item before other sub object. @@ -60,46 +60,72 @@ interface @beta Efl.Pack_Linear extends Efl.Pack could not be packed.]] } pack_at { - [[Inserts $subobj at the specified $index. + [[Inserts $subobj BEFORE the item at position $index. -Valid range: -$count to +$count. -1 refers to the last element. -Out of range indices will trigger an append. +$index ranges from -$count to $count-1, where positive numbers go +from first item (0) to last item ($count-1), and negative numbers go +from last item (-1) to first item (-$count). Where $count is +the number of items currently in the container. + +If $index is less than -$count, it will trigger @.pack_begin($subobj) +whereas $index greater than $count-1 will trigger @.pack_end($subobj). When this container is deleted, it will request deletion of the given $subobj. Use @Efl.Pack.unpack to remove $subobj from this container without deleting it. ]] params { - @in subobj: Efl.Gfx.Entity; [[Item to pack at given index.]] - @in index: int; [[A position.]] + @in subobj: Efl.Gfx.Entity; [[Item to pack.]] + @in index: int; [[Index of item to insert BEFORE. +Valid range is -$count to ($count-1). + ]] } return: bool; [[$false if $subobj could not be packed.]] } pack_content_get { - [[Content at a given index in this container. + [[Content at a given $index in this container. + + $index ranges from -$count to $count-1, where positive numbers go + from first item (0) to last item ($count-1), and negative numbers go + from last item (-1) to first item (-$count). Where $count is + the number of items currently in the container. - Index -1 refers to the last item. The valid range is -(count - 1) to - (count - 1). + If $index is less than -$count, it will return the first item + whereas $index greater than $count-1 will return the last item. ]] params { -index: int; [[Index number]] +@in index: int; [[Index of the item to retrieve. + Valid range is -$count to ($count-1). +]] } return: Efl.Gfx.Entity; [[The object contained at the given $index.]] } pack_index_
[EGIT] [core/efl] master 01/01: gitignore: add elm_default_config.x
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=7ded9453233732c083e8d307089d22cbde5624d7 commit 7ded9453233732c083e8d307089d22cbde5624d7 Author: Yeongjong Lee Date: Mon Apr 15 13:07:54 2019 +0200 gitignore: add elm_default_config.x Summary: elm_default_config.x is created by build script. Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8605 --- src/lib/elementary/.gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/.gitignore b/src/lib/elementary/.gitignore index 9076648525..0a04d8032d 100644 --- a/src/lib/elementary/.gitignore +++ b/src/lib/elementary/.gitignore @@ -9,4 +9,4 @@ /eldbus_elementary_colorclass.c /eldbus_elementary_colorclass.h /eldbus_utils.h - +/elm_default_config.x --
[EGIT] [core/efl] master 01/01: efl_ui_widget: avoid calling null parent
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=48c27364fce82e2bb7743d2e4bd5d29863c7f57d commit 48c27364fce82e2bb7743d2e4bd5d29863c7f57d Author: Yeongjong Lee Date: Fri Apr 12 09:12:51 2019 +0200 efl_ui_widget: avoid calling null parent Summary: This will fix unnecessary warnings on P280. Thanks to segfaultxavi for reporting. ref T7796 Reviewers: zmike, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7796 Differential Revision: https://phab.enlightenment.org/D8599 --- src/lib/elementary/efl_ui_widget.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index c56990f8b3..99da93aa3b 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1421,7 +1421,6 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg */ double scale, prev_scale = efl_gfx_entity_scale_get(obj); Elm_Theme *th, *prev_th = elm_widget_theme_get(obj); - Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(parent); int disabled_delta = pd->disabled - (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0); old_parent = pd->parent_obj; @@ -1430,6 +1429,7 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg // now lets sync up all states if (pd->parent_obj) { +Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(pd->parent_obj); scale = efl_gfx_entity_scale_get(obj); th = elm_widget_theme_get(obj); mirrored = efl_ui_mirrored_get(obj); --
[EGIT] [core/efl] master 01/01: efl_ui_table_layout: calculate cell size with colspan, rowspan property
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e361b45ce1b779ca7e08218968ea66a164f6ee70 commit e361b45ce1b779ca7e08218968ea66a164f6ee70 Author: Yeongjong Lee Date: Sat Mar 30 08:49:57 2019 + efl_ui_table_layout: calculate cell size with colspan, rowspan property We should consider occupied cells by colspan, rowspan property. ref T7753 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8484 --- src/lib/elementary/efl_ui_table_layout.c | 37 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c index 8821fc15dd..3d29551de5 100644 --- a/src/lib/elementary/efl_ui_table_layout.c +++ b/src/lib/elementary/efl_ui_table_layout.c @@ -224,7 +224,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) Table_Item *ti; Item_Calc *items, *item; Efl_Ui_Container_Item_Hints *hints; - int i = 0, rows, cols; + int id = 0, i = 0, rows, cols; int (*_efl_ui_table_item_pos_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); int (*_efl_ui_table_item_size_get[2])(Table_Calc *, Item_Calc *, Eina_Bool); @@ -266,7 +266,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) continue; } -item = [i++]; +item = [id++]; item->obj = ti->object; hints = item->hints; @@ -287,24 +287,33 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) item->cell_span[0] = ti->col_span; item->cell_span[1] = ti->row_span; -if (ti->col_span == 1) +int end; +double ispace, iweight; + +end = ti->col + ti->col_span; +ispace = hints[0].space / ti->col_span; +iweight = hints[0].weight / ti->col_span; +for (i = ti->col; i < end; i++) { - table_calc.cell_calc[0][ti->col].occupied = EINA_TRUE; + table_calc.cell_calc[0][i].occupied = EINA_TRUE; - if (table_calc.cell_calc[0][ti->col].space < hints[0].space) - table_calc.cell_calc[0][ti->col].space = hints[0].space; - if (table_calc.cell_calc[0][ti->col].weight < hints[0].weight) - table_calc.cell_calc[0][ti->col].weight = hints[0].weight; + if (table_calc.cell_calc[0][i].space < ispace) + table_calc.cell_calc[0][i].space = ispace; + if (table_calc.cell_calc[0][i].weight < iweight) + table_calc.cell_calc[0][i].weight = iweight; } -if (ti->row_span == 1) +end = ti->row + ti->row_span; +ispace = hints[1].space / ti->row_span; +iweight = hints[1].weight / ti->row_span; +for (i = ti->row; i < end; i++) { - table_calc.cell_calc[1][ti->row].occupied = EINA_TRUE; + table_calc.cell_calc[1][i].occupied = EINA_TRUE; - if (table_calc.cell_calc[1][ti->row].space < hints[1].space) - table_calc.cell_calc[1][ti->row].space = hints[1].space; - if (table_calc.cell_calc[1][ti->row].weight < hints[1].weight) - table_calc.cell_calc[1][ti->row].weight = hints[1].weight; + if (table_calc.cell_calc[1][i].space < ispace) + table_calc.cell_calc[1][i].space = ispace; + if (table_calc.cell_calc[1][i].weight < iweight) + table_calc.cell_calc[1][i].weight = iweight; } } --
[EGIT] [core/efl] master 14/19: eio: add test to ensure proper lifecycle of Efl_Io object and futures.
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e162ba9696cb25ad91b44649da00dd942c2a5236 commit e162ba9696cb25ad91b44649da00dd942c2a5236 Author: Yeongjong Lee Date: Fri Mar 15 14:51:54 2019 -0700 eio: add test to ensure proper lifecycle of Efl_Io object and futures. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8372 --- src/tests/eio/efl_io_model_test_file.c | 17 + 1 file changed, 17 insertions(+) diff --git a/src/tests/eio/efl_io_model_test_file.c b/src/tests/eio/efl_io_model_test_file.c index f714761c66..e057f6bcc7 100644 --- a/src/tests/eio/efl_io_model_test_file.c +++ b/src/tests/eio/efl_io_model_test_file.c @@ -195,8 +195,25 @@ EFL_START_TEST(efl_io_model_test_test_file) } EFL_END_TEST +EFL_START_TEST(efl_io_model_test_del) +{ + Eo *model; + int i; + + DISABLE_ABORT_ON_CRITICAL_START; + for (i = 0; i < 10; i++) + { +model = efl_add(EFL_IO_MODEL_CLASS, efl_main_loop_get(), +efl_io_model_path_set(efl_added, EFL_MODEL_TEST_FILENAME_PATH)); +efl_del(model); + } + DISABLE_ABORT_ON_CRITICAL_END; +} +EFL_END_TEST + void efl_io_model_test_file(TCase *tc) { tcase_add_test(tc, efl_io_model_test_test_file); +tcase_add_test(tc, efl_io_model_test_del); } --
[EGIT] [core/efl] master 01/01: elm_win: fix correct return value on elm_win_rotation_get
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=2e545ee34e58d4bd2438dd41c29374da7efc232a commit 2e545ee34e58d4bd2438dd41c29374da7efc232a Author: Yeongjong Lee Date: Tue Mar 26 19:48:30 2019 +0900 elm_win: fix correct return value on elm_win_rotation_get Summary: Before b3327c761e, -1 was returned on`elm_win_rotation_get`, if `obj` is NULL. This fixes backward compatibility. Test Plan: make check Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8474 --- src/lib/elementary/efl_ui_win.c | 1 + src/tests/elementary/elm_test_win.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 18e28fa080..b37c1de997 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -1697,6 +1697,7 @@ elm_win_rotation_set(Evas_Object *obj, int rotation) EAPI int elm_win_rotation_get(const Evas_Object *obj) { + EINA_SAFETY_ON_NULL_RETURN_VAL(obj, -1); return efl_ui_win_rotation_get(obj); } diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index 92daf1c656..9327327f6e 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -459,6 +459,7 @@ EFL_START_TEST(elm_win_test_rotation) ck_assert_int_eq(elm_win_rotation_get(win), 90); elm_win_rotation_with_resize_set(win, 180); ck_assert_int_eq(elm_win_rotation_get(win), 180); + ck_assert_int_eq(elm_win_rotation_get(NULL), -1); } EFL_END_TEST --
[EGIT] [core/efl] master 01/01: elm_photocam: fix correct return value in elm_photocam_file_set
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=d36beba2bb0aa2e914de5e6ccd118f67872614df commit d36beba2bb0aa2e914de5e6ccd118f67872614df Author: Yeongjong Lee Date: Tue Mar 26 15:04:52 2019 +0900 elm_photocam: fix correct return value in elm_photocam_file_set Test Plan: `elm_photocam_file_set(NULL, "file_name");` Reviewers: Hermet Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8473 --- src/lib/elementary/efl_ui_image_zoomable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 0f68d709b2..b7ff98a22c 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -3359,8 +3359,8 @@ elm_photocam_zoom_mode_get(const Evas_Object *obj) EAPI Evas_Load_Error elm_photocam_file_set(Evas_Object *obj, const char *file) { - ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_NONE; - EINA_SAFETY_ON_NULL_RETURN_VAL(file, EVAS_LOAD_ERROR_NONE); + ELM_PHOTOCAM_CHECK(obj) EVAS_LOAD_ERROR_GENERIC; + EINA_SAFETY_ON_NULL_RETURN_VAL(file, EVAS_LOAD_ERROR_GENERIC); if (efl_file_simple_load(obj, file, NULL)) return EVAS_LOAD_ERROR_NONE; Eina_Error err = eina_error_get(); --
[EGIT] [core/efl] master 01/01: elm_photocam: fix file_get, set operations
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=43b199aca322a2774d72d7a3b6ad8f898914978e commit 43b199aca322a2774d72d7a3b6ad8f898914978e Author: Yeongjong Lee Date: Tue Mar 26 13:16:32 2019 +0900 elm_photocam: fix file_get,set operations Summary: This patch fixes bug that elm_photocam_file_get always return NULL. Test Plan: make check Reviewers: Hermet, zmike, bu5hm4n Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8472 --- src/lib/elementary/efl_ui_image_zoomable.c | 6 ++ src/lib/elementary/efl_ui_image_zoomable.eo | 2 +- src/tests/elementary/elm_test_photocam.c| 17 + 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 0dac500500..0f68d709b2 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -2408,6 +2408,12 @@ _efl_ui_image_zoomable_efl_file_file_set(Eo *obj EINA_UNUSED, Efl_Ui_Image_Zooma return 0; } +EOLIAN static const char * +_efl_ui_image_zoomable_efl_file_file_get(const Eo *obj EINA_UNUSED, Efl_Ui_Image_Zoomable_Data *sd) +{ + return sd->file; +} + EOLIAN static void _efl_ui_image_zoomable_efl_ui_zoom_zoom_level_set(Eo *obj, Efl_Ui_Image_Zoomable_Data *sd, double zoom) { diff --git a/src/lib/elementary/efl_ui_image_zoomable.eo b/src/lib/elementary/efl_ui_image_zoomable.eo index ffaef70554..fccf57f21c 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.eo +++ b/src/lib/elementary/efl_ui_image_zoomable.eo @@ -64,7 +64,7 @@ class @beta Efl.Ui.Image_Zoomable extends Efl.Ui.Image implements Efl.Ui.Zoom, Efl.Ui.Scrollable_Interactive.scroll; Efl.Access.Widget.Action.elm_actions { get; } Efl.File.load; - Efl.File.file { set; } + Efl.File.file { get; set; } Efl.Orientation.orientation { get; set; } Efl.Orientation.flip { get; set; } Efl.Layout.Group.group_size_min { get; } diff --git a/src/tests/elementary/elm_test_photocam.c b/src/tests/elementary/elm_test_photocam.c index b2bf4ecc12..8313fdb0d2 100644 --- a/src/tests/elementary/elm_test_photocam.c +++ b/src/tests/elementary/elm_test_photocam.c @@ -41,8 +41,25 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST +EFL_START_TEST(elm_photocam_file) +{ + Evas_Object *win, *photocam; + const char *buf = ELM_IMAGE_DATA_DIR "/images/logo_small.png"; + + win = win_add(NULL, "photocam", ELM_WIN_BASIC); + photocam = elm_photocam_add(win); + + ck_assert_int_eq(elm_photocam_file_set(photocam, buf), EVAS_LOAD_ERROR_NONE); + ck_assert_str_eq(elm_photocam_file_get(photocam), buf); + + ck_assert_int_eq(elm_photocam_file_set(photocam, "non_existing.png"), EVAS_LOAD_ERROR_DOES_NOT_EXIST); + ck_assert_str_eq(elm_photocam_file_get(photocam), "non_existing.png"); +} +EFL_END_TEST + void elm_test_photocam(TCase *tc) { tcase_add_test(tc, elm_photocam_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_photocam_file); } --
[EGIT] [core/efl] master 01/01: elm_win: fix correct rot variable in elm_win_rotation_get
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=476010b018e3f7d76f3ed198ad2657fc18cc50c8 commit 476010b018e3f7d76f3ed198ad2657fc18cc50c8 Author: Yeongjong Lee Date: Mon Mar 25 10:33:29 2019 + elm_win: fix correct rot variable in elm_win_rotation_get Remove duplicated rotation variable Also, it fixes wrong layout class comparing. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8464 --- src/lib/elementary/efl_ui_win.c | 5 ++--- src/tests/elementary/elm_test_win.c | 14 ++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c index 26c135b356..18e28fa080 100644 --- a/src/lib/elementary/efl_ui_win.c +++ b/src/lib/elementary/efl_ui_win.c @@ -213,7 +213,6 @@ struct _Efl_Ui_Win_Data int norender; int modal_count; int response; - int rotation; Eina_Boolreq_wh : 1; Eina_Boolreq_xy : 1; @@ -1676,7 +1675,7 @@ _efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, int rotat it = efl_ui_widget_tree_widget_iterator(obj); EINA_ITERATOR_FOREACH(it, widget) { -if (!efl_isa(widget, EFL_UI_LAYOUT_CLASS)) continue; +if (!efl_isa(widget, EFL_UI_LAYOUT_BASE_CLASS)) continue; if (efl_ui_layout_automatic_theme_rotation_get(widget)) efl_ui_layout_theme_rotation_apply(widget, rot); @@ -1686,7 +1685,7 @@ _efl_ui_win_win_rotation_set(Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd, int rotat EOLIAN static int _efl_ui_win_win_rotation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Win_Data *pd) { - return pd->rotation; + return pd->rot; } EAPI void diff --git a/src/tests/elementary/elm_test_win.c b/src/tests/elementary/elm_test_win.c index e08e0d3be5..92daf1c656 100644 --- a/src/tests/elementary/elm_test_win.c +++ b/src/tests/elementary/elm_test_win.c @@ -449,6 +449,19 @@ EFL_START_TEST(efl_ui_win_multi_touch_inputs) } EFL_END_TEST +EFL_START_TEST(elm_win_test_rotation) +{ + Evas_Object *win; + + win = win_add(NULL, "win", ELM_WIN_BASIC); + + elm_win_rotation_set(win, 90); + ck_assert_int_eq(elm_win_rotation_get(win), 90); + elm_win_rotation_with_resize_set(win, 180); + ck_assert_int_eq(elm_win_rotation_get(win), 180); +} +EFL_END_TEST + void elm_test_win(TCase *tc) { tcase_add_test(tc, elm_win_legacy_type_check); @@ -458,6 +471,7 @@ void elm_test_win(TCase *tc) tcase_add_test(tc, elm_win_test_exit_on_close); tcase_add_test(tc, elm_win_test_app_exit_on_windows_close); tcase_add_test(tc, efl_ui_win_multi_touch_inputs); + tcase_add_test(tc, elm_win_test_rotation); #ifdef HAVE_ELEMENTARY_X tcase_add_test(tc, elm_win_autohide); tcase_add_test(tc, elm_win_autohide_and_policy_quit_last_window_hidden); --
[EGIT] [core/efl] master 01/01: efl_ui_container_layout: use correct property
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=aa54d57a07e25e233992a6baccc094a6acc557fe commit aa54d57a07e25e233992a6baccc094a6acc557fe Author: Yeongjong Lee Date: Mon Mar 25 09:56:41 2019 + efl_ui_container_layout: use correct property The `if` condition check whether horizontal, vertical aspect are greater than 0. `aspect` is correct here. this patch fixes T7756 Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8461 --- src/lib/elementary/efl_ui_container_layout.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c index e8c5979dd0..51934e73c7 100644 --- a/src/lib/elementary/efl_ui_container_layout.c +++ b/src/lib/elementary/efl_ui_container_layout.c @@ -87,12 +87,12 @@ _efl_ui_container_layout_item_init(Eo* o, Efl_Ui_Container_Item_Hints *item) item[0].min = min.w; item[1].min = min.h; - if ((item[0].aspect <= 0) || (item[1].aspect_type <= 0)) + if ((item[0].aspect <= 0) || (item[1].aspect <= 0)) { -if ((item[0].aspect <= 0) ^ (item[1].aspect_type <= 0)) +if ((item[0].aspect <= 0) ^ (item[1].aspect <= 0)) { ERR("Invalid aspect parameter for obj(%p)", o); - item[0].aspect = item[1].aspect_type = 0; + item[0].aspect = item[1].aspect = 0; item[0].aspect_type = item[1].aspect_type = EFL_GFX_HINT_ASPECT_NONE; } } --
[EGIT] [core/efl] master 01/01: ui.box_stack: refactor layout_update
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=77f2782d29eb7b51340ff47292afc018978cde84 commit 77f2782d29eb7b51340ff47292afc018978cde84 Author: Yeongjong Lee Date: Wed Mar 20 10:28:45 2019 -0400 ui.box_stack: refactor layout_update Summary: This patch remove evas_box function from Efl.Ui.Box_Stack and add unit test. Depends on D8214 Test Plan: 1. make check 2. elementary_test -to 'efl.ui.box_stack' Reviewers: zmike, Jaehyun_Cho, cedric Reviewed By: zmike, Jaehyun_Cho, cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8094 --- src/Makefile_Elementary.am | 2 + src/bin/elementary/meson.build | 1 + src/bin/elementary/test.c| 4 +- src/bin/elementary/test_box.c| 41 - src/bin/elementary/test_ui_box_stack.c | 44 + src/lib/elementary/efl_ui_box_stack.c| 87 -- src/tests/elementary/efl_ui_suite.c | 1 + src/tests/elementary/efl_ui_suite.h | 1 + src/tests/elementary/efl_ui_test_box_stack.c | 244 +++ src/tests/elementary/meson.build | 1 + 10 files changed, 373 insertions(+), 53 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 542ed21537..c006680071 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -1403,6 +1403,7 @@ bin/elementary/test_tooltip.c \ bin/elementary/test_transit.c \ bin/elementary/test_transit_bezier.c \ bin/elementary/test_ui_box.c \ +bin/elementary/test_ui_box_stack.c \ bin/elementary/test_ui_clock.c \ bin/elementary/test_ui_table.c \ bin/elementary/test_ui_popup.c \ @@ -1935,6 +1936,7 @@ tests_elementary_efl_ui_suite_SOURCES = \ tests/elementary/efl_ui_test_focus_sub.c \ tests/elementary/efl_ui_test_box.c \ tests/elementary/efl_ui_test_box_flow.c \ + tests/elementary/efl_ui_test_box_stack.c \ tests/elementary/efl_ui_test_table.c \ tests/elementary/efl_ui_test_relative_layout.c \ tests/elementary/efl_ui_test_grid.c \ diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index 1612e0bdcc..0f7fa3d340 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -134,6 +134,7 @@ elementary_test_src = [ 'test_transit.c', 'test_transit_bezier.c', 'test_ui_box.c', + 'test_ui_box_stack.c', 'test_ui_clock.c', 'test_ui_table.c', 'test_ui_popup.c', diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 91fe009a66..f81af61ada 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -29,8 +29,8 @@ void test_box_horiz(void *data, Evas_Object *obj, void *event_info); void test_box_homo(void *data, Evas_Object *obj, void *event_info); void test_box_transition(void *data, Evas_Object *obj, void *event_info); void test_box_align(void *data, Evas_Object *obj, void *event_info); -void test_box_stack(void *data, Evas_Object *obj, void *event_info); void test_ui_box(void *data, Evas_Object *obj, void *event_info); +void test_ui_box_stack(void *data, Evas_Object *obj, void *event_info); void test_button(void *data, Evas_Object *obj, void *event_info); void test_ui_button(void *data, Evas_Object *obj, void *event_info); void test_cnp(void *data, Evas_Object *obj, void *event_info); @@ -826,7 +826,6 @@ add_tests: ADD_TEST(NULL, "Containers", "Box Homogeneous", test_box_homo); ADD_TEST(NULL, "Containers", "Box Transition", test_box_transition); ADD_TEST(NULL, "Containers", "Box Align", test_box_align); - ADD_TEST(NULL, "Containers", "Box Stack", test_box_stack); ADD_TEST(NULL, "Containers", "Table", test_table); ADD_TEST(NULL, "Containers", "Table Homogeneous", test_table2); ADD_TEST(NULL, "Containers", "Table 3", test_table3); @@ -841,6 +840,7 @@ add_tests: //--// ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Box", test_ui_box); + ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Box_Stack", test_ui_box_stack); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table", test_ui_table); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table (Linear API)", test_ui_table_linear); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Table_Static", test_ui_table_static); diff --git a/src/bin/elementary/test_box.c b/src/bin/elementary/test_box.c index 2d0e6affd3..893e96d716 100644 --- a/src/bin/elementary/test_box.c +++ b/src/bin/elementary/test_box.c @@ -882,44 +882,3 @@ test_box_align(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, evas_object_resi
[EGIT] [core/efl] master 01/01: efl.pack_table: inherit efl.pack instead of efl.pack_linear
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=37c703437a4df331af8a82515b2229ed4d20b670 commit 37c703437a4df331af8a82515b2229ed4d20b670 Author: Yeongjong Lee Date: Wed Mar 20 12:45:00 2019 +0100 efl.pack_table: inherit efl.pack instead of efl.pack_linear Summary: >>! In T5301#110572, @jpeg wrote: > Quick recap before I leave. > ... > ... > - Pack interfaces - T5328 > > Table does not need to inherit from "linear" (1d) layout: this brings unnecessary complexity, for a dubious use case. We don't have linear layout policy of table(2d) layout. furthermore, i don't think it will be clearly defined. it is enough for Efl.Pack_Table to support `efl_pack` which work the same as `efl_pack_end`. ref T5719, T5328 Test Plan: - make - elementary_test -to 'efl.ui.table' - elementary_test -to 'efl.ui.table(linear api)' Reviewers: zmike, woohyun, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, jpeg, #committers Tags: #efl Maniphest Tasks: T5719, T5328 Differential Revision: https://phab.enlightenment.org/D8420 --- src/bin/elementary/test_ui_table.c | 2 +- src/lib/efl/interfaces/efl_pack_table.eo | 2 +- src/lib/elementary/efl_ui_table.c| 9 + src/lib/elementary/efl_ui_table.eo | 1 - 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index f0e63d2ac3..d11cefe43b 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -545,7 +545,7 @@ append_cb(void *data, const Efl_Event *ev EINA_UNUSED) efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); elm_object_tooltip_text_set(o, "Click to unpack"); - efl_pack_end(table, o); + efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); } diff --git a/src/lib/efl/interfaces/efl_pack_table.eo b/src/lib/efl/interfaces/efl_pack_table.eo index ea88ca61da..9472b52ed4 100644 --- a/src/lib/efl/interfaces/efl_pack_table.eo +++ b/src/lib/efl/interfaces/efl_pack_table.eo @@ -1,6 +1,6 @@ import efl_ui_direction; -interface @beta Efl.Pack_Table extends Efl.Pack_Linear +interface @beta Efl.Pack_Table extends Efl.Pack { [[2D containers aligned on a table with rows and columns]] eo_prefix: efl_pack; diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index 7fe398d1ed..50fd0be834 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -719,14 +719,7 @@ _efl_ui_table_efl_pack_table_table_rows_get(const Eo *obj EINA_UNUSED, Efl_Ui_Ta } EOLIAN static Eina_Bool -_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) -{ - /* this is just an alias */ - return efl_pack_end(obj, subobj); -} - -EOLIAN static Eina_Bool -_efl_ui_table_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj) +_efl_ui_table_efl_pack_pack(Eo *obj, Efl_Ui_Table_Data *pd, Efl_Gfx_Entity *subobj) { EINA_SAFETY_ON_NULL_RETURN_VAL(subobj, EINA_FALSE); diff --git a/src/lib/elementary/efl_ui_table.eo b/src/lib/elementary/efl_ui_table.eo index 3e3753a94c..7bcf3195a1 100644 --- a/src/lib/elementary/efl_ui_table.eo +++ b/src/lib/elementary/efl_ui_table.eo @@ -38,7 +38,6 @@ class @beta Efl.Ui.Table extends Efl.Ui.Widget implements Efl.Pack_Table, Efl.Pa Efl.Pack_Table.table_columns { get; set; } Efl.Pack_Table.table_rows { get; set; } Efl.Pack_Table.table_direction { get; set; } - Efl.Pack_Linear.pack_end; Efl.Pack_Layout.layout_update; Efl.Pack_Layout.layout_request; } --
[EGIT] [core/efl] master 02/02: efl_ui_text_alert_popup: use correct theme klass name
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=a278e4ea9d190bf56c040afe9a908e5bcdd27434 commit a278e4ea9d190bf56c040afe9a908e5bcdd27434 Author: Yeongjong Lee Date: Fri Mar 15 10:52:32 2019 + efl_ui_text_alert_popup: use correct theme klass name text_alert_popup is not scroll_alert_popup. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8364 --- src/lib/elementary/efl_ui_text_alert_popup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_text_alert_popup.c b/src/lib/elementary/efl_ui_text_alert_popup.c index e0d516a598..dd19e6a0d8 100644 --- a/src/lib/elementary/efl_ui_text_alert_popup.c +++ b/src/lib/elementary/efl_ui_text_alert_popup.c @@ -270,7 +270,7 @@ _efl_ui_text_alert_popup_efl_object_constructor(Eo *obj, ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL); if (!elm_widget_theme_klass_get(obj)) - elm_widget_theme_klass_set(obj, "scroll_alert_popup"); + elm_widget_theme_klass_set(obj, "text_alert_popup"); obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME); --
[EGIT] [core/efl] master 01/01: efl_ui_layout: call efl_del instead of efl_unref when text part does not exist
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=cced5487c83c8f75e2ca40969f5749d5e6570228 commit cced5487c83c8f75e2ca40969f5749d5e6570228 Author: Yeongjong Lee Date: Mon Mar 18 08:50:19 2019 -0400 efl_ui_layout: call efl_del instead of efl_unref when text part does not exist Summary: Because `efl_isa` doesn't call _efl_object_call_end, the part object is not removed. it occurs a bunch of efl_unref error message. Test Plan: 1. elementary_test -to 'efl.ui.box' 2. exit window. 3. check there is no efl_unref error message. Reviewers: zmike, cedric Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8385 --- src/lib/elementary/efl_ui_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index a1580aa693..8f9c6c 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2770,7 +2770,7 @@ elm_layout_text_set(Eo *obj, const char *part, const char *text) if (!efl_isa(part_obj, EFL_TEXT_INTERFACE) || !efl_isa(part_obj, EFL_UI_LAYOUT_PART_CLASS)) { -efl_unref(part_obj); +efl_del(part_obj); return EINA_FALSE; } --
[EGIT] [core/efl] master 03/03: evas_events: prevent double event_freeze in evas_object_freeze_events_set
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=721f1776db5dadee0e12226d1801b8a975ed7133 commit 721f1776db5dadee0e12226d1801b8a975ed7133 Author: Yeongjong Lee Date: Fri Mar 15 10:35:17 2019 -0400 evas_events: prevent double event_freeze in evas_object_freeze_events_set Summary: This patch prevent that event_freeze_count is greater than 1 in `evas_object_freeze_events_set` Test Plan: make check Reviewers: bu5hm4n, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8325 --- src/lib/evas/canvas/evas_events.c | 6 ++ src/tests/evas/evas_test_object.c | 22 ++ 2 files changed, 28 insertions(+) diff --git a/src/lib/evas/canvas/evas_events.c b/src/lib/evas/canvas/evas_events.c index 2a7c017fda..bff66c81d9 100644 --- a/src/lib/evas/canvas/evas_events.c +++ b/src/lib/evas/canvas/evas_events.c @@ -3743,6 +3743,12 @@ _efl_canvas_object_efl_object_event_thaw(Eo *obj, Evas_Object_Protected_Data *pd EAPI void evas_object_freeze_events_set(Eo *eo_obj, Eina_Bool freeze) { + Evas_Object_Protected_Data *pd = EVAS_OBJECT_DATA_SAFE_GET(eo_obj); + EINA_SAFETY_ON_NULL_RETURN(pd); + + freeze = !!freeze; + if (pd->freeze_events == freeze) return; + if (freeze) efl_event_freeze(eo_obj); else diff --git a/src/tests/evas/evas_test_object.c b/src/tests/evas/evas_test_object.c index ac4424e327..d2de52a58a 100644 --- a/src/tests/evas/evas_test_object.c +++ b/src/tests/evas/evas_test_object.c @@ -30,7 +30,29 @@ EFL_START_TEST(evas_object_various) } EFL_END_TEST +EFL_START_TEST(evas_object_freeze_events) +{ + Evas *evas = EVAS_TEST_INIT_EVAS(); + Evas_Object *obj = evas_object_rectangle_add(evas); + + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_FALSE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_FALSE); + + evas_object_freeze_events_set(obj, EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); + evas_object_freeze_events_set(obj, EINA_FALSE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_FALSE); + evas_object_freeze_events_set(obj, EINA_FALSE); + evas_object_freeze_events_set(obj, EINA_TRUE); + ck_assert_int_eq(evas_object_freeze_events_get(obj), EINA_TRUE); +} +EFL_END_TEST + void evas_test_object(TCase *tc) { tcase_add_test(tc, evas_object_various); + tcase_add_test(tc, evas_object_freeze_events); } --
[EGIT] [core/efl] master 01/01: efl_ui_layout: fix elm_layout_text_set behavior
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=ba1c94d051ebfd3c57a9220e8553bd7a950b0fce commit ba1c94d051ebfd3c57a9220e8553bd7a950b0fce Author: Yeongjong Lee Date: Thu Mar 14 11:11:32 2019 -0400 efl_ui_layout: fix elm_layout_text_set behavior Summary: Since commit 649433560b5b, elm_layout_text_set didn't work on some widgets. This patch fixes invisible text issues. Test Plan: 1. make check 2. elementary_test -to 'popup' Reviewers: zmike, segfaultxavi, bu5hm4n Reviewed By: zmike Subscribers: cedric, #reviewers, herb, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8326 --- src/lib/elementary/efl_ui_layout.c| 15 ++- src/tests/elementary/elm_test_entry.c | 20 src/tests/elementary/elm_test_popup.c | 15 +++ 3 files changed, 49 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index d50bd84674..a1580aa693 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c @@ -2756,6 +2756,7 @@ elm_layout_table_clear(Eo *obj, const char *part, Eina_Bool clear) EAPI Eina_Bool elm_layout_text_set(Eo *obj, const char *part, const char *text) { + Eo *part_obj; if (!part) { part = efl_ui_widget_default_text_part_get(obj); @@ -2764,7 +2765,19 @@ elm_layout_text_set(Eo *obj, const char *part, const char *text) else if (!_elm_layout_part_aliasing_eval(obj, , EINA_TRUE)) return EINA_FALSE; - efl_text_set(efl_part(obj, part), text); + part_obj = efl_ref(efl_part(obj, part)); + + if (!efl_isa(part_obj, EFL_TEXT_INTERFACE) || + !efl_isa(part_obj, EFL_UI_LAYOUT_PART_CLASS)) + { +efl_unref(part_obj); +return EINA_FALSE; + } + + efl_text_set(part_obj, text); + + efl_unref(part_obj); + return EINA_TRUE; } diff --git a/src/tests/elementary/elm_test_entry.c b/src/tests/elementary/elm_test_entry.c index 969681f4e4..cbeaed1d10 100644 --- a/src/tests/elementary/elm_test_entry.c +++ b/src/tests/elementary/elm_test_entry.c @@ -393,6 +393,25 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST +EFL_START_TEST(elm_entry_text_set) +{ + Evas_Object *win, *entry; + const char *entry_text = "hello world"; + const char *entry_text2 = "scrollable"; + + win = win_add(NULL, "entry", ELM_WIN_BASIC); + + entry = elm_entry_add(win); + + ck_assert(elm_layout_text_set(entry, NULL, entry_text)); + ck_assert_str_eq(elm_object_text_get(entry), entry_text); + + elm_entry_scrollable_set(entry, EINA_TRUE); + ck_assert(elm_layout_text_set(entry, NULL, entry_text2)); + ck_assert_str_eq(elm_object_text_get(entry), entry_text2); +} +EFL_END_TEST + void elm_test_entry(TCase *tc) { tcase_add_test(tc, elm_entry_legacy_type_check); @@ -407,4 +426,5 @@ void elm_test_entry(TCase *tc) tcase_add_test(tc, elm_entry_atspi_text_text_get); tcase_add_test(tc, elm_entry_atspi_text_selections); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_entry_text_set); } diff --git a/src/tests/elementary/elm_test_popup.c b/src/tests/elementary/elm_test_popup.c index d4dc75e79c..ba3143eb17 100644 --- a/src/tests/elementary/elm_test_popup.c +++ b/src/tests/elementary/elm_test_popup.c @@ -70,9 +70,24 @@ EFL_START_TEST(elm_popup_focus_get) } EFL_END_TEST +EFL_START_TEST(elm_popup_text_set) +{ + Evas_Object *win, *popup; + const char *popup_text = "hello world"; + + win = win_add(NULL, "popup", ELM_WIN_BASIC); + + popup = elm_popup_add(win); + + ck_assert(elm_layout_text_set(popup, NULL, popup_text)); + ck_assert_str_eq(elm_object_text_get(popup), popup_text); +} +EFL_END_TEST + void elm_test_popup(TCase *tc) { tcase_add_test(tc, elm_popup_focus_get); tcase_add_test(tc, elm_popup_legacy_type_check); + tcase_add_test(tc, elm_popup_text_set); tcase_add_test(tc, elm_atspi_role_get); } --
[EGIT] [core/efl] master 01/01: ui.widget: fix theme_apply working in sub_object_add
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c3f823418dc2643f352333b7feac902fe80fbdc5 commit c3f823418dc2643f352333b7feac902fe80fbdc5 Author: Yeongjong Lee Date: Mon Mar 11 21:21:22 2019 + ui.widget: fix theme_apply working in sub_object_add It seems that theme_apply in sub_object_add haven't worked since commit f6fa1ef6120fdebcdaf1568674c48b9d17f76f64. scale, theme property will be set properly when the parent is changed. Reviewed-by: Marcel Hollerbach Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8283 --- src/lib/elementary/efl_ui_widget.c| 30 ++--- src/tests/elementary/efl_ui_test_widget.c | 32 +++ 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index acab4f32f5..ca2b975954 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1377,7 +1377,6 @@ elm_widget_sub_object_parent_add(Evas_Object *sobj) EOLIAN static void _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widget *parent) { - Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(obj); Efl_Ui_Widget *old_parent; //check if we are in the subobject list of parents if (parent) @@ -1386,32 +1385,33 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg EINA_SAFETY_ON_FALSE_RETURN(eina_list_data_find(ppd->subobjs, obj)); } + /* NOTE: In the following two lines, 'obj' is correct. Do not change it. +* Due to elementary's scale policy, scale and prev_scale can be different in +* some cases. This happens when obj's previous parent and new parent have +* different scale value. +* For example, if obj's previous parent's scale is 5 and new parent's scale +* is 2 while obj's scale is 0. Then 'prev_pscale' is 5 and 'scale' is 2. So +* we need to reset obj's scale to 5. +* Note that each widget's scale is 1.0 by default. +*/ + double scale, prev_scale = efl_gfx_entity_scale_get(obj); + Elm_Theme *th, *prev_th = elm_widget_theme_get(obj); + Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(parent); + old_parent = pd->parent_obj; pd->parent_obj = parent; // now lets sync up all states - if (pd->parent_obj) { -/* NOTE: In the following two lines, 'sobj' is correct. Do not change it. -* Due to elementary's scale policy, scale and pscale can be different in - * some cases. This happens when sobj's previous parent and new parent have - * different scale value. - * For example, if sobj's previous parent's scale is 5 and new parent's scale - * is 2 while sobj's scale is 0. Then 'pscale' is 5 and 'scale' is 2. So we - * need to reset sobj's scale to 5. - * Note that each widget's scale is 0 by default. - */ -double scale, pscale = efl_gfx_entity_scale_get(obj); -Elm_Theme *th, *pth = elm_widget_theme_get(obj); - scale = efl_gfx_entity_scale_get(obj); th = elm_widget_theme_get(obj); mirrored = efl_ui_mirrored_get(obj); if (!pd->on_create) { - if ((scale != pscale) || (th != pth) || (pmirrored != mirrored)) + if ((scale != prev_scale) || (th != prev_th) || + (pmirrored != mirrored)) elm_widget_theme(obj); } if (_is_focused(obj)) _parents_focus(parent); diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c index d5f9c4d525..810285d0b6 100644 --- a/src/tests/elementary/efl_ui_test_widget.c +++ b/src/tests/elementary/efl_ui_test_widget.c @@ -188,6 +188,37 @@ EFL_START_TEST(efl_ui_test_widget_sub_object_add_del) } EFL_END_TEST +EFL_START_TEST(efl_ui_test_widget_sub_object_theme_sync) +{ + State s; + Efl_Canvas_Layout *edje; + + _small_ui(); + edje = elm_widget_resize_object_get(s.btn1); + + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 1.0)); + + efl_gfx_entity_scale_set(s.win, 0.123); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.123)); + + efl_ui_widget_sub_object_del(s.box, s.btn1); + efl_gfx_entity_scale_set(s.win, 0.456); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123)); + ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.456)); + + efl_gfx_entity_scale_set(s.win, 0.789); + efl_ui_widget_sub_object_ad
[EGIT] [core/efl] master 01/06: elm_conform: remove duplicated constructor call
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c6e0a8cbc617e59c8b928d25d11726628bbd241a commit c6e0a8cbc617e59c8b928d25d11726628bbd241a Author: Yeongjong Lee Date: Tue Mar 12 07:14:06 2019 + elm_conform: remove duplicated constructor call It is duplicated in commit ccbc27f24da1f6fd1494f478f36359aaf1502dc2. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8303 --- src/lib/elementary/elm_conform.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/lib/elementary/elm_conform.c b/src/lib/elementary/elm_conform.c index 82b5e2fe7d..a72c08eafc 100644 --- a/src/lib/elementary/elm_conform.c +++ b/src/lib/elementary/elm_conform.c @@ -997,7 +997,6 @@ _elm_conformant_efl_object_constructor(Eo *obj, Elm_Conformant_Data *sd) (void)parent; #endif - obj = efl_constructor(efl_super(obj, MY_CLASS)); efl_canvas_object_type_set(obj, MY_CLASS_NAME_LEGACY); evas_object_smart_callbacks_descriptions_set(obj, _smart_callbacks); efl_access_object_role_set(obj, EFL_ACCESS_ROLE_FILLER); --
[EGIT] [core/efl] master 01/09: ui.widget: fix theme_apply working in sub_object_add
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=da0ff534716774b35a98c359e8c7fd7bdde7a3d2 commit da0ff534716774b35a98c359e8c7fd7bdde7a3d2 Author: Yeongjong Lee Date: Mon Mar 11 09:44:16 2019 + ui.widget: fix theme_apply working in sub_object_add It seems that theme_apply in sub_object_add haven't worked since commit f6fa1ef6120fdebcdaf1568674c48b9d17f76f64. scale, theme property will be set properly when the parent is changed. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8283 --- src/lib/elementary/efl_ui_widget.c| 30 ++--- src/tests/elementary/efl_ui_test_widget.c | 32 +++ 2 files changed, 47 insertions(+), 15 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index acab4f32f5..ca2b975954 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1377,7 +1377,6 @@ elm_widget_sub_object_parent_add(Evas_Object *sobj) EOLIAN static void _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widget *parent) { - Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(obj); Efl_Ui_Widget *old_parent; //check if we are in the subobject list of parents if (parent) @@ -1386,32 +1385,33 @@ _efl_ui_widget_widget_parent_set(Eo *obj, Elm_Widget_Smart_Data *pd, Efl_Ui_Widg EINA_SAFETY_ON_FALSE_RETURN(eina_list_data_find(ppd->subobjs, obj)); } + /* NOTE: In the following two lines, 'obj' is correct. Do not change it. +* Due to elementary's scale policy, scale and prev_scale can be different in +* some cases. This happens when obj's previous parent and new parent have +* different scale value. +* For example, if obj's previous parent's scale is 5 and new parent's scale +* is 2 while obj's scale is 0. Then 'prev_pscale' is 5 and 'scale' is 2. So +* we need to reset obj's scale to 5. +* Note that each widget's scale is 1.0 by default. +*/ + double scale, prev_scale = efl_gfx_entity_scale_get(obj); + Elm_Theme *th, *prev_th = elm_widget_theme_get(obj); + Eina_Bool mirrored, pmirrored = efl_ui_mirrored_get(parent); + old_parent = pd->parent_obj; pd->parent_obj = parent; // now lets sync up all states - if (pd->parent_obj) { -/* NOTE: In the following two lines, 'sobj' is correct. Do not change it. -* Due to elementary's scale policy, scale and pscale can be different in - * some cases. This happens when sobj's previous parent and new parent have - * different scale value. - * For example, if sobj's previous parent's scale is 5 and new parent's scale - * is 2 while sobj's scale is 0. Then 'pscale' is 5 and 'scale' is 2. So we - * need to reset sobj's scale to 5. - * Note that each widget's scale is 0 by default. - */ -double scale, pscale = efl_gfx_entity_scale_get(obj); -Elm_Theme *th, *pth = elm_widget_theme_get(obj); - scale = efl_gfx_entity_scale_get(obj); th = elm_widget_theme_get(obj); mirrored = efl_ui_mirrored_get(obj); if (!pd->on_create) { - if ((scale != pscale) || (th != pth) || (pmirrored != mirrored)) + if ((scale != prev_scale) || (th != prev_th) || + (pmirrored != mirrored)) elm_widget_theme(obj); } if (_is_focused(obj)) _parents_focus(parent); diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c index d5f9c4d525..221978bade 100644 --- a/src/tests/elementary/efl_ui_test_widget.c +++ b/src/tests/elementary/efl_ui_test_widget.c @@ -188,6 +188,37 @@ EFL_START_TEST(efl_ui_test_widget_sub_object_add_del) } EFL_END_TEST +EFL_START_TEST(efl_ui_test_widget_sub_object_theme_sync) +{ + State s; + Efl_Canvas_Layout *edje; + + _small_ui(); + edje = elm_widget_resize_object_get(s.btn1); + + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn1), 1.0); + ck_assert_double_eq(efl_gfx_entity_scale_get(edje), 1.0); + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn2), 1.0); + + efl_gfx_entity_scale_set(s.win, 0.123); + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn1), 0.123); + ck_assert_double_eq(efl_gfx_entity_scale_get(edje), 0.123); + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn2), 0.123); + + efl_ui_widget_sub_object_del(s.box, s.btn1); + efl_gfx_entity_scale_set(s.win, 0.456); + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn1), 1.0); + ck_assert_double_eq(efl_gfx_entity_scale_get(edje), 0.123); + ck_assert_double_eq(efl_gfx_entity_scale_get(s.btn2), 0.456); + + efl_gfx_entity_scale_set(s.win, 0.789); + efl_ui_widget_sub_object_add(s.box, s.btn1); + ck_assert_double_eq(efl_gfx_entity_scale_get
[EGIT] [core/efl] master 02/03: ui.widget: add exception handling code and unit test of sub_object_add/del function
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0838c1af6351d2be6164f5f07c06f5de08a8179b commit 0838c1af6351d2be6164f5f07c06f5de08a8179b Author: Yeongjong Lee Date: Mon Mar 11 00:59:07 2019 + ui.widget: add exception handling code and unit test of sub_object_add/del function Add missing exception check code with unit test. Reviewed-by: Mike Blumenkrantz Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D8282 --- src/lib/elementary/efl_ui_widget.c| 3 +++ src/tests/elementary/efl_ui_test_widget.c | 17 + 2 files changed, 20 insertions(+) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index ed959eb479..acab4f32f5 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1460,6 +1460,9 @@ _efl_ui_widget_widget_sub_object_add(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Ob { Efl_Ui_Widget *parent; + if (!sobj) return EINA_FALSE; + EINA_SAFETY_ON_TRUE_RETURN_VAL(obj == sobj, EINA_FALSE); + //first make sure that we unregister the sobj from the parent if (elm_widget_is(sobj)) parent = efl_ui_widget_parent_get(sobj); diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c index ad1a60fa0e..d5f9c4d525 100644 --- a/src/tests/elementary/efl_ui_test_widget.c +++ b/src/tests/elementary/efl_ui_test_widget.c @@ -172,6 +172,22 @@ EFL_START_TEST(efl_ui_test_widget_sub_iterator) } EFL_END_TEST +EFL_START_TEST(efl_ui_test_widget_sub_object_add_del) +{ + State s; + + _small_ui(); + ck_assert(!efl_ui_widget_sub_object_add(s.btn1, s.btn1)); + ck_assert(efl_ui_widget_sub_object_add(s.box, s.btn1)); + ck_assert(!efl_ui_widget_sub_object_add(s.box, NULL)); + + ck_assert(!efl_ui_widget_sub_object_del(s.btn1, s.btn1)); + ck_assert(!efl_ui_widget_sub_object_del(s.box, NULL)); + ck_assert(!efl_ui_widget_sub_object_del(s.btn1, s.box)); + ck_assert(efl_ui_widget_sub_object_del(s.box, s.btn1)); +} +EFL_END_TEST + void efl_ui_test_widget(TCase *tc) { tcase_add_test(tc, efl_ui_test_widget_parent_iterator); @@ -179,4 +195,5 @@ void efl_ui_test_widget(TCase *tc) tcase_add_test(tc, efl_ui_test_widget_widget_sub_iterator); tcase_add_test(tc, efl_ui_test_widget_iterator); tcase_add_test(tc, efl_ui_test_widget_sub_iterator); + tcase_add_test(tc, efl_ui_test_widget_sub_object_add_del); } --
[EGIT] [core/efl] master 01/01: ui.widget: enhance documentation of sub_object_add
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=c043b11f467d2df38ed9dbfc78f20c493011ad4b commit c043b11f467d2df38ed9dbfc78f20c493011ad4b Author: Yeongjong Lee Date: Mon Mar 11 12:17:17 2019 +0100 ui.widget: enhance documentation of sub_object_add Reviewers: segfaultxavi, bu5hm4n Reviewed By: segfaultxavi, bu5hm4n Subscribers: bu5hm4n, kimcinoo, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8281 --- src/lib/elementary/efl_ui_widget.eo | 20 +--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index c06587a533..d25174e810 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -253,7 +253,15 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, /* Internal hooks. */ widget_sub_object_add @protected { - [[Virtual function handling sub objects being added. + [[Virtual function customizing sub objects being added. + + When a widget is added as a sub-object of another widget (like list + elements inside a list container, for example) some of its properties + are automatically adapted to the parent's current values (like focus, + access, theme, scale, mirror, scrollable child get, translate, + display mode set, tree dump). + Override this method if you want to customize differently sub-objects + being added to this object. Sub objects can be any canvas object, not necessarily widgets. @@ -266,11 +274,17 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, return: bool; [[Indicates if the operation succeeded.]] } widget_sub_object_del @protected { - [[Virtual function handling sub objects being removed. + [[Virtual function customizing sub objects being removed. + + When a widget is removed as a sub-object from another widget + (@Efl.Pack.unpack, @Efl.Content.content_unset, for example) some of + its properties are automatically adjusted.(like focus, access, tree dump) + Override this method if you want to customize differently sub-objects + being removed to this object. Sub objects can be any canvas object, not necessarily widgets. - See also @.widget_parent. + See also @.widget_parent and @.widget_sub_object_add. ]] params { @in sub_obj: Efl.Canvas.Object; --
[EGIT] [core/efl] master 04/05: ui.box, table: update layout when homogeneous mode is changed.
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f4b69b9c4d850fb646e76f376032fbbbff26ca94 commit f4b69b9c4d850fb646e76f376032fbbbff26ca94 Author: Yeongjong Lee Date: Fri Mar 8 08:22:12 2019 -0500 ui.box,table: update layout when homogeneous mode is changed. Summary: changing homogeneous mode is needed layout_update. Test Plan: 1. elementary_test -to 'efl.ui.box' 2. Click 'Homogenous' check box. 3. Check layout is updated. Reviewers: zmike, Jaehyun_Cho, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8216 --- src/lib/elementary/efl_ui_box.c | 6 +- src/lib/elementary/efl_ui_table.c | 7 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_box.c b/src/lib/elementary/efl_ui_box.c index c577bb8e9d..eec5a645d8 100644 --- a/src/lib/elementary/efl_ui_box.c +++ b/src/lib/elementary/efl_ui_box.c @@ -81,9 +81,13 @@ _evas_box_custom_layout(Evas_Object *evas_box EINA_UNUSED, } EOLIAN static void -_efl_ui_box_homogeneous_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Data *pd, Eina_Bool homogeneous) +_efl_ui_box_homogeneous_set(Eo *obj, Efl_Ui_Box_Data *pd, Eina_Bool homogeneous) { + if (pd->homogeneous == !!homogeneous) + return; + pd->homogeneous = !!homogeneous; + efl_pack_layout_request(obj); } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/efl_ui_table.c b/src/lib/elementary/efl_ui_table.c index cc3d240411..7fe398d1ed 100644 --- a/src/lib/elementary/efl_ui_table.c +++ b/src/lib/elementary/efl_ui_table.c @@ -123,10 +123,15 @@ _custom_table_calc(Eo *obj, Custom_Table_Data *pd) /* End of custom table class */ EOLIAN static void -_efl_ui_table_homogeneous_set(Eo *obj EINA_UNUSED, Efl_Ui_Table_Data *pd, Eina_Bool homogeneoush, Eina_Bool homogeneousv) +_efl_ui_table_homogeneous_set(Eo *obj, Efl_Ui_Table_Data *pd, Eina_Bool homogeneoush, Eina_Bool homogeneousv) { + if ((pd->homogeneoush == !!homogeneoush) && + (pd->homogeneousv == !!homogeneousv)) + return; + pd->homogeneoush = !!homogeneoush; pd->homogeneousv = !!homogeneousv; + efl_pack_layout_request(obj); } EOLIAN static void --
[EGIT] [core/efl] master 03/05: ui.box_flow: refactor layout_update
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=fbc7c31b33270a4d617bead2cf3baec61cc64b62 commit fbc7c31b33270a4d617bead2cf3baec61cc64b62 Author: Yeongjong Lee Date: Fri Mar 8 08:22:08 2019 -0500 ui.box_flow: refactor layout_update Summary: This patch remove evas_box function from Efl.Ui.Box_Flow and add unit test. Depends on D8214 Test Plan: 1. make check 2. `elementary_test -to 'efl.ui.box'` with 'flow' checkbox. Reviewers: zmike, Jaehyun_Cho Reviewed By: zmike Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8219 --- src/Makefile_Elementary.am | 1 + src/bin/elementary/test_ui_box.c| 18 +- src/lib/elementary/efl_ui_box_flow.c| 358 +--- src/lib/elementary/efl_ui_box_flow.eo | 18 -- src/tests/elementary/efl_ui_suite.c | 1 + src/tests/elementary/efl_ui_suite.h | 1 + src/tests/elementary/efl_ui_test_box_flow.c | 416 src/tests/elementary/meson.build| 1 + 8 files changed, 741 insertions(+), 73 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index 002d3f27ba..e29471912b 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -1922,6 +1922,7 @@ tests_elementary_efl_ui_suite_SOURCES = \ tests/elementary/efl_ui_test_focus.c \ tests/elementary/efl_ui_test_focus_sub.c \ tests/elementary/efl_ui_test_box.c \ + tests/elementary/efl_ui_test_box_flow.c \ tests/elementary/efl_ui_test_table.c \ tests/elementary/efl_ui_test_relative_layout.c \ tests/elementary/efl_ui_test_grid.c \ diff --git a/src/bin/elementary/test_ui_box.c b/src/bin/elementary/test_ui_box.c index c5b9db8d56..0021be5603 100644 --- a/src/bin/elementary/test_ui_box.c +++ b/src/bin/elementary/test_ui_box.c @@ -179,15 +179,7 @@ homo_check_cb(void *data, const Efl_Event *event) { Eina_Bool chk = elm_check_selected_get(event->object); Eo *box = efl_key_wref_get(data, "box"); - efl_ui_box_flow_homogenous_set(box, chk); -} - -static void -max_size_check_cb(void *data, const Efl_Event *event) -{ - Eina_Bool chk = elm_check_selected_get(event->object); - Eo *box = efl_key_wref_get(data, "box"); - efl_ui_box_flow_max_size_set(box, chk); + efl_ui_box_homogeneous_set(box, chk); } static void @@ -358,14 +350,6 @@ test_ui_box(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in efl_pack(bx, o); efl_gfx_entity_visible_set(o, 1); - o = elm_check_add(win); - elm_check_selected_set(o, 0); - elm_object_text_set(o, "Homogenous + Max"); - efl_event_callback_add(o, EFL_UI_CHECK_EVENT_CHANGED, max_size_check_cb, win); - efl_gfx_hint_align_set(o, 0, 0); - efl_pack(bx, o); - efl_gfx_entity_visible_set(o, 1); - o = elm_check_add(win); elm_check_selected_set(o, 0); elm_object_text_set(o, "Custom layout"); diff --git a/src/lib/elementary/efl_ui_box_flow.c b/src/lib/elementary/efl_ui_box_flow.c index a93ccc9e49..38bcb7d626 100644 --- a/src/lib/elementary/efl_ui_box_flow.c +++ b/src/lib/elementary/efl_ui_box_flow.c @@ -1,4 +1,5 @@ #include "efl_ui_box_private.h" +#include "efl_ui_container_layout.h" #define MY_CLASS EFL_UI_BOX_FLOW_CLASS @@ -6,75 +7,356 @@ typedef struct _Efl_Ui_Box_Flow_Data Efl_Ui_Box_Flow_Data; struct _Efl_Ui_Box_Flow_Data { - Eina_Bool homogenous; - Eina_Bool max_size; }; -EOLIAN static void -_efl_ui_box_flow_box_flow_homogenous_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd, Eina_Bool val) +typedef struct _Item_Calc Item_Calc; +typedef struct _Row_Calc Row_Calc; + +struct _Item_Calc { - pd->homogenous = val; -} + EINA_INLIST; -EOLIAN static Eina_Bool -_efl_ui_box_flow_box_flow_homogenous_get(const Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd) + Evas_Object *obj; + Row_Calc *row; + double weight_factor; + Efl_Ui_Container_Item_Hints hints[2]; /* 0 is x-axis, 1 is y-axis */ +}; + +struct _Row_Calc { - return pd->homogenous; -} + EINA_INLIST; -EOLIAN static void -_efl_ui_box_flow_box_flow_max_size_set(Eo *obj EINA_UNUSED, Efl_Ui_Box_Flow_Data *pd, Eina_Bool val) + Evas_Object *obj; + int item_count; + int min_sum; + int hgsize; + double weight_sum; + double cross_weight; + double cross_space; + double cur_pos; + double weight_factor; + Efl_Ui_Container_Item_Hints hint; +}; + +static int +_item_weight_sort_cb(const void *l1, const void *l2) { - pd->max_size = val; + Item_Calc *it1, *it2; + + it1 = EINA_INLIST_CONTAINER_GET(l1, Item_Calc); + it2 = EINA_INLIST_CONTAINER_GET(l2, Item_Calc); + + return it2->weight_factor <= it1->weight_factor ? -1 : 1; } -EOLIAN static Eina_Bool -_efl_ui_box_flow
[EGIT] [core/efl] master 01/01: elm_gengrid: fix correct parent-child relation of item content
hermet pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=97416e99969897114ea8a95578d19500f9b7863f commit 97416e99969897114ea8a95578d19500f9b7863f Author: Yeongjong Lee Date: Fri Mar 8 13:18:05 2019 +0900 elm_gengrid: fix correct parent-child relation of item content Summary: see 1b2401849a11c5826dead44b4839ca2acb1dbec1 that said `evas_object_smart_member_del` doesn't make sense here. I guess `_sub_object_del` should have been used when item_all_contents_unset is implemented. Item content should have widget(gengrid) as the parent. but that relationship is removed by c075b7caaac0c6cf8c1043312041afaf5. See also, `_item_content_realize` of genlist. Test Plan: make check Reviewers: Hermet, SanghyeonLee, bu5hm4n Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8238 --- src/lib/elementary/elm_gengrid.c| 3 +- src/tests/elementary/elm_test_gengrid.c | 51 + src/tests/elementary/elm_test_genlist.c | 51 + 3 files changed, 104 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index c08e2f4807..d1851b184a 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1108,6 +1108,7 @@ _item_content_realize(Elm_Gen_Item *it, _elm_widget_full_eval(content); } +elm_widget_sub_object_add(WIDGET(it), content); if (elm_wdg_item_disabled_get(EO_OBJ(it))) elm_widget_disabled_set(content, EINA_TRUE); @@ -1231,7 +1232,7 @@ _elm_gengrid_item_all_contents_unset(Eo *eo_item EINA_UNUSED, Elm_Gen_Item *it, EINA_LIST_FREE (it->contents, content) { -evas_object_smart_member_del(content); +_elm_widget_sub_object_redirect_to_top(WIDGET(it), content); // edje can be reused by item caching, // content should be un-swallowed from edje edje_object_part_unswallow(VIEW(it), content); diff --git a/src/tests/elementary/elm_test_gengrid.c b/src/tests/elementary/elm_test_gengrid.c index 87efc615c9..77a4eb46f7 100644 --- a/src/tests/elementary/elm_test_gengrid.c +++ b/src/tests/elementary/elm_test_gengrid.c @@ -153,11 +153,62 @@ EFL_START_TEST(elm_gengrid_focus) } EFL_END_TEST +static void +_gengrid_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + ecore_main_loop_quit(); +} + +static Evas_Object * +_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED) +{ + Evas_Object *ic = elm_button_add(obj); + return ic; +} + +EFL_START_TEST(elm_gengrid_item_content) +{ + Evas_Object *win, *gengrid; + Elm_Genlist_Item_Class *gtc; + Evas_Object *content, *parent; + Elm_Object_Item *it; + + gtc = elm_gengrid_item_class_new(); + gtc->item_style = "default"; + gtc->func.content_get = _item_content_get; + gtc->func.state_get = NULL; + gtc->func.del = NULL; + + win = win_add(NULL, "gengrid", ELM_WIN_BASIC); + + gengrid = elm_gengrid_add(win); + evas_object_smart_callback_add(gengrid, "realized", _gengrid_item_content_test_realize, NULL); + + it = elm_gengrid_item_append(gengrid, gtc, NULL, NULL, NULL); + + evas_object_resize(gengrid, 100, 100); + evas_object_resize(win, 150, 150); + evas_object_show(gengrid); + evas_object_show(win); + + ecore_main_loop_begin(); + + content = elm_object_item_part_content_get(it, "elm.swallow.end"); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, gengrid); + + elm_gengrid_item_all_contents_unset(it, NULL); + parent = elm_object_parent_widget_get(content); + ck_assert_ptr_eq(parent, win); +} +EFL_END_TEST + void elm_test_gengrid(TCase *tc) { tcase_add_test(tc, elm_gengrid_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); tcase_add_test(tc, elm_gengrid_focus); + tcase_add_test(tc, elm_gengrid_item_content); #if 0 tcase_add_test(tc, elm_atspi_children_parent); #endif diff --git a/src/tests/elementary/elm_test_genlist.c b/src/tests/elementary/elm_test_genlist.c index d0f89aa4d7..894a6fb0f0 100644 --- a/src/tests/elementary/elm_test_genlist.c +++ b/src/tests/elementary/elm_test_genlist.c @@ -119,6 +119,56 @@ EFL_START_TEST(elm_genlist_test_item_iteration) } EFL_END_TEST +static void +_genlist_item_content_test_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + ecore_main_loop_quit(); +} + +static Evas_Object * +_item_content_get(void *data EINA_UNUSED, Evas_Object *obj, const char *part EINA_UNUSED) +{ + Evas_Object *ic = elm_button_add(obj); + return ic; +} + +EFL_START_TEST(elm_genlist_test_item_content) +{ +
[EGIT] [core/efl] master 03/06: ui.table: fix infinite loop when initializing calc data
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=b857fa742084663cfb378596e3ae1455bbd24b67 commit b857fa742084663cfb378596e3ae1455bbd24b67 Author: Yeongjong Lee Date: Thu Mar 7 01:02:09 2019 + ui.table: fix infinite loop when initializing calc data infinite loop if first cell is empty. Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8170 --- src/lib/elementary/efl_ui_table_layout.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c index f017b33b9d..26c288f022 100644 --- a/src/lib/elementary/efl_ui_table_layout.c +++ b/src/lib/elementary/efl_ui_table_layout.c @@ -152,6 +152,7 @@ _efl_ui_table_regular_cell_init(Table_Calc *table_calc, Eina_Bool axis) for (i = 0; i < count; i++) { if (!cell_calc[i].occupied) continue; +else if (i && cell_calc[0].next == 0) cell_calc[0].next = i; cell_calc[i].index = index++; want += cell_calc[i].space; --
[EGIT] [core/efl] master 06/06: ui.box, ui.table: respect user min
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=0b7cd8d88ec2192b60c830a5d0d2bd89fd859c84 commit 0b7cd8d88ec2192b60c830a5d0d2bd89fd859c84 Author: Yeongjong Lee Date: Thu Mar 7 01:40:23 2019 + ui.box, ui.table: respect user min Use restricted_min_set instead of min_set in layout_update. min_set is set by public API(user side). if it is changed by internal function, user will get unexpected value later. please check added test case. Note that this reverts commit e013480e7a0ae11a9363f9a207cf63e3bb7f5423. instead, this patch provides better solution of the issue refered in e013480e7. Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8214 --- src/lib/elementary/efl_ui_box_layout.c | 7 +-- src/lib/elementary/efl_ui_container_layout.c | 4 -- src/lib/elementary/efl_ui_container_layout.h | 1 - src/lib/elementary/efl_ui_table_layout.c | 12 ++--- src/tests/elementary/efl_ui_test_box.c | 65 +++- src/tests/elementary/efl_ui_test_table.c | 65 +++- 6 files changed, 134 insertions(+), 20 deletions(-) diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c index c66a1a8c2e..4cc00e0c48 100644 --- a/src/lib/elementary/efl_ui_box_layout.c +++ b/src/lib/elementary/efl_ui_box_layout.c @@ -47,7 +47,7 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) count = eina_list_count(bd->children); if (!count) { -efl_gfx_hint_size_min_set(ui_box, EINA_SIZE2D(0, 0)); +efl_gfx_hint_size_restricted_min_set(ui_box, EINA_SIZE2D(0, 0)); return; } @@ -199,8 +199,5 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) want[1] += (box_calc[1].margin[0] + box_calc[1].margin[1]) + (box_calc[1].pad * (count - 1)); - if (want[0] < box_calc[0].min) want[0] = box_calc[0].min; - if (want[1] < box_calc[1].min) want[1] = box_calc[1].min; - - efl_gfx_hint_size_min_set(ui_box, EINA_SIZE2D(want[0], want[1])); + efl_gfx_hint_size_restricted_min_set(ui_box, EINA_SIZE2D(want[0], want[1])); } diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c index 4fbdc07b91..e8c5979dd0 100644 --- a/src/lib/elementary/efl_ui_container_layout.c +++ b/src/lib/elementary/efl_ui_container_layout.c @@ -112,14 +112,10 @@ _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc) { Eina_Rect geom; Eina_Bool pad_scalable; - Eina_Size2D min; geom = efl_gfx_entity_geometry_get(obj); efl_gfx_hint_margin_get(obj, [0].margin[0], [0].margin[1], [1].margin[0], [1].margin[1]); - min = efl_gfx_hint_size_combined_min_get(obj); - calc[0].min = min.w; - calc[1].min = min.h; calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj); efl_pack_padding_get(obj, [0].pad, [1].pad, _scalable); diff --git a/src/lib/elementary/efl_ui_container_layout.h b/src/lib/elementary/efl_ui_container_layout.h index 85d3695e9d..097abee13b 100644 --- a/src/lib/elementary/efl_ui_container_layout.h +++ b/src/lib/elementary/efl_ui_container_layout.h @@ -28,7 +28,6 @@ struct _Efl_Ui_Container_Layout_Calc { int pos; int size; - int min; int margin[2]; double align; double scale; diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c index 26c288f022..8821fc15dd 100644 --- a/src/lib/elementary/efl_ui_table_layout.c +++ b/src/lib/elementary/efl_ui_table_layout.c @@ -232,7 +232,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) if (!pd->count) { -efl_gfx_hint_size_min_set(ui_table, EINA_SIZE2D(0, 0)); +efl_gfx_hint_size_restricted_min_set(ui_table, EINA_SIZE2D(0, 0)); return; } @@ -369,11 +369,7 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) + (table_calc.layout_calc[1].pad * table_calc.cell_calc[1][rows - 1].index); - if (table_calc.want[0] < table_calc.layout_calc[0].min) - table_calc.want[0] = table_calc.layout_calc[0].min; - if (table_calc.want[1] < table_calc.layout_calc[1].min) - table_calc.want[1] = table_calc.layout_calc[1].min; - - efl_gfx_hint_size_min_set(ui_table, EINA_SIZE2D(table_calc.want[0], - table_calc.want[1])); + efl_gfx_hint_size_restricted_min_set(ui_table, +EINA_SIZE2D(table_calc.want[0], +table_calc.want[1])); } diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c index ee6532226c..d29c666eb1 100644 --- a/src/tests/elementary/efl_ui_test_box
[EGIT] [core/efl] master 02/06: test/elm_box: clean up elm_box_disabled_test
cedric pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=f1d5b8a40ca7017e5c77c2b55e8df1e06eb78598 commit f1d5b8a40ca7017e5c77c2b55e8df1e06eb78598 Author: Yeongjong Lee Date: Thu Mar 7 10:44:30 2019 + test/elm_box: clean up elm_box_disabled_test 1. remove unrelated test. 2. fix indentation 3. use proper parameters of `elm_win_resize_object_add` Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8218 --- src/tests/elementary/elm_test_box.c | 18 +++--- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/src/tests/elementary/elm_test_box.c b/src/tests/elementary/elm_test_box.c index e8c126f0d0..8ec5111770 100644 --- a/src/tests/elementary/elm_test_box.c +++ b/src/tests/elementary/elm_test_box.c @@ -44,19 +44,18 @@ EFL_END_TEST EFL_START_TEST(elm_box_disabled_test) { Evas_Object *win, *box, *o; - Efl_Access_Role role; + int i; win = win_add(NULL, "box", ELM_WIN_BASIC); box = elm_box_add(win); - elm_win_resize_object_add(box, win); - role = efl_access_object_role_get(box); + elm_win_resize_object_add(win, box); - for (int i = 0; i < 3; ++i) - { - o = elm_button_add(box); - elm_box_pack_end(box, o); - } + for (i = 0; i < 3; ++i) + { +o = elm_button_add(box); +elm_box_pack_end(box, o); + } elm_object_disabled_set(box, EINA_TRUE); elm_object_disabled_set(box, EINA_TRUE); @@ -72,9 +71,6 @@ EFL_START_TEST(elm_box_disabled_test) elm_object_disabled_set(box, EINA_FALSE); ck_assert_int_eq(elm_object_disabled_get(box), EINA_FALSE); ck_assert_int_eq(elm_object_disabled_get(o), EINA_TRUE); - - ck_assert(role == EFL_ACCESS_ROLE_FILLER); - } EFL_END_TEST --
[EGIT] [core/efl] master 01/01: ui.box, ui.table: respect parent hint size min
xartigas pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=e013480e7a0ae11a9363f9a207cf63e3bb7f5423 commit e013480e7a0ae11a9363f9a207cf63e3bb7f5423 Author: Yeongjong Lee Date: Tue Mar 5 09:12:52 2019 +0100 ui.box, ui.table: respect parent hint size min Summary: This patch fixes issue that parent hint size min is ignored when it is greater than children hint size min sum. Thanks to segfaultxavi for reporting this. Test Plan: 1. make check 2. 'hello-gui' or 'texteditor' example in examples.git Reviewers: segfaultxavi, zmike Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8098 --- src/lib/elementary/efl_ui_box_layout.c | 3 +++ src/lib/elementary/efl_ui_container_layout.c | 4 src/lib/elementary/efl_ui_container_layout.h | 1 + src/lib/elementary/efl_ui_table_layout.c | 5 + src/tests/elementary/efl_ui_test_box.c | 1 + src/tests/elementary/efl_ui_test_table.c | 1 + 6 files changed, 15 insertions(+) diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c index bc9ea63c86..c66a1a8c2e 100644 --- a/src/lib/elementary/efl_ui_box_layout.c +++ b/src/lib/elementary/efl_ui_box_layout.c @@ -199,5 +199,8 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd) want[1] += (box_calc[1].margin[0] + box_calc[1].margin[1]) + (box_calc[1].pad * (count - 1)); + if (want[0] < box_calc[0].min) want[0] = box_calc[0].min; + if (want[1] < box_calc[1].min) want[1] = box_calc[1].min; + efl_gfx_hint_size_min_set(ui_box, EINA_SIZE2D(want[0], want[1])); } diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c index e8c5979dd0..4fbdc07b91 100644 --- a/src/lib/elementary/efl_ui_container_layout.c +++ b/src/lib/elementary/efl_ui_container_layout.c @@ -112,10 +112,14 @@ _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc) { Eina_Rect geom; Eina_Bool pad_scalable; + Eina_Size2D min; geom = efl_gfx_entity_geometry_get(obj); efl_gfx_hint_margin_get(obj, [0].margin[0], [0].margin[1], [1].margin[0], [1].margin[1]); + min = efl_gfx_hint_size_combined_min_get(obj); + calc[0].min = min.w; + calc[1].min = min.h; calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj); efl_pack_padding_get(obj, [0].pad, [1].pad, _scalable); diff --git a/src/lib/elementary/efl_ui_container_layout.h b/src/lib/elementary/efl_ui_container_layout.h index 097abee13b..85d3695e9d 100644 --- a/src/lib/elementary/efl_ui_container_layout.h +++ b/src/lib/elementary/efl_ui_container_layout.h @@ -28,6 +28,7 @@ struct _Efl_Ui_Container_Layout_Calc { int pos; int size; + int min; int margin[2]; double align; double scale; diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c index b3009e9f7c..f017b33b9d 100644 --- a/src/lib/elementary/efl_ui_table_layout.c +++ b/src/lib/elementary/efl_ui_table_layout.c @@ -368,6 +368,11 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd) + (table_calc.layout_calc[1].pad * table_calc.cell_calc[1][rows - 1].index); + if (table_calc.want[0] < table_calc.layout_calc[0].min) + table_calc.want[0] = table_calc.layout_calc[0].min; + if (table_calc.want[1] < table_calc.layout_calc[1].min) + table_calc.want[1] = table_calc.layout_calc[1].min; + efl_gfx_hint_size_min_set(ui_table, EINA_SIZE2D(table_calc.want[0], table_calc.want[1])); } diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c index af4eab0874..ee6532226c 100644 --- a/src/tests/elementary/efl_ui_test_box.c +++ b/src/tests/elementary/efl_ui_test_box.c @@ -187,6 +187,7 @@ static void btn_hint_set(Eo *btn, Hint *hint) { efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_min_set(layout, hint->layout_size); efl_gfx_hint_size_max_set(btn, hint->max); efl_gfx_hint_size_min_set(btn, hint->min); efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c index 467208e651..66443efa6b 100644 --- a/src/tests/elementary/efl_ui_test_table.c +++ b/src/tests/elementary/efl_ui_test_table.c @@ -212,6 +212,7 @@ static void btn_hint_set(Eo *btn, Hint *hint) { efl_gfx_entity_size_set(layout, hint->layout_size); + efl_gfx_hint_size_min_set(layout, hint->layout_size); efl_gfx_hint_size_max_set(btn, hint->max); efl_gfx_hint_size_min_set(btn, hint->min); efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr, --
[EGIT] [core/efl] master 03/03: efl_container: remove content_remove
bu5hm4n pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=4628021fe547214b81238a0b1d410240174313ff commit 4628021fe547214b81238a0b1d410240174313ff Author: Yeongjong Lee Date: Tue Feb 12 11:55:11 2019 + efl_container: remove content_remove Most of classes implements Efl.Container.content_remove are just calling "unpack" except of "Efl.Canvas.Layout" and "Efl.Ui.Layout". This patch remove the asymmetrical API and add content_remove API of "Efl.Canvas.Layout" and "Efl.Ui.Layout" that child can be remove without efl_part APIs. ref T7576 Reviewed-by: Marcel Hollerbach Reviewed-by: Mike Blumenkrantz Differential Revision: https://phab.enlightenment.org/D7913 --- src/lib/edje/edje_part_box.c | 6 -- src/lib/edje/edje_part_invalid.c | 1 - src/lib/edje/edje_part_swallow.c | 2 +- src/lib/edje/edje_part_table.c | 6 -- src/lib/edje/edje_util.c | 4 ++-- src/lib/edje/efl_canvas_layout.eo | 8 +++- src/lib/edje/efl_canvas_layout_part_box.eo | 1 - src/lib/edje/efl_canvas_layout_part_invalid.eo | 1 - src/lib/edje/efl_canvas_layout_part_table.eo | 1 - src/lib/efl/interfaces/efl_container.eo| 7 --- src/lib/elementary/efl_ui_box.c| 8 src/lib/elementary/efl_ui_box.eo | 1 - src/lib/elementary/efl_ui_flip.c | 9 - src/lib/elementary/efl_ui_flip.eo | 1 - src/lib/elementary/efl_ui_layout.c | 17 - src/lib/elementary/efl_ui_layout_base.eo | 1 - src/lib/elementary/efl_ui_layout_pack.c| 14 -- src/lib/elementary/efl_ui_layout_part_box.eo | 1 - src/lib/elementary/efl_ui_layout_part_table.eo | 1 - src/lib/elementary/efl_ui_table.c | 7 --- src/lib/elementary/efl_ui_table.eo | 1 - src/tests/edje/edje_test_container.c | 2 +- src/tests/edje/edje_test_swallow.c | 2 +- 23 files changed, 12 insertions(+), 90 deletions(-) diff --git a/src/lib/edje/edje_part_box.c b/src/lib/edje/edje_part_box.c index f737159c6e..db158d6cb8 100644 --- a/src/lib/edje/edje_part_box.c +++ b/src/lib/edje/edje_part_box.c @@ -99,12 +99,6 @@ _efl_canvas_layout_part_box_efl_pack_linear_pack_content_get(Eo *obj, void *_pd return _edje_part_box_content_at(pd->ed, pd->part, index); } -EOLIAN static Eina_Bool -_efl_canvas_layout_part_box_efl_container_content_remove(Eo *obj, void *_pd EINA_UNUSED, Efl_Gfx_Entity *subobj) -{ - return efl_pack_unpack(obj, subobj); -} - EOLIAN static int _efl_canvas_layout_part_box_efl_pack_linear_pack_index_get(Eo *obj, void *_pd EINA_UNUSED, const Efl_Gfx_Entity * subobj) { diff --git a/src/lib/edje/edje_part_invalid.c b/src/lib/edje/edje_part_invalid.c index 3e508b3fe0..d36491d674 100644 --- a/src/lib/edje/edje_part_invalid.c +++ b/src/lib/edje/edje_part_invalid.c @@ -74,7 +74,6 @@ EDJE_PART_INVALID_CONST(Eina_Bool, 0, efl_text_cursor_geometry_get, _efl_canvas_ EDJE_PART_INVALID_VOID(efl_text_markup_interactive_cursor_markup_insert, _efl_canvas_layout_part_invalid_efl_text_markup_interactive_cursor_markup_insert, Efl_Text_Cursor_Cursor *cur, const char *markup) EDJE_PART_INVALID(Eina_Iterator *, 0, efl_content_iterate, _efl_canvas_layout_part_invalid_efl_container_content_iterate) EDJE_PART_INVALID(int, 0, efl_content_count, _efl_canvas_layout_part_invalid_efl_container_content_count) -EDJE_PART_INVALID(Eina_Bool, 0, efl_content_remove, _efl_canvas_layout_part_invalid_efl_container_content_remove, Efl_Gfx_Entity *content) EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_clear, _efl_canvas_layout_part_invalid_efl_pack_pack_clear) EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_unpack_all, _efl_canvas_layout_part_invalid_efl_pack_unpack_all) EDJE_PART_INVALID(Eina_Bool, 0, efl_pack_unpack, _efl_canvas_layout_part_invalid_efl_pack_unpack, Efl_Gfx_Entity *subobj) diff --git a/src/lib/edje/edje_part_swallow.c b/src/lib/edje/edje_part_swallow.c index bf4c2b59cb..e0c0aec568 100644 --- a/src/lib/edje/edje_part_swallow.c +++ b/src/lib/edje/edje_part_swallow.c @@ -27,7 +27,7 @@ _efl_canvas_layout_part_swallow_efl_content_content_unset(Eo *obj, void *_pd EIN PROXY_DATA_GET(obj, pd); Efl_Gfx_Entity *content = _edje_efl_content_content_get(pd->ed, pd->part); if (!content) return NULL; - efl_content_remove(obj, content); + efl_canvas_layout_content_remove(obj, content); return content; } diff --git a/src/lib/edje/edje_part_table.c b/src/lib/edje/edje_part_table.c index cc2439dd89..87709ed368 100644 --- a/src/lib/edje/edje_part_table.c +++ b/src/lib/edje/edje_part_table.c @@ -29,12 +29,6 @@ _efl_canvas_layout_part_table_efl_container_content_count(Eo *obj, void *_pd EIN return evas_
[EGIT] [core/efl] master 01/03: efl_ui_table: refactor layout_update
zmike pushed a commit to branch master. http://git.enlightenment.org/core/efl.git/commit/?id=5572000f1a02ed1107d3757d7ca06727c1217813 commit 5572000f1a02ed1107d3757d7ca06727c1217813 Author: Yeongjong Lee Date: Wed Feb 27 14:45:27 2019 -0500 efl_ui_table: refactor layout_update Summary: There are three reasons to refactor layout_update of Efl.Ui.Table. === 1. Inconsistency of hint behavior. === Some hint property is often not respected. for example, hint_min is ignored in Table when it is used with hint_max even if hint_weight is 0. hint_aspect is always ignored in Table. The ambiguous behavior make it hard to layout widgets in container. of course, we documented 'it's just a hint that should be used whenever appropriate.' but i don't think it means that 'hint API is sometimes respected and we also don't know when that API is respected.'. at least there is rule for consistent behavior and we should be able to explain why a widget is located here and why some hint property is ignored. So, i'll suggest priority of hint property. this refactoring support following priority. 1) HintMin 2) HintMin + HintAspect 3) HintMargin 4) HintMax 5) HintAspect 6) HintWeight, HintFill 7) HintAlign ref T5487 Please check with unit test D7840 === 2. To Enhance usability. === Efl.Ui.Table is using homogeneous mode of evas_table which have same columns, rows size. but i think a table can generally change columns, rows size and we can provide homogeneous mode option.(D7892) In this patch - table columns(rows) min size is decided by maximum size among its cells width(height) min size. - table columns(rows) weight is decided by maximum weight among its cells horizontal(vertical) weight. Also, pack_align is implemented. it is used if no item has a weight. === 3. To remove internal evas_table. === This is low priority work. however, i guess is is necessary for lightweight container widget. there are two size_hint callback to adjust table size and efl_canvas_group_calculate is called twice when it is resized. This patch is first step to remove internal evas_table. Test Plan: make check elementary_test -to 'efl.ui.table' Reviewers: jpeg, Jaehyun_Cho, zmike Reviewed By: zmike Subscribers: zmike, cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T5487 Differential Revision: https://phab.enlightenment.org/D7841 --- src/Makefile_Elementary.am | 3 + src/bin/elementary/test_ui_table.c | 26 +- src/lib/elementary/efl_ui_box_layout.c | 342 --- src/lib/elementary/efl_ui_container_layout.c | 158 + src/lib/elementary/efl_ui_container_layout.h | 42 src/lib/elementary/efl_ui_table.c| 44 +++- src/lib/elementary/efl_ui_table.eo | 1 + src/lib/elementary/efl_ui_table_layout.c | 294 +++ src/lib/elementary/efl_ui_table_private.h| 5 + src/lib/elementary/meson.build | 3 + 10 files changed, 653 insertions(+), 265 deletions(-) diff --git a/src/Makefile_Elementary.am b/src/Makefile_Elementary.am index c020b343d4..98d953df9c 100644 --- a/src/Makefile_Elementary.am +++ b/src/Makefile_Elementary.am @@ -826,6 +826,8 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/els_cursor.c \ lib/elementary/els_tooltip.c \ lib/elementary/elu_ews_wm.c \ + lib/elementary/efl_ui_container_layout.c \ + lib/elementary/efl_ui_container_layout.h \ lib/elementary/efl_ui_box.c \ lib/elementary/efl_ui_box_flow.c \ lib/elementary/efl_ui_box_stack.c \ @@ -838,6 +840,7 @@ lib_elementary_libelementary_la_SOURCES = \ lib/elementary/efl_ui_anchor_popup.c \ lib/elementary/efl_ui_table.c \ lib/elementary/efl_ui_table_static.c \ + lib/elementary/efl_ui_table_layout.c \ lib/elementary/efl_ui_table_private.h \ lib/elementary/efl_ui_text.c \ lib/elementary/efl_ui_text_factory_images.c \ diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index 098fe139b7..2f698f103c 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -34,31 +34,31 @@ weights_cb(void *data, const Efl_Event *event) { case NONE: efl_gfx_hint_align_set(table, 0.5, 0.5); -for (int i = 0; i < 7; i++) +for (int i = 1; i < 7; i++) efl_gfx_hint_weight_set(objects[i], 0, 0); break; case NONE_BUT_FILL: efl_gfx_hint_fill_set(table, EINA_TRUE, EINA_TRUE); -for (int i = 0; i < 7; i++) +for (int i = 1; i < 7; i++) efl_gfx_hint_weight_set(objects[i], 0, 0); break;