Commit Graph

183 Commits

Author SHA1 Message Date
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
Youngbok Shin a6fff5bc1e Edje calc: Fix textblock size calculation logic
Summary:
In singleline textblock, using "text.min: 1 0" and min, max width,
Edje allows to use expandable text with ellipsis. It shows ellipsis
when only text's width reach the max width.
But, Edje couldn't support same feature on multiline textblock.
Edje dose not use max height or text.max properly if ellipsis is enabled.
This feature is very useful to make a layout with dynamically aligned text.
@fix

Reviewers: cedric, tasn, woohyun, raster, herdsman

Subscribers: z-wony, eagleeye, jpeg

Differential Revision: https://phab.enlightenment.org/D3595
2017-02-14 16:17:02 +09:00
Jee-Yong Um 57c14f1c55 edje: fix cached edje modification issue
Summary:
_edje_part_***_set/get (for mouse_events, repeat_events, ignore_flags, mask_flags)
overwrite cached edje value. These behaviors affect all edje object added after
these changes, and result in not intended.

@fix

Reviewers: jpeg, cedric

Subscribers: akanad, woohyun

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 15:14:54 -08:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Cedric BAIL a5804c970d edje: fix float comparison warning in vector loading logic.
Hum, there is no use of our fixed point infrastructure for vector.
2016-12-20 16:39:30 -08:00
Jee-Yong Um 0fd1445508 edje.object: implement Efl.Observer interface
Summary:
To remove duplicated lines to handle edje class (color, text, size),
observer interface is implemented to Edje.Object.

Reviewers: jpeg, cedric

Reviewed By: cedric

Subscribers: bu5hm4n, cedric

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-11-01 11:48:44 -07:00
Marcel Hollerbach 58dedf4674 edje: protect against no file set yet.
Summary:
There can be the case that the file of a edje is NULL. Even if this case
is a bit strange, we should not crash on it.

Sample code which produces the crash:

   Edje_Object *edje;
   int r, g, b, a;

   edje = edje_object_add(evas);

   edje_obj_color_class_get(edje, "bla",
	EDJE_COLOR_CLASS_MODE_COLOR, &r, &g, &b, &a);

So better protect against this case.

Reviewers: raster, herdsman

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4277
2016-09-04 13:46:38 +02:00
Jee-Yong Um 4fc6d3cf90 edje: resolve user defined string with type
Summary: Resolve Edje_User_Defined string with type (normal/escaped/unescaped)

Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4219
2016-08-16 16:14:21 +09:00
Jee-Yong Um 14ff664b76 edje: clean up APIs
- convert methods to property setter/getter
- remove "values" block when getter returns read_only value
- fit the type of params of eo funcs to those of legacy APIs
2016-08-16 15:38:42 +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
Carsten Haitzler 749bc23231 edje - replace eina list with eina inlist to save mem and performance
edje was keeping every edje object created in an eina list so it could
access them later. not really great when every list node contains at
least 4 pointers (data, next, prev and accounting, possibly magic
too). also ever time an edje object is deleted it has to remove from
this list which means... walking the list to where the obj is... not
great. replace with an inlist which is just 3 ptrs, no extra pressure
on list pool and removal os O(1) too.

@optimize
2016-08-14 12:25:59 +09:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Davide Andreoli 7c01254ba7 edje: fix color class broken by b543f4c896.
T4270

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-08-02 16:54:33 -07:00
Jean-Philippe Andre 365a322f01 edje: Remove invalid call to recalc in efl_part
What a mess... Assuming efl_part() had no side effect on the
object it took me hours to figure out that there was a wrong
call to _edje_recalc_do in the efl_part() function itself.
That was bad, and existed because efl_part() used to be
efl_content_get().

efl_part() should not have any side effect.

Also, fix a return value in content_remove.

Fixes T4214 (invalid redraw and crash in terminology).
2016-07-26 18:57:38 +09:00
Carsten Haitzler d143becfe1 edje lang set - fix coverity harmless complaint
fix CID 1357755
2016-07-19 16:41:06 +09:00
Shinwoo Kim c52eda0bf1 edje: the repeat_events property of swallowed object probably should follow the repeat_events property of swallow part object
Summary: Need discussion about the repeat_events property

Test Plan: Swallow an object which has EINA_TRUE repeat_events to a swallow part which has EINA_FALSE repeat_events

Reviewers: Hermet, cedric, raster, jpeg

Reviewed By: raster, jpeg

Subscribers: jaehwan, seoz, woohyun

Differential Revision: https://phab.enlightenment.org/D3580
2016-07-12 10:53:32 +09:00
Carsten Haitzler 899d2d957a edje - language emit - handle null language and convert to none
cleans up an emit string being edje,language,(null) if no language is
set. use none instead of (null).
2016-07-11 13:46:21 +09:00
Jee-Yong Um 399bb5a0ba edje: add a helper for recursive searching in hash
Summary:
If color class of an edje part is defined as "aaa/bbb/ccc/ddd",
edje will search for color class by the following sequence.
   "aaa/bbb/ccc/ddd"
   "aaa/bbb/ddd"
   "aaa/ddd"
   "ddd"
So, without additional lookup table, edje classes (color, text, size)
can have the functionality like inheritance.

Reviewers: jpeg, raster, cedric

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-07-08 10:50:20 -07:00