Commit Graph

275 Commits

Author SHA1 Message Date
Myoungwoon Roy, Kim 28cf881861 edje: fix memory leak in edje part recalculation.
Allocated part_array is only freed when _circular_dependency_find() is successful. It is not freed in other cases.

Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org>
Reviewed-by: woochan lee <wc0917.lee@samsung.com>
Differential Revision: https://phab.enlightenment.org/D11886
2020-05-27 15:19:03 +02:00
Hermet Park 532e8056c6 canvas vg: fix dangling vector containers.
These duplicated containers are not going removed
since its refernece is always more than 0.

We need to unref explicity when they have to

@fix
2020-05-26 16:21:24 +09:00
junsu choi 6a14507edc edje_calc: Add unload file for already loaded vector lottie file.
Summary:
Users can use multiple jsons per description in one part in edc.
At that time, multiple files are loaded,
if a file is already loaded, it must be unloaded.

Test Plan:
edje_cc -beta -id ./ json_edc.edc
make
./test
Push Change button -> shutdown application

{F3882716}

Reviewers: Hermet, herb, kimcinoo

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11820
2020-05-13 21:58:17 +09:00
WooHyun Jung de943b82aa edje_calc: add null check after eet_read 2020-04-13 10:39:34 +09:00
Hermet Park 0583b14307 canvas 3d: remove canvas3d edje
Summary: Remove functional stuff, leave as deprecated for compatibility.

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11541
2020-03-19 18:49:17 +09:00
junsu choi 107e425ef6 edje: Rename Json to Lottie in edj supporting
Summary:
The json file used by edje is for lottie output.
json can be used in many ways. So the purpose is clear.

Test Plan: N/A

Reviewers: Hermet, kimcinoo, herb

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11478
2020-03-10 15:42:13 +09:00
Wonki Kim 7da106ec68 edje: modify to respect user set fixed property
Summary:
this patch is related with @D11365.

rather than undoing optimization edje calc,
this patch introduces a user_set property which enables edje_calc
to respect user set property.

Reviewers: bu5hm4n, eagleeye, YOhoho, Hermet, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers, woohyun, eagleeye, bu5hm4n

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11366
2020-02-19 12:40:39 -05:00
junsu choi a4311f73ee edje: Disable the json vector animation feature with a flag.
Summary:
Json vector animation requires the json loader to be loaded.
Therefore, if the loader does not load,
it prints an appropriate error message and disables the feature.

Depends on D11228

Test Plan: N/A

Reviewers: Hermet, Jaehyun_Cho, id213sin

Reviewed By: Hermet

Subscribers: raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11230
2020-02-17 19:14:14 +09:00
YoungBok Shin 2fe158ce65 edje: add json file support feature
Summary:
It also starts to support following new edc properties.
This is backported patch from Tizen 5.0

1. frame
desc { "default"
   vector {
      frame: 0.5; // 0.0 ~ 1.0
   }
}

2. actions
program { "vector_animation";
   // VG_ANIM_PLAY, VG_ANIM_PLAY_BACK, VG_ANIM_LOOP,
   // VG_ANIM_STOP, VG_ANIM_PAUSE, VG_ANIM_RESUME
   action: VG_ANIM_PLAY;
   target: "your_vector_part";
}

@feature

Co-authored-by: Jaehyun Cho <jae_hyun.cho@samsung.com>
  - Fix to remove Efl.Canvas.Animation_Player on edje

Test Plan:
{F3840540}
{F3840542}
{F3840543}
make and test attached file

edje_cc -beta -id ./ json_edc.edc json.edj
gcc -o test test_edc.c -g `pkg-config --cflags --libs evas elementary rlottie`
./test

Reviewers: Hermet, Jaehyun_Cho, id213sin

Reviewed By: Hermet

Subscribers: segfaultxavi, raster, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11228
2020-02-17 18:59:09 +09:00
WooHyun Jung fe7a7fa3af edje_calc: add null checking and remove unreachable code 2020-02-14 10:38:24 +09:00
Carsten Haitzler 68d7f584cb edje - store original size in edje struct and dont exceed max size
evas can tell us max texture size. in edje when we have image sets
(multiple images that make up mipmaps effectively for a logical
image), we now can avoid choosing an image that exceeds max texture
size. this actually fixes bugs i have seen on the rpi3 which has a max
texture size of 2048 which makes it easy to exceed it with wallpapers
or even terminology's default theme.

