Commit Graph

89 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
WooHyun Jung 77e268e6ab efl_input_clickable: rename efl_ui_clickable to efl_input_clickable
Summary:
Renamed all efl_ui_clickable_XXX to efl_input_clickable_XXX based on
the discussion in T7847

ref T7847 T7976

Reviewers: zmike, bu5hm4n, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7976, T7847

Differential Revision: https://phab.enlightenment.org/D9427
2019-07-29 11:43:01 +02:00
Marcel Hollerbach 41e1dadbf1 elementary: do not emit new events in legacy
Summary:
This commits prepares the tree in order to mess with the events in the
Efl.Ui.Clickable event. Events which have been emitted in a none legacy
widget, are now emitted either with evas, when the widget is legacy due
to inheritance. Or via the normal event and normal event functions.

In case the widget is a legacy only widget (not used at all in the new
api), then the events are for now emitted with
evas_object_smart_callback_call.

Cases where event handlers have been added to legacy widgets, smart
events are now used, and not the eo one anymore.

ref T7844

Depends on D8813

Reviewers: cedric, zmike, segfaultxavi

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7844

Differential Revision: https://phab.enlightenment.org/D8816
2019-05-13 15:14:13 -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
Mike Blumenkrantz b7e92a49fe elm_multibuttonentry*: 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/D8185
2019-03-07 14:15:50 -08:00
Mike Blumenkrantz a8057a3403 elm_entry: 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/D8166
2019-03-07 14:15: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 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 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
Mike Blumenkrantz f886941b11 api: efl.gfx.size_hints -> efl.gfx.hints
Summary:
these hints are not strictly size-related, so renaming them is more consistent
with their actual function

ref T7563

Depends on D7968

Reviewers: segfaultxavi, cedric, bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7563

Differential Revision: https://phab.enlightenment.org/D7977
2019-02-21 18:43:12 +01:00
Cedric BAIL 88dbd866e0 elementary: rename Efl.Ui.Translatable -> Efl.Ui.L10n
If we are to choose Efl.Ui.I18n for the internationalization support, the localization API
should be named accordingly L10n.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7507
2019-01-02 11:03:53 -08:00
Chris Michael e8298d8d44 elementary: Reduce EO calls by using geometry_set
This patch reduces EO calls by using evas_object_geometry_set rather
than calling move & resize.
2018-11-21 11:25:58 -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
Marcel Hollerbach 17b57ba5ac efl_ui_focus_manager: rename a event
In eo there is a difference between legacy events and normal events.
However, when a legacy event, that is called "focused" is emitted, the
event EFL_UI_FOCUS_MANAGER_FOCUSED is emitted on those objects. This
leads to bugs and unexpected results in elm_scroller, and additionally
this problem blocks work that is done right now to add those "focused"
event calls to gengrid.

Differential Revision: https://phab.enlightenment.org/D7099
2018-11-02 02:22:13 +01:00
Chris Michael f7064f9500 elc_multibuttonentry: Wrap calls to edje_object_part_object_get with
Summary:
freeze/thaw

@ref T6884

Depends on D6412

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6413
2018-06-25 11:36:51 -04:00
Mike Blumenkrantz 3c094d8146 theme: fix part namespacing in multibuttonentry theme
Summary:
this was released with improperly namespaced parts which must be maintained
for future releases, but the namespacing can be corrected for future
releases while adding aliasing to preserve compatibility
Depends on D6208

Reviewers: cedric

Reviewed By: cedric

Subscribers: #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6210
2018-06-19 13:27:50 -04:00
Cedric Bail f44511d0f9 elementary: refactor by using elm_legacy_add. 2018-05-24 16:02:19 -07: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
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
YeongJong Lee 495edbd995 elm: fix backward compatibility for "default" name part
Summary:
If you use legacy content/text set/get/unset with "default" part name,
_elm_layout_part_aliasing_eval change the part name to "elm.swallow.content".
Because internal _content_set/get/unset checked only "default" string,
legacy content/test set/get/unset with "default" part name was not working.
This patch fixes that bug.

