Commit Graph

93 Commits

Author SHA1 Message Date
Carsten Haitzler 2ce7feb3d5 emotion - properly track subtitle mute state and init emotion obj early
fix setting things on an emotion obj early bu initting engine early
and also track spu mute flags to set on pipe later

@fix
2021-09-26 21:23:24 +01:00
Felipe Magno de Almeida c118886043 emotion: emotion EAPI macro to EMOTION_API in Emotion library
Summary:
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

=  The Rationale =

EAPI was designed to be able to pass
`__attribute__ ((visibility ("default")))` for symbols with
GCC, which would mean that even if -fvisibility=hidden was used
when compiling the library, the needed symbols would get exported.

MSVC __almost__ works like GCC (or mingw) in which you can
declare everything as export and it will just work (slower, but
it will work). But there's a caveat: global variables will not
work the same way for MSVC, but works for mingw and GCC.

For global variables (as opposed to functions), MSVC requires
correct DSO visibility for MSVC: instead of declaring a symbol as
export for everything, you need to declare it as import when
importing from another DSO and export when defining it locally.

With current EAPI definitions, we get the following example
working in mingw and MSVC (observe it doesn't define any global
variables as exported symbols).

Example 1:
dll1:
```
EAPI void foo(void);

EAPI void bar()
{
  foo();
}
```
dll2:
```
EAPI void foo()
{
  printf ("foo\n");
}
```

This works fine with API defined as __declspec(dllexport) in both
cases and for gcc defining as
`__atttribute__((visibility("default")))`.

However, the following:
Example 2:

dll1:

```
EAPI extern int foo;
EAPI void foobar(void);

EAPI void bar()
{
  foo = 5;
  foobar();
}
```

dll2:

```
EAPI int foo = 0;
EAPI void foobar()
{
  printf ("foo %d\n", foo);
}
```

This will work on mingw but will not work for MSVC. And that's why
EAPI is the only solution that worked for MSVC.

Co-authored-by: João Paulo Taylor Ienczak Zanette <jpaulotiz@gmail.com>
Co-authored-by: Ricardo Campos <ricardo.campos@expertise.dev>
Co-authored-by: Lucas Cavalcante de Sousa <lucks.sousa@gmail.com>

Reviewers: vtorri, woohyun, jptiz, lucas

Reviewed By: vtorri, lucas

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D12227
2021-01-11 10:31:30 +00:00
junsu choi 3dc3deba62 Efl.Player: Add setter of playback_progress
Summary:
The setter of Efl.Player.playback_progress is implemented in each class below.
Efl.Ui.Animation_View
Efl.Ui.Image
Efl.Ui.Image_Zoomable
Efl.Canvas.Video

ref T8476
Depends on D10915

Test Plan: N/A

Reviewers: Hermet, bu5hm4n, kimcinoo, Jaehyun_Cho, segfaultxavi, zmike

Reviewed By: zmike

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8476

Differential Revision: https://phab.enlightenment.org/D10931
2019-12-31 09:53:10 -05:00
Cedric Bail 7dc98ab3d0 evas: move efl_input_device into evas/Efl_Canvas.h
Summary:
The internal and the API we would like is mostly a canvas API. A lot of the code
in evas is working around the fact that efl_input_device is not defined inside Evas.
This patch is the first step to try to clean this up.

Depends on D10487

Reviewers: zmike, raster, bu5hm4n, Hermet

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T8321

Differential Revision: https://phab.enlightenment.org/D10488
2019-10-31 13:29:56 -04:00
Mike Blumenkrantz 4b9d85173b efl/player: progress -> playback_progress
no functional changes

ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10116
2019-09-24 15:23:18 -07:00
Mike Blumenkrantz 3d3cdc5955 efl/player: rename 'play' property to 'pause'
this is a bit of an overhaul wherein the existing 'play' mechanics are
all inverted. 'pause' is a state which stops playback but does not affect
the playback_position property.

this patch also includes implementations of Efl.Player::playing for
a couple classes which (now) only implement pause, as this is a requirement
for the objects to actually activate their animations

test cases:
* unit tests
* all elm_test animation cases
* elm_test video
* rage

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10114
2019-09-24 15:23:15 -07:00
Mike Blumenkrantz 9b0197e2af efl/player: pos -> playback_position
ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10112
2019-09-24 15:23:11 -07:00
Mike Blumenkrantz 5c2ea620a1 efl/player: prune properties duplicated in efl.playable
efl.playable implements a number of properties which are also present
in efl.player. playable was intended to be separate, so enforce this
split in all classes which use player

ref T7877

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D10109
2019-09-24 15:23:09 -07:00
Marcel Hollerbach 5e9e33dd91 efl_player: split off audio related properties
Summary:
this commit moves the audio related properties from Efl.Player to
Efl.Player_Audio.

Reviewers: zmike, Jaehyun_Cho

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7877

