Commit Graph

194 Commits

Author SHA1 Message Date
Hermet Park 12d2a4ce00 elementary genlist: make it sure object type.
Summary:
elm has some cases that resize_obj is not the group object.
That case, efl_canvas_group_need_recalculate_get() prints
annoying type-check errors.

Reviewers: #committers, SanghyeonLee

Reviewed By: #committers, SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7557
2019-01-08 20:01:23 +09:00
Jérémy Zurcher 8a617fda97 silence most left over compiler warnings
Summary: silence -Wshadow -Wunused-variable -Wunused-parameter

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7473
2018-12-18 13:08:01 +01:00
Marcel Hollerbach e779492a1c elm_genlist: behaviour fixes for genlist
This implements the behaviour in case no item is yet focused, but the
genlist is focused.

ref T6805

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7452
2018-12-17 09:12:22 +01:00
Marcel Hollerbach 6922761f3f elm_gen****: fix focus restoring on window focus changes
this ensures that if there is no focused item, that at least the
container is focused. This leads to the fact that the elm_genlist
/elm_gengrid is refocused when a window is unfocused and focused again.

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7451
2018-12-17 09:12:22 +01:00
Marcel Hollerbach 1524c94180 elm_gen****: correctly return the focus parent
this was forgotten before. However, now the correct parents are returned
This is needed in order to have the child_focus property propagated
correctly accross the parent chain.

Differential Revision: https://phab.enlightenment.org/D7266
2018-11-20 14:42:32 +01:00
Marcel Hollerbach edf1fbea20 elm_gen****: ensure that no focus item is handled correctly
This ensures that on first touch the root dummy element is focused
correctly.

fix T7203

Differential Revision: https://phab.enlightenment.org/D7231
2018-11-20 13:04:48 +01:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
2018-11-20 13:56:37 +09:00
Jaehyun Cho 2d460e52e4 elementary: remove Efl.Ui.Layout namespace
Summary:
Efl.Ui.Layout namespace is removed to keep consistency with other
widgets.
Consequently, "Efl.Ui.Layout.Object" is renamed to "Efl.Ui.Layout" and
"Efl.Ui.Layout." is renamed to "Efl.Ui.Layout_".

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers, SanghyeonLee, woohyun

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7291
2018-11-16 11:11:13 +01:00
Marcel Hollerbach c5add3ef40 elm: add unfocus / focus signals to gen* and toolbar
this adds back unfocus / focus emitting when items in those containers
are getting focus.

Differential Revision: https://phab.enlightenment.org/D7100
2018-11-13 17:01:37 +01:00
Marcel Hollerbach 17b57ba5ac efl_ui_focus_manager: rename a event
In eo there is a difference between legacy events and normal events.
However, when a legacy event, that is called "focused" is emitted, the
event EFL_UI_FOCUS_MANAGER_FOCUSED is emitted on those objects. This
leads to bugs and unexpected results in elm_scroller, and additionally
this problem blocks work that is done right now to add those "focused"
event calls to gengrid.

Differential Revision: https://phab.enlightenment.org/D7099
2018-11-02 02:22:13 +01:00
junsu choi 01e6f80e57 elm_genlist: prevent null pointer access
Summary: it->item->block can be null. so add null check.

Test Plan: elementary_test -to "genlist show/bring"

Reviewers: SanghyeonLee, woohyun

Subscribers: woohyun, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7146
2018-10-05 17:13:54 +09:00
Yeongjong Lee 39de8cdc75 elm_genlist: prevent null pointer access
Summary: found by coverity

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7108
2018-09-27 14:08:39 +09:00
SangHyeon Jade Lee b1650ca471 genlist: fix item show/bring in coordinate calculation with zero-sized pan.
Summary:
item show and bring can be processed with zero-sized pan.
item's coordinate will be calculated with this zero-sized pan,
so target position of scroll region bring in is not proper.

it occurs wrong result of SCROLLTO_MIDDLE and SCROLLTO_BOTTOM cases.

now we check pan size, and if less than 1, deferred call.

Test Plan:
please test with attached file.
./main 8 4 : 8th item go to middle
./main 8 8 : 8th item go to bottom

(bottom case may need D7035 as precede patch)

{F3311262}

