summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-06 19:55:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-07 14:48:41 +0200
commit54c524f7f6186bffcfc3059e8268fabf618a9797 (patch)
treefae75187427acf927315dcd8d67b160f54bf1f17 /src/lib
parentf34f92bb29724c8e2c796c9787c2572d29d6619d (diff)
introduce efl_ui_multi_selectable and efl_ui_single_selectable
right now they are just thin wrappers from what have been in efl_ui_collection. This is just a first effort, the interfaces have to be equipped with more and better API, more events, and tests. ref T8057 Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D9515
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/efl/Efl.h1
-rw-r--r--src/lib/efl/interfaces/efl_interfaces_main.c2
-rw-r--r--src/lib/efl/interfaces/meson.build1
-rw-r--r--src/lib/elementary/Efl_Ui.h2
-rw-r--r--src/lib/elementary/efl_ui_collection.c6
-rw-r--r--src/lib/elementary/efl_ui_collection.eo16
-rw-r--r--src/lib/elementary/efl_ui_item.c2
-rw-r--r--src/lib/elementary/efl_ui_multi_selectable.eo (renamed from src/lib/efl/interfaces/efl_ui_multi_selectable.eo)11
-rw-r--r--src/lib/elementary/efl_ui_single_selectable.eo17
-rw-r--r--src/lib/elementary/meson.build2
10 files changed, 38 insertions, 22 deletions
diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h
index c1c934f6b0..a75b683b52 100644
--- a/src/lib/efl/Efl.h
+++ b/src/lib/efl/Efl.h
@@ -109,7 +109,6 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command;
109#include "interfaces/efl_ui_scrollable_interactive.eo.h" 109#include "interfaces/efl_ui_scrollable_interactive.eo.h"
110#include "interfaces/efl_ui_text_selectable.eo.h" 110#include "interfaces/efl_ui_text_selectable.eo.h"
111#include "interfaces/efl_ui_container_selectable.eo.h" 111#include "interfaces/efl_ui_container_selectable.eo.h"
112#include "interfaces/efl_ui_multi_selectable.eo.h"
113#include "interfaces/efl_ui_zoom.eo.h" 112#include "interfaces/efl_ui_zoom.eo.h"
114 113
115#include "interfaces/efl_screen.eo.h" 114#include "interfaces/efl_screen.eo.h"
diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c
index 141a2904a7..47c143c120 100644
--- a/src/lib/efl/interfaces/efl_interfaces_main.c
+++ b/src/lib/efl/interfaces/efl_interfaces_main.c
@@ -77,7 +77,7 @@
77#include "interfaces/efl_ui_scrollbar.eo.c" 77#include "interfaces/efl_ui_scrollbar.eo.c"
78#include "interfaces/efl_ui_container_selectable.eo.c" 78#include "interfaces/efl_ui_container_selectable.eo.c"
79#include "interfaces/efl_ui_text_selectable.eo.c" 79#include "interfaces/efl_ui_text_selectable.eo.c"
80#include "interfaces/efl_ui_multi_selectable.eo.c" 80
81#include "interfaces/efl_ui_zoom.eo.c" 81#include "interfaces/efl_ui_zoom.eo.c"
82 82
83#include "interfaces/efl_cached_item.eo.c" 83#include "interfaces/efl_cached_item.eo.c"
diff --git a/src/lib/efl/interfaces/meson.build b/src/lib/efl/interfaces/meson.build
index 7467882665..992915c69e 100644
--- a/src/lib/efl/interfaces/meson.build
+++ b/src/lib/efl/interfaces/meson.build
@@ -84,7 +84,6 @@ pub_eo_files = [
84 'efl_ui_property_bind.eo', 84 'efl_ui_property_bind.eo',
85 'efl_ui_factory.eo', 85 'efl_ui_factory.eo',
86 'efl_ui_factory_bind.eo', 86 'efl_ui_factory_bind.eo',
87 'efl_ui_multi_selectable.eo',
88 'efl_screen.eo', 87 'efl_screen.eo',
89 'efl_io_closer.eo', 88 'efl_io_closer.eo',
90 'efl_io_positioner.eo', 89 'efl_io_positioner.eo',
diff --git a/src/lib/elementary/Efl_Ui.h b/src/lib/elementary/Efl_Ui.h
index a54ee690fa..9683ee74d0 100644
--- a/src/lib/elementary/Efl_Ui.h
+++ b/src/lib/elementary/Efl_Ui.h
@@ -260,6 +260,8 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
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# include <efl_ui_selectable.eo.h>
263# include <efl_ui_single_selectable.eo.h>
264# include <efl_ui_multi_selectable.eo.h>
263# include <efl_ui_popup.eo.h> 265# include <efl_ui_popup.eo.h>
264# include <efl_ui_alert_popup.eo.h> 266# include <efl_ui_alert_popup.eo.h>
265# include <efl_ui_scroll_alert_popup.eo.h> 267# include <efl_ui_scroll_alert_popup.eo.h>
diff --git a/src/lib/elementary/efl_ui_collection.c b/src/lib/elementary/efl_ui_collection.c
index f1c5b568c3..1889067a5e 100644
--- a/src/lib/elementary/efl_ui_collection.c
+++ b/src/lib/elementary/efl_ui_collection.c
@@ -251,14 +251,14 @@ _efl_ui_collection_item_scroll_align(Eo *obj, Efl_Ui_Collection_Data *pd, Efl_Ui
251 _item_scroll_internal(obj, pd, item, align, animation); 251 _item_scroll_internal(obj, pd, item, align, animation);
252} 252}
253 253
254EOLIAN static Efl_Ui_Item* 254EOLIAN static Efl_Ui_Selectable*
255_efl_ui_collection_last_selected_item_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) 255_efl_ui_collection_efl_ui_single_selectable_last_selected_get(const Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd)
256{ 256{
257 return eina_list_last_data_get(pd->selected); 257 return eina_list_last_data_get(pd->selected);
258} 258}
259 259
260EOLIAN static Eina_Iterator* 260EOLIAN static Eina_Iterator*
261_efl_ui_collection_selected_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd) 261_efl_ui_collection_efl_ui_multi_selectable_selected_items_get(Eo *obj EINA_UNUSED, Efl_Ui_Collection_Data *pd)
262{ 262{
263 return eina_list_iterator_new(pd->selected); 263 return eina_list_iterator_new(pd->selected);
264} 264}
diff --git a/src/lib/elementary/efl_ui_collection.eo b/src/lib/elementary/efl_ui_collection.eo
index 679ef39062..a3e302e320 100644
--- a/src/lib/elementary/efl_ui_collection.eo
+++ b/src/lib/elementary/efl_ui_collection.eo
@@ -32,18 +32,6 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
32 @in animation: bool; [[If you want to have an animation or not.]] 32 @in animation: bool; [[If you want to have an animation or not.]]
33 } 33 }
34 } 34 }
35 @property last_selected_item {
36 [[The item that was selected most recently.
37 ]]
38 get {}
39 values {
40 item: Efl.Ui.Item; [[The latest selected item.]]
41 }
42 }
43 selected_items_get {
44 [[Get the selected items iterator. The iterator sequence will be decided by selection.]]
45 return: iterator<Efl.Ui.Item> @owned @no_unused; [[User has to free the iterator after usage.]]
46 }
47 @property position_manager { 35 @property position_manager {
48 [[Position manager object that handles placement of items.]] 36 [[Position manager object that handles placement of items.]]
49 values { 37 values {
@@ -73,10 +61,12 @@ class @beta Efl.Ui.Collection extends Efl.Ui.Layout_Base implements
73 Efl.Pack_Linear.pack_index_get; 61 Efl.Pack_Linear.pack_index_get;
74 Efl.Pack_Linear.pack_content_get; 62 Efl.Pack_Linear.pack_content_get;
75 Efl.Ui.Scrollable_Interactive.match_content { set; } 63 Efl.Ui.Scrollable_Interactive.match_content { set; }
76 Efl.Ui.Multi_Selectable.select_mode {get; set;}
77 Efl.Ui.Widget_Focus_Manager.focus_manager_create; 64 Efl.Ui.Widget_Focus_Manager.focus_manager_create;
78 Efl.Ui.Widget.focus_state_apply; 65 Efl.Ui.Widget.focus_state_apply;
79 Efl.Ui.Focus.Manager.move; 66 Efl.Ui.Focus.Manager.move;
67 Efl.Ui.Single_Selectable.last_selected { get; }
68 Efl.Ui.Multi_Selectable.selected_items_get;
69 Efl.Ui.Multi_Selectable.select_mode {get; set;}
80 } 70 }
81 events { 71 events {
82 item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]] 72 item,pressed : Efl.Ui.Item; [[A $press event occurred over an item.]]
diff --git a/src/lib/elementary/efl_ui_item.c b/src/lib/elementary/efl_ui_item.c
index 1ccc987759..6e88a84f10 100644
--- a/src/lib/elementary/efl_ui_item.c
+++ b/src/lib/elementary/efl_ui_item.c
@@ -273,3 +273,5 @@ _efl_ui_item_container_get(const Eo *obj EINA_UNUSED, Efl_Ui_Item_Data *pd)
273 273
274#include "efl_ui_item.eo.c" 274#include "efl_ui_item.eo.c"
275#include "efl_ui_selectable.eo.c" 275#include "efl_ui_selectable.eo.c"
276#include "efl_ui_multi_selectable.eo.c"
277#include "efl_ui_single_selectable.eo.c"
diff --git a/src/lib/efl/interfaces/efl_ui_multi_selectable.eo b/src/lib/elementary/efl_ui_multi_selectable.eo
index 2f7eac4788..3957fe332e 100644
--- a/src/lib/efl/interfaces/efl_ui_multi_selectable.eo
+++ b/src/lib/elementary/efl_ui_multi_selectable.eo
@@ -8,10 +8,11 @@ enum @beta Efl.Ui.Select_Mode {
8 none [[Last value of select mode. child cannot be selected at all.]] 8 none [[Last value of select mode. child cannot be selected at all.]]
9} 9}
10 10
11interface @beta Efl.Ui.Multi_Selectable 11interface @beta Efl.Ui.Multi_Selectable extends Efl.Ui.Single_Selectable
12{ 12{
13 [[Efl UI Multi selectable interface. 13 [[Interface for getting access to a range of selected items.
14 The container have to control select property of multiple chidren.]] 14
15 The implementor of this interface provides the possibility to select multiple Selectables. (If not, only Efl.Ui.Single_Selectable should be implemented)]]
15 c_prefix: efl_ui; 16 c_prefix: efl_ui;
16 methods 17 methods
17 { 18 {
@@ -23,5 +24,9 @@ interface @beta Efl.Ui.Multi_Selectable
23 mode: Efl.Ui.Select_Mode; [[Type of selection of children]] 24 mode: Efl.Ui.Select_Mode; [[Type of selection of children]]
24 } 25 }
25 } 26 }
27 selected_items_get {
28 [[Get the selected items in a iterator. The iterator sequence will be decided by selection.]]
29 return: iterator<Efl.Ui.Selectable> @owned @no_unused; [[User has to free the iterator after usage.]]
30 }
26 } 31 }
27} 32}
diff --git a/src/lib/elementary/efl_ui_single_selectable.eo b/src/lib/elementary/efl_ui_single_selectable.eo
new file mode 100644
index 0000000000..c2777ff106
--- /dev/null
+++ b/src/lib/elementary/efl_ui_single_selectable.eo
@@ -0,0 +1,17 @@
1interface @beta Efl.Ui.Single_Selectable {
2 [[Interface for getting access to a single selected item in the implementor.
3
4 The implementor is free to allow a specific number of selectables beeing selected or not. This interface just covers always the latest selected selectable.
5 ]]
6 methods {
7 @property last_selected {
8 [[The selectable that was selected most recently.]]
9 get {
10
11 }
12 values {
13 selectable : Efl.Ui.Selectable; [[The latest selected item.]]
14 }
15 }
16 }
17}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index e42223682b..06cad2bff3 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -183,6 +183,8 @@ pub_eo_files = [
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 'efl_ui_selectable.eo',
186 'efl_ui_multi_selectable.eo',
187 'efl_ui_single_selectable.eo',
186] 188]
187 189
188foreach eo_file : pub_eo_files 190foreach eo_file : pub_eo_files