Differential Revision: https://phab.enlightenment.org/D10106
2019-09-24 14:32:12 -04:00
Mike Blumenkrantz 9e0a285eea efl: implement efl.file::unload for classes that implement load
unload is a crucial method for classes that implement load, as this is
the method which is called during e.g., efl_file_simple_load() when
a new file is specified in order to destroy the previous object data

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9786
2019-08-29 17:17:08 +02:00
Mike Blumenkrantz 7b5fa23e9b emotion: don't update crop clipper geometry if crop clipper doesn't exist
Summary:
this object does not exist if no image border is set

@fix
Depends on D9002

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9003
2019-05-29 12:29:04 -04:00
Mike Blumenkrantz 971e4dd2a6 emotion: 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: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D8118
2019-03-06 13:02:34 -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 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
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
Derek Foreman be752e6bc1 emotion: Convert to new animators
Summary:
Use more efficient animator mechanism.
Depends on D7049

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7050
2018-09-18 09:43:14 -05:00
Yeongjong Lee e19292aa2b evas: call evas_find before safety check
Summary:
edje_edit_object_add
edje_object_add
emotion_object_add
evas_object_xxx_add

These APIs had allowed to set parent to EFL_CANVAS_OBJECT(Evas_Object) before
8bb11a17. we should call evas_find before safety check for backward compatibility.

Test Plan:
  win = elm_win_add(NULL, "main", ELM_WIN_BASIC);

 1.  `rect = evas_object_rectangle_add(evas_object_evas_get(win));`

 2.  `rect = evas_object_rectangle_add(win);`

Check that 1. and 2. works.

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, CHAN, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6909
2018-08-29 21:11:00 +09:00
Yeongjong Lee 8bb11a172b evas: check evas class instead of using evas_find
Summary:
A object that is not evas class shouldn't use evas_find. it may occurs segfault.

ref c2e8b492b1

Test Plan:
Evas *evas = evas_new();
evas_free(evas);
evas_object_line_add(evas);

Check weather there is segfault.

Reviewers: Hermet, raster, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6816
2018-08-16 13:01:39 -04:00
Cedric Bail c2e8b492b1 evas: enforce legacy parent to be the canvas. 2018-05-24 16:02:19 -07: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 c837b321bf Efl.Image_Load_Controller* (From Efl.Image.Load*)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:39 -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
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Mike Blumenkrantz 73106cc201 emotion: call shutdown when smart objects are destroyed
the constructor calls init for every object, so ensure a matching
shutdown call exists to balance the init count

ref 517471190f
ref T6816

Reviewed-by: Stefan Schmidt <stefan@osg.samsung.com>
2018-04-05 11:10:27 +02:00
Cedric Bail a7c402b501 emotion: silence warning due to vpath change. 2018-02-22 14:55:31 -08:00
Marcel Hollerbach c4f33c67a8 move from efl.vpath to eina_vpath
The usages from efl.vpath are moved to to eina_vpath
2018-02-22 09:26:55 +01:00
Mike Blumenkrantz 76eb02303a efl: rename player.position property -> player.pos
position conflicts with gfx.position; this could maybe be named better?
2018-02-15 13:11:00 -05:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Jean-Philippe Andre a3250f975a efl: Use Eina.Size2D for image load size 2017-09-19 10:51:48 +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 a73e4c7c80 emotion: Make it a clipped smart object
This reduces code.
And probably adds new bugs.
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre d971ca2fb8 emotion: Fix refcounts related to eio use
Inside emotion, if Eio is compiled, some asynchronous functions are used
and a refcounted struct was used to ensure safety of the code.
Unfortunately the logic didn't make much sense as emotion's private data
is used. The refcount becomes useless, the lifecycle of the data being
bound to the object itself.

Note that an actual crash is almost impossible because:
 - eio is actually quite fast
 - evas objects are kept alive for 2 frames
 - eina_freeq is used to keep eo objects' data alive for some more time

But this in theory fixes the events, as they were sent on the wrong
object. "obj" is the image object, "smartobj" was the emotion object.
This is fixed with a weak ref.

I don't think it is necessary to backport this.
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre 7ef714924a evas: Fix crash with smart objects
This is due to the previous patches.
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre f5a56789e0 evas: Add internal API to make smart obj (un)clipped
Introduction to the problem:
 - Efl.Canvas.Group has a method member_add() to add sub objects.
 - Efl.Canvas.Group (simple smart object) does NOT actually delete the
   objects on deletion. But:
 - Efl.Canvas.Group.Clipped is a direct subclass and WILL delete the sub
   objects on deletion.

Semantically, all smart objects (at least in EO and Elementary) will own
and delete sub objects automatically. Some exceptions are:
 - Edje object (smart clipped) does not delete swallowed objects.
   Edje object is a "clipped" smart object but it pops out all swallowed
   children before getting deleted.
 - Evas box/table/grid also pop out their children before deletion.
   Those classes are all legacy & internal only.
 - Elm.Widget will "manually" delete all its sub objects at deletion, as
   it inherits from Efl.Canvas.Group but basically takes full ownership
   of the sub objects. Note that member_add shouldn't be used on a
   widget, the widgets do it themselves.