Test Plan: elm_object_part_content/text_set(obj, "default", content)

Reviewers: Jaehyun_Cho, woohyun

Reviewed By: Jaehyun_Cho

Subscribers: cedric, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6185
2018-05-23 19:35:18 +09:00
Xavi Artigas 55bd097a3d Efl.Gfx.Entity (from Efl.Gfx)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:32 -07: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
Jaehyun Cho 0bebd097b5 elc_multibuttonentry: Fix to make multibuttonentry to be legacy only
To make multibuttonentry to be legacy only, inappropriate efl ui
interface usages are removed in multibuttonentry.
2018-04-20 14:07:35 +09:00
Woochan Lee 939690a8a9 Revert Efl.Ui.Multibuttonentry to create new one.
Summary:
Revert e02b2f04c2945ad60fab5612af1e02b0838b7ff5.

I couldnt make a revert commit for many commit has been related with above commit.

I will create a new MBE eo class ASAP. (https://phab.enlightenment.org/T5358)

Reviewers: cedric, woohyun, Jaehyun_Cho, SanghyeonLee, herb

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5954
2018-04-19 22:22:01 +09:00
Woochan Lee 6c3bc915df elm: rename elm_multibuttonentry to Efl.Ui.Multibuttonentry
Summary: @ref T5358

Reviewers: woohyun, jpeg, cedric, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: Jaehyun, bu5hm4n, cedric, jpeg

Maniphest Tasks: T5358

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

JP's note:
MBE currently has quite a few issues, probably related to focus
handling. This needs to be fixed.
2017-10-24 16:20:09 +09:00
Jean-Philippe Andre 1b481f0ae8 widget: Rename events to EFL_UI_WIDGET_EVENT_XXX
This only affects the events (and the data type has an alias).

Ref T5363
2017-10-24 14:37:45 +09: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
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
Marcel Hollerbach 8019639b29 elm_multibuttonentry: remove old api! 2017-10-10 19:28:46 +02:00
Jean-Philippe Andre e9dfcb44ff widget: Implement translation API in layout
This moves the API entry points from Widget to Layout parts. I don't
think the other widgets support translation, but that is easy to fix.
The actual code implementation remains in elm_widget.c.

Legacy-only widgets are covered by Part_Legacy, while all EO widgets
that have text inherit from Layout (except Win but I don't think the
window title was translatable in legacy).

This removes 2/3 remaining part APIs from Widget.

Ref T5363
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 839c4ed395 elm: Introduce interface Efl.Ui.Translatable
This will be used to replace the part translation API in Elm.Widget. It
should work for both parts and non-parts (ie. the main text of a button,
for instance).

For now I'm taking the following approach:
 - All efl_text_set/get strings are untranslatable, i.e. get() returns
   the visible string, set replaces and can not be translated.
 - translatable_text_set/get needs to be used to enable automatic
   translation, which in turns calls efl_text_set to modify the visible
   string. Thus, translatable applications will have to use
   efl_ui_translatable_text_set a lot more than efl_text_set, unless
   they translate strings application-side.

Note that some other frameworks take a simpler approach equivalent to
calling efl_text_set() with an already translated text. This prevents
runtime language changes of the application, unless the application
handles them specifically.
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 0339ad7740 elm: Move base implementation for efl_part in widget
This means that ALL part handles inherit from the base part class
Efl.Ui.Widget.Part. Layout is the only exception where Efl.Part is
specially overridden.

This is a first step towards generic part APIs, including background in
all widgets.
2017-09-21 12:27:33 +09:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre d5a31f3f30 edje/elm: Rename _internal_ to _part_ (EO)
In Edje and Elementary, we have part objects, which are what is returned
by the interface efl_part(). Those objects can't be of an opaque type as
this doesn't work nicely with strongly typed languages such as C++ or
C#. In JS, Lua, C the types are weak and mostly runtime-based so it
doesn't matter much.

As a consequence, the documentation and the types need to look nice in
this EO API. Thus, we remove the abusive term "internal" and explicitly
call all those classes "part" something.

Eventually we want the types to be declared in the EO file so bindings
(C#, C++, ...) can generate the proper access methods, returning the
best possible types.

Note that right now a few of those part types are used in the legacy API
but don't actually need to be exposed externally.

This is kind of a mega commit that does all the renaming at once, but
it's really just a big sed operation. The power of good IDEs :)

Ref T5315
Ref T5306
2017-09-13 13:53:49 +09:00
Shinwoo Kim 2f6e28881e elementary: atspi accessible name uses plain text
The markup information of accessible name is not necessary.
2017-09-06 19:54:59 +09:00
Jean-Philippe Andre c0d7ea4af0 widget: Rename on_focus to on_focus_update (EO)
on_focus seems to imply that focus was just given to the widget, but
that function is called on any focus change (in and out).

Ref T5363
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 71824e1fe0 mbe: Fix infinite recursion on focus change
Ref D4882
2017-08-31 14:14:50 +09:00
Woochan Lee 5eb001dd35 multibuttonentry: Separate selected item and focused item logic.
Summary:
When user set a selected item on MBE creation time.
The internal logic will be broke.
So we need to separate logic them.

@fix

Test Plan:
Calling elm_multibuttonentry_item_selected_set() before MBE got a focus. in elementary_test.

Reviewers: cedric, jpeg, woohyun

Subscribers: bu5hm4n, marcelhollerbach, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4882
2017-08-31 14:01:05 +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 f90d0d1501 widget: Simplify & document "translate"
This is a protected function. It doesn't need to return anything, as all
implementation just returned true, always. Also, the legacy API was just
a wrapper doing nothing special (except verify that we have a widget,
which the recursive code already does).

Tested with fr_FR :)

Ref T5363
2017-08-30 18:54:59 +09:00
Jean-Philippe Andre a82ab33bed widget: Use rectangle in show_region
Also make it a property. It's asymmetric because of the force show
argument, but the get is much cleaner.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 0a0bbe5fda widget: Rename hook "access" (EO)
This is also another protected and beta API. Meant to be overridden by
subclasses, but belongs to a still unstable API.

The difference between the internal legacy and the EO API is really bad.
Same as with activate (previous commit).

Ref T5363
2017-08-29 10:40:53 +09:00
Jean-Philippe Andre c4ac589455 widget: Remove all legacy event stuff in propagate
The EO API is now clean! Yay!

Ref T5363
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
Jean-Philippe Andre 9a2d4928f0 elm: Rename elm_layout to Efl.Ui.Layout
Some names have not been changed, hopefully making a distinction
between legacy APIs and internal code (elm_layout_blah) and valid EO
usages.

This means many internal functions are still elm_layout_ as their
sole purpose is to support the legacy API.

Ref T5315
2017-08-08 13:25:58 +09:00
Jean-Philippe Andre 6864495c99 elm: Move elm_layout_sizing_eval to legacy
elm_layout_sizing_eval() marks an object as requiring recalc.

Unfortunately, it's been massively abused by various widgets into
actually doing the calc, or the min calc. So we end up with one API
that has 3 different definitions depending on the widget type:
1. Mark as requiring recalc (correct, respects doc, elm_layout)
2. Calculate min size and other size hints
3. Actually do some geometry modification

I believe we need to clarify these 3 requirements into 3 very clear
and specific APIs in elementary. Right now we have similar functions
in evas for 1 (evas_object_smart_changed) and 3 (smart_calculate).
But their exact definition also isn't necessarily what we want for
elementary.

Another clear problem is that layout_eval does not do any calculation
(in theory), so the "eval" word is a bit of a stretch here.

Once we're sure about the exact API we want, we can add this back to
EO and make it work across our EO widgets. For now let's just keep
the legacy API, and its EO overrides, as is.

Ref T5315
2017-08-08 11:10:56 +09:00