Reviewers: Hermet, eagleeye

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7037
2018-09-19 09:36:51 +09:00
SangHyeon Jade Lee c9060ca997 elm_genlist: item scroll show sould be processed after block calculation
Summary:
there are buggy actions in the item show api,
when the list is launched, scroll to far distance item.
the reason is item_scroll is called before it's block is fully
calculated in calc_job().
the origin patch of cause the issue is
f6b66cc1d3
by raster in 28 Nov, 2013
but we already do some extra works in calc_job(),
so the code is not necessarily called in queue_process().

more detail descriptions :
mainly this caused by block width size,
so the normal case block width is zero, and item_scroll() will be dismissed,
and deferred action in calc_job(), but in issue case,
block width is already been set, so it can scroll the item directly though
they aren't properly calculated yet.

most cases block was generated in the same queue processing so width size is
not exist, but in issue cases, they re-using the block which was already been
generated by previous queue processing, so the width size is already exist,
but height is not properly calculated yet.

we could move the block height calculation and min/max calculation
in the queue processing, but I'm afraid to face side effect,
so removing item_scroll() call is best option that I got.

Test Plan:
I'll upload some sample file my_genlist_example_4.c,
so please do a test with this.
issue is reproduced very rarely, but I could see the issue within 20 times try.

{F3300793}

Reviewers: raster, eagleeye, Hermet, singh.amitesh, #reviewers

Reviewed By: Hermet, #reviewers

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6952
2018-09-19 09:35:07 +09:00
SangHyeon Jade Lee 7901d145c5 genlist : missing scrollto_bottom condition in item_scroll is fixed.
Summary:
ELM_GENLIST_ITEM_SCROLLTO_BOTTOM condition is considered in coordinate_calc,
but not considered in item_scroll which calls deferred for item calculation.
so put the proper condition for ELM_GENLIST_ITEM_SCROLLTO_BOTTOM in item scroll.

Test Plan: elementary_test

Reviewers: Hermet, eagleeye

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7035
2018-09-19 09:34:43 +09:00
Derek Foreman e968a053d7 elm_genlist: Convert to new animators
Summary:
Use more efficient animator mechanism.
Depends on D7046

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7047
2018-09-18 09:43:02 -05:00
Mike Blumenkrantz daaf5ad190 elm/genlist: check for item invalidation after setting item focus on click
Summary:
if the item is deleted during a focus callback then the remainder of this function
must be skipped in order to avoid crashing when attempting to access deallocated
memory

ref T7292

Reviewers: SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7292

Differential Revision: https://phab.enlightenment.org/D6831
2018-08-21 10:26:38 -04:00
Mike Blumenkrantz dcac8b24f1 elm/genlist: unset callbacks flag when destroying view object in unrealize
Summary:
failing to unset this prevents callbacks from being re-added when the item
is next realized, resulting in items which cannot be interacted with

ref T7292

Reviewers: SanghyeonLee

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7292

Differential Revision: https://phab.enlightenment.org/D6832
2018-08-21 10:26:32 -04:00
Carsten Haitzler 84e7925ab9 elm genlist - remove execsivve calls where we could do less eo lookups
something to help T6580 ... but not that much (0.3% fewer eo calls)
2018-08-09 13:16:40 +09:00
Marcel Hollerbach f36880088b elm_genlist: fix item registration by correct realization
Summary:
there was a case when a block could be realized while a item that is
realized was brought from one block to the this new one. The block now
is simply realized using api instead of just setting the flag, this sets
the correct focus registrations. While fixing this the error of double
regiration of items came up, this is also fixed by unregistration and
reregistration in the correct block.

fix T7247

Reviewers: zmike, SanghyeonLee, YOhoho

Reviewed By: zmike

Subscribers: Hermet, cedric, #committers

Tags: #efl

Maniphest Tasks: T7247

Differential Revision: https://phab.enlightenment.org/D6737
2018-08-07 13:25:34 +09:00
Marcel Hollerbach d922587764 elm_genlist: remove unused function
Summary:
this got replaced by the none composition implementation and is not
required anymore.

Depends on D6737

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6752
2018-08-06 16:38:58 +09:00
Marcel Hollerbach d989e7eab7 elm_genlist: fix ghost objects from the genlist cache
Summary:
the cache simply moved the objects to -9999 -9999 while leaving them
visible and focusable. Hiding them does not work since edje makes it
visible all the time again. Making them unfocusable fixes this.
Depends on D6752

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6753
2018-08-06 16:34:05 +09:00
Mike Blumenkrantz ab1fd96363 elm/genlist: use correct type of list when iterating
itb-items is Eina_List, not Eina_Inlist. this crashes due to wrong type
use

