Commit Graph

56 Commits

Author SHA1 Message Date
Mike Blumenkrantz acd9eb2466 efl_ui/box: restore previous behavior for passing null reference objects
Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9865
2019-09-06 12:43:32 -04:00
Marcel Hollerbach 9284418bea efl_ui_box: do not perform insertion if existing is not added
this was brought up recently and it is true that this should be fixed.
If existing is not registered in the container, then we should not
perform the operation at all.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9860
2019-09-06 16:20:23 +02:00
Mike Blumenkrantz 7e517e2a11 elm/efl_ui: remove elm_layout_sizing_eval implementations
Summary:
historically there have been two methods of calculating sizes in elm:
* elm_layout_sizing_eval
* evas_object_smart_calculate (now efl_canvas_group_calculate)

the former was used to set size hints on widgets, while the latter was
used to perform internal size calcs for the widget. for things to
work correctly, these functions had to be triggered in just the right
order at just the right time. many hard-to-fix bugs related to widget
sizing over the years have been the result of this split

this patch removes elm_layout_sizing_eval implementations so that all
widgets perform both internal size calcs and size hint setting all
in the same function, ensuring that these are always in sync

the result is that in the vast majority of cases, far fewer recalcs
happen for widgets, and they are quicker to achieve their final size

Depends on D9438

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9439
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz d5da991bc5 efl_ui/box: optimize position_set operations with boxes
if a box is moved and no other changes are made to the box or its children,
e.g., if the box is scrolled, then there is no need to loop over the box's
items repeatedly in order to accurately calculate all the item geometries
and positions.

instead, simply apply an offset from the last box calc position to each child
item and handle the position changes more transparently

this yields roughly a 12% perf improvement to the 'efl.ui.scroller simple' test
and brings rendering up to nearly 60fps

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9342
2019-07-17 10:54:44 -07:00
Xavi Artigas 38d7d33354 Rename Efl.Ui.Direction -> Efl.Ui.Layout_Orientation
Summary:
This clarifies a bit the whole Orientation vs. Direction confusion, at the
expense of longer names (Image_Orientation vs. Layout_Orientation).
Also, the interfaces are now adjectives (Orientable) and the enums have long
names (*_Orientation).

Pretty big patch, but no functional changes.

Relates to T7863

Test Plan:
Everything builds and passes tests.
Elementary_tests show same behavior, including the "inverted" widgets, which
are the only parts which received a bit of code changes.
Proof:
https://travis-ci.org/Enlightenment/efl/builds/536277282

Reviewers: zmike, bu5hm4n, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8946
2019-05-24 12:30:32 -04:00
Marcel Hollerbach 4f0ce2c58c efl_ui: add a internal flag to mark widgets internal
when a widget is marked internal, widgets can use that to behave in
certain ways. Box for example uses this to not alter the widget_parent
property anymore. Which is usefull for when boxes are used internally.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8736
2019-04-30 20:45:40 +02:00
Marcel Hollerbach 7aa9ea071a efl_pack: split algin and padding property
the pack interface is a general interface for how we pack things into a
container. the align and padding property has less to nothing to do with
this. Hence this commit splits the two properties into theire own
interface.

fix T7825

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8699
2019-04-26 12:06:02 +02:00
Jaehyun Cho f3b9f7f0d8 efl_ui: fix not to call _on_child_del() after container is deleted
If efl_ref() is called to child, then child may not be deleted when
container is deleted.
This causes _on_child_del() is called after container is deleted and it
causes crash if container data is accessed in _on_child_del().

To resolve the above issue, all callbacks of child are deleted not to
call _on_child_del() after container is deleted.
2019-04-26 18:25:50 +09:00
Yeongjong Lee 41136db8e8 ui.widget: remove elm_widget_sub_object_parent_add from each of widgets
since commit a1addad60e, To add myself as a sub object of parent object will be
done in Efl.Ui.Widget constructor.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8280
2019-04-18 11:01:19 +02:00
Marcel Hollerbach b0549bb8cc efl_ui_box: print more errors,
when a element is added two times, we should print an error. Same for
removing a child that is not part of this container.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8522
2019-04-17 15:21:10 +02:00
Yeongjong Lee d5445918ec ui.box: remove leagcy evas_box from Efl.Ui.Box
Remove legacy stuff from Efl.Ui.Box.
This expect to improve performance by removing internal function call related
evas_box.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8417
2019-04-17 15:21:07 +02:00
Yeongjong Lee f4b69b9c4d ui.box,table: update layout when homogeneous mode is changed.
Summary: changing homogeneous mode is needed layout_update.

