Commit Graph

49 Commits

Author SHA1 Message Date
Cedric BAIL ae8b912328 elementary: do not use list<> in Efl.Ui.Focus_Manager.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11051
2020-01-29 09:51:40 +01:00
Marcel Hollerbach 5c1fde2c57 efl: add free functions to owned types
this commit is a first step in order to add free functions to all the
types that are owned.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7627
2019-01-22 14:02:37 +01:00
Marcel Hollerbach 84ad5d9fe3 introduce efl_ui_focus_manager_window_root
Which is a interface that indicates that this is the root of all focus
managers.
2018-04-09 18:05:27 +02:00
Marcel Hollerbach d4cd85aa55 efl_ui_focus_manager: split this of tinto a class and a interface
it turns out to be very handy to have a interface for the moving and
border elements, that is unconnected to the way of how widgets are
registering themself.

This for example enables us to get a simple focus manager that just
redirects the call into a internal 2 dimensional data struct
2017-08-10 20:55:50 +02:00
Jean-Philippe Andre 9a2d4928f0 elm: Rename elm_layout to Efl.Ui.Layout
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.

This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.

Ref T5315
2017-08-08 13:25:58 +09:00
Marcel Hollerbach 66265c2f4d efl_ui_focus_manager: free iterator when done 2017-08-07 12:31:10 +02:00
Marcel Hollerbach 63393d344b efl_ui_focus_manager: fix leak when setting order
We should free the list when we set it again.
2017-08-07 12:31:10 +02:00
Marcel Hollerbach 0fdc6a854a efl_ui_focus_manager: fix leaking safed_order 2017-07-10 20:32:07 +02:00
Marcel Hollerbach 7a7a343199 efl_ui_focus_manager: use focus geometry for the shortest distance 2017-06-10 18:03:08 +02:00
Marcel Hollerbach f424af2578 efl_ui_focus_manager: logical_end could be called before root_set
which would lead to a NULL deref

CID 1374435
2017-05-20 20:51:30 +02:00
Bryce Harrington 34d28a93ae efl_ui_focus_manager: Fix misspellings in comments
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4877
2017-05-12 14:42:04 +09:00
Marcel Hollerbach 178b363bac efl_ui_focus_manager: specify the event in the same way evas does 2017-05-04 20:44:42 +02:00
Marcel Hollerbach 059239a997 efl_ui_focus_manager: give feedback if setting root worked or not
so a potential caller can make sure if the set of root worked or not
2017-05-04 20:44:41 +02:00
Marcel Hollerbach 0ebe80fa0b efl_ui_focus_manager: rename api from geometry to focus_geometry
otherwise we would clash with efl.gfx.
2017-05-04 20:44:41 +02:00
Bryce Harrington 51ac5ba137 efl_ui_focus_manager: check for null return from node_get
Summary:
node_get() can return NULL sometimes.  Add a missing check, and add dox
for the function to document the error return.

>>>     CID 1374434:  Null pointer dereferences  (NULL_RETURNS)
>>>     Assigning: "node" = null return value from "node_get".

@fix CID1374434

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4824

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-04-25 16:29:46 -07:00
Marcel Hollerbach 69877a91af efl_ui_focus_manager: safe fields from the node
There could be the case that the item gets freed due to some handling in
a event handler of the event EFL_UI_FOCUS_MANAGER_EVENT_FOCUSED.
So the code now sets the node to NULL after the event is called and
saves the fields that are rfom use later.
2017-04-25 21:38:54 +02:00
Marcel Hollerbach 23e7155840 efl_ui_focus_manager: change the new order that gets set
Lets say there is a box with the following ordered children:
|Button|Box|Button|Box|Button| the two boxes do not have any children
at the time of the setup. The logic of the order_update will only order
the children like that:
|Button|Button|Button| Which is correct by that time, the two boxes dont
have any children.
Now the two boxes are also getting children, the order will not
selfupdate or anything so the logical chain would be:
|Button|Button|Button|Box|Box|. Which is wrong. To solve that the
manager keeps the order that got set last, and reapplies the order again
if something gets added to the parent where the order was set.

