2016-10-20 13:59:05 -07:00
|
|
|
enum Efl.Ui.Focus.Direction {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Those values are describing a direction from the position of view from
|
|
|
|
one item.
|
|
|
|
|
|
|
|
@since 1.20
|
|
|
|
]]
|
|
|
|
right = 0, [[Coordinate-wise the next element on the right-hand side]]
|
|
|
|
left = 1, [[Coordinate-wise the next element on the left-hand side]]
|
|
|
|
down = 2, [[Coordinate-wise the next element downward]]
|
|
|
|
up = 3, [[Coorinate-wise the next element upwards]]
|
2016-10-24 03:59:59 -07:00
|
|
|
next = 4, [[Logically-wise the next item in the logical tree]]
|
|
|
|
prev = 5, [[Logically-wise the prev item in the logical tree]]
|
2017-04-20 22:24:45 -07:00
|
|
|
last = 6 [[Last value for this enum, do not use]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
struct Efl.Ui.Focus.Relations {
|
|
|
|
[[Structure holding the graph of relations between focussable objects.
|
|
|
|
|
|
|
|
@since 1.20
|
|
|
|
]]
|
2017-04-25 02:13:12 -07:00
|
|
|
right : list<Efl.Ui.Focus.Object>; [[List of objects on the right side]]
|
|
|
|
left : list<Efl.Ui.Focus.Object>; [[[List of objects on the left side]]
|
|
|
|
top : list<Efl.Ui.Focus.Object>; [[[List of objects above]]
|
|
|
|
down : list<Efl.Ui.Focus.Object>; [[[List of objects below]]
|
|
|
|
next : Efl.Ui.Focus.Object; [[[Next object]]
|
|
|
|
prev : Efl.Ui.Focus.Object; [[Previous object]]
|
|
|
|
type : string; [[Object type]]
|
|
|
|
parent : Efl.Ui.Focus.Object; [[Parent object]]
|
|
|
|
redirect : Efl.Ui.Focus.Manager; [[Redirect manager]]
|
2016-11-04 09:42:26 -07:00
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
|
|
|
|
class Efl.Ui.Focus.Manager (Efl.Object) {
|
2016-10-24 03:59:59 -07:00
|
|
|
[[Calculates the directions of Efl.Ui.Focus.Direction
|
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
Each registered item will get a other registered object into each
|
|
|
|
direction, you can get those items for the currently focused item if
|
|
|
|
you call request move.
|
|
|
|
|
|
|
|
@since 1.20
|
2016-10-24 03:59:59 -07:00
|
|
|
]]
|
2016-10-20 13:59:05 -07:00
|
|
|
methods {
|
|
|
|
move {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Move the focus into the given direction.
|
2016-10-20 13:59:05 -07:00
|
|
|
|
|
|
|
This call flushes all changes.
|
|
|
|
This means all changes between the last flush and now are computed
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
direction : Efl.Ui.Focus.Direction; [[The direction to move to]]
|
|
|
|
}
|
|
|
|
return : Efl.Ui.Focus.Object; [[The element which is now focused]]
|
|
|
|
}
|
|
|
|
request_move {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Returns the object which would be the next object to focus in the
|
|
|
|
given direction.
|
|
|
|
]]
|
2016-10-20 13:59:05 -07:00
|
|
|
params {
|
2017-04-25 02:32:36 -07:00
|
|
|
direction : Efl.Ui.Focus.Direction; [[Direction to move focus]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2017-04-25 02:32:36 -07:00
|
|
|
return : Efl.Ui.Focus.Object; [[Next object to focus]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
register {
|
|
|
|
[[Register a new item in the graph.
|
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
$parent can not be $null, it will be used as the parent in the
|
|
|
|
logical tree.
|
|
|
|
$redirect will be set as redirect property on that manager, once
|
|
|
|
$child gets focused.
|
2016-10-20 13:59:05 -07:00
|
|
|
]]
|
|
|
|
params {
|
|
|
|
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
2017-04-20 22:24:45 -07:00
|
|
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
|
|
|
the logical tree]]
|
|
|
|
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
|
|
|
once this child is focused can be NULL for no redirect]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : bool; [[$true if successful, $false otherwise]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2016-11-16 09:54:26 -08:00
|
|
|
register_logical {
|
|
|
|
[[Register a new item just for the logical parent.
|
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
The item can never get focus, it just helps to build a tree out
|
|
|
|
of the items that are getting focus.
|
2016-11-16 09:54:26 -08:00
|
|
|
]]
|
|
|
|
params {
|
2017-04-20 22:24:45 -07:00
|
|
|
child : Efl.Ui.Focus.Object @nonull; [[The object to register]]
|
|
|
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent to use in
|
|
|
|
the logical tree]]
|
|
|
|
redirect : Efl.Ui.Focus.Manager; [[The redirect manager to set
|
|
|
|
once this child is focused can be $null for no redirect]]
|
2016-11-16 09:54:26 -08:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : bool; [[$true if successful, $false otherwise]]
|
2016-11-16 09:54:26 -08:00
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
update_redirect {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Set a new redirect object for the given child.
|
2016-10-20 13:59:05 -07:00
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
Once $child is focused the redirect manager will be set
|
2017-04-30 02:26:10 -07:00
|
|
|
in the redirect property. Set redirect to $null if nothing should happen.
|
2016-10-20 13:59:05 -07:00
|
|
|
]]
|
|
|
|
params {
|
2017-04-20 22:24:45 -07:00
|
|
|
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
|
|
|
redirect : Efl.Ui.Focus.Manager; [[Once $child got focused this
|
|
|
|
element will be set as redirect]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : bool; [[$true if successful, $false otherwise]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
update_parent {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Set a new logical parent for the given child.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
params {
|
|
|
|
child : Efl.Ui.Focus.Object @nonull; [[The child to update]]
|
2017-04-20 22:24:45 -07:00
|
|
|
parent : Efl.Ui.Focus.Object @nonull; [[The parent which now
|
|
|
|
will be the logical parent of child]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : bool; [[$true if successful, $false otherwise]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
update_children {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Give the list of children a different order.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
params {
|
|
|
|
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
|
|
|
children : list<Efl.Ui.Focus.Object>; [[the list with the new order]]
|
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : bool; [[$true if successful, $false otherwise]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2016-12-21 11:23:55 -08:00
|
|
|
update_order {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Give the given order to the parent's child.
|
|
|
|
|
|
|
|
Children from the list which are no real children are ignored.
|
|
|
|
]]
|
2016-12-21 11:23:55 -08:00
|
|
|
params {
|
|
|
|
parent : Efl.Ui.Focus.Object @nonull; [[the parent to update]]
|
|
|
|
children : list<Efl.Ui.Focus.Object>; [[the order of items]]
|
|
|
|
}
|
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
unregister {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Unregister the given item from the focus graph.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
params {
|
2017-04-20 22:24:45 -07:00
|
|
|
child : Efl.Ui.Focus.Object; [[The child to unregister.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
focus {
|
|
|
|
[[Make the given object the currently focused object in this manager.
|
|
|
|
|
|
|
|
The object has to be part of this manager object.
|
2017-04-20 22:24:45 -07:00
|
|
|
If you want to focus something in the redirect manager, just call
|
|
|
|
the function on the redirect manager.
|
|
|
|
]]
|
|
|
|
params {
|
|
|
|
focus : Efl.Ui.Focus.Object @nonull; [[The object to be focused.]]
|
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2016-12-07 11:12:11 -08:00
|
|
|
focused {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[Return the currently focused element of this manager.]]
|
|
|
|
return : Efl.Ui.Focus.Object; [[The object that has focus.]]
|
2016-12-07 11:12:11 -08:00
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
@property redirect {
|
|
|
|
[[Add a another manager to serve the move requests.
|
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
If this value is set, all move requests are redirected to this
|
|
|
|
manager object. Set it to $null once nothing should be redirected
|
|
|
|
anymore.
|
|
|
|
]]
|
2016-10-20 13:59:05 -07:00
|
|
|
values {
|
2017-04-20 22:24:45 -07:00
|
|
|
redirect : Efl.Ui.Focus.Manager; [[The redirect manager.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property border_elements {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[The list of elements which are at the border of the graph.
|
2016-10-20 13:59:05 -07:00
|
|
|
|
2017-04-20 22:24:45 -07:00
|
|
|
This means one of the relations right,left or down,up are not set.
|
|
|
|
This call flushes all changes. See @Efl.Ui.Focus.Manager.move
|
2016-10-20 13:59:05 -07:00
|
|
|
]]
|
2017-04-20 22:24:45 -07:00
|
|
|
get {}
|
2016-10-20 13:59:05 -07:00
|
|
|
values {
|
2017-04-20 22:24:45 -07:00
|
|
|
border_elements : iterator<Efl.Ui.Focus.Object>; [[An iterator
|
|
|
|
over the border objects.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
@property root {
|
|
|
|
[[Root node for all logical subtrees.
|
|
|
|
|
|
|
|
This property can only be set once.
|
|
|
|
]]
|
2017-04-30 02:25:17 -07:00
|
|
|
set {
|
|
|
|
return : bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
get {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2016-10-20 13:59:05 -07:00
|
|
|
values {
|
2017-04-20 22:24:45 -07:00
|
|
|
root : Efl.Ui.Focus.Object @nonull; [[Will be registered into
|
|
|
|
this manager object.]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
}
|
2016-11-04 09:42:26 -07:00
|
|
|
fetch {
|
2017-04-20 22:24:45 -07:00
|
|
|
[[This will fetch the data from a registered node.
|
2016-11-04 09:42:26 -07:00
|
|
|
|
|
|
|
Be aware this function will trigger all dirty nodes to be computed
|
|
|
|
]]
|
|
|
|
params {
|
2017-04-20 22:24:45 -07:00
|
|
|
child : Efl.Ui.Focus.Object; [[The child object to inspect.]]
|
2016-11-04 09:42:26 -07:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
return : own(ptr(Efl.Ui.Focus.Relations)); [[The list of relations
|
|
|
|
starting from $child.]]
|
2016-11-04 09:42:26 -07:00
|
|
|
}
|
2016-12-19 10:26:33 -08:00
|
|
|
logical_end {
|
2017-04-30 02:35:32 -07:00
|
|
|
[[Return the last logical object.
|
|
|
|
|
|
|
|
The returned object is the last object that would be returned if you start at the root and move the direction into next.
|
|
|
|
]]
|
2017-04-25 02:32:36 -07:00
|
|
|
return : Efl.Ui.Focus.Object; [[Last object]]
|
2016-12-19 10:26:33 -08:00
|
|
|
}
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
|
|
|
implements {
|
2016-12-17 02:55:59 -08:00
|
|
|
class.constructor;
|
|
|
|
class.destructor;
|
2016-10-20 13:59:05 -07:00
|
|
|
Efl.Object.constructor;
|
|
|
|
Efl.Object.finalize;
|
|
|
|
Efl.Object.provider_find;
|
|
|
|
Efl.Object.destructor;
|
|
|
|
}
|
|
|
|
events {
|
2017-04-20 22:24:45 -07:00
|
|
|
redirect,changed : Efl.Ui.Focus.Manager; [[Emitted when the redirect
|
|
|
|
object has changed, the old manager is passed as event info]]
|
2016-10-20 13:59:05 -07:00
|
|
|
pre,flush; [[Emitted once the graph calculationg will be performed]]
|
2017-04-20 22:24:45 -07:00
|
|
|
coords,dirty; [[Emitted once the graph is dirty, this means there are
|
|
|
|
potential changes in border_elements you want to know about]]
|
|
|
|
focused : Efl.Ui.Focus.Object; [[Emitted if the manager has focused an
|
|
|
|
object]]
|
2016-10-20 13:59:05 -07:00
|
|
|
}
|
2017-04-20 22:24:45 -07:00
|
|
|
}
|