From e249efd30df9106eac99e7e0005366feebf4b3b3 Mon Sep 17 00:00:00 2001 From: SangHyeon Jade Lee Date: Wed, 25 Sep 2019 16:39:30 +0900 Subject: [PATCH] efl_ui : reverse the select method name to be ended verb on the last. Summary: our new method naming rule only allow verb at the last position, so change name to fallow rule. Reviewers: bu5hm4n, cedric, segfaultxavi Reviewed By: bu5hm4n, segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10144 --- src/bin/elementary/test_ui_collection.c | 12 +++---- src/lib/elementary/efl_ui_collection.c | 8 ++--- src/lib/elementary/efl_ui_collection.eo | 8 ++--- src/lib/elementary/efl_ui_multi_selectable.eo | 8 ++--- .../elementary/efl_ui_multi_selectable_async.eo | 8 ++--- src/lib/elementary/efl_ui_select_model.c | 14 ++++---- src/lib/elementary/efl_ui_select_model.eo | 8 ++--- .../elementary/spec/efl_test_multi_selectable.c | 40 +++++++++++----------- 8 files changed, 53 insertions(+), 53 deletions(-) diff --git a/src/bin/elementary/test_ui_collection.c b/src/bin/elementary/test_ui_collection.c index ed98d2e..f407a69 100644 --- a/src/bin/elementary/test_ui_collection.c +++ b/src/bin/elementary/test_ui_collection.c @@ -5,15 +5,15 @@ #include static void -_select_all(void *data, const Efl_Event *ev EINA_UNUSED) +_all_select(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_select_all(data); + efl_ui_all_select(data); } static void -_unselect_all(void *data, const Efl_Event *ev EINA_UNUSED) +_all_unselect(void *data, const Efl_Event *ev EINA_UNUSED) { - efl_ui_unselect_all(data); + efl_ui_all_unselect(data); } static void @@ -284,14 +284,14 @@ void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class 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, "Select All"); - efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _select_all, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _all_select, item_container); efl_pack_table(tbl, o, 0, 11, 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, "Unselect All"); - efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _unselect_all, item_container); + efl_event_callback_add(o, EFL_INPUT_EVENT_CLICKED, _all_unselect, item_container); efl_pack_table(tbl, o, 0, 12, 1, 1); diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c index dde77ab..b71b1af 100644 --- a/src/lib/elementary/efl_ui_collection.c +++ b/src/lib/elementary/efl_ui_collection.c @@ -1079,13 +1079,13 @@ _selectable_range_apply(Eina_List *start, Eina_Bool flag) } EOLIAN static void -_efl_ui_collection_efl_ui_multi_selectable_select_all(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) +_efl_ui_collection_efl_ui_multi_selectable_all_select(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { _selectable_range_apply(pd->items, EINA_TRUE); } EOLIAN static void -_efl_ui_collection_efl_ui_multi_selectable_unselect_all(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) +_efl_ui_collection_efl_ui_multi_selectable_all_unselect(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) { _selectable_range_apply(pd->items, EINA_FALSE); } @@ -1125,13 +1125,13 @@ _range_selection_find(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, } EOLIAN static void -_efl_ui_collection_efl_ui_multi_selectable_select_range(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) +_efl_ui_collection_efl_ui_multi_selectable_range_select(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) { _range_selection_find(obj, pd, a, b, EINA_TRUE); } EOLIAN static void -_efl_ui_collection_efl_ui_multi_selectable_unselect_range(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) +_efl_ui_collection_efl_ui_multi_selectable_range_unselect(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) { _range_selection_find(obj, pd, a, b, EINA_FALSE); } diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo index 4a320c3..507477c 100644 --- a/src/lib/elementary/efl_ui_collection.eo +++ b/src/lib/elementary/efl_ui_collection.eo @@ -84,10 +84,10 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements Efl.Ui.Single_Selectable.last_selected { get; } Efl.Ui.Multi_Selectable.selected_items_get; Efl.Ui.Multi_Selectable.select_mode {get; set;} - Efl.Ui.Multi_Selectable.select_all; - Efl.Ui.Multi_Selectable.unselect_all; - Efl.Ui.Multi_Selectable.select_range; - Efl.Ui.Multi_Selectable.unselect_range; + Efl.Ui.Multi_Selectable.all_select; + Efl.Ui.Multi_Selectable.all_unselect; + Efl.Ui.Multi_Selectable.range_select; + Efl.Ui.Multi_Selectable.range_unselect; Efl.Ui.Single_Selectable.fallback_selection {get; set;} } } diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo index a3806c1..fc10d3a 100644 --- a/src/lib/elementary/efl_ui_multi_selectable.eo +++ b/src/lib/elementary/efl_ui_multi_selectable.eo @@ -21,7 +21,7 @@ interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable [[Get the selected items in a iterator. The iterator sequence will be decided by selection.]] return: iterator @move @no_unused; [[User has to free the iterator after usage.]] } - select_range { + range_select { [[Select a range of @Efl.Ui.Selectable. This will select the range of selectables from a to b or from b to a depending on which one comes first. @@ -34,7 +34,7 @@ interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable b : Efl.Ui.Selectable; [[The other side of the range.]] } } - unselect_range { + range_unselect { [[Unselect a range of @Efl.Ui.Selectable. This will unselect the range of selectables from a to b or from b to a depending on which one comes first. @@ -47,10 +47,10 @@ interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable b : Efl.Ui.Selectable; [[The other side of the range.]] } } - select_all { + all_select { [[Select all @Efl.Ui.Selectable]] } - unselect_all { + all_unselect { [[Unselect all @Efl.Ui.Selectable]] } diff --git a/src/lib/elementary/efl_ui_multi_selectable_async.eo b/src/lib/elementary/efl_ui_multi_selectable_async.eo index 6f4ed14..0047ed9 100644 --- a/src/lib/elementary/efl_ui_multi_selectable_async.eo +++ b/src/lib/elementary/efl_ui_multi_selectable_async.eo @@ -29,7 +29,7 @@ interface @beta Efl.Ui.Multi_Selectable_Async extends Efl.Ui.Single_Selectable return: iterator @move @no_unused; [[The iterator gives indices of unselected children. It is valid until any change is made on the model.]] } - select_range { + range_select { [[Select a range of @Efl.Ui.Selectable. This will select the range of selectables from $a to $b or from $b to $a depending on which one comes first. @@ -41,7 +41,7 @@ interface @beta Efl.Ui.Multi_Selectable_Async extends Efl.Ui.Single_Selectable b : uint64; [[The other side of the range.]] } } - unselect_range { + range_unselect { [[Unselect a range of @Efl.Ui.Selectable. This will unselect the range of selectables from $a to $b or from $b to $a depending on which one comes first. @@ -53,10 +53,10 @@ interface @beta Efl.Ui.Multi_Selectable_Async extends Efl.Ui.Single_Selectable b : uint64; [[The other side of the range.]] } } - select_all { + all_select { [[Select all @Efl.Ui.Selectable]] } - unselect_all { + all_unselect { [[Unselect all @Efl.Ui.Selectable]] } } diff --git a/src/lib/elementary/efl_ui_select_model.c b/src/lib/elementary/efl_ui_select_model.c index b969441..c05d720 100644 --- a/src/lib/elementary/efl_ui_select_model.c +++ b/src/lib/elementary/efl_ui_select_model.c @@ -501,11 +501,11 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_set(Eo *obj, case EFL_UI_SELECT_MODE_SINGLE: mode = EFL_UI_SELECT_MODE_SINGLE; if (pd->selection == EFL_UI_SELECT_MODE_MULTI) - efl_ui_multi_selectable_async_unselect_all(obj); + efl_ui_multi_selectable_async_all_unselect(obj); break; case EFL_UI_SELECT_MODE_NONE: if (pd->selection == EFL_UI_SELECT_MODE_MULTI) - efl_ui_multi_selectable_async_unselect_all(obj); + efl_ui_multi_selectable_async_all_unselect(obj); else if (pd->last_model) { Eina_Value unselect = eina_value_bool_init(EINA_FALSE); @@ -533,7 +533,7 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_get(const Eo *obj } static void -_efl_ui_select_model_efl_ui_multi_selectable_async_select_all(Eo *obj, +_efl_ui_select_model_efl_ui_multi_selectable_async_all_select(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED) { unsigned long count, i; @@ -553,16 +553,16 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_select_all(Eo *obj, } static void -_efl_ui_select_model_efl_ui_multi_selectable_async_unselect_all(Eo *obj, +_efl_ui_select_model_efl_ui_multi_selectable_async_all_unselect(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED) { uint64_t count = efl_model_children_count_get(obj); - efl_ui_multi_selectable_async_unselect_range(obj, 0, count - 1); + efl_ui_multi_selectable_async_range_unselect(obj, 0, count - 1); } static void -_efl_ui_select_model_efl_ui_multi_selectable_async_select_range(Eo *obj, +_efl_ui_select_model_efl_ui_multi_selectable_async_range_select(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED, uint64_t a, uint64_t b) { @@ -604,7 +604,7 @@ _children_unselect_then(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Va #define BATCH_MAX 100 static void -_efl_ui_select_model_efl_ui_multi_selectable_async_unselect_range(Eo *obj, +_efl_ui_select_model_efl_ui_multi_selectable_async_range_unselect(Eo *obj, Efl_Ui_Select_Model_Data *pd EINA_UNUSED, uint64_t a, uint64_t b) { diff --git a/src/lib/elementary/efl_ui_select_model.eo b/src/lib/elementary/efl_ui_select_model.eo index 4d94d2f..7fa0f84 100644 --- a/src/lib/elementary/efl_ui_select_model.eo +++ b/src/lib/elementary/efl_ui_select_model.eo @@ -12,10 +12,10 @@ class @beta Efl.Ui.Select_Model extends Efl.Boolean_Model Efl.Ui.Multi_Selectable_Async.selected_iterator_new; Efl.Ui.Multi_Selectable_Async.unselected_iterator_new; Efl.Ui.Multi_Selectable_Async.select_mode {get; set;} - Efl.Ui.Multi_Selectable_Async.select_all; - Efl.Ui.Multi_Selectable_Async.unselect_all; - Efl.Ui.Multi_Selectable_Async.select_range; - Efl.Ui.Multi_Selectable_Async.unselect_range; + Efl.Ui.Multi_Selectable_Async.all_select; + Efl.Ui.Multi_Selectable_Async.all_unselect; + Efl.Ui.Multi_Selectable_Async.range_select; + Efl.Ui.Multi_Selectable_Async.range_unselect; Efl.Ui.Single_Selectable.fallback_selection {get; set;} Efl.Ui.Selectable.selected {get; set;} } diff --git a/src/tests/elementary/spec/efl_test_multi_selectable.c b/src/tests/elementary/spec/efl_test_multi_selectable.c index a2606a1..ac0e642 100644 --- a/src/tests/elementary/spec/efl_test_multi_selectable.c +++ b/src/tests/elementary/spec/efl_test_multi_selectable.c @@ -151,12 +151,12 @@ EFL_START_TEST(test_none_select) } EFL_END_TEST -EFL_START_TEST(select_all_api) +EFL_START_TEST(all_select_api) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); - efl_ui_select_all(widget); + efl_ui_all_select(widget); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); ck_assert_int_eq(eina_array_count(arr_selected), 3); @@ -167,14 +167,14 @@ EFL_START_TEST(select_all_api) } EFL_END_TEST -EFL_START_TEST(unselect_all_api) +EFL_START_TEST(all_unselect_api) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); efl_ui_selectable_selected_set(efl_pack_content_get(widget, 0), EINA_TRUE); - efl_ui_unselect_all(widget); + efl_ui_all_unselect(widget); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); ck_assert_int_eq(eina_array_count(arr_selected), 0); @@ -182,40 +182,40 @@ EFL_START_TEST(unselect_all_api) } EFL_END_TEST -EFL_START_TEST(unselect_range) +EFL_START_TEST(range_unselect) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); - efl_ui_select_all(widget); + efl_ui_all_select(widget); - efl_ui_unselect_range(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); + efl_ui_range_unselect(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); 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(widget, 0)); } EFL_END_TEST -EFL_START_TEST(unselect_range2) +EFL_START_TEST(range_unselect2) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); - efl_ui_select_all(widget); + efl_ui_all_select(widget); - efl_ui_unselect_range(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); + efl_ui_range_unselect(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); 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(widget, 0)); } EFL_END_TEST -EFL_START_TEST(select_range) +EFL_START_TEST(range_select) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); - efl_ui_select_range(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); + efl_ui_range_select(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); 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(widget, 1)); @@ -223,12 +223,12 @@ EFL_START_TEST(select_range) } EFL_END_TEST -EFL_START_TEST(select_range2) +EFL_START_TEST(range_select2) { Eina_Array *arr_selected; efl_ui_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); - efl_ui_select_range(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); + efl_ui_range_select(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); _iterator_to_array(&arr_selected, efl_ui_selected_items_get(widget)); 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(widget, 1)); @@ -244,11 +244,11 @@ efl_ui_multi_selectable_behavior_test(TCase *tc) tcase_add_test(tc, test_multi_select_removal); tcase_add_test(tc, test_single_select); tcase_add_test(tc, test_none_select); - tcase_add_test(tc, select_all_api); - tcase_add_test(tc, unselect_all_api); - tcase_add_test(tc, unselect_range); - tcase_add_test(tc, unselect_range2); - tcase_add_test(tc, select_range); - tcase_add_test(tc, select_range2); + tcase_add_test(tc, all_select_api); + tcase_add_test(tc, all_unselect_api); + tcase_add_test(tc, range_unselect); + tcase_add_test(tc, range_unselect2); + tcase_add_test(tc, range_select); + tcase_add_test(tc, range_select2); efl_ui_single_selectable_behavior_test(tc); } -- 2.7.4