Commit Graph

68 Commits

Author SHA1 Message Date
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
JinYong Park f2082c0412 layout: fix "elm,state,text,hidden" signal never be emitted
Summary:
 In _elm_layout_text_set function, text_signal_emit is called.
 But in that case, check text whether it is null or not null before call signal_emit.
 So "text" is not null always, and text_signal_emit's parameter "visible" is also always EINA_TRUE.

Reviewers: Jaehyun_Cho, cedric, jpeg

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5049
2017-08-04 15:33:27 +09:00
Jean-Philippe Andre 4c8f87974c layout: Implement data_get from edje
This also implements size_min and size_max get.

Ref T5315
2017-08-04 11:52:17 +09:00
Jean-Philippe Andre 3e5cfb83c0 elm: Remove custom layout signal APIs
This merges them with the now standard interface:
  Efl.Canvas.Layout_Signal

Some wrapping work was required for legacy API which
takes no user_data in del() but instead returns it. The
new EO function, while harder to use, is more correct
(you can't delete the invalid callback by accident, and
this follows EO events design).

Another crazy wrapping was done in entry/text in order
to add the callbacks to 2 objects instead of just one,
and still return the user data.

As for Naviframe and Popup, those two widgets override
signal_emit to forward the call to another object than
the resize object, but not callback_add/del. So they
are definitely broken.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre ad7e16bcf4 layout: Use only legacy "elm_layout_sizing_eval"
This removes all uses of elm_obj_layout_sizing_eval.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre f0730f6f4c layout: Move edje_get to legacy only
Here's the reasoning:
 1. We will expose as many edje APIs as possible (and meaningful)
    through the elm layout class.
 2. Access to internal objects is usually risky, as it allows apps
    to bypass EFL in some ways, leading to potentially undefined
    behaviours.
 3. If the need arises we can still add a similar API back to EO,
    later.

Back to #1, it seems that the need for edje_get() was mostly to
call manual sizing functions, or the missing message_send(). I will
make sure these are accessible from the layout itself.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre aebd37cab8 layout: Remove sub_object_add_enable
Same as the previous patch. This was an ugly hack. Use another
one instead.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre a4940ae6c9 layout: Remove method theme_enable
This was an internal thing, ugly, replaced by another ugly
solution, but maybe less ugly.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre 7ba0ab5182 layout: Implement freeze and thaw from interface
This implements part of the interface
  Efl.Canvas.Layout_Calc
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre a4c3929894 layout: Implement cursor part APIs with efl_part
This makes layout parts implement Efl.Ui.Cursor.
This also adds the missing bool returns from that interface.

This removes 7 APIs from Elm.Layout.

Ref T5315
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre f63a564817 layout: Move edje_object_can_access to legacy
This is an API enabling accessibility on text(block) parts
in a layout. But it is said to have many issues. I can already
see that it only changes a flag but doesn't trigger any code
to create the appropriate objects, so definitely not fully
working.

According to @kimcinoo this may remain in legacy land for now.
2017-08-04 11:52:16 +09:00
Jean-Philippe Andre 796d4b138b elm: Make content and text aliases internal only
This removes the APIs from the EO API.

Ref T5315
2017-08-04 10:24:03 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +09:00
Jean-Philippe Andre 5a922f4afa elm: Don't alias in efl_part()
Inside efl_part() we don't know whether we are dealing with a text
or content API, so we can't actually guess the proper alias.

The legacy API should have already dealt with aliasing at this point.
The EO API should not use those aliases.
2017-07-05 20:30:21 +09:00
Jean-Philippe Andre 9b667ed062 elm: Forbid calls to efl_part(obj, NULL)
This in theory should only affect the EO API usage. In EO
we don't want efl_part() to be used for NULL part. In other
words, there is no "default" part in EO objects. Instead, those
functions like text_set or content_set should simply be
implemented by the object themselves.

The legacy API on the other hand will make sure that the
"part" argument is set to a non-NULL value before reaching
this point.
2017-07-05 20:21:08 +09:00
Daniel Hirt 544fedaeba Elm layout: only allow legacy for using NULL text parts
This is a follow-up to a4b79fdbe1.

efl_part no longer supports NULL parts.
NULL text parts are now aliased in legacy code beforehand.

Signed-off-by: Jean-Philippe Andre <jp.andre@samsung.com>
2017-07-05 20:07:29 +09:00
Jean-Philippe Andre a4b79fdbe1 layout: Fix default content part
This fixes call to:
  elm_layout_content_set(ly, NULL, obj);

This only affect this legacy API, not the EO interface.

Thanks Dave for the report!

Ref 59081043a8
2017-07-04 11:49:31 +09:00
Jean-Philippe Andre 59081043a8 elm: Always pass valid part name inside part APIs
This affects the legacy content_set/get/unset part APIs. This
should avoid some unwanted ERR messages in case an elm_object_
API is used on an elm widget that doesn't implement said API.