so combo of new feature and fix... but requires a rebuild of the edj
files...

@feat + @fix
2020-01-22 23:34:05 +00:00
Carsten Haitzler adbf79a3a8 edje - min calc - ix more regressions due to optimizations
again 37b55172b0 broke min size calc.
this time it was for mouse cursors. the entry cursor was 0 sized after
commit 37b55172b0. this disables the
"don't cacle if its 0 sized) which isnt a valid thing to skip - you
caqn min size calc a 0x0 edje ... and it should then return a valid
min size given that design/layout.
2019-12-01 22:56:15 +00:00
Carsten Haitzler 2ca6c301e4 edje - fix min size calc after being broken by previous commit
37b55172b0 breaks min size calc. elm
toolbar was being squashed. e toolbars also were becoming 0 sized.
Just because a swallow does not have content does not mean it does not
affect the minimum size. there still could be a min size set on it
anyway etc. ...
2019-11-28 00:06:15 +00:00
Woochanlee 4ebbe0ad04 edje_calc: Creation macro that perform edje calc, regardless of the edje size.
Summary: edje_recalc_do() needs to be executed regardless of the size of edje in order to deliver edje properties for the API that the user calls.

Reviewers: cedric, Hermet, Jaehyun_Cho, smohanty

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10724
2019-11-26 13:57:16 +09:00
Carsten Haitzler 9876a78fd3 edje - box - calc min size correctly at start ...
this fixes a logic hole where no chosen desc has been applied yet to a
box and thus it has no start layout thus no way to calc a min size.
this breaks min size calcs you do when setting up and object. this
fixes that by forcing the chosen desk on a min size calc so there is
one.

@fix
2019-11-16 14:22:48 +00:00
Lauro Moura 4832d9bfb8 edje: Remove warnings
Missing declaration from another file and removing unused variable.

After D10605

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10674
2019-11-14 10:52:04 -08:00
Woochanlee 37b55172b0 edje_calc: Exception handling if no calculation is required.
If there is no object swllowed, do not run part_calc on it.
This swallow will be calculated if there is an associated part, otherwise it will not need to be calculated.

When the app is launched, a lot of edje calculation logic is executed.
Most of the edje size is missing, so the calculation result is meaningless.
Added code to prevent this.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10605
2019-11-14 10:08:56 -08:00
Woochanlee 249ffd6a50 edje_calc: UNLIKELY changed to LIKELY.
It should takes true almost all times when it checks.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10606
2019-11-06 03:01:56 -08:00
Woochanlee d5bd2ed2d0 edje_calc: Remove unused flag.
Summary: This has marked remove me.

Reviewers: raster, Hermet, zmike, devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10561
2019-10-30 08:10:09 -04:00
Woochanlee 8536c066eb edje_calc: Delete duplicated conditional statement.
Summary: this is identical to the conditional above and can be merged
to improve code clarity

Reviewers: raster, Hermet, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10549
2019-10-29 10:19:43 -04:00
Mike Blumenkrantz b1a2d82417 edje: block "recalc" event emission if it isn't being subscribed to
Summary:
this gets called a ton

ref T8321
Depends on D10356

Reviewers: bu5hm4n, cedric

Reviewed By: bu5hm4n, cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10357
2019-10-14 09:29:50 -04:00
Carsten Haitzler d436971958 edje calc - merge 2 switch statements that are doing 2 phases
we have nigh identical switch logic, so merge these to avoid multiple
switches and type matches. it localises per-type logic too which is
nicer.
2019-08-21 20:02:23 +01:00
Carsten Haitzler cfa8224140 edje recalc - move rare recalc code out of hot path
we rarely use tables in edje, so move it out of the hot path for
intruction prefetch/cache. also for calc single - move things to sub
funcs so things like mesh, light and so on code is always out of the
hot path as much as possible. we probably can merge our 2 switch
statements as well. this really just restructures the code to move
stuff into sub functions which also does make the calc funcs look
simpler and easier to read.
2019-08-21 20:02:23 +01:00
Carsten Haitzler 8dbdcff3cb Revert "edje/calc: clamp part calc size to 0"
This reverts commit 895ffd93cc.

