Commit Graph

212 Commits

Author SHA1 Message Date
Jean-Philippe Andre 942cbbed73 edje: Use Eina.Size2D for group min & max size 2017-09-18 17:26:53 +09:00
Jean-Philippe Andre 89733b22f6 efl_gfx_fill: Use Eina.Rectangle for fill (EO) 2017-09-13 18:09:19 +09:00
Jean-Philippe Andre 13da5e980e efl_gfx: Use Eina.Rectangle for geometry (EO)
This saves a few lines already (without even having the proper helpers
for stack rectangles).
2017-09-13 18:03:34 +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
Stefan Schmidt 4d2117ef2a edje: make the generated default program name reproducible over builds
For programs without specific names edje_cc generated default names in
the form of program_$MEMORY_ADDRESS. That worked well enough for keeping
the names unique, but it causes problems if one wants to have these files
being binary reproducible due to different memory layouts, compilers,
etc. Simply using a counter as unique part should work well enough for
our use case and help people who want to verify builds.

Thanks a lot to Bernhard M. Wiedemann for review and testing.

Fixes T5113
Ref T5495
2017-08-07 14:35:32 +02:00
Carsten Haitzler 7b59a4851e edje crash with run program references - fix
i found a crash today where a heme could cause a crash if it just did
the right things. the run program was freed while still being
accessed. so add some ref counting to keep it alive until references
go to 0. and add soem refs while we store it in lists.

@fix
2017-08-05 13:10:33 +09:00
Jean-Philippe Andre efac7d523a edje: Move signal APIs to an interface
This interface will be used by elm_layout as well.

Ref T5315
2017-08-04 11:52:16 +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
Daniel Hirt d5f781da2b Efl text: replace all usages of cursor handle to same type
Changes cursor handle name from 'Efl.Text.Cursor.Cursor_Data' to
'Efl.Text.Cursor.Cursor'.
Also, replace all usages of Efl_Canvas_Text_Cursor
with Efl_Text_Cursor_Cursor as the handle for the cursor.
2017-07-17 16:51:45 +03: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
Youngbok Shin 638ee888d9 edje: add efl_version property
Summary:
efl_version will be used to figure out which version of EFL lib
is used to develop a edje file.
If there is no property of efl_version, it will be 1.19 as default.
This feature is needed to fix T5548.

Example:
  efl_version: 1 20

@feature

Test Plan: N/A

Reviewers: cedric, jpeg, herdsman, zmike, raster

Reviewed By: cedric

Maniphest Tasks: T5548

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-06-14 14:24:08 -07: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 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
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 9575bc8f8b edje: Remove external_object_get from EO
This will be replaced by a trick: composition on the part
object itself!
2017-05-30 13:54:34 +09:00
Jean-Philippe Andre 7ce7d4cc27 edje: Remove part_external_content_get from EO
I couldn't find a use of this API. This looks like it returns
an object inside a part inside an external (so, inside an edje).

Kept as legacy only.
2017-05-30 13:54:34 +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 e7abfba034 edje: Fix typos and overall strange function name
popornot was supposed to be propornot which stands for prop or not.
prop itself means propagate. Why choose a name so complicated? :)
2017-05-24 11:04:58 +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
Jeeyong Um e105646041 edje_cc: introduce "Anchors" - easy way to set parts relationship
Test Plan: compile src/examples/edc-anchors.c and run

Reviewers: zmike, raster, cedric, jpeg

Reviewed By: raster, jpeg

Subscribers: raster, barbieri, zmike, SanghyeonLee, taxi2se, Jaehyun_Cho

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-04-25 16:25:15 -07:00
Jean-Philippe Andre c0db1f4225 edje: Add workaround for misuses of clip_set
An unfortunately very common misuse of clip is as follows:

- Layout A is created (edje object / elm_layout)
- Object B is swallowed inside A
- Clipper C is set to clip B

This is a invalid usage, as layout A takes control over the clip
property of B (just like it does for geometry, visibility, color...).

Since 75ec3a7338 edje_recalc resets the clip at every calc
loop, as it can change between states.

In the past, edje_recalc did not reset the clip so anyone could
(wrongly) swallow an object and then change its clip from C to modify
its color, mask it, blend it, etc... Even though this was not proper
use of the API, this is not very clearly documented, and since it
worked, it has been (ab)used a lot already.

The result now is that a clipper set from C will become visible
as an opaque white rectangle covering the entire UI. Booh.

This patch is a workaround that should have no impact on well
written applications. As a bonus this avoids an extra call to
clip_set() from edje.

@fix
2017-04-10 16:14:45 +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
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
Bruno Dilly 9308410479 edje: support filtering allowed seats per part
collections.group.parts.part.allowed_seats keeps a list
of seat names to be used for events filter.

So when evas devices of seat type are added, filters
may be applied for each part.

If no seat is listed, every seat may interact with such
part.
2016-12-21 23:03:33 -02:00
Bruno Dilly 9bc9fde90e edje: add function on embryo to control focus
Add set_focus(part_id) and unset_focus().
Both functions accept an optional argument "seat_name".
If not provided default seat will be assumed.
2016-12-21 23:03:33 -02:00
Cedric BAIL a27561b5f5 edje: add infrastructure to test value. 2016-12-20 16:39:30 -08:00
Bruno Dilly 287486e920 edje: add flag to choose between evas or edje seat naming
collections.group.use_custom_seat_names should be set to '1'
to use seat names on signals as provided by Evas.