This should fix strange next / prev operations in ephoto.
2017-04-22 18:30:08 +02:00
Jean-Philippe Andre 57a960d26b focus: Fix shadow variable warning 2017-04-21 14:58:02 +09:00
Marcel Hollerbach 295940c0bc efl_ui_focus_manager: select the widget with the smallest distance
this improves the correctness-feeling when moving focus through a
elementary application.
2017-04-20 14:38:59 +02:00
Marcel Hollerbach 3dfc546a2f efl_ui_focus_manager: the order contains nodes not focusables 2017-04-20 14:38:59 +02:00
Marcel Hollerbach 74b4327746 update according to cedrics review comments 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 5c48607460 efl_ui_focus_manager: make setting a order easier 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 8c8570ba6a efl_ui_focus_manager: if there is no normal item then just do nothing 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 23fd22836d efl_ui_focus_manager: there is the case that n can be NULL 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 7994fa3f68 elm_interface_scrollable: fix bringing in of items 2017-04-20 14:38:58 +02:00
Marcel Hollerbach f09dd5e3df efl_ui_focus_manager: allow settings of subsets
those subsets will just be prepended.
2017-04-20 14:38:58 +02:00
Marcel Hollerbach 5b3fd27931 efl_ui_focus_manager: handle logical end correctly. 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 6245e5a579 efl_ui_focus_manager: fix error message 2017-04-20 14:38:58 +02:00
Marcel Hollerbach 13982b2bd9 efl_ui_focus_manager: return the new candidate 2017-04-20 14:38:57 +02:00
Marcel Hollerbach a5c7006579 efl_ui_focus_manager: handle redirect objects in logical better 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 200ad8ab50 efl_ui_focus_manager: be more secure 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 924033e88a efl_ui_focus_manager: fix sub manager logical handling 2017-04-20 14:38:57 +02:00
Marcel Hollerbach a4616bb6fe efl_ui_focus_manager: better error messages 2017-04-20 14:38:57 +02:00
Marcel Hollerbach d4bd5c9961 efl_ui_focus_manager: add log domain for focus movements 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 89cc2ca06a efl_ui_focus_manager: restructure node struct
a redirect can happen for logical OR normal
2017-04-20 14:38:57 +02:00
Marcel Hollerbach 0c1c2711f3 efl_ui_focus_manager: more debug information 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 6d1df04f24 efl_ui_focus_manager: do not depend on elm widget events 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 54145f488b efl_ui_focus_manager: unset redirect when focusing new item 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 1424875f0a efl_ui_focus_manager: make next and prev searching deadlock prove 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 8a216da3bb efl_ui_focus_manager: unset redirect when destroyed 2017-04-20 14:38:57 +02:00
Marcel Hollerbach be251b0496 efl_ui_focus_manager: allow flushing of one single node
this gives a massive performance boost
2017-04-20 14:38:57 +02:00
Marcel Hollerbach 0f2657983f efl_ui_focus_manager: handle redirect managers in a better way 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 67a697fedd efl_ui_focus_manager: fix up tracking and returning of data
a logical parent should not be in the border elements. The child should
also be not deleted itself. If we do so correct deletion could fail.
2017-04-20 14:38:57 +02:00
Marcel Hollerbach f6aefb2d88 efl_ui_focus_manager: a logical item should never get focus. 2017-04-20 14:38:57 +02:00
Marcel Hollerbach a5868fc819 efl_ui_focus_manager: use data iterator not key iterator
this saves one call to node_get
2017-04-20 14:38:57 +02:00
Marcel Hollerbach 1f8e6dcb37 elm_widget: add debugging informations for a manager in a widget 2017-04-20 14:38:57 +02:00
Marcel Hollerbach f2248410b2 efl_ui_focus_manager: new api for adding a logical widget
a widget which is registered logically will not be used for right left
top or down relations.
2017-04-20 14:38:57 +02:00
Marcel Hollerbach 0eefeca64b efl_ui_focus_manager: add new api to receive child configuration 2017-04-20 14:38:57 +02:00
Marcel Hollerbach 01f46ae205 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.
2017-04-20 14:38:57 +02:00