Commit Graph

164 Commits

Author SHA1 Message Date
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
Mike Blumenkrantz 654656e69d Efl.Access.Selection: clear -> access_selection_clear
maybe there should be a text selection interface...
2018-02-15 13:28:49 -05:00
Mike Blumenkrantz b0bb09ef7a Efl.Access: resolve more name conflicts
children -> access_children
type -> access_type
2018-02-15 13:28:45 -05:00
Mike Blumenkrantz a6566ef8ae elm_interface_scrollable: use 'mirrored' from Efl.Ui.Base 2018-02-15 13:11:01 -05:00
Mike Blumenkrantz 504ad62a6b elm_genlist: parent -> parent_item 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz f45e972c8c Elm.Widget.Item: focus -> item_focus 2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 5263f311f4 efl_widget_item: remove 'del'
this now uses regular efl_del
2018-02-15 13:11:00 -05:00
Mike Blumenkrantz 8b7bbb2398 efl.access: name -> i18n_name 2018-02-15 13:11:00 -05:00
Marcel Hollerbach d447967b76 elm_gen****: do not call realize on items
better rely on the adapter and wait for realization so the adapter is
wether created or not even created but used with content. This fixes
item content focus, crashes at startup and a freeze in genlist test!
2018-01-26 15:11:50 +01:00
Marcel Hollerbach b2be688ccc elm_genlist: prepare the item when its set
so the border element is set accordingly on the parent manager which
then can be picked up for focus relations.

ref T6453
2018-01-23 21:27:45 +01:00
Jean-Philippe Andre 2c66616179 genlist: Avoid a call to NULL
elementary_test -to genlist
-> LOTS of warnings, when creating the genlist, as the items aren't
ready yet. This just avoids the WRN as recalc will happen later anyway.
2018-01-22 20:38:37 +09:00
Jean-Philippe Andre 20570f74d3 widget: Move on_focus_update to Focus.Object
Following @taxi2se's recommendation. This is indeed a focus method, and
Widget already inherits from Focus.Object.

Ping @bu5hm4n who probably wants to adapt this further.

Ref T5363
2018-01-19 17:30:04 +09:00
Jean-Philippe Andre c35f257bf2 widget: Remove item from on_focus_update
It's legacy stuff, and always NULL.
2018-01-19 17:17:01 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Cedric BAIL 526415d903 eo: make efl_provider_find a @const function. 2018-01-04 11:45:10 -08:00
Jean-Philippe Andre 116f24fd78 elm: Rename struct to Efl.Ui.Widget.Focus_State
Ref T5363
2017-12-12 12:01:46 +09:00
Amitesh Singh 10103b9b45 efl.gfx: move scale{} from efl.ui.base to efl.gfx 2017-12-04 14:38:39 +09:00
Marcel Hollerbach 38b3ef1b8c elm_genlist: use the correct elm_object_focus_get function
genlist does not get focus anymore, only its children are getting them.

fix T6425
2017-11-30 20:07:52 +01:00
Amitesh Singh 29b47e0a07 focus: remove focus.get{} from widget.eo
This is taking care by focus manager now.
2017-11-29 19:25:14 +09:00
Prasoon Singh 248cb96c42 elm_genlist: Add signals to communicate drag start and stop to atspi client.
Summary:
Send signal EFL_ACCESS_STATE_ANIMATED when dragging starts and stops to atspi clients and also set EFL_ACCESS_STATE_ANIMATED
when reorder mode is enabled.

Test Plan: When reorder happens atspi client should receive object:state-changed:animated signal.

Reviewers: kimcinoo, shilpasingh

Reviewed By: shilpasingh

Subscribers: cedric, govi, rajeshps, jpeg

Differential Revision: https://phab.enlightenment.org/D5515
2017-11-22 14:17:41 +09:00
Andrii Kroitor c37226ef5e elm_genlist: fix rare segfault
Conditions:
- style is "double_label"
- the is some content for items (i.e elm_label)
- elm_genlist_filter set was once called after genlist creation with
  NULL data
- label_get callback uses elm_genlist_item_prev_get on its current item
- at least one item is added as a sub-item
- ~2 blocks of items are added afterwards
- items are added quickly while holding 'enter' on an elm_button

@fix
2017-11-17 10:16:41 +02:00
Jean-Philippe Andre e9ebe5c676 elm: Define and rename internal atspi struct in EO
This thing is used by only 2 EO APIs that are marked as @beta. I wonder
if the @beta tag or the ptr() expression made it work for eolian,
because it simply wasn't defined in EO.

I'm renaming it just so that it's more consistent with the new names
used by atspi (and EO API in general).
2017-11-16 12:00:18 +09:00
Lukasz Stanislawski c838e30a24 elm: Rename elm_interface_atspi_widget_action mixin
Reviewers: jpeg

Subscribers: jenkins, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5400
2017-11-16 12:00:18 +09:00
Andrii Kroitor a2532b8ef0 genlist: fix state corruption of content
When using reusable content, genlist preserves old object's state and is
expecting reusable_content_get callback to change all needed properties.
But there was an inconsistency: it was silently re-enabling the old content.

@fix
2017-11-15 10:57:10 +02:00
Lukasz Stanislawski 6505f535f6 elm: evaluate MULTISELECTABLE state for genlist and gengrid
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5452
2017-11-13 12:08:57 +09:00
Marcel Hollerbach b364293b0c genlist: implement item focus
this implements item-content focus for genlist. feel free to notify me
if there are any crashes or something simular.

ref T6181
2017-11-12 12:04:11 +01:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Jean-Philippe Andre 824792f09d elm: Major cleanup of EO files
This prevents legacy EO classes from being exposed through .eo.h headers
or .eo in share/eolian/includes. Also removes a slew of useless xxx_eo.h
intermediate headers.

Notes:
 - elm_systray has no proper API: it's not clear if the EO API should be
   released (in which case it needs to be renamed to efl_something) and
   there is no legacy API to create a systray object.
 - Some files have been placed in a "FIXME" section, as I believe they
   are necessary within EO land, but at the same time still don't
   conform to the interfaces (eg. name starts with elm_).
 - elm_interface_scrollable is required by photocam. This means photocam
   needs to be adapted to fit the EO scroller API (still to be
   completed, I believe).

Bugs:
 - This breaks most C++ examples. I KNOW. And I'm working on it.

Ref T5301
2017-11-01 21:23:31 +09:00
Godly T.Alias 0496b7988a Genlist Item Pin Feature
Summary:
**@feature** T6241

This feature enables genlist to pin an item to viewport which will
be available always for user to view/select.

**Use Case**:
In a big list of music, most times when user finds a song which they
like, before playing that they may want to go through the entire list
to check whether there is some other good songs, but
after seeing the entire list user have to again scroll back to the
position of item which they liked to play it then.
In this case item pinning can be used, so that the item
which they want to keep for future selection can be pinned
and then it will remain in viewport, finally when user want to do
operation on item, it will be readily available in viewport.

Signed-off-by: Godly T.Alias <godlytalias@yahoo.co.in>

Test Plan: Elementary Test -> Genlist -> Double click on items to enable/disable pinning

Reviewers: raster, cedric, prince.dubey, SanghyeonLee

Subscribers: rajeshps, jpeg, shilpasingh

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D5340
2017-11-01 16:11:30 +09:00
Jean-Philippe Andre 585be9e24f genlist: Simplify some logic
Item prev/next/first/last.

If true, break, else, break.
EO_OBJ(x) is safe on NULL.
Add a simple macro to simplify inlist handling.
Overall simplify the code.
2017-10-25 22:54:52 +09:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00