summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test_ui_collection.c6
-rw-r--r--src/examples/elementary/efl_ui_collection_view_example_1.c2
-rw-r--r--src/examples/elementary/efl_ui_list_example_1.c4
-rw-r--r--src/examples/elementary/efl_ui_list_view_example_3.c4
-rw-r--r--src/lib/elementary/Efl_Ui.h3
-rw-r--r--src/lib/elementary/efl_ui_collection.c6
-rw-r--r--src/lib/elementary/efl_ui_collection.eo10
-rw-r--r--src/lib/elementary/efl_ui_collection_view.c4
-rw-r--r--src/lib/elementary/efl_ui_collection_view.eo6
-rw-r--r--src/lib/elementary/efl_ui_grid.eo2
-rw-r--r--src/lib/elementary/efl_ui_grid_view.eo4
-rw-r--r--src/lib/elementary/efl_ui_item.c3
-rw-r--r--src/lib/elementary/efl_ui_list.eo2
-rw-r--r--src/lib/elementary/efl_ui_list_view.eo4
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable.eo34
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable_async.eo63
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable_index_range.eo53
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable_object_range.eo46
-rw-r--r--src/lib/elementary/efl_ui_select_model.c24
-rw-r--r--src/lib/elementary/efl_ui_select_model.eo16
-rw-r--r--src/lib/elementary/meson.build3
-rw-r--r--src/tests/elementary/efl_ui_test_select_model.c4
-rw-r--r--src/tests/elementary/spec/efl_test_multi_selectable.c74
23 files changed, 192 insertions, 185 deletions
diff --git a/src/bin/elementary/test_ui_collection.c b/src/bin/elementary/test_ui_collection.c
index 2f74809d29..2397e14211 100644
--- a/src/bin/elementary/test_ui_collection.c
+++ b/src/bin/elementary/test_ui_collection.c
@@ -8,13 +8,13 @@
8static void 8static void
9_all_select(void *data, const Efl_Event *ev EINA_UNUSED) 9_all_select(void *data, const Efl_Event *ev EINA_UNUSED)
10{ 10{
11 efl_ui_selectable_all_select(data); 11 efl_ui_multi_selectable_all_select(data);
12} 12}
13 13
14static void 14static void
15_all_unselect(void *data, const Efl_Event *ev EINA_UNUSED) 15_all_unselect(void *data, const Efl_Event *ev EINA_UNUSED)
16{ 16{
17 efl_ui_selectable_all_unselect(data); 17 efl_ui_multi_selectable_all_unselect(data);
18} 18}
19 19
20static void 20static void
@@ -168,7 +168,7 @@ _select_value_cb(void *data, const Efl_Event *ev)
168{ 168{
169 Efl_Ui_Collection *c = data; 169 Efl_Ui_Collection *c = data;
170 170
171 efl_ui_selectable_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object)); 171 efl_ui_multi_selectable_select_mode_set(c, efl_ui_radio_group_selected_value_get(ev->object));
172} 172}
173 173
174void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class *item, const char *name) 174void create_item_container_ui(const Efl_Class *collection_class, const Efl_Class *item, const char *name)
diff --git a/src/examples/elementary/efl_ui_collection_view_example_1.c b/src/examples/elementary/efl_ui_collection_view_example_1.c
index 72960651fb..3255b17d4d 100644
--- a/src/examples/elementary/efl_ui_collection_view_example_1.c
+++ b/src/examples/elementary/efl_ui_collection_view_example_1.c
@@ -96,7 +96,7 @@ efl_main(void *data EINA_UNUSED, const Efl_Event *ev)
96 li = efl_add(EFL_UI_COLLECTION_VIEW_CLASS, win, 96 li = efl_add(EFL_UI_COLLECTION_VIEW_CLASS, win,
97 efl_ui_collection_view_position_manager_set(efl_added, position_manager), 97 efl_ui_collection_view_position_manager_set(efl_added, position_manager),
98 efl_ui_view_model_set(efl_added, model), 98 efl_ui_view_model_set(efl_added, model),
99 efl_ui_multi_selectable_async_select_mode_set(efl_added, mode), 99 efl_ui_multi_selectable_select_mode_set(efl_added, mode),
100 efl_ui_collection_view_factory_set(efl_added, factory)); 100 efl_ui_collection_view_factory_set(efl_added, factory));
101 101
102 efl_content_set(win, li); 102 efl_content_set(win, li);
diff --git a/src/examples/elementary/efl_ui_list_example_1.c b/src/examples/elementary/efl_ui_list_example_1.c
index ac4976a3c1..edf6d5dd4b 100644
--- a/src/examples/elementary/efl_ui_list_example_1.c
+++ b/src/examples/elementary/efl_ui_list_example_1.c
@@ -37,7 +37,7 @@ _list_selected(void *data EINA_UNUSED, const Efl_Event *ev)
37 Eo *item = ev->info, *tmp; 37 Eo *item = ev->info, *tmp;
38 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected")); 38 printf("list item [%p:%d] is %s\n", item, efl_ui_item_index_get(item), (efl_ui_selectable_selected_get(item)? "selected" : "unselected"));
39 39
40 Eina_Iterator *selects = efl_ui_selectable_selected_iterator_new(list); 40 Eina_Iterator *selects = efl_ui_multi_selectable_selected_iterator_new(list);
41 41
42 EINA_ITERATOR_FOREACH(selects, tmp) 42 EINA_ITERATOR_FOREACH(selects, tmp)
43 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp)); 43 printf("selected [%p:%d] ", tmp, efl_ui_item_index_get(tmp));
@@ -77,7 +77,7 @@ static void
77_select_radio_changed(void *data, const Efl_Event *ev) 77_select_radio_changed(void *data, const Efl_Event *ev)
78{ 78{
79 Eo *list = data; 79 Eo *list = data;
80 efl_ui_selectable_select_mode_set(list, efl_ui_radio_group_selected_value_get(ev->object)); 80 efl_ui_multi_selectable_select_mode_set(list, efl_ui_radio_group_selected_value_get(ev->object));
81} 81}
82 82
83static void 83static void
diff --git a/src/examples/elementary/efl_ui_list_view_example_3.c b/src/examples/elementary/efl_ui_list_view_example_3.c
index c9f6b0db97..dcf6082926 100644
--- a/src/examples/elementary/efl_ui_list_view_example_3.c
+++ b/src/examples/elementary/efl_ui_list_view_example_3.c
@@ -110,7 +110,7 @@ static void
110_bt_none_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 110_bt_none_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
111{ 111{
112 Evas_Object *li = data; 112 Evas_Object *li = data;
113 efl_ui_multi_selectable_async_select_mode_set(li, EFL_UI_SELECT_MODE_NONE); 113 efl_ui_multi_selectable_select_mode_set(li, EFL_UI_SELECT_MODE_NONE);
114} 114}
115 115
116static void 116static void
@@ -124,7 +124,7 @@ static void
124_bt_default_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 124_bt_default_clicked(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
125{ 125{
126 Evas_Object *li = data; 126 Evas_Object *li = data;
127 efl_ui_multi_selectable_async_select_mode_set(li, EFL_UI_SELECT_MODE_SINGLE); 127 efl_ui_multi_selectable_select_mode_set(li, EFL_UI_SELECT_MODE_SINGLE);
128} 128}
129 129
130static void 130static void
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index 9c8744d006..b3b07b5181 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -298,6 +298,8 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
298# include <efl_ui_selectable.eo.h> 298# include <efl_ui_selectable.eo.h>
299# include <efl_ui_single_selectable.eo.h> 299# include <efl_ui_single_selectable.eo.h>
300# include <efl_ui_multi_selectable.eo.h> 300# include <efl_ui_multi_selectable.eo.h>
301# include <efl_ui_multi_selectable_object_range.eo.h>
302# include <efl_ui_multi_selectable_index_range.eo.h>
301# include <efl_ui_popup.eo.h> 303# include <efl_ui_popup.eo.h>
302# include <efl_ui_alert_popup.eo.h> 304# include <efl_ui_alert_popup.eo.h>
303# include <efl_ui_popup_part_backwall.eo.h> 305# include <efl_ui_popup_part_backwall.eo.h>
@@ -307,7 +309,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
307# include <efl_ui_tab_bar.eo.h> 309# include <efl_ui_tab_bar.eo.h>
308# include <efl_ui_tab_page.eo.h> 310# include <efl_ui_tab_page.eo.h>
309# include <efl_ui_tab_pager.eo.h> 311# include <efl_ui_tab_pager.eo.h>
310# include <efl_ui_multi_selectable_async.eo.h>
311# include <efl_ui_select_model.eo.h> 312# include <efl_ui_select_model.eo.h>
312 313
313# include <efl_ui_list_view.eo.h> 314# include <efl_ui_list_view.eo.h>
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index 6c3c5fe226..3e54f79b24 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -261,7 +261,7 @@ _efl_ui_collection_efl_ui_single_selectable_last_selected_get(const Eo *obj EINA
261} 261}
262 262
263EOLIAN static Eina_Iterator* 263EOLIAN static Eina_Iterator*
264_efl_ui_collection_efl_ui_multi_selectable_selected_iterator_new(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) 264_efl_ui_collection_efl_ui_multi_selectable_object_range_selected_iterator_new(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd)
265{ 265{
266 return eina_list_iterator_new(pd->selected); 266 return eina_list_iterator_new(pd->selected);
267} 267}
@@ -1147,13 +1147,13 @@ _range_selection_find(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a,
1147} 1147}
1148 1148
1149EOLIAN static void 1149EOLIAN static void
1150_efl_ui_collection_efl_ui_multi_selectable_range_select(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) 1150_efl_ui_collection_efl_ui_multi_selectable_object_range_range_select(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b)
1151{ 1151{
1152 _range_selection_find(obj, pd, a, b, EINA_TRUE); 1152 _range_selection_find(obj, pd, a, b, EINA_TRUE);
1153} 1153}
1154 1154
1155EOLIAN static void 1155EOLIAN static void
1156_efl_ui_collection_efl_ui_multi_selectable_range_unselect(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b) 1156_efl_ui_collection_efl_ui_multi_selectable_object_range_range_unselect(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui_Selectable *a, Efl_Ui_Selectable *b)
1157{ 1157{
1158 _range_selection_find(obj, pd, a, b, EINA_FALSE); 1158 _range_selection_find(obj, pd, a, b, EINA_FALSE);
1159} 1159}
diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo
index 6071c2ae02..342feea116 100644
--- a/src/lib/elementary/efl_ui_collection.eo
+++ b/src/lib/elementary/efl_ui_collection.eo
@@ -1,7 +1,7 @@
1class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements 1class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
2 Efl.Pack_Linear, 2 Efl.Pack_Linear,
3 Efl.Ui.Layout_Orientable, 3 Efl.Ui.Layout_Orientable,
4 Efl.Ui.Multi_Selectable, 4 Efl.Ui.Multi_Selectable_Object_Range,
5 Efl.Ui.Focus.Manager_Sub, 5 Efl.Ui.Focus.Manager_Sub,
6 Efl.Ui.Widget_Focus_Manager, 6 Efl.Ui.Widget_Focus_Manager,
7 Efl.Ui.Item_Clickable 7 Efl.Ui.Item_Clickable
@@ -24,7 +24,7 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
24 If all items do not fit in the current widget size scrolling facilities are provided. 24 If all items do not fit in the current widget size scrolling facilities are provided.
25 25
26 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode 26 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
27 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable.selected_iterator_new. 27 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Object_Range.selected_iterator_new.
28 28
29 @since 1.23 29 @since 1.23
30 ]] 30 ]]
@@ -84,12 +84,12 @@ class Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
84 Efl.Ui.Widget.focus_state_apply; 84 Efl.Ui.Widget.focus_state_apply;
85 Efl.Ui.Focus.Manager.move; 85 Efl.Ui.Focus.Manager.move;
86 Efl.Ui.Single_Selectable.last_selected { get; } 86 Efl.Ui.Single_Selectable.last_selected { get; }
87 Efl.Ui.Multi_Selectable.selected_iterator_new;
88 Efl.Ui.Multi_Selectable.select_mode {get; set;} 87 Efl.Ui.Multi_Selectable.select_mode {get; set;}
89 Efl.Ui.Multi_Selectable.all_select; 88 Efl.Ui.Multi_Selectable.all_select;
90 Efl.Ui.Multi_Selectable.all_unselect; 89 Efl.Ui.Multi_Selectable.all_unselect;
91 Efl.Ui.Multi_Selectable.range_select; 90 Efl.Ui.Multi_Selectable_Object_Range.selected_iterator_new;
92 Efl.Ui.Multi_Selectable.range_unselect; 91 Efl.Ui.Multi_Selectable_Object_Range.range_select;
92 Efl.Ui.Multi_Selectable_Object_Range.range_unselect;
93 Efl.Ui.Single_Selectable.fallback_selection {get; set;} 93 Efl.Ui.Single_Selectable.fallback_selection {get; set;}
94 } 94 }
95} 95}
diff --git a/src/lib/elementary/efl_ui_collection_view.c b/src/lib/elementary/efl_ui_collection_view.c
index e3d4c96ff0..e5cff428b4 100644
--- a/src/lib/elementary/efl_ui_collection_view.c
+++ b/src/lib/elementary/efl_ui_collection_view.c
@@ -1921,11 +1921,11 @@ _efl_ui_collection_view_model_changed(void *data, const Efl_Event *event)
1921 // Search the composition of model for the one providing MULTI_SELECTABLE_ASYNC 1921 // Search the composition of model for the one providing MULTI_SELECTABLE_ASYNC
1922 mselect = ev->current; 1922 mselect = ev->current;
1923 while (mselect && 1923 while (mselect &&
1924 !efl_isa(mselect, EFL_UI_MULTI_SELECTABLE_ASYNC_INTERFACE) && 1924 !efl_isa(mselect, EFL_UI_MULTI_SELECTABLE_INDEX_RANGE_INTERFACE) &&
1925 efl_isa(mselect, EFL_COMPOSITE_MODEL_CLASS)) 1925 efl_isa(mselect, EFL_COMPOSITE_MODEL_CLASS))
1926 mselect = efl_ui_view_model_get(mselect); 1926 mselect = efl_ui_view_model_get(mselect);
1927 1927
1928 if (!efl_isa(mselect, EFL_UI_MULTI_SELECTABLE_ASYNC_INTERFACE)) 1928 if (!efl_isa(mselect, EFL_UI_MULTI_SELECTABLE_INDEX_RANGE_INTERFACE))
1929 { 1929 {
1930 mselect = NULL; 1930 mselect = NULL;
1931 selection = EINA_FALSE; 1931 selection = EINA_FALSE;
diff --git a/src/lib/elementary/efl_ui_collection_view.eo b/src/lib/elementary/efl_ui_collection_view.eo
index 330c95693c..65a1ee9e62 100644
--- a/src/lib/elementary/efl_ui_collection_view.eo
+++ b/src/lib/elementary/efl_ui_collection_view.eo
@@ -3,7 +3,7 @@ class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
3 Efl.Ui.Focus.Manager_Sub, 3 Efl.Ui.Focus.Manager_Sub,
4 Efl.Ui.Widget_Focus_Manager, 4 Efl.Ui.Widget_Focus_Manager,
5 Efl.Ui.Item_Clickable 5 Efl.Ui.Item_Clickable
6 composites Efl.Ui.Scrollable, Efl.Ui.Scrollbar, Efl.Ui.Multi_Selectable_Async, Efl.Ui.Single_Selectable 6 composites Efl.Ui.Scrollable, Efl.Ui.Scrollbar, Efl.Ui.Multi_Selectable_Index_Range, Efl.Ui.Single_Selectable
7{ 7{
8 [[This widget displays a list of items in an arrangement controlled by an external @.position_manager 8 [[This widget displays a list of items in an arrangement controlled by an external @.position_manager
9 object. By using different @.position_manager objects this widget can show unidimensional lists or 9 object. By using different @.position_manager objects this widget can show unidimensional lists or
@@ -21,8 +21,8 @@ class Efl.Ui.Collection_View extends Efl.Ui.Layout_Base implements
21 21
22 If all items do not fit in the current widget size scrolling facilities are provided. 22 If all items do not fit in the current widget size scrolling facilities are provided.
23 23
24 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable_Async.select_mode 24 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
25 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Async.selected_iterator_new. 25 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Index_Range.selected_ndx_iterator_new.
26 26
27 @since 1.23 27 @since 1.23
28 ]] 28 ]]
diff --git a/src/lib/elementary/efl_ui_grid.eo b/src/lib/elementary/efl_ui_grid.eo
index d461760eda..ad4a4aee68 100644
--- a/src/lib/elementary/efl_ui_grid.eo
+++ b/src/lib/elementary/efl_ui_grid.eo
@@ -8,7 +8,7 @@ class Efl.Ui.Grid extends Efl.Ui.Collection
8 @Efl.Ui.Layout_Orientable.orientation. 8 @Efl.Ui.Layout_Orientable.orientation.
9 9
10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode 10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable.selected_iterator_new. 11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Object_Range.selected_iterator_new.
12 12
13 @Efl.Ui.Grid supports grouping by using @Efl.Ui.Group_Item objects. 13 @Efl.Ui.Grid supports grouping by using @Efl.Ui.Group_Item objects.
14 Group headers are displayed at the top of the viewport if items belonging to the group 14 Group headers are displayed at the top of the viewport if items belonging to the group
diff --git a/src/lib/elementary/efl_ui_grid_view.eo b/src/lib/elementary/efl_ui_grid_view.eo
index 18e513e8c9..3ad70c25d2 100644
--- a/src/lib/elementary/efl_ui_grid_view.eo
+++ b/src/lib/elementary/efl_ui_grid_view.eo
@@ -7,8 +7,8 @@ class @beta Efl.Ui.Grid_View extends Efl.Ui.Collection_View
7 The orientation (vertical or horizontal) of the grid can be set with 7 The orientation (vertical or horizontal) of the grid can be set with
8 @Efl.Ui.Layout_Orientable.orientation. 8 @Efl.Ui.Layout_Orientable.orientation.
9 9
10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable_Async.select_mode 10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Async.selected_iterator_new. 11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Index_Range.selected_ndx_iterator_new.
12 ]] 12 ]]
13 data: null; 13 data: null;
14 implements { 14 implements {
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index f3c35ac9cf..349416ee8a 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -30,7 +30,7 @@ static Efl_Ui_Select_Mode
30_fetch_state(Eo *obj) 30_fetch_state(Eo *obj)
31{ 31{
32 if (efl_isa(obj, EFL_UI_MULTI_SELECTABLE_INTERFACE)) 32 if (efl_isa(obj, EFL_UI_MULTI_SELECTABLE_INTERFACE))
33 return efl_ui_selectable_select_mode_get(obj); 33 return efl_ui_multi_selectable_select_mode_get(obj);
34 if (efl_isa(obj, EFL_UI_SINGLE_SELECTABLE_INTERFACE)) 34 if (efl_isa(obj, EFL_UI_SINGLE_SELECTABLE_INTERFACE))
35 return EFL_UI_SELECT_MODE_SINGLE; 35 return EFL_UI_SELECT_MODE_SINGLE;
36 ERR("Uncaught state %s", efl_debug_name_get(obj)); 36 ERR("Uncaught state %s", efl_debug_name_get(obj));
@@ -236,6 +236,7 @@ ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_item, Efl_Ui_Item_Data)
236#include "efl_ui_item.eo.c" 236#include "efl_ui_item.eo.c"
237#include "efl_ui_selectable.eo.c" 237#include "efl_ui_selectable.eo.c"
238#include "efl_ui_multi_selectable.eo.c" 238#include "efl_ui_multi_selectable.eo.c"
239#include "efl_ui_multi_selectable_object_range.eo.c"
239#include "efl_ui_single_selectable.eo.c" 240#include "efl_ui_single_selectable.eo.c"
240#include "efl_ui_item_clickable.eo.c" 241#include "efl_ui_item_clickable.eo.c"
241 242
diff --git a/src/lib/elementary/efl_ui_list.eo b/src/lib/elementary/efl_ui_list.eo
index 0bd3045223..73ef34b9e8 100644
--- a/src/lib/elementary/efl_ui_list.eo
+++ b/src/lib/elementary/efl_ui_list.eo
@@ -8,7 +8,7 @@ class Efl.Ui.List extends Efl.Ui.Collection
8 @Efl.Ui.Layout_Orientable.orientation. 8 @Efl.Ui.Layout_Orientable.orientation.
9 9
10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode 10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable.selected_iterator_new. 11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Object_Range.selected_iterator_new.
12 12
13 @Efl.Ui.List supports grouping by using @Efl.Ui.Group_Item objects. 13 @Efl.Ui.List supports grouping by using @Efl.Ui.Group_Item objects.
14 Group headers are displayed at the top or left side of the viewport if items belonging to the group 14 Group headers are displayed at the top or left side of the viewport if items belonging to the group
diff --git a/src/lib/elementary/efl_ui_list_view.eo b/src/lib/elementary/efl_ui_list_view.eo
index c4de87da5a..af46bd32d0 100644
--- a/src/lib/elementary/efl_ui_list_view.eo
+++ b/src/lib/elementary/efl_ui_list_view.eo
@@ -7,8 +7,8 @@ class @beta Efl.Ui.List_View extends Efl.Ui.Collection_View
7 The orientation (vertical or horizontal) of the list can be set with 7 The orientation (vertical or horizontal) of the list can be set with
8 @Efl.Ui.Layout_Orientable.orientation. 8 @Efl.Ui.Layout_Orientable.orientation.
9 9
10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable_Async.select_mode 10 Items inside this widget can be selected according to the @Efl.Ui.Multi_Selectable.select_mode
11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Async.selected_iterator_new. 11 policy, and the selection can be retrieved with @Efl.Ui.Multi_Selectable_Index_Range.selected_ndx_iterator_new.
12 ]] 12 ]]
13 data: null; 13 data: null;
14 implements { 14 implements {
diff --git a/src/lib/elementary/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo
index 251f640185..c5237c8118 100644
--- a/src/lib/elementary/efl_ui_multi_selectable.eo
+++ b/src/lib/elementary/efl_ui_multi_selectable.eo
@@ -6,47 +6,15 @@ interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable
6 6
7 The implementor of this interface provides the possibility to select multiple Selectables. 7 The implementor of this interface provides the possibility to select multiple Selectables.
8 If not, only @Efl.Ui.Single_Selectable should be implemented.]] 8 If not, only @Efl.Ui.Single_Selectable should be implemented.]]
9 c_prefix: efl_ui_selectable; 9 c_prefix: efl_ui_multi_selectable;
10 methods 10 methods
11 { 11 {
12 @property select_mode { 12 @property select_mode {
13 [[The mode type for children selection.]] 13 [[The mode type for children selection.]]
14 set {}
15 get {}
16 values { 14 values {
17 mode: Efl.Ui.Select_Mode; [[Type of selection of children]] 15 mode: Efl.Ui.Select_Mode; [[Type of selection of children]]
18 } 16 }
19 } 17 }
20 selected_iterator_new {
21 [[Get the selected items in a iterator. The iterator sequence will be decided by selection.]]
22 return: iterator<Efl.Ui.Selectable> @move @no_unused; [[User has to free the iterator after usage.]]
23 }
24 range_select @beta {
25 [[Select a range of @Efl.Ui.Selectable.
26
27 This will select the range of selectables from a to b or from b to a depending on which one comes first.
28 If a or b are not part of the widget, a error is returned, and no change is applied.
29 $null is not allowed as either of the parameters.
30 Both of the passed values will also be selected.
31 ]]
32 params {
33 a : Efl.Ui.Selectable; [[One side of the range.]]
34 b : Efl.Ui.Selectable; [[The other side of the range.]]
35 }
36 }
37 range_unselect @beta {
38 [[Unselect a range of @Efl.Ui.Selectable.
39
40 This will unselect the range of selectables from a to b or from b to a depending on which one comes first.
41 If a or b are not part of the widget, a error is returned, and no change is applied.
42 $null is not allowed as either of the parameters.
43 Both of the passed values will also be unselected.
44 ]]
45 params {
46 a : Efl.Ui.Selectable; [[One side of the range.]]
47 b : Efl.Ui.Selectable; [[The other side of the range.]]
48 }
49 }
50 all_select { 18 all_select {
51 [[Select all @Efl.Ui.Selectable]] 19 [[Select all @Efl.Ui.Selectable]]
52 } 20 }
diff --git a/src/lib/elementary/efl_ui_multi_selectable_async.eo b/src/lib/elementary/efl_ui_multi_selectable_async.eo
deleted file mode 100644
index 3a09682358..0000000000
--- a/src/lib/elementary/efl_ui_multi_selectable_async.eo
+++ /dev/null
@@ -1,63 +0,0 @@
1import efl_ui;
2
3interface @beta Efl.Ui.Multi_Selectable_Async extends Efl.Ui.Single_Selectable
4{
5 [[Interface for getting access to a range of selected items for widgets that provide them asynchronously.
6
7 The implementor of this interface provides the possibility to select multiple @Efl.Ui.Selectable.
8 If not, only @Efl.Ui.Single_Selectable should be implemented.
9 A widget can only provide either this interface or @Efl.Ui.Multi_Selectable, but not both.]]
10 methods
11 {
12 @property select_mode {
13 [[The mode type for children selection.]]
14 set {}
15 get {}
16 values {
17 mode: Efl.Ui.Select_Mode; [[Type of selection of children]]
18 }
19 }
20 selected_iterator_new {
21 [[Gets an iterator of all the selected child of this model.
22 ]]
23 return: iterator<uint64> @move @no_unused; [[The iterator gives indices of selected children.
24 It is valid until any change is made on the model.]]
25 }
26 unselected_iterator_new {
27 [[Gets an iterator of all the child of this model that are not selected.
28 ]]
29 return: iterator<uint64> @move @no_unused; [[The iterator gives indices of unselected children.
30 It is valid until any change is made on the model.]]
31 }
32 range_select @beta {
33 [[Select a range of @Efl.Ui.Selectable.
34
35 This will select the range of selectables from $a to $b or from $b to $a depending on which one comes first.
36 If $a or $b are not in the range the widget, an error is returned, and no change is applied.
37 Both of the passed values will also be selected.
38 ]]
39 params {
40 a : uint64; [[One side of the range.]]
41 b : uint64; [[The other side of the range.]]
42 }
43 }
44 range_unselect @beta {
45 [[Unselect a range of @Efl.Ui.Selectable.
46
47 This will unselect the range of selectables from $a to $b or from $b to $a depending on which one comes first.
48 If $a or $b are not in the range of the widget, an error is returned, and no change is applied.
49 Both of the passed values will also be unselected.
50 ]]
51 params {
52 a : uint64; [[One side of the range.]]
53 b : uint64; [[The other side of the range.]]
54 }
55 }
56 all_select {
57 [[Select all @Efl.Ui.Selectable]]
58 }
59 all_unselect {
60 [[Unselect all @Efl.Ui.Selectable]]
61 }
62 }
63}
diff --git a/src/lib/elementary/efl_ui_multi_selectable_index_range.eo b/src/lib/elementary/efl_ui_multi_selectable_index_range.eo
new file mode 100644
index 0000000000..39747ab8b4
--- /dev/null
+++ b/src/lib/elementary/efl_ui_multi_selectable_index_range.eo
@@ -0,0 +1,53 @@
1import efl_ui;
2
3interface @beta Efl.Ui.Multi_Selectable_Index_Range extends Efl.Ui.Multi_Selectable
4{
5 [[Interface for getting access to a range of selected items through their indices.
6
7 The implementor of this interface provides the possibility to select multiple @Efl.Ui.Selectable objects.
8 If not, only @Efl.Ui.Single_Selectable should be implemented.
9 A widget can only provide either this interface or @Efl.Ui.Multi_Selectable_Object_Range, but not both.]]
10 c_prefix: efl_ui_multi_selectable;
11 methods
12 {
13 selected_ndx_iterator_new {
14 [[Gets an iterator over the indices of all the selected children.
15 ]]
16 return: iterator<uint64> @move @no_unused; [[The iterator gives the indices of the selected children.
17 It is valid until any change is made to the selection state.]]
18 }
19 unselected_ndx_iterator_new {
20 [[Gets an iterator over the indices of all the unselected children.
21 ]]
22 return: iterator<uint64> @move @no_unused; [[The iterator gives the indices of the unselected children.
23 It is valid until any change is made to the selection state.]]
24 }
25 ndx_range_select @beta {
26 [[Select a range of @Efl.Ui.Selectable objects using their indices inside the container.
27
28 This will select the range of @Efl.Ui.Selectable objects from $a to $b or from $b to $a depending on
29 which one comes first.
30 If $a or $b are not part of the widget, an error is returned, and no change is applied.
31 $NULL is not allowed as either of the parameters.
32 ]]
33 params {
34 a : uint64; [[One side of the range.]]
35 b : uint64; [[The other side of the range.]]
36 }
37 }
38 ndx_range_unselect @beta {
39 [[Unselect a range of @Efl.Ui.Selectable objects using their indices inside the container.
40
41 This will unselect the range of @Efl.Ui.Selectable objects from $a to $b or from $b to $a depending on
42 which one comes first.
43 If $a or $b are not part of the widget, an error is returned, and no change is applied.
44 $NULL is not allowed as either of the parameters.
45 Both of the passed values will also be unselected.
46 ]]
47 params {
48 a : uint64; [[One side of the range.]]
49 b : uint64; [[The other side of the range.]]
50 }
51 }
52 }
53}
diff --git a/src/lib/elementary/efl_ui_multi_selectable_object_range.eo b/src/lib/elementary/efl_ui_multi_selectable_object_range.eo
new file mode 100644
index 0000000000..f88beb9efa
--- /dev/null
+++ b/src/lib/elementary/efl_ui_multi_selectable_object_range.eo
@@ -0,0 +1,46 @@
1import efl_ui;
2
3interface @beta Efl.Ui.Multi_Selectable_Object_Range extends Efl.Ui.Multi_Selectable
4{
5 [[Interface for getting access to a range of selected items.
6
7 The implementor of this interface provides the possibility to select multiple Selectables.
8 If not, only @Efl.Ui.Single_Selectable should be implemented.
9 A widget can only provide either this interface or @Efl.Ui.Multi_Selectable_Index_Range, but not both.]]
10 c_prefix: efl_ui_multi_selectable;
11 methods
12 {
13 selected_iterator_new {
14 [[Get the selected items in an iterator. The iterator sequence will be decided by selection.]]
15 return: iterator<Efl.Ui.Selectable> @move @no_unused; [[User has to free the iterator after usage.]]
16 }
17 range_select @beta {
18 [[Select a range of @Efl.Ui.Selectable.
19
20 This will select the range of @Efl.Ui.Selectable objects from $a to $b or from $b to $a depending on
21 which one comes first.
22 If $a or $b are not part of the widget, an error is returned, and no change is applied.
23 $NULL is not allowed as either of the parameters.
24 Both of the passed values will also be selected.
25 ]]
26 params {
27 a : Efl.Ui.Selectable; [[One side of the range.]]
28 b : Efl.Ui.Selectable; [[The other side of the range.]]
29 }
30 }
31 range_unselect @beta {
32 [[Unselect a range of @Efl.Ui.Selectable.
33
34 This will unselect the range of @Efl.Ui.Selectable objects from $a to $b or from $b to $a depending on
35 which one comes first.
36 If $a or $b are not part of the widget, an error is returned, and no change is applied.
37 $NULL is not allowed as either of the parameters.
38 Both of the passed values will also be unselected.
39 ]]
40 params {
41 a : Efl.Ui.Selectable; [[One side of the range.]]
42 b : Efl.Ui.Selectable; [[The other side of the range.]]
43 }
44 }
45 }
46}
diff --git a/src/lib/elementary/efl_ui_select_model.c b/src/lib/elementary/efl_ui_select_model.c
index c6092a50a6..016f720a15 100644
--- a/src/lib/elementary/efl_ui_select_model.c
+++ b/src/lib/elementary/efl_ui_select_model.c
@@ -469,7 +469,7 @@ _efl_ui_select_model_efl_model_property_get(const Eo *obj, Efl_Ui_Select_Model_D
469} 469}
470 470
471static Eina_Iterator * 471static Eina_Iterator *
472_efl_ui_select_model_efl_ui_multi_selectable_async_selected_iterator_new(Eo *obj, 472_efl_ui_select_model_efl_ui_multi_selectable_index_range_selected_ndx_iterator_new(Eo *obj,
473 Efl_Ui_Select_Model_Data *pd) 473 Efl_Ui_Select_Model_Data *pd)
474{ 474{
475 if (pd->parent && pd->parent->selection == EFL_UI_SELECT_MODE_NONE) 475 if (pd->parent && pd->parent->selection == EFL_UI_SELECT_MODE_NONE)
@@ -478,7 +478,7 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_selected_iterator_new(Eo *obj
478} 478}
479 479
480static Eina_Iterator * 480static Eina_Iterator *
481_efl_ui_select_model_efl_ui_multi_selectable_async_unselected_iterator_new(Eo *obj, 481_efl_ui_select_model_efl_ui_multi_selectable_index_range_unselected_ndx_iterator_new(Eo *obj,
482 Efl_Ui_Select_Model_Data *pd EINA_UNUSED) 482 Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
483{ 483{
484 return efl_boolean_model_boolean_iterator_get(obj, "selected", EINA_FALSE); 484 return efl_boolean_model_boolean_iterator_get(obj, "selected", EINA_FALSE);
@@ -492,7 +492,7 @@ _efl_ui_select_model_efl_ui_single_selectable_last_selected_get(const Eo *obj EI
492} 492}
493 493
494static void 494static void
495_efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_set(Eo *obj, 495_efl_ui_select_model_efl_ui_multi_selectable_select_mode_set(Eo *obj,
496 Efl_Ui_Select_Model_Data *pd, 496 Efl_Ui_Select_Model_Data *pd,
497 Efl_Ui_Select_Mode mode) 497 Efl_Ui_Select_Mode mode)
498{ 498{
@@ -501,11 +501,11 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_set(Eo *obj,
501 case EFL_UI_SELECT_MODE_SINGLE: 501 case EFL_UI_SELECT_MODE_SINGLE:
502 mode = EFL_UI_SELECT_MODE_SINGLE; 502 mode = EFL_UI_SELECT_MODE_SINGLE;
503 if (pd->selection == EFL_UI_SELECT_MODE_MULTI) 503 if (pd->selection == EFL_UI_SELECT_MODE_MULTI)
504 efl_ui_multi_selectable_async_all_unselect(obj); 504 efl_ui_multi_selectable_all_unselect(obj);
505 break; 505 break;
506 case EFL_UI_SELECT_MODE_NONE: 506 case EFL_UI_SELECT_MODE_NONE:
507 if (pd->selection == EFL_UI_SELECT_MODE_MULTI) 507 if (pd->selection == EFL_UI_SELECT_MODE_MULTI)
508 efl_ui_multi_selectable_async_all_unselect(obj); 508 efl_ui_multi_selectable_all_unselect(obj);
509 else if (pd->last_model) 509 else if (pd->last_model)
510 { 510 {
511 Eina_Value unselect = eina_value_bool_init(EINA_FALSE); 511 Eina_Value unselect = eina_value_bool_init(EINA_FALSE);
@@ -526,14 +526,14 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_set(Eo *obj,
526} 526}
527 527
528static Efl_Ui_Select_Mode 528static Efl_Ui_Select_Mode
529_efl_ui_select_model_efl_ui_multi_selectable_async_select_mode_get(const Eo *obj EINA_UNUSED, 529_efl_ui_select_model_efl_ui_multi_selectable_select_mode_get(const Eo *obj EINA_UNUSED,
530 Efl_Ui_Select_Model_Data *pd) 530 Efl_Ui_Select_Model_Data *pd)
531{ 531{
532 return pd->selection; 532 return pd->selection;
533} 533}
534 534
535static void 535static void
536_efl_ui_select_model_efl_ui_multi_selectable_async_all_select(Eo *obj, 536_efl_ui_select_model_efl_ui_multi_selectable_all_select(Eo *obj,
537 Efl_Ui_Select_Model_Data *pd EINA_UNUSED) 537 Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
538{ 538{
539 unsigned long count, i; 539 unsigned long count, i;
@@ -553,16 +553,16 @@ _efl_ui_select_model_efl_ui_multi_selectable_async_all_select(Eo *obj,
553} 553}
554 554
555static void 555static void
556_efl_ui_select_model_efl_ui_multi_selectable_async_all_unselect(Eo *obj, 556_efl_ui_select_model_efl_ui_multi_selectable_all_unselect(Eo *obj,
557 Efl_Ui_Select_Model_Data *pd EINA_UNUSED) 557 Efl_Ui_Select_Model_Data *pd EINA_UNUSED)
558{ 558{
559 uint64_t count = efl_model_children_count_get(obj); 559 uint64_t count = efl_model_children_count_get(obj);
560 560
561 efl_ui_multi_selectable_async_range_unselect(obj, 0, count - 1); 561 efl_ui_multi_selectable_ndx_range_unselect(obj, 0, count - 1);
562} 562}
563 563
564static void 564static void
565_efl_ui_select_model_efl_ui_multi_selectable_async_range_select(Eo *obj, 565_efl_ui_select_model_efl_ui_multi_selectable_index_range_ndx_range_select(Eo *obj,
566 Efl_Ui_Select_Model_Data *pd EINA_UNUSED, 566 Efl_Ui_Select_Model_Data *pd EINA_UNUSED,
567 uint64_t a, uint64_t b) 567 uint64_t a, uint64_t b)
568{ 568{
@@ -604,7 +604,7 @@ _children_unselect_then(Eo *o EINA_UNUSED, void *data EINA_UNUSED, const Eina_Va
604#define BATCH_MAX 100 604#define BATCH_MAX 100
605 605
606static void 606static void
607_efl_ui_select_model_efl_ui_multi_selectable_async_range_unselect(Eo *obj, 607_efl_ui_select_model_efl_ui_multi_selectable_index_range_ndx_range_unselect(Eo *obj,
608 Efl_Ui_Select_Model_Data *pd EINA_UNUSED, 608 Efl_Ui_Select_Model_Data *pd EINA_UNUSED,
609 uint64_t a, uint64_t b) 609 uint64_t a, uint64_t b)
610{ 610{
@@ -695,4 +695,4 @@ _efl_ui_select_model_efl_ui_selectable_selected_get(const Eo *obj,
695} 695}
696 696
697#include "efl_ui_select_model.eo.c" 697#include "efl_ui_select_model.eo.c"
698#include "efl_ui_multi_selectable_async.eo.c" 698#include "efl_ui_multi_selectable_index_range.eo.c"
diff --git a/src/lib/elementary/efl_ui_select_model.eo b/src/lib/elementary/efl_ui_select_model.eo
index 7fa0f8411a..abe5137a18 100644
--- a/src/lib/elementary/efl_ui_select_model.eo
+++ b/src/lib/elementary/efl_ui_select_model.eo
@@ -1,5 +1,5 @@
1class @beta Efl.Ui.Select_Model extends Efl.Boolean_Model 1class @beta Efl.Ui.Select_Model extends Efl.Boolean_Model
2 implements Efl.Ui.Multi_Selectable_Async, 2 implements Efl.Ui.Multi_Selectable_Index_Range,
3 Efl.Ui.Selectable 3 Efl.Ui.Selectable
4{ 4{
5 [[Efl ui select model class]] 5 [[Efl ui select model class]]
@@ -9,13 +9,13 @@ class @beta Efl.Ui.Select_Model extends Efl.Boolean_Model
9 Efl.Model.property { get; set; } 9 Efl.Model.property { get; set; }
10 Efl.Model.properties { get; } 10 Efl.Model.properties { get; }
11 Efl.Ui.Single_Selectable.last_selected { get; } 11 Efl.Ui.Single_Selectable.last_selected { get; }
12 Efl.Ui.Multi_Selectable_Async.selected_iterator_new; 12 Efl.Ui.Multi_Selectable.select_mode {get; set;}
13 Efl.Ui.Multi_Selectable_Async.unselected_iterator_new; 13 Efl.Ui.Multi_Selectable.all_select;
14 Efl.Ui.Multi_Selectable_Async.select_mode {get; set;} 14 Efl.Ui.Multi_Selectable.all_unselect;
15 Efl.Ui.Multi_Selectable_Async.all_select; 15 Efl.Ui.Multi_Selectable_Index_Range.selected_ndx_iterator_new;
16 Efl.Ui.Multi_Selectable_Async.all_unselect; 16 Efl.Ui.Multi_Selectable_Index_Range.unselected_ndx_iterator_new;
17 Efl.Ui.Multi_Selectable_Async.range_select; 17 Efl.Ui.Multi_Selectable_Index_Range.ndx_range_select;
18 Efl.Ui.Multi_Selectable_Async.range_unselect; 18 Efl.Ui.Multi_Selectable_Index_Range.ndx_range_unselect;
19 Efl.Ui.Single_Selectable.fallback_selection {get; set;} 19 Efl.Ui.Single_Selectable.fallback_selection {get; set;}
20 Efl.Ui.Selectable.selected {get; set;} 20 Efl.Ui.Selectable.selected {get; set;}
21 } 21 }
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 7e21417aef..e9aaa55f57 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -178,7 +178,8 @@ pub_eo_files = [
178 'efl_ui_position_manager_grid.eo', 178 'efl_ui_position_manager_grid.eo',
179 'efl_ui_selectable.eo', 179 'efl_ui_selectable.eo',
180 'efl_ui_multi_selectable.eo', 180 'efl_ui_multi_selectable.eo',
181 'efl_ui_multi_selectable_async.eo', 181 'efl_ui_multi_selectable_object_range.eo',
182 'efl_ui_multi_selectable_index_range.eo',
182 'efl_ui_single_selectable.eo', 183 'efl_ui_single_selectable.eo',
183 'efl_ui_position_manager_data_access_v1.eo', 184 'efl_ui_position_manager_data_access_v1.eo',
184 'efl_ui_tab_bar_default_item.eo', 185 'efl_ui_tab_bar_default_item.eo',
diff --git a/src/tests/elementary/efl_ui_test_select_model.c b/src/tests/elementary/efl_ui_test_select_model.c
index e2b61c5677..63f5340052 100644
--- a/src/tests/elementary/efl_ui_test_select_model.c
+++ b/src/tests/elementary/efl_ui_test_select_model.c
@@ -111,12 +111,12 @@ EFL_START_TEST(efl_test_select_model)
111 111
112 ecore_main_loop_begin(); 112 ecore_main_loop_begin();
113 113
114 it = efl_ui_multi_selectable_async_selected_iterator_new(model); 114 it = efl_ui_multi_selectable_selected_ndx_iterator_new(model);
115 EINA_ITERATOR_FOREACH(it, index) 115 EINA_ITERATOR_FOREACH(it, index)
116 fail_if(*index != 2); 116 fail_if(*index != 2);
117 eina_iterator_free(it); 117 eina_iterator_free(it);
118 118
119 it = efl_ui_multi_selectable_async_unselected_iterator_new(model); 119 it = efl_ui_multi_selectable_unselected_ndx_iterator_new(model);
120 EINA_ITERATOR_FOREACH(it, index) 120 EINA_ITERATOR_FOREACH(it, index)
121 fail_if(*index == 2); 121 fail_if(*index == 2);
122 eina_iterator_free(it); 122 eina_iterator_free(it);
diff --git a/src/tests/elementary/spec/efl_test_multi_selectable.c b/src/tests/elementary/spec/efl_test_multi_selectable.c
index bb016474d3..3a02ed9e16 100644
--- a/src/tests/elementary/spec/efl_test_multi_selectable.c
+++ b/src/tests/elementary/spec/efl_test_multi_selectable.c
@@ -36,7 +36,7 @@ EFL_START_TEST(test_multi_select)
36 int c = 0; 36 int c = 0;
37 37
38 Eina_Array *arr_selected; 38 Eina_Array *arr_selected;
39 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 39 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
40 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 40 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
41 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 41 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
42 42
@@ -52,7 +52,7 @@ EFL_START_TEST(test_multi_select)
52 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_TRUE); 52 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_TRUE);
53 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_TRUE); 53 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_TRUE);
54 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), efl_pack_content_get(widget, 2)); 54 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), efl_pack_content_get(widget, 2));
55 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 55 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
56 ck_assert_int_eq(eina_array_count(arr_selected), 2); 56 ck_assert_int_eq(eina_array_count(arr_selected), 2);
57 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0)); 57 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0));
58 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2)); 58 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2));
@@ -70,7 +70,7 @@ EFL_START_TEST(test_multi_select_removal)
70{ 70{
71 int c = 0; 71 int c = 0;
72 Eina_Array *arr_selected; 72 Eina_Array *arr_selected;
73 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 73 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
74 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 74 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
75 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 75 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
76 76
@@ -88,7 +88,7 @@ EFL_START_TEST(test_multi_select_removal)
88 c = 0; 88 c = 0;
89 89
90 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), NULL); 90 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), NULL);
91 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 91 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
92 ck_assert_int_eq(eina_array_count(arr_selected), 0); 92 ck_assert_int_eq(eina_array_count(arr_selected), 0);
93 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 93 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
94 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 94 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
@@ -101,7 +101,7 @@ EFL_START_TEST(test_single_select)
101 int c = 0; 101 int c = 0;
102 Eina_Array *arr_selected; 102 Eina_Array *arr_selected;
103 103
104 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE); 104 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE);
105 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 105 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
106 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 106 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
107 107
@@ -116,7 +116,7 @@ EFL_START_TEST(test_single_select)
116 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE); 116 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE);
117 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_TRUE); 117 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_TRUE);
118 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), efl_pack_content_get(widget, 2)); 118 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), efl_pack_content_get(widget, 2));
119 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 119 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
120 ck_assert_int_eq(eina_array_count(arr_selected), 1); 120 ck_assert_int_eq(eina_array_count(arr_selected), 1);
121 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 2)); 121 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 2));
122 122
@@ -134,7 +134,7 @@ EFL_START_TEST(test_none_select)
134 Eina_Array *arr_selected; 134 Eina_Array *arr_selected;
135 int c = 0; 135 int c = 0;
136 136
137 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE); 137 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE);
138 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 138 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
139 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 139 efl_event_callback_add(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
140 140
@@ -147,7 +147,7 @@ EFL_START_TEST(test_none_select)
147 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE); 147 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE);
148 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_FALSE); 148 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 2)), EINA_FALSE);
149 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), NULL); 149 ck_assert_ptr_eq(efl_ui_selectable_last_selected_get(widget), NULL);
150 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 150 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
151 ck_assert_int_eq(eina_array_count(arr_selected), 0); 151 ck_assert_int_eq(eina_array_count(arr_selected), 0);
152 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c); 152 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, (void*) event_callback_single_call_int_data, &c);
153 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL); 153 efl_event_callback_del(widget, EFL_UI_SELECTABLE_EVENT_SELECTION_CHANGED, event_callback_that_quits_the_main_loop_when_called, NULL);
@@ -159,9 +159,9 @@ EFL_START_TEST(all_select_api)
159{ 159{
160 Eina_Array *arr_selected; 160 Eina_Array *arr_selected;
161 161
162 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 162 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
163 efl_ui_selectable_all_select(widget); 163 efl_ui_multi_selectable_all_select(widget);
164 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 164 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
165 165
166 ck_assert_int_eq(eina_array_count(arr_selected), 3); 166 ck_assert_int_eq(eina_array_count(arr_selected), 3);
167 167
@@ -176,11 +176,11 @@ EFL_START_TEST(all_unselect_api)
176{ 176{
177 Eina_Array *arr_selected; 177 Eina_Array *arr_selected;
178 178
179 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 179 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
180 efl_ui_selectable_selected_set(efl_pack_content_get(widget, 0), EINA_TRUE); 180 efl_ui_selectable_selected_set(efl_pack_content_get(widget, 0), EINA_TRUE);
181 181
182 efl_ui_selectable_all_unselect(widget); 182 efl_ui_multi_selectable_all_unselect(widget);
183 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 183 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
184 184
185 ck_assert_int_eq(eina_array_count(arr_selected), 0); 185 ck_assert_int_eq(eina_array_count(arr_selected), 0);
186 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE); 186 ck_assert_int_eq(efl_ui_selectable_selected_get(efl_pack_content_get(widget, 0)), EINA_FALSE);
@@ -192,11 +192,11 @@ EFL_START_TEST(range_unselect)
192{ 192{
193 Eina_Array *arr_selected; 193 Eina_Array *arr_selected;
194 194
195 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 195 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
196 efl_ui_selectable_all_select(widget); 196 efl_ui_multi_selectable_all_select(widget);
197 197
198 efl_ui_selectable_range_unselect(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); 198 efl_ui_multi_selectable_range_unselect(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2));
199 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 199 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
200 ck_assert_int_eq(eina_array_count(arr_selected), 1); 200 ck_assert_int_eq(eina_array_count(arr_selected), 1);
201 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0)); 201 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0));
202 eina_array_free(arr_selected); 202 eina_array_free(arr_selected);
@@ -207,11 +207,11 @@ EFL_START_TEST(range_unselect2)
207{ 207{
208 Eina_Array *arr_selected; 208 Eina_Array *arr_selected;
209 209
210 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 210 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
211 efl_ui_selectable_all_select(widget); 211 efl_ui_multi_selectable_all_select(widget);
212 212
213 efl_ui_selectable_range_unselect(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); 213 efl_ui_multi_selectable_range_unselect(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1));
214 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 214 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
215 ck_assert_int_eq(eina_array_count(arr_selected), 1); 215 ck_assert_int_eq(eina_array_count(arr_selected), 1);
216 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0)); 216 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 0));
217 eina_array_free(arr_selected); 217 eina_array_free(arr_selected);
@@ -222,9 +222,9 @@ EFL_START_TEST(range_select)
222{ 222{
223 Eina_Array *arr_selected; 223 Eina_Array *arr_selected;
224 224
225 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 225 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
226 efl_ui_selectable_range_select(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2)); 226 efl_ui_multi_selectable_range_select(widget, efl_pack_content_get(widget, 1), efl_pack_content_get(widget, 2));
227 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 227 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
228 ck_assert_int_eq(eina_array_count(arr_selected), 2); 228 ck_assert_int_eq(eina_array_count(arr_selected), 2);
229 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 1)); 229 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 1));
230 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2)); 230 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2));
@@ -236,9 +236,9 @@ EFL_START_TEST(range_select2)
236{ 236{
237 Eina_Array *arr_selected; 237 Eina_Array *arr_selected;
238 238
239 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 239 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
240 efl_ui_selectable_range_select(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1)); 240 efl_ui_multi_selectable_range_select(widget, efl_pack_content_get(widget, 2), efl_pack_content_get(widget, 1));
241 _iterator_to_array(&arr_selected, efl_ui_selectable_selected_iterator_new(widget)); 241 _iterator_to_array(&arr_selected, efl_ui_multi_selectable_selected_iterator_new(widget));
242 ck_assert_int_eq(eina_array_count(arr_selected), 2); 242 ck_assert_int_eq(eina_array_count(arr_selected), 2);
243 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 1)); 243 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 0), efl_pack_content_get(widget, 1));
244 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2)); 244 ck_assert_ptr_eq(eina_array_data_get(arr_selected, 1), efl_pack_content_get(widget, 2));
@@ -250,9 +250,9 @@ EFL_START_TEST(change_mode_from_multi_to_single)
250{ 250{
251 int sel = 0; 251 int sel = 0;
252 252
253 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 253 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
254 efl_ui_selectable_all_select(widget); 254 efl_ui_multi_selectable_all_select(widget);
255 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE); 255 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE);
256 for (int i = 0; i < efl_content_count(widget); ++i) 256 for (int i = 0; i < efl_content_count(widget); ++i)
257 { 257 {
258 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i))) 258 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i)))
@@ -267,9 +267,9 @@ EFL_START_TEST(change_mode_from_multi_to_none)
267{ 267{
268 int sel = 0; 268 int sel = 0;
269 269
270 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI); 270 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_MULTI);
271 efl_ui_selectable_all_select(widget); 271 efl_ui_multi_selectable_all_select(widget);
272 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE); 272 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE);
273 for (int i = 0; i < efl_content_count(widget); ++i) 273 for (int i = 0; i < efl_content_count(widget); ++i)
274 { 274 {
275 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i))) 275 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i)))
@@ -283,9 +283,9 @@ EFL_START_TEST(change_mode_from_single_to_none)
283{ 283{
284 int sel = 0; 284 int sel = 0;
285 285
286 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE); 286 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_SINGLE);
287 efl_ui_selectable_all_select(widget); 287 efl_ui_multi_selectable_all_select(widget);
288 efl_ui_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE); 288 efl_ui_multi_selectable_select_mode_set(widget, EFL_UI_SELECT_MODE_NONE);
289 for (int i = 0; i < efl_content_count(widget); ++i) 289 for (int i = 0; i < efl_content_count(widget); ++i)
290 { 290 {
291 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i))) 291 if (efl_ui_selectable_selected_get(efl_pack_content_get(widget, i)))