Commit Graph

233 Commits

Author SHA1 Message Date
Jaeun Choi bad145f313 edje: add missing NULL checks 2019-02-13 19:41:29 +09:00
Marcel Hollerbach 1763afb391 edje: implement container api
the container api returns the number of added swallows.
the content iterator returns a iterator over all swallowed objects.

The reason this is only for swallows is that the interface explicitly
mentions UI elements at the count. Since i am believing the the result
of the count operation should mirror to the amount of elements in the
iterator, the iterator only returns swallowed objects.

ref T5719

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7748
2019-01-26 11:41:58 +01: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
Carsten Haitzler ff2765c4af edje util - handle missing case in switch 2018-11-09 12:22:58 +00:00
Daniel Hirt face90632e Canvas layout: support more Efl.Text.* with efl_part
This adds many Efl.Text.* that are useful for manipulating the
underlying TEXTBLOCK object's propeties using efl_part.

This has been implemented as part of the "user-defined" properties of
the layout part, so that the changes on the part persist across load of
different groups.

Note that text styles have precedence over the TEXTBLOCK (Canvas.Text)
object's properties. if an edc provides a style, the properties it
manipulates as part of the "base:" string would not be affected by this
API.

In general, this helps reducing the amount of styles for objects (or
modes of the same objects) that share the same setup, but are different
in some properties (e.g.  ellipsis, wrap etc).

@feature

Canvas layout: add text part "expand" property

This adds "expansion modes", which are essentially the same as min/max
hints in the edje part's 'description.text' fields.

The user can then customize his widget to different modes without being
forced to create a new edje group in the theme.

Note that there is an added check in case one of the min/max text flags
are provided from the theme. In such case, all flags from this new API
will be ignored.
This fortifies misuse where the flags are set both in theme and the API.

@feature
2018-11-06 18:33:56 +02:00
Yeongjong Lee 9fc687a8c3 edje: call recalc in part_text_get if there is no available text data
Summary:
If edje_text_get is called before any edje_text_set function call, it return
null, because rp->typedata.text->text is only set by edje_text_set function.
If there is no available text data, find it from rp(edc).

ref 7bbf18a950

Test Plan: make check

Reviewers: zmike, id213sin, herdsman

Reviewed By: id213sin

Subscribers: Hermet, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6961
2018-09-28 16:14:00 +09:00
Mike Blumenkrantz 7bbf18a950 edje: return available text data in part_text_get without recalc when possible
Summary:
based on the codepaths taken when setting text to a part, a recalc should
only be necessary when returning markup from a textblock, and this is only
the case because the function returns a non-allocated string

in the case where the object is textblock and (legacy || not fetching markup),
the current text is guaranteed to be set on this pointer. the reason a
recalc is necessary for the markup case is because edje TEXTBLOCK parts only
set text to the internal textblock during a recalc, meaning that attempting
to fetch text on a just-set part will fail; this does not mean that the internal
textblock object doesn't exist, only that the text has not yet been set to it
Depends on D6422

Reviewers: herdsman, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6423
2018-06-25 15:19:33 -04:00
Mike Blumenkrantz 6839003510 edje: remove recalc during part_recursive_get
Summary:
this adds perf overhead in order to work around a bug in text_get

all part objects are instantiated during edje_object_file_set, and forcing
a recalc here does nothing more than perform unnecessary operations

ref 8f95b17f39
ref D6365

Reviewers: herdsman, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6422
2018-06-25 15:18:56 -04:00
Daniel Hirt 8f95b17f39 Edje: recalc edje before fetching the real part
Summary:
There are many calls to `_edje_real_part_recursive_get`. Though, it is
not guaranteed that the Edje object had instantiated all of the real
parts.

This change makes edje to always recalc before retrieving the real part.

The D6364 patch raised a good point, but presented a local fix, where
it seems that a global fix such as this is needed, instead.

The local fix is removed in favor of this. Test suite still passes.

ref T7057

@fix

Test Plan: See T7057

Reviewers: devilhorns

Subscribers: cedric, zmike, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6365
2018-06-22 17:12:28 +03:00
Youngbok Shin 69b5d67367 edje: fix text set/get issue without edje calculation
Summary:
Some changes broke really basical function behavior of text.
I couldn't get text from an edje object which I just set to the given edje object.
In the past code, edje called recalc function before trying to get text.
So, this patch bring that code to fix this issue.
@fix

Test Plan: Included. Run "make check"

Reviewers: herdsman, raster, cedric, woohyun, devilhorns

