Commit Graph

142 Commits

Author SHA1 Message Date
Lauro Moura 1115752451 elm: Avoid maybe unitialized variable accesses
Reviewers: cedric, bu5hm4n, zmike, felipealmeida

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10170
2019-09-25 16:15:43 -04:00
Cedric Bail 267f8fcfa8 elementary: return an error when unimplemented function on Efl.Ui.Widget_Factory.
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10130
2019-09-25 11:31:02 -07:00
Mike Blumenkrantz 9206960dfa efl_ui/layout: add explicit error case when theme version > efl version
it's important to handle cases where a "future" theme is trying to be used
by "current" efl. this throws a serious error, since it's possible that the
widget may look/act in a way that makes it unusable

ref T8231

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10153
2019-09-25 11:30:57 -07:00
Yeongjong Lee 09b2ecec6d efl_ui_layout: fix null pointer dereferences
Summary: If theme doesn't have version data, `version` can be NULL.

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10146
2019-09-25 06:44:56 -04:00
Mike Blumenkrantz 1511430c29 efl_ui/layout: validate theme api version in theme_apply
Summary:
this throws error and warning messages if the theme api version does
not match the current efl version, and it will cause unit tests to fail
when the theme version is not updated

ref T8231

Depends on D10093

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8231

Differential Revision: https://phab.enlightenment.org/D10081
2019-09-24 17:12:01 -04:00
Mike Blumenkrantz 91f18dc427 efl_ui/layout: fix part aliasing for non-legacy widgets
if a non-null value is passed here, this needs to actually evaluate
all the part aliases

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10091
2019-09-24 13:56:12 -07:00
Mike Blumenkrantz 105f016fc9 elm: rename layout part aliasing functions/macros
these are internal apis for managing part aliasing on the C side,
but they apply to efl_ui_layout and not elm_layout

no functional changes

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D10090
2019-09-24 13:56:11 -07:00
Cedric Bail 5493cc5396 efl: make Efl.Ui.Factory.release work in batches.
This will enable better strategy in scheduling removal of object from the cache
instead of doing the throttling in the View as there is a better understanding
of the different layer the items are going to go through and where they will
consume time.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9955
2019-09-24 09:18:52 +02:00
Cedric Bail 892c26f906 efl: simplify logic for widget created by factory.
In an attempt to make things more complex than they should have been,
I tried to change the inheritance tree on the fly and assume widget would
rely on autodeleting its children. This is way more complex of a solution
than to let the View actually release all the child manually and just set
the window as the default parent.h

Co-authored-by: Marcel Hollerbach <mail@marcel-hollerbach.de>

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9953
2019-09-24 09:18:49 +02:00
Mike Blumenkrantz 74cfe457c3 efl_ui/layout: move 'frozen' struct member to be a bool bitflag
this is already handled by edje, all we really want here is a flag
to avoid more eo lookups internally when calling canvas_group_change

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10079
2019-09-23 10:33:11 -07:00
Mike Blumenkrantz 654e783d28 elm/layout: remove check for finalize in efl_canvas_group_change impl
this used to be a thing in order to prevent widgets from spamming themselves
with recalcs during construction, but since that's no longer possible we
can remove this and also resolve an issue where legacy widgets failed
to correctly calculate their min size if no text was set

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10043
2019-09-23 10:44:32 +02:00
Marcel Hollerbach b4976fdf2c efl_ui_*: fix dereferencing of possible NULL values
this fixes CID 1404763 & 1404751 & 1403904
2019-09-16 17:28:31 +02:00
Mike Blumenkrantz 9e0a285eea efl: implement efl.file::unload for classes that implement load
unload is a crucial method for classes that implement load, as this is
the method which is called during e.g., efl_file_simple_load() when
a new file is specified in order to destroy the previous object data

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9786
2019-08-29 17:17:08 +02:00
Marcel Hollerbach c6e338bb9a efl_ui_layout: remove efl.end
someone decided it should be named efl.extra, the previous commits are
ensuring that.

Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9773
2019-08-29 08:29:57 +02:00
SangHyeon Jade Lee 14f9782a81 efl_ui : add efl.extra part as layout swallow part list.
Summary:
efl.extra part is extra part of the layout swallow,
which can be generally used on overall layout object.
To be supported layout part infrastructures,
add efl.extra on layout_swallow_part[] list.

Depends on D9233

Reviewers: cedric, bu5hm4n, zmike, segfaultxavi

Reviewed By: bu5hm4n

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9316
2019-08-29 10:21:39 +09:00
Cedric BAIL 0248d504b3 elementary: switch Efl.Ui.Factory API to a batch API and update all class using it.
Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Differential Revision: https://phab.enlightenment.org/D9579
2019-08-21 11:18:34 -07:00
Marcel Hollerbach 3c098673ab efl_ui_widget: remove x,y,w,h
this is used for storing the position and size of the widget. However,
just in elm_test this eats 2KB of ram, just for saving them. The cases
where they have been used do not seem like a great performance hotspot,
additionally, in the panel cases the privat data of the widget is
achived anyways, so eo is involved and we are spending some time there
anyways.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9646
2019-08-20 12:30:07 -07:00
Mike Blumenkrantz 07e810c5cc efl_ui/layout: implement unimplemented methods
Summary:
add redirects to internal layout objects for these methods
Depends on D9561