ref D6720
fix T7246

Differential Revision: https://phab.enlightenment.org/D6736
2018-08-02 23:04:50 +02:00
Marcel Hollerbach 0e462d5f5a genlist: rework the focus model for performance
Summary:
the focus model before was more meant for simplicity and not for
performance, this now is more made for performance.

The performance boost is achived by not using composition anymore,
but rather register realized items by hand. This keeps the amount
of items bound to the size of the viewport.

Additionally item realization that is followed by unrealization
immediately is not resulting in focus calls.

This solves the performance issue from T6580 in regards of focus.

perf results after this:
http://www.enlightenment.org/ss/e-5b61b50657f3c3.82619729.png

Reviewers: ManMower, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6720
2018-08-02 09:42:14 -04:00
Mike Blumenkrantz 1a75537ab8 elm/genlist: remove conditional in _calc_job for verifying show_item code
I think at some point in the past this was necessary to avoid weird show
mechanics, but now things have changed and it's best to always attempt to
scroll and let the scroller internals figure things out

this resolves the case where attempting to scroll to an item during a genlist's
calc (ie. the item was not present in a full layout calc) would fail to scroll
to the item if the scroll method was TOP and the item was too close to the
bottom of the list

fix T6368
@fix

Differential Revision: https://phab.enlightenment.org/D6466
2018-08-02 13:29:35 +02:00
Marcel Hollerbach 38656301b6 elm_genlist: prepare items before realising them
Summary: Depends on D6339

Reviewers: ManMower, devilhorns, zmike, stephenmhouston

Reviewed By: zmike

Subscribers: Hermet, cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6340
2018-06-29 11:33:18 -04:00
Derek Foreman c9979ca4c0 genlist: Don't search for an item we know we won't find
Summary:
We track list presence already, so we can just do a boolean test instead
of an O(n) lookup.
Depends on D6349

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6350
2018-06-22 09:38:03 -04:00
Marcel Hollerbach 054eab8ad8 elm_gen****: ensure the correct parent is set
fixes T6474
2018-06-12 11:51:08 +02:00
Marcel Hollerbach 42bb537170 efl_ui_focus_parent_provider_gen: do not accidently flatten the widgets
in the provider we accidently flattend out the widget history by
returning the wrong parent. However, this flattening code was required
for the element focus code of the two generic widgets, so the item is
found for every widget, in every subtree.
2018-06-12 11:32:51 +02:00
Cedric BAIL 5f5af596e0 elementary: cleanup genlist destructor to order content destruction correctly. 2018-05-24 16:02:20 -07:00
Cedric BAIL 0fe3b7962d elementary: due to lifecycle difference between legacy object and unified object, we need to track their lifecycle more explicitely.
It is my understanding that some items view are created with efl_add directly
and manipulate VIEW directly with Eo new API. This clash with the inconsistent
behavior that evas_object_del expect. To work around this, we track object life
by explictely relying on efl_wref_add while holding the pointer to the object.
2018-05-24 16:02:19 -07:00
Cedric BAIL b265c5c887 elementary: make del_pre not return a bool and force rely on Eo ref counting.
Differential Revision: https://phab.enlightenment.org/D6071
2018-05-24 16:02:18 -07:00
Cedric BAIL 4b30a7df8e elementary: use Eo ref counting to prevent death of genlist items.
Differential Revision: https://phab.enlightenment.org/D6068
2018-05-24 16:02:18 -07:00
Marcel Hollerbach 5815ba52ec elm_****: do not make group items focusable 2018-04-30 15:22:52 +02:00
Davide Andreoli 69cf5754b5 Revert "genlist: fix "insane" order [BUG COMPATIBILITY]"
This reverts commit fd82c2521e.

This was based on a wrong assumption, see T5938 fro details
2018-04-28 10:21:57 +02:00
Marcel Hollerbach fa02849193 gen****: just set focus to genlist / gengrid if no item is available
Additional move requests are still redirected to the gen**** widget.

ref T6805
2018-04-25 00:17:58 +02:00
Marcel Hollerbach 94b7d53c3b elm_genlist: do not not right left top down in action_move
the internal movement logic was resulting in wrong movements skipping
children items.
2018-04-25 00:16:50 +02:00
Xavi Artigas 6a98b84cd7 Efl.Ui.Layout.Object (from Efl.Ui.Layout)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:54 -07:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07:00
Xavi Artigas 9dcc31ed4a Efl.Access.Object (from Efl.Access)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:24 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Davide Andreoli 01a95d1f40 Revert "Genlist: restore old behaviour of item next/prev in group items"
This reverts commit f0a0da9f44.

