Commit Graph

116 Commits

Author SHA1 Message Date
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
Lukasz Stanislawski 57aefc53c1 elm: rename Elm_Interface_Atspi_Accessible interface
Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5341
2017-10-19 10:13:54 +09:00
Jean-Philippe Andre 83d063692f genlist: Fix crash on item delete
See d3440a9867

Fixes T6033
2017-10-18 20:01:35 +09:00
Marcel Hollerbach a38f5c3892 elm_genlist: for now disable this code
it will return later
2017-10-10 19:28:48 +02:00
Lukasz Stanislawski 3e6cc83369 elm: rename Elm.Interface.Atspi.Selection => Efl.Access.Selection
Reviewers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D5165
2017-09-19 11:18:22 +09:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
SangHyeon Jade Lee d3440a9867 genlist: process item block positioning before relative item deleted
process item for positioning proper relative block before it's
relative item is deleted.

Signed-off-by: SangHyeon Jade Lee <dltkdgus1764@gmail.com>
2017-09-15 12:11:55 +09:00
SangHyeon Jade Lee 50149e95cd genlist: fix decorate mode dangling pointer in deletion
fix decorate mode crash issue reported by Jack Daniel in T6000
which is occured by dangling pointer in item deletion on decorate mode.

Signed-off-by: SangHyeon Jade Lee <dltkdgus1764@gmail.com>
2017-09-12 18:41:37 +09:00
Jean-Philippe Andre c0d7ea4af0 widget: Rename on_focus to on_focus_update (EO)
on_focus seems to imply that focus was just given to the widget, but
that function is called on any focus change (in and out).

Ref T5363
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre b6bab481aa widget: Mark old focus API as beta.
It's not beta. It's about to die.
Also, move #define ELM_WIDGET_BETA to the common header file, as it is
consequently required by ALL widgets. :(

Ping @bu5hm4n :)

Ref T5363
2017-08-31 11:22:04 +09:00
Jean-Philippe Andre 692282e67a widget: Move item_loop_enabled to scrollable (EO)
I was told that the scrollable interface is being redesigned for EO.
This API definitely does not belong to the base Widget class, as it's
quite specific to item-based scrollable widgets, such as lists and
grids. Since Elm.Interface_Scrollable is itself being revamped, it is a
good place to move that EO API for now.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 8c1f771a67 widget: Use rectangle for focus_hilight
Ref T5363
2017-08-29 16:22:47 +09:00
Jean-Philippe Andre 0a0bbe5fda widget: Rename hook "access" (EO)
This is also another protected and beta API. Meant to be overridden by
subclasses, but belongs to a still unstable API.

The difference between the internal legacy and the EO API is really bad.
Same as with activate (previous commit).

Ref T5363
2017-08-29 10:40:53 +09:00
Jean-Philippe Andre 3f9c239b27 widget: Make sub_object add/del protected (EO)
Also prefix with widget.

I want to rename this as child rather than sub. It's inconsistent with
the other parent/child hierarchies. Anyway the various hierarchies are
confusing, so let's keep this name :)

Ref T5363
2017-08-23 20:56:37 +09:00
Jean-Philippe Andre 06ec847a7c widget: Use EO function pointer for on_show_region
This is as much a test of the EO function pointer as it is a clean up of
this widget API.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 20a5968c12 elm: Use a macro to handle key bindings
This factorizes the code and makes most widgets handle key down events
in the same way:
 - check that the object is not disabled, event is not on hold
 - figure out the key binding based on the class name
 - mark event as on hold

The class name is usually MY_CLASS_NAME but in some cases it was
MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg.
elm_win vs. Efl.Ui.Win). In that case the key bindings are broken.

This breaks key bindings for the following widgets:
 - Win (focus)
 - Image ("clicked")
 - Video (move, play)

This fixes key bindings for the following widgets:
 - Nstate

Some widgets remain broken:
 - Photocam / Efl.Ui.Image.Zoomable

A patch will be applied to restore the key bindings for the above
breaks.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre dee61f4097 elm: Cleanup theme and style set functions
This makes efl_ui_layout_theme_set() return a Theme_Apply error
code. The type is now public as Efl.Ui.Theme.Apply.

Ref T5329
Ref T5363
2017-08-09 17:08:24 +09: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
Jean-Philippe Andre 6864495c99 elm: Move elm_layout_sizing_eval to legacy
elm_layout_sizing_eval() marks an object as requiring recalc.