This commit broke E's widget toolbars that only had text - so many
config dialogs broke. too simple to fix - it's a wrong premise to
begin with it would seem.
2019-07-31 10:17:06 +01:00
Mike Blumenkrantz 895ffd93cc edje/calc: clamp part calc size to 0
this could previously have been negative

@fix

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9431
2019-07-29 11:17:51 -07:00
Subodh Kumar 2854702f8e edje: Add support for map zoom to use other part center.
Summary:
Current:
In edc, zoom is supposed to happen from object center, there is no way to
change the center of the zoom.

Changes:
Adding support to change the center of zooming just like map rotation by using
other part's center.

@feature

Reviewers: cedric, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9115
2019-07-12 12:04:06 -04:00
Mike Blumenkrantz 738241c0bd edje/calc: correctly handle swallow/group objects as clippers for state clips
Summary:
in the case where the clipper being set was an indirect object, it's necessary
to resolve the lookup for that part and use the actual part object to avoid
setting a placeholder rect as the clipper

@fix
Depends on D8850

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8851
2019-05-29 12:29:03 -04:00
Yeongjong Lee 0921e4770e edje_calc: replace eina_stringshare_ref with eina_stringshare_add
Summary:
When there is circular dependency in edc, a bunch of CRI log is printed.
This patch fixes it.
```
ERR<10159>:edje lib/edje/edje_calc.c:3919 _edje_part_recalc() Circular dependency in the group 'test' : longpartname -> longpartname -> longpartname2
ERR<10159>:edje lib/edje/edje_calc.c:3896 _edje_part_recalc() Circular dependency when calculating part "longpartname". Already calculating XY [03] axes. Need to calculate Y [02] axes
CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ebf60 !!!
    Input handle is wrong type.
    Expected: 98761254 - Eina Stringshare Node
    Supplied: 2f736e6f - (unknown)

CRI<10159>: lib/eina/eina_share_common.c:559 _eina_share_common_node_from_str() *** Eina Magic Check Failed at 0x7fb7c93ec5d1 !!!
    Input handle is wrong type.
    Expected: 98761254 - Eina Stringshare Node
    Supplied: 5f747261 - (unknown)
```
If string is already stored, `eina_stringshare_add` increase its reference count.

Test Plan:
test.c
```
//edje_cc test.edc && gcc -o test test.c `pkg-config --libs --cflags elementary`
#include <Elementary.h>

int main(int argc, char **argv)
{
   elm_init(argc, argv);

   Evas_Object *win = elm_win_util_standard_add("test", "test");

   Evas_Object *layout = elm_layout_add(win);
   elm_layout_file_set(layout, "./test.edj", "test");
   elm_win_resize_object_add(win, layout);
   evas_object_show(layout);
   evas_object_resize(win, 200, 200);
   evas_object_show(win);

   elm_run();

   elm_shutdown();

   return 0;
}
```

test.edc
```
collections {
   group { name: "test";
      parts {
         rect { name: "longpartname";
            desc { "default";
                rel1.to: "longpartname2";
            }
         }
         rect { name: "longpartname2";
            type: RECT;
            desc { "default";
                rel2.to: "longpartname";
            }
         }
      }
   }
}
```

Reviewers: SanghyeonLee, zmike

Reviewed By: SanghyeonLee

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8717
2019-04-26 15:33:33 +09:00
Shinwoo Kim e9b2e3c6c3 Revert "edje_calc: make INTP use TO_INT_ROUND"
Summary:
This reverts commit be00af9bc3 which has
incorrect calculation. For more information please refer to:

https://phab.enlightenment.org/D8665

Reviewers: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8666
2019-04-19 17:25:13 +09:00
Shinwoo Kim be00af9bc3 edje_calc: make INTP use TO_INT_ROUND
Summary:
The edje_part_recalc calculates next postion(p3).
Please refer to following line.

   p3->final.y = INTP(p1->final.y, p2->final.y, pos);

