summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_ui_focus_manager.eo
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2016-10-20 22:59:05 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-04-20 14:38:57 +0200
commit01f46ae205bd964e5254793c79a5bc0648c045f5 (patch)
tree952c8162573ad031dd548375d419e6e92bf0227f /src/lib/elementary/efl_ui_focus_manager.eo
parent2cd1326c8d5407e2e89f01ba4b1f6c7ab6211fc3 (diff)
efl_ui: introduce a focus manager and sub manager object
The Efl.Ui.Focus.Manager abstracts the creation of a localization graph and a logical tree. The localization graph is used to find a object right left up or down of a given object. The logical tree is used to iterate throuw the containers which are used to build a ui. Those managers can be used bound to some layer in the ui, so for example the window is a layer, the content of a scroller is a layer. With those layers, we can make sure that movements of a scroller for example just means that this graph of objects in the scroller needs to be recalculated, and not the complete ui. The advantage of having this to layer bound datastructures is that you can easily debug those graphs, since the complete layer of this managerobject can be calculated completly.
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_ui_focus_manager.eo129
1 files changed, 129 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_focus_manager.eo b/src/lib/elementary/efl_ui_focus_manager.eo
new file mode 100644
index 0000000000..ab70c27c21
--- /dev/null
+++ b/src/lib/elementary/efl_ui_focus_manager.eo
@@ -0,0 +1,129 @@
1enum Efl.Ui.Focus.Direction {
2 right = 0,
3 left = 1,
4 down = 2,
5 up = 3,
6 next = 4,
7 prev = 5,
8 last = 6
9}
10
11
12class Efl.Ui.Focus.Manager (Efl.Object) {
13 methods {
14 move {
15 [[Move the focus into the given direction
16
17 This call flushes all changes.
18 This means all changes between the last flush and now are computed
19 ]]
20 params {
21 direction : Efl.Ui.Focus.Direction; [[The direction to move to]]
22 }
23 return : Efl.Ui.Focus.Object; [[The element which is now focused]]
24 }
25 request_move {
26 [[Returns the object which would be the next object to focus in the given direction]]
27 params {
28 direction : Efl.Ui.Focus.Direction;
29 }
30 return : Efl.Ui.Focus.Object;
31 }
32 register {
33 [[Register a new item in the graph.
34
35 The parent has to be none null, it will be used as the parent in the logical tree.
36 The redirect argument will be set as redirect property on that manager, once child gets focused.
37 ]]
38 params {
39 child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
40 parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in the logical tree]]
41 redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set once this child is focused can be NULL for no redirect]]
42 }
43 return : bool; [[$true if it was successfull $false if not]]
44 }
45 update_redirect {
46 [[Set a new redirect object for the given child
47
48 Once the child is focused the redirect manager will be set in the redirect property.
49 Set to $null if nothing should happen
50 ]]
51 params {
52 child : Efl.Ui.Focus.Object @nonull;
53 redirect : Efl.Ui.Focus.Manager; [[Once $child got focused this element will be set as redirect]]
54 }
55 return : bool;
56 }
57 update_parent {
58 [[Set a new logical parent for the given child]]
59 params {
60 child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
61 parent : Efl.Ui.Focus.Object @nonull; [[The parent which now will be the logical parent of child]]
62 }
63 return : bool;
64 }
65 update_children {
66 [[Give the list of children a different order]]
67 params {
68 parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
69 children : list<Efl.Ui.Focus.Object>; [[the list with the new order]]
70 }
71 return : bool;
72 }
73 unregister {
74 [[unregister the given item from the graph]]
75 params {
76 child : Efl.Ui.Focus.Object;
77 }
78 }
79 focus {
80 [[Make the given object the currently focused object in this manager.
81
82 The object has to be part of this manager object.
83 If you want to focus something in the redirect manager, just call the function on the redirect manager]]
84 params {
85 focus : Efl.Ui.Focus.Object @nonull;
86 }
87 }
88 @property redirect {
89 [[Add a another manager to serve the move requests.
90
91 If this value is set all move requests are redirected to this manager object.
92 Set it to $null once nothing should be redirected anymore.]]
93 values {
94 redirect : Efl.Ui.Focus.Manager;
95 }
96 }
97 @property border_elements {
98 [[The list of elements which are at the border of the graph
99 This means one of the relations right,left or down,up are not set.
100
101 This call flushes all changes. see @Efl.Ui.Focus.Manager.move
102 ]]
103 get {
104 }
105 values {
106 border_elements : iterator<Efl.Ui.Focus.Object>;
107 }
108 }
109 @property root {
110 [[Root node for all logical subtrees.
111
112 This property can only be set once.
113 ]]
114 values {
115 root : Efl.Ui.Focus.Object @nonull; [[Will be registered into this manager object]]
116 }
117 }
118 }
119 implements {
120 Efl.Object.constructor;
121 Efl.Object.finalize;
122 Efl.Object.provider_find;
123 Efl.Object.destructor;
124 }
125 events {
126 pre,flush; [[Emitted once the graph calculationg will be performed]]
127 coords,dirty; [[Emitted once the graph is dirty, this means there are potential changes in border_elements you want to know about]]
128 }
129} \ No newline at end of file