Unfortunately, it's been massively abused by various widgets into
actually doing the calc, or the min calc. So we end up with one API
that has 3 different definitions depending on the widget type:
1. Mark as requiring recalc (correct, respects doc, elm_layout)
2. Calculate min size and other size hints
3. Actually do some geometry modification

I believe we need to clarify these 3 requirements into 3 very clear
and specific APIs in elementary. Right now we have similar functions
in evas for 1 (evas_object_smart_changed) and 3 (smart_calculate).
But their exact definition also isn't necessarily what we want for
elementary.

Another clear problem is that layout_eval does not do any calculation
(in theory), so the "eval" word is a bit of a stretch here.

Once we're sure about the exact API we want, we can add this back to
EO and make it work across our EO widgets. For now let's just keep
the legacy API, and its EO overrides, as is.

Ref T5315
2017-08-08 11:10:56 +09:00
Jean-Philippe Andre ad7e16bcf4 layout: Use only legacy "elm_layout_sizing_eval"
This removes all uses of elm_obj_layout_sizing_eval.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre aebd37cab8 layout: Remove sub_object_add_enable
Same as the previous patch. This was an ugly hack. Use another
one instead.

Ref T5315
2017-08-04 11:52:16 +09:00
Amitesh Singh 7fa14e5cc6 genlist: fix multiple focus edje signal issue
We need focus edje signal when item is focused or the already
focused item realizes. its wrong to call focus signal on
_elm_genlist_item_state_update()

fixes T4969
2017-07-11 15:17:09 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Amitesh Singh 0141417d5d genlist: move to next focusable/selectable item when looping
this fixes a bug in genlist when scrolling is enabled and
items at top and bottom are disabled. Focus behaviour is not normal
in case up arrow is pressed when focus is at the top enabled item
or down key is pressed when focus is at bottom enabled item.

fixes T5576
2017-06-30 12:21:20 +09:00
Mike Blumenkrantz 990a9d485d elm_list/genlist/gengrid: don't unselect items when moving the mouse out of them
this seems wrong since it's using smart object geometry to determine
event-based positioning within an edje object. considering it from a user pov,
it definitely is wrong because why would you deselect items based on mouse
movement?

ref D2622
ref da81eff897

@fix
2017-06-23 17:43:44 -04:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
SangHyeon Lee d1a5df7055 elementary: fix recursive content group calculation in genlist
Summary:
There are several problem is left on recursize content calc.
previously genlist only calculate size of layout class,
but after recursive content group calculation patch,
layout couldn't get proper size because sizing eval is
not pre-processed.

Test Plan: elementary test working fine.

Reviewers: jpeg, cedric, raster, conr2d

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-06-12 10:13:05 -07:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Jeeyong Um 02893c39ba Genlist: Calculate the min size of content before item realize
Summary:
Genlist item doesn't change its size when its content size is changed,
but its size is determined in realization.
Therefore, deferred calculations for content should be performed immediately
before swallowing it by genlist item.

Test Plan: make and run attached sample

Reviewers: jpeg, SanghyeonLee, cedric

Differential Revision: https://phab.enlightenment.org/D4705
2017-06-09 15:09:12 +09:00
SangHyeon Lee dc98fd4f5e elm_gen : apply Elm_Theme_Apply enum return types for theme_object_get of item view.
elm_widget_theme_object_get now return Elm_Theme_Apply enum not bools.
only ELM_THEME_APPLY_FAILED case, need to re-apply default item edje.

Signed-off-by: SangHyeon Lee <sh10233.lee@samsung.com>
2017-06-02 10:32:07 +09:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Carsten Haitzler 706c7f9e3b genlist - fix coverity complaint about null check
we checked for null and then just used a null return later inthe loop.
this fixes that. this should fix CID 1360955
2017-04-18 17:30:50 +09:00
Godly T.Alias 5cba6a5857 Genlist: Performance optimization for genlist in non-filter cases
Summary:
When _item_filtered_get is called, block and pan re-calculations
happen, When there is no filter applied, we can skip item filtering to
avoid some unwanted calculations

Reviewers: cedric, raster, SanghyeonLee

Reviewed By: raster

Subscribers: rajeshps, Princekrdubey, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4759
2017-04-13 16:40:29 +09:00
Jean-Philippe Andre 76b5749ea0 genlist: Fix another issue with insert sorted
Fixes T5274

