Commit Graph

171 Commits

Author SHA1 Message Date
Elyes HAOUAS 3e7f317313 Fix typos
Fix some typos

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D12015
2020-06-25 09:03:05 +02:00
Elyes HAOUAS 17151e2eb8 Get rid of trailing whitespaces (10 / 14)
Remove trailing whitespaces
Differential Revision: https://phab.enlightenment.org/D12009
2020-06-23 10:30:36 +02:00
Marcel Hollerbach 721c097bb3 efl_ui_widget: addition to the previous commit
in the previous commit we started to only receive the parent_obj from
the evas object when its not a widget. However, we still need to ensure
that the parent is equal to the current one in order to remove it when a
widget.

While this is one more call, the call to get the parent is not as
heavy as the data_get call, as this directly addresses a struct, and
does not read from a hash table.

This also fixes a test case failure.
2020-06-17 09:13:05 +02:00
Subhransu Mohanty 18b0abf62f elementary/perf: reduce number of efl_isa() call. in elementary test application efl_isa() shows up as hotsport during profiling so refactored the code to reduce redundant efl_isa() calls.
in genlist testcase the number of calls reduced by 30000.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Hermet Park <<hermetpark@gmail.com>>
Reviewed-by: Youngbok Shin <youngb.shin@samsung.com>
Differential Revision: https://phab.enlightenment.org/D11984
2020-06-17 08:56:14 +02:00
Subhransu Mohanty 95eb621c15 elementary/perf:remove unnecessary elm_widget_is() check
As we always make sure the parent is a widget class we don't have to check anymore.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Reviewed-by: Hermet Park <<hermetpark@gmail.com>>
Differential Revision: https://phab.enlightenment.org/D11985
2020-06-17 08:56:11 +02:00
Mike Blumenkrantz 823b7b05cd elm: resolve float comparison warnings
Summary: Depends on D11790

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11791
2020-05-09 09:25:21 +01:00
Marcel Hollerbach 59ee633dc0 efl_ui_widget: pass the correct flag here
this here needs to pass the flag that gets set, not the flag that
results. This is important for the cases, where a subtree in a widget
tree keeps the flag. As this would leave the wrong counter.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11556
2020-03-23 20:02:50 +01:00
Marcel Hollerbach e5cec5dacc efl_ui_widget: unify tree number settings code
Summary:
the internals of those two methods have been the same. Both setted the
internal numeric flag as either as 1 more or equal to the flag in the
parent object (depending on the internal state). Further details can be
found in the comment in code.
Depends on D11554

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11555
2020-03-23 12:12:25 -04:00
Marcel Hollerbach c3cc96d0f8 efl_ui_widget: do not eval all the children twice
Summary:
eval all children is ending up in the complete discovery of the whole
subtree, which is unnessesary here, as we are already discovering the
whole subtree with the calls, these changes are in, so simple
evalulating this is enough.
Depends on D11551

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11554
2020-03-23 12:12:19 -04:00
Marcel Hollerbach 151862f50c efl_ui_widget: fix disabled set behaviour
Summary:
this fixes disabled set behaviour. This ensures that when setting
disabled twice, that unsetting it once does not break the overall state.

This never appeared in any real life example, because
elm_object_disabled_set is already checking for equalness. However, this
is not wanted here, because the simple setter can also be used to sync
the state with the parent, which appears to be helpfull.

Depends on D11550

Reviewers: zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11551
2020-03-23 12:12:12 -04:00
Marcel Hollerbach 8e0a7cedc1 efl_ui_widget: fix tree_unfocusable setting
Summary:
when setting twice the same value, unsetting the same value would not
restore the same state in the tree again. With this commit, we ensure
this is working correctly.

Reviewers: zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11550
2020-03-23 12:12:06 -04:00
Hosang Kim 5b8dc56100 win/widget: free array when object is deleted.
It makes a memory leak.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11522
2020-03-17 09:38:16 +01:00
Marcel Hollerbach 654b05b76f edje_part: move part_type to common interface
In EFL we have multiple hirachies of parts. One in Efl.Layout namespace
(alias edje) and one in Efl.Ui namespace. The seperation of these two
makes sense from the perspective of hiding functionality. However, a
functionality that we want to have on both is: we want to be able to
check which type of part this is. In order to do so, this commit
introduces a common interface, which allows that.

