Commit Graph

78 Commits

Author SHA1 Message Date
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
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 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 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
Marcel Hollerbach e25d494590 elm_widget: do not cache the provider
if turns out that caching the provider here is a problem, since a parent
changing does not change the provided provider
2017-10-16 11:02:12 +02:00
Marcel Hollerbach 75f5ea686f efl_ui_focus: add parent_provider
thats just a little helper, where the logic to find and fetch the
provider is bound to the position in the widget tree, this means that
for example gengrid could change the way the logical parent is
evalulated. (For example to map the logical parent to a item)
2017-10-13 12:31:47 +02:00
Marcel Hollerbach 7880dcd7d4 elm_widget: remove apis we dont need anymore 2017-10-10 19:30:01 +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 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
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
Marcel Hollerbach c51f35d42a elm_widget: move the complete regsiter/unregister logic
We had here a little problem, state focus_state_eval function handled
the unregisteration and consideration of the focus flags and then only
called a helper function (which was a widget function), that then did
the registeration in logical or regular mode.

Elm scroller for example took that function overwrote it and did onyl
permit logical registrations. Then again a evaluation of the focus state
and flags took place, and the function considered elm_scroller should be
registered as regular object, but found it to be logical. This lead to
the problem that we permantently unregistered Elm.Scroller and
registered it again as logical just to unregister it again. This was on
the one side a performance downside. But also a bug since all items from
within the Elm_Scrollers sub manager are getting reparent onto the
parent, which means not the root of the scroller (the scroller itself)
is the logical entrypoint to the widget but rather this reparented
widget, which led to unexpected focus  warps like described in T5923.

tldr: this fixes T5923
2017-09-02 21:10:56 +02:00
Jean-Philippe Andre 4e81df7cb2 widget: Forward focus_highlight_style to win
See the previous commits. All focus_highlight APIs are defined in the
Widget class but only implemented at the Window level. For consistency I
believe this call should also be forwarded to the window. The previous
logic had absolutely no effect at all, except storing a stringshare.

The day focus_highlight becomes widget-specific (i.e. each widget has
its own highlight style) then this can be changed.

Note: This will apply to legacy API as well.

Ref T5363
2017-09-01 10:09:37 +09:00
Jean-Philippe Andre 94d671c971 widget: Fix legacy for focus_mouse_up_handle (EO)
This removes the special code in the legacy API for
elm_widget_focus_mouse_up_handle. Add an internal helper to find the
first widget parent. And mark as protected.
Apparently this functions is still required for the new focus manager.

Ref T5363
2017-08-31 13:48: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 692282e67a widget: Move item_loop_enabled to scrollable (EO)
I was told that the scrollable interface is being redesigned for EO.
This API definitely does not belong to the base Widget class, as it's
quite specific to item-based scrollable widgets, such as lists and
grids. Since Elm.Interface_Scrollable is itself being revamped, it is a
good place to move that EO API for now.

Ref T5363
2017-08-30 17:29:52 +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 6bb9f4fd16 widget: Remove scroll_lock from EO
1. Uniformize the API, which is now for internal use:
   This uses the same enum as scroller "movement_block" instead
   of 2 separate properties. Less APIs, more consistence.

2. Remove scroll_lock x/y from EO widget. I was told it is not going to
   exist in the upcoming scrollable interface.

3. Remove scroll hold/freeze getters.
   scroll hold/freeze push/pop are still there but it remains to be seen
   how the EO scrollable interface will exploit them. Right now they are
   full of bugs.

Ref T5363
2017-08-30 17:29:52 +09:00
Jean-Philippe Andre c690469fcc widget: Rename drag_lock to scroll_lock (EO)
This also includes the drag_child_lock APIs. This had nothing to do with
dragging beyond maybe the case where scrolling is done by thumbscroll
(ie. finger drag).

Note that the EAPI were called already scroll_lock, not drag_lock.

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 8c1f771a67 widget: Use rectangle for focus_hilight
Ref T5363
2017-08-29 16:22:47 +09:00
Jean-Philippe Andre c6c1751fe3 widget: Mark focus_region_show as protected (EO)
This function is meant to be used by the widgets themselves, or internal
features such as elm_access.

Also remove const tag: this function call is definitely modifying the
widget (panning around and all that).

Ref T5363
2017-08-29 14:50:36 +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 6e5e8e567b widget: Rename hook "orientation" (EO)
Renamed to on_orientation_update

This internal / virtual function is in fact not overridden anywhere. Not
sure it is necessary to expose it in EO API?

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 5e7de75914 widget: Remove focus_tree_unfocusable_handle (EO)
Ref T5363
2017-08-23 20:53:20 +09:00
Jean-Philippe Andre ec264c5002 widget: Remove tooltip_add/del from EO
It's pretty much an internal function.
NOTE: Tooltip API is not bound to EO (yet).

Ref T5363
2017-08-23 19:20:47 +09:00
Jean-Philippe Andre 06ec847a7c widget: Use EO function pointer for on_show_region
This is as much a test of the EO function pointer as it is a clean up of
this widget API.
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre 509ed86cdf widget: Remove unused legacy function name
Ref T5363
2017-08-23 11:16:45 +09:00
Jean-Philippe Andre e9dffa723d win: Add Efl.Ui.Win_Inlined and remove parent2
Inlined windows are the only use case for parent2. We might as well want
to create a separate subclass for those special windows.

Ref T5322
Ref T5363
2017-08-23 11:16:45 +09:00