Commit Graph

56 Commits

Author SHA1 Message Date
Mike Blumenkrantz 7767ce884a elm/check: fix emission of legacy "changed" callback
legacy "check" and "toggle" widgets operate differently:
* check emits only the "toggle" event
* toggle emits "toggle", "on", "off"

legacy also must not emit events when the widget's state is changed
programmatically

to handle this effectively, check whether the event has been emitted for
each state when the signal is emitted from the theme, and track this
for subsequent uses to ensure that exactly one event is triggered
when it should be

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9831
2019-09-18 18:18:55 +02:00
Marcel Hollerbach 9baa96c352 efl_ui_check: migrate from own property to Efl.Ui.Selectable
this is the basic work for getting radio group as a single_selection
interface, which can be a part of mutli_selection. Which will come both
later on.

ref T8057

Differential Revision: https://phab.enlightenment.org/D9504
2019-08-06 17:09:42 +02:00
WooHyun Jung 53649030db efl_ui_action_connector: rename clickable_util to action_connector
efl_ui_clickable_util was only for efl_input_clickable interface,
but there can be more cases which want to connect object event
to specific action interfaces (such as scrolling) in the future.
For that extension, efl_ui_action_connector seems better.

ref: T7847

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9486
2019-08-05 17:44:32 +02:00
Marcel Hollerbach 6d0f514126 efl_ui_check/radio: use clickable
Summary:
with this commit the state of the check / radio buttons are changes when
the Widget is clicked. The Widget is now using clickable and emits all
the events.

ref T7865

Reviewers: segfaultxavi, zmike, Jaehyun_Cho, woohyun

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7865

Differential Revision: https://phab.enlightenment.org/D9456
2019-07-31 09:12:07 -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 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
Subodh Kumar 8c90deecd7 [elm] Add missing sizing eval hook at check
Summary:
check is not shown in our Tizen demo.
sizing eval missing.

@fix

Test Plan: NA

Reviewers: zmike, Hermet, cedric, bu5hm4n

Subscribers: bu5hm4n, #reviewers, #committers

Tags: #efl

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9378
2019-07-23 10:06:04 +02:00
Marcel Hollerbach ebf39e9fd7 efl_ui_check/radio: restore legacy behaviour
from now on, the "changed" signal is only emitted on radio/check buttons when
the user interacted with this object. NOT due to the API change.
However, in the eo-api the event is emitted all the time, due to user
interaction, AND due to API interaction.

ref T8042
2019-07-03 12:22:17 -04:00
Mike Blumenkrantz 0e65d0c651 efl_ui: remove nstate widget
Summary:
this doesn't seem to serve a purpose anymore and there's no point in
keeping it in tree

fix T7866

Reviewers: woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T7866

Differential Revision: https://phab.enlightenment.org/D9176
2019-06-26 10:25:14 -04:00
Marcel Hollerbach 3a5f506b0e efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.

Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.

ref T7865

Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7865, T7867

Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 09:21:38 -04:00
Mike Blumenkrantz c83023565e efl_ui/check: check icon swallow existence before getting its content
Summary:
some check styles do not have this part

@fix
Depends on D8977

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8978
2019-05-29 12:29:04 -04:00
Mike Blumenkrantz e6cab273ee elm_check: 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/D8136
2019-03-06 13:03:12 -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 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 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
Cedric BAIL f484ca0951 edje: migrate Eo API to use Eo callback instead of opaque type.
Summary: Depends on D7869

Reviewers: zmike, q66, segfaultxavi, bu5hm4n

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7671

Differential Revision: https://phab.enlightenment.org/D7870
2019-02-06 13:48:43 -05: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
Marcel Hollerbach 9f758dc363 elm: update widgets that have documented focus and unfocused events
this emits focus and unfocus on those widgets.

fixes T7386

Depends on D7124

Differential Revision: https://phab.enlightenment.org/D7103
2018-11-15 13:55:37 +01:00
Woochanlee 7655a0d267 Clean up efl_ui_XXX eo files.
Summary:
Delete unnecessary interface references.

Delete unnecessary annotations.

Reviewers: Hermet, Jaehyun_Cho, zmike

Reviewed By: Hermet

Subscribers: segfaultxavi, q66, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6945
2018-09-04 09:37:01 +09:00
Marcel Hollerbach b2409153aa elm: refactor do not call efl_data_scope_get on a object without data
Summary:
A call to efl_data_Scope_get is actually quite dangerous,
efl_data_scope_get will return a pointer to a 0 sized segment in memory,
this is happening based on how the class data is organized. So in theory
you could use this pointer and accidently write to it. This resolves
this issue.