@fix
2017-03-20 22:25:32 +09:00
Jean-Philippe Andre 83619af10a genlist: Fix a leak
Thanks @herdsman
2017-03-14 23:07:34 +09:00
Jean-Philippe Andre fbe72f6e4b genlist: Fix some more decorate mode issues
The item, after having been unswallowed from its decorate
item, becomes unclipped and unparented. The parent was well
reset, but the clip wasn't.

Test case:
  elementary_test -to "Genlist Decorate Item Mode"

I'm sure some bugs are still lurking. Genlist is so lovely.

Fixes T1551
2017-03-14 14:04:39 +09:00
Jean-Philippe Andre 635b4ad8f3 genlist: Make sure only one item is decorated
In "Genlist Decorate Item Mode" after decorating a few items
(rotate or slide, doesn't matter), only one item or none should
be decorated. Scrolling up and down the genlist should work just
fine. This fixes massive render issues and inconsistent states
of the items in this test case.

"rotate" mode is still going nuts.

Ref T1551
2017-03-14 11:04:16 +09:00
Jean-Philippe Andre ab735ada77 genlist: Make logic more readable 2017-03-14 11:04:16 +09:00
Jean-Philippe Andre f1974b7b1c genlist: Fix invalid call to stack above/below
Test process:
  elementary_test -to "Genlist Decorate Item Mode"

Slide any item to the right, observe error logs.

Ref T1551
2017-03-14 11:04:16 +09:00
Jean-Philippe Andre 6c62ae3e6e Revert "Genlist: Calculate the min size of content before item realize"
This reverts commit 60566ca34d.

This broke the layout in "Genlist Full Widget"
2017-03-10 15:20:22 +09:00
Jeeyong Um 60566ca34d Genlist: Calculate the min size of content before item realize
Summary:
Genlist item doesn't change its size when its content size is changed,
but its size is determined in realization.
Therefore, deferred calculations for content should be performed immediately
before swallowing it by genlist item.

Test Plan: make and run attached sample

Reviewers: cedric, SanghyeonLee, jpeg

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D4705
2017-03-10 14:59:48 +09:00
Jean-Philippe Andre fc40d3d559 genlist: Fix invalid state of reused content
If an item is marked as disabled it should be re-enabled
before being put in the reusable contents cache. Otherwise
a following use of this object may result in a disabled
item being used, making the UI effectively disfunctional.

Also modify the test case to show and test this behaviour.

Add an efl_isa() to protect calls to elm_widget APIs.

Fixes T5236

@fix
2017-03-10 11:22:13 +09:00
Jiwon Kim e6a1e456cb genlist: Remove weird behavior about item_show, bring_in
Summary:
When if item_show / bring_in is proceeded as 'deferred_show'
sequence, Scrollto_Type does not be checked perfectly.
As a result,
ELM_GENLIST_ITEM_SCROLLTO_NONE and any other integer values
are worked such as ELM_GENLIST_ITEM_SCROLLTO_BRING_IN.

As doxygen of Elm_Genlist_Item_Scrollto_Type,
ELM_GENLIST_ITEM_SCROLLTO_NONE and other incorrect number
should not work.

Fixes T4854

@fix

Reviewers: SanghyeonLee, woohyun, jpeg

Reviewed By: jpeg

Subscribers: id213sin, conr2d, cedric

Maniphest Tasks: T4854

Differential Revision: https://phab.enlightenment.org/D4684
2017-03-02 16:43:47 +09:00
Jean-Philippe Andre 726994d175 genlist: Final fix for odd/even styles issue
The key was to emit & process the signal to the edje objects
(item views) at the same time as we move them, ie. from the
loop in _item_block_position().

Also the proper counting must be used at all times. Hidden
items should not be counted.

Tree effect may still have issues but otherwise there is no
more blinking, double odd or even rows, etc... It all looks
good (as long as there is no tree effect!).

Fixes T3086

@fix
2017-02-27 16:26:41 +09:00
Jean-Philippe Andre 3574eb8c07 genlist: Fix fileselector crazy behaviour
When using the fileselector in tree view mode (ie. expandable),
expanding any folder with a lot of files in it would cause the
genlist view to jump somewhere to the bottom. This is because
the mechanism preventing the view from moving was assuming that
all "prepend" operations meant prepending before the selected
item. This is not the case in case of expansion like in the
fileselector.

@fix
2017-02-27 16:26:41 +09:00