Commit Graph

43 Commits

Author SHA1 Message Date
Marcel Hollerbach 02ce09fbb4 elm_part_helper: emit changed events when content is changed
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8639
2019-04-21 10:51:45 +02: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
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
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
Xavi Artigas 6b5ac687c1 Efl.Text_* (from Efl.Text.*)
Including:
Efl.Text.Cursor_* (from Efl.Text.Cursor.Cursor_*)
Efl.Text.Font_* (from Efl.Text.Font.*)
Efl.Text.Format_* (from Efl.Text.Format.*)
Efl.Text.Style_* (from Efl.Text.Style.*)
Efl.Ui.Text_* (from Efl.Ui.Text.*)

Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:49 -07: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
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
YeongJong Lee 160b6d202f elm_part: use TYPE _CLASS instead of MY_CLASS
Summary:
legacy part do not have MY_CLASS. if ELM_PART_OVERRIDE_PARTIAL is used for
legacy part, it call efl_super(non-legacy class).
we need super of TYPE _CLASS instead of MY_CLASS.

Test Plan:
WITH D5818
1. elementary_test -to progressbar
2. check that efl_part is working in _progressbar_part_value_set

Reviewers: cedric, woohyun, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5819
2018-02-26 21:21:57 +09:00
Sungtaek Hong b380e63b07 efl_part: call Efl.Text of each class' part
Summary:
Macro ELM_PART_TEXT_DEFAULT_IMPLEMENT calls
super class' Efl.Text interface, rather than this class.

Reviewers: jpeg, woohyun, Jaehyun_Cho, herdsman

Subscribers: cedric, id213sin

Differential Revision: https://phab.enlightenment.org/D5799
2018-02-08 11:37:51 +02:00
Sungtaek Hong 08d86d3941 efl_part: use efl_ui_widget's default_part_get
Summary:
efl_part macros are using each widget's internally defined
default_part_get() functions to get default part name.
This might potentially cause errors when future widgets
inherits the widget but not overriding Efl.Text.text and
Efl.Content.content.

Reviewers: jpeg, cedric, woohyun, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5797
2018-02-08 14:53:59 +09:00
Jaehyun Cho 000d43b29e elm_part_helper: Fix to use registered default text part 2018-02-07 20:52:12 +09:00
Amitesh Singh 44d3227beb widget: rename elm widget to Efl.Ui.Widget. 2018-01-08 21:28:10 +09:00
Sungtaek Hong e7e375937b elm: introduce ELM_PART_OVERRIDE_PARTIAL
Summary:
ELM_PART_OVERRIDE_PARTIAL replaces ELM_PART_OVERRIDE and
ELM_PART_OVERRIDE_ONLY_ALIASES.
The difference is ELM_PART_OVERRIDE_PARTIAL calls super
ELM_PART_IMPLEMENT when subclass of part is not needed.

Test Plan:
Run elementary_test, Part Background, background part is well set.
           Run efl.ui.panes/efl.ui.flip, check content is well set.

Reviewers: jpeg, Jaehyun_Cho, woohyun

Reviewed By: Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5566
2017-12-08 16:02:23 +09:00
Jean-Philippe Andre 207a0cf3e3 eo: Move hacky API auto_unref to C only
This API is meant to be used by parts only, and by bindings dealing with
part objects. This patch fixes make check which got broken in the after
the previous one (cxx).
2017-12-05 15:06:34 +09:00
Jaehyun Cho 4b18e754de elm_part_helper: Change macro name for default content part 2017-11-29 13:43:21 +09:00
Jean-Philippe Andre 1aedcdaf7a win: Fix window background EO APIs
Broken in a previous commit
2017-11-24 17:10:30 +09:00
Jean-Philippe Andre dee149f3aa elm_part: Mark as auto-unref before finalize
This simplifies the IMPLEMENT macro, which can now be a proper function.
Also, do not set a parent for the part object, as it's not useful and
could mess up the refcount.
2017-11-24 16:27:18 +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 026430578a elm: Fix minor warning (return void) 2017-11-20 20:34:17 +09:00
Jean-Philippe Andre dda18948ae efl: Split Efl.Container and Efl.Content
When I first implemented the Efl.Container interface I made a mistake of
mixing "single slot" content API's with "multiple children" content
API's.  This should fix that, by separating API's that are for a single
part and those that deal with a list of children.

  Efl.Content: Single slot. This will be used a lot by efl_part()
