Commit Graph

86 Commits

Author SHA1 Message Date
Jaeun Choi 998e9a8f68 elm_panel/efl_ui_panel: disable scrolling when obj is disabled
panels were still scrollable while disabled.
this patch fixes it.
2019-04-08 18:48:34 +09:00
Mike Blumenkrantz 563bc027cd elm_panel: 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/D8188
2019-03-07 14:15:56 -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 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
Jaeun Choi dab4d8d8a4 elm_panel: show/hide panel according to hidden status
when panel becomes non-scrollable by elm_panel_scrollable_set() function,
the panel needs to be shown/hidden according to the hidden status.
this patch implements it.
2019-01-21 19:07:51 +09:00
Jaeun Choi 368ab45b26 elm_panel: reset layout theme when scrollable mode is changed
after a panel becomes scrollable, it has two layout objects internally
and only one of them is active. when elm_panel_orient_set() function
is called, only the active layout's theme is changed according to
the orientation. so if scrollable mode is changed after that, it shows
the old theme. this patch fixes it.
2019-01-21 15:01:05 +09:00
Jaeun Choi 4d0289bb9f elm_panel: fix a bug in elm_scrollable_mode_set() function
when panel becomes scrollable, the function blocked scrolling
assuming that the panel is hidden. this caused an issue case
when panel becomes scrollable while it is open.
this patch fixes the issue.
2019-01-18 16:26:44 +09:00
Yeongjong Lee d44c7713cc elm_panel: fix visibility when switching scrollable mode
Summary:
There are two proplem when switching scrollable mode.
1. a previous layout does not disappear.
2. internal evas_box(sd->bx) should set on "elm.swallow.content" part.

This patch hide remained previous layout and set evas_box to "elm.swallow.content"
part directly.

Thanks to arosis for reporting and sample code.

Test Plan: P262

Reviewers: arosis, eunue, Jaehyun_Cho

Reviewed By: eunue

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7667
2019-01-17 17:40:37 +09:00
Cedric BAIL 038612736c efl: rename Efl.Ui.Base -> Efl.Ui.I18n as that is really what it does.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7506
2019-01-02 11:03:51 -08: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
Yeongjong Lee 086783f31d elm_panel: fix mirrored_set work correctly
Summary:
When elm_panel isn't scrollable, It can't pass `if (!sid->edje_obj) return;` in
_elm_interface_scrollable_efl_ui_base_mirrored_set. so elm_panel's mirrored_set
didn't work. we neet to consider non-scrollable panel.

Test Plan:
1. elementary_test
2. Open 'Panel' and 'Panel Scrollable'
3. Turn on UI-Mirroring on Elementary Tests window.
4. Check that mirror mode works correctly.

Reviewers: Hermet, Jaehyun_Cho

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6944
2018-08-30 14:02:34 +09:00
Alastair Poole 706784d7c8 elm_panel: return instead of EINA_SAFETY_ON_FALSE_RETURN
Summary:
As with other checks in ELM return if object is not yet
finalized. This stops lots of console noise.

@fix T7265

Test Plan:
elementary_test: use panel test from console and view the noise
from EINA. Apply then do the same.

Reviewers: #committers, zmike

Reviewed By: #committers, zmike

Subscribers: cedric, #reviewers, zmike

Tags: #efl

Maniphest Tasks: T7265

Differential Revision: https://phab.enlightenment.org/D6826
2018-08-14 15:48:27 -04:00
Chris Michael 2f9a65844e elementary: Check for valid object before calling smart calculate
Summary:
Small patch fixes an issue where evas_object_smart_calculate was being
called with a NULL box.

ref T7030
Depends on D6704

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7030

Differential Revision: https://phab.enlightenment.org/D6710
2018-07-31 17:24:10 -04:00
Xavi Artigas c35214ee9c default theme: fix part names in elm/scrollable/panel
Summary:
Ref T6966

Depends on D6455

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6966

Differential Revision: https://phab.enlightenment.org/D6456
2018-06-29 11:28:57 -04:00
Chris Michael c8770a54df elm_panel: Wrap calls to edje_object_part_object_get with freeze/thaw
Summary:
@ref T6884

Depends on D6406

Reviewers: zmike, ManMower

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Maniphest Tasks: T6884

Differential Revision: https://phab.enlightenment.org/D6407
2018-06-25 11:32:47 -04: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
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
Jaeun Choi d36c849e20 elm_panel: add exception handling in _drawer_close()
this fixes a bug with scrollable panel not being blocked
when it is closed. scroll is blocked in _anim_stop_cb()
which is called after elm_interface_scrollable_region_bring_in().
but if panel content is already at the target position, _anim_stop_cb()
is not called. so there is a need to check content's position and
handle the exceptional case.
2018-01-16 14:57:38 +09:00
Jaeun Choi 4f2b04c7a2 Revert "elm_panel: add exception handling in _drawer_close()"
This reverts commit 2acfc3e381.
2018-01-16 14:48:11 +09:00
Jaeun Choi 2acfc3e381 elm_panel: add exception handling in _drawer_close()
this fixes a bug with scrollable panel not being blocked
when it is closed. scroll is blocked in _anim_stop_cb(),
which is called after elm_interface_scrollable_region_bring_in().
but if panel content is already at the target position, _anim_stop_cb()
is not called. so there is a need to check content's position and
handle the exceptional case.
2018-01-16 14:42:58 +09:00
Jaeun Choi 65b828b050 elm_panel: prevent redundant callback function addition or deletion
there is a need to check if callback functions already exist or not
before adding or deleting them, because they are added or deleted
at two points:
in _elm_panel_scrollable_set() and _elm_panel_elm_widget_disable().
2018-01-16 13:19:36 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +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
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
Jean-Philippe Andre 72f1fbf4f1 widget: Rename focus_region (EO)
This region has little to do with focus, as it's more of a region of
interest within the widget, and not directly related to the highlight
geometry, for instance. It's related to focus in the sense that only
widgets with focus would really care about this region.

I decided to change this name after talking with @bu5hm4n.
Note that gengrid uses this but is also completely broken (the focus
highlight floats around and you don't even see the focused item).

Note: This is very close to show_region but I'm not sure those can be
merged safely (since the default "focus_region" is NULL while the
default "show_region" is the widget's geometry).

Ref T5363
2017-10-12 19:33:04 +09:00
Marcel Hollerbach 5951aa8742 elm_panel: make it a layer 2017-10-10 19:28:47 +02: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 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +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
Jaeun Choi 61381f6e35 elm_panel: set content as a sub object of panel object
since sd->bx is not an elm object, it is excluded from parent-child tree.
in case of a non-scrollable panel, the content needs to be attached to the tree
as a child of panel object directly.
2017-09-05 17:09:37 +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 ffa041fe58 scroll: Rename elm enum to efl.ui
This scroll block enum should also be used in widget itself.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 00862c3c9c widget: Use rectangle on the stack for region_show
Follow @k-s recommendation and simply use rectangles on the stack rather
than by pointer.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre 233068c30c widget: Simplify code with rectangle (EO)
This replaces x,y,w,h with a rectangle in parts of the focus_region
code.

Ref T5363
2017-08-29 14:30:39 +09:00
Jean-Philippe Andre d928ba989a widget: Merge on_focus_region and focus_region_get
This simplifies code and API.

Ref T5363
2017-08-29 14:30:35 +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 6aa309ffb8 widget: Rename hook "disable" (EO)
Renamed to on_disabled_update.
Also passed in the new state of disabled. It's more convenient this way,
than having the subclasses call disabled_get.

Also simplify some code...

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 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