Commit Graph

200 Commits

Author SHA1 Message Date
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
Daniel Hirt 380b3eb09a Edje: move IMF-related part_text API to legacy 2017-09-20 09:19:33 +03:00
Jean-Philippe Andre f53fe993a6 edje: Merge calc_size_min_restricted & calc_size_min
calc_size_min was just a helper passing 0,0 to the restricted form.
Let's not duplicate APIs in EO and use an optional argument instead.
Bindings should be nicer and C could use a macro if it's too cumbersome
to pass in 0,0.
2017-09-18 17:37:23 +09:00
Jean-Philippe Andre 641a58f735 edje: Use Eina.Size2D for min calc 2017-09-18 17:26:53 +09:00
Jean-Philippe Andre 942cbbed73 edje: Use Eina.Size2D for group min & max size 2017-09-18 17:26:53 +09:00
Jean-Philippe Andre a72f3ec64e efl: Use Eina.Size2D for size hint combined min
For this patch I decided to add a pseudo legacy wrapper as the function
is called in a very large number of places. Fixing all those calls to
use the size2d form is a lot of work and a greater risk of b0rking
something.
2017-09-18 16:33:33 +09:00
Jean-Philippe Andre 83ea35541c edje: Use Eina_Rectangle for parts_extends_calc (EO) 2017-09-13 18:03:34 +09:00
Jean-Philippe Andre a973294820 edje: Rename part external class
This was missed in the previous commit as this special part class didn't
include the internal keyword.

Ref T5315
Ref T5306
2017-09-13 13:58:38 +09:00
Jean-Philippe Andre 46001cde38 edje: Remove use of smart clipped data
This removes dependency on a legacy structure.
Edje object does not change the smart data, unlike evas box and grid.
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre 8d7dc6ae24 edje: Add legacy compatibility code
This affects:
 - edje_object_part_swallow
 - edje_object_part_swallow_get

Fixes T5944

@fix
2017-09-12 17:27:02 +09:00
Jean-Philippe Andre 240cc9e501 edje: Move size_min/max and data to an interface
The new interface is:
  Efl.Canvas.Layout_Group

I'm not fan of the name.

Ref T5315
2017-08-04 11:52:17 +09:00
Jean-Philippe Andre 6df17b2ed0 edje: Split off calc APIs to an interface (EO)
Those APIs can then be used by Elm.Layout, hopefully
simplifying the API.

I wonder if the APIs should be prefixed "calc_" (as is)
or "layout_calc_". The extra "layout_" prefix would make
it common with other layout APIs (eg. signals, data,
size min/max, ...).

Ref T5315
2017-08-04 11:52:16 +09:00
Hosang Kim f41e276160 slider: Allow range limitations
Summary:
When user drags slider, slider value cannot be changed by API.
However the necessity of above behavior has emerged.
Because sometimes applications want limitation of slider value.

Test Plan: elementary_test -> slider -> Limited

Reviewers: woohyun, cedric, SanghyeonLee, singh.amitesh, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4883
2017-07-11 16:34:14 +09:00
Youngbok Shin 0735f6aa61 edje: support legacy Textblock calculation logic for 1.18 edje file
Summary:
From EFL 1.19, Edje Textblock calculation logic was fixed according to
Edje documents. But, it broke old edje files which ignored text.min
option for minimum width. Even if the old edje files were wrong,
we need to support them as discussed from T5548.

Also, this patch will change default efl_version to 1.18 from 1.19.
So, without efl_version property, edje file will run on the legacy logic.

Fixes T5548

Test Plan: Turn on/off presentation mode in Enlightenment.

Reviewers: herdsman, cedric, jpeg, zmike, raster

Subscribers: stefan_schmidt

Maniphest Tasks: T5548

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

Adjusted by @jpeg
2017-07-04 14:13:13 +09:00
Jihoon Kim 1dcf2c814c elm_entry: Add prediction hint API
prediction hint can be used to provide an intelligent reply suggestion.

@feature
2017-06-26 13:44:58 +09:00
Jean-Philippe Andre 2dc29cfbfd edje: Remove bool return from scale_set
It was always returning true. There is little point in returning
a bool here, an invalid scale value (eg. <= 0) wouuld lead to a
state where scale_get() != scale_set() and that's about it.
2017-06-12 11:50:30 +09:00
Jean-Philippe Andre 07a25fc88c edje: Move base_scale to Efl.Ui.Base
This API is used by elementary widgets like:
  edje_object_base_scale_get(elm_layout_edje_get(ly));

This means elm_layout in fact should also expose it directly.

Ref T5315
2017-06-12 11:50:30 +09:00
Daniel Hirt 98dad1a52b Canvas layout: port 'part_text' to Efl.Text.*
The following API is now supported with efl_part:

  - Efl.Text.text { set; get; }
  - Efl.Text.Cursor.cursor { get; }
  - Efl.Text.Cursor.cursor_paragraph_first;
  - Efl.Text.Cursor.cursor_paragraph_last;
  - Efl.Text.Cursor.cursor_position { set; get; }
  - Efl.Text.Cursor.cursor_coord_set;
  - Efl.Text.Cursor.cursor_line_char_first;
  - Efl.Text.Cursor.cursor_line_char_last;
  - Efl.Text.Cursor.cursor_char_next;
  - Efl.Text.Cursor.cursor_char_prev;
  - Efl.Text.Cursor.cursor_line_jump_by;
  - Efl.Text.Cursor.cursor_copy;
  - Efl.Text.Cursor.cursor_content { get; }
  - Efl.Text.Cursor.cursor_geometry { get; }
  - Efl.Text.Cursor.cursor_text_insert;