If the condition is as blow, then p3->final.y becomes -50 only if pos is 1.0.
Because INP uses TO_INT not TO_INT_ROUND.

   p1->final.y == -32
   p2->final.y == -50

So we had nonsmooth ending of transition.

Test Plan:
Sample application to check this issue. Please look carefully when the rect moves from bottom to top.

{F3627740}

{F3627739}

Reviewers: cedric, Hermet, jypark

Reviewed By: Hermet

Subscribers: zmike, akanad, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7842
2019-03-08 13:28:22 +09:00
Shinwoo Kim 1f7d7d0606 edje_calc: add ERR message to find out incorrect size problem
When I amended https://phab.enlightenment.org/D7842 I removed line to handle
negative value size of params final in _edje_part_pixel_adjust.
Because It was not related to the what the commit wants to fix, and I could not find
the case making param final size value negative , although I got the negative value
when I tested on a specific case. Now it seems that the negative value is telling me
"Witness Me!".

So I would like to add this change, and never let me forget the issue.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8105
2019-03-06 11:34:49 -08:00
Mike Blumenkrantz 5bfe2e89d2 evas: remove all legacy usage from eo files
this takes the current generated output from eolian for legacy code in
evas and adds it to the tree, then removes legacy references from the
corresponding eo files. in the case where the entire eo file was for
a legacy object, that eo file has been removed from the tree

ref T7724

Reviewed-by: Marcel Hollerbach <marcel-hollerbach@t-online.de>
Differential Revision: https://phab.enlightenment.org/D8107
2019-03-06 19:05:48 +01:00
Mike Blumenkrantz 12467afd40 efl.layout.calc: remove list<> usage in FIXME for event
Summary:
make this an array since there is no need to use a list here anyway

ref T7581

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7581

Differential Revision: https://phab.enlightenment.org/D8058
2019-03-04 13:42:05 -05:00
Mike Blumenkrantz 6326e18b3f efl.file: improve api a bit
Summary:
the previous implementation/api had a number of issues:
* "file" property contained both "file" and "key" values
  - also performed file loading operation
* "load_error" property which was specific to image objects
* no methods for controlling file loading/unloading

this patch attempts the following changes:
* split "file" property into "file" and "key" properties
  - also remove "key" from existing "mmap" property
* remove "load_error"
* directly return error codes from operations
* add "load" and "unload" methods for directly controlling load state
* add implicit file loading if file/mmap is set during construction
* rewrite all efl.file implementations to move file loading into load() method
* rewrite all usage of efl.file api based on these changes
* add C extension functions to mimic previous behavior

ref T7577

Reviewers: segfaultxavi, bu5hm4n, cedric

Reviewed By: segfaultxavi

Subscribers: vitor.sousa, #reviewers, #committers

Tags: #efl_api

Maniphest Tasks: T7577

Differential Revision: https://phab.enlightenment.org/D8018
2019-02-27 13:17:10 -05:00
Mike Blumenkrantz f886941b11 api: efl.gfx.size_hints -> efl.gfx.hints
Summary:
these hints are not strictly size-related, so renaming them is more consistent
with their actual function

ref T7563

Depends on D7968

Reviewers: segfaultxavi, cedric, bu5hm4n

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7563

Differential Revision: https://phab.enlightenment.org/D7977
2019-02-21 18:43:12 +01:00
Xavi Artigas 6b7346b7b2 Remove individual class BETA guards
Summary:
Eolian adds a per-class BETA guard (like EFL_UI_WIN_BETA) to any method tagged
as @beta. This means that any app (and the EFL code) wanting to use BETA features
has to enable them class by class, which is cumbersome.
This commit replaces the individual guards with the global EFL_BETA_API_SUPPORT
guard, so apps only need to define one symbol to access BETA features.

Any usage of the per-class guards has been removed from the EFL code and examples.
When building EFL the global guard is defined by configure, so all EFL methods
already have access to BETA API.
Efl_Core.h and Efl_Ui.h no longer define EFL_BETA_API_SUPPORT. Apps wanting to
use BETA API have to define this symbol before including any EFL header
(It has been added to the examples requiring it).