Reviewers: devilhorns, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6337
2018-06-20 12:24:06 -04:00
Hermet Park 95852ba504 Revert "elementary: fix wrong signal emission"
This reverts commit 1b245787fe.

This is a workaround patch, even occurs a regression bug that
breaks widget signal emission logic. (Happened in Enventor toolbar)

I reviewed this code seriously and found out
ui_layout sub object unset logic has been changed.
Obviously that breaks the elm compatibility.

When sub-object of layout is removed, it tries to remove sub-object from
the layout internal list. Problem is, some widgets sends internal signals
when sub-object is removed(i.e "icon,hidden") , but layout returns the
valid object even though sub-object unset is called prior to signal,
means, "icon,visible" not "icon,hidden" emitted.

This logic obvisouly changed from the previous efl version.
And we need to fix that logic first.

See _efl_ui_button_legacy_efl_ui_widget_widget_sub_object_del()
to check this issue.

1. button: sub_object_del()
2. layout: sub_object_del() => sub object must be removed.
3. button: signal emit() => for updating states
4. layout: content_get() => returns valid object?????! (Issue)
2018-06-19 12:54:15 +09:00
YeongJong Lee 1b245787fe elementary: fix wrong signal emission
Summary:
When _icon_signal_emit is called, "icon" part always exist. so, it only make
"visible" signal.
this fixes that issue

Test Plan:
elm_object_content_unset(button);
elm_object_content_unset(radio);
elm_object_content_unset(check);
elm_object_content_unset(progressbar);

Reviewers: Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6241
2018-06-04 17:48:06 +09:00
Cedric BAIL 8a513a522e efl: major rewrite of efl_part.
The interface efl_part_get should not be directly called from C, but the efl_part
wrapper should. It rely on efl_noref to properly destroy the object. Binding can
control the lifecycle of the reference the way they want by either calling the
wrapper or efl_part_get directly. It also means that the ugly ___efl_auto_unref_set
doesn't need to be exposed outside of EFL anymore.

Differential Revision: https://phab.enlightenment.org/D6098
2018-05-24 16:02:18 -07:00
Jaehyun Cho 08a11dcbf9 efl theme: Replace legacy signal names with efl ui signal names
Replace legacy signal/source names with efl ui signal/source names.
e.g. From "elm,state,content,set" "elm" to "efl,state,content,set" "efl"
2018-04-26 22:45:59 +09: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
YeongJong Lee 736de05ea7 efl.ui.check: change signal name for icon/text
Summary: see also 73f8b3b78f

Test Plan:
1. elementary_test -to check
2. check that icon is visible

Reviewers: cedric, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5816
2018-02-26 20:28:56 +09:00
WooHyun Jung d679425c48 efl_ui_nstate: make "changed" callback is called properly
- "changed" callback is not called when theme_apply is called
- elm_check_state_set does not call "changed" callback to keep
  backward compatibility
2018-02-13 22:50:14 +09:00
WooHyun Jung 23877f2c44 Revert "Efl.Ui.Nstate: do not call "changed" callback"
This reverts commit fd8e9f9c4e.
2018-02-13 18:39:20 +09:00
Shinwoo Kim fd8e9f9c4e Efl.Ui.Nstate: do not call "changed" callback
Before solving following problem in Efl.Ui.Check

https://phab.enlightenment.org/T6673

The changed callback is called with opposite value,
if application is using Efl.Ui.Check with state pointer.

The reason is that the changed callback is called in
efl_ui_nstate_activate, and the value refered by state pointer
is changed only after the efl_ui_nstate_activate is called.

static void
_activate(Evas_Object *obj)
{
   EFL_UI_CHECK_DATA_GET(obj, sd);

   efl_ui_nstate_activate(obj);
   if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);
2018-02-07 16:25:36 +09:00
Sungtaek Hong 596c88f899 Efl.Ui.Check: fix changed callback is called twice
Summary:
Efl.Ui.Check inherits Efl.i.Nstate which also calls changed callback.

fixes T6639

Test Plan: run elementary_test->check->click 'icon not resizable'

Reviewers: woohyun, cedric, jpeg, singh.amitesh

Reviewed By: singh.amitesh

Maniphest Tasks: T6639