Subscribers: #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6364
2018-06-22 12:30:59 +03:00
Youngbok Shin cae57ff51b edje: don't give a wrong Edje data when an Edje object has group parts
Summary:
_edje_part_fetch() function gets an Edje which has the requested Edje_Real_Part.
Basically, it gets main Edje of the given object.
But, if a requested part is in a GROUP part, it gets the Edje of GROUP part.
It shouldn't be passed to _edje_efl_text_text_get() function directly.
@fix

Test Plan: N/A

Reviewers: herdsman, raster, cedric, woohyun

Reviewed By: cedric

Subscribers: #committers, zmike

Tags: #efl

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-05-25 10:09:15 -07:00
Cedric Bail 3347db4bea edje: do not reparent when the object is dead already. 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
Jihoon Kim 379ee0d0db elm_entry: add elm_entry_prediction_hint_hash_set/del API
elm_entry_prediction_hint_hash_set API sets the prediction hint data at the specified key, and
elm_entry_prediction_hint_hash_del API is for deleting the prediction hint data identified by a key.

@feature

Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
2018-05-23 11:27:34 +09:00
SubhransuSekhar Mohanty bdca8f0c71 edje: return proper value from the function.
@fix
2018-05-14 13:26:54 +09:00
Mike Blumenkrantz 668d68cdf4 edje: remove recalc from content_get and text_get
neither of these functions should force a recalc under any circumstance
as they are simply returning pointers

@fix

Differential Revision: https://phab.enlightenment.org/D5947
2018-04-25 12:00:11 -04:00
Mike Blumenkrantz e1036aff40 edje: make most edje_util.c functions obey freeze
a number of these functions have implicit recalcs, which is bad because
it's a pretty significant perf bottleneck, but it can't be improved
without breaking existing behavior expectations so this is probably the
best that can be done

ref T6884

Differential Revision: https://phab.enlightenment.org/D5946
2018-04-25 12:00:11 -04: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
Sungtaek Hong eb50ece082 edje_object: fix typo in EAPI edje_object_color_class_description_get
Reviewers: woohyun, jpeg, cedric, conr2d

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D5766
2018-01-30 14:25:39 +09:00
Daniel Hirt 2eac0dd89d Edje: remove item provider from eo api 2018-01-18 10:20:28 -08:00
Jean-Philippe Andre 001fa5af11 edje: add invalid part handler 2018-01-16 19:35:54 +09: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
Jean-Philippe Andre 9e2f2970b8 edje: Add property "part_exist"
This allows to safely verify if a part exists, without triggering any
potential call to NULL object, or even requiring the efl_part() handle
to be created.

This is perfectly equivalent to edje_object_part_exists(), but
implemented by both edje object and elm layout.
2018-01-16 18:37:04 +09:00
Amitesh Singh 54ae9cc18b edje: rename Edje.Object to Efl.Canvas.Layout 2017-12-06 13:12:29 +09:00
Amitesh Singh bdc3969452 edje: rename intf Efl.Canvas.Layout_Group to Efl.Layout.Group 2017-12-05 16:18:32 +09:00
Amitesh Singh c7aa3b2f83 edje: rename intf Efl.Canvas.Layout_Calc to Efl.Layout.Calc 2017-12-05 16:18:32 +09:00
Amitesh Singh 10103b9b45 efl.gfx: move scale{} from efl.ui.base to efl.gfx 2017-12-04 14:38:39 +09:00
Amitesh Singh 769aeb5fcc edje: fix NULL ptr dereference
Fixes CID 1383425
2017-12-01 10:59:58 +09:00
Amitesh Singh 864fbede3e edje: fix the typo in prev commit 2017-11-30 20:02:36 +09:00
Amitesh Singh 2ddea7065f Efl.Ui.Base: remove base_scale.get{} from interface.
base_scale for edje would be legacy now.
2017-11-30 19:27:04 +09:00
Jean-Philippe Andre 73e3a82bc2 edje: Move perspective to legacy
Note: Edje.Perspective is not bound to EO, and this is the only reason
why I'm moving this to legacy only. Marking as beta would mean the
legacy APIs would not be generated, so that would have almost the same
effect as moving to legacy.

It would be nice to actually support this in EO, though this seems like
a rarely used feature.

Ref T5315
2017-11-30 10:48:24 +09:00
Jean-Philippe Andre 8faa65d90b edje: Move text_change_cb to legacy only
This should probably be replaced by a well defined signal.

Note: If edje sends signals on swallow/unswallow and text set/unset we
could simplify some of the elementary code, eg. for button's icon
handling. The theme should be handling the padding automatically, it's
not the elementary widget's role

Ref T5315
2017-11-29 15:36:44 +09:00
Jean-Philippe Andre 6225293d2e edje: Move "preload" to legacy only
EO file API is still in flux, especially wrt. async loading. Let's just
keep this in legacy for now.

A few more patches and Edje.Object will reach its final form.

