From 5f1f361c088fe5e2d7bf6efc51921e9bb769c037 Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 25 Jul 2019 15:02:02 +0900 Subject: [PATCH 01/72] evas image: apply filter at runtime Summary: If you call efl_gfx_filter_program_set in a mouse event callback, it does not work. Because render_pre removes area uisng evas_render_update_del. Reviewers: Hermet, jpeg, jsuya, cedric Reviewed By: Hermet, cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9301 --- src/lib/evas/canvas/evas_image_private.h | 1 + src/lib/evas/canvas/evas_object_image.c | 9 ++++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/evas/canvas/evas_image_private.h b/src/lib/evas/canvas/evas_image_private.h index 664d60e684..efd53209c8 100644 --- a/src/lib/evas/canvas/evas_image_private.h +++ b/src/lib/evas/canvas/evas_image_private.h @@ -146,6 +146,7 @@ struct _Evas_Image_Data Eina_Bool written : 1; Eina_Bool direct_render : 1; Eina_Bool has_filter : 1; + Eina_Bool changed_filter : 1; Eina_Bool buffer_data_set : 1; struct { diff --git a/src/lib/evas/canvas/evas_object_image.c b/src/lib/evas/canvas/evas_object_image.c index 50a064a287..0f2c10aa10 100644 --- a/src/lib/evas/canvas/evas_object_image.c +++ b/src/lib/evas/canvas/evas_object_image.c @@ -1937,8 +1937,9 @@ _efl_canvas_image_internal_efl_canvas_filter_internal_filter_dirty(Eo *eo_obj, E { Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS); - o->changed = 1; + o->changed = EINA_TRUE; evas_object_change(eo_obj, obj); + o->changed_filter = EINA_TRUE; } EOLIAN static Eina_Bool @@ -2891,6 +2892,11 @@ evas_object_image_render_pre(Evas_Object *eo_obj, } if (o->changed) { + if (o->changed_filter) + { + evas_object_render_pre_prev_cur_add(&e->clip_changes, eo_obj, obj); + goto done; + } if (((o->cur->f) && (!o->prev->f)) || ((!o->cur->f) && (o->prev->f)) || ((o->cur->key) && (!o->prev->key)) || @@ -3216,6 +3222,7 @@ done: } } o->changed = EINA_FALSE; + o->changed_filter = EINA_FALSE; } static void From dd484a54dca4baf7421f9c633ed1b5630c0efd66 Mon Sep 17 00:00:00 2001 From: SubhransuSekhar Mohanty Date: Thu, 25 Jul 2019 15:17:05 +0900 Subject: [PATCH 02/72] efl_canvas_vg svg: free the svg tree returned by eet_data_read() The eet_data_read() api creates the structure by referencing the wwt data structure and reading from eet file. So the structure should be deleted by the user of the function. As eet_data_read() api documentation dosen't specify about the ownership I guess we need to free this structure to avoid memory leak. --- src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c index f0bde2e5ca..8d04aec0f1 100644 --- a/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c +++ b/src/modules/evas/vg_loaders/eet/evas_vg_load_eet.c @@ -36,7 +36,9 @@ evas_vg_load_file_open_eet(Eina_File *file, const char *key, int *error EINA_UNU { *error = EVAS_LOAD_ERROR_NONE; } - return vg_common_svg_create_vg_node(node); + Vg_File_Data *vg_data = vg_common_svg_create_vg_node(node); + vg_common_svg_node_free(node); + return vg_data; } static Eina_Bool From 4b80c5b4e14d62138464a9c629ad3209922b2c48 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 25 Jul 2019 16:38:52 +0200 Subject: [PATCH 03/72] mono-docs: More tweaks to the docs blacklist --- doc/docfx/filterConfig.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/docfx/filterConfig.yml b/doc/docfx/filterConfig.yml index 616c03fb87..e03726ce9c 100644 --- a/doc/docfx/filterConfig.yml +++ b/doc/docfx/filterConfig.yml @@ -4,7 +4,7 @@ apiRules: - exclude: uidRegex: ^.*NativeStruct$ - exclude: - uidRegex: ^.*ConstructingHandle.*$ + uidRegex: ^.*NativeClass$ - exclude: uidRegex: ^.*WrappingHandle.*$ - exclude: From 5a3d659006c66c82617aafa544218f141d33d323 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 25 Jul 2019 17:30:44 +0200 Subject: [PATCH 04/72] mono-docs: Clearer docs for ConstructingHandle Only *slightly* clearer. --- src/bin/eolian_mono/eolian/mono/klass.hh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/eolian_mono/eolian/mono/klass.hh b/src/bin/eolian_mono/eolian/mono/klass.hh index a98866e34a..46215b95a1 100644 --- a/src/bin/eolian_mono/eolian/mono/klass.hh +++ b/src/bin/eolian_mono/eolian/mono/klass.hh @@ -204,7 +204,8 @@ struct klass if (!as_generator ( - scope_tab << "/// Constructor to be used when objects are expected to be constructed from native code.\n" + scope_tab << "/// Subclasses should override this constructor if they are expected to be instantiated from native code.\n" + << scope_tab << "/// Do not call this constructor directly.\n" << scope_tab << "/// Tag struct storing the native handle of the object being constructed.\n" << scope_tab << "private " << concrete_name << "(ConstructingHandle ch) : base(ch)\n" << scope_tab << "{\n" @@ -511,7 +512,8 @@ struct klass << (*(scope_tab << scope_tab << constructor_invocation << "\n")) << scope_tab << scope_tab << "FinishInstantiation();\n" << scope_tab << "}\n\n" - << scope_tab << "/// Constructor to be used when objects are expected to be constructed from native code.\n" + << scope_tab << "/// Subclasses should override this constructor if they are expected to be instantiated from native code.\n" + << scope_tab << "/// Do not call this constructor directly.\n" << scope_tab << "/// Tag struct storing the native handle of the object being constructed.\n" << scope_tab << "protected " << inherit_name << "(ConstructingHandle ch) : base(ch)\n" << scope_tab << "{\n" From a5420ac8f30ae304afe822177e509d7cb2df82aa Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 13:35:41 -0400 Subject: [PATCH 05/72] tests/ecore: verify that quit() -> begin() does not pre-cancel main loop Summary: ref 17f433c57bfa11319a22fde1aedb21e99a3a1268 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9375 --- src/tests/ecore/ecore_test_ecore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tests/ecore/ecore_test_ecore.c b/src/tests/ecore/ecore_test_ecore.c index 8fe433f5a1..6439bc32d2 100644 --- a/src/tests/ecore/ecore_test_ecore.c +++ b/src/tests/ecore/ecore_test_ecore.c @@ -39,6 +39,8 @@ EFL_START_TEST(ecore_test_ecore_main_loop) timer = ecore_timer_add(0.0, _quit_cb, &did); fail_if(timer == NULL); + /* ensure that this does not auto-cancel main loop */ + ecore_main_loop_quit(); ecore_main_loop_begin(); fail_if(did == EINA_FALSE); From eaf8dff2cc485455489615a190df1ebcd00aab94 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 24 Jul 2019 20:49:38 +0200 Subject: [PATCH 06/72] efl_ui_item_container: speed up item lookup the problem with accessor is that the normal eina accessor is only for immutable lists, by the time you change the list, the accessor has a problem and might crash. This would mean we have to recreate the accessors after every change to the internal list representation, which would invalidate the cache all the time. The usage of grid and list here is also very performant in cache using, all the usages normally iterate forward or backward, which makes this cache really helpfull. With this commit the lookup of sizes is improved a lot, because eina_list_nth is not used anymore. (Cuts of ~90ms in creation time) Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9387 --- src/lib/elementary/efl_ui_item_container.c | 319 +++++++++++---------- 1 file changed, 160 insertions(+), 159 deletions(-) diff --git a/src/lib/elementary/efl_ui_item_container.c b/src/lib/elementary/efl_ui_item_container.c index c7758ba8a9..e2a8a65b7d 100644 --- a/src/lib/elementary/efl_ui_item_container.c +++ b/src/lib/elementary/efl_ui_item_container.c @@ -12,6 +12,139 @@ #include "elm_widget.h" #include "elm_priv.h" +typedef struct { + Eina_Accessor acc; + unsigned int last_index; + const Eina_List *current; + Eina_List **items; +} Fast_Accessor; + +static Eina_Bool +_fast_accessor_get_at(Fast_Accessor *accessor, unsigned int idx, void **data) +{ + const Eina_List *over; + unsigned int middle; + unsigned int i; + + if (idx >= eina_list_count(*accessor->items)) + return EINA_FALSE; + + if (accessor->last_index == idx) + over = accessor->current; + else if (idx > accessor->last_index) + { + /* After current position. */ + middle = ((eina_list_count(*accessor->items) - accessor->last_index))/2; + + if (idx > middle) + /* Go backward from the end. */ + for (i = eina_list_count(*accessor->items) - 1, + over = eina_list_last(*accessor->items); + i > idx && over; + --i, over = eina_list_prev(over)) + ; + else + /* Go forward from current. */ + for (i = accessor->last_index, over = accessor->current; + i < idx && over; + ++i, over = eina_list_next(over)) + ; + } + else + { + /* Before current position. */ + middle = accessor->last_index/2; + + if (idx > middle) + /* Go backward from current. */ + for (i = accessor->last_index, over = accessor->current; + i > idx && over; + --i, over = eina_list_prev(over)) + ; + else + /* Go forward from start. */ + for (i = 0, over = *accessor->items; + i < idx && over; + ++i, over = eina_list_next(over)) + ; + } + + if (!over) + return EINA_FALSE; + + accessor->last_index = idx; + accessor->current = over; + + *data = eina_list_data_get(over); + return EINA_TRUE; +} + + +static Eina_Accessor* +_fast_accessor_clone(Fast_Accessor *accessor) +{ + return eina_list_accessor_new(*accessor->items); +} + +static Eina_List * +_fast_accessor_get_container(Fast_Accessor *accessor EINA_UNUSED) +{ + ERR("Not allowed to get a container!"); + return NULL; +} + +static void +_fast_accessor_free(Fast_Accessor *accessor EINA_UNUSED) +{ + ERR("Freeing this accessor is not supported"); +} + +static void +_fast_accessor_init(Fast_Accessor *accessor, Eina_List **items) +{ + //this is the accessor for accessing the items + //we have to workarround here the problem that + //no accessor can be created for a not yet created list. + accessor->acc.version = EINA_ACCESSOR_VERSION; + accessor->acc.get_at = FUNC_ACCESSOR_GET_AT(_fast_accessor_get_at); + accessor->acc.clone = FUNC_ACCESSOR_CLONE(_fast_accessor_clone); + accessor->acc.get_container = FUNC_ACCESSOR_GET_CONTAINER(_fast_accessor_get_container); + accessor->acc.free = FUNC_ACCESSOR_FREE(_fast_accessor_free); + EINA_MAGIC_SET(&accessor->acc, EINA_MAGIC_ACCESSOR); + accessor->items = items; +} + +static void +_fast_accessor_remove(Fast_Accessor *accessor, const Eina_List *removed_elem) +{ + if (accessor->current == removed_elem) + { + Eina_List *next; + Eina_List *prev; + + next = eina_list_next(removed_elem); + prev = eina_list_prev(removed_elem); + if (next) + { + accessor->current = next; + accessor->last_index ++; + } + else if (prev) + { + accessor->current = prev; + accessor->last_index --; + } + else + { + //everything >= length is invalid, and we need that. + accessor->last_index = eina_list_count(*accessor->items); + accessor->current = NULL; + } + + } + +} + #define MY_CLASS EFL_UI_ITEM_CONTAINER_CLASS #define MY_DATA_GET(obj, pd) \ @@ -26,16 +159,12 @@ typedef struct { Efl_Ui_Layout_Orientation dir; Eina_Size2D content_min_size; Efl_Ui_Position_Manager_Entity *pos_man; - struct { - Eina_Accessor pass_on; - unsigned int last_index; - const Eina_List *current; - } obj_accessor; struct { Eina_Bool w; Eina_Bool h; } match_content; - Eina_Accessor size_accessor; + Fast_Accessor obj_accessor; + Fast_Accessor size_accessor; Efl_Gfx_Entity *sizer; } Efl_Ui_Item_Container_Data; @@ -79,138 +208,6 @@ index_adjust(Efl_Ui_Item_Container_Data *pd, int index) return index; } -static Eina_Bool -_obj_accessor_get_at(Eina_Accessor *accessor, unsigned int idx, void **data) -{ - ptrdiff_t offset = offsetof(Efl_Ui_Item_Container_Data, obj_accessor); - Efl_Ui_Item_Container_Data *pd = (void*)accessor - offset; - const Eina_List *over; - unsigned int middle; - unsigned int i; - - if (idx >= eina_list_count(pd->items)) - return EINA_FALSE; - - if (pd->obj_accessor.last_index == idx) - over = pd->obj_accessor.current; - else if (idx > pd->obj_accessor.last_index) - { - /* After current position. */ - middle = ((eina_list_count(pd->items) - pd->obj_accessor.last_index))/2; - - if (idx > middle) - /* Go backward from the end. */ - for (i = eina_list_count(pd->items) - 1, - over = eina_list_last(pd->items); - i > idx && over; - --i, over = eina_list_prev(over)) - ; - else - /* Go forward from current. */ - for (i = pd->obj_accessor.last_index, over = pd->obj_accessor.current; - i < idx && over; - ++i, over = eina_list_next(over)) - ; - } - else - { - /* Before current position. */ - middle = pd->obj_accessor.last_index/2; - - if (idx > middle) - /* Go backward from current. */ - for (i = pd->obj_accessor.last_index, over = pd->obj_accessor.current; - i > idx && over; - --i, over = eina_list_prev(over)) - ; - else - /* Go forward from start. */ - for (i = 0, over = pd->items; - i < idx && over; - ++i, over = eina_list_next(over)) - ; - } - - if (!over) - return EINA_FALSE; - - pd->obj_accessor.last_index = idx; - pd->obj_accessor.current = over; - - *data = eina_list_data_get(over); - return EINA_TRUE; -} - -static Eina_Accessor* -_obj_clone(Eina_Accessor *accessor) -{ - ptrdiff_t offset = offsetof(Efl_Ui_Item_Container_Data, obj_accessor); - Efl_Ui_Item_Container_Data *pd = (void*)accessor - offset; - - return eina_list_accessor_new(pd->items); -} - -static Eina_List * -_null_container(Eina_Accessor *accessor EINA_UNUSED) -{ - ERR("Not allowed to get a container!"); - return NULL; -} - -static void -_free(Eina_Accessor *accessor EINA_UNUSED) -{ - ERR("Freeing this accessor is not supported"); -} - -static void -_obj_accessor_init(Eina_Accessor *accessor) -{ - //this is the accessor for accessing the items - //we have to workarround here the problem that - //no accessor can be created for a not yet created list. - accessor->version = EINA_ACCESSOR_VERSION; - accessor->get_at = FUNC_ACCESSOR_GET_AT(_obj_accessor_get_at); - accessor->clone = FUNC_ACCESSOR_CLONE(_obj_clone); - accessor->get_container = FUNC_ACCESSOR_GET_CONTAINER(_null_container); - accessor->free = FUNC_ACCESSOR_FREE(_free); - EINA_MAGIC_SET(accessor, EINA_MAGIC_ACCESSOR); -} - -static Eina_Bool -_size_accessor_get_at(Eina_Accessor *accessor, unsigned int idx, void **data) -{ - Eina_Size2D *size = (Eina_Size2D*)data; - ptrdiff_t offset = offsetof(Efl_Ui_Item_Container_Data, size_accessor); - Efl_Ui_Item_Container_Data *pd = (void*)accessor - offset; - - if (idx > eina_list_count(pd->items)) - return EINA_FALSE; - - Eo *subobj = eina_list_nth(pd->items, idx); - - *size = efl_gfx_hint_size_combined_min_get(subobj); - - return EINA_TRUE; -} - -static Eina_Accessor* -_size_clone(Eina_Accessor *accessor EINA_UNUSED) -{ - return NULL; -} - -static void -_size_accessor_init(Eina_Accessor *accessor) -{ - accessor->version = EINA_ACCESSOR_VERSION; - accessor->get_at = FUNC_ACCESSOR_GET_AT(_size_accessor_get_at); - accessor->clone = FUNC_ACCESSOR_CLONE(_size_clone); - accessor->get_container = FUNC_ACCESSOR_GET_CONTAINER(_null_container); - accessor->free = FUNC_ACCESSOR_FREE(_free); - EINA_MAGIC_SET(accessor, EINA_MAGIC_ACCESSOR); -} - static void _pan_viewport_changed_cb(void *data, const Efl_Event *ev EINA_UNUSED) { @@ -288,6 +285,23 @@ _efl_ui_item_container_selected_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Item_Conta return eina_list_iterator_new(pd->selected); } +static Eina_Bool +_size_accessor_get_at(Fast_Accessor *accessor, unsigned int idx, void **data) +{ + Eina_Bool res = EINA_FALSE; + Efl_Gfx_Entity *geom; + Eina_Size2D *size = (void*)data; + + res = _fast_accessor_get_at(accessor, idx,(void*) &geom); + + if (!res) return EINA_FALSE; + + *size = efl_gfx_hint_size_min_get(geom); + + return res; +} + + EOLIAN static Efl_Object* _efl_ui_item_container_efl_object_constructor(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED) { @@ -295,8 +309,9 @@ _efl_ui_item_container_efl_object_constructor(Eo *obj, Efl_Ui_Item_Container_Dat pd->dir = EFL_UI_LAYOUT_ORIENTATION_VERTICAL; - _obj_accessor_init(&pd->obj_accessor.pass_on); - _size_accessor_init(&pd->size_accessor); + _fast_accessor_init(&pd->obj_accessor, &pd->items); + _fast_accessor_init(&pd->size_accessor, &pd->items); + pd->size_accessor.acc.get_at = FUNC_ACCESSOR_GET_AT(_size_accessor_get_at); if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "item_container"); @@ -553,25 +568,9 @@ unregister_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item) return EINA_FALSE; unsigned int id = eina_list_data_idx(pd->items, item); - if (pd->obj_accessor.last_index == id) - { - if (eina_list_next(elem)) - { - pd->obj_accessor.current = eina_list_next(elem); - } - else if (eina_list_prev(elem)) - { - pd->obj_accessor.last_index = id-1; - pd->obj_accessor.current = eina_list_prev(elem); - } - else - { - //everything >= length is invalid, and we need that. - pd->obj_accessor.last_index = eina_list_count(pd->items); - pd->obj_accessor.current = NULL; - } - } + _fast_accessor_remove(&pd->obj_accessor, elem); + _fast_accessor_remove(&pd->size_accessor, elem); pd->items = eina_list_remove(pd->items, item); pd->selected = eina_list_remove(pd->selected, item); @@ -589,6 +588,8 @@ update_pos_man(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Enti { pd->obj_accessor.last_index = id; pd->obj_accessor.current = pd->items; + pd->size_accessor.last_index = id; + pd->size_accessor.current = pd->items; } efl_ui_position_manager_entity_item_added(pd->pos_man, id, subobj); } @@ -765,7 +766,7 @@ _efl_ui_item_container_position_manager_set(Eo *obj, Efl_Ui_Item_Container_Data { efl_parent_set(pd->pos_man, obj); efl_event_callback_array_add(pd->pos_man, pos_manager_cbs(), obj); - efl_ui_position_manager_entity_data_access_set(pd->pos_man, &pd->obj_accessor.pass_on, &pd->size_accessor, eina_list_count(pd->items)); + efl_ui_position_manager_entity_data_access_set(pd->pos_man, &pd->obj_accessor.acc, &pd->size_accessor.acc, eina_list_count(pd->items)); efl_ui_position_manager_entity_viewport_set(pd->pos_man, efl_ui_scrollable_viewport_geometry_get(obj)); efl_ui_layout_orientation_set(pd->pos_man, pd->dir); } From 530d03dcf662d2b6159475ba60e2f8a3263a0bc4 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 24 Jul 2019 15:59:24 +0200 Subject: [PATCH 07/72] efl_ui_list_item: remove this this has nothing usefull in it. Additionally, future commits will brings up another design where there is a central default item style, which can be hinted. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9394 --- .../elementary/efl_ui_list_example_1.c | 10 +-- src/lib/elementary/Efl_Ui.h | 1 - src/lib/elementary/Elementary.h | 1 - src/lib/elementary/efl_ui_list.c | 1 - src/lib/elementary/efl_ui_list.eo | 2 - .../elementary/efl_ui_list_default_item.eo | 2 +- src/lib/elementary/efl_ui_list_item.c | 83 ------------------- src/lib/elementary/efl_ui_list_item.eo | 12 --- src/lib/elementary/efl_ui_list_item_private.h | 30 ------- .../efl_ui_list_placeholder_item.eo | 2 +- src/lib/elementary/meson.build | 3 - 11 files changed, 7 insertions(+), 140 deletions(-) delete mode 100644 src/lib/elementary/efl_ui_list_item.c delete mode 100644 src/lib/elementary/efl_ui_list_item.eo delete mode 100644 src/lib/elementary/efl_ui_list_item_private.h diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c index dcb434fcf1..a7be7937df 100644 --- a/src/examples/elementary/efl_ui_list_example_1.c +++ b/src/examples/elementary/efl_ui_list_example_1.c @@ -30,7 +30,7 @@ _list_selected(void *data EINA_UNUSED, const Efl_Event *ev) Eo *item = ev->info, *tmp; printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected")); - Eina_Iterator *selects = efl_ui_item_container_selected_items_get(list); + Eina_Iterator *selects = efl_ui_collection_selected_items_get(list); EINA_ITERATOR_FOREACH(selects, tmp) printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp)); @@ -82,18 +82,18 @@ _anim_radio_changed(void *data, const Efl_Event *ev EINA_UNUSED) static void _scrl_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_List_Item *item = efl_ui_item_container_last_selected_item_get(priv_d.list); + Efl_Ui_List_Default_Item *item = efl_ui_collection_last_selected_item_get(priv_d.list); printf("show [%d:%p] [%d]\n", efl_ui_item_index_get(item), item, priv_d.anim); - efl_ui_item_container_item_scroll(priv_d.list, item, priv_d.anim); + efl_ui_collection_item_scroll(priv_d.list, item, priv_d.anim); } static void _scrl_align_btn_clicked(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_List_Item *item = efl_ui_item_container_last_selected_item_get(priv_d.list); + Efl_Ui_List_Default_Item *item = efl_ui_collection_last_selected_item_get(priv_d.list); double align = efl_ui_range_value_get(priv_d.slider); printf("show [%d:%p] [%.2lf], [%d]\n", efl_ui_item_index_get(item), item, align, priv_d.anim); - efl_ui_item_container_item_scroll_align(priv_d.list, item, align, priv_d.anim); + efl_ui_collection_item_scroll_align(priv_d.list, item, align, priv_d.anim); } EAPI_MAIN int diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 7d16959036..4ec35d0499 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -255,7 +255,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include -# include # include # include # include diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index 3316529acc..ba10773ff4 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -334,7 +334,6 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include # include # include # include diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c index 8d8cbc25f8..eb842e137a 100644 --- a/src/lib/elementary/efl_ui_list.c +++ b/src/lib/elementary/efl_ui_list.c @@ -8,7 +8,6 @@ #include #include "elm_priv.h" -#include "efl_ui_list_item_private.h" #include "efl_ui_item_private.h" #define MY_CLASS EFL_UI_LIST_CLASS diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo index cf99aad862..6254e16a18 100644 --- a/src/lib/elementary/efl_ui_list.eo +++ b/src/lib/elementary/efl_ui_list.eo @@ -1,5 +1,3 @@ -import efl_ui_list_item; - class @beta Efl.Ui.List extends Efl.Ui.Item_Container { [[Simple list widget with Pack interface.]] diff --git a/src/lib/elementary/efl_ui_list_default_item.eo b/src/lib/elementary/efl_ui_list_default_item.eo index ee4e770f5d..90cc024b97 100644 --- a/src/lib/elementary/efl_ui_list_default_item.eo +++ b/src/lib/elementary/efl_ui_list_default_item.eo @@ -1,5 +1,5 @@ -class @beta Efl.Ui.List_Default_Item extends Efl.Ui.List_Item implements +class @beta Efl.Ui.List_Default_Item extends Efl.Ui.Item implements Efl.Text, Efl.Text_Markup, Efl.Content diff --git a/src/lib/elementary/efl_ui_list_item.c b/src/lib/elementary/efl_ui_list_item.c deleted file mode 100644 index 1fe67e9c0c..0000000000 --- a/src/lib/elementary/efl_ui_list_item.c +++ /dev/null @@ -1,83 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif - -#define EFL_ACCESS_PROTECTED -#define EFL_UI_WIDGET_PART_BG_PROTECTED - -#include - -#include "elm_priv.h" -#include "efl_ui_list_item_private.h" - -#define MY_CLASS EFL_UI_LIST_ITEM_CLASS -#define MY_CLASS_PFX efl_ui_list_item - -#define MY_CLASS_NAME "Efl.Ui.List_Item" - -static void -_sizing_eval(Evas_Object *obj, Efl_Ui_List_Item_Data *pd) -{ - Evas_Coord minh = -1, minw = -1; - Evas_Coord rest_w = 0, rest_h = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd); - - edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, - rest_w, rest_h); - evas_object_size_hint_min_set(obj, minw, minh); - - pd->needs_size_calc = EINA_FALSE; -} - -static void -_efl_ui_list_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_List_Item_Data *pd) -{ - if (pd->needs_size_calc) return; - pd->needs_size_calc = EINA_TRUE; - - efl_canvas_group_change(obj); -} - -EOLIAN static void -_efl_ui_list_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_List_Item_Data *pd) -{ - if (pd->needs_size_calc) - { - _sizing_eval(obj, pd); - pd->needs_size_calc = EINA_FALSE; - } -} - -EOLIAN static Eo * -_efl_ui_list_item_efl_object_constructor(Eo *obj, Efl_Ui_List_Item_Data *pd) -{ - pd->obj = obj; - obj = efl_constructor(efl_super(obj, MY_CLASS)); - - return obj; -} - -EOLIAN static Efl_Object * -_efl_ui_list_item_efl_object_finalize(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED) -{ - Eo *eo; - eo = efl_finalize(efl_super(obj, MY_CLASS)); - ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo); - - return eo; -} - -EOLIAN static void -_efl_ui_list_item_efl_object_destructor(Eo *obj, Efl_Ui_List_Item_Data *pd EINA_UNUSED) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - efl_destructor(efl_super(obj, MY_CLASS)); -} - -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_LIST_ITEM_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_list_item) - -#include "efl_ui_list_item.eo.c" diff --git a/src/lib/elementary/efl_ui_list_item.eo b/src/lib/elementary/efl_ui_list_item.eo deleted file mode 100644 index 2997926cfd..0000000000 --- a/src/lib/elementary/efl_ui_list_item.eo +++ /dev/null @@ -1,12 +0,0 @@ - -abstract @beta Efl.Ui.List_Item extends Efl.Ui.Item -{ - implements { - //Efl.Object - Efl.Object.constructor; - Efl.Object.finalize; - Efl.Object.destructor; - //Efl.Canvas - Efl.Canvas.Group.group_calculate; - } -} diff --git a/src/lib/elementary/efl_ui_list_item_private.h b/src/lib/elementary/efl_ui_list_item_private.h deleted file mode 100644 index 0df36bc459..0000000000 --- a/src/lib/elementary/efl_ui_list_item_private.h +++ /dev/null @@ -1,30 +0,0 @@ -#ifndef EFL_UI_LIST_ITEM_PRIVATE_H -#define EFL_UI_LIST_ITEM_PRIVATE_H - -#include "Elementary.h" - -typedef struct _Efl_Ui_List_Item_Data -{ - // Eo Objects - Eo *obj; /* Self-Object */ - Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */ -} Efl_Ui_List_Item_Data; - - -#define EFL_UI_LIST_ITEM_DATA_GET(o, pd) \ - Efl_Ui_List_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_LIST_ITEM_CLASS) - -#define EFL_UI_LIST_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \ - EFL_UI_LIST_ITEM_DATA_GET(o, ptr); \ - if (EINA_UNLIKELY(!ptr)) \ - { \ - ERR("No widget data for object %p (%s)", \ - o, evas_object_type_get(o)); \ - return __VA_ARGS__; \ - } - -#define EFL_UI_LIST_ITEM_CHECK_OR_RETURN(obj, ...) \ - if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_LIST_ITEM_CLASS))) \ - return __VA_ARGS__; - -#endif diff --git a/src/lib/elementary/efl_ui_list_placeholder_item.eo b/src/lib/elementary/efl_ui_list_placeholder_item.eo index e9dbcab477..83a0f9954e 100644 --- a/src/lib/elementary/efl_ui_list_placeholder_item.eo +++ b/src/lib/elementary/efl_ui_list_placeholder_item.eo @@ -1,5 +1,5 @@ -class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.List_Item implements Efl.Content +class @beta Efl.Ui.List_Placeholder_Item extends Efl.Ui.Item implements Efl.Content { [[List Placeholder Item class. This item have only one swallow space, thus user can decorate item by filling the swallow with diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index e3bc6024f0..9d2bb71ae8 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -121,7 +121,6 @@ pub_eo_files = [ 'efl_ui_item_part_extra.eo', 'efl_ui_item_part_content.eo', 'efl_ui_item.eo', - 'efl_ui_list_item.eo', 'efl_ui_list_default_item.eo', 'efl_ui_list_placeholder_item.eo', 'efl_ui_list.eo', @@ -354,7 +353,6 @@ elementary_headers_unstable = [ 'elm_widget_toolbar.h', 'efl_ui_video_private.h', 'efl_ui_item_private.h', - 'efl_ui_list_item_private.h', 'efl_ui_grid_item_private.h', 'efl_ui_list_view_private.h', 'efl_ui_list_view_seg_array.h', @@ -895,7 +893,6 @@ elementary_src = [ 'efl_ui_focus_util.c', 'elm_widget_item_static_focus.c', 'efl_ui_item.c', - 'efl_ui_list_item.c', 'efl_ui_list_default_item.c', 'efl_ui_list_placeholder_item.c', 'efl_ui_list.c', From 167d2475e8f879e96d80fa4a03eb3ab06098bfe5 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 24 Jul 2019 16:36:17 +0200 Subject: [PATCH 08/72] efl_ui_grid_item: remove this this is not needed anymore, the grid items can also just inherit directly from the items. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9395 --- src/lib/elementary/Efl_Ui.h | 1 - src/lib/elementary/Elementary.h | 1 - src/lib/elementary/efl_ui_grid.c | 1 - src/lib/elementary/efl_ui_grid.eo | 2 - .../elementary/efl_ui_grid_default_item.eo | 2 +- src/lib/elementary/efl_ui_grid_item.c | 83 ------------------- src/lib/elementary/efl_ui_grid_item.eo | 12 --- src/lib/elementary/efl_ui_grid_item_private.h | 40 --------- src/lib/elementary/meson.build | 3 - src/tests/elementary/efl_ui_test_grid.c | 20 ++--- 10 files changed, 11 insertions(+), 154 deletions(-) delete mode 100644 src/lib/elementary/efl_ui_grid_item.c delete mode 100644 src/lib/elementary/efl_ui_grid_item.eo delete mode 100644 src/lib/elementary/efl_ui_grid_item_private.h diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 4ec35d0499..0cf1d0fb5d 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -256,7 +256,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include -# include # include /** diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index ba10773ff4..6faf7f7ac5 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -337,7 +337,6 @@ typedef Eo Efl_Ui_Focus_Manager; # include # include # include -# include # include # include # include diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index 331b435b68..a82c0a77dd 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -9,7 +9,6 @@ #include #include "elm_priv.h" #include "efl_ui_item_private.h" -#include "efl_ui_grid_item_private.h" #define MY_CLASS EFL_UI_GRID_CLASS #define MY_CLASS_PFX efl_ui_grid diff --git a/src/lib/elementary/efl_ui_grid.eo b/src/lib/elementary/efl_ui_grid.eo index ce4fbd6a29..5ae359b727 100644 --- a/src/lib/elementary/efl_ui_grid.eo +++ b/src/lib/elementary/efl_ui_grid.eo @@ -1,5 +1,3 @@ -import efl_ui_grid_item; - class @beta Efl.Ui.Grid extends Efl.Ui.Item_Container { [[Simple grid widget with Pack interface.]] diff --git a/src/lib/elementary/efl_ui_grid_default_item.eo b/src/lib/elementary/efl_ui_grid_default_item.eo index 9b3a0eb890..90461b0b6e 100644 --- a/src/lib/elementary/efl_ui_grid_default_item.eo +++ b/src/lib/elementary/efl_ui_grid_default_item.eo @@ -1,5 +1,5 @@ -class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Grid_Item implements +class @beta Efl.Ui.Grid_Default_Item extends Efl.Ui.Item implements Efl.Text, Efl.Text_Markup, Efl.Ui.L10n, diff --git a/src/lib/elementary/efl_ui_grid_item.c b/src/lib/elementary/efl_ui_grid_item.c deleted file mode 100644 index 29daea7896..0000000000 --- a/src/lib/elementary/efl_ui_grid_item.c +++ /dev/null @@ -1,83 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "elementary_config.h" -#endif - -#define EFL_ACCESS_PROTECTED -#define EFL_UI_WIDGET_PART_BG_PROTECTED - -#include - -#include "elm_priv.h" -#include "efl_ui_grid_item_private.h" - -#define MY_CLASS EFL_UI_GRID_ITEM_CLASS -#define MY_CLASS_PFX efl_ui_grid_item - -#define MY_CLASS_NAME "Efl.Ui.Grid_Item" - -static void -_sizing_eval(Evas_Object *obj, Efl_Ui_Grid_Item_Data *pd) -{ - Evas_Coord minh = -1, minw = -1; - Evas_Coord rest_w = 0, rest_h = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd); - - edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, - rest_w, rest_h); - evas_object_size_hint_min_set(obj, minw, minh); - - pd->needs_size_calc = EINA_FALSE; -} - -static void -_efl_ui_grid_item_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Grid_Item_Data *pd) -{ - if (pd->needs_size_calc) return; - pd->needs_size_calc = EINA_TRUE; - - efl_canvas_group_change(obj); -} - -EOLIAN static void -_efl_ui_grid_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Grid_Item_Data *pd) -{ - if (pd->needs_size_calc) - { - _sizing_eval(obj, pd); - pd->needs_size_calc = EINA_FALSE; - } -} - -EOLIAN static Eo * -_efl_ui_grid_item_efl_object_constructor(Eo *obj, Efl_Ui_Grid_Item_Data *pd) -{ - pd->obj = obj; - obj = efl_constructor(efl_super(obj, MY_CLASS)); - - return obj; -} - -EOLIAN static Efl_Object * -_efl_ui_grid_item_efl_object_finalize(Eo *obj, Efl_Ui_Grid_Item_Data *pd EINA_UNUSED) -{ - Eo *eo; - eo = efl_finalize(efl_super(obj, MY_CLASS)); - ELM_WIDGET_DATA_GET_OR_RETURN(eo, wd, eo); - - return eo; -} - -EOLIAN static void -_efl_ui_grid_item_efl_object_destructor(Eo *obj, Efl_Ui_Grid_Item_Data *pd EINA_UNUSED) -{ - ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - - efl_destructor(efl_super(obj, MY_CLASS)); -} - -/* Internal EO APIs and hidden overrides */ - -#define EFL_UI_GRID_ITEM_EXTRA_OPS \ - ELM_LAYOUT_SIZING_EVAL_OPS(efl_ui_grid_item) - -#include "efl_ui_grid_item.eo.c" diff --git a/src/lib/elementary/efl_ui_grid_item.eo b/src/lib/elementary/efl_ui_grid_item.eo deleted file mode 100644 index 99a4abca01..0000000000 --- a/src/lib/elementary/efl_ui_grid_item.eo +++ /dev/null @@ -1,12 +0,0 @@ - -abstract @beta Efl.Ui.Grid_Item extends Efl.Ui.Item -{ - implements { - //Efl.Object - Efl.Object.constructor; - Efl.Object.finalize; - Efl.Object.destructor; - //Efl.Canvas - Efl.Canvas.Group.group_calculate; - } -} diff --git a/src/lib/elementary/efl_ui_grid_item_private.h b/src/lib/elementary/efl_ui_grid_item_private.h deleted file mode 100644 index d8c4009826..0000000000 --- a/src/lib/elementary/efl_ui_grid_item_private.h +++ /dev/null @@ -1,40 +0,0 @@ -#ifndef EFL_UI_GRID_ITEM_PRIVATE_H -#define EFL_UI_GRID_ITEM_PRIVATE_H - -#include "Elementary.h" - -typedef struct _Efl_Ui_Grid_Item_Data -{ - // Eo Objects - Eo *obj; /* Self-Object */ - Eina_Rect geo; - int index; - struct { - int row; - int col; - } pos; - - /* Boolean Values */ - Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */ - Eina_Bool update_me: 1; - Eina_Bool update_begin: 1; -} Efl_Ui_Grid_Item_Data; - - -#define EFL_UI_GRID_ITEM_DATA_GET(o, pd) \ - Efl_Ui_Grid_Item_Data * pd = efl_data_scope_safe_get(o, EFL_UI_GRID_ITEM_CLASS) - -#define EFL_UI_GRID_ITEM_DATA_GET_OR_RETURN(o, ptr, ...) \ - EFL_UI_GRID_ITEM_DATA_GET(o, ptr); \ - if (EINA_UNLIKELY(!ptr)) \ - { \ - ERR("No widget data for object %p (%s)", \ - o, evas_object_type_get(o)); \ - return __VA_ARGS__; \ - } - -#define EFL_UI_GRID_ITEM_CHECK_OR_RETURN(obj, ...) \ - if (EINA_UNLIKELY(!efl_isa((obj), EFL_UI_GRID_ITEM_CLASS))) \ - return __VA_ARGS__; - -#endif diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 9d2bb71ae8..07d85244a1 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -124,7 +124,6 @@ pub_eo_files = [ 'efl_ui_list_default_item.eo', 'efl_ui_list_placeholder_item.eo', 'efl_ui_list.eo', - 'efl_ui_grid_item.eo', 'efl_ui_grid_default_item.eo', 'efl_ui_grid.eo', 'efl_ui_panes_part.eo', @@ -353,7 +352,6 @@ elementary_headers_unstable = [ 'elm_widget_toolbar.h', 'efl_ui_video_private.h', 'efl_ui_item_private.h', - 'efl_ui_grid_item_private.h', 'efl_ui_list_view_private.h', 'efl_ui_list_view_seg_array.h', 'elm_widget_web.h', @@ -896,7 +894,6 @@ elementary_src = [ 'efl_ui_list_default_item.c', 'efl_ui_list_placeholder_item.c', 'efl_ui_list.c', - 'efl_ui_grid_item.c', 'efl_ui_grid_default_item.c', 'efl_ui_grid.c', 'efl_ui_list_view.c', diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c index 1ddf055399..a8d4ea0433 100644 --- a/src/tests/elementary/efl_ui_test_grid.c +++ b/src/tests/elementary/efl_ui_test_grid.c @@ -26,7 +26,7 @@ static Eina_Bool grid_item_pack(Eo *grid, int count, Eina_List **l) { int i; - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; for (i = 0; i < count; i++) { item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid); @@ -51,7 +51,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_pack) { - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; int count; item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid); @@ -65,7 +65,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_unpack) { - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; int count; item = efl_add(EFL_UI_GRID_DEFAULT_ITEM_CLASS, grid); @@ -82,7 +82,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_unpack_all) { - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; int count_before = 10; int count; Eina_Iterator *itor; @@ -119,7 +119,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_pack_end) { - Efl_Ui_Grid_Item *item, *compare; + Efl_Ui_Grid_Default_Item *item, *compare; int count_before = 10; int count; @@ -140,7 +140,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_pack_begin) { - Efl_Ui_Grid_Item *item, *compare; + Efl_Ui_Grid_Default_Item *item, *compare; int count_before = 10; int count; @@ -161,7 +161,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_pack_after) { - Efl_Ui_Grid_Item *item, *after, *compare; + Efl_Ui_Grid_Default_Item *item, *after, *compare; int count_before = 10; int count; int index = 5; @@ -186,7 +186,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_pack_before) { - Efl_Ui_Grid_Item *item, *before, *compare; + Efl_Ui_Grid_Default_Item *item, *before, *compare; int count_before = 10; int count; int index = 5; @@ -224,7 +224,7 @@ EFL_END_TEST EFL_START_TEST(efl_ui_grid_content_iterate) { int count = 10; - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; Eina_List *item_list = NULL; Eina_Iterator *item_itr; @@ -276,7 +276,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(grid_scroll_callbacks, EFL_START_TEST(efl_ui_grid_scroll) { - Efl_Ui_Grid_Item *item; + Efl_Ui_Grid_Default_Item *item; Efl_Loop_Timer *timer; ck_assert(grid_item_pack(grid, 100, NULL) != EINA_FALSE); From a4f7baa911a07d225e81d747bd7d79a177aae552 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Wed, 24 Jul 2019 17:57:01 +0200 Subject: [PATCH 09/72] rename efl_ui_item_container -> efl_ui_collection this is the first rename of the main widget, the renames of the test suites will follow Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9408 --- src/benchmarks/elementary/item_container.c | 10 +- src/bin/elementary/test.c | 8 +- src/bin/elementary/test_ui_item_container.c | 18 +-- src/lib/elementary/Efl_Ui.h | 2 +- ...i_item_container.c => efl_ui_collection.c} | 113 ++++++++++-------- ...item_container.eo => efl_ui_collection.eo} | 2 +- src/lib/elementary/efl_ui_grid.c | 2 +- src/lib/elementary/efl_ui_grid.eo | 2 +- src/lib/elementary/efl_ui_list.c | 2 +- src/lib/elementary/efl_ui_list.eo | 2 +- src/lib/elementary/meson.build | 4 +- src/tests/elementary/efl_ui_suite.c | 2 +- src/tests/elementary/efl_ui_test_grid.c | 2 +- .../elementary/efl_ui_test_grid_container.c | 4 +- .../elementary/efl_ui_test_item_container.c | 8 +- .../efl_ui_test_item_container_common.c | 20 ++-- .../elementary/efl_ui_test_list_container.c | 4 +- src/tests/elementary/spec/efl_ui_spec_suite.c | 2 +- .../spec/test_efl_ui_item_container_list.eo | 2 +- 19 files changed, 112 insertions(+), 97 deletions(-) rename src/lib/elementary/{efl_ui_item_container.c => efl_ui_collection.c} (80%) rename src/lib/elementary/{efl_ui_item_container.eo => efl_ui_collection.eo} (98%) diff --git a/src/benchmarks/elementary/item_container.c b/src/benchmarks/elementary/item_container.c index 5419756e09..982df1df81 100644 --- a/src/benchmarks/elementary/item_container.c +++ b/src/benchmarks/elementary/item_container.c @@ -10,11 +10,11 @@ _timer_tick(void *data, const Efl_Event *ev) { if (timer % 2 == 0) { - efl_ui_item_container_item_scroll(data, last, EINA_TRUE); + efl_ui_collection_item_scroll(data, last, EINA_TRUE); } else { - efl_ui_item_container_item_scroll(data, first, EINA_TRUE); + efl_ui_collection_item_scroll(data, first, EINA_TRUE); } timer--; @@ -51,7 +51,7 @@ _started_cb(void *data, const Efl_Event *ev EINA_UNUSED) static void _first_frame_cb(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_item_container_item_scroll(data, middle, EINA_FALSE); + efl_ui_collection_item_scroll(data, middle, EINA_FALSE); //give time to stabelize efl_add(EFL_LOOP_TIMER_CLASS, efl_main_loop_get(), efl_loop_timer_interval_set(efl_added, 15.0), @@ -72,8 +72,8 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) ); list = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS); - item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, - efl_ui_item_container_position_manager_set(efl_added, list)); + item_container = efl_add(EFL_UI_COLLECTION_CLASS, win, + efl_ui_collection_position_manager_set(efl_added, list)); efl_content_set(win, item_container); printf("Building 5000 objects\n"); diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 2062f18acb..79d56af40e 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -394,8 +394,8 @@ void test_ui_spotlight_scroll(void *data, Evas_Object *obj, void *event_info); void test_ui_relative_layout(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_radio(void *data, Evas_Object *obj, void *event_info); -void test_efl_ui_item_container_list(void *data, Evas_Object *obj, void *event_info ); -void test_efl_ui_item_container_grid(void *data, Evas_Object *obj, void *event_info); +void test_efl_ui_collection_list(void *data, Evas_Object *obj, void *event_info ); +void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void *event_info); static void _list_udpate(void); static Evas_Object *win, *tbx, *entry; // TODO: refactoring @@ -869,8 +869,8 @@ add_tests: 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); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Relative_Layout", test_ui_relative_layout); - ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Item_Container List", test_efl_ui_item_container_list); - ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Item_Container Grid", test_efl_ui_item_container_grid); + ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection List", test_efl_ui_collection_list); + ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection Grid", test_efl_ui_collection_grid); //------------------------------// ADD_TEST_EO(NULL, "Events", "Event Refeed", test_events); diff --git a/src/bin/elementary/test_ui_item_container.c b/src/bin/elementary/test_ui_item_container.c index af82d7a6d9..97f3f0797b 100644 --- a/src/bin/elementary/test_ui_item_container.c +++ b/src/bin/elementary/test_ui_item_container.c @@ -20,7 +20,7 @@ _scroll_to_animated_cb(void *data, const Efl_Event *ev EINA_UNUSED) EINA_SAFETY_ON_NULL_RETURN(element_1154); - efl_ui_item_container_item_scroll(data, element_1154, EINA_TRUE); + efl_ui_collection_item_scroll(data, element_1154, EINA_TRUE); } static void @@ -30,7 +30,7 @@ _scroll_to_cb(void *data, const Efl_Event *ev EINA_UNUSED) EINA_SAFETY_ON_NULL_RETURN(element_10); - efl_ui_item_container_item_scroll(data, element_10, EINA_FALSE); + efl_ui_collection_item_scroll(data, element_10, EINA_FALSE); } static void @@ -54,7 +54,7 @@ _change_min_size_cb(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) typedef struct { Efl_Ui_Check *v, *h; - Efl_Ui_Item_Container *c; + Efl_Ui_Collection *c; } Match_Content_Ctx; static void @@ -76,7 +76,7 @@ _widget_del_cb(void *data, const Efl_Event *ev EINA_UNUSED) } static void -_add_item(Efl_Ui_Item_Container *c) +_add_item(Efl_Ui_Collection *c) { Efl_Class *itc = efl_key_data_get(c, "__item_class"); char buf[PATH_MAX]; @@ -143,7 +143,7 @@ _add_thousend_items(void *data, const Efl_Event *ev EINA_UNUSED) static void _select_value_cb(void *data, const Efl_Event *ev) { - Efl_Ui_Item_Container *c = data; + Efl_Ui_Collection *c = data; efl_ui_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object)); } @@ -160,8 +160,8 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl tbl = efl_add(EFL_UI_TABLE_CLASS, win); efl_content_set(win, tbl); - item_container = o = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, - efl_ui_item_container_position_manager_set(efl_added, manager)); + item_container = o = efl_add(EFL_UI_COLLECTION_CLASS, win, + efl_ui_collection_position_manager_set(efl_added, manager)); efl_key_data_set(o, "__item_class", item); efl_event_callback_add(o, EFL_EVENT_DEL, _widget_del_cb, ctx); for (int i = 0; i < 2000; ++i) @@ -257,14 +257,14 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl efl_pack_end(bx, o); } -void test_efl_ui_item_container_grid(void *data EINA_UNUSED, +void test_efl_ui_collection_grid(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { create_item_container_ui(efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS), EFL_UI_GRID_DEFAULT_ITEM_CLASS, "Efl.Ui.Item_Container Grid"); } -void test_efl_ui_item_container_list(void *data EINA_UNUSED, +void test_efl_ui_collection_list(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) { diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 0cf1d0fb5d..93d3a0a1fa 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -252,7 +252,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include -# include +# include # include # include # include diff --git a/src/lib/elementary/efl_ui_item_container.c b/src/lib/elementary/efl_ui_collection.c similarity index 80% rename from src/lib/elementary/efl_ui_item_container.c rename to src/lib/elementary/efl_ui_collection.c index e2a8a65b7d..564bb108e0 100644 --- a/src/lib/elementary/efl_ui_item_container.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -145,10 +145,10 @@ _fast_accessor_remove(Fast_Accessor *accessor, const Eina_List *removed_elem) } -#define MY_CLASS EFL_UI_ITEM_CONTAINER_CLASS +#define MY_CLASS EFL_UI_COLLECTION_CLASS #define MY_DATA_GET(obj, pd) \ - Efl_Ui_Item_Container_Data *pd = efl_data_scope_get(obj, MY_CLASS); + Efl_Ui_Collection_Data *pd = efl_data_scope_get(obj, MY_CLASS); typedef struct { Efl_Ui_Scroll_Manager *smanager; @@ -166,13 +166,13 @@ typedef struct { Fast_Accessor obj_accessor; Fast_Accessor size_accessor; Efl_Gfx_Entity *sizer; -} Efl_Ui_Item_Container_Data; +} Efl_Ui_Collection_Data; -static Eina_Bool register_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item); -static Eina_Bool unregister_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item); +static Eina_Bool register_item(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item); +static Eina_Bool unregister_item(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item); static void -flush_min_size(Eo *obj, Efl_Ui_Item_Container_Data *pd) +flush_min_size(Eo *obj, Efl_Ui_Collection_Data *pd) { Eina_Size2D tmp = pd->content_min_size; @@ -186,7 +186,7 @@ flush_min_size(Eo *obj, Efl_Ui_Item_Container_Data *pd) } static int -clamp_index(Efl_Ui_Item_Container_Data *pd, int index) +clamp_index(Efl_Ui_Collection_Data *pd, int index) { if (index < ((int)eina_list_count(pd->items)) * -1) return -1; @@ -196,7 +196,7 @@ clamp_index(Efl_Ui_Item_Container_Data *pd, int index) } static int -index_adjust(Efl_Ui_Item_Container_Data *pd, int index) +index_adjust(Efl_Ui_Collection_Data *pd, int index) { int c = eina_list_count(pd->items); if (index < c * -1) @@ -240,7 +240,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(pan_events_cb, static void _item_scroll_internal(Eo *obj EINA_UNUSED, - Efl_Ui_Item_Container_Data *pd, + Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item, double align, Eina_Bool anim) @@ -262,25 +262,25 @@ _item_scroll_internal(Eo *obj EINA_UNUSED, } EOLIAN static void -_efl_ui_item_container_item_scroll(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item, Eina_Bool animation) +_efl_ui_collection_item_scroll(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item, Eina_Bool animation) { _item_scroll_internal(obj, pd, item, -1.0, animation); } EOLIAN static void -_efl_ui_item_container_item_scroll_align(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item, double align, Eina_Bool animation) +_efl_ui_collection_item_scroll_align(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item, double align, Eina_Bool animation) { _item_scroll_internal(obj, pd, item, align, animation); } EOLIAN static Efl_Ui_Item* -_efl_ui_item_container_last_selected_item_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_last_selected_item_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return eina_list_last_data_get(pd->selected); } EOLIAN static Eina_Iterator* -_efl_ui_item_container_selected_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_selected_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return eina_list_iterator_new(pd->selected); } @@ -303,7 +303,7 @@ _size_accessor_get_at(Fast_Accessor *accessor, unsigned int idx, void **data) EOLIAN static Efl_Object* -_efl_ui_item_container_efl_object_constructor(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED) +_efl_ui_collection_efl_object_constructor(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED) { Eo *o; @@ -336,7 +336,7 @@ _efl_ui_item_container_efl_object_constructor(Eo *obj, Efl_Ui_Item_Container_Dat } EOLIAN static Efl_Object* -_efl_ui_item_container_efl_object_finalize(Eo *obj, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_object_finalize(Eo *obj, Efl_Ui_Collection_Data *pd) { EINA_SAFETY_ON_NULL_RETURN_VAL(pd->pos_man, NULL); @@ -344,7 +344,7 @@ _efl_ui_item_container_efl_object_finalize(Eo *obj, Efl_Ui_Item_Container_Data * } EOLIAN static Eina_Error -_efl_ui_item_container_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Collection_Data *pd) { Eina_Error res; @@ -358,13 +358,13 @@ _efl_ui_item_container_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Item_Container_ } EOLIAN static void -_efl_ui_item_container_efl_object_destructor(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED) +_efl_ui_collection_efl_object_destructor(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED) { efl_destructor(efl_super(obj, MY_CLASS)); } static void -deselect_all(Efl_Ui_Item_Container_Data *pd) +deselect_all(Efl_Ui_Collection_Data *pd) { while(pd->selected) { @@ -375,9 +375,9 @@ deselect_all(Efl_Ui_Item_Container_Data *pd) } EOLIAN static void -_efl_ui_item_container_efl_object_invalidate(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED) +_efl_ui_collection_efl_object_invalidate(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED) { - efl_ui_item_container_position_manager_set(obj, NULL); + efl_ui_collection_position_manager_set(obj, NULL); deselect_all(pd); @@ -388,19 +388,19 @@ _efl_ui_item_container_efl_object_invalidate(Eo *obj, Efl_Ui_Item_Container_Data } EOLIAN static Eina_Iterator* -_efl_ui_item_container_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_container_content_iterate(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return eina_list_iterator_new(pd->items); } EOLIAN static int -_efl_ui_item_container_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_container_content_count(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return eina_list_count(pd->items); } EOLIAN static void -_efl_ui_item_container_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Layout_Orientation dir) +_efl_ui_collection_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Efl_Ui_Layout_Orientation dir) { if (pd->dir == dir) return; @@ -410,13 +410,13 @@ _efl_ui_item_container_efl_ui_layout_orientable_orientation_set(Eo *obj EINA_UNU } EOLIAN static Efl_Ui_Layout_Orientation -_efl_ui_item_container_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_ui_layout_orientable_orientation_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return pd->dir; } EOLIAN static void -_efl_ui_item_container_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Eina_Bool w, Eina_Bool h) +_efl_ui_collection_efl_ui_scrollable_interactive_match_content_set(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Eina_Bool w, Eina_Bool h) { if (pd->match_content.w == w && pd->match_content.h == h) return; @@ -429,7 +429,7 @@ _efl_ui_item_container_efl_ui_scrollable_interactive_match_content_set(Eo *obj E } EOLIAN static void -_efl_ui_item_container_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Select_Mode mode) +_efl_ui_collection_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Efl_Ui_Select_Mode mode) { pd->mode = mode; if ((mode == EFL_UI_SELECT_MODE_SINGLE_ALWAYS || mode == EFL_UI_SELECT_MODE_SINGLE) && @@ -448,7 +448,7 @@ _efl_ui_item_container_efl_ui_multi_selectable_select_mode_set(Eo *obj EINA_UNUS } EOLIAN static Efl_Ui_Select_Mode -_efl_ui_item_container_efl_ui_multi_selectable_select_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_ui_multi_selectable_select_mode_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return pd->mode; } @@ -538,7 +538,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(active_item, ) static Eina_Bool -register_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item) +register_item(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item) { EINA_SAFETY_ON_FALSE_RETURN_VAL(efl_isa(item, EFL_UI_ITEM_CLASS), EINA_FALSE); EINA_SAFETY_ON_TRUE_RETURN_VAL(!!eina_list_data_find(pd->items, item), EINA_FALSE); @@ -555,7 +555,7 @@ register_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item) } static Eina_Bool -unregister_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item) +unregister_item(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Item *item) { Eina_List *elem = eina_list_data_find_list(pd->items, item); if (!elem) @@ -576,12 +576,13 @@ unregister_item(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Item *item) pd->selected = eina_list_remove(pd->selected, item); efl_event_callback_array_del(item, active_item(), obj); efl_ui_position_manager_entity_item_removed(pd->pos_man, id, item); + efl_ui_item_container_set(item, NULL); return EINA_TRUE; } static void -update_pos_man(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj) +update_pos_man(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj) { int id = eina_list_data_idx(pd->items, subobj); if (id == 0) @@ -595,7 +596,7 @@ update_pos_man(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Enti } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_pack_clear(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_pack_pack_clear(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { while(pd->items) { @@ -606,7 +607,7 @@ _efl_ui_item_container_efl_pack_pack_clear(Eo *obj EINA_UNUSED, Efl_Ui_Item_Cont } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_unpack_all(Eo *obj, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_efl_pack_unpack_all(Eo *obj, Efl_Ui_Collection_Data *pd) { while(pd->items) { @@ -617,7 +618,7 @@ _efl_ui_item_container_efl_pack_unpack_all(Eo *obj, Efl_Ui_Item_Container_Data * } EOLIAN static Efl_Gfx_Entity* -_efl_ui_item_container_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Item_Container_Data *pd, int index) +_efl_ui_collection_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Collection_Data *pd, int index) { Efl_Ui_Item *it = eina_list_nth(pd->items, index_adjust(pd, index)); @@ -630,21 +631,21 @@ _efl_ui_item_container_efl_pack_linear_pack_unpack_at(Eo *obj, Efl_Ui_Item_Conta } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_unpack(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj) +_efl_ui_collection_efl_pack_unpack(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj) { return unregister_item(obj, pd, subobj); } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_pack(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) +_efl_ui_collection_efl_pack_pack(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED, Efl_Gfx_Entity *subobj) { return efl_pack_end(obj, subobj); } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj) +_efl_ui_collection_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj) { if (!register_item(obj, pd, subobj)) return EINA_FALSE; @@ -655,7 +656,7 @@ _efl_ui_item_container_efl_pack_linear_pack_end(Eo *obj, Efl_Ui_Item_Container_D EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj) +_efl_ui_collection_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj) { if (!register_item(obj, pd, subobj)) return EINA_FALSE; @@ -665,7 +666,7 @@ _efl_ui_item_container_efl_pack_linear_pack_begin(Eo *obj, Efl_Ui_Item_Container } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) +_efl_ui_collection_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { Eina_List *subobj_list = eina_list_data_find_list(pd->items, existing); EINA_SAFETY_ON_NULL_RETURN_VAL(subobj_list, EINA_FALSE); @@ -678,7 +679,7 @@ _efl_ui_item_container_efl_pack_linear_pack_before(Eo *obj, Efl_Ui_Item_Containe } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) +_efl_ui_collection_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj, const Efl_Gfx_Entity *existing) { Eina_List *subobj_list = eina_list_data_find_list(pd->items, existing); EINA_SAFETY_ON_NULL_RETURN_VAL(subobj_list, EINA_FALSE); @@ -691,7 +692,7 @@ _efl_ui_item_container_efl_pack_linear_pack_after(Eo *obj, Efl_Ui_Item_Container } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Gfx_Entity *subobj, int index) +_efl_ui_collection_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Gfx_Entity *subobj, int index) { Eina_List *subobj_list; int clamp; @@ -713,13 +714,13 @@ _efl_ui_item_container_efl_pack_linear_pack_at(Eo *obj, Efl_Ui_Item_Container_Da } EOLIAN static int -_efl_ui_item_container_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, const Efl_Gfx_Entity *subobj) +_efl_ui_collection_efl_pack_linear_pack_index_get(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, const Efl_Gfx_Entity *subobj) { return eina_list_data_idx(pd->items, (void*)subobj); } EOLIAN static Efl_Gfx_Entity* -_efl_ui_item_container_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd, int index) +_efl_ui_collection_efl_pack_linear_pack_content_get(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd, int index) { return eina_list_nth(pd->items, index_adjust(pd, index)); } @@ -750,7 +751,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(pos_manager_cbs, ) EOLIAN static void -_efl_ui_item_container_position_manager_set(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Position_Manager_Entity *layouter) +_efl_ui_collection_position_manager_set(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Position_Manager_Entity *layouter) { if (layouter) EINA_SAFETY_ON_FALSE_RETURN(efl_isa(layouter, EFL_UI_POSITION_MANAGER_ENTITY_INTERFACE)); @@ -773,32 +774,46 @@ _efl_ui_item_container_position_manager_set(Eo *obj, Efl_Ui_Item_Container_Data } EOLIAN static Efl_Ui_Position_Manager_Entity* -_efl_ui_item_container_position_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Container_Data *pd) +_efl_ui_collection_position_manager_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { return pd->pos_man; } EOLIAN static Efl_Ui_Focus_Manager* -_efl_ui_item_container_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root) +_efl_ui_collection_efl_ui_widget_focus_manager_focus_manager_create(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED, Efl_Ui_Focus_Object *root) { return efl_add(EFL_UI_FOCUS_MANAGER_CALC_CLASS, obj, efl_ui_focus_manager_root_set(efl_added, root)); } EOLIAN static Eina_Bool -_efl_ui_item_container_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_Item_Container_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED) +_efl_ui_collection_efl_ui_widget_focus_state_apply(Eo *obj, Efl_Ui_Collection_Data *pd EINA_UNUSED, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect EINA_UNUSED) { return efl_ui_widget_focus_state_apply(efl_super(obj, MY_CLASS), current_state, configured_state, obj); } EOLIAN static Efl_Ui_Focus_Object* -_efl_ui_item_container_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Item_Container_Data *pd, Efl_Ui_Focus_Direction direction) +_efl_ui_collection_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Focus_Direction direction) { Eo *new_obj, *focus; Eina_Size2D step; - new_obj = efl_ui_focus_manager_move(efl_super(obj, MY_CLASS), direction); focus = efl_ui_focus_manager_focus_get(obj); + if (focus) + { + /* if this is outside the viewport, then we must bring that in first */ + Eina_Rect viewport; + Eina_Rect element; + element = efl_gfx_entity_geometry_get(focus); + viewport = efl_gfx_entity_geometry_get(obj); + if (!eina_spans_intersect(element.x, element.x+element.w, viewport.x, viewport.x+viewport.w) && + !eina_spans_intersect(element.y, element.y+element.h, viewport.y, viewport.y+viewport.y)) + { + efl_ui_scrollable_scroll(obj, element, EINA_TRUE); + return focus; + } + } + new_obj = efl_ui_focus_manager_move(efl_super(obj, MY_CLASS), direction); step = efl_gfx_hint_size_min_get(focus); if (!new_obj) { @@ -855,4 +870,4 @@ _efl_ui_item_container_efl_ui_focus_manager_move(Eo *obj, Efl_Ui_Item_Container_ return new_obj; } -#include "efl_ui_item_container.eo.c" +#include "efl_ui_collection.eo.c" diff --git a/src/lib/elementary/efl_ui_item_container.eo b/src/lib/elementary/efl_ui_collection.eo similarity index 98% rename from src/lib/elementary/efl_ui_item_container.eo rename to src/lib/elementary/efl_ui_collection.eo index 962eb00d19..26f3bb3bc0 100644 --- a/src/lib/elementary/efl_ui_item_container.eo +++ b/src/lib/elementary/efl_ui_collection.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Item_Container extends Efl.Ui.Layout_Base implements +class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements Efl.Ui.Scrollable_Interactive, Efl.Ui.Scrollbar, Efl.Pack_Linear, Efl.Pack_Layout, diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index a82c0a77dd..709765373c 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -24,7 +24,7 @@ _efl_ui_grid_efl_object_constructor(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_ui_item_container_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS)); + efl_ui_collection_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS)); return obj; } diff --git a/src/lib/elementary/efl_ui_grid.eo b/src/lib/elementary/efl_ui_grid.eo index 5ae359b727..48221f8f72 100644 --- a/src/lib/elementary/efl_ui_grid.eo +++ b/src/lib/elementary/efl_ui_grid.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Grid extends Efl.Ui.Item_Container +class @beta Efl.Ui.Grid extends Efl.Ui.Collection { [[Simple grid widget with Pack interface.]] diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c index eb842e137a..9a4cc7fb16 100644 --- a/src/lib/elementary/efl_ui_list.c +++ b/src/lib/elementary/efl_ui_list.c @@ -24,7 +24,7 @@ _efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_ui_item_container_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS)); + efl_ui_collection_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS)); return obj; } diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo index 6254e16a18..94e90f760d 100644 --- a/src/lib/elementary/efl_ui_list.eo +++ b/src/lib/elementary/efl_ui_list.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.List extends Efl.Ui.Item_Container +class @beta Efl.Ui.List extends Efl.Ui.Collection { [[Simple list widget with Pack interface.]] implements { diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 07d85244a1..72226f5cf3 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -179,7 +179,7 @@ pub_eo_files = [ 'efl_ui_clickable.eo', 'efl_ui_clickable_util.eo', 'efl_ui_format.eo', - 'efl_ui_item_container.eo', + 'efl_ui_collection.eo', 'efl_ui_position_manager_entity.eo', 'efl_ui_position_manager_list.eo', 'efl_ui_position_manager_grid.eo', @@ -934,7 +934,7 @@ elementary_src = [ 'efl_ui_clickable_util.c', 'efl_ui_format.c', 'efl_ui_scroll_util.c', - 'efl_ui_item_container.c', + 'efl_ui_collection.c', 'efl_ui_position_manager_entity.c', 'efl_ui_position_manager_list.c', 'efl_ui_position_manager_grid.c', diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index bc8a1c6902..3478095936 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -32,7 +32,7 @@ static const Efl_Test_Case etc[] = { { "efl_ui_win", efl_ui_test_win }, { "efl_ui_spin", efl_ui_test_spin }, { "efl_ui_spin_button", efl_ui_test_spin_button }, - { "efl_ui_item_container", efl_ui_test_item_container }, + { "efl_ui_collection", efl_ui_test_item_container }, { "efl_ui_grid_container", efl_ui_test_grid_container }, { "efl_ui_list_container", efl_ui_test_list_container }, { NULL, NULL } diff --git a/src/tests/elementary/efl_ui_test_grid.c b/src/tests/elementary/efl_ui_test_grid.c index a8d4ea0433..9eaa096ad0 100644 --- a/src/tests/elementary/efl_ui_test_grid.c +++ b/src/tests/elementary/efl_ui_test_grid.c @@ -289,7 +289,7 @@ EFL_START_TEST(efl_ui_grid_scroll) efl_event_callback_array_add(grid, grid_scroll_callbacks(), timer); /*FIXME: efl_ui_scroll_interface only emit scroll event when animation exist */ - efl_ui_item_container_item_scroll(grid, item, EINA_TRUE); + efl_ui_collection_item_scroll(grid, item, EINA_TRUE); ecore_main_loop_begin(); } EFL_END_TEST diff --git a/src/tests/elementary/efl_ui_test_grid_container.c b/src/tests/elementary/efl_ui_test_grid_container.c index 61776237cb..a8e94b05b4 100644 --- a/src/tests/elementary/efl_ui_test_grid_container.c +++ b/src/tests/elementary/efl_ui_test_grid_container.c @@ -14,8 +14,8 @@ item_container_setup() Eo * list = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS); position_manager = efl_new(EFL_UI_POSITION_MANAGER_GRID_CLASS); win = win_add(); - item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, - efl_ui_item_container_position_manager_set(efl_added, list)); + item_container = efl_add(EFL_UI_COLLECTION_CLASS, win, + efl_ui_collection_position_manager_set(efl_added, list)); } diff --git a/src/tests/elementary/efl_ui_test_item_container.c b/src/tests/elementary/efl_ui_test_item_container.c index 9b3de482b3..349f73fee0 100644 --- a/src/tests/elementary/efl_ui_test_item_container.c +++ b/src/tests/elementary/efl_ui_test_item_container.c @@ -28,18 +28,18 @@ EFL_START_TEST(finalizer_check) Eo *o; EXPECT_ERROR_START; - ck_assert_ptr_eq(efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win), NULL); + ck_assert_ptr_eq(efl_add(EFL_UI_COLLECTION_CLASS, win), NULL); EXPECT_ERROR_END; EXPECT_ERROR_START; - ck_assert_ptr_eq(efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, efl_ui_item_container_position_manager_set(efl_added, random_obj)), NULL); + ck_assert_ptr_eq(efl_add(EFL_UI_COLLECTION_CLASS, win, efl_ui_collection_position_manager_set(efl_added, random_obj)), NULL); EXPECT_ERROR_END; - o = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, efl_ui_item_container_position_manager_set(efl_added, grid)); + o = efl_add(EFL_UI_COLLECTION_CLASS, win, efl_ui_collection_position_manager_set(efl_added, grid)); ck_assert_ptr_ne(o, NULL); ck_assert_ptr_eq(efl_parent_get(grid), o); efl_del(o); - o = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, efl_ui_item_container_position_manager_set(efl_added, list)); + o = efl_add(EFL_UI_COLLECTION_CLASS, win, efl_ui_collection_position_manager_set(efl_added, list)); ck_assert_ptr_ne(o, NULL); ck_assert_ptr_eq(efl_parent_get(list), o); efl_del(o); diff --git a/src/tests/elementary/efl_ui_test_item_container_common.c b/src/tests/elementary/efl_ui_test_item_container_common.c index e97f3e7971..3a7cad3678 100644 --- a/src/tests/elementary/efl_ui_test_item_container_common.c +++ b/src/tests/elementary/efl_ui_test_item_container_common.c @@ -67,8 +67,8 @@ EFL_START_TEST(test_multi_select) unselected = NULL; ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_TRUE); ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); - ck_assert_ptr_eq(efl_ui_item_container_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); - _iterator_to_array(&arr_selected, efl_ui_item_container_selected_items_get(item_container)); + ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); + _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); ck_assert_int_eq(eina_array_count(arr_selected), 2); ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 0)); ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(item_container, 2)); @@ -109,8 +109,8 @@ EFL_START_TEST(test_multi_select_removal) selected = NULL; unselected = NULL; - ck_assert_ptr_eq(efl_ui_item_container_last_selected_item_get(item_container), NULL); - _iterator_to_array(&arr_selected, efl_ui_item_container_selected_items_get(item_container)); + ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), NULL); + _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); ck_assert_int_eq(eina_array_count(arr_selected), 0); efl_event_callback_del(item_container, EFL_UI_EVENT_ITEM_SELECTED, _set_pointer_quit, &selected); efl_event_callback_del(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); @@ -140,8 +140,8 @@ EFL_START_TEST(test_single_select) unselected = NULL; ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); - ck_assert_ptr_eq(efl_ui_item_container_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); - _iterator_to_array(&arr_selected, efl_ui_item_container_selected_items_get(item_container)); + ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); + _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); ck_assert_int_eq(eina_array_count(arr_selected), 1); ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 2)); @@ -183,8 +183,8 @@ EFL_START_TEST(test_single_select_always) unselected = NULL; ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); - ck_assert_ptr_eq(efl_ui_item_container_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); - _iterator_to_array(&arr_selected, efl_ui_item_container_selected_items_get(item_container)); + ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); + _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); ck_assert_int_eq(eina_array_count(arr_selected), 1); ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 2)); efl_event_callback_del(item_container, EFL_UI_EVENT_ITEM_SELECTED, _set_pointer_quit, &selected); @@ -215,8 +215,8 @@ EFL_START_TEST(test_none_select) unselected = NULL; ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_FALSE); - ck_assert_ptr_eq(efl_ui_item_container_last_selected_item_get(item_container), NULL); - _iterator_to_array(&arr_selected, efl_ui_item_container_selected_items_get(item_container)); + ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), NULL); + _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); ck_assert_int_eq(eina_array_count(arr_selected), 0); efl_event_callback_del(item_container, EFL_UI_EVENT_ITEM_SELECTED, _set_pointer_quit, &selected); efl_event_callback_del(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); diff --git a/src/tests/elementary/efl_ui_test_list_container.c b/src/tests/elementary/efl_ui_test_list_container.c index 74a41bacaa..6edad08126 100644 --- a/src/tests/elementary/efl_ui_test_list_container.c +++ b/src/tests/elementary/efl_ui_test_list_container.c @@ -14,8 +14,8 @@ item_container_setup() Eo * list = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS); position_manager = efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS); win = win_add(); - item_container = efl_add(EFL_UI_ITEM_CONTAINER_CLASS, win, - efl_ui_item_container_position_manager_set(efl_added, list)); + item_container = efl_add(EFL_UI_COLLECTION_CLASS, win, + efl_ui_collection_position_manager_set(efl_added, list)); } diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c index bf26623a08..8316e36bc7 100644 --- a/src/tests/elementary/spec/efl_ui_spec_suite.c +++ b/src/tests/elementary/spec/efl_ui_spec_suite.c @@ -13,7 +13,7 @@ EOLIAN static Efl_Object* _test_efl_ui_item_container_list_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) { efl_constructor(efl_super(obj, TEST_EFL_UI_ITEM_CONTAINER_LIST_CLASS)); - efl_ui_item_container_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS)); + efl_ui_collection_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS)); return obj; } diff --git a/src/tests/elementary/spec/test_efl_ui_item_container_list.eo b/src/tests/elementary/spec/test_efl_ui_item_container_list.eo index d61bc0fcaa..e1cb3e9884 100644 --- a/src/tests/elementary/spec/test_efl_ui_item_container_list.eo +++ b/src/tests/elementary/spec/test_efl_ui_item_container_list.eo @@ -1,4 +1,4 @@ -class @beta Test.Efl.Ui.Item_Container_List extends Efl.Ui.Item_Container { +class @beta Test.Efl.Ui.Item_Container_List extends Efl.Ui.Collection { data: null; implements { Efl.Object.constructor; From 257b30f9ded8dbd4de55ae0cc703710224a593ab Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 25 Jul 2019 19:24:58 +0200 Subject: [PATCH 10/72] efl_ui_spec_suite: simplify this when i initially added item_container to the spec test suite, there was no plan to make Efl.Ui.List / Efl.Ui.Grid like it is now. However, now we can simply use Efl.Ui.List and Grid instead of this helper class. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9409 --- .../elementary/spec/efl_test_pack_linear.c | 4 ++-- src/tests/elementary/spec/efl_ui_spec_suite.c | 12 ------------ src/tests/elementary/spec/efl_ui_spec_suite.h | 1 - src/tests/elementary/spec/meson.build | 18 ------------------ .../spec/test_efl_ui_item_container_list.eo | 6 ------ 5 files changed, 2 insertions(+), 39 deletions(-) delete mode 100644 src/tests/elementary/spec/test_efl_ui_item_container_list.eo diff --git a/src/tests/elementary/spec/efl_test_pack_linear.c b/src/tests/elementary/spec/efl_test_pack_linear.c index 4da2f8538e..71746eaeee 100644 --- a/src/tests/elementary/spec/efl_test_pack_linear.c +++ b/src/tests/elementary/spec/efl_test_pack_linear.c @@ -9,10 +9,10 @@ /* spec-meta-start {"test-interface":"Efl.Pack_Linear", - "test-widgets": ["Efl.Ui.Box", "Efl.Ui.Grid", "Efl.Ui.Spotlight.Container", "Test.Efl.Ui.Item_Container_List"], + "test-widgets": ["Efl.Ui.Box", "Efl.Ui.Grid", "Efl.Ui.Spotlight.Container", "Efl.Ui.List"], "custom-mapping" : { "Efl.Ui.Grid" : "EFL_UI_GRID_DEFAULT_ITEM_CLASS", - "Test.Efl.Ui.Item_Container_List" : "EFL_UI_LIST_DEFAULT_ITEM_CLASS" + "Efl.Ui.List" : "EFL_UI_LIST_DEFAULT_ITEM_CLASS" } } spec-meta-end */ diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c index 8316e36bc7..dc5462a89e 100644 --- a/src/tests/elementary/spec/efl_ui_spec_suite.c +++ b/src/tests/elementary/spec/efl_ui_spec_suite.c @@ -8,16 +8,6 @@ #include "suite_helpers.h" #include "eo_internal.h" -//helper functions for custom widget intialization -EOLIAN static Efl_Object* -_test_efl_ui_item_container_list_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) -{ - efl_constructor(efl_super(obj, TEST_EFL_UI_ITEM_CONTAINER_LIST_CLASS)); - efl_ui_collection_position_manager_set(obj, efl_new(EFL_UI_POSITION_MANAGER_LIST_CLASS)); - - return obj; -} - Evas_Object *win = NULL; Evas_Object *widget = NULL; const Efl_Class *test_content_klass = NULL; @@ -73,5 +63,3 @@ main(int argc, char **argv) return (failed_count == 0) ? 0 : 255; } - -#include "test_efl_ui_item_container_list.eo.c" diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.h b/src/tests/elementary/spec/efl_ui_spec_suite.h index 6ea53fc801..01be37652d 100644 --- a/src/tests/elementary/spec/efl_ui_spec_suite.h +++ b/src/tests/elementary/spec/efl_ui_spec_suite.h @@ -5,7 +5,6 @@ #define EFL_NOLEGACY_API_SUPPORT #include -#include "test_efl_ui_item_container_list.eo.h" #include "../efl_check.h" extern Evas_Object *win; diff --git a/src/tests/elementary/spec/meson.build b/src/tests/elementary/spec/meson.build index d9fadd9c68..d23c3860dc 100644 --- a/src/tests/elementary/spec/meson.build +++ b/src/tests/elementary/spec/meson.build @@ -1,7 +1,3 @@ -priv_eo_files = [ - 'test_efl_ui_item_container_list.eo', -] - efl_ui_suite_behavior_test_files = files([ 'efl_test_pack.c', 'efl_test_pack_linear.c', @@ -24,20 +20,6 @@ efl_ui_suite_behavior_src = files([ test_generator = find_program('generator.py') - -priv_eo_file_target = [] -foreach eo_file : priv_eo_files - priv_eo_file_target += custom_target('eolian_gen_' + eo_file, - input : eo_file, - output : [eo_file + '.h'], - depfile : eo_file + '.d', - command : eolian_gen + [ '-I', meson.current_source_dir(), eolian_include_directories, - '-o', 'h:' + join_paths(meson.current_build_dir(), eo_file + '.h'), - '-o', 'c:' + join_paths(meson.current_build_dir(), eo_file + '.c'), - '-o', 'd:' + join_paths(meson.current_build_dir(), eo_file + '.d'), - '-gchd', '@INPUT@']) -endforeach - generated_test_parts = custom_target('generate_test_suite', input: efl_ui_suite_behavior_test_files, output: 'efl_ui_spec_suite_gen.x', diff --git a/src/tests/elementary/spec/test_efl_ui_item_container_list.eo b/src/tests/elementary/spec/test_efl_ui_item_container_list.eo deleted file mode 100644 index e1cb3e9884..0000000000 --- a/src/tests/elementary/spec/test_efl_ui_item_container_list.eo +++ /dev/null @@ -1,6 +0,0 @@ -class @beta Test.Efl.Ui.Item_Container_List extends Efl.Ui.Collection { - data: null; - implements { - Efl.Object.constructor; - } -} From 18c7a90f7a67432a9dd3cdb212887fe8d824356a Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 25 Jul 2019 19:35:15 +0200 Subject: [PATCH 11/72] rename Item_Container -> Collection this is the last bit of renaming Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9410 --- ..._ui_test_item_container.c => efl_ui_test_collection.c} | 2 +- ...container_common.c => efl_ui_test_collection_common.c} | 2 +- ...container_common.h => efl_ui_test_collection_common.h} | 0 ...est_grid_container.c => efl_ui_test_grid_collection.c} | 2 +- ...est_list_container.c => efl_ui_test_list_collection.c} | 2 +- .../elementary/efl_ui_test_position_manager_common.c | 2 +- src/tests/elementary/meson.build | 8 ++++---- 7 files changed, 9 insertions(+), 9 deletions(-) rename src/tests/elementary/{efl_ui_test_item_container.c => efl_ui_test_collection.c} (96%) rename src/tests/elementary/{efl_ui_test_item_container_common.c => efl_ui_test_collection_common.c} (99%) rename src/tests/elementary/{efl_ui_test_item_container_common.h => efl_ui_test_collection_common.h} (100%) rename src/tests/elementary/{efl_ui_test_grid_container.c => efl_ui_test_grid_collection.c} (94%) rename src/tests/elementary/{efl_ui_test_list_container.c => efl_ui_test_list_collection.c} (94%) diff --git a/src/tests/elementary/efl_ui_test_item_container.c b/src/tests/elementary/efl_ui_test_collection.c similarity index 96% rename from src/tests/elementary/efl_ui_test_item_container.c rename to src/tests/elementary/efl_ui_test_collection.c index 349f73fee0..c645fba210 100644 --- a/src/tests/elementary/efl_ui_test_item_container.c +++ b/src/tests/elementary/efl_ui_test_collection.c @@ -4,7 +4,7 @@ #include #include "efl_ui_suite.h" -#include "efl_ui_test_item_container_common.h" +#include "efl_ui_test_collection_common.h" static Eo* win; diff --git a/src/tests/elementary/efl_ui_test_item_container_common.c b/src/tests/elementary/efl_ui_test_collection_common.c similarity index 99% rename from src/tests/elementary/efl_ui_test_item_container_common.c rename to src/tests/elementary/efl_ui_test_collection_common.c index 3a7cad3678..c41946afbe 100644 --- a/src/tests/elementary/efl_ui_test_item_container_common.c +++ b/src/tests/elementary/efl_ui_test_collection_common.c @@ -4,7 +4,7 @@ #include #include "efl_ui_suite.h" -#include "efl_ui_test_item_container_common.h" +#include "efl_ui_test_collection_common.h" Eo *item_container; diff --git a/src/tests/elementary/efl_ui_test_item_container_common.h b/src/tests/elementary/efl_ui_test_collection_common.h similarity index 100% rename from src/tests/elementary/efl_ui_test_item_container_common.h rename to src/tests/elementary/efl_ui_test_collection_common.h diff --git a/src/tests/elementary/efl_ui_test_grid_container.c b/src/tests/elementary/efl_ui_test_grid_collection.c similarity index 94% rename from src/tests/elementary/efl_ui_test_grid_container.c rename to src/tests/elementary/efl_ui_test_grid_collection.c index a8e94b05b4..d0dad63c7d 100644 --- a/src/tests/elementary/efl_ui_test_grid_container.c +++ b/src/tests/elementary/efl_ui_test_grid_collection.c @@ -4,7 +4,7 @@ #include #include "efl_ui_suite.h" -#include "efl_ui_test_item_container_common.h" +#include "efl_ui_test_collection_common.h" static Eo *win; diff --git a/src/tests/elementary/efl_ui_test_list_container.c b/src/tests/elementary/efl_ui_test_list_collection.c similarity index 94% rename from src/tests/elementary/efl_ui_test_list_container.c rename to src/tests/elementary/efl_ui_test_list_collection.c index 6edad08126..98af17e7ec 100644 --- a/src/tests/elementary/efl_ui_test_list_container.c +++ b/src/tests/elementary/efl_ui_test_list_collection.c @@ -4,7 +4,7 @@ #include #include "efl_ui_suite.h" -#include "efl_ui_test_item_container_common.h" +#include "efl_ui_test_collection_common.h" static Eo *win; diff --git a/src/tests/elementary/efl_ui_test_position_manager_common.c b/src/tests/elementary/efl_ui_test_position_manager_common.c index e465bd3482..7cf39f92d8 100644 --- a/src/tests/elementary/efl_ui_test_position_manager_common.c +++ b/src/tests/elementary/efl_ui_test_position_manager_common.c @@ -4,7 +4,7 @@ #include #include "efl_ui_suite.h" -#include "efl_ui_test_item_container_common.h" +#include "efl_ui_test_collection_common.h" Eo *position_manager; diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build index 7623a5cc52..3bd7d2f85a 100644 --- a/src/tests/elementary/meson.build +++ b/src/tests/elementary/meson.build @@ -146,10 +146,10 @@ efl_ui_suite_src = [ 'efl_ui_test_spin.c', 'efl_ui_test_spin_button.c', 'efl_ui_test_slider.c', - 'efl_ui_test_item_container_common.c', - 'efl_ui_test_item_container.c', - 'efl_ui_test_list_container.c', - 'efl_ui_test_grid_container.c', + 'efl_ui_test_collection_common.c', + 'efl_ui_test_collection.c', + 'efl_ui_test_list_collection.c', + 'efl_ui_test_grid_collection.c', 'efl_ui_test_position_manager_common.c', ] From 670b7b4a8392c4628d9d21dc8e3db60dec16cc5d Mon Sep 17 00:00:00 2001 From: SangHyeon Jade Lee Date: Mon, 22 Jul 2019 11:12:30 +0000 Subject: [PATCH 12/72] efl_ui : apply item part visible signal properly. efl_layout_signal is being overrided by efl_ui_layout, so do not call the signal emit on resize object directly, call the signal emit on the item widget. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9233 --- src/lib/elementary/efl_ui_item.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index 8b16afd5f2..432486bd69 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -28,7 +28,6 @@ _efl_ui_item_part_text_efl_text_text_set(Eo *obj, void *pd EINA_UNUSED, const ch Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); efl_text_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), text); - efl_layout_signal_emit(wd->obj, "efl,state,text,set", "efl"); elm_layout_sizing_eval(wd->obj); } @@ -45,7 +44,6 @@ _efl_ui_item_part_text_efl_text_markup_markup_set(Eo *obj, void *pd EINA_UNUSED, Elm_Part_Data *wd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); efl_text_markup_set(efl_part(efl_super(wd->obj, MY_CLASS), wd->part), markup); - efl_layout_signal_emit(obj, "efl,state,text,set", "efl"); elm_layout_sizing_eval(obj); } From 6d0b0baf9bec36a364224eb6e6c5d53adc4f2adf Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 12 Jul 2019 18:39:07 +0200 Subject: [PATCH 13/72] efl_ui_spotlight_container: fix ownership behavior of view_manager view_manager is a property that takes ownership of the view_manager object. We are setting the parent in the setter which means, we should actaully have one ref to the parent, and one from the caller, so we need to unref one. Differential Revision: https://phab.enlightenment.org/D9304 --- src/bin/elementary/test_ui_tab_pager.c | 2 -- src/lib/elementary/efl_ui_spotlight_container.c | 7 ++++--- src/lib/elementary/efl_ui_spotlight_util.c | 2 +- src/tests/elementary/efl_ui_test_spotlight.c | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index fe7dc968f7..ab0559276e 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -558,7 +558,6 @@ _tran_set_btn_scroll_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Efl_Ui_Spotlight_Manager_Scroll *scroll = efl_new(EFL_UI_SPOTLIGHT_MANAGER_SCROLL_CLASS); efl_ui_spotlight_manager_set(data, scroll); - efl_unref(scroll); } static void @@ -566,7 +565,6 @@ _tran_set_btn_stack_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Efl_Ui_Spotlight_Manager_Scroll *stack = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); efl_ui_spotlight_manager_set(data, stack); - efl_unref(stack); } static void diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c index 9906864d7a..37ee165667 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.c +++ b/src/lib/elementary/efl_ui_spotlight_container.c @@ -214,9 +214,7 @@ _efl_ui_spotlight_container_efl_object_finalize(Eo *obj, Efl_Ui_Spotlight_Contai //set a view manager in case nothing is here if (!manager) { - Eo *plain; - plain = efl_add(EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS, obj); - efl_ui_spotlight_manager_set(obj, plain); + efl_ui_spotlight_manager_set(obj, efl_new(EFL_UI_SPOTLIGHT_MANAGER_PLAIN_CLASS)); } else { @@ -605,7 +603,10 @@ _efl_ui_spotlight_container_spotlight_manager_set(Eo *obj, Efl_Ui_Spotlight_Cont if (pd->transition) { + EINA_SAFETY_ON_FALSE_RETURN(efl_ownable_get(pd->transition)); efl_parent_set(pd->transition, obj); + //the api indicates that the caller passes ownership to this function, so we need to unref here + efl_unref(pd->transition); //disable animation when not finalized yet, this help reducing the overhead of scheduling a animation that will not be displayed efl_ui_spotlight_manager_animation_enabled_set(pd->transition, efl_finalized_get(obj)); efl_ui_spotlight_manager_bind(pd->transition, obj, diff --git a/src/lib/elementary/efl_ui_spotlight_util.c b/src/lib/elementary/efl_ui_spotlight_util.c index 308b4f3eaa..c49ebd4d8c 100644 --- a/src/lib/elementary/efl_ui_spotlight_util.c +++ b/src/lib/elementary/efl_ui_spotlight_util.c @@ -12,7 +12,7 @@ typedef struct { EOLIAN static Efl_Ui_Spotlight_Container* _efl_ui_spotlight_util_stack_gen(Efl_Ui_Widget *parent) { - Efl_Ui_Spotlight_Manager *manager = efl_add(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS, parent); + Efl_Ui_Spotlight_Manager *manager = efl_new(EFL_UI_SPOTLIGHT_MANAGER_STACK_CLASS); return efl_add(EFL_UI_SPOTLIGHT_CONTAINER_CLASS, parent, efl_ui_spotlight_manager_set(efl_added, manager)); } diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c index 7a39e6e940..6b5a79291d 100644 --- a/src/tests/elementary/efl_ui_test_spotlight.c +++ b/src/tests/elementary/efl_ui_test_spotlight.c @@ -209,7 +209,7 @@ _create_transition(void) { Eo *obj; - obj = efl_add(efl_ui_spotlight_manager_realized_class_get(), win); + obj = efl_new(efl_ui_spotlight_manager_realized_class_get()); efl_object_override(obj, &transition_tracker); return obj; From 2a970046bc6355af59e0b4c0f7d44e0b44d764bb Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 12 Jul 2019 19:33:31 +0200 Subject: [PATCH 14/72] efl_ui_spotlight_container: mirror the behavior of view_manager setting the parent here is usefull, as we can forgot about this object then, and do not have to free the object by hand. Differential Revision: https://phab.enlightenment.org/D9305 --- src/bin/elementary/test_ui_spotlight.c | 2 +- src/lib/elementary/efl_ui_spotlight_container.c | 4 ++++ src/tests/elementary/efl_ui_test_spotlight.c | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c index bcb6fbbd3e..ff0cbdd6f5 100644 --- a/src/bin/elementary/test_ui_spotlight.c +++ b/src/bin/elementary/test_ui_spotlight.c @@ -347,7 +347,7 @@ indicator_icon_btn_cb(void *data, const Efl_Event *ev EINA_UNUSED) { Params *params = data; - params->indicator = efl_add(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS, params->spotlight); + params->indicator = efl_new(EFL_UI_SPOTLIGHT_INDICATOR_ICON_CLASS); efl_ui_spotlight_indicator_set(params->spotlight, params->indicator); } diff --git a/src/lib/elementary/efl_ui_spotlight_container.c b/src/lib/elementary/efl_ui_spotlight_container.c index 37ee165667..45afd99b1b 100644 --- a/src/lib/elementary/efl_ui_spotlight_container.c +++ b/src/lib/elementary/efl_ui_spotlight_container.c @@ -637,6 +637,10 @@ _efl_ui_spotlight_container_indicator_set(Eo *obj, Efl_Ui_Spotlight_Container_Da pd->indicator = indicator; if (pd->indicator) { + EINA_SAFETY_ON_FALSE_RETURN(efl_ownable_get(pd->indicator)); + efl_parent_set(pd->indicator, obj); + //the api indicates that the caller passes ownership to this function, so we need to unref here + efl_unref(pd->indicator); efl_ui_spotlight_indicator_bind(pd->indicator, obj); if (pd->position != -1) efl_ui_spotlight_indicator_position_update(pd->indicator, pd->position); diff --git a/src/tests/elementary/efl_ui_test_spotlight.c b/src/tests/elementary/efl_ui_test_spotlight.c index 6b5a79291d..0bad5c362f 100644 --- a/src/tests/elementary/efl_ui_test_spotlight.c +++ b/src/tests/elementary/efl_ui_test_spotlight.c @@ -81,7 +81,7 @@ _create_indicator(void) { Eo *obj; - obj = efl_add(efl_ui_spotlight_indicator_realized_class_get(), win); + obj = efl_new(efl_ui_spotlight_indicator_realized_class_get()); efl_object_override(obj, &indicator_tracker); return obj; From e3557ec944271902b92523beffbadc09c054e700 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 12 Jul 2019 20:04:06 +0200 Subject: [PATCH 15/72] efl_ui_spotlight_manager_*: cleanup canvas state on invalidate this is needed so we can support a empty object which is not freed. Sounds useless, but required by bindings, this fixes the issue described in D9300. Differential Revision: https://phab.enlightenment.org/D9306 --- src/lib/elementary/efl_ui_spotlight_manager_scroll.c | 4 ++-- src/lib/elementary/efl_ui_spotlight_manager_scroll.eo | 2 +- src/lib/elementary/efl_ui_spotlight_manager_stack.c | 4 ++-- src/lib/elementary/efl_ui_spotlight_manager_stack.eo | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c index 1bc688b30d..778079d864 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.c @@ -316,7 +316,7 @@ _efl_ui_spotlight_manager_scroll_efl_ui_spotlight_manager_animation_enabled_get( EOLIAN static void -_efl_ui_spotlight_manager_scroll_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd EINA_UNUSED) +_efl_ui_spotlight_manager_scroll_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Scroll_Data *pd EINA_UNUSED) { efl_event_callback_del(pd->group, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, obj); efl_event_callback_del(pd->group, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, obj); @@ -329,7 +329,7 @@ _efl_ui_spotlight_manager_scroll_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight efl_canvas_object_clipper_set(efl_pack_content_get(pd->container, i), NULL); } - efl_destructor(efl_super(obj, MY_CLASS)); + efl_invalidate(efl_super(obj, MY_CLASS)); } diff --git a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo index 8ba9ac6597..942ad192ca 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo +++ b/src/lib/elementary/efl_ui_spotlight_manager_scroll.eo @@ -7,6 +7,6 @@ class @beta Efl.Ui.Spotlight.Manager_Scroll extends Efl.Ui.Spotlight.Manager Efl.Ui.Spotlight.Manager.switch_to; Efl.Ui.Spotlight.Manager.size {set;} Efl.Ui.Spotlight.Manager.animation_enabled {set; get;} - Efl.Object.destructor; + Efl.Object.invalidate; } } diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.c b/src/lib/elementary/efl_ui_spotlight_manager_stack.c index ceff490f69..0df770db7c 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.c +++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.c @@ -231,12 +231,12 @@ _efl_ui_spotlight_manager_stack_efl_ui_spotlight_manager_size_set(Eo *obj, Efl_U } EOLIAN static void -_efl_ui_spotlight_manager_stack_efl_object_destructor(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd EINA_UNUSED) +_efl_ui_spotlight_manager_stack_efl_object_invalidate(Eo *obj, Efl_Ui_Spotlight_Manager_Stack_Data *pd EINA_UNUSED) { efl_event_callback_del(pd->group, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _resize_cb, obj); efl_event_callback_del(pd->group, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _move_cb, obj); - efl_destructor(efl_super(obj, MY_CLASS)); + efl_invalidate(efl_super(obj, MY_CLASS)); for (int i = 0; i < efl_content_count(pd->container); ++i) { diff --git a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo b/src/lib/elementary/efl_ui_spotlight_manager_stack.eo index 999293bda7..c18fe31a8a 100644 --- a/src/lib/elementary/efl_ui_spotlight_manager_stack.eo +++ b/src/lib/elementary/efl_ui_spotlight_manager_stack.eo @@ -7,6 +7,6 @@ class @beta Efl.Ui.Spotlight.Manager_Stack extends Efl.Ui.Spotlight.Manager Efl.Ui.Spotlight.Manager.switch_to; Efl.Ui.Spotlight.Manager.size {set;} Efl.Ui.Spotlight.Manager.animation_enabled {set; get;} - Efl.Object.destructor; + Efl.Object.invalidate; } } From 6c93461324c7687aa81eec6b58635e0ea3a786c3 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 14:45:48 -0400 Subject: [PATCH 16/72] efl_ui/timepicker: fix range clamping on 12 hour timepickers Summary: this errors all the time otherwise Reviewers: devilhorns Reviewed By: devilhorns Subscribers: devilhorns, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9396 --- src/lib/elementary/efl_ui_timepicker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c index 938c22c846..59ef13d3f1 100644 --- a/src/lib/elementary/efl_ui_timepicker.c +++ b/src/lib/elementary/efl_ui_timepicker.c @@ -59,7 +59,7 @@ _field_value_update(Eo *obj) if (!pd->is_24hour) { - if (pd->cur_time[TIMEPICKER_HOUR] >= 12) + if (pd->cur_time[TIMEPICKER_HOUR] > 12) { //TODO: gets text from strftime. efl_text_set(pd->ampm, "PM"); @@ -68,7 +68,7 @@ _field_value_update(Eo *obj) else { efl_text_set(pd->ampm, "AM"); - efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR] + 12); + efl_ui_range_value_set(pd->hour, pd->cur_time[TIMEPICKER_HOUR]); } } From 485d2e37d8af406fa99b75bf3372bb0d59a07621 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 14:46:12 -0400 Subject: [PATCH 17/72] elm/glview: fix glview to (again) return null if context creation fails Summary: engine internals have changed, so it's necessary to actually check whether the glview api is available now to determine whether the glview is viable @fix Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D9397 --- src/lib/elementary/elm_glview.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/elm_glview.c b/src/lib/elementary/elm_glview.c index 51e3cb6da6..a33921a4c9 100644 --- a/src/lib/elementary/elm_glview.c +++ b/src/lib/elementary/elm_glview.c @@ -272,7 +272,7 @@ _elm_glview_constructor(Eo *obj, Elm_Glview_Data *priv) priv->context = evas_gl_context_create(priv->evasgl, NULL); else priv->context = evas_gl_context_version_create(priv->evasgl, NULL, priv->gles_version); - if (!priv->context) + if ((!priv->context) || (!evas_gl_context_api_get(priv->evasgl, priv->context))) { ERR("Error Creating an Evas_GL Context."); ELM_SAFE_FREE(priv->config, evas_gl_config_free); From 880296bb7d93ce74153978f25c4bccbed61a340c Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 14:46:34 -0400 Subject: [PATCH 18/72] elm_test/plug: fix error handling Summary: if plug connection fails, a notification can't always be created because there may be no object passed to this function to create a notify object on @fix Reviewers: devilhorns Reviewed By: devilhorns Subscribers: cedric, #reviewers, #committers Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D9400 --- src/bin/elementary/test_win_plug.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/bin/elementary/test_win_plug.c b/src/bin/elementary/test_win_plug.c index 615e6fa8d5..b94f324c10 100644 --- a/src/bin/elementary/test_win_plug.c +++ b/src/bin/elementary/test_win_plug.c @@ -196,7 +196,10 @@ test_win_plug(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UN evas_object_event_callback_add(plug, EVAS_CALLBACK_DEL, _timer_del, NULL); if (!elm_plug_connect(plug, "ello", 0, EINA_FALSE)) { - _notify_error(data, "Unable to connect to the Window Socket!"); + if (data) + _notify_error(data, "Unable to connect to the Window Socket!"); + else + fprintf(stderr, "Unable to connect to the Window Socket!\n"); evas_object_del(win); return; } From f66844ebbf3b58bc5504caacede3fc9ef96418d0 Mon Sep 17 00:00:00 2001 From: Cedric BAIL Date: Wed, 24 Jul 2019 15:48:30 -0700 Subject: [PATCH 19/72] elementary: use data:null to remove unecessary structure declaration. Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9389 --- src/lib/elementary/efl_ui_grid.c | 6 +----- src/lib/elementary/efl_ui_grid.eo | 2 +- src/lib/elementary/efl_ui_list.c | 8 ++------ src/lib/elementary/efl_ui_list.eo | 1 + 4 files changed, 5 insertions(+), 12 deletions(-) diff --git a/src/lib/elementary/efl_ui_grid.c b/src/lib/elementary/efl_ui_grid.c index 709765373c..226b3780cb 100644 --- a/src/lib/elementary/efl_ui_grid.c +++ b/src/lib/elementary/efl_ui_grid.c @@ -15,12 +15,8 @@ #define MY_CLASS_NAME "Efl.Ui.Grid" -typedef struct { - -} Efl_Ui_Grid_Data; - EOLIAN static Eo * -_efl_ui_grid_efl_object_constructor(Eo *obj, Efl_Ui_Grid_Data *pd EINA_UNUSED) +_efl_ui_grid_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); diff --git a/src/lib/elementary/efl_ui_grid.eo b/src/lib/elementary/efl_ui_grid.eo index 48221f8f72..832fcf1c31 100644 --- a/src/lib/elementary/efl_ui_grid.eo +++ b/src/lib/elementary/efl_ui_grid.eo @@ -1,7 +1,7 @@ class @beta Efl.Ui.Grid extends Efl.Ui.Collection { [[Simple grid widget with Pack interface.]] - + data: null; implements { Efl.Object.constructor; } diff --git a/src/lib/elementary/efl_ui_list.c b/src/lib/elementary/efl_ui_list.c index 9a4cc7fb16..0281fd8b30 100644 --- a/src/lib/elementary/efl_ui_list.c +++ b/src/lib/elementary/efl_ui_list.c @@ -15,12 +15,8 @@ #define MY_CLASS_NAME "Efl.Ui.List" -typedef struct { - -} Efl_Ui_List_Data; - -EOLIAN static Eo * -_efl_ui_list_efl_object_constructor(Eo *obj, Efl_Ui_List_Data *pd EINA_UNUSED) +static Eo * +_efl_ui_list_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo index 94e90f760d..3cb2fea202 100644 --- a/src/lib/elementary/efl_ui_list.eo +++ b/src/lib/elementary/efl_ui_list.eo @@ -1,6 +1,7 @@ class @beta Efl.Ui.List extends Efl.Ui.Collection { [[Simple list widget with Pack interface.]] + data: null; implements { Efl.Object.constructor; } From 3210fa3d69a639f85c9252d6776fa86060324fbf Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 26 Jul 2019 13:12:48 +0900 Subject: [PATCH 20/72] ector: Prevent access to NULL buffer in software rasterizer Summary: Prevents a crash caused by a null pointer exception when ector surface buffer is NULL. Test Plan: N/A Reviewers: Hermet, smohanty, kimcinoo Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9390 --- src/lib/ector/software/ector_software_rasterizer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lib/ector/software/ector_software_rasterizer.c b/src/lib/ector/software/ector_software_rasterizer.c index a368774310..808f723b81 100644 --- a/src/lib/ector/software/ector_software_rasterizer.c +++ b/src/lib/ector/software/ector_software_rasterizer.c @@ -54,6 +54,7 @@ _blend_alpha(int count, const SW_FT_Span *spans, void *user_data) Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -97,6 +98,7 @@ _blend_alpha_inv(int count, const SW_FT_Span *spans, void *user_data) Span_Data *sd = user_data; const int pix_stride = sd->raster_buffer->stride / 4; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; // multiply the color with mul_col if any uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); @@ -140,6 +142,7 @@ _blend_mask_add(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -164,6 +167,7 @@ _blend_mask_sub(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -189,6 +193,7 @@ _blend_mask_ins(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -227,6 +232,7 @@ _blend_mask_diff(int count, const SW_FT_Span *spans, void *user_data) { Span_Data *sd = user_data; Ector_Software_Buffer_Base_Data *mask = sd->mask; + if (!mask || !mask->pixels.u32) return; uint32_t color = DRAW_MUL4_SYM(sd->color, sd->mul_col); RGBA_Comp_Func_Solid comp_func = efl_draw_func_solid_span_get(sd->op, color); @@ -905,6 +911,7 @@ ector_software_rasterizer_draw_rle_data(Software_Rasterizer *rasterizer, int mask_op) { if (!rle) return; + if (!rasterizer->fill_data.raster_buffer->pixels.u32) return; rasterizer->fill_data.offx = x; rasterizer->fill_data.offy = y; From e1e4f904464230460bcd12935529e45793901b09 Mon Sep 17 00:00:00 2001 From: Taehyub Kim Date: Fri, 26 Jul 2019 09:02:01 +0200 Subject: [PATCH 21/72] Efl.Gfx.Hint_Align: add define values for Efl.Gfx.Hint_Align Summary: Add define values for Efl.Gfx.Hint_Align - Efl.Gfx.Hint_Align_Left - Efl.Gfx.Hint_Align_Right - Efl.Gfx.Hint_Align_Top - Efl.Gfx.Hint_Align_Bottom - Efl.Gfx.Hint_Align_Center Reviewers: bu5hm4n, Jaehyun_Cho, woohyun, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9413 --- src/lib/efl/interfaces/efl_gfx_hint.eo | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/lib/efl/interfaces/efl_gfx_hint.eo b/src/lib/efl/interfaces/efl_gfx_hint.eo index 08f521fcf4..286474f888 100644 --- a/src/lib/efl/interfaces/efl_gfx_hint.eo +++ b/src/lib/efl/interfaces/efl_gfx_hint.eo @@ -4,6 +4,17 @@ import efl_gfx_types; const Efl.Gfx.Hint_Expand: double = 1.0; [[Use with @Efl.Gfx.Hint.hint_weight.]] +const Efl.Gfx.Hint_Align_Left: double = 0.0; + [[Use with @Efl.Gfx.Hint.hint_align.]] +const Efl.Gfx.Hint_Align_Right: double = 1.0; + [[Use with @Efl.Gfx.Hint.hint_align.]] +const Efl.Gfx.Hint_Align_Top: double = 0.0; + [[Use with @Efl.Gfx.Hint.hint_align.]] +const Efl.Gfx.Hint_Align_Bottom: double = 1.0; + [[Use with @Efl.Gfx.Hint.hint_align.]] +const Efl.Gfx.Hint_Align_Center: double = 0.5; + [[Use with @Efl.Gfx.Hint.hint_align.]] + interface Efl.Gfx.Hint { [[Efl graphics hint interface From e40f666807ea4dfd19dfd37b96c8da5a56c7a62e Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Thu, 7 Feb 2019 18:01:56 +0100 Subject: [PATCH 22/72] Efl.Ui.Text: Minor tweaks on the documentation. --- src/lib/elementary/efl_ui_selection_types.eot | 2 +- src/lib/elementary/efl_ui_text.eo | 24 ++++++++----------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/lib/elementary/efl_ui_selection_types.eot b/src/lib/elementary/efl_ui_selection_types.eot index a8d156c37e..cbe5e0dc7b 100644 --- a/src/lib/elementary/efl_ui_selection_types.eot +++ b/src/lib/elementary/efl_ui_selection_types.eot @@ -11,7 +11,7 @@ enum @beta Efl.Ui.Selection_Format { [[Selection format]] targets = -1, [[For matching every possible atom]] - none = 0x0, [[Content is from outside of Elementary]] + none = 0x0, [[Content is from outside of EFL]] text = 0x01, [[Plain unformatted text: Used for things that don't want rich markup]] markup = 0x2, [[Edje textblock markup, including inline images]] image = 0x4, [[Images]] diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index 4ebb3faec8..d34b2822d2 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -5,24 +5,20 @@ class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, Efl.Ui.Selectable, Efl.Text_Interactive, Efl.Text_Markup { - [[Efl UI text class]] + [[A flexible text widget which can be static (as a label) or editable by + the user (as a text entry). It provides all sorts of editing facilities + like automatic scrollbars, virtual keyboard, clipboard, configurable + context menus, password mode or autocapitalization, for example.]] methods { @property scrollable { - set { - [[Enable or disable scrolling in entry + [[Enable or disable scrolling in the widget. - Normally the entry is not scrollable unless you enable it with this call. - ]] - } - get { - [[Get the scrollable state of the entry - - Normally the entry is not scrollable. This gets the scrollable state - of the entry. - ]] - } + When scrolling is enabled scrollbars will appear if the text does + not fit the widget size.]] + set {} + get {} values { - scroll: bool; [[$true if it is to be scrollable, $false otherwise.]] + scroll: bool; [[$true to enable scrolling. Default is $false.]] } } @property input_panel_show_on_demand { From 24a49c893886d4fa8cd81f727c465f717c3a0629 Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Fri, 26 Jul 2019 16:49:45 +0900 Subject: [PATCH 23/72] ecore_evas: prevent double free evas. When user manually free the ecore evas, it could delete evas internally, then evas_invalidate would be triggered, invalidate callback would try free evas again, this causes double free evas. TEST SCENARIO: ee = ecore_evas_new(...); ... ecore_evas_free(ee); -> free evas -> invalidated cb -> free evas (**double free) This is a regression bug by 5847886a3fdb7c470bd55e215b822bbbaf109080 --- src/lib/ecore_evas/ecore_evas.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c index 672b7c4072..18c251f007 100644 --- a/src/lib/ecore_evas/ecore_evas.c +++ b/src/lib/ecore_evas/ecore_evas.c @@ -3502,7 +3502,11 @@ _ecore_evas_free(Ecore_Evas *ee) ee->prop.wm_rot.manual_mode.timer = NULL; eina_hash_free(ee->prop.cursors); ee->prop.cursors = NULL; - if (!ee->evas_dying) evas_free(ee->evas); + if (!ee->evas_dying) + { + ee->evas_dying = EINA_TRUE; + evas_free(ee->evas); + } ee->evas = NULL; ECORE_MAGIC_SET(ee, ECORE_MAGIC_NONE); ee->driver = NULL; @@ -5276,6 +5280,7 @@ static void _ecore_evas_event_del(void *data, const Efl_Event *ev EINA_UNUSED) { Ecore_Evas *ee = data; + if (ee->evas_dying) return; ee->evas_dying = EINA_TRUE; ecore_evas_free(ee); From d19e435ff9a4716e890d2653af6a1231d8961e37 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 26 Jul 2019 10:15:47 +0100 Subject: [PATCH 24/72] reduce syscalls on opening files - roll CLOEXEC into open on linux open supports() O_CLOEXEC. add test case for this in meson build and ifdef. this rolls 3 syscalls into 1 as we were doing open, then fnctl to get and fcntl to set flags. less syscalls is a good thing as syscalls are not cheap on some architectures or systems. I've seen a syscall on 1 system take 2-3x as long as another and another syscall in the same 2 system comparison take 10x as long. depending on the syscall you may only have a budget of something like 5000 syscalls "per frame" (60fps) before you spend all of your frame time just in syscalls not doing any processing, so we should keep these down if possible and that is what this does. --- header_checks/meson.build | 14 ++++++++++++++ src/lib/eina/eina_file.c | 21 +++++++++++++++------ src/lib/eina/eina_mmap.c | 6 ++++++ 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/header_checks/meson.build b/header_checks/meson.build index ff5b21ee0c..4cc855e218 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -123,6 +123,20 @@ function_checks = [ ['dladdr', ['dlfcn.h'], ['dl'], '-D_GNU_SOURCE=1'] ] +open_cloexec = cc.run('''#include + #include + #include + int main(int argc, char **argv) { + int res = open(argv[0], O_RDONLY | O_CLOEXEC); + if (res < 0) return 1; + return 0; + } + ''', + name : 'open works with O_CLOEXEC') +if open_cloexec.compiled() and open_cloexec.returncode() == 0 + config_h.set10('HAVE_OPEN_CLOEXEC', true) +endif + strerror_r_char_p = cc.compiles('''#define _GNU_SOURCE #include int func (void) diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c index cc53f65cce..068aa12e14 100644 --- a/src/lib/eina/eina_file.c +++ b/src/lib/eina/eina_file.c @@ -802,19 +802,28 @@ eina_file_open(const char *path, Eina_Bool shared) if (!filename) return NULL; if (shared) + { #ifdef HAVE_SHM_OPEN - fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) + goto on_error; #else - goto on_error; + goto on_error; #endif + } else - fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + { +#ifdef HAVE_OPEN_CLOEXEC + fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO | O_CLOEXEC); +#else + fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) + goto on_error; +#endif + } if (fd < 0) goto on_error; - if (!eina_file_close_on_exec(fd, EINA_TRUE)) - goto on_error; - if (fstat(fd, &file_stat)) goto on_error; diff --git a/src/lib/eina/eina_mmap.c b/src/lib/eina/eina_mmap.c index 11d8804759..23386dac1d 100644 --- a/src/lib/eina/eina_mmap.c +++ b/src/lib/eina/eina_mmap.c @@ -198,10 +198,16 @@ eina_mmap_safety_enabled_set(Eina_Bool enabled) /* no zero page device - open it */ if (_eina_mmap_zero_fd < 0) { +#ifdef HAVE_OPEN_CLOEXEC + _eina_mmap_zero_fd = open("/dev/zero", O_RDWR | O_CLOEXEC); + /* if we don;'t have one - fail to set up mmap safety */ + if (_eina_mmap_zero_fd < 0) return EINA_FALSE; +#else _eina_mmap_zero_fd = open("/dev/zero", O_RDWR); /* if we don;'t have one - fail to set up mmap safety */ if (_eina_mmap_zero_fd < 0) return EINA_FALSE; eina_file_close_on_exec(_eina_mmap_zero_fd, EINA_TRUE); +#endif } /* set up signal handler for SIGBUS */ sa.sa_sigaction = _eina_mmap_safe_sigbus; From f230dc9dbc08b52a26a8d547cc107fb1818ba5d1 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 26 Jul 2019 13:02:21 +0200 Subject: [PATCH 25/72] eolian-cxx: Add binbuf and event keywords handling n Summary: Add support in Eolian-Cxx for binbuf and event keywords and tests. It will generate the C type while the manual binding in C++ for the types do not exist. Reviewers: q66, lauromoura Reviewed By: q66 Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9412 --- src/lib/eolian_cxx/grammar/type_impl.hpp | 24 ++++++++++++++++++++++++ src/tests/eolian_cxx/generic.c | 15 +++++++++++++++ src/tests/eolian_cxx/generic.eo | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/src/lib/eolian_cxx/grammar/type_impl.hpp b/src/lib/eolian_cxx/grammar/type_impl.hpp index c5bd4d8363..b8cb7342b6 100644 --- a/src/lib/eolian_cxx/grammar/type_impl.hpp +++ b/src/lib/eolian_cxx/grammar/type_impl.hpp @@ -140,6 +140,30 @@ struct visitor_generate r.base_qualifier.qualifier ^= qualifier_info::is_ref; return replace_base_type(r, " ::efl::eina::strbuf"); }} + , {"event", nullptr, nullptr, nullptr, [&] + { + regular_type_def r = regular; + r.base_qualifier.qualifier ^= qualifier_info::is_ref; + if (r.base_qualifier.qualifier & qualifier_info::is_const) + { + r.base_qualifier.qualifier ^= qualifier_info::is_const; + return replace_base_type(r, " Efl_Event*"); + } + else + return replace_base_type(r, " Efl_Event const*"); + }} + , {"binbuf", nullptr, nullptr, nullptr, [&] + { + regular_type_def r = regular; + r.base_qualifier.qualifier ^= qualifier_info::is_ref; + if (r.base_qualifier.qualifier & qualifier_info::is_const) + { + r.base_qualifier.qualifier ^= qualifier_info::is_const; + return replace_base_type(r, " Eina_Binbuf*"); + } + else + return replace_base_type(r, " Eina_Binbuf const*"); + }} /* FIXME: handle any_value_ptr */ , {"any_value", true, nullptr, nullptr, [&] { diff --git a/src/tests/eolian_cxx/generic.c b/src/tests/eolian_cxx/generic.c index ebc33aca25..0bbf894457 100644 --- a/src/tests/eolian_cxx/generic.c +++ b/src/tests/eolian_cxx/generic.c @@ -138,5 +138,20 @@ static void _generic_protected_beta_method1(Eo *obj EINA_UNUSED, Generic_Data* p static void _generic_beta_method1(Eo *obj EINA_UNUSED, Generic_Data* pd EINA_UNUSED) { } +void _generic_event_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, Efl_Event *value EINA_UNUSED) +{ +} +void _generic_const_event_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, const Efl_Event *value EINA_UNUSED) +{ +} +void _generic_binbuf_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, Eina_Binbuf *value EINA_UNUSED) +{ +} +void _generic_const_binbuf_param(Eo *obj EINA_UNUSED, Generic_Data *pd EINA_UNUSED, const Eina_Binbuf *value EINA_UNUSED) +{ +} + + + #include "generic.eo.c" #include "generic_interface.eo.c" diff --git a/src/tests/eolian_cxx/generic.eo b/src/tests/eolian_cxx/generic.eo index 5bc284fc4a..cf7aa3b31e 100644 --- a/src/tests/eolian_cxx/generic.eo +++ b/src/tests/eolian_cxx/generic.eo @@ -94,6 +94,26 @@ class Generic extends Efl.Object implements Generic_Interface } protected_beta_method1 @protected @beta { } + event_param { + params { + value: event; + } + } + const_event_param { + params { + value: const(event); + } + } + binbuf_param { + params { + value: binbuf; + } + } + const_binbuf_param { + params { + value: const(binbuf); + } + } } constructors { .required_ctor_a; From d964a04da1ee654d9829c1b92dbb1ebb1d5738d7 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 26 Jul 2019 13:02:00 +0200 Subject: [PATCH 26/72] eo: remove Efl_Event definition (replace with builtin) --- src/lib/ecore/efl_threadio.eo | 4 ++-- src/lib/elementary/efl_ui_widget.eo | 2 +- src/lib/eo/efl_object.eo | 14 -------------- 3 files changed, 3 insertions(+), 17 deletions(-) diff --git a/src/lib/ecore/efl_threadio.eo b/src/lib/ecore/efl_threadio.eo index 2049ad86d6..14f6507c24 100644 --- a/src/lib/ecore/efl_threadio.eo +++ b/src/lib/ecore/efl_threadio.eo @@ -3,14 +3,14 @@ import efl_object; function @beta EFlThreadIOCall { [[ A Function to call on the "other end" of a thread obvject ]] params { - @cref event: Efl.Event; [[ ]] + @in event: const(event); [[ ]] } }; function @beta EFlThreadIOCallSync { [[ A Function to call on the "other end" of a thread obvject ]] params { - @cref event: Efl.Event; [[ ]] + @in event: const(event); [[ ]] } return: void_ptr; [[ ]] }; diff --git a/src/lib/elementary/efl_ui_widget.eo b/src/lib/elementary/efl_ui_widget.eo index 1c2f85abf9..ea5435848c 100644 --- a/src/lib/elementary/efl_ui_widget.eo +++ b/src/lib/elementary/efl_ui_widget.eo @@ -174,7 +174,7 @@ abstract Efl.Ui.Widget extends Efl.Canvas.Group implements Efl.Access.Object, makes sure other widgets will not also process this input event. ]] params { - @cref eo_event: Efl.Event; + @in eo_event: const(event); [[EO event struct with an Efl.Input.Event as info.]] @in source: Efl.Canvas.Object; [[Source object where the event originated. Often same as this.]] diff --git a/src/lib/eo/efl_object.eo b/src/lib/eo/efl_object.eo index 0b3c403a20..2548f9d6f3 100644 --- a/src/lib/eo/efl_object.eo +++ b/src/lib/eo/efl_object.eo @@ -437,17 +437,3 @@ abstract Efl.Object reference you keep to the object.]] } } - -struct @extern Efl.Event { - [[A parameter passed in event callbacks holding extra event parameters. - - This is the full event information passed to callbacks in C. - ]] - object: Efl.Object; [[The object the callback was called on.]] - desc: const(ptr(Efl.Event_Description)); [[The event description.]] - info: void_ptr; [[Extra event information passed by the event caller. - Must be cast to the event type declared in the EO file. Keep in mind that: - 1) Objects are passed as a normal Eo*. Event subscribers can call functions on these objects. - 2) Structs, built-in types and containers are passed as const pointers, with one level of indirection. - ]] -} From 635a2df7e7e69d051a290f616c9e14528404f42b Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 26 Jul 2019 13:35:27 +0200 Subject: [PATCH 27/72] eolian: ban void_ptr in stable APIs This required some refactoring in eldbus and tests but otherwise seems good to go. --- src/lib/eldbus/Eldbus.h | 20 +++- src/lib/eldbus/eldbus_introspection.h | 104 +++++++++++++++++- src/lib/eldbus/eldbus_types.eot | 26 ++--- src/lib/eolian/database_validate.c | 11 ++ src/lib/evas/include/evas_ector_buffer.eo | 2 +- .../eolian_cxx/name1_name2_type_generation.eo | 2 +- 6 files changed, 148 insertions(+), 17 deletions(-) diff --git a/src/lib/eldbus/Eldbus.h b/src/lib/eldbus/Eldbus.h index c69c056c41..18c3de5d1b 100644 --- a/src/lib/eldbus/Eldbus.h +++ b/src/lib/eldbus/Eldbus.h @@ -212,7 +212,25 @@ typedef void (*Eldbus_Signal_Cb)(void *data, const Eldbus_Message *msg); * @} */ -#include "eldbus_types.eot.h" +/* FIXME: these are duplicated as @extern in eldbus_types.eot */ + +/** Represents a client object bound to an interface + * + * @ingroup Eldbus + */ +typedef struct _Eldbus_Proxy Eldbus_Proxy; + +/** Represents a connection of one the type of connection with the DBus daemon. + * + * @ingroup Eldbus + */ +typedef struct _Eldbus_Connection Eldbus_Connection; + +/** Represents an object path already attached with bus name or unique id + * + * @ingroup Eldbus + */ +typedef struct _Eldbus_Object Eldbus_Object; #include "eldbus_connection.h" #include "eldbus_message.h" diff --git a/src/lib/eldbus/eldbus_introspection.h b/src/lib/eldbus/eldbus_introspection.h index 7c0249874b..665d38a160 100644 --- a/src/lib/eldbus/eldbus_introspection.h +++ b/src/lib/eldbus/eldbus_introspection.h @@ -4,7 +4,109 @@ #include #include -#include "eldbus_types.eot.h" +/* FIXME: these are duplicated as @extern in eldbus_types.eot */ + +/** Argument direction + * + * @ingroup Eldbus_Introspection + */ +typedef enum +{ + ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_NONE = 0, /**< No direction */ + ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_IN, /**< Incoming direction */ + ELDBUS_INTROSPECTION_ARGUMENT_DIRECTION_OUT /**< Outgoing direction */ +} Eldbus_Introspection_Argument_Direction; + +/** Property access rights + * + * @ingroup Eldbus_Introspection + */ +typedef enum +{ + ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READ = 0, /**< Property can be read */ + ELDBUS_INTROSPECTION_PROPERTY_ACCESS_WRITE, /**< Property can be written */ + ELDBUS_INTROSPECTION_PROPERTY_ACCESS_READWRITE /**< Property can be read and + * written */ +} Eldbus_Introspection_Property_Access; + +/** DBus Node + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Node +{ + Eina_Stringshare *name; /**< Node name (optional) */ + Eina_List *nodes; /**< List with nodes */ + Eina_List *interfaces; /**< List with interfaces */ +} Eldbus_Introspection_Node; + +/** DBus Interface + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Interface +{ + Eina_Stringshare *name; /**< Interface name */ + Eina_List *methods; /**< List with interface methods */ + Eina_List *signals; /**< List with interface signals */ + Eina_List *properties; /**< List with interface properties */ + Eina_List *annotations; /**< List with interface annotations */ +} Eldbus_Introspection_Interface; + +/** DBus Method + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Method +{ + Eina_Stringshare *name; /**< Method name */ + Eina_List *arguments; /**< List with method arguments */ + Eina_List *annotations; /**< List with method annotations */ +} Eldbus_Introspection_Method; + +/** DBus Property + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Property +{ + Eina_Stringshare *name; /**< Property name */ + Eina_Stringshare *type; /**< Property type */ + Eldbus_Introspection_Property_Access access; /**< Property access rights */ + Eina_List *annotations; /**< List with property annotations */ +} Eldbus_Introspection_Property; + +/** DBus Annotation + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Annotation +{ + Eina_Stringshare *name; /**< Annotation name */ + Eina_Stringshare *value; /**< Annotation value */ +} Eldbus_Introspection_Annotation; + +/** DBus Argument + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Argument +{ + Eina_Stringshare *name; /**< Argument name (optional) */ + Eina_Stringshare *type; /**< Argument type */ + Eldbus_Introspection_Argument_Direction direction; /**< Argument direction */ +} Eldbus_Introspection_Argument; + +/** DBus Signal + * + * @ingroup Eldbus_Introspection + */ +typedef struct _Eldbus_Introspection_Signal +{ + Eina_Stringshare *name; /**< Signal name */ + Eina_List *arguments; /**< List with signal arguments */ + Eina_List *annotations; /**< List with signal annotations */ +} Eldbus_Introspection_Signal; /** * @brief Parses the introspection xml abstracting it to an object tree diff --git a/src/lib/eldbus/eldbus_types.eot b/src/lib/eldbus/eldbus_types.eot index ebd3130a43..a4a5babd2c 100644 --- a/src/lib/eldbus/eldbus_types.eot +++ b/src/lib/eldbus/eldbus_types.eot @@ -1,8 +1,8 @@ -struct Eldbus.Proxy; [[Represents a client object bound to an interface]] -struct Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]] -struct Eldbus.Object; [[Represents an object path already attached with bus name or unique id]] +struct @beta @extern Eldbus.Proxy; [[Represents a client object bound to an interface]] +struct @beta @extern Eldbus.Connection; [[Represents a connection of one the type of connection with the DBus daemon.]] +struct @beta @extern Eldbus.Object; [[Represents an object path already attached with bus name or unique id]] -enum @extern Eldbus.Connection.Type +enum @beta @extern Eldbus.Connection.Type { [[Eldbus connection type]] unknown = 0, [[Sentinel, not a real type]] @@ -13,7 +13,7 @@ enum @extern Eldbus.Connection.Type last, [[Sentinel, not a real type]] } -enum Eldbus.Introspection.Argument_Direction +enum @beta @extern Eldbus.Introspection.Argument_Direction { [[Argument direction]] none = 0, [[No direction]] @@ -23,7 +23,7 @@ enum Eldbus.Introspection.Argument_Direction /* DTD conversion form: http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd */ -enum Eldbus.Introspection.Property_Access +enum @beta @extern Eldbus.Introspection.Property_Access { [[Property access rights]] read, [[Property can be read]] @@ -32,7 +32,7 @@ enum Eldbus.Introspection.Property_Access } /* FIXME: Properly type all of these lists. */ -struct Eldbus.Introspection.Node +struct @beta @extern Eldbus.Introspection.Node { [[DBus Node]] name: stringshare; [[Node name (optional)]] @@ -40,7 +40,7 @@ struct Eldbus.Introspection.Node interfaces: list; [[List with interfaces]] } -struct Eldbus.Introspection.Interface +struct @beta @extern Eldbus.Introspection.Interface { [[DBus Interface]] name: stringshare; [[Interface name]] @@ -50,7 +50,7 @@ struct Eldbus.Introspection.Interface annotations: list; [[List with interface annotations]] } -struct Eldbus.Introspection.Method +struct @beta @extern Eldbus.Introspection.Method { [[DBus Method]] name: stringshare; [[Method name]] @@ -58,7 +58,7 @@ struct Eldbus.Introspection.Method annotations: list; [[List with method annotations]] } -struct Eldbus.Introspection.Property +struct @beta @extern Eldbus.Introspection.Property { [[DBus Property]] name: stringshare; [[Property name]] @@ -67,14 +67,14 @@ struct Eldbus.Introspection.Property annotations: list; [[List with property annotations]] } -struct Eldbus.Introspection.Annotation +struct @beta @extern Eldbus.Introspection.Annotation { [[DBus Annotation]] name: stringshare; [[Annotation name]] value: stringshare; [[Annotation value]] } -struct Eldbus.Introspection.Argument +struct @beta @extern Eldbus.Introspection.Argument { [[DBus Argument]] name: stringshare; [[Argument name (optional)]] @@ -82,7 +82,7 @@ struct Eldbus.Introspection.Argument direction: Eldbus.Introspection.Argument_Direction; [[Argument direction]] } -struct Eldbus.Introspection.Signal +struct @beta @extern Eldbus.Introspection.Signal { [[DBus Signal]] name: stringshare; [[Signal name]] diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 8e14a95554..95dc4a58b9 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -289,6 +289,17 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) default: break; } + switch (id) + { + case KW_void_ptr: + if (vals->stable) + { + _eo_parser_log(&tp->base, + "deprecated builtin type '%s' not allowed in stable context", + tp->base.name); + return EINA_FALSE; + } + } return _validate_ownable(tp); } /* user defined */ diff --git a/src/lib/evas/include/evas_ector_buffer.eo b/src/lib/evas/include/evas_ector_buffer.eo index 8801c5aecb..5c097454b0 100644 --- a/src/lib/evas/include/evas_ector_buffer.eo +++ b/src/lib/evas/include/evas_ector_buffer.eo @@ -1,4 +1,4 @@ -interface Evas.Ector.Buffer +interface @beta Evas.Ector.Buffer { [[Binding layer between ector buffers and evas images. diff --git a/src/tests/eolian_cxx/name1_name2_type_generation.eo b/src/tests/eolian_cxx/name1_name2_type_generation.eo index dce2ff22d9..8f3ca8e553 100644 --- a/src/tests/eolian_cxx/name1_name2_type_generation.eo +++ b/src/tests/eolian_cxx/name1_name2_type_generation.eo @@ -1,4 +1,4 @@ -class Name1.Name2.Type_Generation extends Efl.Object +class @beta Name1.Name2.Type_Generation extends Efl.Object { data: Type_Generation_Data; methods { From 0259f9847292e49c0a47b383c986c7963aa4f818 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 26 Jul 2019 13:38:01 +0200 Subject: [PATCH 28/72] eolian: also ban underscore prefixed builtins in stable API --- src/lib/eolian/database_validate.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index 95dc4a58b9..eb818750a4 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -292,6 +292,8 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) switch (id) { case KW_void_ptr: + case KW___undefined_type: + case KW___builtin_free_cb: if (vals->stable) { _eo_parser_log(&tp->base, From c9f82d8e5d2ac6d8d5e7cc1aa9e6019ef63ede9d Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 26 Jul 2019 12:51:58 +0100 Subject: [PATCH 29/72] meson - for crossbuild move run check to just compile check not as accurate but will do for cross build i guess for O_CLOEXEC --- header_checks/meson.build | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/header_checks/meson.build b/header_checks/meson.build index 4cc855e218..35b5db9fdd 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -123,17 +123,17 @@ function_checks = [ ['dladdr', ['dlfcn.h'], ['dl'], '-D_GNU_SOURCE=1'] ] -open_cloexec = cc.run('''#include - #include - #include - int main(int argc, char **argv) { - int res = open(argv[0], O_RDONLY | O_CLOEXEC); - if (res < 0) return 1; - return 0; - } - ''', - name : 'open works with O_CLOEXEC') -if open_cloexec.compiled() and open_cloexec.returncode() == 0 +open_cloexec = cc.compiles('''#include + #include + #include + int main(int argc, char **argv) { + int res = open(argv[0], O_RDONLY | O_CLOEXEC); + if (res < 0) return 1; + return 0; + } + ''', + name : 'open works with O_CLOEXEC') +if open_cloexec config_h.set10('HAVE_OPEN_CLOEXEC', true) endif From 1348569bfa08eedd4e851de00f838bf3431fd931 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 26 Jul 2019 14:13:22 +0200 Subject: [PATCH 30/72] eolian: allow value types in owning containers (list/array/etc) --- src/lib/eolian/database_validate.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/lib/eolian/database_validate.c b/src/lib/eolian/database_validate.c index eb818750a4..7f09d43299 100644 --- a/src/lib/eolian/database_validate.c +++ b/src/lib/eolian/database_validate.c @@ -257,16 +257,6 @@ _validate_type(Validate_State *vals, Eolian_Type *tp) { if (!_validate_type(vals, itp)) return EINA_FALSE; - if (kwid == KW_array || kwid == KW_hash || kwid == KW_list) - { - if (!database_type_is_ownable(src, itp, EINA_TRUE)) - { - _eo_parser_log(&itp->base, - "%s cannot contain value types (%s)", - tp->base.name, itp->base.name); - return EINA_FALSE; - } - } itp = itp->next_type; } return _validate_ownable(tp); From 1a95e87f58bea83f7a7e9b1e0b8f7d406f983b48 Mon Sep 17 00:00:00 2001 From: Daniel Kolesa Date: Fri, 26 Jul 2019 14:39:38 +0200 Subject: [PATCH 31/72] eolian: fix tests after latest restrictions --- src/tests/eolian/data/typedef.eo | 4 ++-- src/tests/eolian/data/typedef_ref.h | 2 ++ src/tests/eolian/data/typedef_ref_stub.h | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tests/eolian/data/typedef.eo b/src/tests/eolian/data/typedef.eo index 23645be444..31bf9c627c 100644 --- a/src/tests/eolian/data/typedef.eo +++ b/src/tests/eolian/data/typedef.eo @@ -8,9 +8,9 @@ type Evas.Coord3: Evas.Coord2; type @extern Evas.Pants: float; /* not generated */ -type Undef: __undefined_type; /* not generated */ +type @beta Undef: __undefined_type; /* not generated */ -type Free: __builtin_free_cb; /* specially generated */ +type @beta Free: __builtin_free_cb; /* specially generated */ enum Enum.Bar { diff --git a/src/tests/eolian/data/typedef_ref.h b/src/tests/eolian/data/typedef_ref.h index 1f220b87b2..c03f18ca55 100644 --- a/src/tests/eolian/data/typedef_ref.h +++ b/src/tests/eolian/data/typedef_ref.h @@ -19,7 +19,9 @@ typedef Evas_Coord Evas_Coord2; typedef Evas_Coord2 Evas_Coord3; +#ifdef EFL_BETA_API_SUPPORT typedef void (*Free)(void *data); +#endif /* EFL_BETA_API_SUPPORT */ typedef enum { diff --git a/src/tests/eolian/data/typedef_ref_stub.h b/src/tests/eolian/data/typedef_ref_stub.h index 867329582c..3bbb7d2417 100644 --- a/src/tests/eolian/data/typedef_ref_stub.h +++ b/src/tests/eolian/data/typedef_ref_stub.h @@ -11,7 +11,9 @@ typedef Evas_Coord Evas_Coord2; typedef Evas_Coord2 Evas_Coord3; +#ifdef EFL_BETA_API_SUPPORT typedef void (*Free)(void *data); +#endif /* EFL_BETA_API_SUPPORT */ #endif From 8377ea20a01c95b7bd9b8b2a61e202b4af598016 Mon Sep 17 00:00:00 2001 From: Felipe Magno de Almeida Date: Fri, 26 Jul 2019 14:59:17 +0200 Subject: [PATCH 32/72] efl-js: Remove private keys for Twitter API from example Summary: For security concerns we removed the secret keys which could be used improperly by the wrong people. Reviewers: woohyun, cedric, lauromoura Reviewed By: lauromoura Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9377 --- src/examples/elementary/twitter_example_01.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/examples/elementary/twitter_example_01.js b/src/examples/elementary/twitter_example_01.js index d0f5f71fcd..04edbdd3ae 100644 --- a/src/examples/elementary/twitter_example_01.js +++ b/src/examples/elementary/twitter_example_01.js @@ -13,10 +13,10 @@ Twitter = require('twitter'); user_acount = 'EnlightenmentKo' var twit = new Twitter({ - consumer_key: 'ZbSM93w5Sp2cyZ2SG0XuCvoHV', - consumer_secret: 'g8N7EEQLpdKPnAsS9hWuQV29FYjBkhH62jhZzXyYymDw87DKye', - access_token_key: '222611263-pPhKKjYh59uuNLP0b86sP7aAtLhdecjVQaEsCDCv', - access_token_secret: 'l7ccNKXTVv6cymfSD1gQH61tmfixkdna2QmOjPtpVxSHD' + consumer_key: '', // replace with consumer_key + consumer_secret: '', // replace with consumer_secret + access_token_key: '', // replace with access_token_key + access_token_secret: '' // replace with access_token_secret }); win = new efl.Efl.Ui.Win(null, "Efl JS Example", efl.Efl.Ui.Win.Type.BASIC, "hw"); From 44dbf5c22a221bef490edffc0552400b5f07b20a Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jul 2019 16:55:48 +0200 Subject: [PATCH 33/72] efl_ui/datepicker: adjust datepicker minimum limits Summary: this whole thing seems pretty busted but at least now it won't error and break elm_test t.tm_mday is 0 when the function in the macro returns, so this value needs to be clamped like the others Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D9398 --- src/lib/elementary/efl_ui_datepicker.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/efl_ui_datepicker.c b/src/lib/elementary/efl_ui_datepicker.c index 810c9bc4c4..666791b36f 100644 --- a/src/lib/elementary/efl_ui_datepicker.c +++ b/src/lib/elementary/efl_ui_datepicker.c @@ -18,7 +18,7 @@ Efl_Time t = efl_datetime_manager_value_get(pd->dt_manager); \ pd->cur_date[DATEPICKER_YEAR] = t.tm_year + 1900; \ pd->cur_date[DATEPICKER_MONTH] = t.tm_mon + 1; \ - pd->cur_date[DATEPICKER_DAY] = t.tm_mday; \ + pd->cur_date[DATEPICKER_DAY] = t.tm_mday + 1; \ } while (0) #define DATE_SET() \ @@ -26,7 +26,7 @@ Efl_Time t; \ t.tm_year = pd->cur_date[DATEPICKER_YEAR] - 1900; \ t.tm_mon = pd->cur_date[DATEPICKER_MONTH] - 1; \ - t.tm_mday = pd->cur_date[DATEPICKER_DAY]; \ + t.tm_mday = pd->cur_date[DATEPICKER_DAY] - 1; \ t.tm_sec = 0; \ efl_datetime_manager_value_set(pd->dt_manager, t); \ } while (0) @@ -160,7 +160,7 @@ _fields_init(Eo *obj) //Field create. pd->year = efl_add(EFL_UI_SPIN_BUTTON_CLASS, obj, - efl_ui_range_limits_set(efl_added, 1970, 2037), + efl_ui_range_limits_set(efl_added, 1900, 2037), efl_ui_spin_button_circulate_set(efl_added, EINA_TRUE), efl_ui_spin_button_editable_set(efl_added, EINA_TRUE), efl_ui_layout_orientation_set(efl_added, EFL_UI_LAYOUT_ORIENTATION_VERTICAL), From 8d1bd770df61e14d54ad05e279fe9aac9f8aeeed Mon Sep 17 00:00:00 2001 From: Vitor Sousa Date: Fri, 26 Jul 2019 14:40:38 -0300 Subject: [PATCH 34/72] csharp: fix EFL# by updating it to reflect the newest changes in Eolian Summary: `Efl.Event` became a builtin type that is no longer declared in `efl_object.eo`, and therefore it is no longer automatically generated in EFL#. Given that, we define a struct manually to reflect the memory layout of the native struct. Containers of value types are now allowed in eolian, so tests that were disabled because of the restriction on `ptr` were re-enabled using the plain type. But since these containers have just arrived, handling of ownership for value types is currently undefined in bindings. Hence, tests that used `ptr(int) @owned` as elements were left disable. This will be solved in a future patch. `void_pr` is now deprecated, so we remove it from tests also. Reviewers: q66, segfaultxavi, lauromoura, felipealmeida Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9417 --- src/bindings/mono/eo_mono/workaround.cs | 82 +++++++++++++++++++++++++ src/tests/efl_mono/Eina.cs | 18 +++++- src/tests/efl_mono/StructHelpers.cs | 3 - src/tests/efl_mono/dummy_test_object.c | 2 - src/tests/efl_mono/dummy_test_object.eo | 55 ++++++++++------- 5 files changed, 130 insertions(+), 30 deletions(-) diff --git a/src/bindings/mono/eo_mono/workaround.cs b/src/bindings/mono/eo_mono/workaround.cs index 9f22b90fa6..49a6e1ef58 100644 --- a/src/bindings/mono/eo_mono/workaround.cs +++ b/src/bindings/mono/eo_mono/workaround.cs @@ -108,6 +108,88 @@ public struct EventDescription } }; +/// +/// A parameter passed in event callbacks holding extra event parameters. +/// This is the full event information passed to callbacks in C. +/// (Since EFL 1.22) +/// +[StructLayout(LayoutKind.Sequential)] +[Efl.Eo.BindingEntity] +public struct Event +{ + /// The object the callback was called on. + /// (Since EFL 1.22) + public Efl.Object Object; + + /// The event description. + /// (Since EFL 1.22) + public Efl.EventDescription Desc; + + /// Extra event information passed by the event caller. + /// Must be cast to the event type declared in the EO file. Keep in mind that: + /// 1) Objects are passed as a normal Eo*. Event subscribers can call functions on these objects. + /// 2) Structs, built-in types and containers are passed as const pointers, with one level of indirection. + /// (Since EFL 1.22) + public System.IntPtr Info; + + /// Constructor for Event. + public Event( + Efl.Object obj = default(Efl.Object), + Efl.EventDescription desc = default(Efl.EventDescription), + System.IntPtr info = default(System.IntPtr)) + { + this.Object = obj; + this.Desc = desc; + this.Info = info; + } + + /// Implicit conversion to the managed representation from a native pointer. + /// Native pointer to be converted. + public static implicit operator Event(IntPtr ptr) + { + var tmp = (Event.NativeStruct) Marshal.PtrToStructure(ptr, typeof(Event.NativeStruct)); + return tmp; + } + + /// Internal wrapper for struct Event. + [StructLayout(LayoutKind.Sequential)] + public struct NativeStruct + { + /// Internal wrapper for field Object + public System.IntPtr Object; + + /// Internal wrapper for field Desc + public System.IntPtr Desc; + + /// Internal wrapper for field Info + public System.IntPtr Info; + + /// Implicit conversion to the internal/marshalling representation. + /// Managed struct to be converted. + /// Native representation of the managed struct. + public static implicit operator Event.NativeStruct(Event externalStruct) + { + var internalStruct = new Event.NativeStruct(); + internalStruct.Object = externalStruct.Object?.NativeHandle ?? System.IntPtr.Zero; + internalStruct.Desc = Eina.PrimitiveConversion.ManagedToPointerAlloc(externalStruct.Desc); + internalStruct.Info = externalStruct.Info; + return internalStruct; + } + + /// Implicit conversion to the managed representation. + /// Native struct to be converted. + /// Managed representation of the native struct. + public static implicit operator Event(Event.NativeStruct internalStruct) + { + var externalStruct = new Event(); + externalStruct.Object = (Efl.Object) Efl.Eo.Globals.CreateWrapperFor(internalStruct.Object); + externalStruct.Desc = Eina.PrimitiveConversion.PointerToManaged(internalStruct.Desc); + externalStruct.Info = internalStruct.Info; + return externalStruct; + } + } +} + public delegate void EventCb(System.IntPtr data, ref Event.NativeStruct evt); public delegate void FreeWrapperSupervisorCb(System.IntPtr obj); diff --git a/src/tests/efl_mono/Eina.cs b/src/tests/efl_mono/Eina.cs index d71d6c8f7f..07dfd1bed2 100644 --- a/src/tests/efl_mono/Eina.cs +++ b/src/tests/efl_mono/Eina.cs @@ -826,7 +826,6 @@ class TestEinaArray // Integer // - /* public static void test_eina_array_int_in() { var t = new Dummy.TestObject(); @@ -839,6 +838,7 @@ class TestEinaArray Test.Assert(arr.Handle == IntPtr.Zero); } + /* public static void test_eina_array_int_in_own() { var t = new Dummy.TestObject(); @@ -851,6 +851,7 @@ class TestEinaArray Test.Assert(arr.Handle == IntPtr.Zero); Test.Assert(t.CheckEinaArrayIntInOwn()); } + */ public static void test_eina_array_int_out() { @@ -865,6 +866,7 @@ class TestEinaArray Test.Assert(t.CheckEinaArrayIntOut()); } + /* public static void test_eina_array_int_out_own() { var t = new Dummy.TestObject(); @@ -876,6 +878,7 @@ class TestEinaArray arr.Dispose(); Test.Assert(arr.Handle == IntPtr.Zero); } + */ public static void test_eina_array_int_return() { @@ -889,6 +892,7 @@ class TestEinaArray Test.Assert(t.CheckEinaArrayIntReturn()); } + /* public static void test_eina_array_int_return_own() { var t = new Dummy.TestObject(); @@ -1886,7 +1890,6 @@ class TestEinaList // Integer // - /* public static void test_eina_list_int_in() { var t = new Dummy.TestObject(); @@ -1899,6 +1902,7 @@ class TestEinaList Test.Assert(lst.Handle == IntPtr.Zero); } + /* public static void test_eina_list_int_in_own() { var t = new Dummy.TestObject(); @@ -1910,6 +1914,7 @@ class TestEinaList Test.Assert(lst.Handle == IntPtr.Zero); Test.Assert(t.CheckEinaListIntInOwn()); } + */ public static void test_eina_list_int_out() { @@ -1923,6 +1928,7 @@ class TestEinaList Test.Assert(t.CheckEinaListIntOut()); } + /* public static void test_eina_list_int_out_own() { var t = new Dummy.TestObject(); @@ -1934,6 +1940,7 @@ class TestEinaList lst.Dispose(); Test.Assert(lst.Handle == IntPtr.Zero); } + */ public static void test_eina_list_int_return() { @@ -1946,6 +1953,7 @@ class TestEinaList Test.Assert(t.CheckEinaListIntReturn()); } + /* public static void test_eina_list_int_return_own() { var t = new Dummy.TestObject(); @@ -2666,7 +2674,6 @@ class TestEinaHash // Integer // - /* public static void test_eina_hash_int_in() { var t = new Dummy.TestObject(); @@ -2680,6 +2687,7 @@ class TestEinaHash Test.Assert(hsh.Handle == IntPtr.Zero); } + /* public static void test_eina_hash_int_in_own() { var t = new Dummy.TestObject(); @@ -2694,6 +2702,7 @@ class TestEinaHash Test.Assert(hsh.Handle == IntPtr.Zero); Test.Assert(t.CheckEinaHashIntInOwn()); } + */ public static void test_eina_hash_int_out() { @@ -2709,6 +2718,7 @@ class TestEinaHash Test.Assert(t.CheckEinaHashIntOut()); } + /* public static void test_eina_hash_int_out_own() { var t = new Dummy.TestObject(); @@ -2722,6 +2732,7 @@ class TestEinaHash Test.Assert(hsh.Handle == IntPtr.Zero); Test.Assert(t.CheckEinaHashIntOutOwn()); } + */ public static void test_eina_hash_int_return() { @@ -2736,6 +2747,7 @@ class TestEinaHash Test.Assert(t.CheckEinaHashIntReturn()); } + /* public static void test_eina_hash_int_return_own() { var t = new Dummy.TestObject(); diff --git a/src/tests/efl_mono/StructHelpers.cs b/src/tests/efl_mono/StructHelpers.cs index 110432f08f..7af3529055 100644 --- a/src/tests/efl_mono/StructHelpers.cs +++ b/src/tests/efl_mono/StructHelpers.cs @@ -41,7 +41,6 @@ internal class StructHelpers simple.Ffloat = -16777216.0f; simple.Fdouble = -9007199254740992.0; simple.Fbool = true; - simple.Fvoid_ptr = (IntPtr) 0xFE; simple.Fenum = Dummy.SampleEnum.V2; simple.Fstring = "test/string"; simple.Fmstring = "test/mstring"; @@ -78,7 +77,6 @@ internal class StructHelpers Test.Assert(simple.Ffloat == -16777216.0f); Test.Assert(simple.Fdouble == -9007199254740992.0); Test.Assert(simple.Fbool == true); - Test.Assert(simple.Fvoid_ptr == (IntPtr) 0xFE); Test.Assert(simple.Fenum == Dummy.SampleEnum.V2); Test.Assert(simple.Fstring == "test/string"); Test.Assert(simple.Fmstring == "test/mstring"); @@ -113,7 +111,6 @@ internal class StructHelpers Test.Assert(simple.Ffloat == 0); Test.Assert(simple.Fdouble == 0); Test.Assert(simple.Fbool == false); - Test.Assert(simple.Fvoid_ptr == IntPtr.Zero); Test.Assert(simple.Fenum == Dummy.SampleEnum.V0); Test.Assert(simple.Fstring == null); Test.Assert(simple.Fmstring == null); diff --git a/src/tests/efl_mono/dummy_test_object.c b/src/tests/efl_mono/dummy_test_object.c index e6bec29362..6717b12476 100644 --- a/src/tests/efl_mono/dummy_test_object.c +++ b/src/tests/efl_mono/dummy_test_object.c @@ -4040,7 +4040,6 @@ void struct_simple_with_values(Dummy_StructSimple *simple) simple->ffloat = -16777216.0; simple->fdouble = -9007199254740992.0; simple->fbool = EINA_TRUE; - simple->fvoid_ptr = (void*) 0xFE; simple->fenum = DUMMY_SAMPLEENUM_V2; simple->fstring = "test/string"; simple->fmstring = strdup("test/mstring"); @@ -4077,7 +4076,6 @@ Eina_Bool check_and_modify_struct_simple(Dummy_StructSimple *simple) && EQUAL(simple->ffloat, -16777216.0) && EQUAL(simple->fdouble, -9007199254740992.0) && EQUAL(simple->fbool, EINA_TRUE) - && EQUAL(simple->fvoid_ptr, (void*) 0xFE) && EQUAL(simple->fenum, DUMMY_SAMPLEENUM_V2) && STR_EQUAL(simple->fstring, "test/string") && STR_EQUAL(simple->fmstring, "test/mstring") diff --git a/src/tests/efl_mono/dummy_test_object.eo b/src/tests/efl_mono/dummy_test_object.eo index 97b7cf6641..2273c23a20 100644 --- a/src/tests/efl_mono/dummy_test_object.eo +++ b/src/tests/efl_mono/dummy_test_object.eo @@ -51,7 +51,6 @@ struct @free(free) Dummy.StructSimple ffloat: float; fdouble: double; fbool: bool; - fvoid_ptr: void_ptr; fenum: Dummy.SampleEnum; // fboolptr: ptr(bool); // TODO // fbyteptr: ptr(byte); @@ -379,27 +378,28 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { /* Eina Array */ /* Integer */ - /* eina_array_int_in { params { - @in arr: array; + @in arr: array; } return: bool; } + /* eina_array_int_in_own { params { - @in arr: array @owned; + @in arr: array @owned; // } return: bool; } check_eina_array_int_in_own { return: bool; } + */ eina_array_int_out { params { - @out arr: array; + @out arr: array; } return: bool; } @@ -407,22 +407,25 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } + /* eina_array_int_out_own { params { - @out arr: array @owned; + @out arr: array @owned; // } return: bool; } + */ eina_array_int_return { - return: array; + return: array; } check_eina_array_int_return { return: bool; } + /* eina_array_int_return_own { - return: array @owned; + return: array @owned; // } */ @@ -574,27 +577,28 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { /* Eina List */ /* Integer */ - /* eina_list_int_in { params { - @in lst: list; + @in lst: list; } return: bool; } + /* eina_list_int_in_own { params { - @in lst: list @owned; + @in lst: list @owned; // } return: bool; } check_eina_list_int_in_own { return: bool; } + */ eina_list_int_out { params { - @out lst: list; + @out lst: list; } return: bool; } @@ -602,22 +606,25 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } + /* eina_list_int_out_own { params { - @out lst: list @owned; + @out lst: list @owned; // } return: bool; } + */ eina_list_int_return { - return: list; + return: list; } check_eina_list_int_return { return: bool; } + /* eina_list_int_return_own { - return: list @owned; + return: list @owned; // } */ @@ -769,27 +776,28 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { // Eina Hash // // Integer // - /* eina_hash_int_in { params { - @in hsh: hash; + @in hsh: hash; } return: bool; } + /* eina_hash_int_in_own { params { - @in hsh: hash @owned; + @in hsh: hash @owned; // <, int @owned> } return: bool; } check_eina_hash_int_in_own { return: bool; } + */ eina_hash_int_out { params { - @out hsh: hash; + @out hsh: hash; } return: bool; } @@ -797,25 +805,28 @@ class Dummy.Test_Object extends Efl.Object implements Dummy.Test_Iface { return: bool; } + /* eina_hash_int_out_own { params { - @out hsh: hash @owned; + @out hsh: hash @owned; // <, int @owned> } return: bool; } check_eina_hash_int_out_own { return: bool; } + */ eina_hash_int_return { - return: hash; + return: hash; } check_eina_hash_int_return { return: bool; } + /* eina_hash_int_return_own { - return: hash @owned; + return: hash @owned; // <, int @owned> } check_eina_hash_int_return_own { return: bool; From 41aa680c859a306dd13ff0f7f9a76aa7a046aa6a Mon Sep 17 00:00:00 2001 From: Yeongjong Lee Date: Fri, 26 Jul 2019 15:00:17 +0200 Subject: [PATCH 35/72] efl_mono: update docs of CreateWrapperFor Reviewers: lauromoura, felipealmeida, segfaultxavi, vitor.sousa Reviewed By: lauromoura Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9084 --- src/bindings/mono/eo_mono/iwrapper.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bindings/mono/eo_mono/iwrapper.cs b/src/bindings/mono/eo_mono/iwrapper.cs index 09c82a7e81..6b7719e61f 100644 --- a/src/bindings/mono/eo_mono/iwrapper.cs +++ b/src/bindings/mono/eo_mono/iwrapper.cs @@ -569,11 +569,8 @@ public class Globals /// Creates a new wrapper for the given Eo id. /// - /// If the Eo was created from a non-generated class (i.e. C#-pure class), it returns - /// the C# instance handle stored in the Eo's private data. - /// - /// For generated-class Eo instance, we use reflection to get the correct C# type to re-wrap - /// it. + /// If the Eo have a WrapperSupervisor, it returns the C# instance handle stored in its + /// WrapperSupervisor. otherwise, we use reflection to get the correct C# type to re-wrap it. /// /// /// The Eo id to be wrapped. From bc955f35bb5a7fc88133fe811c48123a9b49f8f0 Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Fri, 26 Jul 2019 22:35:40 +0200 Subject: [PATCH 36/72] Rename Efl.Gfx.Image.Stretch_Region -> Efl.Gfx.Image_Stretch_Region Otherwise we have a symbol <-> namespace clash. Again. --- src/lib/efl/interfaces/efl_gfx_image.eo | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_image.eo b/src/lib/efl/interfaces/efl_gfx_image.eo index 64bd6b873d..db71b17ab5 100644 --- a/src/lib/efl/interfaces/efl_gfx_image.eo +++ b/src/lib/efl/interfaces/efl_gfx_image.eo @@ -40,7 +40,7 @@ enum @beta Efl.Gfx.Image_Scale_Type none [[Not scale the image]] } -struct Efl.Gfx.Image.Stretch_Region +struct Efl.Gfx.Image_Stretch_Region { [[This struct holds the description of a stretchable region in one dimension (vertical or horizontal). Used when scaling an image. @@ -183,8 +183,8 @@ interface @beta Efl.Gfx.Image } get {} values { - horizontal: iterator; [[Representation of area that are stretchable in the image horizontal space.]] - vertical: iterator; [[Representation of area that are stretchable in the image vertical space.]] + horizontal: iterator; [[Representation of area that are stretchable in the image horizontal space.]] + vertical: iterator; [[Representation of area that are stretchable in the image vertical space.]] } } @property image_size { From 04848c98f217b3fa1fc2a49bce2649895e705611 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sun, 28 Jul 2019 09:21:47 +0100 Subject: [PATCH 37/72] Eina: define EINA_HAVE_DEBUG_THREADS only if backtrace() in execinfo.h is available Summary: fix compilation on systems where backtrace() in execinfo.h is not available Test Plan: compilation on Windows Reviewers: zmike, cedric, raster Reviewed By: cedric, raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9392 --- src/lib/eina/meson.build | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/eina/meson.build b/src/lib/eina/meson.build index b93e46802c..7866323742 100644 --- a/src/lib/eina/meson.build +++ b/src/lib/eina/meson.build @@ -299,7 +299,9 @@ if cc.has_header_symbol(pthread_np_header_file, 'pthread_attr_setaffinity_np', a endif if debug_threads or get_option('debug-threads') - eina_config.set('EINA_HAVE_DEBUG_THREADS', '1') + if cc.has_header_symbol('execinfo.h', 'backtrace') + eina_config.set('EINA_HAVE_DEBUG_THREADS', '1') + endif endif eina_config.set('EINA_SIZEOF_WCHAR_T', cc.sizeof('wchar_t', prefix : '#include')) From a6ade14c5e65ab729b1013388ec1aea4be22afc7 Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sun, 28 Jul 2019 09:27:27 +0100 Subject: [PATCH 38/72] Evil: remove pwd code in Evil and fix compilation failures after the removal Summary: remove pwd code in Evil Test Plan: compilation Reviewers: zmike, cedric, raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9420 --- src/benchmarks/elementary/focus_widget_tree.c | 4 + src/bin/elementary/test.c | 5 ++ src/bin/elementary/test_combobox.c | 5 ++ src/bin/elementary/test_fileselector.c | 4 + src/bin/elementary/test_fileselector_button.c | 4 + src/bin/elementary/test_fileselector_entry.c | 4 + src/bin/elementary/test_genlist.c | 5 ++ src/bin/elementary/test_label.c | 5 ++ src/bin/elementary/test_panel.c | 5 ++ src/lib/ecore_con/ecore_con_local.c | 6 +- src/lib/efreet/efreet_base.c | 3 +- src/lib/eina/eina_vpath.c | 6 +- src/lib/eina/eina_vpath_xdg.c | 4 +- src/lib/elementary/Efl_Ui.h | 4 +- src/lib/elementary/Elementary.h | 4 +- src/lib/elementary/efl_datetime_manager.c | 4 + src/lib/elementary/efl_ui_clock.c | 4 + src/lib/elementary/elm_config.c | 1 - src/lib/elementary/elm_main.c | 1 + src/lib/elementary/elm_prefs.c | 4 + src/lib/elementary/elm_util.c | 4 + src/lib/ethumb/ethumb.c | 4 +- src/lib/evil/Evil.h | 6 -- src/lib/evil/evil_pwd.c | 69 -------------- src/lib/evil/meson.build | 2 - src/lib/evil/pwd.h | 89 ------------------- src/tests/eina/eina_test_vpath.c | 4 +- src/tests/elementary/spec/efl_test_format.c | 4 + 28 files changed, 89 insertions(+), 175 deletions(-) delete mode 100644 src/lib/evil/evil_pwd.c delete mode 100644 src/lib/evil/pwd.h diff --git a/src/benchmarks/elementary/focus_widget_tree.c b/src/benchmarks/elementary/focus_widget_tree.c index 5f05df3445..d5e1531bb5 100644 --- a/src/benchmarks/elementary/focus_widget_tree.c +++ b/src/benchmarks/elementary/focus_widget_tree.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* setenv */ +#endif + #include #include #include "elm_widget.h" diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 79d56af40e..4a77460058 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -3,6 +3,11 @@ #endif #include + +#ifdef _WIN32 +# include /* strcasestr */ +#endif + #include #include #include "test.h" diff --git a/src/bin/elementary/test_combobox.c b/src/bin/elementary/test_combobox.c index c71cf2f1e0..ee68a3bdaf 100644 --- a/src/bin/elementary/test_combobox.c +++ b/src/bin/elementary/test_combobox.c @@ -2,6 +2,11 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif + +#ifdef _WIN32 +# include /* strcasestr */ +#endif + #include static void diff --git a/src/bin/elementary/test_fileselector.c b/src/bin/elementary/test_fileselector.c index 1c23066097..880162e9d2 100644 --- a/src/bin/elementary/test_fileselector.c +++ b/src/bin/elementary/test_fileselector.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* mkdir stelocale */ +#endif + #include #ifndef ENABLE_NLS # ifndef setlocale diff --git a/src/bin/elementary/test_fileselector_button.c b/src/bin/elementary/test_fileselector_button.c index b04e9d38ef..2ee1a3338c 100644 --- a/src/bin/elementary/test_fileselector_button.c +++ b/src/bin/elementary/test_fileselector_button.c @@ -3,6 +3,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* mkdir */ +#endif + #include struct _api_data diff --git a/src/bin/elementary/test_fileselector_entry.c b/src/bin/elementary/test_fileselector_entry.c index 3bfd438204..17d6ddee4b 100644 --- a/src/bin/elementary/test_fileselector_entry.c +++ b/src/bin/elementary/test_fileselector_entry.c @@ -3,6 +3,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* mkdir */ +#endif + #include struct _api_data diff --git a/src/bin/elementary/test_genlist.c b/src/bin/elementary/test_genlist.c index b4168fd830..c3f4d95943 100644 --- a/src/bin/elementary/test_genlist.c +++ b/src/bin/elementary/test_genlist.c @@ -3,6 +3,11 @@ #ifdef HAVE_CONFIG_H #include "elementary_config.h" #endif + +#ifdef _WIN32 +# include /* strcasestr */ +#endif + #include #include "test_explode.h" diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c index 2b11ff5b2a..c00ae7986e 100644 --- a/src/bin/elementary/test_label.c +++ b/src/bin/elementary/test_label.c @@ -1,6 +1,11 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif + +#ifdef _WIN32 +# include /* strcasestr */ +#endif + #include enum _slide_style diff --git a/src/bin/elementary/test_panel.c b/src/bin/elementary/test_panel.c index 371e6d5541..a6318d1c29 100644 --- a/src/bin/elementary/test_panel.c +++ b/src/bin/elementary/test_panel.c @@ -1,6 +1,11 @@ #ifdef HAVE_CONFIG_H # include "elementary_config.h" #endif + +#ifdef _WIN32 +# include /* mkdir */ +#endif + #include #define LIST_ITEM_MAX 20 diff --git a/src/lib/ecore_con/ecore_con_local.c b/src/lib/ecore_con/ecore_con_local.c index 5fed0b711e..fae182e133 100644 --- a/src/lib/ecore_con/ecore_con_local.c +++ b/src/lib/ecore_con/ecore_con_local.c @@ -10,7 +10,11 @@ #include #include #include -#include +#ifdef _WIN32 +# include /* mkdir */ +#else +# include +#endif #include #ifdef HAVE_SYSTEMD diff --git a/src/lib/efreet/efreet_base.c b/src/lib/efreet/efreet_base.c index e7bc54f118..6497e8d955 100644 --- a/src/lib/efreet/efreet_base.c +++ b/src/lib/efreet/efreet_base.c @@ -8,10 +8,11 @@ #include #include #include -#include #ifdef _WIN32 # include +#else +# include #endif #include diff --git a/src/lib/eina/eina_vpath.c b/src/lib/eina/eina_vpath.c index c06ee5abe8..78ae6a250d 100644 --- a/src/lib/eina/eina_vpath.c +++ b/src/lib/eina/eina_vpath.c @@ -3,7 +3,11 @@ #endif #include -#include +#ifdef _WIN32 +# include /* mkdir */ +#else +# include +#endif #include diff --git a/src/lib/eina/eina_vpath_xdg.c b/src/lib/eina/eina_vpath_xdg.c index 0db6e7836d..43ca85e1d9 100644 --- a/src/lib/eina/eina_vpath_xdg.c +++ b/src/lib/eina/eina_vpath_xdg.c @@ -3,7 +3,9 @@ #endif #include -#include +#ifndef _WIN32 +# include +#endif #include diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 93d3a0a1fa..e390b89efe 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -21,7 +21,9 @@ #ifdef ELM_DIRENT_H #include #endif -#include +#ifndef _WIN32 +# include +#endif #include #ifdef ELM_UNIX diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index 6faf7f7ac5..bdc128a2b8 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -27,7 +27,9 @@ #ifdef ELM_DIRENT_H #include #endif -#include +#ifndef _WIN32 +# include +#endif #include #ifdef ELM_UNIX diff --git a/src/lib/elementary/efl_datetime_manager.c b/src/lib/elementary/efl_datetime_manager.c index 8739be8251..24daa34217 100644 --- a/src/lib/elementary/efl_datetime_manager.c +++ b/src/lib/elementary/efl_datetime_manager.c @@ -5,6 +5,10 @@ # include #endif +#ifdef _WIN32 +# include /* nl_langinfo */ +#endif + #include #include "elm_priv.h" diff --git a/src/lib/elementary/efl_ui_clock.c b/src/lib/elementary/efl_ui_clock.c index e580d3cf06..5a86dcdc26 100644 --- a/src/lib/elementary/efl_ui_clock.c +++ b/src/lib/elementary/efl_ui_clock.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* nl_langinfo */ +#endif + #define EFL_ACCESS_OBJECT_PROTECTED #define EFL_UI_L10N_PROTECTED diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 6093ca73cd..72bc9f8004 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -4,7 +4,6 @@ #include #include "elm_priv.h" -#include #include "efl_config_global.eo.h" diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c index ca03e4bab6..77d7ab2aac 100644 --- a/src/lib/elementary/elm_main.c +++ b/src/lib/elementary/elm_main.c @@ -12,6 +12,7 @@ #ifdef _WIN32 # include /* getcwd */ +# include /* dlopen,dlclose,etc */ #endif #include diff --git a/src/lib/elementary/elm_prefs.c b/src/lib/elementary/elm_prefs.c index a320563661..32e684edc2 100644 --- a/src/lib/elementary/elm_prefs.c +++ b/src/lib/elementary/elm_prefs.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* strsep evil_path_absolute */ +#endif + #define EFL_ACCESS_OBJECT_PROTECTED #include diff --git a/src/lib/elementary/elm_util.c b/src/lib/elementary/elm_util.c index 476205c936..101afe9bb3 100644 --- a/src/lib/elementary/elm_util.c +++ b/src/lib/elementary/elm_util.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* nl_langinfo */ +#endif + #include #include "elm_priv.h" diff --git a/src/lib/ethumb/ethumb.c b/src/lib/ethumb/ethumb.c index bbfe3a01c5..cf22911921 100644 --- a/src/lib/ethumb/ethumb.c +++ b/src/lib/ethumb/ethumb.c @@ -41,7 +41,9 @@ #include #include #include -#include +#ifndef _WIN32 +# include +#endif #ifdef HAVE_XATTR # include diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h index 7383fe7398..147e45a27b 100644 --- a/src/lib/evil/Evil.h +++ b/src/lib/evil/Evil.h @@ -75,11 +75,8 @@ * @li @ref Evil_Dlfcn * @li @ref Evil_Langinfo_Group * @li @ref Evil_Locale_Group - * @li @ref Evil_Pwd_Group * @li @ref Evil_Stdio_Group * @li @ref Evil_Main_Group - * @li @ref Evil_Inet_Group - * @li @ref Evil_Dirent_Group * @li @ref Evil_String_Group * @li @ref Evil_Stdlib_Group * @li @ref Evil_Time_Group @@ -94,9 +91,6 @@ extern "C" { #endif -typedef unsigned long uid_t; -typedef unsigned long gid_t; - #ifdef _MSC_VER # ifdef _WIN64 typedef __int64 pid_t; diff --git a/src/lib/evil/evil_pwd.c b/src/lib/evil/evil_pwd.c deleted file mode 100644 index c45f9281a4..0000000000 --- a/src/lib/evil/evil_pwd.c +++ /dev/null @@ -1,69 +0,0 @@ -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif /* HAVE_CONFIG_H */ - -#include -#include - -#define _POSIX -#include -#include - -#include "evil_private.h" -#include "pwd.h" - - -static struct passwd pw = { NULL, NULL, 0, 0, 0, NULL, NULL, NULL, NULL, 0, 0 }; - -struct passwd * -getpwnam(const char *n) -{ - static char user_name[UNLEN + 1]; - static char user_gecos[UNLEN + 4]; - TCHAR name[UNLEN + 1]; - DWORD length; - BOOLEAN res; -#ifdef UNICODE - char *a_name; -# endif /* UNICODE */ - - if (!n) - return NULL; - - length = UNLEN + 1; - res = GetUserName(name, &length); - if (!res) - return NULL; - -#ifdef UNICODE - a_name = evil_wchar_to_char(name); - if (a_name) - { - int l; - - l = strlen(a_name); - if (l >= PATH_MAX) - l = PATH_MAX; - memcpy(user_name, a_name, l); - user_name[l] = '\0'; - free(a_name); - } - else - return NULL; -#else - memcpy(user_name, name, strlen(name) + 1); -#endif /* UNICODE */ - - if (strcmp(n, user_name) != 0) - return NULL; - - pw.pw_name = user_name; - snprintf(user_gecos, sizeof(user_gecos), "%s,,,", user_name); - pw.pw_gecos = user_gecos; - pw.pw_dir = getenv("USERPROFILE"); - pw.pw_shell = getenv("SHELL"); - if (!pw.pw_shell) - pw.pw_shell = "cmd.exe"; - - return &pw; -} diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build index 8ed266c77e..85978d8e9c 100644 --- a/src/lib/evil/meson.build +++ b/src/lib/evil/meson.build @@ -16,7 +16,6 @@ if target_machine.system() == 'windows' 'evil_unistd.h', 'evil_util.h', 'dirent.h', - 'pwd.h', ] evil_header_sys_src = [join_paths('sys','mman.h')] @@ -27,7 +26,6 @@ if target_machine.system() == 'windows' 'evil_locale.c', 'evil_main.c', 'evil_mman.c', - 'evil_pwd.c', 'evil_stdio.c', 'evil_stdlib.c', 'evil_string.c', diff --git a/src/lib/evil/pwd.h b/src/lib/evil/pwd.h deleted file mode 100644 index 104acd9600..0000000000 --- a/src/lib/evil/pwd.h +++ /dev/null @@ -1,89 +0,0 @@ -#ifndef __EVIL_PWD_H__ -#define __EVIL_PWD_H__ - - -/** - * @file pwd.h - * @brief The file that provides functions ported from Unix in pwd.h. - * @defgroup Evil_Pwd_Group Pwd.h functions - * @ingroup Evil - * - * This header provides functions ported from Unix in pwd.h. - * - * @{ - */ - - -#include - -#include - -#ifdef EAPI -# undef EAPI -#endif - -#ifdef _WIN32 -# ifdef EFL_BUILD -# ifdef DLL_EXPORT -# define EAPI __declspec(dllexport) -# else -# define EAPI -# endif -# else -# define EAPI __declspec(dllimport) -# endif -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @struct passwd - * @brief A structure that describes a password. - */ -struct passwd { - char *pw_name; /**< user name */ - char *pw_passwd; /**< encrypted password (always @c NULL) */ - uid_t pw_uid; /**< user uid (always 0) */ - gid_t pw_gid; /**< user gid (always 0) */ - time_t pw_change; /**< password change time (always 0) */ - char *pw_class; /**< user access class (always @c NULL) */ - char *pw_gecos; /**< Honeywell login info */ - char *pw_dir; /**< home directory */ - char *pw_shell; /**< default shell */ - time_t pw_expire; /**< account expiration (always 0) */ - int pw_fields; /**< internal: fields filled in (always 0) */ -}; - -/** - * @brief Return a passwd structure. - * - * @param n The name of the user. - * @return A stacally allocated passwd structure. - * - * This function fills a static buffer @ref passwd with the user name @p n. - * - * Conformity: None. - * - * Supported OS: Windows XP. - */ -EAPI struct passwd *getpwnam(const char *n); - - -#ifdef __cplusplus -} -#endif - -#undef EAPI -#define EAPI - - -/** - * @} - */ - - -#endif /* __EVIL_PWD_H__ */ diff --git a/src/tests/eina/eina_test_vpath.c b/src/tests/eina/eina_test_vpath.c index 7a38712acc..1282cc4f2f 100644 --- a/src/tests/eina/eina_test_vpath.c +++ b/src/tests/eina/eina_test_vpath.c @@ -5,7 +5,9 @@ #include #include #include "eina_suite.h" -#include +#ifndef _WIN32 +# include +#endif EFL_START_TEST(eina_test_vpath_valid) { diff --git a/src/tests/elementary/spec/efl_test_format.c b/src/tests/elementary/spec/efl_test_format.c index cd2e698051..c3fa7d42f5 100644 --- a/src/tests/elementary/spec/efl_test_format.c +++ b/src/tests/elementary/spec/efl_test_format.c @@ -2,6 +2,10 @@ # include "elementary_config.h" #endif +#ifdef _WIN32 +# include /* setlocale strptime */ +#endif + #define EFL_UI_FORMAT_PROTECTED /* To access internal methods */ #include From 5b51a6bb207dc8d5127fa9c6ad7d3c8c6e2659cf Mon Sep 17 00:00:00 2001 From: Vincent Torri Date: Sun, 28 Jul 2019 09:38:26 +0100 Subject: [PATCH 39/72] Eio: enable eio_file_chown if chown is available on the platform Test Plan: compilation on Windows Reviewers: zmike, raster, cedric Reviewed By: raster Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9393 --- header_checks/meson.build | 1 + src/lib/eio/Eio_Legacy.h | 3 +++ src/lib/eio/eio_single.c | 22 +++++++++++++--------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/header_checks/meson.build b/header_checks/meson.build index 35b5db9fdd..4f71dbde5c 100644 --- a/header_checks/meson.build +++ b/header_checks/meson.build @@ -78,6 +78,7 @@ function_checks = [ ['alloca', ['alloca.h']], ['backtrace', ['execinfo.h']], ['backtrace_symbols', ['execinfo.h']], + ['chown', ['unistd.h']], ['clock_gettime', ['time.h']], ['dirfd', ['dirent.h sys/types.h']], ['fchmod', ['sys/stat.h']], diff --git a/src/lib/eio/Eio_Legacy.h b/src/lib/eio/Eio_Legacy.h index ac7a814f5f..50140edd4e 100644 --- a/src/lib/eio/Eio_Legacy.h +++ b/src/lib/eio/Eio_Legacy.h @@ -394,6 +394,9 @@ EAPI Eio_File *eio_file_chmod(const char *path, * * This function will change the owner of a path, setting it to the user and * group passed as argument. It's equivalent to the chown shell command. + * + * @note Some platforms (including Windows) do not support chown(). In that + * case, this function returns @c NULL. */ EAPI Eio_File *eio_file_chown(const char *path, const char *user, diff --git a/src/lib/eio/eio_single.c b/src/lib/eio/eio_single.c index 1701f1006e..3fd11a59cb 100644 --- a/src/lib/eio/eio_single.c +++ b/src/lib/eio/eio_single.c @@ -204,16 +204,10 @@ _eio_file_chmod(void *data, Ecore_Thread *thread) eio_file_thread_error(&ch->common, thread); } +#if defined(HAVE_CHOWN) && defined(HAVE_GETPWENT) static void _eio_file_chown(void *data, Ecore_Thread *thread) { -#ifdef _WIN32 - /* FIXME: - * look at http://wwwthep.physik.uni-mainz.de/~frink/chown/readme.html - */ - (void)data; - (void)thread; -#else Eio_File_Chown *own = data; char *tmp; uid_t owner = -1; @@ -266,7 +260,6 @@ _eio_file_chown(void *data, Ecore_Thread *thread) on_error: ecore_thread_cancel(thread); return; -#endif } static void @@ -297,6 +290,7 @@ _eio_file_chown_error(void *data, Ecore_Thread *thread EINA_UNUSED) eio_file_error(&ch->common); _eio_chown_free(ch); } +#endif /** * @endcond @@ -585,6 +579,7 @@ eio_file_chown(const char *path, Eio_Error_Cb error_cb, const void *data) { +#if defined(HAVE_CHOWN) && defined(HAVE_GETPWENT) Eio_File_Chown *c = NULL; EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); @@ -601,11 +596,20 @@ eio_file_chown(const char *path, if (!eio_file_set(&c->common, done_cb, error_cb, - data, + data, _eio_file_chown, _eio_file_chown_done, _eio_file_chown_error)) return NULL; return &c->common; +#else + EINA_SAFETY_ON_NULL_RETURN_VAL(error_cb, NULL); + error_cb(data, NULL, EINVAL); + return NULL; + (void)path; + (void)user; + (void)group; + (void)done_cb; +#endif } From 508c2954f35d6dab5a79e1ecbcaceb7b8ff3b4b7 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 10:29:52 +0100 Subject: [PATCH 40/72] ecore win32 - disable #warning because all it does is fill build logs we see it 100's of times during build. disabling this. the comments etc. are still there, but more value in commenting out than keeping it so we can see the forest from the trees. --- src/lib/ecore_win32/Ecore_Win32.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/ecore_win32/Ecore_Win32.h b/src/lib/ecore_win32/Ecore_Win32.h index cfa7f5adc1..91274ba74a 100644 --- a/src/lib/ecore_win32/Ecore_Win32.h +++ b/src/lib/ecore_win32/Ecore_Win32.h @@ -6,6 +6,7 @@ * THE API MAY CHANGE. */ +/* #ifndef ECORE_WIN32_WIP_POZEFLKSD # ifdef _MSC_VER # pragma message ("You are using a work in progress API. This API is not stable") @@ -15,6 +16,7 @@ # warning "and is subject to change. You use this at your own risk." # endif #endif +*/ #include From 5fd272d0381f5cda6b8b992e14072f884965a415 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 10:33:07 +0100 Subject: [PATCH 41/72] filesel example - add locale.h include since we use setlocale --- src/examples/elementary/fileselector_example.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/examples/elementary/fileselector_example.c b/src/examples/elementary/fileselector_example.c index 320fe64231..db6dbee256 100644 --- a/src/examples/elementary/fileselector_example.c +++ b/src/examples/elementary/fileselector_example.c @@ -10,6 +10,7 @@ */ #include +#include /* 'done' cb */ static void From 188874e289ffb83fd6344d7efe2680c5ad365fd3 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 11:17:51 +0100 Subject: [PATCH 42/72] examples - use putenv, not setenv for porting reasons putenv is more portable than setenv, so usethat instead. this nukes warnings on windows as evil is meant to go private and you thus have no setenv anymore. --- src/examples/edje/edje-text.c | 15 +++++++++++++-- src/examples/evas/evas-3d-blending.c | 2 +- src/examples/evas/evas-3d-cube.c | 2 +- src/examples/evas/evas-3d-cube2.c | 2 +- src/examples/evas/evas-3d-eet.c | 2 +- src/examples/evas/evas-3d-fog.c | 2 +- src/examples/evas/evas-3d-frustum.c | 2 +- src/examples/evas/evas-3d-hull.c | 2 +- src/examples/evas/evas-3d-md2.c | 2 +- src/examples/evas/evas-3d-mmap-set.c | 2 +- src/examples/evas/evas-3d-obj.c | 2 +- src/examples/evas/evas-3d-parallax-occlusion.c | 2 +- src/examples/evas/evas-3d-pick.c | 2 +- src/examples/evas/evas-3d-ply.c | 2 +- src/examples/evas/evas-3d-proxy.c | 2 +- src/examples/evas/evas-3d-shadows.c | 2 +- src/examples/evas/evas-3d-static-lod.c | 2 +- src/examples/evas/evas-vg-batman.c | 2 +- src/examples/evas/evas-vg-json.c | 2 +- 19 files changed, 31 insertions(+), 20 deletions(-) diff --git a/src/examples/edje/edje-text.c b/src/examples/edje/edje-text.c index 2f4d745aa0..45fb340feb 100644 --- a/src/examples/edje/edje-text.c +++ b/src/examples/edje/edje-text.c @@ -77,9 +77,20 @@ _on_mouse_down(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o, void static void _on_mouse_down_text(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED) { + static char *env_lang_str = NULL; + char *s; + lang_idx = (lang_idx + 1) % (sizeof (lang)/ sizeof (lang[0])); fprintf(stderr, "Setting lang to '%s'\n", lang[lang_idx]); - setenv("LANGUAGE", lang[lang_idx], 1); + s = malloc(10 + strlen(lang[lang_idx])); + if (s) + { + strcpy(s, "LANGUAGE="); + strcpy(s + 9, lang[lang_idx]); + putenv(s); + if (env_lang_str) free(env_lang_str); + env_lang_str = s; + } edje_language_set(lang[lang_idx]); } int @@ -122,7 +133,7 @@ main(int argc EINA_UNUSED, char *argv[] EINA_UNUSED) evas_object_move(edje_obj, 0, 20); evas_object_resize(edje_obj, WIDTH - 40, HEIGHT - 40); evas_object_show(edje_obj); - setenv("LANGUAGE", "en_IN", 1); + putenv("LANGUAGE=en_IN"); edje_object_language_set(edje_obj, "en_IN"); edje_object_text_change_cb_set(edje_obj, _on_text_change, NULL); edje_object_part_text_set(edje_obj, "part_two", "Click here"); diff --git a/src/examples/evas/evas-3d-blending.c b/src/examples/evas/evas-3d-blending.c index 47271ff460..066961af72 100644 --- a/src/examples/evas/evas-3d-blending.c +++ b/src/examples/evas/evas-3d-blending.c @@ -266,7 +266,7 @@ main(void) if (!ecore_evas_init()) return 0; - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); ecore_evas = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); if (!ecore_evas) return 0; diff --git a/src/examples/evas/evas-3d-cube.c b/src/examples/evas/evas-3d-cube.c index 3fba86a147..50c3034342 100644 --- a/src/examples/evas/evas-3d-cube.c +++ b/src/examples/evas/evas-3d-cube.c @@ -218,7 +218,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; diff --git a/src/examples/evas/evas-3d-cube2.c b/src/examples/evas/evas-3d-cube2.c index 493cea98ce..026b90a5a0 100644 --- a/src/examples/evas/evas-3d-cube2.c +++ b/src/examples/evas/evas-3d-cube2.c @@ -213,7 +213,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; diff --git a/src/examples/evas/evas-3d-eet.c b/src/examples/evas/evas-3d-eet.c index 5ecd79e350..0272de7db2 100644 --- a/src/examples/evas/evas-3d-eet.c +++ b/src/examples/evas/evas-3d-eet.c @@ -98,7 +98,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-fog.c b/src/examples/evas/evas-3d-fog.c index 8bcd51b94e..ec27d632c2 100644 --- a/src/examples/evas/evas-3d-fog.c +++ b/src/examples/evas/evas-3d-fog.c @@ -190,7 +190,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; Ecore_Animator *anim; diff --git a/src/examples/evas/evas-3d-frustum.c b/src/examples/evas/evas-3d-frustum.c index 6aacecc825..2d693fc83a 100644 --- a/src/examples/evas/evas-3d-frustum.c +++ b/src/examples/evas/evas-3d-frustum.c @@ -405,7 +405,7 @@ main(void) if (!ecore_evas_init()) return 0; - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); ecore_evas = ecore_evas_new("opengl_x11", 0, 0, WIDTH, HEIGHT, NULL); if (!ecore_evas) return 0; diff --git a/src/examples/evas/evas-3d-hull.c b/src/examples/evas/evas-3d-hull.c index 6ca12837dc..a5c39752d2 100644 --- a/src/examples/evas/evas-3d-hull.c +++ b/src/examples/evas/evas-3d-hull.c @@ -412,7 +412,7 @@ main(void) Scene_Data data; // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-md2.c b/src/examples/evas/evas-3d-md2.c index 4c93b54ec0..a4edb28833 100644 --- a/src/examples/evas/evas-3d-md2.c +++ b/src/examples/evas/evas-3d-md2.c @@ -75,7 +75,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-mmap-set.c b/src/examples/evas/evas-3d-mmap-set.c index df8bdbdd4d..7da515aa61 100644 --- a/src/examples/evas/evas-3d-mmap-set.c +++ b/src/examples/evas/evas-3d-mmap-set.c @@ -165,7 +165,7 @@ main(void) Eina_File *obj_file, *ply_file, *eet_file, *md2_file; // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-obj.c b/src/examples/evas/evas-3d-obj.c index 6bf668ba09..1034b6befc 100644 --- a/src/examples/evas/evas-3d-obj.c +++ b/src/examples/evas/evas-3d-obj.c @@ -143,7 +143,7 @@ main(void) char buffer[PATH_MAX], full_file_path[PATH_MAX + 4]; // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-parallax-occlusion.c b/src/examples/evas/evas-3d-parallax-occlusion.c index 65d1880559..e3a69a606b 100644 --- a/src/examples/evas/evas-3d-parallax-occlusion.c +++ b/src/examples/evas/evas-3d-parallax-occlusion.c @@ -217,7 +217,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; diff --git a/src/examples/evas/evas-3d-pick.c b/src/examples/evas/evas-3d-pick.c index 5ed8067dc3..600220f955 100644 --- a/src/examples/evas/evas-3d-pick.c +++ b/src/examples/evas/evas-3d-pick.c @@ -101,7 +101,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-ply.c b/src/examples/evas/evas-3d-ply.c index ba0b912d0b..3d8693e90a 100644 --- a/src/examples/evas/evas-3d-ply.c +++ b/src/examples/evas/evas-3d-ply.c @@ -114,7 +114,7 @@ main(void) } // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; diff --git a/src/examples/evas/evas-3d-proxy.c b/src/examples/evas/evas-3d-proxy.c index 1a671f811d..8c88143a47 100644 --- a/src/examples/evas/evas-3d-proxy.c +++ b/src/examples/evas/evas-3d-proxy.c @@ -201,7 +201,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; diff --git a/src/examples/evas/evas-3d-shadows.c b/src/examples/evas/evas-3d-shadows.c index eaa2f02f55..315fda70cd 100644 --- a/src/examples/evas/evas-3d-shadows.c +++ b/src/examples/evas/evas-3d-shadows.c @@ -626,7 +626,7 @@ main(void) Eina_List *nodes1 = NULL, *nodes2 = NULL; // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); if (!ecore_evas_init()) return 0; ecore_evas = ecore_evas_new(NULL, 10, 10, WIDTH, HEIGHT, NULL); diff --git a/src/examples/evas/evas-3d-static-lod.c b/src/examples/evas/evas-3d-static-lod.c index 3b08380f1c..f4477289c7 100644 --- a/src/examples/evas/evas-3d-static-lod.c +++ b/src/examples/evas/evas-3d-static-lod.c @@ -235,7 +235,7 @@ int main(void) { // Unless Evas 3D supports Software renderer, we force use of the gl backend. - setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + putenv("ECORE_EVAS_ENGINE=opengl_x11"); Scene_Data data; diff --git a/src/examples/evas/evas-vg-batman.c b/src/examples/evas/evas-vg-batman.c index 8625366962..72bdd6c4fe 100644 --- a/src/examples/evas/evas-vg-batman.c +++ b/src/examples/evas/evas-vg-batman.c @@ -104,7 +104,7 @@ main(void) if (!ecore_evas_init()) return -1; - //setenv("ECORE_EVAS_ENGINE", "opengl_x11", 1); + //putenv("ECORE_EVAS_ENGINE=opengl_x11"); ee = ecore_evas_new(NULL, 0, 0, WIDTH, HEIGHT, NULL); if (!ee) return -1; diff --git a/src/examples/evas/evas-vg-json.c b/src/examples/evas/evas-vg-json.c index d0176dbd72..a6c0969381 100644 --- a/src/examples/evas/evas-vg-json.c +++ b/src/examples/evas/evas-vg-json.c @@ -59,7 +59,7 @@ int main(void) { //Cairo backend is not supported. - setenv("ECTOR_BACKEND", "default", 1); + putenv("ECTOR_BACKEND=default"); if (!ecore_evas_init()) return EXIT_FAILURE; From 4d27f5f63e15526cb512202d5b8ff250cc37a77b Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 11:37:23 +0100 Subject: [PATCH 43/72] warning - move break in switch to handle properly and addess warning --- src/examples/ecore_avahi/ecore_avahi_browse_example.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/examples/ecore_avahi/ecore_avahi_browse_example.c b/src/examples/ecore_avahi/ecore_avahi_browse_example.c index 6935a13bdd..1a9d6663e3 100644 --- a/src/examples/ecore_avahi/ecore_avahi_browse_example.c +++ b/src/examples/ecore_avahi/ecore_avahi_browse_example.c @@ -151,8 +151,9 @@ _ecore_avahi_client_cb(AvahiClient *c, AvahiClientState state, void * userdata) ecore_main_loop_quit(); - break; } + break; + case AVAHI_CLIENT_CONNECTING: FREE_CLEAN(example->sb, avahi_service_browser_free); break; From 0ff42fa4e51d5aa94b6d60e300a77876b82fe952 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 11:40:18 +0100 Subject: [PATCH 44/72] elm test - set var to null to avoid warning --- src/bin/elementary/test_ui_radio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/elementary/test_ui_radio.c b/src/bin/elementary/test_ui_radio.c index 259846f96d..7f72df92f7 100644 --- a/src/bin/elementary/test_ui_radio.c +++ b/src/bin/elementary/test_ui_radio.c @@ -94,7 +94,7 @@ void test_efl_ui_radio(void *data EINA_UNUSED, Efl_Ui_Box *bx; Eina_Array *arr; Efl_Ui_Button *o; - Efl_Ui_Radio *uk; + Efl_Ui_Radio *uk = NULL; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), From 9b294d6284fbda62dde20bcb31732a1c63a65962 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Sun, 28 Jul 2019 11:51:15 +0100 Subject: [PATCH 45/72] eina file - stat generation inexactness support this is a performance optimization. it brings in a "stat generation". for now it's disabled by default so we retain previous behavior. this stops eina file from opening and stating a file every time you open ... it only does it if stat generation is off, or, if the generation changed since the last time it opened that file. this makes cache hits not have a 3 syscall cost (open+fstat+close). this optimizes that lower end of things path. but .. it comes at a cost. if the file changes before generation ticks over (which this forces to tick over every time the loop exits idle by default). now here is something to ask. 1. should we have this on by default and accept the "inexactness" since you can eina_file_statgen_next() before any call that would do i/o to force it to look at the real file stat info... 2. should we tick over every idle enter OR every N idle enters or every frame we render instead? ... i want to avoid getting a timestamp or having a timer interrupt often... so what should we do? at least this introduces the idea, some api's and an env var to turn this on. it definitely cuts down syscalls during things like creation of widdgets or objects in large batches etc. --- src/lib/ecore/ecore_main.c | 6 +++ src/lib/eina/eina_file.c | 70 ++++++++++++++++++--------------- src/lib/eina/eina_file.h | 32 +++++++++++++++ src/lib/eina/eina_file_common.c | 44 +++++++++++++++++++++ src/lib/eina/eina_file_common.h | 1 + 5 files changed, 121 insertions(+), 32 deletions(-) diff --git a/src/lib/ecore/ecore_main.c b/src/lib/ecore/ecore_main.c index f7d248fc27..e898b6e0f3 100644 --- a/src/lib/ecore/ecore_main.c +++ b/src/lib/ecore/ecore_main.c @@ -331,6 +331,7 @@ _ecore_main_uv_poll_cb(uv_poll_t *handle, int status, int events) { DBG("not IDLE anymore"); _ecore_main_uv_idling = EINA_FALSE; + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); _ecore_animator_run_reset(); } @@ -794,6 +795,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_idling && events_ready) { _ecore_animator_run_reset(); + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); ecore_idling = 0; } @@ -808,6 +810,7 @@ _ecore_main_gsource_dispatch(GSource *source EINA_UNUSED, if (ecore_fds_ready || events_ready || timers_ready) { _ecore_animator_run_reset(); + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); ecore_idling = 0; } @@ -867,6 +870,7 @@ _ecore_main_loop_timer_run(uv_timer_t *timer EINA_UNUSED) if (_ecore_main_uv_idling) { _ecore_main_uv_idling = EINA_FALSE; + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); _ecore_animator_run_reset(); } @@ -2243,6 +2247,7 @@ _ecore_main_loop_uv_prepare(uv_prepare_t *handle EINA_UNUSED) if (_ecore_main_uv_idling) { + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); _ecore_animator_run_reset(); _ecore_main_uv_idling = EINA_FALSE; @@ -2473,6 +2478,7 @@ process_all: //-********************************************************* if (!once_only) { _ecore_animator_run_reset(); // XXX: + eina_file_statgen_next(); efl_event_callback_call(obj, EFL_LOOP_EVENT_IDLE_EXIT, NULL); } // call the fd handler per fd that became alive... diff --git a/src/lib/eina/eina_file.c b/src/lib/eina/eina_file.c index 068aa12e14..e334beaf21 100644 --- a/src/lib/eina/eina_file.c +++ b/src/lib/eina/eina_file.c @@ -795,46 +795,51 @@ eina_file_open(const char *path, Eina_Bool shared) Eina_Stringshare *filename; struct stat file_stat; int fd = -1; + Eina_Statgen statgen; EINA_SAFETY_ON_NULL_RETURN_VAL(path, NULL); filename = eina_file_sanitize(path); if (!filename) return NULL; - if (shared) - { -#ifdef HAVE_SHM_OPEN - fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); - if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) - goto on_error; -#else - goto on_error; -#endif - } - else - { -#ifdef HAVE_OPEN_CLOEXEC - fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO | O_CLOEXEC); -#else - fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); - if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) - goto on_error; -#endif - } - - if (fd < 0) goto on_error; - - if (fstat(fd, &file_stat)) - goto on_error; - + statgen = eina_file_statgen_get(); eina_lock_take(&_eina_file_lock_cache); - file = eina_hash_find(_eina_file_cache, filename); - if ((file) && !_eina_file_timestamp_compare(file, &file_stat)) + statgen = eina_file_statgen_get(); + if ((!file) || (file->statgen != statgen) || (statgen == 0)) { - file->delete_me = EINA_TRUE; - eina_hash_del(_eina_file_cache, file->filename, file); - file = NULL; + if (shared) + { +#ifdef HAVE_SHM_OPEN + fd = shm_open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) + goto on_error; +#else + goto on_error; +#endif + } + else + { +#ifdef HAVE_OPEN_CLOEXEC + fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO | O_CLOEXEC); +#else + fd = open(filename, O_RDONLY, S_IRWXU | S_IRWXG | S_IRWXO); + if ((fd != -1) && (!eina_file_close_on_exec(fd, EINA_TRUE))) + goto on_error; +#endif + } + if (fd < 0) goto on_error; + + if (fstat(fd, &file_stat)) + goto on_error; + if (file) file->statgen = statgen; + + if ((file) && !_eina_file_timestamp_compare(file, &file_stat)) + { + file->delete_me = EINA_TRUE; + eina_hash_del(_eina_file_cache, file->filename, file); + file = NULL; + } } if (!file) @@ -874,7 +879,7 @@ eina_file_open(const char *path, Eina_Bool shared) } else { - close(fd); + if (fd >= 0) close(fd); n = file; } eina_lock_take(&n->lock); @@ -886,6 +891,7 @@ eina_file_open(const char *path, Eina_Bool shared) return n; on_error: + eina_lock_release(&_eina_file_lock_cache); INF("Could not open file [%s].", filename); eina_stringshare_del(filename); diff --git a/src/lib/eina/eina_file.h b/src/lib/eina/eina_file.h index bc1543e26e..07a045e1b4 100644 --- a/src/lib/eina/eina_file.h +++ b/src/lib/eina/eina_file.h @@ -768,6 +768,38 @@ EAPI Eina_Bool eina_file_close_on_exec(int fd, Eina_Bool on); #include "eina_inline_file.x" +/** + * @typedef Eina_Statgen + * @brief Stat Generation count state with it being 0 when disabled or some other value that is comparable (== or !=) to a stored value and if it is not equal, then do the actual stat i/o work + * @since 1.23 + */ +typedef unsigned int Eina_Statgen; + +/** + * @brief Force the stat generation counter to tick over so any following i/o does real i/o and stat calls + * @since 1.23 + */ +EAPI void eina_file_statgen_next(void); + +/** + * @brief Get the current stat generation counter value + * @return 0 if you should always do stat calls and compare, or some other value that changes like a generation counter + * @since 1.23 + */ +EAPI Eina_Statgen eina_file_statgen_get(void); + +/** + * @brief Enable stat generation count optimiziing to only stat/do file i/o between generation counts changing + * @since 1.23 + */ +EAPI void eina_file_statgen_enable(void); + +/** + * @brief Disable stat generation count optimiziing to only stat/do file i/o between generation counts changing + * @since 1.23 + */ +EAPI void eina_file_statgen_bisable(void); + /** * @} */ diff --git a/src/lib/eina/eina_file_common.c b/src/lib/eina/eina_file_common.c index b62fc22b80..9369cb2cc5 100644 --- a/src/lib/eina/eina_file_common.c +++ b/src/lib/eina/eina_file_common.c @@ -74,6 +74,47 @@ Eina_Lock _eina_file_lock_cache; # define EINA_FILE_MAGIC_CHECK(f, ...) do {} while(0) #endif +static Eina_Spinlock _eina_statgen_lock; +static Eina_Statgen _eina_statgen = 0; + +EAPI void +eina_file_statgen_next(void) +{ + eina_spinlock_take(&_eina_statgen_lock); + if (_eina_statgen != 0) + { + _eina_statgen++; + if (_eina_statgen == 0) _eina_statgen = 1; + } + eina_spinlock_release(&_eina_statgen_lock); +} + +EAPI Eina_Statgen +eina_file_statgen_get(void) +{ + Eina_Statgen s; + eina_spinlock_take(&_eina_statgen_lock); + s = _eina_statgen; + eina_spinlock_release(&_eina_statgen_lock); + return s; +} + +EAPI void +eina_file_statgen_enable(void) +{ + eina_spinlock_take(&_eina_statgen_lock); + if (_eina_statgen != 0) _eina_statgen = 1; + eina_spinlock_release(&_eina_statgen_lock); +} + +EAPI void +eina_file_statgen_bisable(void) +{ + eina_spinlock_take(&_eina_statgen_lock); + _eina_statgen = 0; + eina_spinlock_release(&_eina_statgen_lock); +} + static char * _eina_file_escape(char *path, size_t len) { @@ -1072,6 +1113,8 @@ eina_file_init(void) return EINA_FALSE; } + if (getenv("EINA_STATGEN")) _eina_statgen = 1; + eina_spinlock_new(&_eina_statgen_lock); eina_lock_recursive_new(&_eina_file_lock_cache); eina_magic_string_set(EINA_FILE_MAGIC, "Eina_File"); @@ -1102,6 +1145,7 @@ eina_file_shutdown(void) eina_log_domain_unregister(_eina_file_log_dom); _eina_file_log_dom = -1; + eina_spinlock_free(&_eina_statgen_lock); return EINA_TRUE; } diff --git a/src/lib/eina/eina_file_common.h b/src/lib/eina/eina_file_common.h index 142ee2d852..38c1a3c4ee 100644 --- a/src/lib/eina/eina_file_common.h +++ b/src/lib/eina/eina_file_common.h @@ -89,6 +89,7 @@ struct _Eina_File int refcount; /**< Keeps track of references to #map. */ int global_refcount; /**< Keeps track of references to #global_map. */ + Eina_Statgen statgen;/**< For inexact stats a stat gen count to rate limit syscalls to stat file */ #ifndef _WIN32 int fd; /**< The file descriptor. */ From 77e268e6aba2d07b9d4b06c83515041775210c27 Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Mon, 29 Jul 2019 11:42:34 +0200 Subject: [PATCH 46/72] efl_input_clickable: rename efl_ui_clickable to efl_input_clickable Summary: Renamed all efl_ui_clickable_XXX to efl_input_clickable_XXX based on the discussion in T7847 ref T7847 T7976 Reviewers: zmike, bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T7976, T7847 Differential Revision: https://phab.enlightenment.org/D9427 --- src/bin/elementary/test_bg.c | 4 +- src/bin/elementary/test_efl_ui_text.c | 10 +-- src/bin/elementary/test_evas_mask.c | 6 +- src/bin/elementary/test_evas_snapshot.c | 8 +- src/bin/elementary/test_events.c | 4 +- src/bin/elementary/test_gfx_filters.c | 4 +- src/bin/elementary/test_part_bg.c | 6 +- src/bin/elementary/test_part_shadow.c | 4 +- src/bin/elementary/test_photocam.c | 2 +- src/bin/elementary/test_ui_button.c | 18 ++-- src/bin/elementary/test_ui_clock.c | 2 +- src/bin/elementary/test_ui_image.c | 4 +- src/bin/elementary/test_ui_item_container.c | 12 +-- src/bin/elementary/test_ui_pager.c | 32 ++++---- src/bin/elementary/test_ui_pager_scroll.c | 40 ++++----- src/bin/elementary/test_ui_panel.c | 2 +- src/bin/elementary/test_ui_popup.c | 82 +++++++++---------- src/bin/elementary/test_ui_progressbar.c | 6 +- src/bin/elementary/test_ui_radio.c | 6 +- src/bin/elementary/test_ui_relative_layout.c | 4 +- src/bin/elementary/test_ui_scroller.c | 16 ++-- src/bin/elementary/test_ui_spin.c | 4 +- src/bin/elementary/test_ui_spotlight.c | 44 +++++----- src/bin/elementary/test_ui_stack.c | 12 +-- src/bin/elementary/test_ui_tab_pager.c | 38 ++++----- src/bin/elementary/test_ui_table.c | 12 +-- src/bin/elementary/test_ui_table_static.c | 4 +- src/bin/elementary/test_ui_tags.c | 2 +- src/bin/elementary/test_win_indicator.c | 8 +- .../elementary/button_cxx_example_00.cc | 4 +- .../elementary/button_cxx_example_01.cc | 20 ++--- .../elementary/efl_ui_list_example_1.c | 10 +-- .../elementary/efl_ui_slideshow_example.c | 2 +- .../elementary/efl_ui_theme_example_01.c | 2 +- .../elementary/efl_ui_theme_example_02.c | 2 +- src/examples/elementary/popup_cxx_example.cc | 26 +++--- src/lib/elementary/Efl_Ui.h | 1 - src/lib/elementary/Elementary.h | 1 - src/lib/elementary/efl_ui_alert_popup.c | 6 +- src/lib/elementary/efl_ui_button.c | 10 +-- src/lib/elementary/efl_ui_button.eo | 2 +- src/lib/elementary/efl_ui_calendar.c | 2 +- src/lib/elementary/efl_ui_clickable_util.c | 24 +++--- src/lib/elementary/efl_ui_clickable_util.eo | 12 +-- src/lib/elementary/efl_ui_collection.c | 20 ++--- src/lib/elementary/efl_ui_frame.c | 4 +- src/lib/elementary/efl_ui_frame.eo | 2 +- src/lib/elementary/efl_ui_image.c | 4 +- src/lib/elementary/efl_ui_image.eo | 2 +- src/lib/elementary/efl_ui_image_zoomable.c | 2 +- src/lib/elementary/efl_ui_item.c | 8 +- src/lib/elementary/efl_ui_item.eo | 2 +- src/lib/elementary/efl_ui_navigation_bar.c | 6 +- src/lib/elementary/efl_ui_panes.c | 6 +- src/lib/elementary/efl_ui_panes.eo | 2 +- src/lib/elementary/efl_ui_spin_button.c | 2 +- src/lib/elementary/efl_ui_tags.c | 4 +- src/lib/elementary/efl_ui_text.c | 6 +- src/lib/elementary/efl_ui_text.eo | 2 +- src/lib/elementary/efl_ui_timepicker.c | 2 +- src/lib/elementary/elc_multibuttonentry.c | 2 +- src/lib/elementary/elc_naviframe.c | 2 +- src/lib/elementary/elm_bubble_eo.c | 2 +- src/lib/elementary/elm_calendar.c | 6 +- src/lib/elementary/elm_color_class.c | 2 +- src/lib/elementary/elm_colorselector.c | 4 +- src/lib/elementary/elm_colorselector_eo.c | 2 +- src/lib/elementary/elm_diskselector_eo.c | 2 +- src/lib/elementary/elm_entry.c | 2 +- src/lib/elementary/elm_entry_eo.c | 2 +- .../elementary/elm_fileselector_entry_eo.c | 2 +- src/lib/elementary/elm_fileselector_eo.c | 2 +- src/lib/elementary/elm_gengrid_eo.c | 2 +- src/lib/elementary/elm_genlist_eo.c | 2 +- src/lib/elementary/elm_hover_eo.c | 2 +- src/lib/elementary/elm_hoversel_eo.c | 2 +- src/lib/elementary/elm_index_eo.c | 2 +- src/lib/elementary/elm_list_eo.c | 2 +- src/lib/elementary/elm_map_eo.c | 2 +- src/lib/elementary/elm_menu.c | 4 +- src/lib/elementary/elm_menu_eo.c | 2 +- src/lib/elementary/elm_multibuttonentry_eo.c | 2 +- src/lib/elementary/elm_photo_eo.c | 2 +- src/lib/elementary/elm_plug_eo.c | 2 +- src/lib/elementary/elm_spinner.c | 8 +- src/lib/elementary/elm_thumb_eo.c | 2 +- src/lib/elementary/elm_toolbar_eo.c | 2 +- src/lib/elementary/meson.build | 2 - src/lib/evas/Evas_Eo.h | 1 + .../canvas/efl_input_clickable.c} | 33 ++++---- .../canvas/efl_input_clickable.eo} | 12 +-- src/lib/evas/canvas/meson.build | 2 + .../clock_input_ctxpopup.c | 4 +- .../elementary/spec/efl_test_clickable.c | 24 +++--- 94 files changed, 370 insertions(+), 370 deletions(-) rename src/lib/{elementary/efl_ui_clickable.c => evas/canvas/efl_input_clickable.c} (71%) rename src/lib/{elementary/efl_ui_clickable.eo => evas/canvas/efl_input_clickable.eo} (76%) diff --git a/src/bin/elementary/test_bg.c b/src/bin/elementary/test_bg.c index fb8b4f5f33..ebcb3ded07 100644 --- a/src/bin/elementary/test_bg.c +++ b/src/bin/elementary/test_bg.c @@ -358,7 +358,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_file_set(efl_added, buf), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _file_cb, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _file_cb, win), efl_pack(box, efl_added)); snprintf(buf, sizeof(buf), "%s/images/sky_04.jpg", elm_app_data_dir_get()); @@ -366,7 +366,7 @@ test_bg_window(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_file_set(efl_added, buf), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(64, 64)), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _image_cb, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _image_cb, win), efl_pack(box, efl_added)); efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200)); diff --git a/src/bin/elementary/test_efl_ui_text.c b/src/bin/elementary/test_efl_ui_text.c index 9993204468..a939304965 100644 --- a/src/bin/elementary/test_efl_ui_text.c +++ b/src/bin/elementary/test_efl_ui_text.c @@ -184,14 +184,14 @@ test_efl_ui_text(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Sel"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_bt3_clicked, en); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _on_bt3_clicked, en); efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Wr"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_bt6_clicked, en); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _on_bt6_clicked, en); efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); @@ -376,21 +376,21 @@ test_ui_text_item_factory(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Image"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_image_clicked, en); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _on_factory_bt_image_clicked, en); efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Emoticon"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_emoticon_clicked, en); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _on_factory_bt_emoticon_clicked, en); efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); bt = efl_add(EFL_UI_BUTTON_CLASS, bx2); efl_text_set(bt, "Factory"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _on_factory_bt_factory_clicked, en); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _on_factory_bt_factory_clicked, en); efl_gfx_hint_weight_set(bt, EFL_GFX_HINT_EXPAND, 0.0); efl_pack(bx2, bt); elm_object_focus_allow_set(bt, EINA_FALSE); diff --git a/src/bin/elementary/test_evas_mask.c b/src/bin/elementary/test_evas_mask.c index 5b470e0845..4a263e0a44 100644 --- a/src/bin/elementary/test_evas_mask.c +++ b/src/bin/elementary/test_evas_mask.c @@ -182,19 +182,19 @@ test_evas_mask(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event // FIXME: button EO API efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Toggle mask (image)"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_mask, ly), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _toggle_mask, ly), efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Toggle map"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, ly), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _toggle_map, ly), efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Rotate Window"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _rotate_win, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _rotate_win, win), efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_pack(box2, efl_added)); diff --git a/src/bin/elementary/test_evas_snapshot.c b/src/bin/elementary/test_evas_snapshot.c index 4cb8ed1b53..dba6570588 100644 --- a/src/bin/elementary/test_evas_snapshot.c +++ b/src/bin/elementary/test_evas_snapshot.c @@ -184,25 +184,25 @@ test_evas_snapshot(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_text_set(efl_added, "Toggle animation"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _anim_toggle, win)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _anim_toggle, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Save to file"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _save_image, win)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _save_image, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Map"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _toggle_map, win)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _toggle_map, win)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Close"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack(box, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _close_do, win)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _close_do, win)); efl_key_wref_set(win, "snap", snap); efl_key_wref_set(win, "table", table); diff --git a/src/bin/elementary/test_events.c b/src/bin/elementary/test_events.c index 614b9fa2ac..4b36bf4b35 100644 --- a/src/bin/elementary/test_events.c +++ b/src/bin/elementary/test_events.c @@ -227,9 +227,9 @@ test_events(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in o = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win); efl_pack(bx, o); - efl_event_callback_add(td->button, EFL_UI_EVENT_CLICKED, _clicked_button1, td); + efl_event_callback_add(td->button, EFL_INPUT_EVENT_CLICKED, _clicked_button1, td); efl_event_callback_array_add(td->button, button_pointer_callbacks(), (void*)(intptr_t)0x1); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _clicked_button2, td); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _clicked_button2, td); efl_event_callback_add(win, EFL_EVENT_DEL, _win_del, td); efl_event_callback_array_add(o, rect_pointer_callbacks(), td); efl_event_callback_array_add(win, win_key_callbacks(), td); diff --git a/src/bin/elementary/test_gfx_filters.c b/src/bin/elementary/test_gfx_filters.c index fed75a9359..4fdee9dccb 100644 --- a/src/bin/elementary/test_gfx_filters.c +++ b/src/bin/elementary/test_gfx_filters.c @@ -378,7 +378,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_text_set(efl_added, "Flip"), efl_gfx_hint_weight_set(efl_added, 0.0, 1.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _flip_click, win)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _flip_click, win)); efl_pack(box2, o); } @@ -409,7 +409,7 @@ test_gfx_filters(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve elm_object_tooltip_text_set(efl_added, images[k].src_name)); if (efl_player_playable_get(o)) efl_player_play_set(o, 1); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _img_click, win); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _img_click, win); efl_pack(box2, o); } diff --git a/src/bin/elementary/test_part_bg.c b/src/bin/elementary/test_part_bg.c index cc01014c04..d3d6ea3629 100644 --- a/src/bin/elementary/test_part_bg.c +++ b/src/bin/elementary/test_part_bg.c @@ -181,9 +181,9 @@ test_part_background(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void radio_group = _create_box_contents(vbox); - efl_event_callback_add(reset_btn, EFL_UI_EVENT_CLICKED, _reset_cb, radio_group); - efl_event_callback_add(color_btn, EFL_UI_EVENT_CLICKED, _color_cb, radio_group); - efl_event_callback_add(scale_btn, EFL_UI_EVENT_CLICKED, _scale_type_cb, radio_group); + efl_event_callback_add(reset_btn, EFL_INPUT_EVENT_CLICKED, _reset_cb, radio_group); + efl_event_callback_add(color_btn, EFL_INPUT_EVENT_CLICKED, _color_cb, radio_group); + efl_event_callback_add(scale_btn, EFL_INPUT_EVENT_CLICKED, _scale_type_cb, radio_group); efl_gfx_entity_size_set(win, EINA_SIZE2D(300, 200)); } diff --git a/src/bin/elementary/test_part_shadow.c b/src/bin/elementary/test_part_shadow.c index 44e75143c9..8378473903 100644 --- a/src/bin/elementary/test_part_shadow.c +++ b/src/bin/elementary/test_part_shadow.c @@ -181,12 +181,12 @@ test_part_shadow(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *eve efl_pack(bx, bt_bx); bt = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Start")); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, pulse_start, td); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, pulse_start, td); efl_pack(bt_bx, bt); td->btn_start = bt; bt = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Stop")); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, pulse_stop, td); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, pulse_stop, td); efl_ui_widget_disabled_set(bt, EINA_TRUE); efl_pack(bt_bx, bt); td->btn_stop = bt; diff --git a/src/bin/elementary/test_photocam.c b/src/bin/elementary/test_photocam.c index bbbbb1fe88..42ef33f671 100644 --- a/src/bin/elementary/test_photocam.c +++ b/src/bin/elementary/test_photocam.c @@ -827,7 +827,7 @@ test_image_zoomable_animated(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE efl_file_set(efl_added, buf), efl_file_load(efl_added), efl_pack(bx, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _zoomable_clicked_cb, NULL) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _zoomable_clicked_cb, NULL) ); if (efl_player_playable_get(zoomable)) diff --git a/src/bin/elementary/test_ui_button.c b/src/bin/elementary/test_ui_button.c index 079f9c66d3..62be0bca4f 100644 --- a/src/bin/elementary/test_ui_button.c +++ b/src/bin/elementary/test_ui_button.c @@ -42,18 +42,18 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Text"), efl_pack(bx, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_PRESSED, _pressed, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_UNPRESSED, _unpressed, NULL) ); // Icon Only Button snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get()); btn = efl_add(EFL_UI_BUTTON_CLASS, bx, efl_pack(bx, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_PRESSED, _pressed, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_UNPRESSED, _unpressed, NULL) ); efl_add(EFL_UI_IMAGE_CLASS, btn, efl_file_set(efl_added, buf), @@ -65,9 +65,9 @@ test_ui_button(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event btn = efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Text + Icon"), efl_pack(bx, efl_added), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_PRESSED, _pressed, NULL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_UNPRESSED, _unpressed, NULL) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_PRESSED, _pressed, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_UNPRESSED, _unpressed, NULL) ); efl_add(EFL_UI_IMAGE_CLASS, btn, efl_file_set(efl_added, buf), diff --git a/src/bin/elementary/test_ui_clock.c b/src/bin/elementary/test_ui_clock.c index 936efd1d3b..d8cfd175e1 100644 --- a/src/bin/elementary/test_ui_clock.c +++ b/src/bin/elementary/test_ui_clock.c @@ -102,6 +102,6 @@ test_ui_clock(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Back to the future..."), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } diff --git a/src/bin/elementary/test_ui_image.c b/src/bin/elementary/test_ui_image.c index 8491a7f4cd..482abe6d8d 100644 --- a/src/bin/elementary/test_ui_image.c +++ b/src/bin/elementary/test_ui_image.c @@ -573,13 +573,13 @@ test_load_ui_image(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf { bt = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Image Reload"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _reload_clicked, win) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _reload_clicked, win) ); efl_pack(hbox, bt); bt = efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Image Switch"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _switch_clicked, win) + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _switch_clicked, win) ); efl_pack(hbox, bt); } diff --git a/src/bin/elementary/test_ui_item_container.c b/src/bin/elementary/test_ui_item_container.c index 97f3f0797b..e87a6ba9a7 100644 --- a/src/bin/elementary/test_ui_item_container.c +++ b/src/bin/elementary/test_ui_item_container.c @@ -175,21 +175,21 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Scroll to 1154 ANIMATED"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _scroll_to_animated_cb, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _scroll_to_animated_cb, item_container); efl_pack_table(tbl, o, 0, 1, 1, 1); o = efl_add(EFL_UI_BUTTON_CLASS, tbl, efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Scroll to 10"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _scroll_to_cb, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _scroll_to_cb, item_container); efl_pack_table(tbl, o, 0, 2, 1, 1); o = efl_add(EFL_UI_BUTTON_CLASS, tbl, efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Change min size of 0"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _change_min_size_cb, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _change_min_size_cb, item_container); efl_pack_table(tbl, o, 0, 3, 1, 1); o = efl_add(EFL_UI_CHECK_CLASS, tbl, @@ -221,21 +221,21 @@ void create_item_container_ui(Efl_Ui_Position_Manager_Entity *manager, const Efl efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Remove all items"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _remove_all_cb, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _remove_all_cb, item_container); efl_pack_table(tbl, o, 0, 7, 1, 1); o = efl_add(EFL_UI_BUTTON_CLASS, tbl, efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Add 1 item"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _add_one_item, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _add_one_item, item_container); efl_pack_table(tbl, o, 0, 8, 1, 1); o = efl_add(EFL_UI_BUTTON_CLASS, tbl, efl_gfx_hint_weight_set(efl_added, 0.0, 0.0), efl_gfx_hint_align_set(efl_added, 0, 0.5)); efl_text_set(o, "Add 1000 item"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _add_thousend_items, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _add_thousend_items, item_container); efl_pack_table(tbl, o, 0, 9, 1, 1); bx = efl_add(EFL_UI_RADIO_BOX_CLASS, tbl, diff --git a/src/bin/elementary/test_ui_pager.c b/src/bin/elementary/test_ui_pager.c index 6fcf48f763..c6d1aa084b 100644 --- a/src/bin/elementary/test_ui_pager.c +++ b/src/bin/elementary/test_ui_pager.c @@ -337,7 +337,7 @@ static void page_size_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -439,7 +439,7 @@ static void pack_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -478,7 +478,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Begin"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -496,7 +496,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack End"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -514,7 +514,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Before Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -532,7 +532,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack After Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -550,7 +550,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, in_box1, efl_text_set(efl_added, "Pack At"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -569,7 +569,7 @@ static void pack_cb(void *data, pack_param->unpack_btn = btn; pack_param->type = UNPACK_AT; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param); efl_event_callback_add(btn, EFL_EVENT_DEL, pack_btn_del_cb, pack_param); @@ -603,7 +603,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Clear"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -624,7 +624,7 @@ static void current_page_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -656,7 +656,7 @@ static void current_page_cb(void *data, psp->pager = pager; psp->spinner = sp; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, page_set_btn_cb, psp); efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp); } @@ -670,7 +670,7 @@ static void indicator_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -680,13 +680,13 @@ static void indicator_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Icon Type"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_icon_btn_cb, params), efl_pack_end(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "None"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_none_btn_cb, params), efl_pack_end(box, efl_added)); } @@ -735,13 +735,13 @@ void test_ui_pager(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Prev"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, prev_btn_cb, pager), + EFL_INPUT_EVENT_CLICKED, prev_btn_cb, pager), efl_content_set(efl_part(layout, "prev_btn"), efl_added)); efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Next"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, next_btn_cb, pager), + EFL_INPUT_EVENT_CLICKED, next_btn_cb, pager), efl_content_set(efl_part(layout, "next_btn"), efl_added)); params = calloc(1, sizeof(Params)); diff --git a/src/bin/elementary/test_ui_pager_scroll.c b/src/bin/elementary/test_ui_pager_scroll.c index 6e6c7d1f49..a7e564acbd 100644 --- a/src/bin/elementary/test_ui_pager_scroll.c +++ b/src/bin/elementary/test_ui_pager_scroll.c @@ -391,7 +391,7 @@ static void page_size_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -491,7 +491,7 @@ static void padding_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -518,7 +518,7 @@ static void side_page_num_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -551,7 +551,7 @@ static void pack_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -590,7 +590,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Begin"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -608,7 +608,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack End"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -626,7 +626,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Before Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -644,7 +644,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack After Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -662,7 +662,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, in_box1, efl_text_set(efl_added, "Pack At"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -681,7 +681,7 @@ static void pack_cb(void *data, pack_param->unpack_btn = btn; pack_param->type = UNPACK_AT; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param); efl_event_callback_add(btn, EFL_EVENT_DEL, pack_btn_del_cb, pack_param); @@ -715,7 +715,7 @@ static void pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Clear"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -735,7 +735,7 @@ static void current_page_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -767,7 +767,7 @@ static void current_page_cb(void *data, psp->pager = pager; psp->spinner = sp; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, page_set_btn_cb, psp); efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp); } @@ -783,7 +783,7 @@ static void scroll_block_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -822,7 +822,7 @@ static void loop_cb(void *data EINA_UNUSED, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_RADIO_BOX_CLASS, navi, @@ -870,7 +870,7 @@ static void indicator_cb(void *data EINA_UNUSED, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -880,13 +880,13 @@ static void indicator_cb(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Icon Type"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_icon_btn_cb, params), efl_pack_end(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "None"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_none_btn_cb, params), efl_pack_end(box, efl_added)); } @@ -936,13 +936,13 @@ void test_ui_pager_scroll(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Prev"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, prev_btn_cb, pager), + EFL_INPUT_EVENT_CLICKED, prev_btn_cb, pager), efl_content_set(efl_part(layout, "prev_btn"), efl_added)); efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Next"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, next_btn_cb, pager), + EFL_INPUT_EVENT_CLICKED, next_btn_cb, pager), efl_content_set(efl_part(layout, "next_btn"), efl_added)); tran = efl_add(EFL_PAGE_TRANSITION_SCROLL_CLASS, pager, diff --git a/src/bin/elementary/test_ui_panel.c b/src/bin/elementary/test_ui_panel.c index 22bd1a6ad4..ac08ff878a 100644 --- a/src/bin/elementary/test_ui_panel.c +++ b/src/bin/elementary/test_ui_panel.c @@ -154,7 +154,7 @@ test_ui_panel2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event efl_content_set(panel, list); efl_event_callback_add(panel, EFL_UI_PANEL_EVENT_TOGGLED, _panel_toggled, check); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _btn_clicked, panel); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _btn_clicked, panel); efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 400)); } diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c index d70592c70a..6fa397234f 100644 --- a/src/bin/elementary/test_ui_popup.c +++ b/src/bin/elementary/test_ui_popup.c @@ -251,7 +251,7 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_gfx_entity_position_set(repeat_test_btn, EINA_POSITION2D(0, 0)); efl_gfx_entity_size_set(repeat_test_btn, EINA_SIZE2D(100, 100)); efl_text_set(repeat_test_btn, "Repeat Event Test"); - efl_event_callback_add(repeat_test_btn, EFL_UI_EVENT_CLICKED, _repeat_test_cb, NULL); + efl_event_callback_add(repeat_test_btn, EFL_INPUT_EVENT_CLICKED, _repeat_test_cb, NULL); efl_gfx_entity_visible_set(repeat_test_btn, EINA_FALSE); p_data->win = win; @@ -263,73 +263,73 @@ test_ui_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_ efl_text_set(create_btn, "Create Popup"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _create_cb, p_data); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _create_cb, p_data); Eo *delete_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(delete_btn, "Delete Popup"); efl_gfx_entity_position_set(delete_btn, EINA_POSITION2D(150, 0)); efl_gfx_entity_size_set(delete_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(delete_btn, EFL_UI_EVENT_CLICKED, _delete_cb, p_data); + efl_event_callback_add(delete_btn, EFL_INPUT_EVENT_CLICKED, _delete_cb, p_data); Eo *repeat_event_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(repeat_event_btn, "Repeat Event Set"); efl_gfx_entity_position_set(repeat_event_btn, EINA_POSITION2D(0, 50)); efl_gfx_entity_size_set(repeat_event_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(repeat_event_btn, EFL_UI_EVENT_CLICKED, _repeat_event_cb, p_data); + efl_event_callback_add(repeat_event_btn, EFL_INPUT_EVENT_CLICKED, _repeat_event_cb, p_data); Eo *dummy_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(dummy_btn, "Show Dummy Button"); efl_gfx_entity_position_set(dummy_btn, EINA_POSITION2D(150, 50)); efl_gfx_entity_size_set(dummy_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(dummy_btn, EFL_UI_EVENT_CLICKED, _dummy_cb, p_data); + efl_event_callback_add(dummy_btn, EFL_INPUT_EVENT_CLICKED, _dummy_cb, p_data); Eo *backwall_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_gfx_entity_position_set(backwall_btn, EINA_POSITION2D(0, 100)); efl_gfx_entity_size_set(backwall_btn, EINA_SIZE2D(150, 50)); efl_text_set(backwall_btn, "Backwall Set"); - efl_event_callback_add(backwall_btn, EFL_UI_EVENT_CLICKED, _backwall_cb, p_data); + efl_event_callback_add(backwall_btn, EFL_INPUT_EVENT_CLICKED, _backwall_cb, p_data); Eo *timeout_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(timeout_btn, "Timeout Set"); efl_gfx_entity_position_set(timeout_btn, EINA_POSITION2D(150, 100)); efl_gfx_entity_size_set(timeout_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(timeout_btn, EFL_UI_EVENT_CLICKED, _timeout_set_cb, p_data); + efl_event_callback_add(timeout_btn, EFL_INPUT_EVENT_CLICKED, _timeout_set_cb, p_data); Eo *center_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(center_btn, "Center Align"); efl_gfx_entity_position_set(center_btn, EINA_POSITION2D(0, 150)); efl_gfx_entity_size_set(center_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(center_btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data); + efl_event_callback_add(center_btn, EFL_INPUT_EVENT_CLICKED, _center_align_cb, p_data); Eo *top_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(top_btn, "Top Align"); efl_gfx_entity_position_set(top_btn, EINA_POSITION2D(150, 150)); efl_gfx_entity_size_set(top_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(top_btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data); + efl_event_callback_add(top_btn, EFL_INPUT_EVENT_CLICKED, _top_align_cb, p_data); Eo *left_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(left_btn, "Left Align"); efl_gfx_entity_position_set(left_btn, EINA_POSITION2D(0, 200)); efl_gfx_entity_size_set(left_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(left_btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data); + efl_event_callback_add(left_btn, EFL_INPUT_EVENT_CLICKED, _left_align_cb, p_data); Eo *right_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(right_btn, "Right Align"); efl_gfx_entity_position_set(right_btn, EINA_POSITION2D(150, 200)); efl_gfx_entity_size_set(right_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(right_btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data); + efl_event_callback_add(right_btn, EFL_INPUT_EVENT_CLICKED, _right_align_cb, p_data); Eo *bottom_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(bottom_btn, "Bottom Align"); efl_gfx_entity_position_set(bottom_btn, EINA_POSITION2D(0, 250)); efl_gfx_entity_size_set(bottom_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(bottom_btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data); + efl_event_callback_add(bottom_btn, EFL_INPUT_EVENT_CLICKED, _bottom_align_cb, p_data); Eo *position_btn = efl_add(EFL_UI_BUTTON_CLASS, panel_win); efl_text_set(position_btn, "Position Set (x:0, y:0)"); efl_gfx_entity_position_set(position_btn, EINA_POSITION2D(150, 250)); efl_gfx_entity_size_set(position_btn, EINA_SIZE2D(150, 50)); - efl_event_callback_add(position_btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data); + efl_event_callback_add(position_btn, EFL_INPUT_EVENT_CLICKED, _position_set_cb, p_data); } static void @@ -517,31 +517,31 @@ test_ui_scroll_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_text_set(create_btn, "1. size(160,160), content(200, 200), expand(-1, -1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case1_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_scroll_case1_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "2. size(160,160), content(200, 200), expand(320, -1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 50)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case2_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_scroll_case2_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "3. size(160,160), content(200, 200), expand(-1, 320)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 100)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case3_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_scroll_case3_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "4. size(160,160), content(200, 200), expand(320, 320)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 150)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case4_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_scroll_case4_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "5. size(160,160), content(200, 200), expand(80, 80)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 200)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_scroll_case5_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_scroll_case5_cb, win); } static void @@ -900,85 +900,85 @@ test_ui_text_alert_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, v efl_text_set(create_btn, "1. size(200,200), text(short), expand(-1,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 0)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case1_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case1_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "2. size(200,200), text(long), expand(-1,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 50)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case2_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case2_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "3. size(200,200), text(short), expand(300,300)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 100)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case3_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case3_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "4. size(200,200), text(short), expand(300,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 150)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case4_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case4_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "5. size(200,200), text(short), expand(-1,300)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 200)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case5_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case5_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "6. size(200,200), text(long), expand(300,300)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 250)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case6_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case6_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "7. size(200,200), text(long), expand(300,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 300)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case7_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case7_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "8. size(200,200), text(long), expand(-1,300)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 350)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case8_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case8_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "9. size(200,200), text(long), expand(10, 10)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 400)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case9_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case9_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "10. size(200,200), text(long), expand(150,150)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 450)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case10_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case10_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "11. size(200,200), text(long), expand(150,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 500)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case11_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case11_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "12. size(200,200), text(long), expand(300,-1)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 550)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case12_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case12_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "13. size(200,200), text(long), expand(-1,150)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 600)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case13_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case13_cb, win); create_btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(create_btn, "14. size(200,200), text(long), expand(-1,300)"); efl_gfx_entity_position_set(create_btn, EINA_POSITION2D(0, 650)); efl_gfx_entity_size_set(create_btn, EINA_SIZE2D(500, 50)); - efl_event_callback_add(create_btn, EFL_UI_EVENT_CLICKED, _alert_text_case14_cb, win); + efl_event_callback_add(create_btn, EFL_INPUT_EVENT_CLICKED, _alert_text_case14_cb, win); } static void @@ -1036,7 +1036,7 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(btn, "anchor"); efl_gfx_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _anchor_set_cb, efl_ui_popup); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _anchor_set_cb, efl_ui_popup); snprintf(buf, sizeof(buf), "anchor%d", i+1); efl_content_set(efl_part(layout, buf), btn); @@ -1045,7 +1045,7 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void btn = efl_add(EFL_UI_BUTTON_CLASS, win); efl_text_set(btn, "anchor none"); efl_gfx_hint_weight_set(btn, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _anchor_unset_cb, efl_ui_popup); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _anchor_unset_cb, efl_ui_popup); efl_content_set(efl_part(layout, "anchor_none"), btn); Eo *table = efl_add(EFL_UI_TABLE_CLASS, efl_ui_popup); @@ -1054,43 +1054,43 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Center Align"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _center_align_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _center_align_cb, p_data); efl_pack_table(table, btn, 0, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Top Align"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _top_align_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _top_align_cb, p_data); efl_pack_table(table, btn, 2, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Bottom Align"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(70, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _bottom_align_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _bottom_align_cb, p_data); efl_pack_table(table, btn, 4, 0, 2, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Left Align"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _left_align_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _left_align_cb, p_data); efl_pack_table(table, btn, 0, 1, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Right Align"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _right_align_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _right_align_cb, p_data); efl_pack_table(table, btn, 3, 1, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Position Set"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _position_set_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _position_set_cb, p_data); efl_pack_table(table, btn, 0, 2, 3, 1); btn = efl_add(EFL_UI_BUTTON_CLASS, efl_ui_popup); efl_text_set(btn, "Resize"); efl_gfx_hint_size_min_set(btn, EINA_SIZE2D(100, 35)); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _popup_resize_cb, p_data); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _popup_resize_cb, p_data); efl_pack_table(table, btn, 3, 2, 3, 1); efl_content_set(efl_ui_popup, table); diff --git a/src/bin/elementary/test_ui_progressbar.c b/src/bin/elementary/test_ui_progressbar.c index 5a1c705a03..943c57404a 100644 --- a/src/bin/elementary/test_ui_progressbar.c +++ b/src/bin/elementary/test_ui_progressbar.c @@ -224,20 +224,20 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf pd->btn_start = efl_add(EFL_UI_BUTTON_CLASS, btbx, efl_text_set(efl_added, "start"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _start_btn_clicked_cb, pd), efl_pack(btbx, efl_added) ); pd->btn_stop = efl_add(EFL_UI_BUTTON_CLASS, btbx, efl_text_set(efl_added, "stop"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _stop_btn_clicked_cb, pd), efl_pack(btbx, efl_added) ); pd->btn_reset = efl_add(EFL_UI_BUTTON_CLASS, btbx, efl_text_set(efl_added, "reset"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _reset_btn_clicked_cb, pd), efl_pack(btbx, efl_added) ); diff --git a/src/bin/elementary/test_ui_radio.c b/src/bin/elementary/test_ui_radio.c index 7f72df92f7..c6cb3d2033 100644 --- a/src/bin/elementary/test_ui_radio.c +++ b/src/bin/elementary/test_ui_radio.c @@ -119,18 +119,18 @@ void test_efl_ui_radio(void *data EINA_UNUSED, o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_pack_table(table, o, 1, 0, 1, 1); efl_text_set(o, "Selected France check"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _select_btn_clicked, eina_array_data_get(arr, 2)); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _select_btn_clicked, eina_array_data_get(arr, 2)); o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_pack_table(table, o, 1, 1, 1, 1); efl_text_set(o, "Set value for Germany"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _set_selected_btn_clicked, bx); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _set_selected_btn_clicked, bx); o = efl_add(EFL_UI_BUTTON_CLASS, table); efl_pack_table(table, o, 1, 2, 1, 1); efl_text_set(o, "Set object for UK"); efl_key_data_set(o, "uk", uk); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, _set_selected_object_btn_clicked, bx); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _set_selected_object_btn_clicked, bx); eina_array_free(arr); } diff --git a/src/bin/elementary/test_ui_relative_layout.c b/src/bin/elementary/test_ui_relative_layout.c index c108dd6cf7..2632f34353 100644 --- a/src/bin/elementary/test_ui_relative_layout.c +++ b/src/bin/elementary/test_ui_relative_layout.c @@ -167,7 +167,7 @@ _setter_add(Eo *vbox, Eo *btn, Options option) efl_key_wref_set(efl_added, "to", to), efl_key_wref_set(efl_added, "btn", btn), efl_gfx_hint_weight_set(efl_added, 0, EFL_GFX_HINT_EXPAND), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_clicked_to_cb, (void *)option), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_clicked_to_cb, (void *)option), efl_pack(hbox, efl_added)); efl_add(EFL_UI_SLIDER_CLASS, hbox, @@ -308,7 +308,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_event_callback_add(efl_added, EFL_INPUT_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/bin/elementary/test_ui_scroller.c b/src/bin/elementary/test_ui_scroller.c index f3b6152b2b..a042039109 100644 --- a/src/bin/elementary/test_ui_scroller.c +++ b/src/bin/elementary/test_ui_scroller.c @@ -60,7 +60,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_text_set(efl_added, "Vertical"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } @@ -76,7 +76,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void { efl_add(EFL_UI_BUTTON_CLASS, bx2, efl_text_set(efl_added, "... Horizontal scrolling ..."), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx2, efl_added)); } @@ -86,7 +86,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_text_set(efl_added, "Vertical"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } @@ -114,7 +114,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void { efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Both"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack_table(gd2, efl_added, i, j, 1, 1)); } } @@ -125,7 +125,7 @@ test_efl_ui_scroller(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void efl_text_set(efl_added, "Vertical"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } } @@ -161,7 +161,7 @@ test_efl_ui_scroller_simple(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED efl_text_set(efl_added, "Vertical"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack(bx, efl_added)); } } @@ -197,13 +197,13 @@ test_efl_ui_scroller_simple2(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSE efl_text_set(efl_added, "Vertical"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack_table(tb, efl_added, 0, i, 1, 1)); efl_add(EFL_UI_BUTTON_CLASS, tb, efl_text_set(efl_added, "Horizontal"), efl_gfx_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0), efl_gfx_hint_fill_set(efl_added, EINA_TRUE, EINA_FALSE), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _bt_clicked, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _bt_clicked, NULL), efl_pack_table(tb, efl_added, 1, i, 1, 1)); } } diff --git a/src/bin/elementary/test_ui_spin.c b/src/bin/elementary/test_ui_spin.c index f07a42778a..01b0ff38a3 100644 --- a/src/bin/elementary/test_ui_spin.c +++ b/src/bin/elementary/test_ui_spin.c @@ -58,12 +58,12 @@ test_ui_spin(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Increse Spinner value"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _inc_clicked, sp), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _inc_clicked, sp), efl_pack(bx, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, bx, efl_text_set(efl_added, "Decrease Spinner value"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _dec_clicked, sp), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _dec_clicked, sp), efl_pack(bx, efl_added)); efl_gfx_entity_size_set(win, EINA_SIZE2D(100, 120)); diff --git a/src/bin/elementary/test_ui_spotlight.c b/src/bin/elementary/test_ui_spotlight.c index ff0cbdd6f5..428ea52066 100644 --- a/src/bin/elementary/test_ui_spotlight.c +++ b/src/bin/elementary/test_ui_spotlight.c @@ -101,7 +101,7 @@ view_add(View_Type p, Eo *parent) case BUTTON: page = efl_add(EFL_UI_BUTTON_CLASS, parent, efl_text_set(efl_added, "Button Page")); - efl_event_callback_add(page, EFL_UI_EVENT_CLICKED, page_clicked_cb, NULL); + efl_event_callback_add(page, EFL_INPUT_EVENT_CLICKED, page_clicked_cb, NULL); efl_gfx_hint_fill_set(page, EINA_TRUE, EINA_TRUE); break; @@ -370,7 +370,7 @@ spotlight_size(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -479,7 +479,7 @@ view_animation_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -508,7 +508,7 @@ pack_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -549,7 +549,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Begin"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -567,7 +567,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack End"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -585,7 +585,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Before Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -603,7 +603,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack After Current Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -621,7 +621,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, in_box1, efl_text_set(efl_added, "Pack At"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -640,7 +640,7 @@ pack_cb(void *data, pack_param->unpack_btn = btn; pack_param->type = UNPACK_AT; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param); efl_event_callback_add(btn, EFL_EVENT_DEL, pack_btn_del_cb, pack_param); @@ -674,7 +674,7 @@ pack_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Clear"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, pack_btn_cb, pack_param), efl_event_callback_add(efl_added, EFL_EVENT_DEL, pack_btn_del_cb, pack_param), @@ -695,7 +695,7 @@ active_index_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -727,7 +727,7 @@ active_index_cb(void *data, psp->spotlight = spotlight; psp->spinner = sp; - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, page_set_btn_cb, psp); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, page_set_btn_cb, psp); efl_event_callback_add(btn, EFL_EVENT_DEL, page_set_btn_del_cb, psp); } @@ -742,7 +742,7 @@ indicator_cb(void *data, btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, back_btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, @@ -752,13 +752,13 @@ indicator_cb(void *data, efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Icon Type"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_icon_btn_cb, params), efl_pack_end(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "None"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, indicator_none_btn_cb, params), efl_pack_end(box, efl_added)); } @@ -810,13 +810,13 @@ test_ui_spotlight_stack(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Prev"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, prev_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, prev_btn_cb, spotlight), efl_content_set(efl_part(layout, "prev_btn"), efl_added)); efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Next"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, next_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, next_btn_cb, spotlight), efl_content_set(efl_part(layout, "next_btn"), efl_added)); params = calloc(1, sizeof(Params)); @@ -910,13 +910,13 @@ test_ui_spotlight_plain(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Prev"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, prev_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, prev_btn_cb, spotlight), efl_content_set(efl_part(layout, "prev_btn"), efl_added)); efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Next"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, next_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, next_btn_cb, spotlight), efl_content_set(efl_part(layout, "next_btn"), efl_added)); params = calloc(1, sizeof(Params)); @@ -1011,13 +1011,13 @@ test_ui_spotlight_scroll(void *data EINA_UNUSED, efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Prev"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, prev_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, prev_btn_cb, spotlight), efl_content_set(efl_part(layout, "prev_btn"), efl_added)); efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Next"), efl_event_callback_add(efl_added, - EFL_UI_EVENT_CLICKED, next_btn_cb, spotlight), + EFL_INPUT_EVENT_CLICKED, next_btn_cb, spotlight), efl_content_set(efl_part(layout, "next_btn"), efl_added)); params = calloc(1, sizeof(Params)); diff --git a/src/bin/elementary/test_ui_stack.c b/src/bin/elementary/test_ui_stack.c index bd1c475959..854696b21c 100644 --- a/src/bin/elementary/test_ui_stack.c +++ b/src/bin/elementary/test_ui_stack.c @@ -70,7 +70,7 @@ _bar_left_btn_set(Eo *navigation_layout, Efl_Event_Cb clicked_cb, void *data) efl_text_set(left_btn, "Prev"); efl_content_set(efl_part(bn, "left_content"), left_btn); - efl_event_callback_add(left_btn, EFL_UI_EVENT_CLICKED, clicked_cb, data); + efl_event_callback_add(left_btn, EFL_INPUT_EVENT_CLICKED, clicked_cb, data); //Positions of "left_content" and "back_button" are the same. efl_gfx_entity_visible_set(efl_part(bn, "back_button"), EINA_FALSE); @@ -85,7 +85,7 @@ _bar_right_btn_set(Eo *navigation_layout, Efl_Event_Cb clicked_cb, void *data) efl_text_set(right_btn, "Next"); efl_content_set(efl_part(bn, "right_content"), right_btn); - efl_event_callback_add(right_btn, EFL_UI_EVENT_CLICKED, clicked_cb, data); + efl_event_callback_add(right_btn, EFL_INPUT_EVENT_CLICKED, clicked_cb, data); } static void @@ -95,7 +95,7 @@ _fifth_layout_insert(void *data, const Efl_Event *ev EINA_UNUSED) Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack); efl_text_set(btn, "Press to remove top layout"); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_remove, stack); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _stack_remove, stack); Eo *nl = _navigation_layout_create(stack, "5th layout", btn); @@ -109,7 +109,7 @@ _third_layout_push(void *data, const Efl_Event *ev EINA_UNUSED) Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack); efl_text_set(btn, "Press to pop"); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_pop, stack); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _stack_pop, stack); Eo *nl = _navigation_layout_create(stack, "3rd layout", btn); @@ -125,7 +125,7 @@ _second_layout_push(void *data, const Efl_Event *ev EINA_UNUSED) Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack); efl_text_set(btn, "Press to double push"); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_double_push, stack); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _stack_double_push, stack); Eo *nl = _navigation_layout_create(stack, "2nd layout", btn); @@ -139,7 +139,7 @@ _first_layout_push(Eo *win, Eo *stack) { Eo *btn = efl_add(EFL_UI_BUTTON_CLASS, stack); efl_text_set(btn, "Press to delete stack"); - efl_event_callback_add(btn, EFL_UI_EVENT_CLICKED, _stack_del, stack); + efl_event_callback_add(btn, EFL_INPUT_EVENT_CLICKED, _stack_del, stack); Eo *nl = _navigation_layout_create(stack, "1st layout", btn); diff --git a/src/bin/elementary/test_ui_tab_pager.c b/src/bin/elementary/test_ui_tab_pager.c index ab0559276e..c7180a555e 100644 --- a/src/bin/elementary/test_ui_tab_pager.c +++ b/src/bin/elementary/test_ui_tab_pager.c @@ -222,7 +222,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), @@ -238,7 +238,7 @@ _current_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Current Tab Page Set"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tab_set_btn_cb, tsd), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tab_set_btn_cb, tsd), efl_event_callback_add(efl_added, EFL_EVENT_DEL, _tab_set_btn_del_cb, tsd), efl_pack_end(box, efl_added)); } @@ -327,7 +327,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), @@ -336,25 +336,25 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) /* Pack Begin */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Begin"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_begin_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_begin_btn_cb, tab_pager), efl_pack_end(box, efl_added)); /* Pack End */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack End"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_end_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_end_btn_cb, tab_pager), efl_pack_end(box, efl_added)); /* Pack Before */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack Before Current Tab Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_before_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_before_btn_cb, tab_pager), efl_pack_end(box, efl_added)); /* Pack After */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Pack After Current Tab Page"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_after_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_after_btn_cb, tab_pager), efl_pack_end(box, efl_added)); in_box = efl_add(EFL_UI_BOX_CLASS, box, @@ -373,7 +373,7 @@ _pack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) /* Pack At */ btn = efl_add(EFL_UI_BUTTON_CLASS, in_box, efl_text_set(efl_added, "Pack At"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _pack_at_btn_cb, tsd), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _pack_at_btn_cb, tsd), efl_event_callback_add(efl_added, EFL_EVENT_DEL, _pack_at_btn_del_cb, tsd), efl_pack_end(in_box, efl_added)); } @@ -431,7 +431,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), @@ -440,20 +440,20 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) /* Clear */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Clear"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clear_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clear_btn_cb, tab_pager), efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(box, efl_added)); /* Unpack */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Unpack"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_btn_cb, tab_pager), efl_pack_end(box, efl_added)); /* Unpack All */ btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Unpack All"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_all_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_all_btn_cb, tab_pager), efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(box, efl_added)); @@ -473,7 +473,7 @@ _unpack_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) /* Unpack At */ btn = efl_add(EFL_UI_BUTTON_CLASS, in_box, efl_text_set(efl_added, "Unpack At"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _unpack_at_btn_cb, tsd), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _unpack_at_btn_cb, tsd), efl_event_callback_add(efl_added, EFL_EVENT_DEL, _unpack_at_btn_del_cb, tsd), efl_ui_widget_disabled_set(efl_added, EINA_TRUE), //Soon to be implemented efl_pack_end(in_box, efl_added)); @@ -526,7 +526,7 @@ _tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), @@ -548,7 +548,7 @@ _tab_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Change"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _change_btn_cb, tcd), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _change_btn_cb, tcd), efl_event_callback_add(efl_added, EFL_EVENT_DEL, _change_btn_del_cb, tcd), efl_pack_end(box, efl_added)); } @@ -586,7 +586,7 @@ _transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, navi, efl_text_set(efl_added, "Back"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_cb, navi)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_cb, navi)); box = efl_add(EFL_UI_BOX_CLASS, navi, efl_gfx_arrangement_content_padding_set(efl_added, 10, 10, EINA_TRUE), @@ -594,15 +594,15 @@ _transition_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Scroll"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tran_set_btn_scroll_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_set_btn_scroll_cb, tab_pager), efl_pack_end(box, efl_added)); btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Stack"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tran_set_btn_stack_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_set_btn_stack_cb, tab_pager), efl_pack_end(box, efl_added)); btn = efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Unset"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _tran_unset_btn_cb, tab_pager), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _tran_unset_btn_cb, tab_pager), efl_pack_end(box, efl_added)); } diff --git a/src/bin/elementary/test_ui_table.c b/src/bin/elementary/test_ui_table.c index 34991f6634..437c9bed2d 100644 --- a/src/bin/elementary/test_ui_table.c +++ b/src/bin/elementary/test_ui_table.c @@ -543,7 +543,7 @@ append_cb(void *data, const Efl_Event *ev EINA_UNUSED) efl_text_set(o, btn_text("appended")); efl_gfx_hint_weight_set(o, 0, 0); efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL); elm_object_tooltip_text_set(o, "Click to unpack"); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); @@ -597,7 +597,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, o = elm_button_add(win); elm_object_content_set(o, ico); elm_object_text_set(o, "Append"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, append_cb, table); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, append_cb, table); efl_pack(hbox, o); efl_gfx_entity_visible_set(o, 1); @@ -606,7 +606,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, o = elm_button_add(win); elm_object_content_set(o, ico); elm_object_text_set(o, "Clear"); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, clear_cb, table); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, clear_cb, table); efl_pack(hbox, o); efl_gfx_entity_visible_set(o, 1); @@ -657,7 +657,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_text_set(o, btn_text(NULL)); efl_gfx_hint_weight_set(o, 0, 0); efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); @@ -665,7 +665,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_text_set(o, btn_text(NULL)); efl_gfx_hint_weight_set(o, 0, 0); efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); @@ -673,7 +673,7 @@ test_ui_table_linear(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, efl_text_set(o, btn_text(NULL)); efl_gfx_hint_weight_set(o, 0, 0); efl_gfx_hint_fill_set(o, EINA_FALSE, EINA_FALSE); - efl_event_callback_add(o, EFL_UI_EVENT_CLICKED, remove_cb, NULL); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, remove_cb, NULL); efl_pack(table, o); efl_gfx_entity_visible_set(o, 1); diff --git a/src/bin/elementary/test_ui_table_static.c b/src/bin/elementary/test_ui_table_static.c index d21d6b6c7d..3e5ff789c4 100644 --- a/src/bin/elementary/test_ui_table_static.c +++ b/src/bin/elementary/test_ui_table_static.c @@ -133,7 +133,7 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void bt = elm_button_add(win); elm_object_text_set(bt, "Next API function"); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _api_bt_clicked, api); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _api_bt_clicked, api); efl_pack_table(table, bt, 30, 0, 40, 10); elm_object_disabled_set(bt, api->state == API_STATE_LAST); efl_gfx_entity_visible_set(bt, 1); @@ -162,7 +162,7 @@ test_ui_table_static(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void bt = elm_button_add(win); elm_object_text_set(bt, "Change"); efl_pack_table(table, bt, 40, 40, 20, 20); - efl_event_callback_add(bt, EFL_UI_EVENT_CLICKED, _ch_table, table); + efl_event_callback_add(bt, EFL_INPUT_EVENT_CLICKED, _ch_table, table); efl_gfx_entity_visible_set(bt, 1); rc = efl_add(EFL_CANVAS_RECTANGLE_CLASS, win); diff --git a/src/bin/elementary/test_ui_tags.c b/src/bin/elementary/test_ui_tags.c index 2ef7d6db2b..475bc68837 100644 --- a/src/bin/elementary/test_ui_tags.c +++ b/src/bin/elementary/test_ui_tags.c @@ -83,7 +83,7 @@ test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i efl_add(EFL_UI_BUTTON_CLASS, layout, efl_text_set(efl_added, "Change mode"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, tags), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _clicked, tags), elm_object_part_content_set(layout, "box", efl_added)); efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480)); diff --git a/src/bin/elementary/test_win_indicator.c b/src/bin/elementary/test_win_indicator.c index 0ebb30bf0f..aa9606f316 100644 --- a/src/bin/elementary/test_win_indicator.c +++ b/src/bin/elementary/test_win_indicator.c @@ -106,18 +106,18 @@ test_win_indicator(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *e efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Indicator Off"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _off_clicked, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _off_clicked, win), efl_pack(bx, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Bg Opaque"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _opaque_clicked, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _opaque_clicked, win), efl_pack(bx, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Bg Transparent"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _transparent_clicked, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _transparent_clicked, win), efl_pack(bx, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, win, efl_text_set(efl_added, "Hidden"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _hidden_clicked, win), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _hidden_clicked, win), efl_pack(bx, efl_added)); } diff --git a/src/examples/elementary/button_cxx_example_00.cc b/src/examples/elementary/button_cxx_example_00.cc index 2d58c7fc03..ae0a0fa44f 100644 --- a/src/examples/elementary/button_cxx_example_00.cc +++ b/src/examples/elementary/button_cxx_example_00.cc @@ -29,7 +29,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) auto cb(std::bind([wbt]() { std::cout << wbt->text_get() << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, bt, cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, bt, cb); efl::ui::Button bt2(instantiate, win); bt2.text_set("Click to quit"); @@ -39,7 +39,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) auto cb2(std::bind([wwin]() { ::efl_del(wwin->_eo_ptr()); // FIXME: No proper C++ API to delete win })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, bt2, cb2); + efl::eolian::event_add(efl::input::Clickable::clicked_event, bt2, cb2); win.size_set({320,160}); } diff --git a/src/examples/elementary/button_cxx_example_01.cc b/src/examples/elementary/button_cxx_example_01.cc index 47b1b9deb3..8623dfa111 100644 --- a/src/examples/elementary/button_cxx_example_01.cc +++ b/src/examples/elementary/button_cxx_example_01.cc @@ -67,17 +67,17 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) wright->autorepeat_gap_timeout_set(t); } }, std::placeholders::_1); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn, btn_options); efl::ui::Button btn2(instantiate, win); btn2.text_set("Initial: 1.0"); box_initial.pack_end(btn2); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn2, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn2, btn_options); efl::ui::Button btn3(instantiate, win); btn3.text_set("Initial: 5.0"); box_initial.pack_end(btn3); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn3, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn3, btn_options); efl::ui::Box box_gap(instantiate, win); box_gap.orientation_set(EFL_UI_LAYOUT_ORIENTATION_HORIZONTAL); @@ -87,17 +87,17 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl::ui::Button btn4(instantiate, win); btn4.text_set("Gap: 0.1"); box_gap.pack_end(btn4); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn4, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn4, btn_options); efl::ui::Button btn5(instantiate, win); btn5.text_set("Gap: 0.5"); box_gap.pack_end(btn5); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn5, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn5, btn_options); efl::ui::Button btn6(instantiate, win); btn6.text_set("Gap: 1.0"); box_gap.pack_end(btn6); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, btn6, btn_options); + efl::eolian::event_add(efl::input::Clickable::clicked_event, btn6, btn_options); up.autorepeat_enabled_set(true); up.autorepeat_initial_timeout_set(1.0); @@ -169,7 +169,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) icon_still = nullptr; } }); - efl::eolian::event_add(efl::ui::Clickable::unpressed_event, up, btn_cursors_release); + efl::eolian::event_add(efl::input::Clickable::unpressed_event, up, btn_cursors_release); efl::ui::Image icon_up(instantiate, win); icon_up.icon_set("arrow_up"); @@ -188,7 +188,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) left.hint_align_set(0.0, 0.5); box_inferior.pack_end(left); efl::eolian::event_add(efl::ui::Autorepeat::repeated_event, left, btn_cursors_move); - efl::eolian::event_add(efl::ui::Clickable::unpressed_event, left, btn_cursors_release); + efl::eolian::event_add(efl::input::Clickable::unpressed_event, left, btn_cursors_release); efl::ui::Image icon_left(instantiate, win); icon_left.icon_set("arrow_left"); @@ -208,7 +208,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) right.hint_align_set(0.0, 0.5); box_inferior.pack_end(right); efl::eolian::event_add(efl::ui::Autorepeat::repeated_event, right, btn_cursors_move); - efl::eolian::event_add(efl::ui::Clickable::unpressed_event, right, btn_cursors_release); + efl::eolian::event_add(efl::input::Clickable::unpressed_event, right, btn_cursors_release); efl::ui::Image icon_right(instantiate, win); icon_right.icon_set("arrow_right"); @@ -222,7 +222,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) down.hint_align_set(0.5, 0.0); box.pack_end(down); efl::eolian::event_add(efl::ui::Autorepeat::repeated_event, down, btn_cursors_move); - efl::eolian::event_add(efl::ui::Clickable::unpressed_event, down, btn_cursors_release); + efl::eolian::event_add(efl::input::Clickable::unpressed_event, down, btn_cursors_release); efl::ui::Image icon_down(instantiate, win); icon_down.icon_set("arrow_down"); diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c index a7be7937df..a778617c93 100644 --- a/src/examples/elementary/efl_ui_list_example_1.c +++ b/src/examples/elementary/efl_ui_list_example_1.c @@ -129,9 +129,9 @@ elm_main(int argc EINA_UNUSED, char **argv) efl_event_callback_add(list, EFL_UI_EVENT_ITEM_SELECTED, _list_selected, NULL); efl_event_callback_add(list, EFL_UI_EVENT_ITEM_UNSELECTED, _list_unselected, NULL); - efl_event_callback_add(list, EFL_UI_EVENT_PRESSED, _list_pressed, NULL); - efl_event_callback_add(list, EFL_UI_EVENT_UNPRESSED, _list_unpressed, NULL); - efl_event_callback_add(list, EFL_UI_EVENT_LONGPRESSED, _list_longpressed, NULL); + efl_event_callback_add(list, EFL_INPUT_EVENT_PRESSED, _list_pressed, NULL); + efl_event_callback_add(list, EFL_INPUT_EVENT_UNPRESSED, _list_unpressed, NULL); + efl_event_callback_add(list, EFL_INPUT_EVENT_LONGPRESSED, _list_longpressed, NULL); for (i = 0; i < NUM_ITEMS; i++) { @@ -299,14 +299,14 @@ elm_main(int argc EINA_UNUSED, char **argv) efl_text_set(scrl_btn, "Scroll Item"); efl_gfx_hint_align_set(scrl_btn, 0.5, 0.5); efl_gfx_hint_size_min_set(scrl_btn, EINA_SIZE2D(200, 25)); - efl_event_callback_add(scrl_btn, EFL_UI_EVENT_CLICKED, _scrl_btn_clicked, NULL); + efl_event_callback_add(scrl_btn, EFL_INPUT_EVENT_CLICKED, _scrl_btn_clicked, NULL); efl_pack_end(rbox, scrl_btn); scrl_btn = efl_add(EFL_UI_BUTTON_CLASS, rbox); efl_text_set(scrl_btn, "Scroll Item Align"); efl_gfx_hint_align_set(scrl_btn, 0.5, 0.5); efl_gfx_hint_size_min_set(scrl_btn, EINA_SIZE2D(200, 25)); - efl_event_callback_add(scrl_btn, EFL_UI_EVENT_CLICKED, _scrl_align_btn_clicked, NULL); + efl_event_callback_add(scrl_btn, EFL_INPUT_EVENT_CLICKED, _scrl_align_btn_clicked, NULL); efl_pack_end(rbox, scrl_btn); efl_pack_end(bbox, rbox); diff --git a/src/examples/elementary/efl_ui_slideshow_example.c b/src/examples/elementary/efl_ui_slideshow_example.c index 4681037b3e..55c1b66fab 100644 --- a/src/examples/elementary/efl_ui_slideshow_example.c +++ b/src/examples/elementary/efl_ui_slideshow_example.c @@ -110,7 +110,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_gfx_hint_weight_set(efl_added, 1.0, 0.0), efl_pack_table(table, efl_added, 0, 1, 1, 1), efl_text_set(efl_added, "Play"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _play_toggle, NULL)); + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _play_toggle, NULL)); efl_gfx_entity_size_set(win, EINA_SIZE2D(200, 200)); } diff --git a/src/examples/elementary/efl_ui_theme_example_01.c b/src/examples/elementary/efl_ui_theme_example_01.c index 15e1017e50..fe09a83556 100644 --- a/src/examples/elementary/efl_ui_theme_example_01.c +++ b/src/examples/elementary/efl_ui_theme_example_01.c @@ -62,7 +62,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Unload extension"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_extension_clicked_cb, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_extension_clicked_cb, NULL), efl_pack_end(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, diff --git a/src/examples/elementary/efl_ui_theme_example_02.c b/src/examples/elementary/efl_ui_theme_example_02.c index 0d0390b82c..1b7e61c96a 100644 --- a/src/examples/elementary/efl_ui_theme_example_02.c +++ b/src/examples/elementary/efl_ui_theme_example_02.c @@ -62,7 +62,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Unload overlay"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _btn_overlay_clicked_cb, NULL), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _btn_overlay_clicked_cb, NULL), efl_pack_end(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, diff --git a/src/examples/elementary/popup_cxx_example.cc b/src/examples/elementary/popup_cxx_example.cc index 6195c430c7..4d670ebce3 100644 --- a/src/examples/elementary/popup_cxx_example.cc +++ b/src/examples/elementary/popup_cxx_example.cc @@ -84,7 +84,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) auto repeat_events_test_cb(std::bind([]() { std::cout << "Repeat Test Button is clicked" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, repeat_events_test_btn, repeat_events_test_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, repeat_events_test_btn, repeat_events_test_cb); g_repeat_events_test_btn = repeat_events_test_btn; @@ -110,7 +110,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) } } })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, create_btn, create_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, create_btn, create_cb); //Delete Button @@ -128,7 +128,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) else std::cout << "Efl.Ui.Popup does not exist" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, delete_btn, delete_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, delete_btn, delete_cb); //Repeat Events Button @@ -156,7 +156,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) repeat_events_btn.text_set("Unset Repeat Events"); } })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, repeat_events_btn, repeat_events_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, repeat_events_btn, repeat_events_cb); //Dummy Button @@ -184,7 +184,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) dummy_btn.text_set("Hide Dummy Button"); } })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, dummy_btn, dummy_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, dummy_btn, dummy_cb); //Backwall Button @@ -215,7 +215,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) backwall_btn.text_set("Set Backwall"); } })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, backwall_btn, backwall_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, backwall_btn, backwall_cb); //Timeout Button @@ -230,7 +230,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.timeout_set(3); std::cout << "Timeout is set to 3 seconds" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, timeout_btn, timeout_set_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, timeout_btn, timeout_set_cb); //Center Button @@ -245,7 +245,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.align_set(EFL_UI_POPUP_ALIGN_CENTER); std::cout << "Align Center" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, center_btn, center_align_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, center_btn, center_align_cb); //Top Button @@ -260,7 +260,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.align_set(EFL_UI_POPUP_ALIGN_TOP); std::cout << "Align Top" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, top_btn, top_align_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, top_btn, top_align_cb); //Left Button @@ -275,7 +275,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.align_set(EFL_UI_POPUP_ALIGN_LEFT); std::cout << "Align Left" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, left_btn, left_align_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, left_btn, left_align_cb); //Right Button @@ -290,7 +290,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.align_set(EFL_UI_POPUP_ALIGN_RIGHT); std::cout << "Align Right" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, right_btn, right_align_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, right_btn, right_align_cb); //Bottom Button @@ -305,7 +305,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.align_set(EFL_UI_POPUP_ALIGN_BOTTOM); std::cout << "Align Bottom" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, bottom_btn, bottom_align_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, bottom_btn, bottom_align_cb); //Position Button @@ -320,6 +320,6 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) g_popup.position_set({0, 0}); std::cout << "Position is set to (0, 0)" << std::endl; })); - efl::eolian::event_add(efl::ui::Clickable::clicked_event, position_btn, position_set_cb); + efl::eolian::event_add(efl::input::Clickable::clicked_event, position_btn, position_set_cb); } EFL_MAIN() diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index e390b89efe..8ccc063dea 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -246,7 +246,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include -# include # include # include # include diff --git a/src/lib/elementary/Elementary.h b/src/lib/elementary/Elementary.h index bdc128a2b8..1e273b3d95 100644 --- a/src/lib/elementary/Elementary.h +++ b/src/lib/elementary/Elementary.h @@ -169,7 +169,6 @@ typedef Eo Efl_Ui_Focus_Manager; #ifdef EFL_BETA_API_SUPPORT # include # include -#include #endif #include diff --git a/src/lib/elementary/efl_ui_alert_popup.c b/src/lib/elementary/efl_ui_alert_popup.c index e7eac4a955..b80e6e6388 100644 --- a/src/lib/elementary/efl_ui_alert_popup.c +++ b/src/lib/elementary/efl_ui_alert_popup.c @@ -154,15 +154,15 @@ _efl_ui_alert_popup_button_set(Eo *obj, Efl_Ui_Alert_Popup_Data *pd, Efl_Ui_Aler switch (type) { case EFL_UI_ALERT_POPUP_BUTTON_POSITIVE: - efl_event_callback_add(pd->button[type], EFL_UI_EVENT_CLICKED, + efl_event_callback_add(pd->button[type], EFL_INPUT_EVENT_CLICKED, _positive_button_clicked_cb, obj); break; case EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE: - efl_event_callback_add(pd->button[type], EFL_UI_EVENT_CLICKED, + efl_event_callback_add(pd->button[type], EFL_INPUT_EVENT_CLICKED, _negative_button_clicked_cb, obj); break; case EFL_UI_ALERT_POPUP_BUTTON_USER: - efl_event_callback_add(pd->button[type], EFL_UI_EVENT_CLICKED, + efl_event_callback_add(pd->button[type], EFL_INPUT_EVENT_CLICKED, _user_button_clicked_cb, obj); break; default: diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c index 6694a91f4a..834e00f43d 100644 --- a/src/lib/elementary/efl_ui_button.c +++ b/src/lib/elementary/efl_ui_button.c @@ -6,7 +6,7 @@ #define EFL_ACCESS_OBJECT_PROTECTED #define ELM_LAYOUT_PROTECTED #define EFL_PART_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include #include "elm_priv.h" @@ -77,8 +77,8 @@ _activate(Evas_Object *obj) evas_object_smart_callback_call(obj, "clicked", NULL); else { - efl_ui_clickable_press(obj, 1); - efl_ui_clickable_unpress(obj, 1); + efl_input_clickable_press(obj, 1); + efl_input_clickable_unpress(obj, 1); } } } @@ -107,8 +107,8 @@ _efl_ui_button_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Button_Data *_pd evas_object_smart_callback_call(obj, "clicked", NULL); else { - efl_ui_clickable_press(obj, 1); - efl_ui_clickable_unpress(obj, 1); + efl_input_clickable_press(obj, 1); + efl_input_clickable_unpress(obj, 1); } if (elm_widget_is_legacy(obj)) diff --git a/src/lib/elementary/efl_ui_button.eo b/src/lib/elementary/efl_ui_button.eo index 449d501276..794ed9b04a 100644 --- a/src/lib/elementary/efl_ui_button.eo +++ b/src/lib/elementary/efl_ui_button.eo @@ -1,4 +1,4 @@ -class Efl.Ui.Button extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Ui.Autorepeat, +class Efl.Ui.Button extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, Efl.Ui.Autorepeat, Efl.Text, Efl.Content, Efl.Access.Widget.Action { diff --git a/src/lib/elementary/efl_ui_calendar.c b/src/lib/elementary/efl_ui_calendar.c index 7fb174273f..d905324c82 100644 --- a/src/lib/elementary/efl_ui_calendar.c +++ b/src/lib/elementary/efl_ui_calendar.c @@ -441,7 +441,7 @@ _btn_create(Eo *obj, const char *style, char *part) efl_ui_autorepeat_enabled_set(efl_added, EINA_TRUE), efl_ui_autorepeat_initial_timeout_set(efl_added, FIRST_INTERVAL), efl_ui_autorepeat_gap_timeout_set(efl_added, INTERVAL), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _inc_dec_btn_clicked_cb, obj), efl_event_callback_add(efl_added, EFL_UI_AUTOREPEAT_EVENT_REPEATED, _inc_dec_btn_repeated_cb, obj), diff --git a/src/lib/elementary/efl_ui_clickable_util.c b/src/lib/elementary/efl_ui_clickable_util.c index 3243b725bb..50251c48fd 100644 --- a/src/lib/elementary/efl_ui_clickable_util.c +++ b/src/lib/elementary/efl_ui_clickable_util.c @@ -2,7 +2,7 @@ # include #endif -#define EFL_UI_CLICKABLE_PROTECTED 1 +#define EFL_INPUT_CLICKABLE_PROTECTED 1 #include #include "elm_priv.h" @@ -17,7 +17,7 @@ _on_press_cb(void *data, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) { - efl_ui_clickable_press(data, 1); + efl_input_clickable_press(data, 1); } static void @@ -26,7 +26,7 @@ _on_unpress_cb(void *data, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) { - efl_ui_clickable_unpress(data, 1); + efl_input_clickable_unpress(data, 1); } static void @@ -35,7 +35,7 @@ _on_mouse_out(void *data, const char *emission EINA_UNUSED, const char *source EINA_UNUSED) { - efl_ui_clickable_button_state_reset(data, 1); + efl_input_clickable_button_state_reset(data, 1); } static void @@ -44,7 +44,7 @@ _theme_move_cb(void *data, const Efl_Event *ev EINA_UNUSED) Efl_Input_Pointer *pointer = ev->info; if (efl_input_processed_get(pointer)) - efl_ui_clickable_button_state_reset(data, 1); + efl_input_clickable_button_state_reset(data, 1); } EFL_CALLBACKS_ARRAY_DEFINE(bind_to_theme_callbacks, @@ -52,7 +52,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(bind_to_theme_callbacks, ) EOLIAN static void -_efl_ui_clickable_util_bind_to_theme(Efl_Canvas_Layout *object, Efl_Ui_Clickable *clickable) +_efl_ui_clickable_util_bind_to_theme(Efl_Canvas_Layout *object, Efl_Input_Clickable *clickable) { efl_event_callback_array_add(object, bind_to_theme_callbacks(), clickable); @@ -67,7 +67,7 @@ _press_cb(void *data, const Efl_Event *ev) Efl_Input_Pointer *pointer = ev->info; if (!efl_input_processed_get(pointer)) { - efl_ui_clickable_press(data, 1); + efl_input_clickable_press(data, 1); efl_input_processed_set(pointer, EINA_TRUE); } } @@ -80,21 +80,21 @@ _unpress_cb(void *data, const Efl_Event *ev EINA_UNUSED) Eina_Rect geom = efl_gfx_entity_geometry_get(data); if (efl_input_processed_get(pointer)) { - efl_ui_clickable_button_state_reset(data, 1); + efl_input_clickable_button_state_reset(data, 1); } else if (!eina_rectangle_coords_inside(&geom.rect, mouse_pos.x, mouse_pos.y)) { //we are emulating edje behavior here, do press unpress on the event, but not click - efl_ui_clickable_button_state_reset(data, 1); + efl_input_clickable_button_state_reset(data, 1); if (efl_canvas_object_pointer_mode_get(data) == EFL_INPUT_OBJECT_POINTER_MODE_AUTO_GRAB) { - efl_ui_clickable_unpress(data, 1); + efl_input_clickable_unpress(data, 1); efl_input_processed_set(pointer, EINA_TRUE); } } else { - efl_ui_clickable_unpress(data, 1); + efl_input_clickable_unpress(data, 1); efl_input_processed_set(pointer, EINA_TRUE); } } @@ -105,7 +105,7 @@ EFL_CALLBACKS_ARRAY_DEFINE(bind_to_object_callbacks, ) EOLIAN static void -_efl_ui_clickable_util_bind_to_object(Efl_Input_Interface *object, Efl_Ui_Clickable *clickable) +_efl_ui_clickable_util_bind_to_object(Efl_Input_Interface *object, Efl_Input_Clickable *clickable) { efl_event_callback_array_add(object, bind_to_object_callbacks(), clickable); } diff --git a/src/lib/elementary/efl_ui_clickable_util.eo b/src/lib/elementary/efl_ui_clickable_util.eo index d086c24581..5db5e67a5c 100644 --- a/src/lib/elementary/efl_ui_clickable_util.eo +++ b/src/lib/elementary/efl_ui_clickable_util.eo @@ -1,12 +1,12 @@ class @beta Efl.Ui.Clickable_Util { - [[Helper class that connects theme signals or object events to the @Efl.Ui.Clickable interface. + [[Helper class that connects theme signals or object events to the @Efl.Input.Clickable interface. - This simplifies creating widgets that implement the @Efl.Ui.Clickable interface. + This simplifies creating widgets that implement the @Efl.Input.Clickable interface. ]] methods { bind_to_theme @class { [[This will listen to the standard "click" events on a theme and emit the appropriate - events through the @Efl.Ui.Clickable interface. + events through the @Efl.Input.Clickable interface. Using these methods widgets do not need to listen to the theme signals. This class does it and calls the correct clickable functions. @@ -16,12 +16,12 @@ class @beta Efl.Ui.Clickable_Util { ]] params { object : Efl.Canvas.Layout; [[The object to listen on.]] - clickable : Efl.Ui.Clickable; [[The object to call the clickable methods on.]] + clickable : Efl.Input.Clickable; [[The object to call the clickable methods on.]] } } bind_to_object @class { [[This will listen to the standard "click" events on an object, and emit the appropriate - events through the @Efl.Ui.Clickable interface. + events through the @Efl.Input.Clickable interface. Using these methods widgets do not need to listen to the object events. This class does it and calls the correct clickable functions. @@ -30,7 +30,7 @@ class @beta Efl.Ui.Clickable_Util { ]] params { object : Efl.Input.Interface; [[The object to listen on.]] - clickable : Efl.Ui.Clickable; [[The object to call the clickable methods on.]] + clickable : Efl.Input.Clickable; [[The object to call the clickable methods on.]] } } } diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index 564bb108e0..b12712b139 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -517,11 +517,11 @@ _redirect_cb(void *data, const Efl_Event *ev) #define REDIRECT_EVT(item_evt, item) \ if (item_evt == ev->desc) efl_event_callback_call(obj, item, ev->object); - REDIRECT_EVT(EFL_UI_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED); - REDIRECT_EVT(EFL_UI_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED); - REDIRECT_EVT(EFL_UI_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED); - REDIRECT_EVT(EFL_UI_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY); - REDIRECT_EVT(EFL_UI_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED); + REDIRECT_EVT(EFL_INPUT_EVENT_PRESSED, EFL_UI_EVENT_ITEM_PRESSED); + REDIRECT_EVT(EFL_INPUT_EVENT_UNPRESSED, EFL_UI_EVENT_ITEM_UNPRESSED); + REDIRECT_EVT(EFL_INPUT_EVENT_LONGPRESSED, EFL_UI_EVENT_ITEM_LONGPRESSED); + REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED_ANY, EFL_UI_EVENT_ITEM_CLICKED_ANY); + REDIRECT_EVT(EFL_INPUT_EVENT_CLICKED, EFL_UI_EVENT_ITEM_CLICKED); #undef REDIRECT_EVT } @@ -529,11 +529,11 @@ EFL_CALLBACKS_ARRAY_DEFINE(active_item, {EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _hints_changed_cb}, {EFL_UI_EVENT_ITEM_SELECTED, _selected_cb}, {EFL_UI_EVENT_ITEM_UNSELECTED, _unselected_cb}, - {EFL_UI_EVENT_PRESSED, _redirect_cb}, - {EFL_UI_EVENT_UNPRESSED, _redirect_cb}, - {EFL_UI_EVENT_LONGPRESSED, _redirect_cb}, - {EFL_UI_EVENT_CLICKED, _redirect_cb}, - {EFL_UI_EVENT_CLICKED_ANY, _redirect_cb}, + {EFL_INPUT_EVENT_PRESSED, _redirect_cb}, + {EFL_INPUT_EVENT_UNPRESSED, _redirect_cb}, + {EFL_INPUT_EVENT_LONGPRESSED, _redirect_cb}, + {EFL_INPUT_EVENT_CLICKED, _redirect_cb}, + {EFL_INPUT_EVENT_CLICKED_ANY, _redirect_cb}, {EFL_EVENT_INVALIDATE, _invalidate_cb}, ) diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c index fd9420d6b7..a47a8669dd 100644 --- a/src/lib/elementary/efl_ui_frame.c +++ b/src/lib/elementary/efl_ui_frame.c @@ -5,7 +5,7 @@ #define EFL_ACCESS_OBJECT_PROTECTED #define ELM_LAYOUT_PROTECTED #define EFL_PART_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include #include "elm_priv.h" @@ -148,7 +148,7 @@ _efl_ui_frame_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Frame_Data *_pd EINA_UN (wd->resize_obj, "efl,anim,done", "efl", _on_recalc_done, obj); efl_ui_clickable_util_bind_to_theme(wd->resize_obj, obj); - efl_event_callback_add(obj, EFL_UI_EVENT_CLICKED, _clicked_cb, obj); + efl_event_callback_add(obj, EFL_INPUT_EVENT_CLICKED, _clicked_cb, obj); } elm_widget_can_focus_set(obj, EINA_FALSE); diff --git a/src/lib/elementary/efl_ui_frame.eo b/src/lib/elementary/efl_ui_frame.eo index 509bd02df0..31849f95d7 100644 --- a/src/lib/elementary/efl_ui_frame.eo +++ b/src/lib/elementary/efl_ui_frame.eo @@ -1,4 +1,4 @@ -class @beta Efl.Ui.Frame extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, Efl.Text, Efl.Text_Markup, +class @beta Efl.Ui.Frame extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, Efl.Text, Efl.Text_Markup, Efl.Content { [[Frame widget diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c index dea9ec1b00..4f79fb0c2d 100644 --- a/src/lib/elementary/efl_ui_image.c +++ b/src/lib/elementary/efl_ui_image.c @@ -7,7 +7,7 @@ #define EFL_ACCESS_COMPONENT_PROTECTED #define EFL_ACCESS_WIDGET_ACTION_PROTECTED #define EFL_LAYOUT_CALC_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include @@ -747,7 +747,7 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED) if (elm_widget_is_legacy(obj)) evas_object_smart_callback_call(obj, "clicked", NULL); else - efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL); + efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL); return EINA_TRUE; } diff --git a/src/lib/elementary/efl_ui_image.eo b/src/lib/elementary/efl_ui_image.eo index 728a6c4cb0..f756d179bd 100644 --- a/src/lib/elementary/efl_ui_image.eo +++ b/src/lib/elementary/efl_ui_image.eo @@ -16,7 +16,7 @@ struct @beta Efl.Ui.Image_Error open_error: bool; [[$true if the error happened when opening the file, $false otherwise]] } -class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Ui.Clickable, Efl.Ui.Draggable, +class @beta Efl.Ui.Image extends Efl.Ui.Widget implements Efl.Input.Clickable, Efl.Ui.Draggable, Efl.File, Efl.Gfx.Image, Efl.Gfx.Image_Load_Controller, Efl.Player, Efl.Gfx.View, Efl.Access.Component, Efl.Access.Widget.Action, Efl.Gfx.Color, Efl.Gfx.Image_Orientable, diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c index 9d834afad2..bc64ecb9eb 100644 --- a/src/lib/elementary/efl_ui_image_zoomable.c +++ b/src/lib/elementary/efl_ui_image_zoomable.c @@ -6,7 +6,7 @@ #define EFL_ACCESS_WIDGET_ACTION_PROTECTED #define EFL_UI_SCROLL_MANAGER_PROTECTED #define EFL_UI_SCROLLBAR_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index 432486bd69..5119568773 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -175,7 +175,7 @@ _item_longpressed(void *data) pd->longpress_timer = NULL; - efl_event_callback_call(item, EFL_UI_EVENT_LONGPRESSED, NULL); + efl_event_callback_call(item, EFL_INPUT_EVENT_LONGPRESSED, NULL); return ECORE_CALLBACK_CANCEL; } @@ -195,7 +195,7 @@ _item_mouse_down(void *data, edje_object_signal_emit(wd->resize_obj, "efl,state,pressed", "efl"); pd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _item_longpressed, item); - efl_event_callback_call(item, EFL_UI_EVENT_PRESSED, NULL); + efl_event_callback_call(item, EFL_INPUT_EVENT_PRESSED, NULL); } static void @@ -217,7 +217,7 @@ _item_mouse_up(void *data, { //FIXME: should we send this message to fallback? edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); - //efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL); + //efl_event_callback_call(item, EFL_INPUT_EVENT_UNPRESSED, NULL); return; } @@ -228,7 +228,7 @@ _item_mouse_up(void *data, } edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); - efl_event_callback_call(item, EFL_UI_EVENT_UNPRESSED, NULL); + efl_event_callback_call(item, EFL_INPUT_EVENT_UNPRESSED, NULL); m = efl_ui_select_mode_get(efl_ui_item_container_get(item)); if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo index 9ece7e4c0c..a97ec30568 100644 --- a/src/lib/elementary/efl_ui_item.eo +++ b/src/lib/elementary/efl_ui_item.eo @@ -1,4 +1,4 @@ -abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Ui.Clickable +abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Input.Clickable { [[Item abstract class for pack widget. All item have to be inherited from this class.]] methods { diff --git a/src/lib/elementary/efl_ui_navigation_bar.c b/src/lib/elementary/efl_ui_navigation_bar.c index 6c1de6773a..039b7f563f 100644 --- a/src/lib/elementary/efl_ui_navigation_bar.c +++ b/src/lib/elementary/efl_ui_navigation_bar.c @@ -48,7 +48,7 @@ _efl_ui_navigation_bar_efl_object_constructor(Eo *obj, Efl_Ui_Navigation_Bar_Dat Eo *back_button = efl_add(EFL_UI_BUTTON_CLASS, obj, elm_widget_element_update(obj, efl_added, "back_button"), - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, obj), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _back_button_clicked_cb, obj), efl_gfx_entity_visible_set(efl_added, EINA_FALSE)); pd->back_button = back_button; @@ -182,7 +182,7 @@ _efl_ui_navigation_bar_part_back_button_efl_content_content_set(Eo *obj, void *_ if (content == ppd->back_button) return EINA_FALSE; - efl_event_callback_add(content, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, pd->obj); + efl_event_callback_add(content, EFL_INPUT_EVENT_CLICKED, _back_button_clicked_cb, pd->obj); ppd->back_button = content; return _efl_ui_navigation_bar_content_set(pd->obj, ppd, pd->part, content); @@ -203,7 +203,7 @@ _efl_ui_navigation_bar_part_back_button_efl_content_content_unset(Eo *obj, void Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); EFL_UI_NAVIGATION_BAR_DATA_GET_OR_RETURN(pd->obj, ppd, NULL); - efl_event_callback_del(ppd->back_button, EFL_UI_EVENT_CLICKED, _back_button_clicked_cb, pd->obj); + efl_event_callback_del(ppd->back_button, EFL_INPUT_EVENT_CLICKED, _back_button_clicked_cb, pd->obj); ppd->back_button = NULL; return _efl_ui_navigation_bar_content_unset(pd->obj, ppd, pd->part); diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c index 7069e3edb5..e14d3de505 100644 --- a/src/lib/elementary/efl_ui_panes.c +++ b/src/lib/elementary/efl_ui_panes.c @@ -6,7 +6,7 @@ #define ELM_LAYOUT_PROTECTED #define EFL_GFX_HINT_PROTECTED #define EFL_PART_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include @@ -184,7 +184,7 @@ _on_pressed(void *data, const char *source EINA_UNUSED) { efl_event_callback_legacy_call(data, ELM_PANES_EVENT_PRESS, NULL); - efl_ui_clickable_press(data, 1); + efl_input_clickable_press(data, 1); } static void @@ -195,7 +195,7 @@ _on_unpressed(void *data, { EFL_UI_PANES_DATA_GET(data, sd); efl_event_callback_legacy_call(data, ELM_PANES_EVENT_UNPRESS, NULL); - efl_ui_clickable_unpress(data, 1); + efl_input_clickable_unpress(data, 1); if (sd->double_clicked) { evas_object_smart_callback_call(data, "clicked,double", NULL); diff --git a/src/lib/elementary/efl_ui_panes.eo b/src/lib/elementary/efl_ui_panes.eo index a9c2bbd089..5b5029a67f 100644 --- a/src/lib/elementary/efl_ui_panes.eo +++ b/src/lib/elementary/efl_ui_panes.eo @@ -1,5 +1,5 @@ class @beta Efl.Ui.Panes extends Efl.Ui.Layout_Base implements Efl.Ui.Layout_Orientable, - Efl.Ui.Clickable + Efl.Input.Clickable { [[Elementary panes class]] event_prefix: elm_panes; diff --git a/src/lib/elementary/efl_ui_spin_button.c b/src/lib/elementary/efl_ui_spin_button.c index 6974428dc4..13b3c2ddf2 100644 --- a/src/lib/elementary/efl_ui_spin_button.c +++ b/src/lib/elementary/efl_ui_spin_button.c @@ -41,7 +41,7 @@ static void _access_increment_decrement_info_say(Evas_Object *obj, Eina_Bool is_incremented); EFL_CALLBACKS_ARRAY_DEFINE(_inc_dec_button_cb, - { EFL_UI_EVENT_CLICKED, _inc_dec_button_clicked_cb}, + { EFL_INPUT_EVENT_CLICKED, _inc_dec_button_clicked_cb}, { EFL_UI_AUTOREPEAT_EVENT_REPEATED, _inc_dec_button_clicked_cb}, ); diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c index 34bc487355..97393c8d47 100644 --- a/src/lib/elementary/efl_ui_tags.c +++ b/src/lib/elementary/efl_ui_tags.c @@ -28,7 +28,7 @@ static void _entry_clicked_cb(void *data, const Efl_Event *event); EFL_CALLBACKS_ARRAY_DEFINE(_tags_cb, { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb }, { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb }, - { EFL_UI_EVENT_CLICKED, _entry_clicked_cb } + { EFL_INPUT_EVENT_CLICKED, _entry_clicked_cb } ); static void @@ -489,7 +489,7 @@ _mouse_clicked_signal_cb(void *data EINA_UNUSED, if (sd->editable) efl_ui_text_input_panel_show(sd->entry); - efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL); + efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL); } static void diff --git a/src/lib/elementary/efl_ui_text.c b/src/lib/elementary/efl_ui_text.c index 3201c8875e..419fd84434 100644 --- a/src/lib/elementary/efl_ui_text.c +++ b/src/lib/elementary/efl_ui_text.c @@ -7,7 +7,7 @@ #define EFL_ACCESS_EDITABLE_TEXT_PROTECTED #define ELM_LAYOUT_PROTECTED #define EFL_PART_PROTECTED -#define EFL_UI_CLICKABLE_PROTECTED +#define EFL_INPUT_CLICKABLE_PROTECTED #include #include @@ -2118,7 +2118,7 @@ _efl_ui_text_efl_object_constructor(Eo *obj, Efl_Ui_Text_Data *sd) if (!elm_widget_theme_klass_get(obj)) elm_widget_theme_klass_set(obj, "text"); obj = efl_constructor(efl_super(obj, MY_CLASS)); - efl_event_callback_add(obj, EFL_UI_EVENT_LONGPRESSED, _long_press_cb, obj); + efl_event_callback_add(obj, EFL_INPUT_EVENT_LONGPRESSED, _long_press_cb, obj); text_obj = efl_add(EFL_UI_INTERNAL_TEXT_INTERACTIVE_CLASS, obj); efl_event_callback_forwarder_add(text_obj, EFL_UI_TEXT_EVENT_CHANGED_USER, obj); @@ -2822,7 +2822,7 @@ _efl_ui_text_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Text_Data *_pd EIN if (!elm_widget_disabled_get(obj) && !evas_object_freeze_events_get(obj)) { - efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL); + efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, NULL); if (sd->editable && sd->input_panel_enable) edje_object_part_text_input_panel_show(sd->entry_edje, "efl.text"); } diff --git a/src/lib/elementary/efl_ui_text.eo b/src/lib/elementary/efl_ui_text.eo index d34b2822d2..a0a1807942 100644 --- a/src/lib/elementary/efl_ui_text.eo +++ b/src/lib/elementary/efl_ui_text.eo @@ -1,7 +1,7 @@ /* FIXME - Text object must stop using elm_general! */ import elm_general; -class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Ui.Clickable, +class @beta Efl.Ui.Text extends Efl.Ui.Layout_Base implements Efl.Input.Clickable, Efl.Access.Text, Efl.Access.Editable.Text, Efl.File, Efl.Ui.Selectable, Efl.Text_Interactive, Efl.Text_Markup { diff --git a/src/lib/elementary/efl_ui_timepicker.c b/src/lib/elementary/efl_ui_timepicker.c index 59ef13d3f1..6d568bcef8 100644 --- a/src/lib/elementary/efl_ui_timepicker.c +++ b/src/lib/elementary/efl_ui_timepicker.c @@ -136,7 +136,7 @@ _fields_init(Eo *obj) efl_event_callback_add(efl_added, EFL_UI_SPIN_EVENT_CHANGED,_field_changed_cb, obj)); pd->ampm = efl_add(EFL_UI_BUTTON_CLASS, obj, - efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _field_changed_cb, obj), + efl_event_callback_add(efl_added, EFL_INPUT_EVENT_CLICKED, _field_changed_cb, obj), elm_widget_element_update(obj, efl_added, "button")); pd->dt_manager = efl_add(EFL_DATETIME_MANAGER_CLASS, obj); diff --git a/src/lib/elementary/elc_multibuttonentry.c b/src/lib/elementary/elc_multibuttonentry.c index 3c7e26c216..9bcb64514e 100644 --- a/src/lib/elementary/elc_multibuttonentry.c +++ b/src/lib/elementary/elc_multibuttonentry.c @@ -67,7 +67,7 @@ static void _entry_clicked_cb(void *data, const Efl_Event *event); EFL_CALLBACKS_ARRAY_DEFINE(_multi_buttonentry_cb, { ELM_ENTRY_EVENT_CHANGED, _entry_changed_cb }, { EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED , _entry_focus_changed_cb }, - { EFL_UI_EVENT_CLICKED, _entry_clicked_cb } + { EFL_INPUT_EVENT_CLICKED, _entry_clicked_cb } ); EOLIAN static void diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c index e2be2f5464..862edec01c 100644 --- a/src/lib/elementary/elc_naviframe.c +++ b/src/lib/elementary/elc_naviframe.c @@ -1499,7 +1499,7 @@ _key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED) ///Leave for compatibility. ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it); if (it->title_prev_btn) - efl_event_callback_legacy_call(it->title_prev_btn, EFL_UI_EVENT_CLICKED, NULL); + efl_event_callback_legacy_call(it->title_prev_btn, EFL_INPUT_EVENT_CLICKED, NULL); return EINA_TRUE; } diff --git a/src/lib/elementary/elm_bubble_eo.c b/src/lib/elementary/elm_bubble_eo.c index 4f6ee165a3..24780aacf0 100644 --- a/src/lib/elementary/elm_bubble_eo.c +++ b/src/lib/elementary/elm_bubble_eo.c @@ -50,6 +50,6 @@ static const Efl_Class_Description _elm_bubble_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_bubble_class_get, &_elm_bubble_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_bubble_class_get, &_elm_bubble_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_bubble_eo.legacy.c" diff --git a/src/lib/elementary/elm_calendar.c b/src/lib/elementary/elm_calendar.c index b249fd44fe..74619d4a65 100644 --- a/src/lib/elementary/elm_calendar.c +++ b/src/lib/elementary/elm_calendar.c @@ -74,9 +74,9 @@ static void _inc_dec_button_unpressed_cb(void *data, const Efl_Event *event EINA_UNUSED); EFL_CALLBACKS_ARRAY_DEFINE( _inc_dec_button_cb, - { EFL_UI_EVENT_CLICKED, _inc_dec_button_clicked_cb}, - { EFL_UI_EVENT_PRESSED, _inc_dec_button_pressed_cb}, - { EFL_UI_EVENT_UNPRESSED, _inc_dec_button_unpressed_cb} + { EFL_INPUT_EVENT_CLICKED, _inc_dec_button_clicked_cb}, + { EFL_INPUT_EVENT_PRESSED, _inc_dec_button_pressed_cb}, + { EFL_INPUT_EVENT_UNPRESSED, _inc_dec_button_unpressed_cb} ); static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params); diff --git a/src/lib/elementary/elm_color_class.c b/src/lib/elementary/elm_color_class.c index cd85f52175..962e16f178 100644 --- a/src/lib/elementary/elm_color_class.c +++ b/src/lib/elementary/elm_color_class.c @@ -750,7 +750,7 @@ elm_color_class_editor_add(Evas_Object *obj) elm_object_text_set(bt, "Reset"); elm_object_part_content_set(ly, "elm.swallow.reset", bt); efl_event_callback_add - (bt, EFL_UI_EVENT_CLICKED, _colorclass_reset, cc); + (bt, EFL_INPUT_EVENT_CLICKED, _colorclass_reset, cc); cc->cs = cs = elm_colorselector_add(ly); elm_colorselector_mode_set(cs, ELM_COLORSELECTOR_COMPONENTS); diff --git a/src/lib/elementary/elm_colorselector.c b/src/lib/elementary/elm_colorselector.c index 2ca5b09c5d..5b40c537cd 100644 --- a/src/lib/elementary/elm_colorselector.c +++ b/src/lib/elementary/elm_colorselector.c @@ -1287,7 +1287,7 @@ _color_bars_add(Evas_Object *obj) edje_object_part_swallow (sd->cb_data[i]->colorbar, "elm.l_button", sd->cb_data[i]->lbt); efl_event_callback_add - (sd->cb_data[i]->lbt, EFL_UI_EVENT_CLICKED, _button_clicked_cb, sd->cb_data[i]); + (sd->cb_data[i]->lbt, EFL_INPUT_EVENT_CLICKED, _button_clicked_cb, sd->cb_data[i]); elm_button_autorepeat_set(sd->cb_data[i]->lbt, EINA_TRUE); elm_button_autorepeat_initial_timeout_set (sd->cb_data[i]->lbt, _elm_config->longpress_timeout); @@ -1305,7 +1305,7 @@ _color_bars_add(Evas_Object *obj) edje_object_part_swallow (sd->cb_data[i]->colorbar, "elm.r_button", sd->cb_data[i]->rbt); efl_event_callback_add - (sd->cb_data[i]->rbt, EFL_UI_EVENT_CLICKED, _button_clicked_cb, sd->cb_data[i]); + (sd->cb_data[i]->rbt, EFL_INPUT_EVENT_CLICKED, _button_clicked_cb, sd->cb_data[i]); elm_button_autorepeat_set(sd->cb_data[i]->rbt, EINA_TRUE); elm_button_autorepeat_initial_timeout_set (sd->cb_data[i]->rbt, _elm_config->longpress_timeout); diff --git a/src/lib/elementary/elm_colorselector_eo.c b/src/lib/elementary/elm_colorselector_eo.c index b6b288a8cf..c7ce07fc82 100644 --- a/src/lib/elementary/elm_colorselector_eo.c +++ b/src/lib/elementary/elm_colorselector_eo.c @@ -146,6 +146,6 @@ static const Efl_Class_Description _elm_colorselector_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_colorselector_class_get, &_elm_colorselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_colorselector_class_get, &_elm_colorselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_colorselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_diskselector_eo.c b/src/lib/elementary/elm_diskselector_eo.c index d533a106eb..d4158c4e94 100644 --- a/src/lib/elementary/elm_diskselector_eo.c +++ b/src/lib/elementary/elm_diskselector_eo.c @@ -222,6 +222,6 @@ static const Efl_Class_Description _elm_diskselector_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_diskselector_class_get, &_elm_diskselector_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SCROLLABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_diskselector_class_get, &_elm_diskselector_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SCROLLABLE_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_diskselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_entry.c b/src/lib/elementary/elm_entry.c index ad627a0dc7..22dcaff458 100644 --- a/src/lib/elementary/elm_entry.c +++ b/src/lib/elementary/elm_entry.c @@ -2665,7 +2665,7 @@ _entry_hover_anchor_clicked_do(Evas_Object *obj, efl_event_callback_legacy_call(obj, ELM_ENTRY_EVENT_ANCHOR_HOVER_OPENED, &ei); efl_event_callback_add - (sd->anchor_hover.hover, EFL_UI_EVENT_CLICKED, _anchor_hover_clicked_cb, obj); + (sd->anchor_hover.hover, EFL_INPUT_EVENT_CLICKED, _anchor_hover_clicked_cb, obj); /* FIXME: Should just check if there's any callback registered to * the smart events instead. This is used to determine if anyone diff --git a/src/lib/elementary/elm_entry_eo.c b/src/lib/elementary/elm_entry_eo.c index 110de558bc..397a6b4ea7 100644 --- a/src/lib/elementary/elm_entry_eo.c +++ b/src/lib/elementary/elm_entry_eo.c @@ -1188,6 +1188,6 @@ static const Efl_Class_Description _elm_entry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_entry_class_get, &_elm_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_TEXT_INTERFACE, EFL_ACCESS_EDITABLE_TEXT_INTERFACE, EFL_FILE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_entry_class_get, &_elm_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_TEXT_INTERFACE, EFL_ACCESS_EDITABLE_TEXT_INTERFACE, EFL_FILE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_SCROLLABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_entry_eo.legacy.c" diff --git a/src/lib/elementary/elm_fileselector_entry_eo.c b/src/lib/elementary/elm_fileselector_entry_eo.c index 04af297c98..3f6e17a701 100644 --- a/src/lib/elementary/elm_fileselector_entry_eo.c +++ b/src/lib/elementary/elm_fileselector_entry_eo.c @@ -88,4 +88,4 @@ static const Efl_Class_Description _elm_fileselector_entry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_fileselector_entry_class_get, &_elm_fileselector_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_fileselector_entry_class_get, &_elm_fileselector_entry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_fileselector_eo.c b/src/lib/elementary/elm_fileselector_eo.c index 3ae6cd3539..e6b7d726f4 100644 --- a/src/lib/elementary/elm_fileselector_eo.c +++ b/src/lib/elementary/elm_fileselector_eo.c @@ -202,6 +202,6 @@ static const Efl_Class_Description _elm_fileselector_class_desc = { _elm_fileselector_class_destructor }; -EFL_DEFINE_CLASS(elm_fileselector_class_get, &_elm_fileselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_fileselector_class_get, &_elm_fileselector_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_FILESELECTOR_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_FOCUS_COMPOSITION_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_fileselector_eo.legacy.c" diff --git a/src/lib/elementary/elm_gengrid_eo.c b/src/lib/elementary/elm_gengrid_eo.c index b3012a57b8..d927aae949 100644 --- a/src/lib/elementary/elm_gengrid_eo.c +++ b/src/lib/elementary/elm_gengrid_eo.c @@ -512,6 +512,6 @@ static const Efl_Class_Description _elm_gengrid_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_gengrid_eo.legacy.c" diff --git a/src/lib/elementary/elm_genlist_eo.c b/src/lib/elementary/elm_genlist_eo.c index fd0d5216ab..b34ec2a352 100644 --- a/src/lib/elementary/elm_genlist_eo.c +++ b/src/lib/elementary/elm_genlist_eo.c @@ -681,6 +681,6 @@ static const Efl_Class_Description _elm_genlist_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_genlist_class_get, &_elm_genlist_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_genlist_class_get, &_elm_genlist_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_genlist_eo.legacy.c" diff --git a/src/lib/elementary/elm_hover_eo.c b/src/lib/elementary/elm_hover_eo.c index b5a1b20208..c36c6ccf3f 100644 --- a/src/lib/elementary/elm_hover_eo.c +++ b/src/lib/elementary/elm_hover_eo.c @@ -92,6 +92,6 @@ static const Efl_Class_Description _elm_hover_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_hover_class_get, &_elm_hover_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_hover_class_get, &_elm_hover_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_LAYER_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_hover_eo.legacy.c" diff --git a/src/lib/elementary/elm_hoversel_eo.c b/src/lib/elementary/elm_hoversel_eo.c index de2f5371c5..52bb001c67 100644 --- a/src/lib/elementary/elm_hoversel_eo.c +++ b/src/lib/elementary/elm_hoversel_eo.c @@ -189,6 +189,6 @@ static const Efl_Class_Description _elm_hoversel_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_hoversel_class_get, &_elm_hoversel_class_desc, EFL_UI_BUTTON_LEGACY_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_hoversel_class_get, &_elm_hoversel_class_desc, EFL_UI_BUTTON_LEGACY_CLASS, EFL_UI_SELECTABLE_INTERFACE, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_hoversel_eo.legacy.c" diff --git a/src/lib/elementary/elm_index_eo.c b/src/lib/elementary/elm_index_eo.c index 862e228fa1..806f94ce0b 100644 --- a/src/lib/elementary/elm_index_eo.c +++ b/src/lib/elementary/elm_index_eo.c @@ -322,6 +322,6 @@ static const Efl_Class_Description _elm_index_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_index_class_get, &_elm_index_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LAYOUT_ORIENTABLE_INTERFACE, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_index_class_get, &_elm_index_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_LAYOUT_ORIENTABLE_INTERFACE, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_index_eo.legacy.c" diff --git a/src/lib/elementary/elm_list_eo.c b/src/lib/elementary/elm_list_eo.c index 3da0cba750..32f0f77b92 100644 --- a/src/lib/elementary/elm_list_eo.c +++ b/src/lib/elementary/elm_list_eo.c @@ -363,6 +363,6 @@ static const Efl_Class_Description _elm_list_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_list_class_get, &_elm_list_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_list_class_get, &_elm_list_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_list_eo.legacy.c" diff --git a/src/lib/elementary/elm_map_eo.c b/src/lib/elementary/elm_map_eo.c index 0e522f4635..57a36a570d 100644 --- a/src/lib/elementary/elm_map_eo.c +++ b/src/lib/elementary/elm_map_eo.c @@ -360,6 +360,6 @@ static const Efl_Class_Description _elm_map_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_map_class_get, &_elm_map_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_map_class_get, &_elm_map_class_desc, EFL_UI_WIDGET_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, EFL_UI_ZOOM_INTERFACE, NULL); #include "elm_map_eo.legacy.c" diff --git a/src/lib/elementary/elm_menu.c b/src/lib/elementary/elm_menu.c index 681ac2273d..551b9830b3 100644 --- a/src/lib/elementary/elm_menu.c +++ b/src/lib/elementary/elm_menu.c @@ -780,13 +780,13 @@ _elm_menu_menu_bar_set(Eo *obj, Eina_Bool menu_bar) if (menu_bar) { efl_event_callback_add - (item->submenu.hv, EFL_UI_EVENT_CLICKED, _hover_dismissed_cb, WIDGET(item)); + (item->submenu.hv, EFL_INPUT_EVENT_CLICKED, _hover_dismissed_cb, WIDGET(item)); snprintf(style, sizeof(style), "main_menu_submenu//%s", elm_widget_style_get(obj)); elm_object_style_set(item->submenu.hv, style); } else { - efl_event_callback_del(item->submenu.hv, EFL_UI_EVENT_CLICKED, _hover_dismissed_cb, WIDGET(item)); + efl_event_callback_del(item->submenu.hv, EFL_INPUT_EVENT_CLICKED, _hover_dismissed_cb, WIDGET(item)); snprintf(style, sizeof(style), "submenu/%s", elm_widget_style_get(obj)); elm_object_style_set(item->submenu.hv, style); } diff --git a/src/lib/elementary/elm_menu_eo.c b/src/lib/elementary/elm_menu_eo.c index 4aaa856be8..f202d2e795 100644 --- a/src/lib/elementary/elm_menu_eo.c +++ b/src/lib/elementary/elm_menu_eo.c @@ -119,6 +119,6 @@ static const Efl_Class_Description _elm_menu_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_menu_class_get, &_elm_menu_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_WIDGET_FOCUS_MANAGER_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_menu_class_get, &_elm_menu_class_desc, EFL_UI_WIDGET_CLASS, EFL_INPUT_CLICKABLE_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_WIDGET_FOCUS_MANAGER_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_menu_eo.legacy.c" diff --git a/src/lib/elementary/elm_multibuttonentry_eo.c b/src/lib/elementary/elm_multibuttonentry_eo.c index dcfb62778d..d8697d015f 100644 --- a/src/lib/elementary/elm_multibuttonentry_eo.c +++ b/src/lib/elementary/elm_multibuttonentry_eo.c @@ -219,6 +219,6 @@ static const Efl_Class_Description _elm_multibuttonentry_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_multibuttonentry_class_get, &_elm_multibuttonentry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_multibuttonentry_class_get, &_elm_multibuttonentry_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_multibuttonentry_eo.legacy.c" diff --git a/src/lib/elementary/elm_photo_eo.c b/src/lib/elementary/elm_photo_eo.c index 6c49b03515..6d46584a74 100644 --- a/src/lib/elementary/elm_photo_eo.c +++ b/src/lib/elementary/elm_photo_eo.c @@ -76,4 +76,4 @@ static const Efl_Class_Description _elm_photo_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_photo_class_get, &_elm_photo_class_desc, EFL_UI_WIDGET_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_photo_class_get, &_elm_photo_class_desc, EFL_UI_WIDGET_CLASS, EFL_FILE_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_plug_eo.c b/src/lib/elementary/elm_plug_eo.c index c40f883d22..292176d630 100644 --- a/src/lib/elementary/elm_plug_eo.c +++ b/src/lib/elementary/elm_plug_eo.c @@ -54,6 +54,6 @@ static const Efl_Class_Description _elm_plug_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_plug_class_get, &_elm_plug_class_desc, EFL_UI_WIDGET_CLASS, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_LEGACY_INTERFACE, NULL); #include "elm_plug_eo.legacy.c" diff --git a/src/lib/elementary/elm_spinner.c b/src/lib/elementary/elm_spinner.c index ba22b6fa06..c033e9a732 100644 --- a/src/lib/elementary/elm_spinner.c +++ b/src/lib/elementary/elm_spinner.c @@ -60,9 +60,9 @@ static void _entry_activated_cb(void *data, const Efl_Event *event); EFL_CALLBACKS_ARRAY_DEFINE(_inc_dec_button_cb, - { EFL_UI_EVENT_CLICKED, _inc_dec_button_clicked_cb}, - { EFL_UI_EVENT_PRESSED, _inc_dec_button_pressed_cb}, - { EFL_UI_EVENT_UNPRESSED, _inc_dec_button_unpressed_cb}, + { EFL_INPUT_EVENT_CLICKED, _inc_dec_button_clicked_cb}, + { EFL_INPUT_EVENT_PRESSED, _inc_dec_button_pressed_cb}, + { EFL_INPUT_EVENT_UNPRESSED, _inc_dec_button_unpressed_cb}, { EFL_EVENT_POINTER_MOVE, _inc_dec_button_mouse_move_cb } ); @@ -1222,7 +1222,7 @@ _elm_spinner_efl_canvas_group_group_add(Eo *obj, Elm_Spinner_Data *priv) elm_widget_can_focus_set(priv->text_button, _elm_config->access_mode); efl_event_callback_add - (priv->text_button, EFL_UI_EVENT_CLICKED, _text_button_clicked_cb, obj); + (priv->text_button, EFL_INPUT_EVENT_CLICKED, _text_button_clicked_cb, obj); efl_event_callback_add (priv->text_button, EFL_UI_FOCUS_OBJECT_EVENT_FOCUS_CHANGED, _text_button_focus_change, obj); diff --git a/src/lib/elementary/elm_thumb_eo.c b/src/lib/elementary/elm_thumb_eo.c index 0e57845112..d7a469060f 100644 --- a/src/lib/elementary/elm_thumb_eo.c +++ b/src/lib/elementary/elm_thumb_eo.c @@ -82,4 +82,4 @@ static const Efl_Class_Description _elm_thumb_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_thumb_class_get, &_elm_thumb_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_FILE_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_DRAGGABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, NULL); diff --git a/src/lib/elementary/elm_toolbar_eo.c b/src/lib/elementary/elm_toolbar_eo.c index f27ea9b4e4..bcb3b23c5f 100644 --- a/src/lib/elementary/elm_toolbar_eo.c +++ b/src/lib/elementary/elm_toolbar_eo.c @@ -372,6 +372,6 @@ static const Efl_Class_Description _elm_toolbar_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_toolbar_class_get, &_elm_toolbar_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_LAYOUT_ORIENTABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_UI_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_toolbar_class_get, &_elm_toolbar_class_desc, EFL_UI_WIDGET_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_LAYOUT_ORIENTABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_ACCESS_OBJECT_MIXIN, EFL_INPUT_CLICKABLE_MIXIN, EFL_UI_SELECTABLE_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_toolbar_eo.legacy.c" diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build index 72226f5cf3..3216383f41 100644 --- a/src/lib/elementary/meson.build +++ b/src/lib/elementary/meson.build @@ -176,7 +176,6 @@ pub_eo_files = [ 'efl_ui_caching_factory.eo', 'efl_ui_widget_factory.eo', 'efl_ui_relative_layout.eo', - 'efl_ui_clickable.eo', 'efl_ui_clickable_util.eo', 'efl_ui_format.eo', 'efl_ui_collection.eo', @@ -930,7 +929,6 @@ elementary_src = [ 'efl_ui_exact_model.c', 'efl_ui_average_model.c', 'efl_ui_relative_layout.c', - 'efl_ui_clickable.c', 'efl_ui_clickable_util.c', 'efl_ui_format.c', 'efl_ui_scroll_util.c', diff --git a/src/lib/evas/Evas_Eo.h b/src/lib/evas/Evas_Eo.h index 4122ac7f15..593c4d9a69 100644 --- a/src/lib/evas/Evas_Eo.h +++ b/src/lib/evas/Evas_Eo.h @@ -464,3 +464,4 @@ typedef void (Evas_Canvas3D_Surface_Func)(Evas_Real *out_x, #include "canvas/efl_input_hold.eo.h" #include "canvas/efl_input_interface.eo.h" #include "canvas/efl_input_focus.eo.h" +#include "canvas/efl_input_clickable.eo.h" diff --git a/src/lib/elementary/efl_ui_clickable.c b/src/lib/evas/canvas/efl_input_clickable.c similarity index 71% rename from src/lib/elementary/efl_ui_clickable.c rename to src/lib/evas/canvas/efl_input_clickable.c index ced9609e35..fb6c3fe457 100644 --- a/src/lib/elementary/efl_ui_clickable.c +++ b/src/lib/evas/canvas/efl_input_clickable.c @@ -2,10 +2,11 @@ # include #endif -#define EFL_UI_CLICKABLE_PROTECTED 1 +#define EFL_INPUT_CLICKABLE_PROTECTED 1 -#include -#include "elm_priv.h" +#include +#include +#include "evas_common_private.h" typedef struct { Eina_Bool pressed; @@ -16,9 +17,9 @@ typedef struct { typedef struct { Button_State state[3]; -} Efl_Ui_Clickable_Data; +} Efl_Input_Clickable_Data; -#define MY_CLASS EFL_UI_CLICKABLE_MIXIN +#define MY_CLASS EFL_INPUT_CLICKABLE_MIXIN #define DOUBLE_CLICK_TIME ((double)0.1) //in seconds #define LONGPRESS_TIMEOUT ((double)1.0) //in seconds @@ -27,7 +28,7 @@ static void _timer_longpress(void *data, const Efl_Event *ev) { Button_State *state; - Efl_Ui_Clickable_Data *pd = efl_data_scope_get(data, MY_CLASS); + Efl_Input_Clickable_Data *pd = efl_data_scope_get(data, MY_CLASS); for (int i = 0; i < 3; ++i) { @@ -36,13 +37,13 @@ _timer_longpress(void *data, const Efl_Event *ev) { efl_del(state->timer); state->timer = NULL; - efl_event_callback_call(data, EFL_UI_EVENT_LONGPRESSED, &i); + efl_event_callback_call(data, EFL_INPUT_EVENT_LONGPRESSED, &i); } } } EOLIAN static void -_efl_ui_clickable_press(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +_efl_input_clickable_press(Eo *obj EINA_UNUSED, Efl_Input_Clickable_Data *pd, unsigned int button) { Button_State *state; EINA_SAFETY_ON_FALSE_RETURN(button < 3); @@ -58,13 +59,13 @@ _efl_ui_clickable_press(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned efl_loop_timer_interval_set(efl_added, LONGPRESS_TIMEOUT), efl_event_callback_add(efl_added, EFL_LOOP_TIMER_EVENT_TIMER_TICK, _timer_longpress, obj)); - efl_event_callback_call(obj, EFL_UI_EVENT_PRESSED, &button); + efl_event_callback_call(obj, EFL_INPUT_EVENT_PRESSED, &button); } EOLIAN static void -_efl_ui_clickable_unpress(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +_efl_input_clickable_unpress(Eo *obj EINA_UNUSED, Efl_Input_Clickable_Data *pd, unsigned int button) { - Efl_Ui_Clickable_Clicked clicked; + Efl_Input_Clickable_Clicked clicked; Button_State *state; Eina_Bool pressed; EINA_SAFETY_ON_FALSE_RETURN(button < 3); @@ -88,20 +89,20 @@ _efl_ui_clickable_unpress(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsign state->timer = NULL; //populate state - efl_event_callback_call(obj, EFL_UI_EVENT_UNPRESSED, &button); + efl_event_callback_call(obj, EFL_INPUT_EVENT_UNPRESSED, &button); if (pressed) { INF("Widget %s,%p is clicked(%d)", efl_class_name_get(obj), obj, button); clicked.repeated = state->pressed_before; clicked.button = button; if (button == 1) - efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, &clicked); - efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED_ANY, &clicked); + efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED, &clicked); + efl_event_callback_call(obj, EFL_INPUT_EVENT_CLICKED_ANY, &clicked); } } EOLIAN static void -_efl_ui_clickable_button_state_reset(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data *pd, unsigned int button) +_efl_input_clickable_button_state_reset(Eo *obj EINA_UNUSED, Efl_Input_Clickable_Data *pd, unsigned int button) { Button_State *state; EINA_SAFETY_ON_FALSE_RETURN(button < 3); @@ -117,4 +118,4 @@ _efl_ui_clickable_button_state_reset(Eo *obj EINA_UNUSED, Efl_Ui_Clickable_Data state->pressed = EINA_FALSE; } -#include "efl_ui_clickable.eo.c" +#include "efl_input_clickable.eo.c" diff --git a/src/lib/elementary/efl_ui_clickable.eo b/src/lib/evas/canvas/efl_input_clickable.eo similarity index 76% rename from src/lib/elementary/efl_ui_clickable.eo rename to src/lib/evas/canvas/efl_input_clickable.eo index ace6f6d6e7..14ca084d37 100644 --- a/src/lib/elementary/efl_ui_clickable.eo +++ b/src/lib/evas/canvas/efl_input_clickable.eo @@ -1,13 +1,13 @@ -struct @beta Efl.Ui.Clickable_Clicked { +struct @beta Efl.Input.Clickable_Clicked { [[A struct that expresses a click in elementary.]] repeated : int; [[The amount of how often the clicked event was repeated in a certain amount of time]] button : int; [[The Button that is pressed]] } -mixin @beta Efl.Ui.Clickable +mixin @beta Efl.Input.Clickable { - [[Efl UI clickable interface]] - event_prefix: efl_ui; + [[Efl input clickable interface]] + event_prefix: efl_input; methods { press @protected { [[Change internal states that a button got pressed. @@ -38,8 +38,8 @@ mixin @beta Efl.Ui.Clickable } } events { - clicked: Efl.Ui.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed, by the primary button]] - clicked,any : Efl.Ui.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed by any button. The button that triggered the event can be found in the event information.]] + clicked: Efl.Input.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed, by the primary button]] + clicked,any: Efl.Input.Clickable_Clicked; [[Called when object is in sequence pressed and unpressed by any button. The button that triggered the event can be found in the event information.]] pressed: int; [[Called when the object is pressed, event_info is the button that got pressed]] unpressed: int; [[Called when the object is no longer pressed, event_info is the button that got pressed]] longpressed: int; [[Called when the object receives a long press, event_info is the button that got pressed]] diff --git a/src/lib/evas/canvas/meson.build b/src/lib/evas/canvas/meson.build index f285316844..c306c900a3 100644 --- a/src/lib/evas/canvas/meson.build +++ b/src/lib/evas/canvas/meson.build @@ -27,6 +27,7 @@ pub_eo_files = [ 'efl_input_pointer.eo', 'efl_input_hold.eo', 'efl_input_focus.eo', + 'efl_input_clickable.eo', 'efl_canvas_animation.eo', 'efl_canvas_animation_alpha.eo', 'efl_canvas_animation_rotate.eo', @@ -168,6 +169,7 @@ evas_src += files([ 'efl_input_pointer.c', 'efl_input_hold.c', 'efl_input_focus.c', + 'efl_input_clickable.c', 'efl_canvas_animation.c', 'efl_canvas_animation_alpha.c', 'efl_canvas_animation_rotate.c', diff --git a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c index 03b5a7f20a..d92a08618d 100644 --- a/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c +++ b/src/modules/elementary/clock_input_ctxpopup/clock_input_ctxpopup.c @@ -317,7 +317,7 @@ field_create(Efl_Ui_Clock_Module_Data *module_data, Efl_Ui_Clock_Type field_typ { field_obj = elm_button_add(ctx_mod->mod_data.base); efl_event_callback_add - (field_obj, EFL_UI_EVENT_CLICKED, _ampm_clicked_cb, ctx_mod); + (field_obj, EFL_INPUT_EVENT_CLICKED, _ampm_clicked_cb, ctx_mod); } else { @@ -327,7 +327,7 @@ field_create(Efl_Ui_Clock_Module_Data *module_data, Efl_Ui_Clock_Type field_typ elm_entry_input_panel_enabled_set(field_obj, EINA_FALSE); elm_entry_context_menu_disabled_set(field_obj, EINA_TRUE); efl_event_callback_add - (field_obj, EFL_UI_EVENT_CLICKED, _field_clicked_cb, ctx_mod); + (field_obj, EFL_INPUT_EVENT_CLICKED, _field_clicked_cb, ctx_mod); } evas_object_data_set(field_obj, "_field_type", (void *)field_type); diff --git a/src/tests/elementary/spec/efl_test_clickable.c b/src/tests/elementary/spec/efl_test_clickable.c index c1b63d38b7..c6ca54883b 100644 --- a/src/tests/elementary/spec/efl_test_clickable.c +++ b/src/tests/elementary/spec/efl_test_clickable.c @@ -69,9 +69,9 @@ prepare_window(void) */ typedef struct { - Efl_Ui_Clickable_Clicked clicked_params; + Efl_Input_Clickable_Clicked clicked_params; unsigned int clicked; - Efl_Ui_Clickable_Clicked clicked_all_params; + Efl_Input_Clickable_Clicked clicked_all_params; unsigned int clicked_all; unsigned int pressed; unsigned int unpressed; @@ -84,23 +84,23 @@ Clickable_Event_Register event_caller = { 0 }; static void _event_register(void *data EINA_UNUSED, const Efl_Event *ev) { -#define EVENT_CHECK(e,f) if (ev->desc == EFL_UI_EVENT_ ##e ) event_caller.f ++ +#define EVENT_CHECK(e,f) if (ev->desc == EFL_INPUT_EVENT_ ##e ) event_caller.f ++ EVENT_CHECK(CLICKED, clicked); EVENT_CHECK(CLICKED_ANY, clicked_all); EVENT_CHECK(PRESSED, pressed); EVENT_CHECK(UNPRESSED, unpressed); EVENT_CHECK(LONGPRESSED, long_pressed); - if (ev->desc == EFL_UI_EVENT_CLICKED) + if (ev->desc == EFL_INPUT_EVENT_CLICKED) { - Efl_Ui_Clickable_Clicked *clicked = ev->info; + Efl_Input_Clickable_Clicked *clicked = ev->info; event_caller.clicked_params.repeated = clicked->repeated; event_caller.clicked_params.button = clicked->button; } - if (ev->desc == EFL_UI_EVENT_CLICKED_ANY) + if (ev->desc == EFL_INPUT_EVENT_CLICKED_ANY) { - Efl_Ui_Clickable_Clicked *clicked = ev->info; + Efl_Input_Clickable_Clicked *clicked = ev->info; event_caller.clicked_all_params.repeated = clicked->repeated; event_caller.clicked_all_params.button = clicked->button; @@ -108,11 +108,11 @@ _event_register(void *data EINA_UNUSED, const Efl_Event *ev) } EFL_CALLBACKS_ARRAY_DEFINE(clickable, - {EFL_UI_EVENT_CLICKED, _event_register}, - {EFL_UI_EVENT_CLICKED_ANY, _event_register}, - {EFL_UI_EVENT_PRESSED, _event_register}, - {EFL_UI_EVENT_UNPRESSED, _event_register}, - {EFL_UI_EVENT_LONGPRESSED, _event_register}, + {EFL_INPUT_EVENT_CLICKED, _event_register}, + {EFL_INPUT_EVENT_CLICKED_ANY, _event_register}, + {EFL_INPUT_EVENT_PRESSED, _event_register}, + {EFL_INPUT_EVENT_UNPRESSED, _event_register}, + {EFL_INPUT_EVENT_LONGPRESSED, _event_register}, ) static void From 1c0a459293981ef9691b9bb5acd468ba84e502b4 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Mon, 29 Jul 2019 12:10:18 +0200 Subject: [PATCH 47/72] efl_gfx_color: fix color_code_set Summary: There are two parts for this patch: 1- Fix sigmentation fault when using (efl_gfx_color_color_code_set). // It try to modify const variable 2- Remove unnecessary code. // why would user pass slash or back slash as color code format. Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include #include #include static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); } static void _gui_setup() { Eo *win, *rect; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Hello World"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); // when the user clicks "close" on a window there is a request to delete efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); rect = efl_add(EFL_CANVAS_RECTANGLE_CLASS,win); const char *color = "#FF0000FF"; efl_gfx_color_code_set(rect,color); evas_object_resize(rect,250,250); evas_object_resize(win,250,250); evas_object_move(rect,0,0); evas_object_show(rect); evas_object_show(win); } EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { _gui_setup(); } EFL_MAIN() ``` Reviewers: zmike, cedric, segfaultxavi, woohyun Reviewed By: segfaultxavi Subscribers: singh.amitesh, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9422 --- src/lib/efl/interfaces/efl_gfx_color.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c index 92c1f07483..fe35d92cc7 100644 --- a/src/lib/efl/interfaces/efl_gfx_color.c +++ b/src/lib/efl/interfaces/efl_gfx_color.c @@ -1,24 +1,6 @@ #include "config.h" #include "Efl.h" -static int -_format_clean_param(Eina_Tmpstr *s) -{ - Eina_Tmpstr *ss; - char *ds; - int len = 0; - - ds = (char*) s; - for (ss = s; *ss; ss++, ds++, len++) - { - if ((*ss == '\\') && *(ss + 1)) ss++; - if (ds != ss) *ds = *ss; - } - *ds = 0; - - return len; -} - static int _hex_string_get(char ch, Eina_Bool *ok) { @@ -102,7 +84,7 @@ _efl_gfx_color_color_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *colorc int len; unsigned char r, g, b, a; - len = _format_clean_param(colorcode); + len = (size_t) strlen(colorcode); _format_color_parse(colorcode, len, &r, &g, &b, &a); efl_gfx_color_set(obj, r, g, b, a); From ef235c43c81c7e81a7779e0ed13f671bb426989d Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Mon, 29 Jul 2019 12:23:18 +0200 Subject: [PATCH 48/72] Fix build break Caused by 1c0a459293981ef9691b9bb5acd468ba84e502b4 I should have been more careful before approving, my bad. --- src/lib/efl/interfaces/efl_gfx_color.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/efl/interfaces/efl_gfx_color.c b/src/lib/efl/interfaces/efl_gfx_color.c index fe35d92cc7..5d49d12f4a 100644 --- a/src/lib/efl/interfaces/efl_gfx_color.c +++ b/src/lib/efl/interfaces/efl_gfx_color.c @@ -106,7 +106,7 @@ _efl_gfx_color_class_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const int len; unsigned char r, g, b, a; - len = _format_clean_param(colorcode); + len = (size_t) strlen(colorcode); _format_color_parse(colorcode, len, &r, &g, &b, &a); return efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a); From 444a068c05f772a1c01cd965c8ed1e0c5035eabb Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 29 Jul 2019 12:16:55 +0200 Subject: [PATCH 49/72] elm_test: fix anchor popup test Summary: this group name was wrongly changed by sed ref d4526f44b8c20010061c42a87ac0496796311afb Reviewers: segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9419 --- src/bin/elementary/test_ui_popup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bin/elementary/test_ui_popup.c b/src/bin/elementary/test_ui_popup.c index 6fa397234f..89a9f0ef1b 100644 --- a/src/bin/elementary/test_ui_popup.c +++ b/src/bin/elementary/test_ui_popup.c @@ -1009,7 +1009,7 @@ test_ui_anchor_popup(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win); snprintf(buf, sizeof(buf), "%s/objects/test.edj", elm_app_data_dir_get()); - efl_file_simple_load(layout, buf, "efl_ui_anchor_popup_layout"); + efl_file_simple_load(layout, buf, "efl_ui_popup_anchor_layout"); efl_gfx_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); efl_content_set(win, layout); From 0bab8be791b7454f19d6b813fb005cd78333bd67 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Mon, 29 Jul 2019 14:00:04 +0200 Subject: [PATCH 50/72] evas_textblock: markup: handle invalid/missing escape characters Summary: T8088 if escape character sequence not found for example **&123;** : * (Old Behaviour) : Draw nothing * (New Behaviour) : Draw Text like it plain text I think this is the right behaviour since: 1- We print output as it is, so user can detect what was the problem. For example user write &gf; (by mistake, he wanted to write >) == if we nothing is printed he would not know exactly where is the real problem. it can be font file, textblock is not visible, he may think bug in efl == if we printed &gf; as it is, it will direclty show that this is not valid escape char. 2- If user made mistake in text, it is better to show it instead of hide it, maybe there are new sequences that we do not know about. This behaviour was checked on multible systems: 1- Web Browsers like chrome 2- Qt 3- Android They all have same as our new behaviour Example : markup text = ">&gf; Old : > New : >&gf; Test Plan: ``` #define EFL_EO_API_SUPPORT 1 #define EFL_BETA_API_SUPPORT 1 #include #include #include static void _gui_quit_cb(void *data EINA_UNUSED, const Efl_Event *event EINA_UNUSED) { efl_exit(0); } static void _gui_setup() { Eo *win, *box; win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), efl_text_set(efl_added, "Hello World"), efl_ui_win_autodel_set(efl_added, EINA_TRUE)); // when the user clicks "close" on a window there is a request to delete efl_event_callback_add(win, EFL_UI_WIN_EVENT_DELETE_REQUEST, _gui_quit_cb, NULL); box = efl_add(EFL_UI_BOX_CLASS, win, efl_content_set(win, efl_added), efl_gfx_hint_size_min_set(efl_added, EINA_SIZE2D(360, 240))); efl_add(EFL_UI_TEXT_CLASS, box, efl_text_markup_set(efl_added, ">&gf;"), efl_text_interactive_selection_allowed_set(efl_added, EINA_FALSE), efl_gfx_hint_weight_set(efl_added, 1.0, 0.9), efl_gfx_hint_align_set(efl_added, 0.5, 0.5), efl_text_multiline_set(efl_added,EINA_FALSE), efl_pack(box, efl_added)); efl_add(EFL_UI_BUTTON_CLASS, box, efl_text_set(efl_added, "Quit"), efl_gfx_hint_weight_set(efl_added, 1.0, 0.1), efl_pack(box, efl_added), efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _gui_quit_cb, efl_added)); } EAPI_MAIN void efl_main(void *data EINA_UNUSED, const Efl_Event *ev EINA_UNUSED) { _gui_setup(); } EFL_MAIN() ``` Reviewers: woohyun, bowonryu, segfaultxavi, bu5hm4n Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9428 --- src/lib/evas/canvas/evas_object_textblock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c index 2210c958b0..510f6ce05a 100644 --- a/src/lib/evas/canvas/evas_object_textblock.c +++ b/src/lib/evas/canvas/evas_object_textblock.c @@ -7931,6 +7931,8 @@ _prepend_escaped_char(Efl_Text_Cursor_Cursor *cur_obj, const char *s, escape = _escaped_char_get(s, s_end); if (escape) evas_textblock_cursor_text_prepend(cur_obj, escape); + else /* Use same text input if no escape was found */ + _prepend_text_run(cur_obj, s, s_end); } From 782738122196c731e75a66d54703c9fb5f063eb4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 29 Jul 2019 09:17:20 -0400 Subject: [PATCH 51/72] elm_test/modal_win: handle case where test is not passed the main window Summary: this test is not runnable when it is not triggered directly from pressing a button in the main window Reviewers: devilhorns Reviewed By: devilhorns Subscribers: devilhorns, bu5hm4n, cedric, #reviewers, #committers Tags: #efl_widgets Differential Revision: https://phab.enlightenment.org/D9401 --- src/bin/elementary/test_win_modal.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bin/elementary/test_win_modal.c b/src/bin/elementary/test_win_modal.c index 8775eada5b..2a82a38d9a 100644 --- a/src/bin/elementary/test_win_modal.c +++ b/src/bin/elementary/test_win_modal.c @@ -27,6 +27,11 @@ test_win_modal(void *data EINA_UNUSED, Evas_Object *obj, void *event_info EINA_U { Evas_Object *parent_win, *win, *bg, *txt, *bx, *bt; + if (!obj) + { + fprintf(stderr, "The modal win test can only be run by clicking the button for it in the main elementary_test window.\n"); + return; + } parent_win = _parent_win_get(obj); win = elm_win_add(parent_win, "modal", ELM_WIN_BASIC); From b9648605e8f6623283ec960deac302685909f3c5 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 11:49:55 -0400 Subject: [PATCH 52/72] tests/elm: add test for ctxpopup sizing verify that size hints of content are being respected Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9404 --- src/tests/elementary/elm_test_ctxpopup.c | 36 ++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/tests/elementary/elm_test_ctxpopup.c b/src/tests/elementary/elm_test_ctxpopup.c index fb462364aa..a6f74de676 100644 --- a/src/tests/elementary/elm_test_ctxpopup.c +++ b/src/tests/elementary/elm_test_ctxpopup.c @@ -41,8 +41,44 @@ EFL_START_TEST(elm_atspi_role_get) } EFL_END_TEST +static void +_geometry_update(void *data, Evas_Object *obj EINA_UNUSED, void *event_info) +{ + Eina_Rectangle *geom = event_info; + int *set = data; + if ((geom->w >= 150) && (geom->h >= 150)) + *set = 1; + else + *set = 0; +} + +EFL_START_TEST(elm_ctxpopup_test_sizing) +{ + Eo *win, *bt, *ctx; + int pass = 0; + + win = win_add(); + bt = elm_button_add(win); + ctx = elm_ctxpopup_add(win); + evas_object_smart_callback_add(ctx, "geometry,update", _geometry_update, &pass); + elm_object_text_set(bt, "test"); + evas_object_size_hint_min_set(bt, 150, 150); + elm_object_content_set(ctx, bt); + evas_object_show(win); + + evas_object_resize(bt, 200, 200); + evas_object_resize(win, 200, 200); + + evas_object_show(ctx); + get_me_to_those_events(win); + + ck_assert_int_eq(pass, 1); +} +EFL_END_TEST + void elm_test_ctxpopup(TCase *tc) { tcase_add_test(tc, elm_ctxpopup_legacy_type_check); tcase_add_test(tc, elm_atspi_role_get); + tcase_add_test(tc, elm_ctxpopup_test_sizing); } From b1986363dbe46202cd46216af7e013c2f26ff098 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 22 Jul 2019 13:00:45 -0400 Subject: [PATCH 53/72] tests/elm: move efl_config tests to efl_ui_suite these invoke non-legacy codepaths which should never be triggered during legacy unit tests Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9403 --- src/tests/elementary/efl_ui_suite.c | 1 + src/tests/elementary/efl_ui_suite.h | 1 + src/tests/elementary/efl_ui_test_config.c | 230 ++++++++++++++++++++++ src/tests/elementary/elm_test_config.c | 207 +------------------ src/tests/elementary/meson.build | 1 + 5 files changed, 235 insertions(+), 205 deletions(-) create mode 100644 src/tests/elementary/efl_ui_test_config.c diff --git a/src/tests/elementary/efl_ui_suite.c b/src/tests/elementary/efl_ui_suite.c index 3478095936..707f450939 100644 --- a/src/tests/elementary/efl_ui_suite.c +++ b/src/tests/elementary/efl_ui_suite.c @@ -11,6 +11,7 @@ static const Efl_Test_Case etc[] = { //{ "elm_widget_focus", elm_test_widget_focus}, { "efl_ui_atspi", efl_ui_test_atspi}, { "efl_ui_callback", efl_ui_test_callback}, + { "efl_ui_config", efl_ui_test_config}, { "efl_ui_focus", efl_ui_test_focus}, { "efl_ui_focus_sub", efl_ui_test_focus_sub}, { "efl_ui_box", efl_ui_test_box}, diff --git a/src/tests/elementary/efl_ui_suite.h b/src/tests/elementary/efl_ui_suite.h index 16170efde1..a2ad7945f7 100644 --- a/src/tests/elementary/efl_ui_suite.h +++ b/src/tests/elementary/efl_ui_suite.h @@ -46,6 +46,7 @@ void efl_ui_test_spin_button(TCase *tc); void efl_ui_test_item_container(TCase *tc); void efl_ui_test_list_container(TCase *tc); void efl_ui_test_grid_container(TCase *tc); +void efl_ui_test_config(TCase *tc); void loop_timer_interval_set(Eo *obj, double in); diff --git a/src/tests/elementary/efl_ui_test_config.c b/src/tests/elementary/efl_ui_test_config.c new file mode 100644 index 0000000000..40d0415bc9 --- /dev/null +++ b/src/tests/elementary/efl_ui_test_config.c @@ -0,0 +1,230 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#define EFL_ACCESS_OBJECT_PROTECTED +#include +#include +#include "elm_suite.h" + +#include +typedef unsigned int uint; + +EFL_START_TEST(efl_config_eoapi) +{ + Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); + fail_if(!cfg); + +#define CONFIG_CHK(opt, typ, val) do { \ + typ old = elm_config_ ## opt ## _get(); \ + fail_if(old != efl_config_ ## typ ## _get(cfg, #opt)); \ + fail_if(!efl_config_ ## typ ## _set(cfg, #opt, val)); \ + fail_if(elm_config_ ## opt ## _get() != val); \ + fail_if(efl_config_ ## typ ## _get(cfg, #opt) != val); \ + } while (0) + +#define CONFIG_CHKB(opt, val) CONFIG_CHK(opt, bool, val) +#define CONFIG_CHKI(opt, val) CONFIG_CHK(opt, int, val) +#define CONFIG_CHKD(opt, val) CONFIG_CHK(opt, double, val) + + // note: leaks badly +#define CONFIG_CHKS(opt, val) do { \ + const char *old = elm_config_ ## opt ## _get(); \ + fail_if(!eina_streq(old, efl_config_string_get(cfg, #opt))); \ + fail_if(!efl_config_string_set(cfg, #opt, val)); \ + fail_if(!eina_streq(elm_config_ ## opt ## _get(), val)); \ + fail_if(!eina_streq(efl_config_string_get(cfg, #opt), val)); \ + } while (0) + +#define CONFIG_CHKE(opt, ival, sval) do { \ + elm_config_ ## opt ## _set(ival); \ + fail_if(!eina_streq(efl_config_string_get(cfg, #opt), sval)); \ + fail_if(!efl_config_string_set(cfg, #opt, sval)); \ + fail_if(!eina_streq(efl_config_string_get(cfg, #opt), sval)); \ + } while (0) + + CONFIG_CHKB(scroll_bounce_enabled, !old); + CONFIG_CHKD(scroll_bounce_friction, 0); + CONFIG_CHKD(scroll_page_scroll_friction, 0); + CONFIG_CHKB(context_menu_disabled, !old); + CONFIG_CHKD(scroll_bring_in_scroll_friction, 0); + CONFIG_CHKD(scroll_zoom_friction, 0); + CONFIG_CHKB(scroll_thumbscroll_enabled, !old); + CONFIG_CHKI(scroll_thumbscroll_threshold, 0); + CONFIG_CHKI(scroll_thumbscroll_hold_threshold, 0); + CONFIG_CHKD(scroll_thumbscroll_momentum_threshold, 0); + CONFIG_CHKI(scroll_thumbscroll_flick_distance_tolerance, 0); + CONFIG_CHKD(scroll_thumbscroll_friction, 0); + CONFIG_CHKD(scroll_thumbscroll_min_friction, 0); + CONFIG_CHKD(scroll_thumbscroll_friction_standard, 0); + CONFIG_CHKD(scroll_thumbscroll_border_friction, 0); + CONFIG_CHKD(scroll_thumbscroll_sensitivity_friction, 1.0); + CONFIG_CHKB(scroll_thumbscroll_smooth_start, 0); + CONFIG_CHKB(scroll_animation_disabled, 0); + CONFIG_CHKD(scroll_accel_factor, 0); + CONFIG_CHKD(scroll_thumbscroll_smooth_amount, 0); + CONFIG_CHKD(scroll_thumbscroll_smooth_time_window, 0); + CONFIG_CHKD(scroll_thumbscroll_acceleration_threshold, 0); + CONFIG_CHKD(scroll_thumbscroll_acceleration_time_limit, 0); + CONFIG_CHKD(scroll_thumbscroll_acceleration_weight, 0); + CONFIG_CHKE(focus_autoscroll_mode, EFL_UI_FOCUS_AUTOSCROLL_MODE_NONE, "none"); + CONFIG_CHKE(slider_indicator_visible_mode, EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, "always"); + CONFIG_CHKD(longpress_timeout, 0); + CONFIG_CHKE(softcursor_mode, EFL_UI_SOFTCURSOR_MODE_ON, "on"); + CONFIG_CHKD(tooltip_delay, 0); + CONFIG_CHKB(cursor_engine_only, 0); + CONFIG_CHKD(scale, 0); + CONFIG_CHKS(icon_theme, ELM_CONFIG_ICON_THEME_ELEMENTARY); + CONFIG_CHKB(password_show_last, 0); + CONFIG_CHKD(password_show_last_timeout, 0); + CONFIG_CHKS(preferred_engine, 0); + CONFIG_CHKS(accel_preference, 0); + //font_overlay + CONFIG_CHKB(access, 0); + CONFIG_CHKB(selection_unfocused_clear, 0); + //elm_config_font_overlay_unset + //CONFIG_CHKI(font_hint_type, 0); // this has no get! + CONFIG_CHKI(finger_size, 0); + CONFIG_CHKI(cache_flush_interval, 10); + CONFIG_CHKB(cache_flush_enabled, !old); + CONFIG_CHKI(cache_font_cache_size, 0); + CONFIG_CHKI(cache_image_cache_size, 0); + CONFIG_CHKI(cache_edje_file_cache_size, 0); + CONFIG_CHKI(cache_edje_collection_cache_size, 0); + CONFIG_CHKB(vsync, 0); + CONFIG_CHKB(accel_preference_override, 0); + CONFIG_CHKB(focus_highlight_enabled, !old); + CONFIG_CHKB(focus_highlight_animate, 0); + CONFIG_CHKB(focus_highlight_clip_disabled, !old); + CONFIG_CHKE(focus_move_policy, EFL_UI_FOCUS_MOVE_POLICY_MOVE_IN, "in"); + CONFIG_CHKB(item_select_on_focus_disabled, !old); + CONFIG_CHKB(first_item_focus_on_first_focusin, 0); + CONFIG_CHKB(mirrored, 0); + //see clouseau tests + //CONFIG_CHKB(clouseau_enabled, !old); + CONFIG_CHKD(glayer_long_tap_start_timeout, 0); + CONFIG_CHKD(glayer_double_tap_timeout, 0); + //color_overlay + //color_overlay_unset + CONFIG_CHKB(magnifier_enable, 0); + CONFIG_CHKD(magnifier_scale, 0); + CONFIG_CHKB(window_auto_focus_enable, 0); + CONFIG_CHKB(window_auto_focus_animate, 0); + CONFIG_CHKB(popup_scrollable, 0); + CONFIG_CHKB(atspi_mode, 0); + CONFIG_CHKD(transition_duration_factor, 0); + CONFIG_CHKS(web_backend, old); // no value change (requires web support) + + static const struct { + Edje_Channel chan; + const char *name; + } channels[] = { + { EDJE_CHANNEL_EFFECT, "audio_mute_effect" }, + { EDJE_CHANNEL_BACKGROUND, "audio_mute_background" }, + { EDJE_CHANNEL_MUSIC, "audio_mute_music" }, + { EDJE_CHANNEL_FOREGROUND, "audio_mute_foreground" }, + { EDJE_CHANNEL_INTERFACE, "audio_mute_interface" }, + { EDJE_CHANNEL_INPUT, "audio_mute_input" }, + { EDJE_CHANNEL_ALERT, "audio_mute_alert" }, + { EDJE_CHANNEL_ALL, "audio_mute_all" }, + { EDJE_CHANNEL_ALL, "audio_mute" }, + }; + + for (unsigned i = 0; i < (sizeof(channels) / sizeof(channels[0])); i++) + { + Eina_Bool b = elm_config_audio_mute_get(channels[i].chan); + if (b != efl_config_bool_get(cfg, channels[i].name)) + fail(channels[i].name); + efl_config_bool_set(cfg, channels[i].name, !b); + if(efl_config_bool_get(cfg, channels[i].name) != !b) + fail(channels[i].name); + if(elm_config_audio_mute_get(channels[i].chan) != !b) + fail(channels[i].name); + } + +} +EFL_END_TEST + +EFL_START_TEST(efl_config_win) +{ + Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); + fail_if(!cfg); + + Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL); + Eo *cfg2 = efl_provider_find(win, EFL_CONFIG_INTERFACE); + fail_if(cfg != cfg2); + + elm_config_cache_flush_interval_set(42); + fail_if(efl_config_int_get(win, "cache_flush_interval") != 42); + + efl_unref(win); +} +EFL_END_TEST + +static inline Eina_Bool +_eina_list_string_has(const Eina_List *list, const char *str) +{ + const char *s; + const Eina_List *l; + + EINA_LIST_FOREACH(list, l, s) + if (eina_streq(str, s)) + return EINA_TRUE; + + return EINA_FALSE; +} + +EFL_START_TEST(efl_config_profiles) +{ + // this only tests some of the profile APIs. we're not going to mess with + // the global config during make check :) + + Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); + fail_if(!cfg); + + for (int hidden = 0; hidden <= 1; hidden++) + { + Eina_List *list; + Eina_Iterator *it; + const char *prof; + unsigned int cnt = 0; + + list = (!hidden) ? elm_config_profile_list_get() + : elm_config_profile_list_full_get(); + it = efl_config_profile_iterate(cfg, hidden); + EINA_ITERATOR_FOREACH(it, prof) + { + fail_if(!_eina_list_string_has(list, prof)); + cnt++; + } + fail_if(cnt != eina_list_count(list)); + elm_config_profile_list_free(list); + eina_iterator_free(it); + } + + const char *dir, *profile; + Eina_Stringshare *str; + + profile = elm_config_profile_get(); + fail_if(!profile); + dir = elm_config_profile_dir_get(profile, EINA_TRUE); + str = efl_config_profile_dir_get(cfg, profile, EINA_TRUE); + fail_if(!eina_streq(dir, str)); + elm_config_profile_dir_free(dir); + eina_stringshare_del(str); + + dir = elm_config_profile_dir_get(profile, EINA_FALSE); + str = efl_config_profile_dir_get(cfg, profile, EINA_FALSE); + fail_if(!eina_streq(dir, str)); + elm_config_profile_dir_free(dir); + eina_stringshare_del(str); + +} +EFL_END_TEST + +void efl_ui_test_config(TCase *tc) +{ + tcase_add_test(tc, efl_config_eoapi); + tcase_add_test(tc, efl_config_win); + tcase_add_test(tc, efl_config_profiles); +} diff --git a/src/tests/elementary/elm_test_config.c b/src/tests/elementary/elm_test_config.c index c6745c16a8..08cd12ed62 100644 --- a/src/tests/elementary/elm_test_config.c +++ b/src/tests/elementary/elm_test_config.c @@ -2,229 +2,26 @@ # include "elementary_config.h" #endif -#define EFL_ACCESS_OBJECT_PROTECTED -#include #include #include "elm_suite.h" -#include -typedef unsigned int uint; - -EFL_START_TEST(elm_config_eoapi) -{ - Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); - fail_if(!cfg); - -#define CONFIG_CHK(opt, typ, val) do { \ - typ old = elm_config_ ## opt ## _get(); \ - fail_if(old != efl_config_ ## typ ## _get(cfg, #opt)); \ - fail_if(!efl_config_ ## typ ## _set(cfg, #opt, val)); \ - fail_if(elm_config_ ## opt ## _get() != val); \ - fail_if(efl_config_ ## typ ## _get(cfg, #opt) != val); \ - } while (0) - -#define CONFIG_CHKB(opt, val) CONFIG_CHK(opt, bool, val) -#define CONFIG_CHKI(opt, val) CONFIG_CHK(opt, int, val) -#define CONFIG_CHKD(opt, val) CONFIG_CHK(opt, double, val) - - // note: leaks badly -#define CONFIG_CHKS(opt, val) do { \ - const char *old = elm_config_ ## opt ## _get(); \ - fail_if(!eina_streq(old, efl_config_string_get(cfg, #opt))); \ - fail_if(!efl_config_string_set(cfg, #opt, val)); \ - fail_if(!eina_streq(elm_config_ ## opt ## _get(), val)); \ - fail_if(!eina_streq(efl_config_string_get(cfg, #opt), val)); \ - } while (0) - -#define CONFIG_CHKE(opt, ival, sval) do { \ - elm_config_ ## opt ## _set(ival); \ - fail_if(!eina_streq(efl_config_string_get(cfg, #opt), sval)); \ - fail_if(!efl_config_string_set(cfg, #opt, sval)); \ - fail_if(!eina_streq(efl_config_string_get(cfg, #opt), sval)); \ - } while (0) - - CONFIG_CHKB(scroll_bounce_enabled, !old); - CONFIG_CHKD(scroll_bounce_friction, 0); - CONFIG_CHKD(scroll_page_scroll_friction, 0); - CONFIG_CHKB(context_menu_disabled, !old); - CONFIG_CHKD(scroll_bring_in_scroll_friction, 0); - CONFIG_CHKD(scroll_zoom_friction, 0); - CONFIG_CHKB(scroll_thumbscroll_enabled, !old); - CONFIG_CHKI(scroll_thumbscroll_threshold, 0); - CONFIG_CHKI(scroll_thumbscroll_hold_threshold, 0); - CONFIG_CHKD(scroll_thumbscroll_momentum_threshold, 0); - CONFIG_CHKI(scroll_thumbscroll_flick_distance_tolerance, 0); - CONFIG_CHKD(scroll_thumbscroll_friction, 0); - CONFIG_CHKD(scroll_thumbscroll_min_friction, 0); - CONFIG_CHKD(scroll_thumbscroll_friction_standard, 0); - CONFIG_CHKD(scroll_thumbscroll_border_friction, 0); - CONFIG_CHKD(scroll_thumbscroll_sensitivity_friction, 1.0); - CONFIG_CHKB(scroll_thumbscroll_smooth_start, 0); - CONFIG_CHKB(scroll_animation_disabled, 0); - CONFIG_CHKD(scroll_accel_factor, 0); - CONFIG_CHKD(scroll_thumbscroll_smooth_amount, 0); - CONFIG_CHKD(scroll_thumbscroll_smooth_time_window, 0); - CONFIG_CHKD(scroll_thumbscroll_acceleration_threshold, 0); - CONFIG_CHKD(scroll_thumbscroll_acceleration_time_limit, 0); - CONFIG_CHKD(scroll_thumbscroll_acceleration_weight, 0); - CONFIG_CHKE(focus_autoscroll_mode, EFL_UI_FOCUS_AUTOSCROLL_MODE_NONE, "none"); - CONFIG_CHKE(slider_indicator_visible_mode, EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, "always"); - CONFIG_CHKD(longpress_timeout, 0); - CONFIG_CHKE(softcursor_mode, EFL_UI_SOFTCURSOR_MODE_ON, "on"); - CONFIG_CHKD(tooltip_delay, 0); - CONFIG_CHKB(cursor_engine_only, 0); - CONFIG_CHKD(scale, 0); - CONFIG_CHKS(icon_theme, ELM_CONFIG_ICON_THEME_ELEMENTARY); - CONFIG_CHKB(password_show_last, 0); - CONFIG_CHKD(password_show_last_timeout, 0); - CONFIG_CHKS(preferred_engine, 0); - CONFIG_CHKS(accel_preference, 0); - //font_overlay - CONFIG_CHKB(access, 0); - CONFIG_CHKB(selection_unfocused_clear, 0); - //elm_config_font_overlay_unset - //CONFIG_CHKI(font_hint_type, 0); // this has no get! - CONFIG_CHKI(finger_size, 0); - CONFIG_CHKI(cache_flush_interval, 10); - CONFIG_CHKB(cache_flush_enabled, !old); - CONFIG_CHKI(cache_font_cache_size, 0); - CONFIG_CHKI(cache_image_cache_size, 0); - CONFIG_CHKI(cache_edje_file_cache_size, 0); - CONFIG_CHKI(cache_edje_collection_cache_size, 0); - CONFIG_CHKB(vsync, 0); - CONFIG_CHKB(accel_preference_override, 0); - CONFIG_CHKB(focus_highlight_enabled, !old); - CONFIG_CHKB(focus_highlight_animate, 0); - CONFIG_CHKB(focus_highlight_clip_disabled, !old); - CONFIG_CHKE(focus_move_policy, EFL_UI_FOCUS_MOVE_POLICY_MOVE_IN, "in"); - CONFIG_CHKB(item_select_on_focus_disabled, !old); - CONFIG_CHKB(first_item_focus_on_first_focusin, 0); - CONFIG_CHKB(mirrored, 0); - //see clouseau tests - //CONFIG_CHKB(clouseau_enabled, !old); - CONFIG_CHKD(glayer_long_tap_start_timeout, 0); - CONFIG_CHKD(glayer_double_tap_timeout, 0); - //color_overlay - //color_overlay_unset - CONFIG_CHKB(magnifier_enable, 0); - CONFIG_CHKD(magnifier_scale, 0); - CONFIG_CHKB(window_auto_focus_enable, 0); - CONFIG_CHKB(window_auto_focus_animate, 0); - CONFIG_CHKB(popup_scrollable, 0); - CONFIG_CHKB(atspi_mode, 0); - CONFIG_CHKD(transition_duration_factor, 0); - CONFIG_CHKS(web_backend, old); // no value change (requires web support) - - static const struct { - Edje_Channel chan; - const char *name; - } channels[] = { - { EDJE_CHANNEL_EFFECT, "audio_mute_effect" }, - { EDJE_CHANNEL_BACKGROUND, "audio_mute_background" }, - { EDJE_CHANNEL_MUSIC, "audio_mute_music" }, - { EDJE_CHANNEL_FOREGROUND, "audio_mute_foreground" }, - { EDJE_CHANNEL_INTERFACE, "audio_mute_interface" }, - { EDJE_CHANNEL_INPUT, "audio_mute_input" }, - { EDJE_CHANNEL_ALERT, "audio_mute_alert" }, - { EDJE_CHANNEL_ALL, "audio_mute_all" }, - { EDJE_CHANNEL_ALL, "audio_mute" }, - }; - - for (unsigned i = 0; i < (sizeof(channels) / sizeof(channels[0])); i++) - { - Eina_Bool b = elm_config_audio_mute_get(channels[i].chan); - if (b != efl_config_bool_get(cfg, channels[i].name)) - fail(channels[i].name); - efl_config_bool_set(cfg, channels[i].name, !b); - if(efl_config_bool_get(cfg, channels[i].name) != !b) - fail(channels[i].name); - if(elm_config_audio_mute_get(channels[i].chan) != !b) - fail(channels[i].name); - } - -} -EFL_END_TEST - -EFL_START_TEST(elm_config_win) -{ - Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); - fail_if(!cfg); - - Eo *win = efl_add_ref(EFL_UI_WIN_CLASS, NULL); - Eo *cfg2 = efl_provider_find(win, EFL_CONFIG_INTERFACE); - fail_if(cfg != cfg2); - - elm_config_cache_flush_interval_set(42); - fail_if(efl_config_int_get(win, "cache_flush_interval") != 42); - - efl_unref(win); -} -EFL_END_TEST - -static inline Eina_Bool -_eina_list_string_has(const Eina_List *list, const char *str) -{ - const char *s; - const Eina_List *l; - - EINA_LIST_FOREACH(list, l, s) - if (eina_streq(str, s)) - return EINA_TRUE; - - return EINA_FALSE; -} - EFL_START_TEST(elm_config_profiles) { - // this only tests some of the profile APIs. we're not going to mess with - // the global config during make check :) - - Eo *cfg = efl_provider_find(efl_main_loop_get(), EFL_CONFIG_INTERFACE); - fail_if(!cfg); - - for (int hidden = 0; hidden <= 1; hidden++) - { - Eina_List *list; - Eina_Iterator *it; - const char *prof; - unsigned int cnt = 0; - - list = (!hidden) ? elm_config_profile_list_get() - : elm_config_profile_list_full_get(); - it = efl_config_profile_iterate(cfg, hidden); - EINA_ITERATOR_FOREACH(it, prof) - { - fail_if(!_eina_list_string_has(list, prof)); - cnt++; - } - fail_if(cnt != eina_list_count(list)); - elm_config_profile_list_free(list); - eina_iterator_free(it); - } - const char *dir, *profile; - Eina_Stringshare *str; profile = elm_config_profile_get(); fail_if(!profile); dir = elm_config_profile_dir_get(profile, EINA_TRUE); - str = efl_config_profile_dir_get(cfg, profile, EINA_TRUE); - fail_if(!eina_streq(dir, str)); + ck_assert(dir); elm_config_profile_dir_free(dir); - eina_stringshare_del(str); dir = elm_config_profile_dir_get(profile, EINA_FALSE); - str = efl_config_profile_dir_get(cfg, profile, EINA_FALSE); - fail_if(!eina_streq(dir, str)); + ck_assert(dir); elm_config_profile_dir_free(dir); - eina_stringshare_del(str); - } EFL_END_TEST void elm_test_config(TCase *tc) { - tcase_add_test(tc, elm_config_eoapi); - tcase_add_test(tc, elm_config_win); tcase_add_test(tc, elm_config_profiles); } diff --git a/src/tests/elementary/meson.build b/src/tests/elementary/meson.build index 3bd7d2f85a..7046aa8862 100644 --- a/src/tests/elementary/meson.build +++ b/src/tests/elementary/meson.build @@ -123,6 +123,7 @@ efl_ui_suite_src = [ 'efl_ui_test_win.c', 'efl_ui_test_atspi.c', 'efl_ui_test_callback.c', + 'efl_ui_test_config.c', 'efl_ui_test_focus_common.c', 'efl_ui_test_focus_common.h', 'efl_ui_test_focus.c', From 62d4d4c5b81fe4c9e03d62503409a36616177f19 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Thu, 25 Jul 2019 10:38:12 -0400 Subject: [PATCH 54/72] elm/ctxpopup: check list existence before trying to delete list items this is kinda gross, but if the list is already deleted then the list items are also gone and this is an invalid object access @fix Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9402 --- src/lib/elementary/elc_ctxpopup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c index 08817bac70..fadf7af26a 100644 --- a/src/lib/elementary/elc_ctxpopup.c +++ b/src/lib/elementary/elc_ctxpopup.c @@ -862,7 +862,9 @@ _elm_ctxpopup_item_elm_widget_item_del_pre(Eo *eo_ctxpopup_it EINA_UNUSED, { if (ctxpopup_it->list_item) { - elm_object_item_del(ctxpopup_it->list_item); + Elm_Ctxpopup_Data *sd = efl_data_scope_safe_get(WIDGET(ctxpopup_it), MY_CLASS); + if (sd->list) + elm_object_item_del(ctxpopup_it->list_item); ctxpopup_it->list_item = NULL; } } From e0ae3a9a768f1c8b7b840e250ef0d7a4c8b39d13 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 24 Jul 2019 13:59:03 -0400 Subject: [PATCH 55/72] efl_ui/widget: check legacy type on correct object for scroll_hold push/pop too much copy/paste Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9399 --- src/lib/elementary/efl_ui_widget.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 4d7d0da9f6..43fe92bd86 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -2117,7 +2117,7 @@ _efl_ui_widget_scroll_hold_push(Eo *obj, Elm_Widget_Smart_Data *sd) { if (elm_widget_is(child) && _elm_scrollable_is(child)) { - if (elm_widget_is_legacy(obj)) + if (elm_widget_is_legacy(child)) elm_interface_scrollable_hold_set(child, EINA_TRUE); else efl_ui_scrollable_scroll_hold_set(child, EINA_TRUE); @@ -2151,7 +2151,7 @@ _efl_ui_widget_scroll_hold_pop(Eo *obj, Elm_Widget_Smart_Data *sd) { if (elm_widget_is(child) && _elm_scrollable_is(child)) { - if (elm_widget_is_legacy(obj)) + if (elm_widget_is_legacy(child)) elm_interface_scrollable_hold_set(child, EINA_FALSE); else efl_ui_scrollable_scroll_hold_set(child, EINA_FALSE); From e1f2b9d23593302b3c7f1e05b933b551cee1bbbe Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 24 Jul 2019 12:44:31 -0400 Subject: [PATCH 56/72] elm_test: replace bespoke arg handling with a for loop this fixes handling of --help regardless of its position in the arg array Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9405 --- src/bin/elementary/test.c | 48 ++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 21 deletions(-) diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 4a77460058..3222fad2c9 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -1387,33 +1387,39 @@ efl_main(void *data EINA_UNUSED, /* if called with a single argument try to autorun a test with * the same name as the given param * ex: elementary_test "Box Vert 2" */ - if (eina_array_count(arge->argv) == 2) + if (eina_array_count(arge->argv) >= 2) { - if ((!strcmp(eina_array_data_get(arge->argv, 1), "--help")) || - (!strcmp(eina_array_data_get(arge->argv, 1), "-help")) || - (!strcmp(eina_array_data_get(arge->argv, 1), "-h"))) + unsigned int i; + for (i = 1; i < eina_array_count(arge->argv); i++) { - efl_loop_quit(ev->object, - eina_value_string_init("Usages:\n" - "$ elementary_test\n" - "$ elementary_test --test-win-only [TEST_NAME]\n" - "$ elementary_test -to [TEST_NAME]\n\n" - "Examples:\n" - "$ elementary_test -to Button\n\n")); - return ; + char *arg = eina_array_data_get(arge->argv, i); + if ((!strcmp(arg, "--help")) || + (!strcmp(arg, "-help")) || + (!strcmp(arg, "-h"))) + { + efl_loop_quit(ev->object, + eina_value_string_init("Usages:\n" + "$ elementary_test\n" + "$ elementary_test --test-win-only [TEST_NAME]\n" + "$ elementary_test -to [TEST_NAME]\n\n" + "Examples:\n" + "$ elementary_test -to Button\n\n")); + return ; + } + /* Just a workaround to make the shot module more + * useful with elementary test. */ + if ((!strcmp(arg, "--test-win-only")) || + (!strcmp(arg, "-to"))) + { + test_win_only = EINA_TRUE; + } + else if ((i == eina_array_count(arge->argv) - 1) && (arg[0] != '-')) + autorun = arg; + } - autorun = eina_array_data_get(arge->argv, 1); } else if (eina_array_count(arge->argv) == 3) { - /* Just a workaround to make the shot module more - * useful with elementary test. */ - if ((!strcmp(eina_array_data_get(arge->argv, 1), "--test-win-only")) || - (!strcmp(eina_array_data_get(arge->argv, 1), "-to"))) - { - test_win_only = EINA_TRUE; - autorun = eina_array_data_get(arge->argv, 2); - } } my_win_main(autorun, test_win_only); /* create main window */ From d01885ec8b6fd039acc206e82d1bd805420e6eb9 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 24 Jul 2019 13:16:58 -0400 Subject: [PATCH 57/72] elm_test: add keybinds to rapidly flip between tests when not using --test-win-only, allow opening new tests forward and backward with alt+. and alt+, Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9406 --- src/bin/elementary/test.c | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 3222fad2c9..8856c7cab1 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -405,7 +405,7 @@ static void _list_udpate(void); static Evas_Object *win, *tbx, *entry; // TODO: refactoring static void *tt; -static Eina_List *tests; +static Eina_List *tests, *cur_test;; static Eina_Bool hide_legacy = EINA_FALSE; static Eina_Bool hide_beta = EINA_FALSE; @@ -643,6 +643,32 @@ _space_removed_string_get(const char *name) return ret; } +static Eina_Bool +_my_win_key_up(void *d EINA_UNUSED, int type EINA_UNUSED, Ecore_Event_Key *ev) +{ + struct elm_test *t; + + if (eina_streq(ev->key, "comma") && (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) + { + if (cur_test) + cur_test = eina_list_prev(cur_test); + if (!cur_test) + cur_test = eina_list_last(tests); + t = eina_list_data_get(cur_test); + t->cb(NULL, NULL, NULL); + } + else if (eina_streq(ev->key, "period") && (ev->modifiers & ECORE_EVENT_MODIFIER_ALT)) + { + if (cur_test) + cur_test = eina_list_next(cur_test); + if (!cur_test) + cur_test = tests; + t = eina_list_data_get(cur_test); + t->cb(NULL, NULL, NULL); + } + return ECORE_CALLBACK_RENEW; +} + static void my_win_main(const char *autorun, Eina_Bool test_win_only) { @@ -1300,7 +1326,10 @@ add_tests: } if (tests) - _menu_create(NULL); + { + _menu_create(NULL); + ecore_event_handler_add(ECORE_EVENT_KEY_UP, (Ecore_Event_Handler_Cb)_my_win_key_up, NULL); + } /* bring in autorun frame */ if (autorun) From b4f5b78550f10531fc9b5fc04e1a77327908b580 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 29 Jul 2019 16:07:25 +0200 Subject: [PATCH 58/72] efl_ui_item: remove self field Summary: there is no reason to have this field, pd of a item is always passed with the object. Reviewers: segfaultxavi, zmike, cedric Reviewed By: zmike Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D9423 --- src/lib/elementary/efl_ui_item.c | 5 ++--- src/lib/elementary/efl_ui_item_private.h | 1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index 5119568773..7b9beab362 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -302,7 +302,7 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Item_Data *pd) { Evas_Coord minh = -1, minw = -1; Evas_Coord rest_w = 0, rest_h = 0; - ELM_WIDGET_DATA_GET_OR_RETURN(pd->obj, wd); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, rest_w, rest_h); @@ -331,9 +331,8 @@ _efl_ui_item_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Item_Data *pd) } EOLIAN static Eo * -_efl_ui_item_efl_object_constructor(Eo *obj, Efl_Ui_Item_Data *pd) +_efl_ui_item_efl_object_constructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED) { - pd->obj = obj; obj = efl_constructor(efl_super(obj, MY_CLASS)); return obj; diff --git a/src/lib/elementary/efl_ui_item_private.h b/src/lib/elementary/efl_ui_item_private.h index ea8ac073c9..bb09c2e509 100644 --- a/src/lib/elementary/efl_ui_item_private.h +++ b/src/lib/elementary/efl_ui_item_private.h @@ -6,7 +6,6 @@ typedef struct _Efl_Ui_Item_Data { // Eo Objects - Eo *obj; /* Self-Object */ Eo *parent; /* Parent Widget */ Ecore_Timer *longpress_timer; /* Timer for longpress handle */ From e6726c6f92c3217ca4d5dbcd3b73b0d3a2fb8a9a Mon Sep 17 00:00:00 2001 From: Xavi Artigas Date: Mon, 29 Jul 2019 16:15:55 +0200 Subject: [PATCH 59/72] docfx: Missing template file Otherwise, section DIV at the namespace level is always shown, even if empty. And we do not want that now that the DIV has a background color. --- .../default_efl/partials/namespace.tmpl.partial | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 doc/docfx/default_efl/partials/namespace.tmpl.partial diff --git a/doc/docfx/default_efl/partials/namespace.tmpl.partial b/doc/docfx/default_efl/partials/namespace.tmpl.partial new file mode 100644 index 0000000000..9da6b786fd --- /dev/null +++ b/doc/docfx/default_efl/partials/namespace.tmpl.partial @@ -0,0 +1,15 @@ +{{!Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license. See LICENSE file in the project root for full license information.}} + +

{{>partials/title}}

+
{{{summary}}}
+
{{{conceptual}}}
+{{#remarks}} +
{{{remarks}}}
+{{/remarks}} +{{#children}} +

{{>partials/namespaceSubtitle}}

+ {{#children}} +

+
{{{summary}}}
+ {{/children}} +{{/children}} From a247bd0f56cfd9ececa40b32c562541717a55e5b Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jul 2019 12:56:10 -0400 Subject: [PATCH 60/72] efl_ui/popup: use correct class when setting popup backwall file MY_CLASS failure strikes again Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9416 --- src/lib/elementary/efl_ui_popup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c index 341de7e750..c60f13753d 100644 --- a/src/lib/elementary/efl_ui_popup.c +++ b/src/lib/elementary/efl_ui_popup.c @@ -361,7 +361,7 @@ _efl_ui_popup_part_backwall_efl_file_load(Eo *obj, void *_pd EINA_UNUSED) if (efl_file_loaded_get(obj)) return 0; - err = efl_file_load(efl_super(obj, MY_CLASS)); + err = efl_file_load(efl_super(obj, EFL_UI_POPUP_PART_BACKWALL_CLASS)); if (err) return err; Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content"); From a61cef3fb208655bb98e2bc511c2abe2b9169587 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jul 2019 12:54:41 -0400 Subject: [PATCH 61/72] efl_ui/popup: implement efl.file.unload for popup backwall part this fixes unsetting images for popup backwall @fix Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9415 --- src/lib/elementary/efl_ui_popup.c | 16 ++++++++++++++++ src/lib/elementary/efl_ui_popup_part_backwall.eo | 1 + 2 files changed, 17 insertions(+) diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c index c60f13753d..8d7271eb67 100644 --- a/src/lib/elementary/efl_ui_popup.c +++ b/src/lib/elementary/efl_ui_popup.c @@ -351,6 +351,22 @@ _efl_ui_popup_part_backwall_repeat_events_get(const Eo *obj, void *_pd EINA_UNUS return efl_canvas_object_repeat_events_get(sd->backwall); } +EOLIAN static void +_efl_ui_popup_part_backwall_efl_file_unload(Eo *obj, void *_pd EINA_UNUSED) +{ + Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS); + Efl_Ui_Popup_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_POPUP_CLASS); + + efl_file_unload(efl_super(obj, EFL_UI_POPUP_PART_BACKWALL_CLASS)); + Eo *prev_obj = edje_object_part_swallow_get(sd->backwall, "efl.content"); + if (prev_obj) + { + edje_object_signal_emit(sd->backwall, "efl,state,content,unset", "efl"); + edje_object_part_unswallow(sd->backwall, prev_obj); + efl_del(prev_obj); + } +} + EOLIAN static Eina_Error _efl_ui_popup_part_backwall_efl_file_load(Eo *obj, void *_pd EINA_UNUSED) { diff --git a/src/lib/elementary/efl_ui_popup_part_backwall.eo b/src/lib/elementary/efl_ui_popup_part_backwall.eo index 4a6a914a45..64bd8636b7 100644 --- a/src/lib/elementary/efl_ui_popup_part_backwall.eo +++ b/src/lib/elementary/efl_ui_popup_part_backwall.eo @@ -26,5 +26,6 @@ class @beta Efl.Ui.Popup_Part_Backwall extends Efl.Ui.Layout_Part implements Efl } implements { Efl.File.load; + Efl.File.unload; } } From 44a45e3acadb61235e5230d2ff38b967b99e7a39 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Sun, 28 Jul 2019 17:11:40 +0200 Subject: [PATCH 62/72] efl_ui_item: migrate to Efl.Ui.Clickable this adds the mixin to the item. With this commit every class inheriting from Efl.Ui.Item will automatically emit all the clickable events. Reviewed-by: Mike Blumenkrantz Reviewed-by: Xavi Artigas Differential Revision: https://phab.enlightenment.org/D8830 --- src/lib/elementary/efl_ui_item.c | 137 +++--------------- src/lib/elementary/efl_ui_item_private.h | 2 - .../elementary/spec/efl_test_clickable.c | 15 +- src/tests/elementary/spec/efl_ui_spec_suite.c | 2 + 4 files changed, 36 insertions(+), 120 deletions(-) diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c index 7b9beab362..26911a3a73 100644 --- a/src/lib/elementary/efl_ui_item.c +++ b/src/lib/elementary/efl_ui_item.c @@ -167,134 +167,39 @@ _item_unselect(Eo *obj, Efl_Ui_Item_Data *pd) } /* Mouse Controls */ -static Eina_Bool -_item_longpressed(void *data) +static void +_item_pressed(void *data, const Efl_Event *ev EINA_UNUSED) { - Efl_Ui_Item *item = data; - EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd, ECORE_CALLBACK_CANCEL); + Efl_Ui_Item *obj = data; + if (efl_ui_widget_disabled_get(obj)) return; - pd->longpress_timer = NULL; - - efl_event_callback_call(item, EFL_INPUT_EVENT_LONGPRESSED, NULL); - return ECORE_CALLBACK_CANCEL; + efl_layout_signal_emit(obj, "efl,state,pressed", "efl"); } static void -_item_mouse_down(void *data, - Evas *evas EINA_UNUSED, - Evas_Object *obj EINA_UNUSED, - void *event_info) +_item_unpressed(void *data, const Efl_Event *ev EINA_UNUSED) { - Evas_Event_Mouse_Down *ev = event_info; - Eo *item = data; - EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd); - ELM_WIDGET_DATA_GET_OR_RETURN(item, wd); - if (wd->disabled) return; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; - - edje_object_signal_emit(wd->resize_obj, "efl,state,pressed", "efl"); - - pd->longpress_timer = ecore_timer_add(_elm_config->longpress_timeout, _item_longpressed, item); - efl_event_callback_call(item, EFL_INPUT_EVENT_PRESSED, NULL); -} - -static void -_item_mouse_up(void *data, - Evas *evas EINA_UNUSED, - Evas_Object *obj EINA_UNUSED, - void *event_info) -{ - Evas_Event_Mouse_Up *ev = event_info; - Eo *item = data; + Efl_Ui_Item *obj = data; Efl_Ui_Select_Mode m; + EFL_UI_ITEM_DATA_GET_OR_RETURN(obj, pd); - if (!efl_ui_item_container_get(item)) - return; - EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd); - ELM_WIDGET_DATA_GET_OR_RETURN(item, wd); - if (wd->disabled) return; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) - { - //FIXME: should we send this message to fallback? - edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); - //efl_event_callback_call(item, EFL_INPUT_EVENT_UNPRESSED, NULL); - return; - } + if (efl_ui_widget_disabled_get(obj)) return; + if (!efl_ui_item_container_get(obj)) return; - if (pd->longpress_timer) - { - ecore_timer_del(pd->longpress_timer); - pd->longpress_timer = NULL; - } + efl_layout_signal_emit(obj, "efl,state,unpressed", "efl"); + m = efl_ui_select_mode_get(efl_ui_item_container_get(obj)); - edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); - efl_event_callback_call(item, EFL_INPUT_EVENT_UNPRESSED, NULL); - - m = efl_ui_select_mode_get(efl_ui_item_container_get(item)); if ((m != EFL_UI_SELECT_MODE_SINGLE_ALWAYS) && (pd->selected)) - _item_unselect(item, pd); + _item_unselect(obj, pd); else if (m != EFL_UI_SELECT_MODE_NONE) - _item_select(item, pd); + _item_select(obj, pd); } -static void -_item_mouse_move(void *data EINA_UNUSED, - Evas *evas EINA_UNUSED, - Evas_Object *obj EINA_UNUSED, - void *event_info) -{ - Evas_Event_Mouse_Move *ev = event_info; - Eo *item = data; - EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd); - ELM_WIDGET_DATA_GET_OR_RETURN(item, wd); - if (wd->disabled) return; - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) - { - edje_object_signal_emit(wd->resize_obj, "efl,state,unpressed", "efl"); - return; - } -} +EFL_CALLBACKS_ARRAY_DEFINE(self_listening, + {EFL_INPUT_EVENT_PRESSED, _item_pressed}, + {EFL_INPUT_EVENT_UNPRESSED, _item_unpressed}, +) -static void -_item_mouse_in(void *data EINA_UNUSED, - Evas *evas EINA_UNUSED, - Evas_Object *obj EINA_UNUSED, - void *event_info) -{ - Evas_Event_Mouse_In *ev = event_info; - Eo *item = data; - EFL_UI_ITEM_DATA_GET_OR_RETURN(item, pd); - ELM_WIDGET_DATA_GET_OR_RETURN(item, wd); - if (wd->disabled) return; - - if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return; -} - -static void -_item_mouse_callback_add(Eo *obj, void *data) -{ - evas_object_event_callback_add - (obj, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down, data); - evas_object_event_callback_add - (obj, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up, data); - evas_object_event_callback_add - (obj, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move, data); - evas_object_event_callback_add - (obj, EVAS_CALLBACK_MOUSE_IN, _item_mouse_in, data); -} - -static void -_item_mouse_callback_del(Eo *obj, void *data) -{ - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_MOUSE_DOWN, _item_mouse_down, data); - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_MOUSE_UP, _item_mouse_up, data); - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_MOUSE_MOVE, _item_mouse_move, data); - evas_object_event_callback_del_full - (obj, EVAS_CALLBACK_MOUSE_IN, _item_mouse_in, data); -} /* Mouse Controls ends */ static void @@ -335,6 +240,8 @@ _efl_ui_item_efl_object_constructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED) { obj = efl_constructor(efl_super(obj, MY_CLASS)); + efl_event_callback_array_add(obj, self_listening(), obj); + return obj; } @@ -348,7 +255,7 @@ _efl_ui_item_efl_object_finalize(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED) /* Support Item Focus Feature */ elm_widget_can_focus_set(obj, EINA_TRUE); - _item_mouse_callback_add(wd->resize_obj, eo); + efl_ui_clickable_util_bind_to_object(wd->resize_obj, obj); return eo; } @@ -357,7 +264,6 @@ _efl_ui_item_efl_object_destructor(Eo *obj, Efl_Ui_Item_Data *pd EINA_UNUSED) { ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); - _item_mouse_callback_del(wd->resize_obj, obj); efl_destructor(efl_super(obj, MY_CLASS)); } @@ -396,7 +302,6 @@ _efl_ui_item_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd) return pd->parent; } - /* Internal EO APIs and hidden overrides */ #define EFL_UI_ITEM_EXTRA_OPS \ diff --git a/src/lib/elementary/efl_ui_item_private.h b/src/lib/elementary/efl_ui_item_private.h index bb09c2e509..e6babde8a3 100644 --- a/src/lib/elementary/efl_ui_item_private.h +++ b/src/lib/elementary/efl_ui_item_private.h @@ -8,8 +8,6 @@ typedef struct _Efl_Ui_Item_Data // Eo Objects Eo *parent; /* Parent Widget */ - Ecore_Timer *longpress_timer; /* Timer for longpress handle */ - // Boolean Data Eina_Bool selected : 1; /* State for item selected */ Eina_Bool needs_size_calc : 1; /* Flag for Size calculation */ diff --git a/src/tests/elementary/spec/efl_test_clickable.c b/src/tests/elementary/spec/efl_test_clickable.c index c6ca54883b..3068aec140 100644 --- a/src/tests/elementary/spec/efl_test_clickable.c +++ b/src/tests/elementary/spec/efl_test_clickable.c @@ -3,12 +3,14 @@ #endif #include +#include #include "efl_ui_spec_suite.h" #include "suite_helpers.h" - +#include "eo_internal.h" +#include "elm_widget.h" /* spec-meta-start {"test-interface":"Efl.Ui.Clickable", - "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame"] + "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized"] } spec-meta-end */ @@ -58,6 +60,15 @@ prepare_window(void) pos->x = 30; pos->y = 10; } + else if (efl_isa(widget, EFL_UI_ITEM_CLASS)) + { + elm_widget_theme_klass_set(widget, "grid_item"); + elm_widget_theme_element_set(widget, NULL); + elm_widget_theme_style_set(widget, NULL); + efl_ui_widget_theme_apply(widget); + pos->x = 30; + pos->y = 30; + } evas_smart_objects_calculate(evas_object_evas_get(win)); evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, prepare_window_norendered, pos); diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c index dc5462a89e..50b32c362e 100644 --- a/src/tests/elementary/spec/efl_ui_spec_suite.c +++ b/src/tests/elementary/spec/efl_ui_spec_suite.c @@ -12,6 +12,8 @@ Evas_Object *win = NULL; Evas_Object *widget = NULL; const Efl_Class *test_content_klass = NULL; EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); +EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS); +#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get() static void _setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass) From 0ab05a82716a8c5ed23e953987c33f57e3655be9 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 29 Jul 2019 13:56:27 +0000 Subject: [PATCH 63/72] efl_ui_item: try to improve docs its everything but perfect, but a start ... Reviewed-by: Marcel Hollerbach Differential Revision: https://phab.enlightenment.org/D9424 --- src/lib/elementary/efl_ui_item.eo | 43 +++++++++++++++++++++++-------- 1 file changed, 32 insertions(+), 11 deletions(-) diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo index a97ec30568..aa760046f1 100644 --- a/src/lib/elementary/efl_ui_item.eo +++ b/src/lib/elementary/efl_ui_item.eo @@ -1,27 +1,50 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Input.Clickable { - [[Item abstract class for pack widget. All item have to be inherited from this class.]] + [[Selectable Item abstraction. + + This class serves as the basis to create widgets acting as selectable items inside containers + like @Efl.Ui.List or @Efl.Ui.Grid, for example. + @Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin. + Items can be pressed, long-pressed, etc, and appropriate events are generated. + @Efl.Ui.Item also implements the @Efl.Ui.Selectable interface, meaning that "selected" and + "unselected" events are automatically generated. + + Classes inheriting from this one only need to deal with the visual representation of the widget. + See for example @Efl.Ui.Grid_Default_Item and @Efl.Ui.List_Default_Item. + + Some events are converted to edje signals so the theme can react to them: + @[Efl.Input.Clickable.pressed] -> "efl,state,pressed", + @[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed", + @[Efl.Ui.Selectable.item,selected] -> "efl,state,selected", + @[Efl.Ui.Selectable.item,unselected] -> "efl,state,unselected". + ]] methods { @property index { - [[index number of item from their parent object.]] + [[The index of this item inside its container. + + The container must be set through the @Efl.Ui.Item.container property.]] get {} values { - index : int; + index : int; [[The index where to find this item in its $container.]] } } @property selected { - [[Select property for item object. - Item can be selected by user mouse/key input also]] - set {} - get {} + [[Item selected state. + + The visual representation of the item will be adjusted accordingly to the new state. + This property is also automatically modified in response to user actions. + ]] values { - select: bool; + select: bool; [[Whether this item is selected or not.]] } } @property container { [[The container this object is part of. - You should never use this property yourself, the container will set it. Unsetting this while the item is packed into a container does not have an impact on its state in the container. + You should never use this property directly, the container will set it when the + item is added. + Unsetting this while the item is packed inside a container does not remove the item + from the container. ]] values { container : Efl.Ui.Widget; [[The container this item is in.]] @@ -29,11 +52,9 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectab } } implements { - //Efl.Object Efl.Object.constructor; Efl.Object.finalize; Efl.Object.destructor; - //Efl.Canvas Efl.Canvas.Group.group_calculate; } } From 7927023fc7a3aeebbb570f4e5cc0be36b99218c9 Mon Sep 17 00:00:00 2001 From: Lauro Moura Date: Mon, 29 Jul 2019 11:24:26 -0300 Subject: [PATCH 64/72] pyolian: Fix tests Summary: Update tests after some legacy cleanup from last release. Reviewers: bu5hm4n, DaveMDS, segfaultxavi Reviewed By: DaveMDS Subscribers: segfaultxavi, cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8817 --- src/scripts/pyolian/test_eolian.py | 77 +++++++++++++++++------------- 1 file changed, 45 insertions(+), 32 deletions(-) diff --git a/src/scripts/pyolian/test_eolian.py b/src/scripts/pyolian/test_eolian.py index 23a618be11..b597e812b7 100755 --- a/src/scripts/pyolian/test_eolian.py +++ b/src/scripts/pyolian/test_eolian.py @@ -59,7 +59,7 @@ class TestEolianState(unittest.TestCase): self.assertIsInstance(unit, eolian.Eolian_Unit) self.assertTrue(unit.file.endswith(('.eo', '.eot'))) count += 1 - self.assertGreater(count, 500) + self.assertGreater(count, 400) unit = eolian_db.unit_by_file_get('efl_ui_win.eo') self.assertIsInstance(unit, eolian.Eolian_Unit) @@ -167,8 +167,8 @@ class TestEolianUnit(unittest.TestCase): self.assertGreater(all_count, 50) def test_alias_listing(self): - l = list(eolian_db.aliases_by_file_get('edje_types.eot')) - self.assertGreater(len(l), 5) + l = list(eolian_db.aliases_by_file_get('eina_types.eot')) + self.assertGreater(len(l), 2) self.assertIsInstance(l[0], eolian.Typedecl) all_count = 0 @@ -211,12 +211,30 @@ class TestEolianNamespace(unittest.TestCase): for ns in eolian_db.all_namespaces: self.assertIsInstance(ns, eolian.Namespace) count += 1 - self.assertGreater(count, 100) + self.assertGreater(count, 50) def test_namespace_vs_class_collision(self): + colliding_classes = ['Ecore.Audio', + 'Ecore.Audio.In', + 'Ecore.Audio.Out', + 'Ecore.Event.Message', + 'Ector.Buffer', + 'Ector.Renderer', + 'Ector.Renderer.Cairo', + 'Ector.Renderer.GL', + 'Ector.Renderer.Gradient', + 'Ector.Renderer.Software', + 'Ector.Software.Buffer', + 'Eio.Sentry', + 'Eldbus.Model', + ] for ns in eolian_db.all_namespaces: cls = eolian_db.class_by_name_get(ns.name) - self.assertIsNone(cls) + # Some legacy classes are parsed and still make this fail. + if cls: + self.assertIn(cls.name, colliding_classes) + else: + self.assertIsNone(cls) def test_namespace_equality(self): ns1 = eolian.Namespace(eolian_db, 'Efl.Io') @@ -323,7 +341,6 @@ class TestEolianClass(unittest.TestCase): self.assertEqual(list(cls.namespaces), ['Efl']) self.assertEqual(cls.type, eolian.Eolian_Class_Type.REGULAR) self.assertIsInstance(cls.documentation, eolian.Documentation) - self.assertEqual(cls.legacy_prefix, 'ecore_timer') self.assertIsNone(cls.eo_prefix) # TODO fin a class with a value self.assertIsNone(cls.event_prefix) # TODO same as above self.assertIsNone(cls.data_type) # TODO same as above @@ -335,8 +352,8 @@ class TestEolianClass(unittest.TestCase): self.assertEqual(cls.c_get_function_name, 'efl_loop_timer_class_get') self.assertEqual(cls.c_macro, 'EFL_LOOP_TIMER_CLASS') self.assertEqual(cls.c_data_type, 'Efl_Loop_Timer_Data') - self.assertEqual([f.name for f in cls.methods], ['reset','loop_reset','delay']) - self.assertEqual([f.name for f in cls.properties], ['interval','pending']) + self.assertEqual([f.name for f in cls.methods], ['timer_reset','timer_loop_reset','timer_delay']) + self.assertEqual([f.name for f in cls.properties], ['timer_interval','time_pending']) self.assertGreater(len(list(cls.implements)), 5) self.assertIsInstance(list(cls.implements)[0], eolian.Implement) @@ -344,9 +361,9 @@ class TestEolianClass(unittest.TestCase): class TestEolianFunction(unittest.TestCase): def test_function(self): cls = eolian_db.class_by_name_get('Efl.Loop_Timer') - f = cls.function_by_name_get('delay') + f = cls.function_by_name_get('timer_delay') self.assertIsInstance(f, eolian.Function) - self.assertEqual(f.name, 'delay') + self.assertEqual(f.name, 'timer_delay') self.assertEqual(f.type, eolian.Eolian_Function_Type.METHOD) self.assertEqual(f.method_scope, eolian.Eolian_Object_Scope.PUBLIC) self.assertEqual(f.getter_scope, eolian.Eolian_Object_Scope.UNKNOWN) # TODO correct? @@ -354,13 +371,9 @@ class TestEolianFunction(unittest.TestCase): self.assertEqual(f.full_c_method_name, 'efl_loop_timer_delay') self.assertEqual(f.full_c_getter_name, 'efl_loop_timer_delay_get') self.assertEqual(f.full_c_setter_name, 'efl_loop_timer_delay_set') - self.assertEqual(f.full_c_method_name_legacy, 'ecore_timer_delay') - self.assertEqual(f.full_c_getter_name_legacy, 'ecore_timer_delay_get') - self.assertEqual(f.full_c_setter_name_legacy, 'ecore_timer_delay_set') self.assertIsNone(f.method_return_type) # TODO correct ? self.assertIsNone(f.setter_return_type) # TODO correct ? self.assertIsNone(f.getter_return_type) # TODO correct ? - self.assertFalse(f.is_legacy_only(eolian.Eolian_Function_Type.PROP_GET)) self.assertFalse(f.is_class) self.assertFalse(f.is_beta) self.assertFalse(f.is_constructor(cls)) @@ -375,7 +388,7 @@ class TestEolianFunction(unittest.TestCase): def test_function_parameter(self): cls = eolian_db.class_by_name_get('Efl.Loop_Timer') - f = cls.function_by_name_get('delay') + f = cls.function_by_name_get('timer_delay') p = list(f.parameters)[0] self.assertEqual(p.direction, eolian.Eolian_Parameter_Dir.IN) self.assertEqual(p.name, 'add') @@ -388,10 +401,10 @@ class TestEolianFunction(unittest.TestCase): class TestEolianImplement(unittest.TestCase): def test_implement(self): cls = eolian_db.class_by_name_get('Efl.Loop_Timer') - f = cls.function_by_name_get('delay') + f = cls.function_by_name_get('timer_delay') im = f.implement self.assertIsInstance(im, eolian.Implement) - self.assertEqual(im.name, 'Efl.Loop_Timer.delay') + self.assertEqual(im.name, 'Efl.Loop_Timer.timer_delay') self.assertIsInstance(im.class_, eolian.Class) self.assertIsInstance(im.function, eolian.Function) self.assertIsInstance(im.documentation_get(), eolian.Documentation) # TODO is UNRESOLVED correct ? @@ -407,10 +420,10 @@ class TestEolianImplement(unittest.TestCase): class TestEolianEvent(unittest.TestCase): def test_event(self): cls = eolian_db.class_by_name_get('Efl.Loop_Timer') - self.assertEqual([e.name for e in cls.events], ['tick']) - ev = cls.event_by_name_get('tick') + self.assertEqual([e.name for e in cls.events], ['timer,tick']) + ev = cls.event_by_name_get('timer,tick') self.assertIsInstance(ev, eolian.Event) - self.assertEqual(ev.name, 'tick') + self.assertEqual(ev.name, 'timer,tick') self.assertEqual(ev.c_macro, 'EFL_LOOP_TIMER_EVENT_TIMER_TICK') self.assertIsNone(ev.type) # TODO is this correct self.assertIsInstance(ev.documentation, eolian.Documentation) @@ -441,7 +454,7 @@ class TestEolianConstructor(unittest.TestCase): ctor = ctors[0] self.assertIsInstance(ctor, eolian.Constructor) self.assertEqual(ctor.name, 'Efl.Ui.Win.win_name') - self.assertFalse(ctor.is_optional) + self.assertTrue(ctor.is_optional) self.assertIsInstance(ctor.class_, eolian.Class) self.assertEqual(ctor.class_.name, 'Efl.Ui.Win') self.assertIsInstance(ctor.function, eolian.Function) @@ -450,14 +463,14 @@ class TestEolianConstructor(unittest.TestCase): class TestEolianDocumentation(unittest.TestCase): def test_documentation(self): - td = eolian_db.class_by_name_get('Efl.Net.Control.Manager') + td = eolian_db.class_by_name_get('Efl.Object') doc = td.documentation self.assertIsInstance(doc, eolian.Documentation) self.assertIsInstance(doc.summary, str) self.assertGreater(len(doc.summary), 10) self.assertIsInstance(doc.description, str) self.assertGreater(len(doc.description), 20) - self.assertEqual(doc.since, '1.19') + self.assertEqual(doc.since, '1.22') class TestEolianVariable(unittest.TestCase): @@ -475,10 +488,10 @@ class TestEolianVariable(unittest.TestCase): self.assertIsNone(var.value) # TODO is None correct here? no value? def test_variable_constant(self): - var = eolian_db.constant_by_name_get('Efl.Gfx.Hint_Fill') + var = eolian_db.constant_by_name_get('Efl.Gfx.Hint_Expand') self.assertIsInstance(var, eolian.Variable) - self.assertEqual(var.name, 'Efl.Gfx.Hint_Fill') - self.assertEqual(var.short_name, 'Size_Hint_Fill') + self.assertEqual(var.name, 'Efl.Gfx.Hint_Expand') + self.assertEqual(var.short_name, 'Hint_Expand') self.assertEqual(var.type, eolian.Eolian_Variable_Type.CONSTANT) self.assertEqual(var.file, 'efl_gfx_hint.eo') self.assertFalse(var.is_extern) @@ -551,7 +564,7 @@ class TestEolianTypedecl(unittest.TestCase): class TestEolianType(unittest.TestCase): def test_type_regular_builtin(self): cls = eolian_db.class_by_name_get('Efl.Loop_Timer') - func = cls.function_by_name_get('delay') + func = cls.function_by_name_get('timer_delay') param = list(func.parameters)[0] t = param.type # type: double self.assertIsInstance(t, eolian.Type) @@ -629,16 +642,16 @@ class TestEolianExpression(unittest.TestCase): self.assertEqual(exp.serialize, '100') def test_expression_unary(self): - var = eolian_db.constant_by_name_get('Efl.Gfx.Hint_Fill') + var = eolian_db.constant_by_name_get('Efl.Gfx.Stack_Layer_Min') exp = var.value self.assertIsInstance(exp, eolian.Expression) self.assertEqual(exp.type, eolian.Eolian_Expression_Type.UNARY) - self.assertEqual(float(exp.serialize), 1.0) # TODO is this a bug? isn't -1.0 ? - self.assertEqual(exp.unary_operator, eolian.Eolian_Unary_Operator.UNM) + self.assertEqual(float(exp.serialize), 32768.0) # TODO is this a bug? isn't -1.0 ? + self.assertEqual(exp.unary_operator, eolian.Eolian_Unary_Operator.UNM) # Invalid -> NOP unary = exp.unary_expression self.assertIsInstance(unary, eolian.Expression) - self.assertEqual(unary.type, eolian.Eolian_Expression_Type.DOUBLE) - self.assertEqual(float(exp.serialize), 1.0) + self.assertEqual(unary.type, eolian.Eolian_Expression_Type.INT) + self.assertEqual(float(exp.serialize), 32768.0) # Bug too? # TODO test_expression_binary # exp.binary_operator # TODO find a better test (only works for BINARY expr) From f7ce771e3243e19f8a12672ea2be752dedccbcf6 Mon Sep 17 00:00:00 2001 From: Ali Alzyod Date: Thu, 18 Jul 2019 08:51:28 +0000 Subject: [PATCH 65/72] evas_object_textblock: add support for variation sequences update font processing to handle variation sequences unicodes to select proper glypg in respect to variation seqences Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9053 --- src/bin/elementary/test.c | 2 + src/bin/elementary/test_label.c | 24 +++ src/lib/evas/common/evas_font.h | 53 ++++- src/lib/evas/common/evas_font_load.c | 6 +- src/lib/evas/common/evas_font_main.c | 296 +++++++++++++++++++++++--- src/lib/evas/common/evas_font_query.c | 54 +++-- src/lib/evas/common/evas_text_utils.c | 6 +- src/tests/evas/evas_test_textblock.c | 19 +- 8 files changed, 411 insertions(+), 49 deletions(-) diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index 8856c7cab1..adae27b52c 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -243,6 +243,7 @@ void test_label_wrap(void *data, Evas_Object *obj, void *event_info); void test_label_ellipsis(void *data, Evas_Object *obj, void *event_info); void test_label_colors(void *data, Evas_Object *obj, void *event_info); void test_label_emoji(void *data, Evas_Object *obj, void *event_info); +void test_label_variation_sequence(void *data, Evas_Object *obj, void *event_info); void test_conformant(void *data, Evas_Object *obj, void *event_info); void test_conformant2(void *data, Evas_Object *obj, void *event_info); void test_conformant_indicator(void *data, Evas_Object *obj, void *event_info); @@ -1198,6 +1199,7 @@ add_tests: ADD_TEST(NULL, "Text", "Label Ellipsis", test_label_ellipsis); ADD_TEST(NULL, "Text", "Label Colors", test_label_colors); ADD_TEST(NULL, "Text", "Label Emoji", test_label_emoji); + ADD_TEST(NULL, "Text", "Label Variation Sequnece", test_label_variation_sequence); ADD_TEST_EO(NULL, "Text", "Efl.Ui.Textpath", test_ui_textpath); //------------------------------// diff --git a/src/bin/elementary/test_label.c b/src/bin/elementary/test_label.c index c00ae7986e..f49255f21e 100644 --- a/src/bin/elementary/test_label.c +++ b/src/bin/elementary/test_label.c @@ -401,6 +401,30 @@ test_label_colors(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *ev evas_object_show(win); } +/*** Label variation sequence **************************************************************/ +void +test_label_variation_sequence(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) +{ + Evas_Object *win, *lb; + + win = elm_win_util_standard_add("label-variation sequence", "Label variation sequnece"); + elm_win_autodel_set(win, EINA_TRUE); + + lb = elm_label_add(win); + elm_object_text_set(lb, + "You need to have at least on font contains variation sequence
" + "Three different 8 glyphs :
" + "88️8️⃣
" + "line with 3 variation glyphs :
" + "8️⃣☪️AAA☪︎1234567️⃣" + ); + evas_object_size_hint_weight_set(lb, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + elm_win_resize_object_add(win, lb); + evas_object_show(lb); + + evas_object_show(win); +} + /*** Label Emoji *************************************************************/ static char * _fontlist_text_get(void *data, Evas_Object *obj EINA_UNUSED, const char *part EINA_UNUSED) diff --git a/src/lib/evas/common/evas_font.h b/src/lib/evas/common/evas_font.h index ab6e6fbd17..5e79026ca3 100644 --- a/src/lib/evas/common/evas_font.h +++ b/src/lib/evas/common/evas_font.h @@ -56,7 +56,32 @@ typedef unsigned long long DATA64; #define LKU(x) eina_lock_release(&(x)) #define LKDBG(x) eina_lock_debug(&(x)) +/** + * See explanation of variation_sequences at: + * https://unicode.org/Public/UCD/latest/ucd/StandardizedVariants.txt + * https://unicode.org/reports/tr37/ + * https://unicode.org/ivd/ + * https://www.freetype.org/freetype2/docs/reference/ft2-glyph_variants.html +*/ +#define VAR_SEQ(x) GENERIC_VARIATION_SEQUENCES(x) | IDEOGRAPHICS_VARIATION_SEQUENCES(x) | MANGOLIAN_VARIATION_SEQUENCES(x) +#define GENERIC_VARIATION_SEQUENCES(x) (x>=0xFE00 && x<=0xFE0F) ? x : 0 +#define IDEOGRAPHICS_VARIATION_SEQUENCES(x) (x>=0xE0100 && x<=0xE01EF) ? x : 0 +#define MANGOLIAN_VARIATION_SEQUENCES(x) (x>=0x180B && x<=0x180D) ? x : 0 +/** + * http://unicode.org/emoji/charts/emoji-variants.html +*/ +#define VARIATION_EMOJI_PRESENTATION 0xFE0F +#define VARIATION_TEXT_PRESENTATION 0xFE0E +/** + * These Options (Flags) are used with evas_common_font_glyph_search function + */ +#define EVAS_FONT_SEARCH_OPTION_NONE 0x0000 +#define EVAS_FONT_SEARCH_OPTION_SKIP_COLOR 0x0001 + + +#define FASH_INT_MAGIC 0x01012345 +#define FASH_GLYPH_MAGIC 0x02012345 enum _Evas_Font_Style { @@ -128,6 +153,10 @@ typedef struct _RGBA_Font_Source RGBA_Font_Source; typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph; typedef struct _RGBA_Font_Glyph_Out RGBA_Font_Glyph_Out; +typedef struct _Fash_Item_variation_Index_Item Fash_Item_variation_Index_Item; +typedef struct _Fash_Item_variation_List Fash_Item_variation_List; +typedef struct _Fash_Item_Index_Map_Variations Fash_Item_Index_Map_Variations; + typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map; typedef struct _Fash_Int_Map Fash_Int_Map; typedef struct _Fash_Int_Map2 Fash_Int_Map2; @@ -139,9 +168,25 @@ struct _Fash_Item_Index_Map RGBA_Font_Int *fint; int index; }; +struct _Fash_Item_variation_Index_Item +{ + Fash_Item_Index_Map item; + Eina_Unicode variation_sequence; +}; +struct _Fash_Item_variation_List +{ + Fash_Item_variation_Index_Item *list; + size_t length; + size_t capacity; +}; +struct _Fash_Item_Index_Map_Variations +{ + Fash_Item_Index_Map item; + Fash_Item_variation_List *variations; +}; struct _Fash_Int_Map { - Fash_Item_Index_Map item[256]; + Fash_Item_Index_Map_Variations items[256]; }; struct _Fash_Int_Map2 { @@ -149,6 +194,7 @@ struct _Fash_Int_Map2 }; struct _Fash_Int { + unsigned int MAGIC; Fash_Int_Map2 *bucket[256]; void (*freeme) (Fash_Int *fash); }; @@ -166,6 +212,7 @@ struct _Fash_Glyph_Map2 }; struct _Fash_Glyph { + unsigned int MAGIC; Fash_Glyph_Map2 *bucket[256]; void (*freeme) (Fash_Glyph *fash); }; @@ -346,7 +393,7 @@ void *evas_common_font_freetype_face_get(RGBA_Font *font); /* XXX: Not EAPI on p EAPI RGBA_Font_Glyph *evas_common_font_int_cache_glyph_get (RGBA_Font_Int *fi, FT_UInt index); EAPI Eina_Bool evas_common_font_int_cache_glyph_render(RGBA_Font_Glyph *fg); -EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, Eina_Unicode gl); +EAPI FT_UInt evas_common_get_char_index (RGBA_Font_Int* fi, Eina_Unicode gl, Eina_Unicode variation_sequence); /* load */ EAPI void evas_common_font_dpi_set (int dpi_h, int dpi_v); @@ -396,7 +443,7 @@ EAPI void evas_common_font_ascent_descent_get(RGBA_Font *fn, const EAPI void *evas_common_font_glyph_compress(void *data, int num_grays, int pixel_mode, int pitch_data, int w, int h, int *size_ret); EAPI DATA8 *evas_common_font_glyph_uncompress(RGBA_Font_Glyph *fg, int *wret, int *hret); -EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl); +EAPI int evas_common_font_glyph_search (RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl, Eina_Unicode variation_sequence, uint32_t evas_font_search_options); void evas_common_font_load_init(void); void evas_common_font_load_shutdown(void); diff --git a/src/lib/evas/common/evas_font_load.c b/src/lib/evas/common/evas_font_load.c index 15d1017b1f..6a7edac300 100644 --- a/src/lib/evas/common/evas_font_load.c +++ b/src/lib/evas/common/evas_font_load.c @@ -686,7 +686,11 @@ evas_common_font_free(RGBA_Font *fn) evas_common_font_int_unref(fi); evas_common_font_flush(); eina_list_free(fn->fonts); - if (fn->fash) fn->fash->freeme(fn->fash); + if (fn->fash) + { + fn->fash->freeme(fn->fash); + fn->fash = NULL; + } LKD(fn->lock); free(fn); } diff --git a/src/lib/evas/common/evas_font_main.c b/src/lib/evas/common/evas_font_main.c index b99df9a927..31076132fd 100644 --- a/src/lib/evas/common/evas_font_main.c +++ b/src/lib/evas/common/evas_font_main.c @@ -355,33 +355,182 @@ end: /* Set of common functions that are used in a couple of places. */ static void -_fash_int2_free(Fash_Int_Map2 *fash) -{ +_fash_int_map_and_variations_free(Fash_Int_Map *map) + { + if(!map) + return; int i; - for (i = 0; i < 256; i++) if (fash->bucket[i]) free(fash->bucket[i]); - free(fash); + for (i = 0; i < 256; i++) + { + if (map->items[i].variations) + { + if (map->items[i].variations->list) + { + free(map->items[i].variations->list); + map->items[i].variations->list = NULL; + map->items[i].variations->capacity = 0; + map->items[i].variations->length = 0; + } + free(map->items[i].variations); + map->items[i].variations = NULL; + } + } + + free(map); +} + +static void +_fash_int2_free(Fash_Int_Map2 *fash) + { + int i; + if (fash) + { + for (i = 0; i < 256; i++) + if (fash->bucket[i]) + { + _fash_int_map_and_variations_free(fash->bucket[i]); + fash->bucket[i] = NULL; + } + free(fash); + fash = NULL; + } } static void _fash_int_free(Fash_Int *fash) { int i; + if (fash) + { + if (fash->MAGIC != FASH_INT_MAGIC) + { + return; + } - for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_int2_free(fash->bucket[i]); - free(fash); + for (i = 0; i < 256; i++) + { + if (fash->bucket[i]) + { + _fash_int2_free(fash->bucket[i]); + fash->bucket[i] = NULL; + } + } + free(fash); + } } static Fash_Int * _fash_int_new(void) { Fash_Int *fash = calloc(1, sizeof(Fash_Int)); + EINA_SAFETY_ON_NULL_RETURN_VAL(fash, NULL); + fash->MAGIC = FASH_INT_MAGIC; fash->freeme = _fash_int_free; return fash; } +static Fash_Item_variation_List * +_variations_list_new(void) +{ + Fash_Item_variation_List *variations = calloc(1, sizeof(Fash_Item_variation_List)); + EINA_SAFETY_ON_NULL_RETURN_VAL(variations, NULL); + variations->capacity = 0; + variations->length = 0; + variations->list = 0; + return variations; +} + +static void +_variations_list_add(Fash_Item_variation_List *variations,RGBA_Font_Int *fint, int index, Eina_Unicode variation_sequence) +{ + Fash_Item_variation_Index_Item *list = variations->list; + if (variations->capacity == variations->length) + { + list = (Fash_Item_variation_Index_Item *) realloc(list, (variations->capacity + 4) * sizeof(Fash_Item_variation_Index_Item)); + if (list) + { + variations->list = list; + variations->capacity += 4; + } + } + + EINA_SAFETY_ON_NULL_RETURN(list); + + int start = 0; + int end = variations->length; + if (end == 0) + { + // if only on element just add it in 0 index + variations->list[0].item.fint = fint; + variations->list[0].item.index = index; + variations->list[0].variation_sequence = variation_sequence; + variations->length++; + } + else + { + // find lower bound + while (end > start) + { + int middle = start + (end - start) / 2; + if (variations->list[middle].variation_sequence >= variation_sequence) + end = middle; + else + start = middle + 1; + } + + // if passed value founded in list, just replace it + if (start < (int)variations->length && variations->list[start].variation_sequence == variation_sequence) + { + variations->list[start].item.fint = fint; + variations->list[start].item.index = index; + variations->list[start].variation_sequence = variation_sequence; + return; + } + + // shift array to insert item + for (int i = (variations->length - 1) ; i >= start; i--) + { + variations->list[i + 1] = variations->list[i]; + } + + // insert new item and keep array sorted + variations->list[start].item.fint = fint; + variations->list[start].item.index = index; + variations->list[start].variation_sequence = variation_sequence; + variations->length++; + } +} + + static Fash_Item_Index_Map * -_fash_int_find(Fash_Int *fash, int item) +_variations_list_find(Fash_Item_variation_List * variations, Eina_Unicode variation_sequence) +{ + if (!variations) + return NULL; + + if (!variations->list) + return NULL; + + int start = 0; + int end = variations->length; + + while(end > start) + { + int middle = start + (end - start) / 2; + if (variations->list[middle].variation_sequence == variation_sequence) + return &(variations->list[middle].item); + else if (variations->list[middle].variation_sequence < variation_sequence) + start = middle + 1; + else + end = middle - 1; + } + + return NULL; +} + +static const Fash_Item_Index_Map * +_fash_int_find(Fash_Int *fash, int item, Eina_Unicode variation_sequence) { int grp, maj, min; @@ -391,14 +540,22 @@ _fash_int_find(Fash_Int *fash, int item) min = item & 0xff; if (!fash->bucket[grp]) return NULL; if (!fash->bucket[grp]->bucket[maj]) return NULL; - return &(fash->bucket[grp]->bucket[maj]->item[min]); + if (!variation_sequence) + return &(fash->bucket[grp]->bucket[maj]->items[min].item); + else + return _variations_list_find(fash->bucket[grp]->bucket[maj]->items[min].variations, variation_sequence); } static void -_fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx) +_fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx, Eina_Unicode variation_sequence) { int grp, maj, min; + // If we already have cached passed item, skip adding it again + const Fash_Item_Index_Map *fm = _fash_int_find(fash, item, variation_sequence); + if (fm && fm->fint) + return; + // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) grp = (item >> 16) & 0xff; maj = (item >> 8) & 0xff; @@ -409,8 +566,20 @@ _fash_int_add(Fash_Int *fash, int item, RGBA_Font_Int *fint, int idx) if (!fash->bucket[grp]->bucket[maj]) fash->bucket[grp]->bucket[maj] = calloc(1, sizeof(Fash_Int_Map)); EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]->bucket[maj]); - fash->bucket[grp]->bucket[maj]->item[min].fint = fint; - fash->bucket[grp]->bucket[maj]->item[min].index = idx; + if (variation_sequence) + { + if (!fash->bucket[grp]->bucket[maj]->items[min].variations) + { + fash->bucket[grp]->bucket[maj]->items[min].variations =_variations_list_new(); + EINA_SAFETY_ON_NULL_RETURN(fash->bucket[grp]->bucket[maj]->items[min].variations); + } + _variations_list_add(fash->bucket[grp]->bucket[maj]->items[min].variations, fint, idx, variation_sequence); + } + else + { + fash->bucket[grp]->bucket[maj]->items[min].item.fint = fint; + fash->bucket[grp]->bucket[maj]->items[min].item.index = idx; + } } static void @@ -461,24 +630,45 @@ _fash_gl2_free(Fash_Glyph_Map2 *fash) int i; // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) - for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_glyph_free(fash->bucket[i]); + for (i = 0; i < 256; i++) + { + if (fash->bucket[i]) + { + _fash_glyph_free(fash->bucket[i]); + fash->bucket[i] = NULL; + } + } free(fash); } static void _fash_gl_free(Fash_Glyph *fash) { - int i; + if (fash) + { + if (fash->MAGIC != FASH_GLYPH_MAGIC) + return; - // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) - for (i = 0; i < 256; i++) if (fash->bucket[i]) _fash_gl2_free(fash->bucket[i]); - free(fash); + int i; + // 24bits for unicode - v6 up to E01EF (chrs) & 10FFFD for private use (plane 16) + for (i = 0; i < 256; i++) + { + if (fash->bucket[i]) + { + _fash_gl2_free(fash->bucket[i]); + fash->bucket[i] = NULL; + } + } + free(fash); + } } static Fash_Glyph * _fash_gl_new(void) { Fash_Glyph *fash = calloc(1, sizeof(Fash_Glyph)); + EINA_SAFETY_ON_NULL_RETURN_VAL(fash, NULL); + fash->MAGIC = FASH_GLYPH_MAGIC; fash->freeme = _fash_gl_free; return fash; } @@ -679,7 +869,7 @@ struct _Font_Char_Index }; EAPI FT_UInt -evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl) +evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl, Eina_Unicode variation_sequence) { static const unsigned short mapfix[] = { @@ -741,7 +931,10 @@ evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl) * that something else try to use it. */ /* FTLOCK(); */ - result.index = FT_Get_Char_Index(fi->src->ft.face, gl); + if (variation_sequence) + result.index = FT_Face_GetCharVariantIndex(fi->src->ft.face, gl, variation_sequence); + else + result.index = FT_Get_Char_Index(fi->src->ft.face, gl); /* FTUNLOCK(); */ result.gl = gl; @@ -773,7 +966,10 @@ evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl) { gl = mapfix[(i << 1) + 1]; FTLOCK(); - result.index = FT_Get_Char_Index(fi->src->ft.face, gl); + if (variation_sequence) + result.index = FT_Face_GetCharVariantIndex(fi->src->ft.face, gl, variation_sequence); + else + result.index = FT_Get_Char_Index(fi->src->ft.face, gl); FTUNLOCK(); break; } @@ -798,20 +994,49 @@ evas_common_get_char_index(RGBA_Font_Int* fi, Eina_Unicode gl) return result.index; } + +/* + * @internal + * Search for unicode glyph inside all font files, and return font and glyph index + * + * @param[in] fn the font to use. + * @param[out] fi_ret founded font. + * @param[in] gl unicode glyph to search for + * @param[in] variation_sequence for the gl glyph + * @param[in] evas_font_search_options search options when searching font files + * + */ + EAPI int -evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl) +evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicode gl, Eina_Unicode variation_sequence, uint32_t evas_font_search_options) { Eina_List *l; if (fn->fash) { - Fash_Item_Index_Map *fm = _fash_int_find(fn->fash, gl); + const Fash_Item_Index_Map *fm = _fash_int_find(fn->fash, gl, variation_sequence); if (fm) { if (fm->fint) { - *fi_ret = fm->fint; - return fm->index; + if (evas_font_search_options == EVAS_FONT_SEARCH_OPTION_NONE) + { + *fi_ret = fm->fint; + return fm->index; + } + else if( (evas_font_search_options & EVAS_FONT_SEARCH_OPTION_SKIP_COLOR) == EVAS_FONT_SEARCH_OPTION_SKIP_COLOR) + { + if (!fm->fint->src->ft.face) + { + evas_common_font_int_reload(fm->fint); + } + + if (fm->fint->src->ft.face && !FT_HAS_COLOR(fm->fint->src->ft.face)) + { + *fi_ret = fm->fint; + return fm->index; + } + } } else if (fm->index == -1) return 0; } @@ -850,20 +1075,35 @@ evas_common_font_glyph_search(RGBA_Font *fn, RGBA_Font_Int **fi_ret, Eina_Unicod } if (fi->src->ft.face) { - idx = evas_common_get_char_index(fi, gl); + Eina_Bool is_color_only = (evas_font_search_options & EVAS_FONT_SEARCH_OPTION_SKIP_COLOR) == EVAS_FONT_SEARCH_OPTION_SKIP_COLOR && + FT_HAS_COLOR(fi->src->ft.face); + + if (is_color_only) + { + /* This is color font ignore it */ + continue; + } + + idx = (int) evas_common_get_char_index(fi, gl, variation_sequence); if (idx != 0) { if (!fi->ft.size) evas_common_font_int_load_complete(fi); - if (!fn->fash) fn->fash = _fash_int_new(); - if (fn->fash) _fash_int_add(fn->fash, gl, fi, idx); + if (!is_color_only) + { + if (!fn->fash) fn->fash = _fash_int_new(); + if (fn->fash) _fash_int_add(fn->fash, gl, fi, idx, variation_sequence); + } *fi_ret = fi; return idx; } else { - if (!fn->fash) fn->fash = _fash_int_new(); - if (fn->fash) _fash_int_add(fn->fash, gl, NULL, -1); + if (!is_color_only) + { + if (!fn->fash) fn->fash = _fash_int_new(); + if (fn->fash) _fash_int_add(fn->fash, gl, NULL, -1, variation_sequence); + } } } } diff --git a/src/lib/evas/common/evas_font_query.c b/src/lib/evas/common/evas_font_query.c index 1ff0447963..7b50a74e62 100644 --- a/src/lib/evas/common/evas_font_query.c +++ b/src/lib/evas/common/evas_font_query.c @@ -32,6 +32,9 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi (evas_common_language_char_script_get(*base_char) != script) ; base_char++) ; + /* If counter reach variation sequence it is safe to pick default font */ + if(VAR_SEQ(*base_char) || (base_char != run_end && VAR_SEQ(*(base_char+1)))) goto get_top_font; + if (base_char == run_end) base_char = text; /* Find the first renderable char */ @@ -40,7 +43,7 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi /* 0x1F is the last ASCII contral char, just a hack in * the meanwhile. */ if ((*base_char > 0x1F) && - evas_common_font_glyph_search(fn, &fi, *base_char)) + evas_common_font_glyph_search(fn, &fi, *base_char, 0, EVAS_FONT_SEARCH_OPTION_NONE)) break; base_char++; } @@ -49,7 +52,8 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi /* If everything else fails, at least try to find a font for the * replacement char */ if (base_char == run_end) - evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR); + evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR, 0, EVAS_FONT_SEARCH_OPTION_NONE); +get_top_font: if (!fi) fi = fn->fonts->data; @@ -80,15 +84,17 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi if (evas_common_language_char_script_get(*itr) == EVAS_SCRIPT_INHERITED) continue; + Eina_Unicode variation_sequence = VAR_SEQ(*(itr+1)); + /* Break if either it's not in the font, or if it is in the * script's font. */ - if (!evas_common_get_char_index(fi, *itr)) - break; + if (!evas_common_get_char_index(fi, *itr, variation_sequence)) + break; if (fi != *script_fi) { - if (evas_common_get_char_index(*script_fi, *itr)) - break; + if (evas_common_get_char_index(*script_fi, *itr, variation_sequence)) + break; } } @@ -102,10 +108,25 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi /* If we can find a font, use it. Otherwise, find the first * char the run of chars that can't be rendered until the first * one that can. */ - if (evas_common_font_glyph_search(fn, &tmp_fi, *itr)) + Eina_Unicode variation_sequence = VAR_SEQ(*(itr+1)); + if (evas_common_font_glyph_search(fn, &tmp_fi, *itr, variation_sequence, EVAS_FONT_SEARCH_OPTION_NONE)) { fi = tmp_fi; } + else if ( (variation_sequence == VARIATION_TEXT_PRESENTATION) && evas_common_font_glyph_search(fn, &tmp_fi, *itr, 0, EVAS_FONT_SEARCH_OPTION_SKIP_COLOR)) + { + /* If we can not find unicode with variation sequence, then we will + Search and find for non color glyph because variation sequence is Text + */ + fi = tmp_fi; + } + else if ( variation_sequence && evas_common_font_glyph_search(fn, &tmp_fi, *itr, 0, EVAS_FONT_SEARCH_OPTION_NONE)) + { + /* If we can not find unicode with variation sequence, then we will + Search and find glyph without the variation sequence + */ + fi = tmp_fi; + } else { itr++; @@ -113,9 +134,13 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi * font */ for ( ; itr < run_end ; itr++) { + if(VAR_SEQ(*itr)) + continue; + + Eina_Unicode variation_sequence = VAR_SEQ(*(itr+1)); tmp_fi = fi; - if (evas_common_get_char_index(fi, *itr) || - evas_common_font_glyph_search(fn, &tmp_fi, *itr)) + if (evas_common_get_char_index(fi, *itr, variation_sequence) || + evas_common_font_glyph_search(fn, &tmp_fi, *itr, variation_sequence, EVAS_FONT_SEARCH_OPTION_NONE)) { fi = tmp_fi; break; @@ -127,9 +152,9 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi * find a font most suitable for the replacement char and * break */ if ((itr == run_end) || - !evas_common_get_char_index(fi, REPLACEMENT_CHAR)) + !evas_common_get_char_index(fi, REPLACEMENT_CHAR, 0)) { - evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR); + evas_common_font_glyph_search(fn, &fi, REPLACEMENT_CHAR, 0, EVAS_FONT_SEARCH_OPTION_NONE); break; } } @@ -140,8 +165,11 @@ evas_common_font_query_run_font_end_get(RGBA_Font *fn, RGBA_Font_Int **script_fi /* If this char is not renderable by any font, but the replacement * char can be rendered using the currentfont, continue this * run. */ - if (!evas_common_font_glyph_search(fn, &tmp_fi, *itr) && - evas_common_get_char_index(fi, REPLACEMENT_CHAR)) + Eina_Unicode variation_sequence = VAR_SEQ(*(itr+1)); + + if (!evas_common_font_glyph_search(fn, &tmp_fi, *itr, variation_sequence, EVAS_FONT_SEARCH_OPTION_NONE) && + (variation_sequence ? !evas_common_font_glyph_search(fn, &tmp_fi, *itr, 0, EVAS_FONT_SEARCH_OPTION_NONE) : 1) && + evas_common_get_char_index(fi, REPLACEMENT_CHAR, 0)) { itr++; } diff --git a/src/lib/evas/common/evas_text_utils.c b/src/lib/evas/common/evas_text_utils.c index b7cbe1b219..7edc73226d 100644 --- a/src/lib/evas/common/evas_text_utils.c +++ b/src/lib/evas/common/evas_text_utils.c @@ -1066,7 +1066,7 @@ _content_create_ot(RGBA_Font_Int *fi, const Eina_Unicode *text, /* If we got a malformed index, show the replacement char instead */ if (gl_itr->index == 0) { - gl_itr->index = evas_common_get_char_index(fi, REPLACEMENT_CHAR); + gl_itr->index = evas_common_get_char_index(fi, REPLACEMENT_CHAR, 0); is_replacement = EINA_TRUE; } idx = gl_itr->index; @@ -1172,10 +1172,10 @@ _content_create_regular(RGBA_Font_Int *fi, const Eina_Unicode *text, _gl = *text; if (_gl == 0) break; - idx = evas_common_get_char_index(fi, _gl); + idx = evas_common_get_char_index(fi, _gl, 0); if (idx == 0) { - idx = evas_common_get_char_index(fi, REPLACEMENT_CHAR); + idx = evas_common_get_char_index(fi, REPLACEMENT_CHAR, 0); } fg = evas_common_font_int_cache_glyph_get(fi, idx); diff --git a/src/tests/evas/evas_test_textblock.c b/src/tests/evas/evas_test_textblock.c index dc3f22d136..f826a481c7 100644 --- a/src/tests/evas/evas_test_textblock.c +++ b/src/tests/evas/evas_test_textblock.c @@ -1,6 +1,6 @@ /* * TODO: - * * Test different font lodaing mechanisms. + * * Test different font loading mechanisms. */ #ifdef HAVE_CONFIG_H @@ -4129,6 +4129,22 @@ EFL_START_TEST(evas_textblock_obstacle) } EFL_END_TEST; +EFL_START_TEST(evas_textblock_variation_sequence) +{ + START_TB_TEST(); + const char *str1 = "8️😃️"; + const char *str2 = "8︎😃︎"; + Evas_Coord fw, fh,fw_new, fh_new; + evas_object_textblock_text_markup_set(tb, str1); + evas_object_textblock_size_formatted_get(tb, &fw, &fh); + evas_object_textblock_text_markup_set(tb, str2); + evas_object_textblock_size_formatted_get(tb, &fw_new, &fh_new); + fail_if(fw_new == fw && fh_new == fh); + + END_TB_TEST(); +} +EFL_END_TEST; + #ifdef HAVE_HYPHEN static void _hyphenation_width_stress(Evas_Object *tb, Evas_Textblock_Cursor *cur) @@ -4677,6 +4693,7 @@ void evas_test_textblock(TCase *tc) tcase_add_test(tc, evas_textblock_items); tcase_add_test(tc, evas_textblock_delete); tcase_add_test(tc, evas_textblock_obstacle); + tcase_add_test(tc, evas_textblock_variation_sequence); #ifdef HAVE_HYPHEN tcase_add_test(tc, evas_textblock_hyphenation); #endif From 44ff1e73bb7cefdf99c9cd68b250df0a497aa37d Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Fri, 26 Jul 2019 13:22:44 -0400 Subject: [PATCH 66/72] efl_ui/popup: unset callbacks on win object when parent is removed these callbacks must be removed if there is no parent, otherwise they may trigger once the widget is deleted and trigger invalid object access @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9429 --- src/lib/elementary/efl_ui_popup.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/lib/elementary/efl_ui_popup.c b/src/lib/elementary/efl_ui_popup.c index 8d7271eb67..5d97a7d9c2 100644 --- a/src/lib/elementary/efl_ui_popup.c +++ b/src/lib/elementary/efl_ui_popup.c @@ -96,8 +96,18 @@ _parent_geom_cb(void *data, const Efl_Event *ev EINA_UNUSED) } EOLIAN static void -_efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent EINA_UNUSED) +_efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EINA_UNUSED, Eo *parent) { + if (!parent) + { + /* unsetting parent, probably before deletion */ + if (pd->win_parent) + { + efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, obj); + efl_event_callback_del(pd->win_parent, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _parent_geom_cb, obj); + } + goto end; + } pd->win_parent = efl_provider_find(obj, EFL_UI_WIN_CLASS); if (!pd->win_parent) { @@ -112,7 +122,7 @@ _efl_ui_popup_efl_ui_widget_widget_parent_set(Eo *obj, Efl_Ui_Popup_Data *pd EIN efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_SIZE_CHANGED, _parent_geom_cb, obj); efl_event_callback_add(pd->win_parent, EFL_GFX_ENTITY_EVENT_POSITION_CHANGED, _parent_geom_cb, obj); - +end: efl_ui_widget_parent_set(efl_super(obj, MY_CLASS), parent); } From 7f2ce2f99a345d4b3b667755db1d73f7db213f03 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 24 Jul 2019 16:19:26 -0400 Subject: [PATCH 67/72] elm_test: add option for running all tests on startup this is useful for doing quick testing when making invasive changes that affect a large number of widgets, such as rewriting all sizing calc code Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9407 --- src/bin/elementary/test.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index adae27b52c..f4400695e5 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -409,6 +409,7 @@ static void *tt; static Eina_List *tests, *cur_test;; static Eina_Bool hide_legacy = EINA_FALSE; static Eina_Bool hide_beta = EINA_FALSE; +static Eina_Bool all_tests = EINA_FALSE; struct elm_test { @@ -580,6 +581,7 @@ _menu_create(const char *option_str) } pcat = t->category; if (t == tt) tt = cfr; + if (all_tests) t->cb(NULL, NULL, NULL); } } @@ -1444,6 +1446,8 @@ efl_main(void *data EINA_UNUSED, { test_win_only = EINA_TRUE; } + else if (eina_streq(arg, "--all") || eina_streq(arg, "-a")) + all_tests = EINA_TRUE; else if ((i == eina_array_count(arge->argv) - 1) && (arg[0] != '-')) autorun = arg; From 764f35b7a3e795e344d2414e252e280c3c34756d Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Mon, 29 Jul 2019 15:00:32 +0200 Subject: [PATCH 68/72] elm_test: add a example that shows efl_ui_item instances this is just a little showcase to show the possible items Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9430 --- src/bin/elementary/meson.build | 1 + src/bin/elementary/test.c | 3 ++ src/bin/elementary/test_ui_items.c | 87 ++++++++++++++++++++++++++++++ src/lib/elementary/Efl_Ui.h | 1 + 4 files changed, 92 insertions(+) create mode 100644 src/bin/elementary/test_ui_items.c diff --git a/src/bin/elementary/meson.build b/src/bin/elementary/meson.build index 10372d9154..9c26bc3eb4 100644 --- a/src/bin/elementary/meson.build +++ b/src/bin/elementary/meson.build @@ -157,6 +157,7 @@ elementary_test_src = [ 'test_ui_tab_pager.c', 'test_ui_relative_layout.c', 'test_ui_item_container.c', + 'test_ui_items.c', 'test.h' ] diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c index f4400695e5..1a332575da 100644 --- a/src/bin/elementary/test.c +++ b/src/bin/elementary/test.c @@ -402,6 +402,8 @@ void test_ui_relative_layout(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_radio(void *data, Evas_Object *obj, void *event_info); void test_efl_ui_collection_list(void *data, Evas_Object *obj, void *event_info ); void test_efl_ui_collection_grid(void *data, Evas_Object *obj, void *event_info); +void test_efl_ui_item(void *data, Evas_Object *obj, void *event_info); + static void _list_udpate(void); static Evas_Object *win, *tbx, *entry; // TODO: refactoring @@ -905,6 +907,7 @@ add_tests: ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Relative_Layout", test_ui_relative_layout); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection List", test_efl_ui_collection_list); ADD_TEST_EO(NULL, "Containers", "Efl.Ui.Collection Grid", test_efl_ui_collection_grid); + ADD_TEST_EO(NULL, "Containers", "Items", test_efl_ui_item); //------------------------------// ADD_TEST_EO(NULL, "Events", "Event Refeed", test_events); diff --git a/src/bin/elementary/test_ui_items.c b/src/bin/elementary/test_ui_items.c new file mode 100644 index 0000000000..4c2254ad25 --- /dev/null +++ b/src/bin/elementary/test_ui_items.c @@ -0,0 +1,87 @@ +#ifdef HAVE_CONFIG_H +# include "elementary_config.h" +#endif + +#include + +static Efl_Ui_Widget* +_item_add(Eo *box, const Efl_Class *c, int i) +{ + Eo *check, *rect, *il = efl_add(c, box); + int r = 0, g = 0, b = 0; + char buf[PATH_MAX]; + + 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(il)); + switch (i % 5) + { + case 0: + r = 255; + break; + case 1: + g = 255; + break; + case 2: + b = 255; + break; + case 3: + r = g = b = 255; + break; + case 4: + r = g = b = 0; + break; + } + efl_gfx_color_set(rect, r, g, b, 255); + efl_content_set(il, rect); + + check = efl_add(EFL_UI_CHECK_CLASS, il); + efl_content_set(efl_part(il, "extra"), check); + + if (c == EFL_UI_GRID_DEFAULT_ITEM_CLASS) + efl_gfx_hint_size_min_set(il, EINA_SIZE2D(100, 180)); + else + efl_gfx_hint_size_min_set(il, EINA_SIZE2D(40, 40+(i%2)*40)); + + return il; +} + +void test_efl_ui_item(void *data EINA_UNUSED, + Evas_Object *obj EINA_UNUSED, + void *event_info EINA_UNUSED) +{ + Eo *win, *box, *o; + + win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), + efl_ui_win_type_set(efl_added, EFL_UI_WIN_TYPE_BASIC), + efl_text_set(efl_added, "Item examples"), + efl_ui_win_autodel_set(efl_added, EINA_TRUE) + ); + + box = efl_add(EFL_UI_BOX_CLASS, win, + efl_content_set(win, efl_added)); + + o = _item_add(box, EFL_UI_GRID_DEFAULT_ITEM_CLASS, 1); + efl_pack_end(box, o); + + o = _item_add(box, EFL_UI_GRID_DEFAULT_ITEM_CLASS, 2); + efl_ui_widget_disabled_set(o, EINA_TRUE); + efl_pack_end(box, o); + + o = _item_add(box, EFL_UI_LIST_DEFAULT_ITEM_CLASS, 3); + efl_pack_end(box, o); + + o = _item_add(box, EFL_UI_LIST_DEFAULT_ITEM_CLASS, 4); + efl_ui_widget_disabled_set(o, EINA_TRUE); + efl_pack_end(box, o); + + o = efl_add(EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS, box); + efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40+40)); + efl_pack_end(box, o); + + o = efl_add(EFL_UI_LIST_PLACEHOLDER_ITEM_CLASS, box); + efl_gfx_hint_size_min_set(o, EINA_SIZE2D(40, 40)); + efl_ui_widget_disabled_set(o, EINA_TRUE); + efl_pack_end(box, o); +} diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h index 8ccc063dea..4ed285771f 100644 --- a/src/lib/elementary/Efl_Ui.h +++ b/src/lib/elementary/Efl_Ui.h @@ -258,6 +258,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator; # include # include # include +# include /** * Initialize Elementary From 2057957d219996e5363d34475ceb39c2145d4005 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Thu, 25 Jul 2019 20:54:49 +0200 Subject: [PATCH 69/72] efl_ui_pan: emit position changed when content is resized even if the position is not really changed here, the min / max relation has changed. If we do not emit this event here, every user (that calculates a relative position) would have to monitor the pan position and the size of the content. This simplifies the given usecase, and fixes the scroller position when new items are added to the collection. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9411 --- src/lib/elementary/efl_ui_pan.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elementary/efl_ui_pan.c b/src/lib/elementary/efl_ui_pan.c index 534b433661..3412cba005 100644 --- a/src/lib/elementary/efl_ui_pan.c +++ b/src/lib/elementary/efl_ui_pan.c @@ -147,6 +147,7 @@ _efl_ui_pan_content_resize_cb(void *data, evas_object_smart_changed(pobj); } efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); + efl_event_callback_call(pobj, EFL_UI_PAN_EVENT_PAN_POSITION_CHANGED, NULL); } EOLIAN static Eina_Bool From b561e9632e5d0b1a9feef2d9db54ed872b4568ee Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 29 Jul 2019 10:59:27 -0400 Subject: [PATCH 70/72] elm/config: monitor MODIFIED events on config files eio/inotify now receives these events when the config file is modified, even though the file is copied onto that location. this fixes config updating at runtime @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9432 --- src/lib/elementary/elm_config.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 72bc9f8004..9258939f79 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -34,6 +34,7 @@ Eina_Bool _config_profile_lock = EINA_FALSE; static Ecore_Timer *_config_change_delay_timer = NULL; static Ecore_Timer *_config_profile_change_delay_timer = NULL; static Ecore_Event_Handler *_monitor_file_created_handler = NULL; +static Ecore_Event_Handler *_monitor_file_modified_handler = NULL; static Ecore_Event_Handler *_monitor_directory_created_handler = NULL; static Eio_Monitor *_eio_config_monitor = NULL; static Eio_Monitor *_eio_profile_monitor = NULL; @@ -4196,6 +4197,7 @@ _elm_config_sub_shutdown(void) ELM_SAFE_FREE(_config_change_delay_timer, ecore_timer_del); ELM_SAFE_FREE(_config_profile_change_delay_timer, ecore_timer_del); ELM_SAFE_FREE(_monitor_file_created_handler, ecore_event_handler_del); + ELM_SAFE_FREE(_monitor_file_modified_handler, ecore_event_handler_del); ELM_SAFE_FREE(_monitor_directory_created_handler, ecore_event_handler_del); } @@ -4226,7 +4228,7 @@ _config_change_delay_cb(void *data EINA_UNUSED) static Eina_Bool _elm_config_file_monitor_cb(void *data EINA_UNUSED, - int type EINA_UNUSED, + int type, void *event) { Eio_Monitor_Event *ev = event; @@ -4234,7 +4236,7 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED, if (ev->monitor == _eio_config_monitor) { - if (type == EIO_MONITOR_FILE_CREATED) + if ((type == EIO_MONITOR_FILE_CREATED) || (type == EIO_MONITOR_FILE_MODIFIED)) { if (!strcmp(file, "base.cfg")) { @@ -4246,7 +4248,7 @@ _elm_config_file_monitor_cb(void *data EINA_UNUSED, } if (ev->monitor == _eio_profile_monitor) { - if (type == EIO_MONITOR_FILE_CREATED) + if ((type == EIO_MONITOR_FILE_CREATED) || (type == EIO_MONITOR_FILE_MODIFIED)) { if ((!_config_profile_lock) && (!strcmp(file, "profile.cfg"))) { @@ -4299,6 +4301,8 @@ _elm_config_sub_init(void) _eio_profile_monitor = eio_monitor_add(buf); _monitor_file_created_handler = ecore_event_handler_add (EIO_MONITOR_FILE_CREATED, _elm_config_file_monitor_cb, NULL); + _monitor_file_modified_handler = ecore_event_handler_add + (EIO_MONITOR_FILE_MODIFIED, _elm_config_file_monitor_cb, NULL); _monitor_directory_created_handler = ecore_event_handler_add (EIO_MONITOR_DIRECTORY_CREATED, _elm_config_file_monitor_cb, NULL); From 36ff0a012ce227757331a745fbb437b2097f4e45 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 29 Jul 2019 12:41:59 -0400 Subject: [PATCH 71/72] elm/config: fix config usage with EFL_RUN_IN_TREE set when running in tree, elm_config should not attempt to access files outside the tree, nor should it attempt to overwrite any existing config files @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9433 --- src/lib/elementary/elm_config.c | 35 ++++++++++++++++++++++++++------- 1 file changed, 28 insertions(+), 7 deletions(-) diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c index 9258939f79..c6da38ed27 100644 --- a/src/lib/elementary/elm_config.c +++ b/src/lib/elementary/elm_config.c @@ -5,6 +5,7 @@ #include #include "elm_priv.h" +#include "../../static_libs/buildsystem/buildsystem.h" #include "efl_config_global.eo.h" EAPI int ELM_EVENT_CONFIG_ALL_CHANGED = 0; @@ -964,7 +965,8 @@ _elm_config_profile_dir_get(const char *prof, if (!is_user) goto not_user; - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s", prof); + if ((!_use_build_config) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof))) + _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s", prof); // See elm_config_profile_dir_free: always use strdup+free if (ecore_file_is_dir(buf)) @@ -973,7 +975,8 @@ _elm_config_profile_dir_get(const char *prof, return NULL; not_user: - snprintf(buf, sizeof(buf), "%s/config/%s", _elm_data_dir, prof); + if ((!_use_build_config) || (!bs_data_path_get(buf, sizeof(buf), "elementary/config", prof))) + snprintf(buf, sizeof(buf), "%s/config/%s", _elm_data_dir, prof); // See elm_config_profile_dir_free: always use strdup+free if (ecore_file_is_dir(buf)) @@ -1355,9 +1358,15 @@ _elm_config_profiles_list(Eina_Bool hide_profiles) Eina_Iterator *file_it; char buf[PATH_MAX]; const char *dir; - size_t len; + size_t len = 0; - len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config"); + if (_use_build_config) + { + len = bs_data_path_get(buf, sizeof(buf), "elementary", "config"); + if (len) len = strlen(buf); + } + if (!len) + len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config"); file_it = eina_file_stat_ls(buf); if (!file_it) goto sys; @@ -2082,7 +2091,7 @@ _elm_config_profile_save(const char *profile) Eet_File *ef; size_t len; - if ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s)) + if (_use_build_config || ((s = getenv("ELM_PROFILE_NOSAVE")) && atoi(s))) return EINA_TRUE; len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/profile.cfg"); @@ -3001,6 +3010,11 @@ elm_config_profile_exists(const char *profile) if (!profile) return EINA_FALSE; + if (_use_build_config) + { + if (!bs_data_path_get(buf, sizeof(buf), "elementary/config", profile)) return EINA_FALSE; + return ecore_file_exists(buf); + } _elm_config_user_dir_snprintf(buf, sizeof(buf), "config/%s/base.cfg", profile); if (ecore_file_exists(buf)) return EINA_TRUE; @@ -4093,6 +4107,7 @@ elm_config_all_flush(void) int ok = 0; size_t len; + if (_use_build_config) return; len = _elm_config_user_dir_snprintf(buf, sizeof(buf), "themes/"); if (len + 1 >= sizeof(buf)) return; @@ -4199,6 +4214,7 @@ _elm_config_sub_shutdown(void) ELM_SAFE_FREE(_monitor_file_created_handler, ecore_event_handler_del); ELM_SAFE_FREE(_monitor_file_modified_handler, ecore_event_handler_del); ELM_SAFE_FREE(_monitor_directory_created_handler, ecore_event_handler_del); + _use_build_config = EINA_FALSE; } static Eina_Bool @@ -4290,8 +4306,13 @@ _elm_config_sub_init(void) char buf[PATH_MAX]; int ok = 0; - _elm_config_user_dir_snprintf(buf, sizeof(buf), "config"); - ok = ecore_file_mkpath(buf); + if (_use_build_config) + ok = bs_data_path_get(buf, sizeof(buf), "elementary", "config"); + else + { + _elm_config_user_dir_snprintf(buf, sizeof(buf), "config"); + ok = ecore_file_mkpath(buf); + } if (!ok) { ERR("Problem accessing Elementary's user configuration directory: %s", From 895ffd93cc5d9e183420bbedb86ec92f5c7e5369 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Mon, 29 Jul 2019 10:58:07 -0400 Subject: [PATCH 72/72] edje/calc: clamp part calc size to 0 this could previously have been negative @fix Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D9431 --- src/lib/edje/edje_calc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c index f3d31c8502..540efa2bf3 100644 --- a/src/lib/edje/edje_calc.c +++ b/src/lib/edje/edje_calc.c @@ -3018,7 +3018,9 @@ _edje_part_recalc_single(Edje *ed, params->req.x = TO_INT(params->eval.x); params->req.y = TO_INT(params->eval.y); params->req.w = TO_INT(params->eval.w); + if (params->req.w < 0) params->req.w = 0; params->req.h = TO_INT(params->eval.h); + if (params->req.h < 0) params->req.h = 0; /* adjust for min size */ _edje_part_recalc_single_min(desc, params, minw, minh, apref);