Test Plan:
make && make check && make examples still work, but there's a lot less #defines
in the code

Reviewers: zmike, bu5hm4n, q66

Reviewed By: q66

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T6788

Differential Revision: https://phab.enlightenment.org/D7924
2019-02-13 18:09:17 +01:00
Mike Blumenkrantz 56dbd2bf86 edje: apply maps to textblock cursors and backgrounds
when a map is applied to an edje part, it is expected that all components of
the part respect the map attributes. this requires that, in the case of
textblock parts, all the sub-parts which are internal to the textblock
(entry) object also go through the map populate and apply codepaths

fix T4977
@fix

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7648
2019-02-11 15:10:45 -08:00
Jérémy Zurcher 8a617fda97 silence most left over compiler warnings
Summary: silence -Wshadow -Wunused-variable -Wunused-parameter

Reviewers: segfaultxavi

Reviewed By: segfaultxavi

Subscribers: segfaultxavi, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7473
2018-12-18 13:08:01 +01:00
Youngbok Shin b89b221b97 edje: fix an overflow issue for state values
Summary:
Whenever _edje_recalc_do() is called, a state value of
Edje structure is increased. This increased value will be stored
in Edje_Real_Part and Edje_Real_Part_State for calculation optimazation.
But, once the state value is overflowed, it ruins calculation logic.
@fix

Test Plan:
Run an Edje file which has infinite animation for over an hour.
I'll attach an example to phab.

Reviewers: raster, cedric, woohyun, Hermet

Reviewed By: Hermet

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7264
2018-11-14 16:43:13 +09:00
Carsten Haitzler 7847af7f57 edje calc - wanr - move fallthrough tag to just before next case
fixes warning for it not being there... no bug here though
2018-11-09 11:44:00 +00:00
Carsten Haitzler 921d3b4979 edje calc - warn - fix warn about initting all fields of calc params 2018-11-09 11:44:00 +00:00
SubodhKumar f107ea2432 edje: Remove hack code
Summary:
special calculation for textblock is for fit calculation.
This is obvious from code that fit is being calculated
before text is actually been set to textblock.
I am not sure whether this is intentional or mistake
but it make sense to calculate fit after text is being
set so that formatted and native calculation can be proper.

@fix

Test Plan: NA

Reviewers: cedric, zmike, herdsman, devilhorns

Subscribers: stefan_schmidt, #reviewers, #committers, shilpasingh

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6045
2018-09-17 17:38:24 +03:00
Hermet Park 2614179af8 Revert "evas vg: changed "vg object" to "vg""
This reverts commit ec69abed9d.

Ooops, I didn't intended this patch.  @#!@#!@#!@#
2018-09-10 17:27:42 +09:00
Hermet Park ec69abed9d evas vg: changed "vg object" to "vg"
Summary:
Following our naming rule, rename to like other primitives.

i.e. efl_canvas_rect, efl_canvas_image, efl_canvas_vg ...

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7013
2018-09-10 14:06:58 +09:00
Yeongjong Lee fd87dbce38 edje_calc: remove unused variable
Summary: those variables should be removed at 05e3e450e5

Reviewers: eagleeye

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6968
2018-09-04 17:40:06 +09:00
Hermet Park 5f0002ce69 efl: vector is no more beta version. 2018-08-31 12:16:24 +09:00
Xavi Artigas 5697f6e94b Efl.Gfx.Image* (From Efl.Image*)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:40 -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
Xavi Artigas a217d4b455 Efl.Canvas.Vg.Object (from Efl.Canvas.Vg)
Also, Efl.Canvas.Vg.* (from Efl.Canvas.VG.*)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:30 -07:00
Mike Blumenkrantz 3d9dcbd478 edje: add ability to reference images from other edje files
this uses the just-added "id" property to allow referencing images
by name from that theme. example:

=FILE1=
id: "myfile";
images.image: "someimage.png" COMP;

=FILE2=
requires: "myfile";
images.image: "someimage.png" EXTERNAL "myfile";

FILE2 will now load someimage.png from FILE1 at runtime if FILE1 is
currently opened in edje, and FILE1 will be kept open until FILE2 is
closed

@feature
2018-02-28 16:02:38 -05:00