This is required because eo is currently undergoing some works, where
only APIs on a object are allowed, that are also inheriting its type,
which is normal in OOP, but sometimes, due to the lack of limitation, we
did that. This commit resolves one more case of that.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11516
2020-03-17 09:38:10 +01:00
Mike Blumenkrantz 92a03628c8 efl_ui/widget: add inheritance for efl.gfx.entity to widget part
most of these are empty

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11448
2020-03-06 13:30:43 +01:00
Marcel Hollerbach 090c351d38 elementary: use array instead of list for subchildren
this safes in the runtime of elm_test round about 9kb (*).
Additionally, using a array here is jumping way fewer times arround in
memory, as we do not need to jump from node to node in a list.

Additionally, this commit replaces a few abort disabler macros with a
error checking macro. (which cleans the log).

*: explanation: we have round about 600 widgets in elm_test, every
widget is normally refered once, every list node has 4 pointer, makes
round about 9600 bytes or rougly 9 KB. So the messured savings are more
or less explaining the reality.

Reviewed-by: Carsten Haitzler (Rasterman) <rasterman.com>
Differential Revision: https://phab.enlightenment.org/D11374
2020-02-19 16:28:11 +01:00
Cedric BAIL ae8b912328 elementary: do not use list<> in Efl.Ui.Focus_Manager.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11051
2020-01-29 09:51:40 +01:00
Carsten Haitzler f2b88560a0 elm - widget - actually check object smart data return for no data
so sometimes widgets dont have smart data - some situtions happen...
but let's not segfault. instead we now see the usual eina log eerrs
and things march on... and no segv.

@fix
2020-01-04 20:58:16 +00:00
Marcel Hollerbach 7d1463124a efl_ui_widget: do not execute up handler when on destruction
otherwise we would cause an error.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10846
2019-12-13 09:33:05 -08:00
Wonki Kim 2c515628d3 focus: modify a formula to calculate focus region to show
if there was a spacer around elm.swallow.content of scroller,
position of pan object would be different with position of the scroller obj.

this patch modifies a fomular that calculates some points relative to scroller
to a fomular that calculates the points relative to pan obj.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10745
2019-12-06 15:35:50 +01:00
Xavi Artigas b04a7ed4f4 code comments: annoying typos 2019-12-04 18:22:25 +01:00
Cedric Bail 7dc98ab3d0 evas: move efl_input_device into evas/Efl_Canvas.h
Summary:
The internal and the API we would like is mostly a canvas API. A lot of the code
in evas is working around the fact that efl_input_device is not defined inside Evas.
This patch is the first step to try to clean this up.

Depends on D10487

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10488
2019-10-31 13:29:56 -04:00
Mike Blumenkrantz 37e258904d elm/widget: error on null params for tree_unfocusable functions
Summary: these should error so the user can detect that they screwed up

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10563
2019-10-30 09:29:56 -04:00
Cedric BAIL 2e1317baed elementary: introduce Efl.Ui.CollectionView a generic listing View.
The idea of this widget is to provide to MVVM what Efl.Ui.Collection provide and
leverage the same shared logic for layout.

Co-authored-by: Mike Blumenkrantz <zmike@samsung.com>
Co-authored-by: Marcel Hollerbach <mail@marcel-hollerbach.de>

Differential Revision: https://phab.enlightenment.org/D9958
2019-09-24 11:12:43 -07:00
WooHyun Jung f7e183b851 efl_ui_scrollable: remove ui_scrollable_interactive and move all into ui_scrollable
Summary:
Based on the discussion T7883, there is no reason to keep those
interfaces separately. So, now, efl_ui_scrollable will support
the events and methods together.

@ref T7883

Reviewers: eagleeye, bu5hm4n, zmike, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7883

Differential Revision: https://phab.enlightenment.org/D10072
2019-09-23 11:02:15 +02:00
Marcel Hollerbach 0d7535071c elementary: make our tests work again
7321911468 moved the constructor to to
top, which leads to the fact that a few widgets cannot fetch the shared
data of the window. Which made the test suite fail.

With this commit we are just moving the sub_object_add after the
constructor, which fixes the flip crash.
This fixes the test suite
2019-09-21 15:04:42 +02:00
Carsten Haitzler 7321911468 efl ui widget - call parent constructor before doing more init
the object is not properly set up yet for child classes -0 parent like
the main evas object or smart obj havent been constructed yet so call
this really early, not in the middle of construction of an efl ui
widget...