Differential Revision: https://phab.enlightenment.org/D5768
2018-01-29 22:54:23 +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 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
Sungtaek Hong fc8cc4a9b3 efl_ui_widget: find theme just once in layout inherited widget
When a widget inherits layout in tries to set theme in group_add or in
constructor. When another widget inherits the previous widget, it sets
layout again with new klass name. This sets klass in the widget and
sets layout in super class, so that it can set layout only once.

Test Plan: Run efl_ui_widget related elementary test.

Reviewers: jpeg, cedric, woohyun, singh.amitesh

Differential Revision: https://phab.enlightenment.org/D5473
2017-12-08 16:02:22 +09:00
Amitesh Singh 7b3fde4d4b edje: rename intf Efl.Canvas.Layout.Signal to Efl.Layout.Signal 2017-12-05 16:18:32 +09:00
Jean-Philippe Andre e9ebe5c676 elm: Define and rename internal atspi struct in EO
This thing is used by only 2 EO APIs that are marked as @beta. I wonder
if the @beta tag or the ptr() expression made it work for eolian,
because it simply wasn't defined in EO.

I'm renaming it just so that it's more consistent with the new names
used by atspi (and EO API in general).
2017-11-16 12:00:18 +09:00
Lukasz Stanislawski c838e30a24 elm: Rename elm_interface_atspi_widget_action mixin
Reviewers: jpeg

Subscribers: jenkins, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5400
2017-11-16 12:00:18 +09:00
Jean-Philippe Andre d39bbc1491 elm: Create legacy widgets with elm_legacy_add
This will be used to solve issues around style_set:
if the widget is legacy or pure eo we may need to select a different
style. So in the constructor we need to know whether we are legacy or
eo. Note that calling style_set in finalize only is too late as we would
lose information such as efl_text_set() called inside efl_add().
2017-11-07 14:50:31 +09:00
Sungtaek Hong 5f7710f561 efl_ui_radio: remove some legacy code
Summary:
This uses constructor/destructor instead of group_add/group_del.

Note: finalize can't be used for theme loading as any action done
inside
efl_add(...) would be lost (eg. part text set).

Test Plan: 1) run elementary_test -to radio

Reviewers: jpeg, woohyun, cedric

Subscribers: akanad

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-11-01 10:34:45 -07:00
Jean-Philippe Andre 2f465e1fbb widget: Rename EO APIs to efl_ui_widget_xxx
This only changes the eo_prefix for APIs.

Ref T5363
2017-10-24 14:30:21 +09:00
Jean-Philippe Andre 1e83dd84c6 nstate: Remove some legacy code
This uses constructor/destructor instead of group_add/group_del.

Note: finalize can't be used for theme loading as any action done inside
efl_add(...) would be lost (eg. part text set).
2017-10-24 11:57:27 +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
Jean-Philippe Andre c9c9e6a209 elm: Rename Elm.Activate to Efl.Ui.Activate
Note: This is an EO-only beta API.

Ref T5329
2017-10-17 17:31:38 +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 0e98f57d6d widget: Rename hook "activate" (EO)
This is for accessibility only. Protected function.

Also marked as beta as elm_access isn't going to be stable in EO (yet).

Ref T5363
2017-08-29 10:40:53 +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 20a5968c12 elm: Use a macro to handle key bindings
This factorizes the code and makes most widgets handle key down events
in the same way:
 - check that the object is not disabled, event is not on hold
 - figure out the key binding based on the class name
 - mark event as on hold

The class name is usually MY_CLASS_NAME but in some cases it was
MY_CLASS_NAME_LEGACY which may be different from the EO class name (eg.
elm_win vs. Efl.Ui.Win). In that case the key bindings are broken.

This breaks key bindings for the following widgets:
 - Win (focus)
 - Image ("clicked")
 - Video (move, play)

This fixes key bindings for the following widgets:
 - Nstate

Some widgets remain broken:
 - Photocam / Efl.Ui.Image.Zoomable

A patch will be applied to restore the key bindings for the above
breaks.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 069747b9de widget: Add eo event info inside widget_event
This is an internal function that should probably become an overridable
protected method, as it's required for proper event handling in widgets.
Next step: use eo_event_info in the widgets implementations. Then remove
legacy event struct.

Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre dee61f4097 elm: Cleanup theme and style set functions
This makes efl_ui_layout_theme_set() return a Theme_Apply error
code. The type is now public as Efl.Ui.Theme.Apply.

Ref T5329
Ref T5363
2017-08-09 17:08:24 +09:00