Reviewers: q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9562
2019-08-14 19:25:53 +02:00
Yeongjong Lee c857955a4e efl_ui_layout: remove efl_gfx_hint_size_min_set in _sizing_eval
Summary:
`evas_object_size_hint_min_set` is replaced with `efl_gfx_hint_size_min_set` in
4d79efce6. it is able to have backward compatibility issue because
`evas_object_size_hint_min_set` call `efl_gfx_hint_size_restricted_min_set`
internally.
```
evas_object_main.c:2501
EAPI void
evas_object_size_hint_min_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
   efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(w, h));
}
```

This patch remove unnecessary min_set call.

Test Plan: elementary_test

Reviewers: zmike, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9566
2019-08-14 17:48:32 +09:00
Jaehyun Cho b8d1747382 efl_ui_layout: fix typo in _sizing_eval 2019-08-14 10:29:49 +09:00
Mike Blumenkrantz c594c83a02 efl_ui/layout: use MAX macro for min size clamping in group calc
Summary: Depends on D9442

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Differential Revision: https://phab.enlightenment.org/D9447
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 872d43f0a0 elm_layout: move elm_layout_sizing_restricted_eval to layout mixin
Summary:
this function should never need to be called on new widgets

Depends on D9440

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9441
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 4d79efce64 elm_layout: create a mixin to provide elm_layout_sizing_eval
Summary:
this removes elm_layout_sizing_eval entirely from the implementation
hierarchy of any efl_ui-based widgets, ensuring that future code will
correctly use efl_canvas_group functionality

Depends on D9439

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9440
2019-07-30 13:12:52 -04: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 586f41f927 efl_ui/layout_base: add subobjs_calc internal functionality
Summary:
this functionality forces group_calc on a layout's subobjects during
layout group_calc so that the layout's own group_calc will yield consistent
and correct results

currently this is only used in panel widgets

Depends on D9437

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9438
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz e583eba56b efl_ui/layout_base: add "finger_size_multiplier" property
Summary:
this feature is set on objects which inherit from layout_base in order to
allow automatically application of variable finger sizes based on a
widget's needs

an example of this would be a calendar, which is 7:8 fingers

this functionality is disabled by passing 0,0 as the property

@feature

Depends on D9436

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9437
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 46cf288d32 efl_ui/layout: implement group_calc, add finger size for inherited layouts
Summary:
this adds a group_calc implementation for the layout object (not layout_base)
to allow differentiation between inherited layout calcs and layout object
calcs

by using this, we can automatically apply finger size to inherited layout
calcs if the implementation ever reaches this point

Depends on D9435

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9436
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz 268d06d381 efl_ui/layout: use min size hints when calculating layout size
Summary:
for legacy layouts, all min size hints should be considered when performing
size calculations

for non-legacy layouts, only "user" min size hints should be considered, as we
are calculating the restricted min size hint in this function

Depends on D9434

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9435
2019-07-30 13:12:52 -04:00
Mike Blumenkrantz adc510f9ee efl_ui: change calls to elm_layout_sizing_eval to efl_canvas_group_change
Summary:
elm_layout_sizing_eval is a legacy function which should not need to be called
on new widgets

Reviewers: segfaultxavi, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9434
2019-07-30 13:12:52 -04:00
Carsten Haitzler a26c787e2b Revert "efl_ui_layout: set needs_size_calc flag at constructor"
This reverts commit 98b1924432.

This totally broke elm widget min size calcs, e dialogs... sizing is
totally broken and unusable as a result. this is a major break and
needs immediate reverting back to a working state. Sorry Woki. You
need to test this... elementary_Test out of the box is totally broken
as all hell not to mention a lot more.
2019-07-22 15:10:40 +01:00
Wonki Kim 98b1924432 efl_ui_layout: set needs_size_calc flag at constructor
Summary:
even if there is a min definition on theme for some object,
the objects don't have the min size if we do nothing after creating it.

elm_layout_sizing_eval will return with doing nothing while executing contructor
so that _sizing_eval in _layout_group_calculate will never be invoked without calling hint_set, text_set, content_set, etc.

this patch modifies a initial state of needs_size_calc flag
so that object will doing _sizing_eval after executing constructor.

Test Plan:
1. remove lines that call apis such as content_set, hint_set, text_set
  in radio test on elementary_test

2. observe that radios don't have min size