Ref T5315
2017-11-29 15:36:44 +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
Cedric BAIL 6bbcb3cc15 edje: last improvement of _edje_hash_find_helper speed by reducing call to eina split function. 2017-11-13 14:25:10 -08:00
Cedric BAIL eddd52cba7 edje: cache last string search miss to reduce useless call to eina_str_split_full by 3. 2017-11-13 14:13:08 -08:00
Cedric BAIL 7c615e1831 edje: cleanup life cycle of buffer in _edje_hash_find_helper. 2017-11-13 14:12:42 -08:00
Carsten Haitzler 75daddc839 Revert "Edje: use textblock by default"
This reverts commit ef3d2120bf.

This breaks E. pager ono my right screen looks like:

http://devs.enlightenment.org/~raster/shot-2017-11-11_12-13-14.png

on my left screen shellf keeps swapping between 2 dizes wobbling back
and forth every frame eating cpu and making it "blurry"...

note - theme is the flat one in devs/raster/theme/flat2 branch. so
this change certainly breaks something...
2017-11-11 12:10:32 +09:00
Daniel Hirt ef3d2120bf Edje: use textblock by default
As most of you know, TEXT part was, up to this point, an Evas.Text
object.

This patch merges TEXT and TEXTBLOCK both to use Efl.Canvas.Text.
Code is added to emulate what TEXT did that TEXTBLOCK did not.

I believe we can move forward with TEXT, and deperacate TEXTBLOCK from
the EDC. You can also set markup to TEXT parts.

Exactness seems to show some differences, but further examination shows
that it's due to difference in how width is calculated in
Efl.Canvas.Text. The results seem correct.

Be sure to report of any breakage via Phabricator or contact me
directly.
I am running E with this and did not stumble upon any crashes or visual
bugs.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-11-10 10:30:09 -08:00
Jean-Philippe Andre cc1ed7183c edje: Hide edje_global from the rest of the world
Call provider_find on the loop (or basically any object) with the
color/text/size class interface instead, to find it. The main loop is
the main holder of those objects.

Note: This makes use of provider_find instead of direct access to the
variable, in order to self-test the code. In theory release builds will
not do this and user directly the variable.
2017-11-08 20:02:31 +09:00
Jee-Yong Um 2f838acd4e Efl: add class interfaces (color/text/size)
Summary: implement Efl.Gfx.Class interface

Reviewers: jpeg, cedric

Subscribers: taxi2se, herdsman

Differential Revision: https://phab.enlightenment.org/D4403
2017-11-08 19:17:59 +09:00
Youngbok Shin de9f0aff57 edje: don't return negative width and height from _parts_extends
Summary:
It should return width and height with positive values or zero.
@fix

Test Plan: make check

Reviewers: raster, jpeg, cedric

Reviewed By: raster

Subscribers: jiin.moon

Differential Revision: https://phab.enlightenment.org/D5422
2017-11-06 11:06:41 +09:00
Daniel Hirt eadf313702 Canvas layout: fix Efl.text (non-legacy) TEXT parts
Current implementation should also support TEXT parts (like button)
with usage of efl_text_set.

Follow-up to 0061a4bb34.
2017-10-02 11:05:32 +03:00
Daniel Hirt 0061a4bb34 Canvas layout: improve legacy code paths for Efl.Text
Better handling of specific cases where you want to efl_text_set on
a TEXTBLOCK part.
Follow-up to af1595fd01.
2017-10-01 19:51:28 +03:00
Daniel Hirt af1595fd01 Canvas layout: fix legacy text set
Keep the legacy code path when using edje_object_part_text_set.
Fixes e's notification that got broken after
3642b3ae67.

Also, limit new efl_text_markup set to TEXTBLOCK parts.
2017-10-01 12:00:56 +03:00
Daniel Hirt 3642b3ae67 Canvas layout: support markup for efl_part
Users can now do either:
   efl_text_set(efl_part(obj, "part"), "text");
   efl_text_markup_set(efl_part(obj, "part"), "text");

Also have efl_text_get/markup_get.

Using markup_set will allow to choose whether to set a markup or a text
to the text part.
2017-09-28 19:32:02 +03:00
Jean-Philippe Andre 419f3935c6 edje: Add part_type_get API
For now I made this EO-only but this definitely could be expose in
legacy API as well.

This simply gives exact information about the type of part, after doing
a recursive search. Edit Edit doesn't do a recursive search, only a
direct one, which can yield invalid results (eg. RECT or NONE instead of
TEXT in case of "elm.units.max" for a slider).

@feature
2017-09-21 12:28:20 +09:00
Daniel Hirt d44131a3aa Edje: move selection-related part_text API to legacy 2017-09-20 09:19:33 +03:00