By default just follow Edje naming approach
("seat1", "seat2", ...)
2016-12-19 14:58:35 -02:00
Bruno Dilly bb3fd015de edje: add names for seats following an incremental pattern
This way it'll be possible to write EDC with seat names that
will work no matter how seats are named by each ecore_evas
backend or users.
2016-12-19 14:58:35 -02:00
Bruno Dilly 5cfdf3ec3a edje: support seat on focus action and signals
Seat goes as an optional parameter for FOCUS_SET (if not
provided, act over default seat), and emit signals
with seat suffix:
 * focus,in,$SEAT
 * focus,out,$SEAT
 * focus,part,in,$SEAT
 * focus,part,out,$SEAT
2016-12-19 14:58:35 -02:00
Bruno Dilly fecd59fe32 edje: add new signals providing seat information
Add the following signals:
 * mouse,in,$SEAT
 * mouse,out,$SEAT
 * mouse,move,$SEAT
 * mouse,clicked,$BUTTON,$SEAT
 * hold,on,$SEAT
 * hold,off,$SEAT
 * drag,$SEAT
 * drag,start,$SEAT
 * drag,stop,$SEAT
2016-12-19 14:58:35 -02:00
Jaehwan Kim 7cce8ae40d edje_calc: round the scaled value when it is casted to int type.
It rounds the value for the more precious calculation when the scaled
value is casted to int type.
2016-11-30 14:00:11 +09: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
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Carsten Haitzler 6139c7a3c6 edje - reduce anothr 400k or so of memory usage (esp hello world)
so edje was allocating 32 pointers per collection. this is per
collection inside an edje file even if we just use one collection from
that edje file. it consumes 32 pointers. on 64bit thats 256 bytes...
just for pointers to mempools so we can "optimize" freeing and
allocation of parts. this was simply rediculous. i moved it to a
sub-struct allocated on demand (so now only for collections we
actually use) and this nuked 400k of "base memory usage youcant get
rid of).

note that our current default theme has something like 1100 or so
images, 1500 or so collections in it. as theme gorws, memory footprint
goes up if we dont allocation only on demand (when needed/used) and we
aren't careful about the size of our data structs and their content.

@optimize
2016-08-21 11:14:28 +09:00
Jean-Philippe Andre ae3ac0cd25 edje: Allow no_render in description
Previously, it was limited to the part block. It was a mistake
and should have been put in the description instead, as this
allows it to change during state transition (like visible, or
proxy_src_visible).

@feature
2016-08-16 20:08:32 +09: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
Carsten Haitzler 1d6a58cfc9 edje - save memory on edje parts as a lot of over-allocation was done
so ... Edje_Calc_Params was huge ... like about 200 bytes. every part
in every live edje object got one of these in addtion to real part
struct info etc. ... so really every part was probably consuming
300-500 bytes or so... crazy. so i made a lot of the data now optional
so only the minimum required is allocated now which cuts down about 110
or even 120 bytes per part, depending. 100 bytes was needed for 3d
node parts even though almsot no parts are 3d node parts... the image
and text data was 30-40 bytes so we consumed 100 even if we only used
30-40... so this cuts that done and puts in polace calc param cleanup
funcs everywhere they are needed to clean up this extra allocated data.

i also reduced this even more by maping pointers to req_drag, map and
physics and clip_to fields in another extension struct cutting
down another 28/52 bytes on most parts (in  return for an added
4/8 bytes - on 32/64bit accordingly).

in elementary_test this saves about ~300kb of ram for just having the
etst run and displaying (peak memory measuremment). so massif says
10.6M -> 10.3M.

@optimize
2016-08-15 09:21:08 +09:00
Carsten Haitzler 0779adcf0b edje - remove unused fields from part desc and calc params
fill spread and angle have never been used - resevred intitially for
gradient objects, but never put into use, so remove to get rid of
junk/memory footprint etc.

@optimize
2016-08-14 13:51:52 +09: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
Carsten Haitzler 1d0b500fa8 edje - reduce memory footrpint by dlopening ephysics on demand
this saves about another 80Kb or so in dirty pages by only loading
ephysics when needed. This removed ephysics and bullet library dirty
pages from the process space. this is another patch to address T4227.

@fix
2016-08-01 19:11:39 +09:00
Subhransu Mohanty 7af272d93c edje: Fix handling of polygon and polyline node.
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4203
2016-08-01 13:23:44 +09:00
Subhransu Mohanty e3ed888aa9 edje: fixed issue with applying transformation and stroke width
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4192
2016-07-26 14:33:15 +09:00
Jee-Yong Um 5a3c015e9e edje: add required attribute in Edje_Part
Summary:
When using EDC written by another person, developer usually
does not need to know all specified parts in EDC but editable
like swallow, text or textblock parts.
The required flag tells whether the part is intended to be used outside EDC.

Reviewers: jpeg, cedric, raster, Hermet

Reviewed By: jpeg, raster

Subscribers: raster, NikaWhite, kimcinoo, jpeg

Differential Revision: https://phab.enlightenment.org/D3579
2016-07-15 16:34:34 +09:00
Subhransu Mohanty 9be9da17bf edje/svg: added _edje_svg_node_free() function
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4143
2016-07-07 16:29:21 +09:00
Subhransu Mohanty 80413dda8c svg/loader: use stringshare instead of malloc for storing string.
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4142
2016-07-07 16:27:17 +09:00