this fixes a segv in elementary_test -to filp where it segv's on
object construction where evas object ->cur/prev are NULL (not set up
yet).
2019-09-21 10:26:46 +01:00
Marcel Hollerbach ccdec4ba68 efl_ui_widget_part: implement all the missing API
Efl.Color and Efl.File cannot be done due to composition. Efl.Gfx.Image
can, so we can solve this via composition, this also resolves all the
other cases for Efl.Gfx.Image.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9991
2019-09-19 14:37:29 -07:00
Xavi Artigas 944d5f37c7 efl/image: Efl.Gfx.Image_Scale_Type -> Efl.Gfx.Image_Scale_Method
ref T7927, T7875
Depends on D9931
2019-09-16 11:06:02 +02:00
Marcel Hollerbach 63fd44ef16 efl_ui_widget: refactor constructor
Summary:
first of all, in efl-ui we should probebly ensure that a widget is
always created in a window object. Otherwise we are looking for trouble.

Additionally, calling efl_ui_win_shared_data_get on anything else than a
window object will result in a returned NULL value.
If we are not having a widget parent, there is also not much point in
calling a API that is only defined on the widget base class, so we also
move that away

Reviewers: kimcinoo, raster

Reviewed By: kimcinoo

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9762
2019-09-11 10:43:08 +09:00
Yeongjong Lee 37a63fb1ee efl_ui_widget: make Efl_Ui_Scrollable_On_Show_Region legacy
Summary:
`Efl_Ui_Scrollable_On_Show_Region` is only used for legacy EAPI. it moved to
elm_widget.h from eo file. also, it renamed `Elm_Widget_On_Show_Region_Cb`.

Reviewers: Jaehyun_Cho, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9896
2019-09-10 09:16:48 -04:00
Mike Blumenkrantz 121a437c4d api: remove Efl.Ui.Scroll_Block
Summary:
this now uses layout orient enum everywhere

fix T7921

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7921

Differential Revision: https://phab.enlightenment.org/D9804
2019-09-03 09:15: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
Shinwoo Kim cfc0d4866c efl_ui_widget: keep backward compatibility
It was possilbe to add an image with improper parent object before aa2d94f and
56752e0. This patch makes it possible. Sure there are error messages when user
adds an image object using non widget object as below but you can see image.

ERR<28822>:elementary ../src/lib/elementary/efl_ui_widget.c:4801 _efl_ui_widget_efl_object_constructor() You passed a wrong parent parameter (0x400000007ced (null)). Elementary widget's parent should be an elementary widget.
ERR<28822>:elementary ../src/lib/elementary/efl_ui_widget.c:4803 _efl_ui_widget_efl_object_constructor() No widget data for object 0x400000007ced ((null))
ERR<28822>:eina_safety ../src/lib/elementary/efl_ui_win.c:9450 efl_ui_win_shared_data_get() safety check failed: pd == NULL
ERR<28822>:eo ../src/lib/eo/eo.c:579 _efl_object_call_resolve() in src/lib/elementary/efl_ui_widget.eo.c:256: func 'efl_ui_widget_sub_object_add' (698) could not be resolved for class 'Evas.Canvas'.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9747
2019-08-27 15:02:32 +02:00
Yeongjong Lee e8a32d72c6 efl_ui_widget: correct the comparison parameter in scroll_freeze_pop
Summary:
It is copy/paste error.
See also, e7986cc646