What this does is request the widget for the name of the default
part if NULL was passed in. Since some widgets are not elm_layout,
they have to override the API themselves, which is why I made it
an internal EO API (rather than a series of efl_isa()).

In theory, part should never be NULL when reaching the internal
implementation code in the widgets, at least for content.

In EO, efl_part(obj, NULL) should be invalid.

Ref T5629
2017-06-30 14:37:54 +09:00
Sungtaek Hong 82a955be90 elm_entry: use layout text/content aliases when text_set/get content_set/get/unset
Summary:
- elm_entry has elm.guide text part and it can be set by "guide".
- However when using text_aliases_get, this cannot be found.
- Add elm_obj_elm_layout_part_aliasing_eval() internal APIs to make entry
  use proper aliases.

Test Plan:
1. Run elementary test
           2. Observe search entry has guide text with "guide" part.
           3. Run Entry 8.
           4. Observe "elm.guide" part also works.
           5. Observe "icon" and "end" part works.

Reviewers: id213sin, herdsman, jpeg

Reviewed By: jpeg

Subscribers: conr2d, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4962
2017-06-30 14:37:54 +09:00
Daniel Hirt c0e4a218dd Elm layout: fix broken text part name resolving
This adds a few workaround to overcome the efl_part port.
Quite a few layouts got broken in some specific cases.
2017-06-30 00:20:10 +03:00
Jean-Philippe Andre ed41adf791 widget: Implement mirrored from Efl.Ui.Base
Ref T5363
2017-06-14 11:02:05 +09:00
Jean-Philippe Andre 06b14827b7 widget: Implement scale from Efl.Ui.Base 2017-06-12 11:50:30 +09:00
Larry Jr 824699036a Elementary: fix Elm.Layout Model Connect
Use "elm" has source to model_connect update
Disconnect part/property in model_connect
2017-06-08 19:12:13 -03:00
Daniel Hirt ca8a8b712c Elm layout: fix a few objects after move to efl_part
Fixes elm_layout_text_set/get bugs that were introduced in
3eb649b180.
2017-06-05 12:00:27 +03:00
Daniel Hirt 3eb649b180 Elm layout: replace 'text' property with 'efl_part' interface
The expected usage is efl_text_set(efl_part(layout, part), text);
Same for text_get.

Also, added an example how to make API easier with providing
efl_text_set/get for the widget itself, in efl_ui_button. Please see
this example.
2017-06-05 02:08:03 +03:00
Jean-Philippe Andre 76ef772d0a edje: Unify load error types for image and edje (EO)
Most of the values were the same, with edje having just a couple
more error codes.

Not entirely sure the prefix Efl.Image is correct for this type.
Maybe just Efl.Load.Error?
2017-05-29 10:49:17 +09:00
Jean-Philippe Andre 55b529cebc evas/elm: Make group_add/group_del internal functions
This hides those two legacy functions from the EO API.
2017-05-19 14:07:00 +09:00
Jean-Philippe Andre afbdaf514a efl model: Fix invalid type in EO
Efl.Canvas refers to a canvas, like Evas or Window. Efl.Gfx is
the base visual object type in libefl.so
2017-05-17 15:32:04 +09:00
Jean-Philippe Andre 6cd8811fe9 container: Remove method part_name_get
Remove this for now, as it may not apply to all contents.
Note that this was a new API in EO.
2017-05-11 17:53:50 +09:00
Daniel Kolesa 3fb4bc336e eo: hide dbg_info from eo files
Continues b780cf2af2.
2017-04-21 17:59:32 +02:00
Larry Jr 093c592188 efl: add efl_model and efl_ui_view classes
Efl.Model.Container and Efl.Model.Item to efl/interfaces are used
to create Efl.Model objects with predefined property values.
This is useful to any situation where we want an Efl.Model with
explicit defined property values.

Efl.Ui.View and Efl.Ui.Factory are used to connect Efl.Models with
Widgets, Elm.Layout and Efl.Ui.Image has changed to use news interfaces

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-06 15:26:21 -08:00
Jean-Philippe Andre 1ce8c1c3d1 Revert "elm_layout: Implement Efl.Text"
This reverts commit 584e17ae84.

After talking to @herdsman (before xmas) we concluded that we
didn't necessarily want a generic version of efl_text_set/get
for elm_layout. Instead, each widget that should have a default
text part should implement text_set/get themselves (very simple).

Note that Efl.Ui.Text somehow does not "implement" efl_text when
looking at the eolian files. It works by composition.
2017-01-05 10:37:19 +09:00
Jean-Philippe Andre 584e17ae84 elm_layout: Implement Efl.Text
This implements support for efl_text_set() for the default
part (NULL). This also adds support for efl_text_set(efl_part())
for layouts. This should cover a LOT of widgets :)

