Commit Graph

122 Commits

Author SHA1 Message Date
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 e0ae3a9a76 efl_ui/widget: check legacy type on correct object for scroll_hold push/pop
too much copy/paste

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9399
2019-07-29 16:06:20 +02:00
Marcel Hollerbach 5fd3436b17 efl_ui_widget: fix warning 2019-07-22 10:44:30 +02:00
Mike Blumenkrantz 5dac20f69f efl_ui_widget: add safety checks to verify parents aren't being added as children
somehow it was never checked to see if a parent was being added as a subobject
of a parent's own child object (recursive hierarchy)

@fix

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9333
2019-07-22 10:44:30 +02:00
Cedric BAIL 0b949d0e7a elementary: first search on ourself instead of our parent for all providers.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9293
2019-07-17 21:57:54 +02:00
Cedric BAIL 2d481d8593 efl: add a Efl.Model_Provider that every widget will look up for in their parent tree.
This is done to simplify code as you only need to set the model on the
provider and all the widget that are using it as a provider will automatically be
updated. The child will find a provider during at the time the first property binding
is set on the widget by checking if the parent have an Efl.Model_Provider set. It is
not necessary to set a model to have a valid lookup on a Efl.Model_Provider. To disable
a widget lookup, you can just force set a model on it (even NULL) and it will disable
the lookup.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9290
2019-07-17 21:57:51 +02:00
Cedric BAIL 4d071ff1cb efl: implement notification for when the model is changed on a widget.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9288
2019-07-17 21:57:49 +02:00
Marcel Hollerbach a6fa2f12d6 efl_ui_widget: relax the amount of event subscriptions
there is a very basic problem in eo events. We are having one central
array of event subscription, if for example a widget is now listening to
changes in its parent, then we are 100% asking for trouble.

As an example:
- A scroller with 100 buttons in it.
- Every button will have a subscription to the FOCUS_MANAGER_CHANGED
event

If you now scroll, the position is updated in the scroller, therefore
the position in scroller is updated. This has the result that the whole
list of 100 event subscriptions is walked, which is obviously bad,
however, this solution here is way easier than fixing eo (i am not even
sure there is a nice solution to it).

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9324
2019-07-17 10:17:46 -07:00
Marcel Hollerbach e76349cd41 efl_ui_widget: performance optimize deletion
when a logic parent does not have any widgets left, the parent needs to
be reevaluated. However, this only has to happen when there is a change
in state (eg. from 0 -> N or from N -> 0). Every other call can be
safed. This commit introduces this checking, and safes up performance.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9323
2019-07-17 10:17:44 -07:00
Mike Blumenkrantz 66ba42e74d efl_ui_widget_part: implement some expected methods
checking part type and part geometry is pretty common, so these base
implementations can fill in gaps in existing functionality

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9317
2019-07-16 14:48:45 +02:00
Marcel Hollerbach a94c72f4de efl_ui_widget: optimize focus
this commit ensures 2 things:
1. This ensures that the parent is not evaluated when there was no state
changed, this cuts down roughly 30% of the calls to full_eval
2. This ensures that we only listen to parent manager changes when we
are actaully registered. This reduces the amount spend in event emission
a lot.
2019-07-04 20:41:23 +02:00
Mike Blumenkrantz 4046628633 efl_ui/widget: skip updating access info during parent_set(NULL) if dead
Summary:
no need to update access info for dead objects

@fix
Depends on D8983

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8984
2019-05-29 12:29:04 -04:00
Marcel Hollerbach ea4b840539 efl_ui_widget: error on NULL passing
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8747
2019-04-30 20:45:49 +02: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 3d44b9bdb8 efl_ui_widget: remove unused function
Reviewers: zmike, cedric, segfaultxavi, devilhorns

Reviewed By: devilhorns

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8672
2019-04-22 07:06:40 -04: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 adc51e882c efl_ui_widget: we should ensure that every subobject is a gfx entity
we are calling visible_set on them later on, this will drop errors,
additionally this safes us from checking this in the widget-container
code.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8520
2019-04-17 15:21:09 +02:00
Yeongjong Lee 48c27364fc efl_ui_widget: avoid calling null parent
Summary:
This will fix unnecessary warnings on P280.

Thanks to segfaultxavi for reporting.

ref T7796

Reviewers: zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7796

Differential Revision: https://phab.enlightenment.org/D8599
2019-04-12 09:15:11 +02:00
Woochanlee 638a36ea9a efl_ui_widget: Fix disabled set calling without meaning.
Summary:
The efl_ui_widget_disabled_set calling even the state is not change when widget create and destroy.

It broken backward compatibility.

T7799
@fix