Test Plan:
1. elementary_test -to 'efl.ui.box'
2. Click 'Homogenous' check box.
3. Check layout is updated.

Reviewers: zmike, Jaehyun_Cho, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8216
2019-03-08 08:22:12 -05:00
Yeongjong Lee 4628021fe5 efl_container: remove content_remove
Most of classes implements Efl.Container.content_remove are just calling "unpack"
except of "Efl.Canvas.Layout" and "Efl.Ui.Layout".
This patch remove the asymmetrical API and add content_remove API of
"Efl.Canvas.Layout" and "Efl.Ui.Layout" that child can be remove without efl_part
APIs.

ref T7576

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7913
2019-02-27 21:20:33 +01:00
Yeongjong Lee 27e101da4b ui.box: implement homogeneous mode
Summary:
On homogeneous mode, children are of the same weight and of the same min size
which is determined by maximum min size of children.

Depends on D7750

Reviewers: Jaehyun_Cho, zmike, jpeg

Reviewed By: zmike

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7889
2019-02-13 09:23:01 -05:00
Marcel Hollerbach f00ae98a1d elm: add container api for the two objects
this resolves unimplemented API by just mirroring the calls to different
API calls.

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7749
2019-01-26 11:41:59 +01:00
Yeongjong Lee 78ae9c0ae0 gfx: Add size hint fill (EO)
Summary:
If widget use both hint_align(HINT_FILL) and hint_max together, there is no way
to set to hint_align. See, elementary_test -to 'efl.ui.box' -
"Button with a quite long text." button. you can control button position
using "Box align" slider, but this is not proper implementation. When there are
two widget which have hint_align(HINT_FILL) and hint_max, those positions are
determined by box_align rather than hint_align. it means widget align cannot be
set individually.
To solve this problem, this patch add hint_fill property. in order to avoid
conflict with legacy API named evas_object_size_hint_fill_set(), it only works
for EO widgets(made by efl_add).
Also, EFL_GFX_SIZE_HINT_FILL is removed.

@feature

Test Plan:
elementary_test -to 'efl.ui.box'
elementary_test -to 'efl.ui.table'

Reviewers: jpeg, Hermet, Jaehyun_Cho, raster, barbieri

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T3912

Differential Revision: https://phab.enlightenment.org/D7409
2019-01-16 16:47:51 +09:00
Marcel Hollerbach f570e7435e elm-containers: use alive api
check if the object is in its correct lifetime before performing
operations

Differential Revision: https://phab.enlightenment.org/D6724
2018-09-14 11:19:01 +02: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
Jean-Philippe Andre ee90f72a76 elm: Call efl_access_type_set after construction
I don't think it is necessary to call this before construction, and that
could instead lead to issues. It's just weird overall.
2017-11-07 14:43:22 +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
Marcel Hollerbach 7b11317159 efl_ui_box: remove old api! 2017-10-10 19:28:45 +02: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 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 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 b1488b98de efl.ui.box: Switch to Efl.Ui.Dir (EO)
This makes the default box vertical, just like in legacy.
The flow box is horizontal by default.

Ref T5870
2017-08-10 14:42:08 +09:00
Jean-Philippe Andre 2450038436 widget: Remove sub_obj arg to resize_object_set
This removes an argument that was false only for a single widget:
naviframe. Hopefully this logic is now simpler, even though it involves
a small hack within naviframe itself.

Ref T5363
2017-08-09 12:21:42 +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 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
Jean-Philippe Andre acb9ae70fe eo/elm: Simplify box/grid EO API
After talking with @eunue I realised that the way I'd first
implemented the box/grid "pack" API was simply too complicated.
I had tried to make it possible to change the layout function
at runtime, like good old evas box, but since there are no function
pointers in EO the final design was really convoluted.