Reviewers: bu5hm4n, Hermet, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9368
2019-07-22 09:08:55 -04:00
Cedric BAIL c0e7b1343c elementary: Efl.Ui.Layout now rely on model change event to track the model.
This means that this will work nicely with model provider too.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9291
2019-07-17 21:57:52 +02:00
Mike Blumenkrantz 6e77c039a7 efl_ui/layout: only freeze internal layout during delete if it exists
Summary:
if the layout object does not exist here then there is nothing to freeze

@fix
Depends on D8980

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8981
2019-05-29 12:29:04 -04:00
Mike Blumenkrantz f4d13d3671 efl_ui/layout: do not trigger sizing eval on subobj delete if layout is dead
Summary: @fix

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8980
2019-05-29 12:29:04 -04:00
Mike Blumenkrantz 1986a30162 efl_ui/layout: do not trigger sizing eval on hint change if object is dead
Summary:
this fixes a huge number of errors during object deletion

@fix
Depends on D8979

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8987
2019-05-29 12:29:04 -04:00
Mike Blumenkrantz d09edd7242 elm/layout: do not trigger sizing eval at end of canvas_group_add
Summary:
this can never succeed as there will never be an object to successfully
size with at this point

@fix
Depends on D8954

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8955
2019-05-29 12:29:03 -04:00
Mike Blumenkrantz 75bdc620a1 elm/layout: do not trigger sizing eval on subobj deletion if no resize_obj set
Summary:
this has no effect since the resize_obj is what determines sizing

@fix
Depends on D8953

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8954
2019-05-29 12:29:03 -04:00
Xavi Artigas e9eb1c825a Rename Efl.Orient -> Efl.Gfx.Orientation
Summary:
And the Efl.Orientation interface -> Efl.Gfx.Orientable
(with proper c_prefix so it is not too cumbersome to use from C).
Also, turned the theme_rotation_apply() parameter into an int to avoid confusion.

Fixes T7919
Depends on D8912

Test Plan: Everything continues to build and pass tests

Reviewers: zmike, bu5hm4n, cedric, Hermet, Jaehyun_Cho

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7919

Differential Revision: https://phab.enlightenment.org/D8926
2019-05-20 11:52:10 -04:00
Marcel Hollerbach e9a7da0549 efl_ui_layout: only delete and unparent objects here when alive
something else might cause the object to get magically revived. Once the
object is invalidated, some things are able to set a parent again, which
causes the widget to continue with refcount 1 and a parent.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8637
2019-04-21 10:51:43 +02: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 1a5dde0b47 efl_ui_layout: ensure that resize_obj is present before emitting signals
otherwise there will be warnings because of calling api on NULL objects.

Differential Revision: https://phab.enlightenment.org/D8512
2019-03-29 14:02:36 +01:00
Cedric BAIL 2f4b581300 Revert "efl_ui_layout: call efl_del instead of efl_unref when text part does not exist"
This reverts commit cced5487c8.

This patch was pushed just to silence warning without fixing the problem and doing
something that was incorrect (coupling an efl_del with an efl_ref).

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8429
2019-03-27 15:03:14 -07:00
Cedric BAIL e05b8ae9ca elementary: only apply text when the object is not invalidated and dying.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8359
2019-03-27 15:03:12 -07:00
Taehyub Kim bb81ccdac1 efl_ui_layout: Eina_Error type has been modified to work correctly.
Summary:
fix Eina_Error type calculation in _efl_ui_layout_base_efl_ui_widget_theme_apply() to behave as before.

@fix

Test Plan: run elementary_test for all widgets

Reviewers: #reviewers, Jaehyun_Cho, Hermet

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8443
2019-03-22 12:38:44 +09:00
Yeongjong Lee cced5487c8 efl_ui_layout: call efl_del instead of efl_unref when text part does not exist
Summary:
Because `efl_isa` doesn't call _efl_object_call_end, the part object is not
removed. it occurs a bunch of efl_unref error message.

Test Plan:
1. elementary_test -to 'efl.ui.box'
2. exit window.
3. check there is no efl_unref error message.

Reviewers: zmike, cedric

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8385
2019-03-18 08:50:19 -04:00
Yeongjong Lee ba1c94d051 efl_ui_layout: fix elm_layout_text_set behavior
Summary:
Since commit 649433560b, elm_layout_text_set didn't work on some widgets.
This patch fixes invisible text issues.

Test Plan:
1. make check
2. elementary_test -to 'popup'

Reviewers: zmike, segfaultxavi, bu5hm4n

Reviewed By: zmike

Subscribers: cedric, #reviewers, herb, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8326
2019-03-14 11:11:32 -04:00
Jaehyun Cho 98ca79e8ce Revert "efl_ui_layout: check part existence in text_set"
This reverts commit 649433560b.

This patch is reverted because this patch breaks the backward
compatibility.
Please check Popup in elementary_test.
2019-03-13 19:27:03 +09: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 4e1c26d047 elementary: rely on Efl.Ui.Widget to do more of property binding for MVVM in Efl.Ui.Layout.
Reviewed-by: Vitor Sousa da Silva <vitorsousa@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D7943
2019-03-08 14:31:03 -08:00