Reviewers: bu5hm4n, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9695
2019-08-22 07:17:03 -04:00
Carsten Haitzler be6555e754 fix e did again after crash from dnd fix 2019-08-22 00:47:10 +01:00
Carsten Haitzler aa21bd3c60 elm - efl ui - dont crash if parent is not an elm widget 2019-08-22 00:22:39 +01:00
Marcel Hollerbach b8bf5b31e8 efl_ui_widget: fix model listenting logic
if we are walking this method twice (spoiler we do!) then we subscribe
twice to the event, which leads (depending on the order of executed
deletion) to the accessing of obj after its deleted.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9684
2019-08-21 10:46:37 -07:00
Marcel Hollerbach 4cede693a5 efl_ui_widget: remove self reference
as an example: elm_test uses roughly 500 widgets, this pointer takes 8
bytes, this is wasting quite some time, which can be perfectly safed by
just structuring the code a little bit more. In some callbacks we need
to call one more time efl_data_scope_get but that is not a that big
issue, as most calls after that are also doing a eo call on that object,
so the eo_id is already cached.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9683
2019-08-21 10:46:34 -07:00
Yeongjong Lee bb62f71fe2 efl_ui_widget: ensure that tree_unfocusable is binary number in its getter
since 2dd596084b, tree_unfocusable is changed from
Eina_Bool to int.
Double negation ensure binary return value of `elm_widget_tree_unfocusable_get`

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9673
2019-08-21 14:20:33 +02:00
Marcel Hollerbach b5f458f5b8 efl_ui_widget: fixup field counting
this has to use tree_unfocusable not disabled.

ref D9644

Reviewed-by: YeongJong Lee <yj34.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D9671
2019-08-21 11:59:15 +02:00
Yeongjong Lee e7986cc646 efl_ui_widget: correct the comparison parameter in scroll_freeze_push
I guess it is copy/paste error.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9669
2019-08-21 11:59:12 +02:00
Yeongjong Lee 5f4c9a4458 efl_ui_widget: fix dereference null return value issues
Dereference null return value issues is reported by Coverity.

If `sd` is NULL, it will return zero values.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9668
2019-08-21 09:47:19 +02: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
Marcel Hollerbach 56752e0b3b efl_ui_widget: do not walk parent chain for none legacy cases
walking here the parent chain can be very costly, esp. if you make a lot
of widgets visible or hide them. With this commit we ensure that we only
walk the parent chain when there is a custom chain, which is only the
case in legacy. This gets us about 2-3 FPS on the rpi with the
item_container benchmark.

With earlier commits, tree_unfocusable and disabled is honoring the
whole parent chain, so checking that alone, without the parent chain, is
fine.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9645
2019-08-20 12:30:05 -07:00
Marcel Hollerbach 2dd596084b efl_ui_widget: make treeunfocusable state easier
Before this patch tree unfocusable set just set a simple flag, getting
this state however forced you to traverse the whole parent chain to get
the real result.
With this patch the setting of the unfocusable flag is heavier as it
walks all the children of the widget, however, the getting of the flag
is way easier now. The next revision will refactor the focus related
APIs for that.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9644
2019-08-20 12:30:03 -07:00
Marcel Hollerbach b4b17993d5 efl_ui_widget: skip custom focus parent logic
asking for a parent provider only makes sense if we are having a custom
focus parent provider, otherwise this will just result in the normal
parent relation. Not doing this safes us a lot of time that we spent for
nothing in the focus evalulation code.

The gengrid change is needed as the parent provider should be applied
after the constructor is called, otherwise there is no garantee that
shared_win_data is not NULL.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9643
2019-08-20 12:30:00 -07:00
Marcel Hollerbach aa2d94f901 efl_ui_widget: add a place to share data
this introduces a shared place to all widgets. The shared pointer is
allocated in the window, as the window outlifes every widget that is
part of it.

This struct will be later used for further optimizations like:

1. There are really heavy focus operations which are only needed for
gengrid/genlst, there is no point in executing them if there is no
gen**** added to the window object. So we can skip the custom
parent_provider logic that is only introduced for gengrid / genlist.

2. Legacy focus APIs must do list walks, which means, on every focus
operation we always have to walk the full list up to the parent, which
is annoying and slow, as we *most of the time* do not use legacy focus
API.

This list can be continued, the above two cases are fixed in the next
revisions.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9642
2019-08-20 12:29:58 -07:00
Marcel Hollerbach ead8a28057 efl_ui_widget: optimize size / position setting
calling geometry set here is again calling the API in canvas object that
splits this call to size_set and position_set which means we spent quite
a bit of time in eo, just to call the same APIs we could call directly.
With this commit here, the calls are directly going to the right
objects, with the right API.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9619
2019-08-20 07:42:43 +02:00
Cedric BAIL a5a7c67bdf elementary: add support for efl_ui_property_bind to all efl_part inheriting from widget using reflection.
Reviewed-by: Felipe Magno de Almeida <felipe@expertisesolutions.com.br>
Differential Revision: https://phab.enlightenment.org/D9528
2019-08-12 10:13:35 -07: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