Commit Graph

214 Commits

Author SHA1 Message Date
Jean-Philippe Andre ec1acca74d evas vg: Add FIXME and fix strbuf use
This is the result of a really quick review of the new VG code. Most of
it was moved around, but this merge includes the following:
 - Move logic from edje to evas
 - Create static lib for common VG handling
 - Add file_set() API
 - Add a basic VG cache in evas side
 - Add savers modules, implement loaders and savers.
2017-10-27 14:58:38 +09:00
subhransu mohanty d5c8822107 edje: use the file_set api from vg canvas to load and parse svg file. 2017-10-27 14:58:38 +09:00
subhransu mohanty d267595557 evas: add set function for root_node property.
Summary:
Currently user ask for the root_node from the evas_vg object and then attach its tree by setting the root node as parent.
With this change this process will be explicit. user has to set the root node to the evas_vg object and the object will take the ownership
of the tree. User can query the current vg_tree by root_node_get api.

Test Plan:
        Fixed the test app to reflects this change.

Reviewers: jpeg, cedric

Reviewed By: jpeg, cedric

Subscribers: cedric

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2017-10-23 11:05:38 -07:00
Thiep Ha 6597b89f53 edje: correct the usage of EINA_SIZE2D
The usage of EINA_SIZE2D macro as left hand side variable
does not save the size value. The Eina_Size2D should be used.
2017-10-18 10:51:49 +09:00
Cedric Bail a6dcaa0f9a evas: remove use of engine image_load from Evas.Canvas3D.Texture. 2017-10-04 21:32:22 -07:00
Carsten Haitzler 22466b991c edje - fix check return of _edje_fetch
fixes CID 1381326
2017-09-28 15:28:00 +09:00
Jean-Philippe Andre 7d2b4b6916 efl: Use Eina.Size2D for size hint restricted min
This is the "internal" or "intrinsic" minimum size, to be set by EFL and
not by applications.
2017-09-18 14:57:52 +09:00
Jean-Philippe Andre 4c634ed78e efl: Use Eina.Size2D for Efl.Gfx.size
Big patch as a lot of things call or reimplement size_set. Hopefully I
got it right... fingers crossed.
2017-09-18 13:34:50 +09:00
Jean-Philippe Andre 8fb194d969 efl: Use Eina.Position2D for Efl.Gfx.position
Note: This is a little bit more cumbersome in some places but in most
it's more convenient than (x,y).
2017-09-18 13:22:54 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +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 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
Hosang Kim 05e3e450e5 slider: fix jumping handler bug.
Summary:
Actual slider value is not changed.
So when user release mouse or touch, slider value is returned
to the value by user set.

This is a partial revert of f41e276160

Fixes T5745

Test Plan: elementary_test -> slider

Reviewers: jpeg

Subscribers: cedric

Maniphest Tasks: T5745

Differential Revision: https://phab.enlightenment.org/D5031
2017-07-20 15:28:32 +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
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 0392cd3c48 Revert "Edje calc: Fix textblock size calculation logic"
This reverts commit a6fff5bc1e.
2017-06-09 19:14:59 -04:00
Cedric BAIL 7caa81ed9d edje: object have small difference and we use switch case fallthrough to reuse code. 2017-06-05 12:07:57 -07: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
Minchul Lee 82f0be9a32 edje: null checking the return value of a function eina_mempool_malloc
Summary:
The return value of the function eina_mempool_malloc was dereferenced without checking. I added the checking code similar to the other codes.
@fix

Reviewers: raster, cedric, jpeg, herdsman, woohyun, stefan_schmidt

Subscribers: stefan_schmidt

Differential Revision: https://phab.enlightenment.org/D4855
2017-05-08 15:39:21 +02: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
Jean-Philippe Andre 882ad6fbf5 edje: Fix a major issue with recalc loop
With the new Efl.Ui.Clock widget, which implements Datetime,
most parts are relative to each other, and trigger a near-inifinite
recalc of all the parts. Indeed edje was recalculating a part even
if it had already calculated it (flag is set).

This seemingly simple patch fixes Datetime and probably a lot
of other edje widgets.

Fixes T4909

@fix
2017-02-21 17:56:31 +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
Carsten Haitzler e22de29461 edje - fix border scale by interpolation
several theme elements uses transitioning border scale by for
animation and this has been broken for quite some time now. the theme
sall looked wrong for ages. i just never junted down exactly why, but
i know... i wrote the themes that made use of scale by animation
interpolating from like 0.1 to 1 and so on to make for example a
shadow go from sharp to blurry... the theme hasnt changed. edje did.
it broke.