The next step is to remove Elm.Layout.text but it's used in too
many places at the moment. @herdsman!!
2016-12-16 18:53:33 +09:00
Andrii Kroitor 595ae821ba elm_layout: add mmap support
Reviewers: cedric, Hermet, raster, NikaWhite

Subscribers: jpeg, reutskiy.v.v

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-07 14:42:07 -08:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Jee-Yong Um 30ec592638 elementary: remove redundant parts_text_fix from Elm.Layout
Summary:
When a theme is loaded, Elm.Layout updates strings with new theme.
This adjustment will be performed by Edje. (See D4219)

Reviewers: cedric, jpeg

Subscribers: taxi2se

Differential Revision: https://phab.enlightenment.org/D4220
2016-08-16 16:14:21 +09:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Cedric Bail a7bb1662e2 Revert "elementary/layout: attach edje object API with eo compositing"
This reverts commit 8a988717e1.

It seems we can't actually inherit from class more than once and neither eo
nor eolian will complain about it. You will just get random weird behavior.
This patch should come back once we have made an interface of edje.
2016-08-05 11:09:55 -07:00
Jean-Philippe Andre 28c917836c efl: Cleanup some code (return values)
This removes some useless code in various places, where the
switch from eo_do() to standard function call was not properly
refactored.

This changes:

type ret = 0;
ret = my_eo_function();
return ret;

To:

return my_eo_function();
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre ccac110d71 elm: Fix extra mouse,in events in layout_content_unset
Problem: crash in assert() in terminology.

Scenario:
 Open Terminology,
 Split V by keyboard,
 Move mouse to split 2,
 Create tab by keyboard
 --> abort() in terminology

Cause:
 An extra mouse,in event happens during edje_object_unswallow
 inside elm_layout_content_unset.

Root cause:
 efl_part() in elm_layout had a side effect: edje_recalc on the
 edje object. Causing its geometry to be "properly" defined and
 the mouse event to trigger callbacks.

Solution:
 Avoid calling recalc... somehow.

Conclusion:
 Without adding any new API, edje edit provides internally the
 information that we want: type of an edje part (for box & table).

Fixes T4221
See T4028
See T3509
2016-07-27 16:48:45 +09:00
Carsten Haitzler 1e4c425bea elm layout - fix possible leak
fixes CID 1357365 (new!)
2016-07-08 11:02:41 +09:00
Carsten Haitzler 6ab167afa1 elm layout - add and delete signal cbs from the same consistent obj
elm layout signal handling was all over the place. using 3 different
ways of adding or deleteing signals from the object. it uses either
obj directly, eo_super(obj) or wd->resize_obj. come on. be consistent.
so using wd->resize_obj worked before and now works properly with
sgnal cbs PROPELY deleted unlike before.

@fix
2016-07-03 15:45:46 +09:00
Jinyong Park 3271ec8d18 theme: return enum from elm_widget_style_set instead of bool
Summary:
if trying to apply incorrect theme, widget apply default theme and return TRUE.
so there is no way to check it really apply correct theme.
To resolve this problem, _elm_theme_set return three type enum

* related history : 4ca3ef4514
* elm_object_style_set is public api, so I didn't change it.
* typedef name [ Theme_Apply ] is temporarily, please suggest better one.

@fix

Reviewers: singh.amitesh, herb, Hermet, cedric, jpeg, raster

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4073
2016-07-01 15:09:43 +09:00
Jaeun Choi 92a67f1a61 layout: Add NULL check in _elm_layout_text_set function
When the parameter 'text' is NULL in elm_layout_text_set function,
the sub object data with the same part name is removed
from the layout's sub object list and the function returns immediately.
However, if the text part doesn't exist in the list,
a new sub object data is appended to the list even though the text is NULL.
This patch adds NULL check so the function can return in such cases.
2016-06-30 14:20:44 +09:00
Jaeun Choi 921dba8457 Revert "layout: Add NULL check in _elm_layout_text_set function"
This reverts commit e3fd84d1de.

NULL checking point is wrong.
2016-06-29 18:25:17 +09:00
Jaeun Choi e3fd84d1de layout: Add NULL check in _elm_layout_text_set function
When the parameter 'text' is NULL in elm_layout_text_set function,
the sub object data with the same part name is removed
from the layout's sub object list and the function returns immediately.
However, if the text part doesn't exist in the list,
a new sub object data is appended to the list even though the text is NULL.
This patch adds NULL check so the function can return in such cases.
2016-06-29 16:15:46 +09:00
Jee-Yong Um 8a988717e1 elementary/layout: attach edje object API with eo compositing
Test Plan: make check

Reviewers: Hermet, jpeg, cedric

Subscribers: slotus.lee

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-06-27 11:18:05 -07:00
Jean-Philippe Andre 269fc4f7a6 evas: Remove common interface and use provider_find
Evas.Common_Interface not only had a bad name, it also
wasn't in line with how we can get a loop object, for
instance.

Use eo_provider_find in each implementing class.
2016-06-21 16:13:04 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00