Commit Graph

18 Commits

Author SHA1 Message Date
Cedric BAIL 4624b56bed elementary: make sure that our index for the maximum number of object is actually unsigned int bound.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10927
2019-12-27 11:36:59 +01:00
Cedric BAIL 8331ea048c elementary: improve data layout for Efl.Ui.PositionManager*.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10688
2019-12-11 11:12:06 +01:00
Cedric BAIL 2b324779c9 elementary: reduce events triggered by Efl.Ui.PositionManager.
Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10687
2019-12-11 11:12:01 +01:00
WooHyun Jung 62e470130c efl_ui_position_manager_grid: avoid zero division case
This fixes the issue of zero division when columns is zero.
Sometimes columns can be zero when "pd->viewport.w = 0".

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10768
2019-11-29 08:08:19 +01:00
Marcel Hollerbach 534021632c efl_ui_position_manager: review cache accesses
in position manager grid and list, there are caches for the sizes, so
the access within placing the item is faster. The cache sometimes is
invalidated, which means, it must be rebuild before accessing it.

This commit is the result of reviewing all the accesses, that the
correct item is available.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10065
2019-09-23 10:33:19 -07:00
Marcel Hollerbach fc935e99d9 efl_ui_position_manager: a way to announce new entities
there are situations where the entity is not ready yet when the initial
placing does happen. With this API you can tell the position manager
that the placing of the items can be reapplied at the entities are
availble now.

Differential Revision: https://phab.enlightenment.org/D9947
2019-09-19 14:37:52 -07:00
Cedric Bail e448110439 elementary: properly shutdown and cleanup Efl.Ui.Position_Manager.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9946
2019-09-17 10:24:14 -07:00
Marcel Hollerbach 6e23dfba62 efl_ui_position_manager: only fill as many items as we need
prior to this commit, we just passed the start_id and the end_id the
end_id was the start_id plus the size of the memory buffer. However,
making this depending on the size of the memory buffer is a bad idea, as
changing it based on our needs is rather painfull.

With this commit we have explicit passing of the start_id, end_id and
memory len. This is kind of redundant, however, its very convenient, and
easy to write. The buffer will be filled with the maximum size that is
possible with length of the buffer, however, the end_id will not be
filled anymore.

Differential Revision: https://phab.enlightenment.org/D9756
2019-09-10 09:10:11 +02:00
Marcel Hollerbach a26efaeb57 efl_ui_position_manager_grid: honor NULL objects
its sometimes possible that there is a NULL object returned by the batch
call. We should not just access the NULL element. Additionally, if NULL
was returned during visibility setting, we need to set visibility here.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9827
2019-09-03 18:36:25 +02:00
Marcel Hollerbach 36eff7ed82 efl_ui_grid_position_manager: recalculate max min size correctly
we are walking all the items anyways, so we can recalc the minsize here
anyways. Additionally, this pm was never tested with code that just
passes a set of items at data-access init time, without calling
item_added for each item. (Which is perfectly fine). With this commit
this is now perfectly possible,

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9826
2019-09-03 18:36:24 +02:00
Marcel Hollerbach 53739890ce efl_ui_position_manager: refactor data access
before data access has been a property on
Efl.Ui.Position_Manager.Entity. However, we are not sure how stable all
this will be, and maybe we have the demand to change that in future, in
order to allow more high-performance item passing here.

Additionally, this patch addresses a few lectures learned from the past,
that includes:
- direct group header filling.
- direct group sizing
- difference between size for caching, and size for displaying
- Have a end_id which is the maximum of id that is filled.

ref T8179

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9754
2019-08-27 17:47:54 +02:00
Marcel Hollerbach 9eef883312 efl_ui_position_manager_common: generalize code
move the same code to a common header file.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9630
2019-08-21 07:50:55 +02:00
Marcel Hollerbach 3cb3c1c4b1 efl_ui_position_manager_grid: start to honor group items
This commit introduces the correct placement of group items and normal
items. The gruop items are also floating on the top of there child items
in case they are not visible on theire own. Items without group items
between items with groups are right now a little bit troublesome and
might display the wrong group, we *need* to check later on if this case
is even needed or not.

The whole placement code now uses 2 different caches, one cache is
counting how many groups we have, and how many items each group has.
Additionally, the size of the header + the state of the header is
safes. The second cache does translate that into how much size one full
group needs on the screen to be placed, this makes the calculation of
the correct item placement a lot faster.
The invalidation of the caches is also quite good. The size cache only
depends on the viewport size and the group cache, which means its
*never* recaclulated on a normal scroll operation. Only if items are
added, or the widget is resized (The later case can also be more
optimized). The group cache is only invalidated when new items are
added (Which is normally not happening during rendering)

ref T8115

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9608
2019-08-21 07:50:53 +02:00
Marcel Hollerbach e2b859bdae efl_ui_position_manager: pass on information about group ids
every batched call will now contain the id of the first item, if the
conditions in the documentation are met.

ref T8115

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9586
2019-08-21 07:50:50 +02:00
Marcel Hollerbach 63d3af3ce9 efl_ui_collection: implement initial focus behaviour
Summary:
the behaviour here is that the next item according to the direction is
getting focused. This sounds easy but is quite complex given the fact
that the items might be hidden. This is the first draft for this, to see
how good it performes.

Reviewers: zmike, stefan_schmidt, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9496
2019-08-06 09:34:42 -04:00
Marcel Hollerbach 4f45749b14 efl_ui_position_manager: add event for updating the range
the new event can be used to message back the currently visible range
from the position to the collection / collection_view.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9462
2019-08-01 14:36:59 -07:00
Marcel Hollerbach d98d434e56 efl_ui_position_manager: move from accessor to function callback
this commit enables access to the item structure of the collection via a
function callback. The function callback now enables batching for items,
which does not pay off right now. However, a few more optimizations can
be done in order to get the whole payoff.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9445
2019-07-31 15:51:48 -07:00
Cedric BAIL 9419be9baf elementary: make Efl.Ui.Position_Manager a namespace.
This does the following rename as per T8058:
Efl.Ui.Item_Position_Manager -> Efl.Ui.Position_Manager.Entity
Efl.Ui.Grid_Position_Manager -> Efl.Ui.Position_Manager.Grid
Efl.Ui.List_Position_Manager -> Efl.Ui.Position_Manager.List

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9388
2019-07-24 21:26:43 +02:00