Commit Graph

107 Commits

Author SHA1 Message Date
Vincent Torri cfbdcdc9c8 Use extern after EAPI
Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D11961
2020-06-10 10:07:57 +02: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
Daniel Kolesa 553ce69bad efl: remove remaining instances of .eo global variables 2019-09-24 18:27:37 +02:00
Mike Blumenkrantz 2251865a30 elm/widget: make this header usable without elm_priv.h again
supposedly this header should be usable if someone wants to create an
elm widget, so ensure that it can be included without issues

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Differential Revision: https://phab.enlightenment.org/D9976
2019-09-18 18:04:52 +02: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
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
Marcel Hollerbach c323a99037 efl_ui_widget: remove unused field
its not used ...

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9647
2019-08-20 12:30:09 -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
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 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
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 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 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
Christopher Michael 05c9aff90a elementary: Use efl_data_scope_safe_get when trying to get widget data
As per bu5hm4n, these macros should be using efl_data_scope_safe_get
when trying to get widget data
2019-03-18 15:19:21 -04:00
Christopher Michael 28400e3260 elementary: Add ELM_WIDGET_DATA_GET macro
There are cases, such as 2abe5ad9bc where we do not
always want to return if we fail to get the elm widget data (as we may
have to cleanup leaks, etc). As such, add a macro we can call which
will just try to fetch the elm_widget data.
2019-03-18 15:14:54 -04: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 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 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
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
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
Mike Blumenkrantz b3327c761e efl_ui_widget: move orientation to the specific users of this widget
The new api is moved into either Efl.Ui.Win or Efl.Ui.Layout.
Only Efl.Ui.Layout is interested in the rotation, as this is the only
widget that can actaully apply it to the theme. The value itself however
is unique to the window, which means, the window is the only point where
the rotation is stored, and this is the point, where rotation changes
are brought to the layouts.

ref T7553

Depends on D8014

Differential Revision: https://phab.enlightenment.org/D8015
2019-02-27 20:19:07 +01:00
Marcel Hollerbach 5235f1da85 efl_ui_widget: remove focused_item
focused_item is only used in item containers. This API is now moved into
a widget item container, which *can* have a focused item.

ref T7553

Reviewed-by: WooHyun Jung <woohyun0705@gmail.com>
Differential Revision: https://phab.enlightenment.org/D8013
2019-02-25 10:37:44 +01:00
Marcel Hollerbach 7031a8cd7e elm_widget: remove defines that are not implemented
Summary:
they are not implemented - so using them would not work, to me it looks
like they can be dropped.

Reviewers: cedric, raster, stefan_schmidt, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7455
2018-12-20 19:55:20 +09:00
Jaehyun Cho 4f9c8d524c efl_ui_theme: Introduce Efl.Ui.Theme class
Summary:
Efl.Ui.Theme class is required to support language bindings.
Efl.Ui.Theme works based on current elm_theme features.

This patch fixes T7357.

Reviewers: segfaultxavi, cedric, lauromoura, woohyun, zmike, SanghyeonLee

Reviewed By: segfaultxavi, SanghyeonLee

Subscribers: SanghyeonLee, herdsman, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7357