Reviewers: bu5hm4n, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8600
2019-04-12 15:45:37 +09:00
Marcel Hollerbach 0c0f47796b efl_ui_widget: move from elm_widget_top_get to provider_find
this resolves a lot of cases where focus_highlight API was called on a
object, which is not a efl_ui_win object. With this patch we ensure that
the object is always a window.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8476
2019-03-29 14:02:32 +01:00
Marcel Hollerbach fce4d95596 efl_ui_widget: add implementation for finding the window
the problem with the previous implementation (just redirect the calls to
the widget_parent then to the efl_parent is that after invalidate its
impossible to find the window where the widget is in. However, there are
cases where we want to have access to the window of the widget, for
example, to invalidate focus highlight etc..
The window of a widget is always constant, and cannot be changed (as the
evas object cannot hop accross different evas)

Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8475
2019-03-29 14:02:31 +01:00
Marcel Hollerbach b54035213f efl_ui_widget: reintroduce legacy behaviour
before the refactoring of the disabled property, there was no way to
enable a widget which has a disabled tree. This here however enables
this to work again like this. The user will be told with an error
message. The integraty of the property is maintained accross reparents.

Reviewed-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
Differential Revision: https://phab.enlightenment.org/D8459
2019-03-29 08:26:06 +01:00
Marcel Hollerbach bb0290edbe efl_ui_widget: resolve warning about multiple defines
Summary:
the difference here is, that the macro before did not print ERR's the
one now does. Hence this commit remove two error messages.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8415
2019-03-19 16:28:10 -04:00
Xavi Artigas 8c39c0e251 Revert "efl_ui_widget: resolve warning about multiple defines"
This reverts commit 9012742f9a.

I landed this too hastily.
2019-03-19 16:50:13 +01:00
Marcel Hollerbach 9012742f9a efl_ui_widget: resolve warning about multiple defines
Summary:
the difference here is, that the macro before did not print ERR's the
one now does. Hence this commit remove two error messages.

Depends on D8394

Reviewers: zmike, segfaultxavi, cedric, devilhorns

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8395
2019-03-19 16:41:45 +01:00
Christopher Michael 04ea005218 efl_ui_widget: Remove duplicate definition of ELM_WIDGET_DATA_GET
Patch 28400e3260 added a define for ELM_WIDGET_DATA_GET
which is available for all widgets so we do not need to redefine it
here.
2019-03-19 08:33:01 -04:00
Yeongjong Lee c3f823418d ui.widget: fix theme_apply working in sub_object_add
It seems that theme_apply in sub_object_add haven't worked since commit
f6fa1ef612.

scale, theme property will be set properly when the parent is changed.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8283
2019-03-13 17:02:30 +01:00
Marcel Hollerbach aabe29abc1 Revert "ui.widget: fix theme_apply working in sub_object_add"
This only works with a new libcheck, but not with a old one, revisiting
it.

This reverts commit da0ff53471.
2019-03-11 21:57:45 +01:00
Yeongjong Lee da0ff53471 ui.widget: fix theme_apply working in sub_object_add
It seems that theme_apply in sub_object_add haven't worked since commit
f6fa1ef612.

scale, theme property will be set properly when the parent is changed.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8283
2019-03-11 21:34:57 +01:00
Yeongjong Lee 0838c1af63 ui.widget: add exception handling code and unit test of sub_object_add/del function
Add missing exception check code with unit test.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8282
2019-03-11 21:23:51 +01:00
Marcel Hollerbach a1addad60e efl_ui_widget: refactor sub_object handling
efl_ui_widget has a property called widget_parent. The setter for this
function is called is exactly once, and this is within the constructor,
to a value which is not even set to the actaul field parent_obj. Which
shows, that in the sitation right now, the setter of the property is a
bit disconnected and lags some real aspects.
As we are heading towards eo-api stabilization we should beat some sense
into this setter, as people using our classes might overwrite the setter
and except calls to it, whenever the widget_parent is changed, and
implementation as in elm_menu show that this might makes sense sometime.

In order to achive this, the sub_object registering code of elm is
adjusted a bit.
sub_object_add/del is now used to differenciate between evas objects and
efl.ui.widget objects as subobject. In case of a widget, the
widget_parent of this object is set, most of the widget specific code is
then executed in the actaul setter. In case of an evas object, the
parent reference is added. In the end both end up in the subobject
children list. The later is also a requirement for widget_parent_set to
be successfull.

ref T7553

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8031
2019-03-09 11:12:26 +01:00
Cedric BAIL 6bb197caa9 efl: for consistency and effiency move Efl.Model event to send stringshare like Property_Bind event.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7946
2019-03-08 14:31:06 -08:00
Cedric BAIL 98e5a71974 efl: add an event for the View to know if someone did bound a property.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7945
2019-03-08 14:31:04 -08:00
Cedric BAIL d1d30f442b elementary: implemente property_bind support on all widget using property reflection.
This means that all property that are registered in the reflection table of
any Eo class will be available for binding with a model. This will increase
the amount of useful binding quickly.

Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7941
2019-03-08 14:31:00 -08:00
Mike Blumenkrantz 71f49619dc elm_interface_scrollable: remove elm_pan_eo.h from public header
this is a legacy header so it can't include (non-installed) eo headers

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8229
2019-03-07 14:17:09 -08:00
Mike Blumenkrantz 79a585884b elm: remove legacy type usage from eo focus functions
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8226
2019-03-07 14:17:03 -08:00
Mike Blumenkrantz 5ae716f7b3 elm_widget_item*: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8209
2019-03-07 14:16:41 -08:00
Mike Blumenkrantz c881b1497f efl_ui_widget: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
efl and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8148
2019-03-06 15:22:07 -08:00
Mike Blumenkrantz 9a361ac917 efl_access_object: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8131
2019-03-06 13:03:02 -08:00
Mike Blumenkrantz bc0c50c507 efl.ui.widget: widget_event -> widget_input_event_handler
Summary:
ref T7553
Depends on D8081

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Differential Revision: https://phab.enlightenment.org/D8082
2019-03-04 13:37:18 -05:00
Mike Blumenkrantz 3521add359 efl.ui.widget: mark a bunch of methods and event @beta
Summary:
these seem suspicious

ref T7553
Depends on D8068

Reviewers: woohyun, Jaehyun_Cho, cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7553

Differential Revision: https://phab.enlightenment.org/D8081
2019-03-04 13:37:12 -05:00
Mike Blumenkrantz bb6caaa471 efl.ui: remove Efl.Ui.Theme_Apply_Error
Summary:
now that the error codes have been change to be compatible with eina_error,
this can be removed and will work through eina_error naturally

fix T7718

Depends on D8067

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7718

Differential Revision: https://phab.enlightenment.org/D8068
2019-03-04 13:37:07 -05:00
Mike Blumenkrantz 43ef483801 efl.ui.widget: remove widget_top property
Summary:
this can be mimicked with efl_provider_find as the top widget should
always be efl.ui.win

ref T7553
Depends on D8063

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7553

Differential Revision: https://phab.enlightenment.org/D8064
2019-03-04 13:36:47 -05:00
Mike Blumenkrantz 644b771fe4 efl.ui: Efl.Ui.Theme_Apply_Result -> Efl.Ui.Theme_Apply_Error
Summary:
this swaps the values of "no error" and "error" in order to maintain
consistency with the rest of efl where the zero value means "no error"
Depends on D8060

Reviewers: cedric

Reviewed By: cedric

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_api

Differential Revision: https://phab.enlightenment.org/D8063
2019-03-04 13:36:41 -05:00
Mike Blumenkrantz bba6339cc4 efl.ui.widget: mark scroll_* methods @beta
Summary:
these are questionable at best here

ref T7553, T7714

Reviewers: woohyun

Reviewed By: woohyun

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7714, T7553

Differential Revision: https://phab.enlightenment.org/D8055
2019-02-28 23:48:27 +09:00
Marcel Hollerbach 665f8877e9 efl_ui_widget: child_can_focus is not needed anymore
summary_:
pd->logical.child_count is a counter where focusable children do
register themself in the parent if they can be focused or not. With this
we don't need the updating of this internal flag nor the flag itself anymore.

Depends on D8027

Reviewers: woohyun, cedric, Jaehyun_Cho, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8030
2019-02-27 20:19:31 +01:00
Marcel Hollerbach 0aaae8208e efl_ui_widget: make interest_region_mode legacy
summary_:
interest_region_mode makes it possible, that interest_region_get either
returns WIDGET or ITEM coordinates. However, efl-api does not have
items. That means, this can be legacy.

ref T7553

Depends on D8026

Reviewers: woohyun, cedric, Jaehyun_Cho, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8027
2019-02-27 20:19:29 +01:00
Marcel Hollerbach 29e6d1d364 efl_ui_widget: move show_region to legacy
summary_:
show_region is simular to focus_region. However, it builds up on setting
custom functions per setter to the widget, which are then executed. This
can be solved better by overwriting the interest_region getter, and
using a function like elm_widget_focus_region_show (This function still
needs to find its place in the eo api).

ref T7553

Depends on D8025

Reviewers: woohyun, cedric, Jaehyun_Cho, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D8026
2019-02-27 20:19:28 +01:00
Marcel Hollerbach b704db8f07 efl_ui_widget: move focus_highlight to the window
summary_:
the widget implementation just redirected calls from efl_ui_widget to
efl_ui_win. Which makes the properties unncessesary on the widget. This
commit moves them now to the window.

The legacy implementation of the window can now go away, as this is
taken care of by eolian directly.

ref T7553

Depends on D8017

Reviewers: woohyun

Reviewed By: woohyun

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7553

Reviewed-by: WooHyun Jung <woohyun0705@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8025
2019-02-27 20:19:25 +01:00
Mike Blumenkrantz 0b152734ba efl_ui_widget: redo disable handling
before the disable property was a bit weird. Setting something to
disabled=true will disable all children of the widget that is changed.
However, only the update function of the children will get the false flag,
not the flag itself. Which means, to query the real disabled state, we
need to walk up the parent relations.

With this patch, every change to disabled will go through the disabled
property, which mean, a implementor can just overwrite the disabled
property, and adjust its internal state there. Just be carefull, a set
to disabled=true still might result in disabled=false. This makes the
function on_disable_update unneccesary. Which also cleans up the
Efl.Ui.Widget class.

ref T7553

Depends on D8016

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8017
2019-02-27 20:19:23 +01:00