Also, smart clipped objects are much more convenient to use as they will
handle some things for you: color, visibility, moving and ownership.

So, the API member_add needs to be marked as own(). But right now
Efl.Canvas.Group does not own. Thus, here's the plan:
 - Mark clipped objects as such with an internal API
 - Merge clipped smart object features directly inside the standard
   smart object.
 - Get rid of Efl.Canvas.Group.Clipped entirely and watch all hell break
   loose.

Ref T5301
2017-09-13 09:57:05 +09:00
Jean-Philippe Andre 242127a96b evas,edje,elm: Mark all legacy objects as such 2017-07-07 13:21:18 +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
Jean-Philippe Andre 4310e641cd evas: Make Efl.Canvas.Object.type internal 2017-05-19 14:07:00 +09:00
Derek Foreman fddbf75fc9 Fix sed error that changed "video" to "videfl"
commit c662934be8 seems to have accidentally
renamed a few instances of _video_ to _videfl_, this hopefully changes
them all back.
2017-04-17 17:06:28 -05:00
Jean-Philippe Andre d689afccae group: Track calls to group_del
After a long search I found that fileselector was not calling
super.group_del on deletion, leading to the use of dangling pointers.
So let's verify that group_del is properly called.

See T4598
2017-02-15 20:11:22 +09:00
Carsten Haitzler 76244d89a7 vpath file - add a keey property to know if obj should be kept around
if its a file downloading (to a tmp location) or a zip/tar/whatever
file being extracted also to a tmp location and that tmp file needs to
be removed after ...you need to keep the obj around to know when to
delete the file. this makes the keeping optional and you query if the
vpath obj is meant to be kept or not. if it's not it's safe to del
immediately.

this cuts down 1 obj per image obj/edje obj when generally unused.
save some mem.
2017-02-13 16:51:49 +09:00
Al Poole 1f9e915b5a emotion: add support for obtaining embedded artwork from media files with gstreamer1 backend.
Reviewers: raster, cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-01-12 14:37:19 -08:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Chris Michael 2faf3df444 emotion: remove float comparison warnings
Signed-off-by: Chris Michael <cp.michael@samsung.com>
2016-12-20 11:13:40 -05:00
Jean-Philippe Andre f909a6d6ea evas: Fix masks of masks and clippers of clippers in general
The root cause was simple: smart object clipped was not
calling efl_super() on clip_set.

Fixes T4813 (and probably a whole lot of other bugs)
2016-11-09 10:52:03 +09:00
Carsten Haitzler 534c3c91b7 emotion - add vpath support for file_set on emotion objects
this completes my todo list for vpath path support at least for now
(evas images, edje objects and emotion objects). now vpath's work for
these too.
2016-10-25 18:34:25 +09:00
Davide Andreoli b8ae4947b6 Emotion: prefer ratio to calculate sizes
Instead of calculate the ratio from the sizes, calc the width from the ratio,
as ratio seems always accurate.
Fallback to the old code if ratio not available (tbh I never see this case)

@Fix EMOTION_ASPECT_KEEP_BOTH with some rare strams, mostly DVD and online stuff
2016-10-16 08:19:30 +02:00
Jean-Philippe Andre 9bf0df8f32 evas: Mark group_add/del as internal
Lacking a proper internal tag, I'm using both protected (it is
in fact a protected access function) and beta (to mark as unstable,
not real API).

New smart objects based on EO only should rely on constructor,
finalize and destructor exclusively. In theory, this should be fine.

Unfortunately it may be impossible to inherit from the Efl.Ui.Win
class as it uses a really bad hack and calls super.constructor
inside the finalize method.
2016-10-12 11:47:50 +09:00
Jean-Philippe Andre 8a9f0bd603 evas/elm: Remove function group_resize
This is an override of efl_gfx_size_set. Same as before, the
order of operations matter so it is possible that a corner
case will break. In particular, legacy code was:
 - intercept
 - smart resize (do stuff), super, super, super
 - evas object resize

The new code is more like:
 - intercept
 - super, super, super, evas object resize
 - do stuff

But unfortunately this broke elm_widget (read: all widgets) as
the internal resize was done before the object resize. So,
inside the resize event cb, the resize_obj size would not match
the smart object size. >_<
2016-10-12 11:25:56 +09:00
Jean-Philippe Andre 11b7cf6b72 evas/elm: Remove function group_move
This is an override of efl_gfx_position_set.
As for the other patches, I hope I didn't break anything.

A problem likely to happen is that the super call was inserted
too early or too late in the call flow. For instance:

  _myclass_position_set(obj, x, y) {
    position_set(super(obj), x, y);
    position_get(obj, &prevx, &prevy);
    do_something_with_delta_xy();
  }

The above code flow is obvisouly wrong, but may have crept in this
patch (such a bug sneaked in inside smart object, breaking
everything at first).
2016-10-12 11:25:56 +09:00