objects, and for the default content of widgets (eg. the window
content).

  Efl.Container: Multiple children. Used by lists, boxes, layouts
(edje/elm), etc...

I didn't see any class that implemented both interfaces (note: Layout
implements Container and Button implements Content, so technically
Button implements both through inheritance).

For now the eo_prefix is not changed in Efl.Container. I wonder if it
should be reset (to efl_container) or not. This would only affect the C
API.

Ref T5328
2017-11-20 19:02:09 +09:00
Jean-Philippe Andre 006546a042 elm: Use auto_unref for parts
This avoids leaks.
2017-10-24 14:49:12 +09:00
Jean-Philippe Andre b5c241ca08 frame: Implement content set/get/unset
Not a huge fan of my macro as it uses efl_part() where a direct call
could be possible, depending on the widget (win can, frame can't).

See D5241
2017-10-17 17:31:38 +09:00
Daniel Hirt deca3c947f Ui layout: support markup for efl_part()
Also implement markup_set/get for:
  - Efl.Ui.Frame
  - Efl.Ui.Slider

Users may choose between text_set/get and markup_set/get, depending on
whether they want to escape their text or not.
2017-09-28 19:32:02 +03:00
Jean-Philippe Andre c9f51e450b widget: Fix translation of default text parts
Note: fileselector uses this translation API

Ref T5363
2017-09-26 17:58:07 +09:00
Jean-Philippe Andre 28b387821d elm: Split off text and content for efl_part
This is VERY tricky.
For legacy, just create an internal class that has both. It's easier
this way. For parts that are handled by Layout directly, we know from
Edje which type to return.

For EO objects we should know from the part name which kind of part we
are dealing with:
 - text (overridden by the widget)
 - content (overridden by the widget)
 - special (new efl_part based functions)
 - generic (handled by Layout)

Note: Efl.Ui.Slider was handling "span size" on ALL parts. That's bad...
This is now limited to "span" only.
2017-09-21 12:27:34 +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 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
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 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 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 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
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
Amitesh Singh 850498e977 rename elm_button to Efl.Ui.Button
ref T5323

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-05-22 17:28:47 +09:00
Jean-Philippe Andre b5b78c0232 button: Add support for efl_text_set
For now a very quick and dirty solution, relying on elm_layout
legacy APIs.
2017-01-05 10:37:20 +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
Tom Hacohen aa6b53a2ae Switch to eo_del() where it should be a del and not an unref
This code was written when eo_del() was removed and eo_unref() was the
recommended practice. Since we added eo_del() back we now need to adjust
this new code accordingly.
2016-06-01 19:27:40 +01:00
Jean-Philippe Andre 3092e08a83 elm: Fix efl_part inheritance
So, I was storing a single "sd" pointer (class private data)
but using it in two different places, ie. as if it were two
different classes. Crashes happened, complaints were heard.

See T3714.
2016-05-30 13:35:34 +09:00
Jean-Philippe Andre 6e487e93b8 Elm Layout: Make box & table part proxies temporary
efl_part returns short lived objects, let's make them
die after each function call.
2016-05-26 19:55:50 +09:00
Jean-Philippe Andre 99924852ab Efl: Remove part name in Efl.Container (use Efl.Part)
This touches Edje and also Elementary where part names are used.
This commit blew up in size since now all content part APIs
(get, set, unset) require to use Efl.Part instead.

This is a big refactoring commit, but no logic should
have been changed. Fingers crossed.
2016-05-26 19:55:50 +09:00