Many of the 'part_text' functionality was moved to legacy, too.
See the edje_object.eo to see which ones are still supported.
2017-06-12 00:10:05 +03:00
Daniel Hirt 6e1b5fdd10 Canvas layout: port part_text to efl_part
You now use the following:

  efl_text_set(efl_part(edje_obj, "part"), "text");
  const char *text = efl_text_get(efl_part(edje_obj, "part"));

The former method of edje_object_part_text_set/get is now legacy.

Also, adjusted 'tests/emotion/emotion_test_main-eo.c' with
this change.
2017-06-12 00:10:04 +03:00
Mike Blumenkrantz 84c79f6c49 Revert "Revert "Edje calc: Fix textblock size calculation logic""
This reverts commit 0392cd3c48.

oops this was supposed to just be local
2017-06-09 20:20:47 -04:00
Mike Blumenkrantz 4c431c8b9c edje: add set_pointer_mode() to embryo functions
this should probably be a description-level property
2017-06-09 20:06:48 -04:00
Mike Blumenkrantz 0392cd3c48 Revert "Edje calc: Fix textblock size calculation logic"
This reverts commit a6fff5bc1e.
2017-06-09 19:14:59 -04:00
Jean-Philippe Andre 602039cf83 edje: Move some functions to Efl.Ui.Base (EO)
This introduces the new interface Efl.Ui.Base, intended to
share some APIs between Edje and Elm:
 - mirrored (rtl)
 - language
 - scale

base_scale remains in Edje.Object for now. I don't think it
applies to generic widgets.

The new interface uses eo prefix "efl_ui". It could be renamed
as Efl.Ui (no Base), or anything else. As always, I'm open to
propositions!

Ref T5315
2017-05-31 18:42:32 +09:00
Jean-Philippe Andre ce0d15ecb3 edje: Reshuffle a bit edje_object.eo
This changes a few method names:
 - freeze -> calc_freeze
 - thaw -> calc_thaw
 - update_hints -> calc_update_hints

Otherwise this is mostly about reshuffling the EO file itself
and changing documentation.

Ref T5315
2017-05-31 18:42:28 +09:00
Jean-Philippe Andre aa5ac8eed7 edje: Rename "data" to "group_data" for EO
Still not happy with the name. I'm trying to avoid a name
clash between other "data" elements in the object. This is
the EDC group "data item".

Ref T5315
2017-05-31 18:42:24 +09:00
Jean-Philippe Andre f767e8bea4 edje: Move part drag APIs to efl_part
This moves all part_drag APIs to legacy and implements them for
EO using efl_part(). All parts now support these APIs, even if
they are not draggable. Making this more fine grained would
probably be much extra work for little gain.

This creates a new interface Efl.Ui.Drag.
2017-05-31 15:41:20 +09:00
Jean-Philippe Andre 63518c4c2c edje: Implement part proxy for all parts
This is required for part_state_get, which is now based
on the EO API internally. This fixes the test case introduced
in the following commmit.
2017-05-30 13:54:35 +09:00
Jean-Philippe Andre 554dd9facf edje: Move external_param_set to a efl_part API
This adds a new class: Efl.Canvas.Layout.External.
I hate this long name...

This class represents an external part, and for now only
supports param_set/get as well as param_type_get. For now
param_type_get() still returns an Edje_External_Param_Type and
not another more generic type.

TODO: enumerate choices, return object, return content
2017-05-30 13:54:34 +09:00
Jean-Philippe Andre 11d4daf90a edje: Move part_state_get to efl_part 2017-05-29 10:49:17 +09:00
Jean-Philippe Andre da2a7e6587 edje: Implement part_geometry_get with Efl.Part
This refactors even more the edje part eo internals. But now
common part APIs can easily be implemented in edje_part.c

The API now looks like:
  efl_gfx_geometry_get(efl_part(edje, "part"), &x, &y, &w, &h)
2017-05-29 10:49:17 +09:00
Jean-Philippe Andre 7c3e732f8c edje: Remove part_object_get from EO
Ooooh. This one might be controversial, as some apps definitely
use the function. But it is so easily abused. For our EO API
we are trying to not expose any internal object, as this prevents
us from making changes to the internal behaviour and structure.
All the features that this API provided should be limited to
read-only access to the internal object. In order to replace
this, we will have to return an Efl.Part object that implements
all those APIs: geometry_get, visibility_get, etc...
2017-05-29 10:49:17 +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
Jean-Philippe Andre 3103c551f5 edje: Move prev_description out of ephysics ifdef
prev_description was used when HAVE_EPHYSICS is set, which is the
default, but I also added a use in 7072fbc2bf where the map
was not properly reset.

This removes an ugly #ifdef and opens the door to other fixes
similar to that map one.
2017-03-14 14:15:09 +09:00
Jean-Philippe Andre 7072fbc2bf edje: Fix rare issue with map
In the following sequence, the swallowed object map property is
never reset as it should have been:

- swallow object
- start program, change state to have a map
- do something
- start program, change state to have no map
    but before render, unswallow the object

At this point, the object will never be un-mapped. This is weird.
Somehow edje_calc avoids calling evas_object_map_[enable_]_set
excessively, but I believe the issue is that the object does not
need recalc. Its container needed recalc, not the child (which is
mapped). I'm not 100% sure.

Test case:
  elementary_test -to "Genlist Decorate Item Mode"
  Click on rotate, select a few items, scroll up and down. Enjoy.

Ref T1551

@fix
2017-03-14 14:04:39 +09:00