Differential Revision: https://phab.enlightenment.org/D7244
2018-11-20 13:56:37 +09:00
Cedric BAIL 0fe3b7962d elementary: due to lifecycle difference between legacy object and unified object, we need to track their lifecycle more explicitely.
It is my understanding that some items view are created with efl_add directly
and manipulate VIEW directly with Eo new API. This clash with the inconsistent
behavior that evas_object_del expect. To work around this, we track object life
by explictely relying on efl_wref_add while holding the pointer to the object.
2018-05-24 16:02:19 -07:00
Marcel Hollerbach e3049e4a16 efl_ui_widget: do not register if the child is missing in a custom chain 2018-04-30 19:24:47 +02:00
Marcel Hollerbach fdfcae968b elm_widget: Introduce elm_focus_legacy
Code located here is meant for a legacy tree and legacy widgets.
This is checked on the entry of the function
2018-04-30 19:24:47 +02: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
Cedric Bail 08c9f99134 elementary: make sure windows are not born orfan and properly have at least a main loop as parent. 2018-03-19 15:39:14 -07:00
Mike Blumenkrantz 8fc6aa5467 elm_widget: provide base implementation of style property 2018-02-15 13:11:01 -05:00
Shinwoo Kim 8aaa350262 Use ERR instead of CRI if *DATA_GET* returns NULL
This patch set is for remains.
2018-02-01 14:20:57 +09:00
Sungtaek Hong cb25699dac efl_ui_legacy: add new interface to indicate legacy widget
Summary:
For now, how to check whether a widget is legacy or not
is to check flags in private data or static flag, which is set
during elm_legacy_add.
If Efl.Ui.Legacy interface is added, it can be easilly checked
by efl_isa(obj, EFL_UI_LEGACY_INTERFACE)

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5748
2018-01-24 18:14:26 +09:00
Jean-Philippe Andre f312ed6db9 widget: Rename orientation_mode_disabled
Name is stupid and long, why not just invert this bool?
2018-01-18 17:25:15 +09:00
Yeongjong Lee 210db8fc5d efl_ui_focus: merge efl_ui_focus_user and efl_ui_focus_object into one mixin
Summary:
focus_user and focus_object are similar classes. by merging them into
one mixin, we can maintain consistency.

Test Plan: make check

Reviewers: bu5hm4n

Subscribers: cedric, Jaehyun_Cho, woohyun, jpeg

Differential Revision: https://phab.enlightenment.org/D5734
2018-01-16 22:39:13 +01:00
Jean-Philippe Andre a92186be6a ecore/edje/elm: Fix a few WRN from calls to NULL
This fixes some of the warnings generated by calling functions on NULL
objects. One of the main remaining points is to avoid unwanted warnings
on non-existing parts.

Ref T6326
2018-01-16 18:37:05 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Jean-Philippe Andre a13e61a37b elm: Add "shadow" part to all widgets
This makes it possible to very easily create drop shadows and glow
effects on any widget. This is absolutely not optimized, though the main
performance bottleneck is that the proxy images get redrawn after just
moving.

@feature
2017-12-14 18:03:49 +09:00
Jean-Philippe Andre 116f24fd78 elm: Rename struct to Efl.Ui.Widget.Focus_State
Ref T5363
2017-12-12 12:01:46 +09:00
Sungtaek Hong cff9b1b11a efl_ui_widget: add new internal EAPI for new group name
theme_klass: set/get klass name used for resize_obj
theme_element: set/get group name used for resize_obj
theme_style: set/get style name used for resize_obj
element_update: automatically sets and apply theme for
             sub object of widget.
2017-12-08 15:57:25 +09:00
Amitesh Singh 29b47e0a07 focus: remove focus.get{} from widget.eo
This is taking care by focus manager now.
2017-11-29 19:25:14 +09:00
Jean-Philippe Andre 8608e8dc70 part bg: Fix up some unnecessary complexity
See previous commit :)

Note: right now the background part has a small 3d indent which comes
from the legacy theme being used. This will be fixed soon.
2017-11-24 16:12:31 +09:00
Sungtaek Hong 3c47a4f9f9 efl_ui_layout: create efl_ui_bg when efl_part for background is called.
Reviewers: woohyun, jpeg, cedric

Subscribers: felipealmeida, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5151
2017-11-24 16:00:22 +09:00
Jean-Philippe Andre b798005e80 elm: Add hack to make test case work
Because of the way elm_code test case is written, by directly including
the C file, we end up with two symbols for the internal _elm_legacy_add
flag. This makes some test case fail (after applying a pending patch).

Solution found by Sungtaek Hong.

elm_code test case needs to be fixed. Don't include the C files
directly, testing static inlines should be done through a common .x or
something, but not by including the C file itself. This has led and will
lead to many issues.
2017-11-23 15:45:49 +09:00
Cedric Bail 6ae1c3239e elementary: elm_widget actually rely on elm_object_item. 2017-11-14 20:12:36 -08:00
Jean-Philippe Andre 80b0ef7537 elm: Fix make check (code_widget)
elm_code_widget is causing a lot of trouble as it's relying on internal
access to elementary, without being built as part of elementary.so. Many
EAPI symbols are exported that shouldn't need to be, as they are only
internals of elm.
2017-11-07 14:59:01 +09:00