this fixes it back to where it was. interpolation now works. i left a
comment so no one tries to "fix it".

@fix
2017-01-25 22:30:13 +09:00
Cedric BAIL b3ce8381e2 edje: fix float comparison warning in edje calc. 2016-12-20 16:39:30 -08:00
Cedric BAIL 0f65bde10c edje: handle case when strdup would be NULL.
alternate solution to D4488. Would be better to have a buffer and recycle it.
2016-12-16 15:15:17 -08:00
Thiep Ha a94f30f1dc edje_calc: remove redundant checking
We check amin > ZERO && amax > ZERO, so no need to do it them again.
2016-12-14 17:59:40 +09: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
Hosang Kim 304ca158be edje_calc: add rounding pixel calculation for transition.
Summary: when transition animation is working, sometimes one pixels loss occurs.

Reviewers: cedric, woohyun, jpeg, raster

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D4341
2016-10-11 21:32:23 +09:00
Vitor Sousa 8356b16a49 Efl Object: remove legacy callback calls from event_callback_call
Efl.Object.event_callback_call no longer calls legacy smart callbacks;
calling only event callbacks registered with the given event description
pointer.

Create the method Efl.Object.event_callback_legacy_call to inherit the old
behavior from Efl.Object.event_callback_call, calling both Efl.Object events
and legacy smart callbacks.

Update all other files accordingly in order to still supply legacy
callbacks while they are necessary.
2016-08-26 15:45:07 -03:00
Jean Guyomarc'h 4285fc1dda edje: fix warning raised by clang
Clang was not happy with the initialization of
the structure.
2016-08-22 19:57:06 +02:00
Carsten Haitzler 419f84907b edje - fix missing vector field frees, copies, handling etc.
it seems vector type parts were not handled all that well. we had at
least one mem leak with the vector mempool never being freed... so i
filled in various missing points where vector parts were not being
handled right.

@fix
2016-08-21 11:30:45 +09: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
Carsten Haitzler 4be972c41c ejde - fix recalc single min n edje for h eval
this fixes a seemingly small typo that would only turn up with fixed
point, but not floats as we have by default whwere we had
  x = 999;
instead of
  x = FROM_INT(999);

shouldn't be visibule unless you disable float support and use fixed
point in edje.
2016-08-18 14:21:08 +09:00
Carsten Haitzler 6f9f361f3e edje - solve crash issues brought on by optimization of edje mem usage
this solves a crash brought on by 1d6a58cfc9
that optimized mem usage but seems to have created issues in empc.

fixes T4382
2016-08-18 14:21:08 +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
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 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
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Subhransu Mohanty d458101a41 edje: updated the start index of vector resource from 1 to 0
Reviewers: cedric, jpeg

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
2016-08-03 17:34:57 -07: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
Stefan Schmidt 3f4b2a2c90 edje: remove now unused variables
Commit e3ed888aa9 removed the code where these
variables have been used before.
2016-07-26 12:41:19 +02: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
Chris Michael 4555f5d594 edje: Fix unchecked return value
Coverity reports that we call _circular_dependency_find here without
checking the return value

Fixes Coverity CID1349867

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-07-21 12:29:35 -04:00
Youngbok Shin 982ef0b9d0 Edje calc: Fix Evas Text width calculation with ellipsis
Summary:
To keep consistency with Evas Textblock part in edje,
text.min has to work logically even if ellipsis is enabled.
If a Text part has minimum width, maximum width and "text.min: 1 X;",
Text part should be expanded until its width reaches to the maximum width.
Then, ellipsis will work. Singleline Textblock is also working like this.
@fix

Reviewers: cedric, herdsman, raster, tasn

Subscribers: Blackmole, z-wony, jpeg

Differential Revision: https://phab.enlightenment.org/D3587
2016-07-12 10:48:17 +09:00
Cedric Bail 1be63c1b66 edje: fix build without ephysics.
T4050
2016-07-08 14:16:39 -07:00
Hermet Park 9873358f68 edje: fix the map state issue.
While the part state switching, map won't gonna be disabled again,
due to the incorrect state checking.

If there param1 indicates the current state with map off.
then it should disable the map obviously.
But It assumed the param1 is the previous state, not the current!,
so the map didn't go disabled state.

It was intended to avoid the duplicated map state setting.
So to keeping the intention, now it disable the map, only if
the map is actually enabled.

So both are fine.

@fix
2016-07-08 21:22:44 +09:00