As per T5938 seems we really want to restore a totally wrong
behaviour, without taking care of newer apps being broken.

I revert this for now, but I'm still convinced that we must
find a way to let user use a sane ordering for newer app.

I'm thinking about adding an api in genlist to let the widget
use the new sane ordering, something like
elm_genlist_fixed_ordering_set(bool) so that new apps can use
this to ensure correct behaviour. zmike what do you think about
this solution?
2018-04-17 00:11:11 +02:00
Davide Andreoli f0a0da9f44 Genlist: restore old behaviour of item next/prev in group items
Commit fd82c2521 has changed the behaviour of item_next/prev_get()
in case of genlist with group items (not tree).

The lagacy behaviour was to tread normal items and group items
in a flat way, like if group items was on the same level of
the children normal items.

As the commit already implement bug compatibility, seems to me
the case to restore also this case. Note that this changes only
apply to legacy genlist (I think).

Let me know if this broke something for you...as touching genlist
code is always an "I hope this is right" operation.
2018-04-13 20:37:36 +02:00
Marcel Hollerbach 78f4babbb5 efl_ui_focus_object:
make the prepare call safe to recursive calls. There is no need to
prepare a item again if it is already in prepare.
2018-04-09 18:27:45 +02:00
Marcel Hollerbach 02a062ba67 elm_genlist: support immidiate focus once the item is realized
this supports the case of item.focus = true before the item is realized.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach be3cfcec66 elm_genlist: move focus recovering to first_touch instead of
focus_update

this means that the function is called more reliable, and not only based
on focus state, but also based on the redirect situation.
2018-03-15 15:39:12 +01:00
Marcel Hollerbach 7d2d6c7e1d elm_genlist: performe elm_item_focus_set
this means all neccessary fields with last focus and current focused
item are updated correctly
2018-03-15 15:39:12 +01:00
Marcel Hollerbach e5af7c914a elm_genlist: set focus to the item when a user calls the function 2018-03-15 15:39:12 +01:00
Marcel Hollerbach 8410659bb6 elm_genlist: set focus to the item when a user calls the function 2018-03-15 15:39:12 +01:00
Jean-Philippe Andre fd82c2521e genlist: fix "insane" order [BUG COMPATIBILITY]
This patch implements bug compatibility.

genlist internally uses both a tree structure with Eina_List and a flat
Eina_Inlist to track its items. ALL of the items are in the inlist while
subitems appear in their parent's list. As a consequence both lists must
be kept in sync pretty tightly. Obviously this is not done at all and
has led to countless bugs, as soon as tree or groups are used:
 - Invalid order of items (visually)
 - Invalid order of items with sorted_insert
 - Glitches in the matrix
 - Crashes with sorted_insert
 - Odd/even styles not properly set
 - Promote/demote functions broken by design
 - Developers send to psychiatric hospitals
 - Etc...

Legacy genlist (1.19 and before) used an inlist order that basically
didn't make sense, as it didn't follow the logical order of elements (as
they appear visually). Unfortunately this has "worked" (really, that's a
huge stretch to use this word here) for a long time this way. As a
consequence, some applications (*cough* empc *cough*) have relied on
this order to implement "next album" or "previous album" where the
album title is a group node.

By changing the order of items in the inlist, this has broken the
assumptions made above, and ends up in cases that return NULL, leading
to SEGV. Sure, the app should have checked NULL, but that's not really
the point here. The behavior has been changed.

This patch implements "fixes" for the following functions:
 - elm_genlist_first_item_get(): Don't return a parent
 - elm_genlist_last_item_get(): Return a parent
 - elm_genlist_item_next_get(): return a parent upon reaching the last child
 - elm_genlist_item_prev_get(): return a child when a parent is passed

Important notes:
 - This does not cover 100% behavior compatibility here. The only way to
   have it would be to simply revert the entire genlist code to its
   original version and never touch it again, ever.
 - An explicit API is required for an application to specify which API
   level it targets, so that we can cherry-pick which bug compatibility
   features we want to enable. We are already doing this for EDC,
   unfortunately.

@fix

fix T5938

Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-13 15:15:01 -07:00