If someone really needs to change the layout of a box at runtime,
just create your own subclass, or unpack all items and repack them
in a new box.

Note: there are still some issues with the layout params & flow
2017-04-18 15:34:29 +09:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Jean-Philippe Andre 52f9220b3f Evas: Rename smart object into Efl.Canvas.Group 2016-06-17 19:32:43 +09:00
Jean-Philippe Andre 42b63f5507 Evas: Add smart_ prefix to all smart functions (eo)
This is a first step at separating legacy smart
object features away from standard efl interfaces.
2016-06-17 19:25:48 +09:00
Jean-Philippe Andre 9a052a740d Evas: Move smart_callbacks_descriptions to legacy 2016-06-17 19:25:47 +09:00
Jean-Philippe Andre 37625fca91 Evas/Edje/Elm: Use combined_min instead of min everywhere
This allows apps to set the objects min size with hint_min,
while letting the rest of EFL define the minimum size with
rstricted_min.

I don't like the property names much...
2016-06-09 16:37:49 +09:00
Jean-Philippe Andre 31279d2513 Efl.Pack: Replace pack_direction with Efl.Orientation
Since I first made the pack_direction before orientation
existed, the names didn't match. This should improve API
consistency.
2016-06-03 16:52:31 +09:00
Jean-Philippe Andre 5fd02a79cc Efl.Ui.Box: Fix direction set
VERTICAL means UP but UP was ignored...
2016-06-03 15:29:01 +09:00
Jaehwan Kim 945932e1b1 Elementary: fix the indentation 2016-05-30 11:39:00 +09:00
Jaehwan Kim 62cf70034d widget: set the parent-child relation again, when the widget is unset
Summary:
When the widget is unset from any container, a parent of the widget
doesn't exist. So we should set its parent to the top object.
But if we just set sd->parent, the parent can not find the widget as a
child. So the container widgets set the parent-child relation when
sub object is unset.
This commit is related to 0822ad2195.

@fix

Test Plan:
Check this issue.
https://phab.enlightenment.org/D3855
The unset widget don't added any widget as child.
So when it set scale, the widget can not reload the thmeme.

Reviewers: raster, cedric, Hermet, reutskiy.v.v

Reviewed By: Hermet, reutskiy.v.v

Subscribers: cedric, jpeg

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

Conflicts:
	src/lib/elementary/elm_mapbuf.c
2016-05-30 09:49:04 +09:00
Tom Hacohen 0ca59b0402 Efl gfx: Remove the no longer needed .Base hack. 2016-05-10 12:25:44 +01:00
Jean-Philippe Andre ff8ee01432 Efl: Rename some packing functions and return bool
This renames some APIs from Efl.Pack in order to try and
make them more sensible. Feedback welcome.

Also, most APIs now return bool, where false is quite unlikely
to happen.
2016-04-26 16:48:55 +09:00
Jean-Philippe Andre 32b622f08d Efl.Pack: Add content_at_remove
This will match Edje Box remove_at
2016-04-26 11:36:23 +09:00
Jean-Philippe Andre 902950018b Efl: Introduce Efl.Container and unify APIs
This removes Efl.Pack_Named which had a terrible name,
removes Elm.Container which should have been renamed
Efl.Ui.Container anyway, and introduces an interface
Efl.Container instead.

The hierarchy tree is now changed as objects don't inherit
from Efl.Container (it's an interface, not a regular class)
but only implement it. Obviously it is very easy to
reintroduce an Efl.Ui.Container parent class if we need it,
but I guess it should have some actual logic. It's basically
part of what Elm.Widget already does.

Some function names have been modified to look better in C
with the efl_content prefix.

@feature
2016-04-26 11:36:23 +09:00
Jean-Philippe Andre 2d946d03ae Efl.Pack: Rename methods and properties
- Children are now contents
- Efl.Pack_Layout is now a separate class and
  merges Pack_Engine.
- Removed dumb class Efl.Pack_Item
- Updated docs
- Added pack_ or grid_ prefixes to some methods
2016-04-20 11:15:53 +09:00