summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-05 19:07:29 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-05 19:49:13 +0200
commit1bd9a8f232ec1891cc396d13d7106aa7c255d78e (patch)
tree5dd46a9b1a892eb2ceb718a3fd414dc3fd937491
parentfc12e7721fd2ea2b39f9a732522e744d43a66840 (diff)
introduce a new interface efl_ui_selectable
this is meant to be implemented by entities that *can* be selectabled (not to be confused with containers that can have selected contents)! ref T8057 Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D9503
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c4
-rw-r--r--src/lib/elementary/Efl_Ui.h1
-rw-r--r--src/lib/elementary/efl_ui_collection.c50
-rw-r--r--src/lib/elementary/efl_ui_item.c14
-rw-r--r--src/lib/elementary/efl_ui_item.eo19
-rw-r--r--src/lib/elementary/efl_ui_selectable.eo21
-rw-r--r--src/lib/elementary/meson.build1
-rw-r--r--src/tests/elementary/efl_ui_test_collection_common.c46
8 files changed, 85 insertions, 71 deletions
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index a778617c93..bb8aa4011f 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -28,7 +28,7 @@ _list_selected(void *data EINA_UNUSED, const Efl_Event *ev)
28{ 28{
29 Eo *list = ev->object; 29 Eo *list = ev->object;
30 Eo *item = ev->info, *tmp; 30 Eo *item = ev->info, *tmp;
31 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected")); 31 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected"));
32 32
33 Eina_Iterator *selects = efl_ui_collection_selected_items_get(list); 33 Eina_Iterator *selects = efl_ui_collection_selected_items_get(list);
34 34
@@ -42,7 +42,7 @@ static void
42_list_unselected(void *data EINA_UNUSED, const Efl_Event *ev) 42_list_unselected(void *data EINA_UNUSED, const Efl_Event *ev)
43{ 43{
44 Eo *item = ev->info; 44 Eo *item = ev->info;
45 printf("list item [%p : %d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_item_selected_get(item)? "selected" : "unselected")); 45 printf("list item [%p : %d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected"));
46} 46}
47 47
48static void 48static void
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 56fe6a7d5e..74003bd452 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -259,6 +259,7 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
259# include <efl_ui_list_default_item.eo.h> 259# include <efl_ui_list_default_item.eo.h>
260# include <efl_ui_grid_default_item.eo.h> 260# include <efl_ui_grid_default_item.eo.h>
261# include <efl_ui_list_placeholder_item.eo.h> 261# include <efl_ui_list_placeholder_item.eo.h>
262# include <efl_ui_selectable.eo.h>
262 263
263/** 264/**
264 * Initialize Elementary 265 * Initialize Elementary
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index c637be0744..2241c5209d 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -371,7 +371,7 @@ deselect_all(Efl_Ui_Collection_Data *pd)
371 while(pd->selected) 371 while(pd->selected)
372 { 372 {
373 Eo *item = eina_list_data_get(pd->selected); 373 Eo *item = eina_list_data_get(pd->selected);
374 efl_ui_item_selected_set(item, EINA_FALSE); 374 efl_ui_selectable_selected_set(item, EINA_FALSE);
375 EINA_SAFETY_ON_TRUE_RETURN(eina_list_data_get(pd->selected) == item); 375 EINA_SAFETY_ON_TRUE_RETURN(eina_list_data_get(pd->selected) == item);
376 } 376 }
377} 377}
@@ -456,41 +456,40 @@ _efl_ui_collection_efl_ui_multi_selectable_select_mode_get(const Eo *obj EINA_UN
456} 456}
457 457
458static void 458static void
459_selected_cb(void *data, const Efl_Event *ev) 459_selection_changed(void *data, const Efl_Event *ev)
460{ 460{
461 Eina_Bool selection = *((Eina_Bool*) ev->info);
461 Eo *obj = data; 462 Eo *obj = data;
462 MY_DATA_GET(obj, pd); 463 MY_DATA_GET(obj, pd);
463 464
464 if (pd->mode == EFL_UI_SELECT_MODE_SINGLE_ALWAYS || pd->mode == EFL_UI_SELECT_MODE_SINGLE) 465 if (selection)
465 { 466 {
466 //we might get the situation that the item is already in the list and selected again, so just free the list, it will be rebuild below 467 if (pd->mode == EFL_UI_SELECT_MODE_SINGLE_ALWAYS || pd->mode == EFL_UI_SELECT_MODE_SINGLE)
467 if (eina_list_data_get(pd->selected) == ev->object)
468 { 468 {
469 pd->selected = eina_list_free(pd->selected); 469 //we might get the situation that the item is already in the list and selected again, so just free the list, it will be rebuild below
470 if (eina_list_data_get(pd->selected) == ev->object)
471 {
472 pd->selected = eina_list_free(pd->selected);
473 }
474 else
475 {
476 deselect_all(pd);
477 }
478
470 } 479 }
471 else 480 else if (pd->mode == EFL_UI_SELECT_MODE_NONE)
472 { 481 {
473 deselect_all(pd); 482 ERR("Selection while mode is NONE, uncaught state!");
483 return;
474 } 484 }
475 485 pd->selected = eina_list_append(pd->selected, ev->object);
486 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, ev->object);
476 } 487 }
477 else if (pd->mode == EFL_UI_SELECT_MODE_NONE) 488 else
478 { 489 {
479 ERR("Selection while mode is NONE, uncaught state!"); 490 pd->selected = eina_list_remove(pd->selected, ev->object);
480 return; 491 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, ev->object);
481 } 492 }
482 pd->selected = eina_list_append(pd->selected, ev->object);
483 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, ev->object);
484}
485
486static void
487_unselected_cb(void *data, const Efl_Event *ev)
488{
489 Eo *obj = data;
490 MY_DATA_GET(obj, pd);
491
492 pd->selected = eina_list_remove(pd->selected, ev->object);
493 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, ev->object);
494} 493}
495 494
496static void 495static void
@@ -529,8 +528,7 @@ _redirect_cb(void *data, const Efl_Event *ev)
529 528
530EFL_CALLBACKS_ARRAY_DEFINE(active_item, 529EFL_CALLBACKS_ARRAY_DEFINE(active_item,
531 {EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _hints_changed_cb}, 530 {EFL_GFX_ENTITY_EVENT_HINTS_CHANGED, _hints_changed_cb},
532 {EFL_UI_EVENT_ITEM_SELECTED, _selected_cb}, 531 {EFL_UI_EVENT_SELECTED_CHANGED, _selection_changed},
533 {EFL_UI_EVENT_ITEM_UNSELECTED, _unselected_cb},
534 {EFL_INPUT_EVENT_PRESSED, _redirect_cb}, 532 {EFL_INPUT_EVENT_PRESSED, _redirect_cb},
535 {EFL_INPUT_EVENT_UNPRESSED, _redirect_cb}, 533 {EFL_INPUT_EVENT_UNPRESSED, _redirect_cb},
536 {EFL_INPUT_EVENT_LONGPRESSED, _redirect_cb}, 534 {EFL_INPUT_EVENT_LONGPRESSED, _redirect_cb},
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index c0c863bf73..1ccc987759 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -142,6 +142,7 @@ static void
142_item_select(Eo *obj, Efl_Ui_Item_Data *pd) 142_item_select(Eo *obj, Efl_Ui_Item_Data *pd)
143{ 143{
144 Efl_Ui_Select_Mode m; 144 Efl_Ui_Select_Mode m;
145
145 if (!pd->parent) 146 if (!pd->parent)
146 return; 147 return;
147 m = efl_ui_select_mode_get(pd->parent); 148 m = efl_ui_select_mode_get(pd->parent);
@@ -150,9 +151,9 @@ _item_select(Eo *obj, Efl_Ui_Item_Data *pd)
150 151
151 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 152 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
152 153
153 pd->selected = EINA_TRUE; 154 Eina_Bool tmp = pd->selected = EINA_TRUE;
154 edje_object_signal_emit(wd->resize_obj, "efl,state,selected", "efl"); 155 edje_object_signal_emit(wd->resize_obj, "efl,state,selected", "efl");
155 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_SELECTED, NULL); 156 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED_CHANGED, &tmp);
156} 157}
157 158
158static void 159static void
@@ -161,9 +162,9 @@ _item_unselect(Eo *obj, Efl_Ui_Item_Data *pd)
161 if (!pd->selected) return; 162 if (!pd->selected) return;
162 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 163 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
163 164
164 pd->selected = EINA_FALSE; 165 Eina_Bool tmp = pd->selected =EINA_FALSE;
165 edje_object_signal_emit(wd->resize_obj, "efl,state,unselected", "efl"); 166 edje_object_signal_emit(wd->resize_obj, "efl,state,unselected", "efl");
166 efl_event_callback_call(obj, EFL_UI_EVENT_ITEM_UNSELECTED, NULL); 167 efl_event_callback_call(obj, EFL_UI_EVENT_SELECTED_CHANGED, &tmp);
167} 168}
168 169
169/* Mouse Controls */ 170/* Mouse Controls */
@@ -242,7 +243,7 @@ _efl_ui_item_index_get(const Eo *obj, Efl_Ui_Item_Data *pd)
242} 243}
243 244
244EOLIAN static void 245EOLIAN static void
245_efl_ui_item_selected_set(Eo *obj, Efl_Ui_Item_Data *pd, Eina_Bool select) 246_efl_ui_item_efl_ui_selectable_selected_set(Eo *obj, Efl_Ui_Item_Data *pd, Eina_Bool select)
246{ 247{
247 Eina_Bool selected = !!select; 248 Eina_Bool selected = !!select;
248 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 249 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
@@ -253,7 +254,7 @@ _efl_ui_item_selected_set(Eo *obj, Efl_Ui_Item_Data *pd, Eina_Bool select)
253} 254}
254 255
255EOLIAN static Eina_Bool 256EOLIAN static Eina_Bool
256_efl_ui_item_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd) 257_efl_ui_item_efl_ui_selectable_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
257{ 258{
258 return pd->selected; 259 return pd->selected;
259} 260}
@@ -271,3 +272,4 @@ _efl_ui_item_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
271} 272}
272 273
273#include "efl_ui_item.eo.c" 274#include "efl_ui_item.eo.c"
275#include "efl_ui_selectable.eo.c"
diff --git a/src/lib/elementary/efl_ui_item.eo b/src/lib/elementary/efl_ui_item.eo
index 331f48a8e1..51c9100fec 100644
--- a/src/lib/elementary/efl_ui_item.eo
+++ b/src/lib/elementary/efl_ui_item.eo
@@ -1,4 +1,4 @@
1abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Container_Selectable, Efl.Input.Clickable 1abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Selectable, Efl.Input.Clickable
2{ 2{
3 [[Selectable Item abstraction. 3 [[Selectable Item abstraction.
4 4
@@ -6,7 +6,7 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Containe
6 like @Efl.Ui.List or @Efl.Ui.Grid, for example. 6 like @Efl.Ui.List or @Efl.Ui.Grid, for example.
7 @Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin. 7 @Efl.Ui.Item provides user interaction through the @Efl.Input.Clickable mixin.
8 Items can be pressed, long-pressed, etc, and appropriate events are generated. 8 Items can be pressed, long-pressed, etc, and appropriate events are generated.
9 @Efl.Ui.Item also implements the @Efl.Ui.Container_Selectable interface, meaning that "selected" and 9 @Efl.Ui.Item also implements the @Efl.Ui.Selectable interface, meaning that "selected" and
10 "unselected" events are automatically generated. 10 "unselected" events are automatically generated.
11 11
12 Classes inheriting from this one only need to deal with the visual representation of the widget. 12 Classes inheriting from this one only need to deal with the visual representation of the widget.
@@ -15,8 +15,8 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Containe
15 Some events are converted to edje signals so the theme can react to them: 15 Some events are converted to edje signals so the theme can react to them:
16 @[Efl.Input.Clickable.pressed] -> "efl,state,pressed", 16 @[Efl.Input.Clickable.pressed] -> "efl,state,pressed",
17 @[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed", 17 @[Efl.Input.Clickable.unpressed] -> "efl,state,unpressed",
18 @[Efl.Ui.Container_Selectable.item,selected] -> "efl,state,selected", 18 @[Efl.Ui.Selectable.selected,changed] (true) -> "efl,state,selected",
19 @[Efl.Ui.Container_Selectable.item,unselected] -> "efl,state,unselected". 19 @[Efl.Ui.Selectable.selected,changed] (false) -> "efl,state,unselected".
20 ]] 20 ]]
21 methods { 21 methods {
22 @property index { 22 @property index {
@@ -28,16 +28,6 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Containe
28 index : int; [[The index where to find this item in its $container.]] 28 index : int; [[The index where to find this item in its $container.]]
29 } 29 }
30 } 30 }
31 @property selected {
32 [[Item selected state.
33
34 The visual representation of the item will be adjusted accordingly to the new state.
35 This property is also automatically modified in response to user actions.
36 ]]
37 values {
38 select: bool; [[Whether this item is selected or not.]]
39 }
40 }
41 @property container { 31 @property container {
42 [[The container this object is part of. 32 [[The container this object is part of.
43 33
@@ -55,5 +45,6 @@ abstract @beta Efl.Ui.Item extends Efl.Ui.Layout_Base implements Efl.Ui.Containe
55 Efl.Object.constructor; 45 Efl.Object.constructor;
56 Efl.Object.finalize; 46 Efl.Object.finalize;
57 Efl.Object.destructor; 47 Efl.Object.destructor;
48 Efl.Ui.Selectable.selected {get; set;}
58 } 49 }
59} 50}
diff --git a/src/lib/elementary/efl_ui_selectable.eo b/src/lib/elementary/efl_ui_selectable.eo
new file mode 100644
index 0000000000..66a83ee347
--- /dev/null
+++ b/src/lib/elementary/efl_ui_selectable.eo
@@ -0,0 +1,21 @@
1interface Efl.Ui.Selectable {
2 [[Selectable interface for ui objects
3
4 A object implementing this can be selected. When the selected property of this object changes, the selected,changed event is emitted.
5 ]]
6 event_prefix: efl_ui;
7 methods {
8 @property selected {
9 [[The selected state of this object
10
11 A change to this property emits the changed event.
12 ]]
13 values {
14 selected : bool; [[The selected state of this object]]
15 }
16 }
17 }
18 events {
19 selected,changed : bool; [[Called when the selected state has changed]]
20 }
21}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 0ca268998b..8f0c85a12a 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -182,6 +182,7 @@ pub_eo_files = [
182 'efl_ui_position_manager_entity.eo', 182 'efl_ui_position_manager_entity.eo',
183 'efl_ui_position_manager_list.eo', 183 'efl_ui_position_manager_list.eo',
184 'efl_ui_position_manager_grid.eo', 184 'efl_ui_position_manager_grid.eo',
185 'efl_ui_selectable.eo',
185] 186]
186 187
187foreach eo_file : pub_eo_files 188foreach eo_file : pub_eo_files
diff --git a/src/tests/elementary/efl_ui_test_collection_common.c b/src/tests/elementary/efl_ui_test_collection_common.c
index c41946afbe..746b86d938 100644
--- a/src/tests/elementary/efl_ui_test_collection_common.c
+++ b/src/tests/elementary/efl_ui_test_collection_common.c
@@ -55,25 +55,25 @@ EFL_START_TEST(test_multi_select)
55 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); 55 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected);
56 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS); 56 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS);
57 57
58 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE); 58 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE);
59 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0)); 59 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0));
60 ck_assert_ptr_eq(unselected, NULL); 60 ck_assert_ptr_eq(unselected, NULL);
61 selected = NULL; 61 selected = NULL;
62 unselected = NULL; 62 unselected = NULL;
63 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 63 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
64 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2)); 64 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2));
65 ck_assert_ptr_eq(unselected, NULL); 65 ck_assert_ptr_eq(unselected, NULL);
66 selected = NULL; 66 selected = NULL;
67 unselected = NULL; 67 unselected = NULL;
68 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_TRUE); 68 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 0)), EINA_TRUE);
69 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); 69 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE);
70 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); 70 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2));
71 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); 71 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container));
72 ck_assert_int_eq(eina_array_count(arr_selected), 2); 72 ck_assert_int_eq(eina_array_count(arr_selected), 2);
73 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 0)); 73 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 0));
74 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(item_container, 2)); 74 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(item_container, 2));
75 75
76 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 76 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
77 ck_assert_ptr_eq(selected, NULL); 77 ck_assert_ptr_eq(selected, NULL);
78 ck_assert_ptr_eq(unselected, NULL); 78 ck_assert_ptr_eq(unselected, NULL);
79 selected = NULL; 79 selected = NULL;
@@ -93,17 +93,17 @@ EFL_START_TEST(test_multi_select_removal)
93 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); 93 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected);
94 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS); 94 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS);
95 95
96 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE); 96 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE);
97 selected = NULL;//No need to ckeck the flag, we asserted in the tcase before 97 selected = NULL;//No need to ckeck the flag, we asserted in the tcase before
98 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 98 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
99 selected = NULL;//No need to ckeck the flag, we asserted in the tcase before 99 selected = NULL;//No need to ckeck the flag, we asserted in the tcase before
100 unselected = NULL; 100 unselected = NULL;
101 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_FALSE); 101 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_FALSE);
102 ck_assert_ptr_eq(selected, NULL); 102 ck_assert_ptr_eq(selected, NULL);
103 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0)); 103 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0));
104 selected = NULL; 104 selected = NULL;
105 unselected = NULL; 105 unselected = NULL;
106 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_FALSE); 106 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_FALSE);
107 ck_assert_ptr_eq(selected, NULL); 107 ck_assert_ptr_eq(selected, NULL);
108 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 2)); 108 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 2));
109 selected = NULL; 109 selected = NULL;
@@ -128,24 +128,24 @@ EFL_START_TEST(test_single_select)
128 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); 128 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected);
129 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS); 129 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS);
130 130
131 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE); 131 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE);
132 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0)); 132 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0));
133 ck_assert_ptr_eq(unselected, NULL); 133 ck_assert_ptr_eq(unselected, NULL);
134 selected = NULL; 134 selected = NULL;
135 unselected = NULL; 135 unselected = NULL;
136 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 136 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
137 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2)); 137 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2));
138 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0)); 138 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0));
139 selected = NULL; 139 selected = NULL;
140 unselected = NULL; 140 unselected = NULL;
141 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); 141 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE);
142 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); 142 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE);
143 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); 143 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2));
144 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); 144 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container));
145 ck_assert_int_eq(eina_array_count(arr_selected), 1); 145 ck_assert_int_eq(eina_array_count(arr_selected), 1);
146 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 2)); 146 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(item_container, 2));
147 147
148 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 148 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
149 ck_assert_ptr_eq(selected, NULL); 149 ck_assert_ptr_eq(selected, NULL);
150 ck_assert_ptr_eq(unselected, NULL); 150 ck_assert_ptr_eq(unselected, NULL);
151 selected = NULL; 151 selected = NULL;
@@ -166,23 +166,23 @@ EFL_START_TEST(test_single_select_always)
166 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); 166 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected);
167 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS); 167 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS);
168 168
169 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE); 169 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE);
170 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0)); 170 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 0));
171 ck_assert_ptr_eq(unselected, NULL); 171 ck_assert_ptr_eq(unselected, NULL);
172 selected = NULL; 172 selected = NULL;
173 unselected = NULL; 173 unselected = NULL;
174 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 174 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
175 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2)); 175 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2));
176 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0)); 176 ck_assert_ptr_eq(unselected, efl_pack_content_get(item_container, 0));
177 selected = NULL; 177 selected = NULL;
178 unselected = NULL; 178 unselected = NULL;
179 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 179 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
180 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2)); 180 ck_assert_ptr_eq(selected, efl_pack_content_get(item_container, 2));
181 ck_assert_ptr_eq(unselected, NULL); 181 ck_assert_ptr_eq(unselected, NULL);
182 selected = NULL; 182 selected = NULL;
183 unselected = NULL; 183 unselected = NULL;
184 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); 184 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE);
185 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE); 185 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 2)), EINA_TRUE);
186 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2)); 186 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), efl_pack_content_get(item_container, 2));
187 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); 187 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container));
188 ck_assert_int_eq(eina_array_count(arr_selected), 1); 188 ck_assert_int_eq(eina_array_count(arr_selected), 1);
@@ -203,18 +203,18 @@ EFL_START_TEST(test_none_select)
203 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected); 203 efl_event_callback_add(item_container, EFL_UI_EVENT_ITEM_UNSELECTED, _set_pointer_quit, &unselected);
204 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS); 204 fill_items(EFL_UI_LIST_DEFAULT_ITEM_CLASS);
205 205
206 efl_ui_item_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE); 206 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 0), EINA_TRUE);
207 ck_assert_ptr_eq(selected, NULL); 207 ck_assert_ptr_eq(selected, NULL);
208 ck_assert_ptr_eq(unselected, NULL); 208 ck_assert_ptr_eq(unselected, NULL);
209 selected = NULL; 209 selected = NULL;
210 unselected = NULL; 210 unselected = NULL;
211 efl_ui_item_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE); 211 efl_ui_selectable_selected_set(efl_pack_content_get(item_container, 2), EINA_TRUE);
212 ck_assert_ptr_eq(selected, NULL); 212 ck_assert_ptr_eq(selected, NULL);
213 ck_assert_ptr_eq(unselected, NULL); 213 ck_assert_ptr_eq(unselected, NULL);
214 selected = NULL; 214 selected = NULL;
215 unselected = NULL; 215 unselected = NULL;
216 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE); 216 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 0)), EINA_FALSE);
217 ck_assert_int_eq(efl_ui_item_selected_get(efl_pack_content_get(item_container, 2)), EINA_FALSE); 217 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(item_container, 2)), EINA_FALSE);
218 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), NULL); 218 ck_assert_ptr_eq(efl_ui_collection_last_selected_item_get(item_container), NULL);
219 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container)); 219 _iterator_to_array(&arr_selected, efl_ui_collection_selected_items_get(item_container));
220 ck_assert_int_eq(eina_array_count(arr_selected), 0); 220 ck_assert_int_eq(eina_array_count(arr_selected), 0);