Commit Graph

241 Commits

Author SHA1 Message Date
Carsten Haitzler db081f9648 ecore evas ews - deprecate/remove
it's broken. it doesnt render anything. input is broken. it isn't in
use so it doesnt justify fixing. no one has complained it's brokne
thus proof of it not in use, so proof that it's not needed, so do the
right thing and nuke it to save work

@feat
2021-03-28 13:56:33 +01:00
Christopher Michael 6a3522352b ecore-evas: Formatting fix
NB: No functional changes
2021-01-27 15:11:57 -05:00
Carsten Haitzler 13d4c546f9 ecore evas - use correct enums for legacy funcstions to remove warns 2020-08-25 13:21:25 +01:00
Vincent Torri 68bb283c58 ecore_evas: fix uninitialized variable warning
Test Plan: compilation

Reviewers: raster, zmike

Reviewed By: raster

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11871
2020-05-23 14:55:53 +01:00
Vincent Torri d135957ffa Use __func__ C99 identifier instead of __FUNCTION__ compiler extension
Summary: see http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf section 6.4.2.2 page 52

Test Plan: compilation

Reviewers: raster, devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11785
2020-05-07 09:27:07 -04:00
Marcel Hollerbach 7b68960d3a ecore_evas: only define these eina errors once
Summary:
they are not needed multiple times, infact this is creating multiple
definition errors.

@fix

Reviewers: stefan_schmidt, zmike

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11766
2020-04-30 09:22:01 -04:00
Marcel Hollerbach 0a2db329c8 ecore_evas: add API for finding out if event is used
Summary:
ecore_x_dnd_send_status can be used to indicate if a item can be dropped
on a client or not. However, we should only indicate that this can be
dropped, if there is a object we signaled that a drop is in.

Long story short: there is no assertion that after indicating that
things can be dropped, that a notify for the data is sent. A drag
implementation should always listen to a mouse up event, and abort the
drag if no further operations are sent.
Depends on D11698

Reviewers: zmike, stefan_schmidt, raster

Reviewed By: zmike

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D11699
2020-04-14 11:29:43 -04:00
Marcel Hollerbach 5689ce8bfa ecore_evas: do not leak allocated memory in error case 2020-03-09 17:10:40 +01:00
Marcel Hollerbach 33203a9764 ecore_evas: only free content when content is != NULL
otherwise we might run into issues with that.
2020-03-09 17:10:40 +01:00
Xavi Artigas 7a79e15ea3 ecore_evas: Use EFL naming convention in cnp & dnd methods
Some methods were missing the "Drag" or "Selection" namespaces or the _Cb suffix.
Depends on D11219

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11426
2020-03-08 11:01:24 +01:00
Marcel Hollerbach 39f3ce42dc ecore_evas: Introduce cnp / dnd API for ecore evas
The idea of copy and paste here is:
- The user specifies the content he wants to have in the selection
  buffer with a Eina_Content, these content pointer ownerships are
  passed to the called. Internally ecore_evas code will memorieze the
  pointer, and pass on function callbacks to the modules, which then do
  not have to deal with the ownership.

- In case the module does not specify these APIs, the callback
  implementation will be called, which only works for cnp *not* dnd.

- Action and mime types are handled as strings, which allows way better
  custom organisations.

(The docs needs improvement)

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D11192
2020-03-08 10:59:25 +01: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
Vincent Torri 01b987df59 make mman.h private
Summary:
integrate mman.h to make Evil private to the EFL, as mman.h does not exist on Windows. After a discussion with raster, i include sys/mman.h only on non Windows platform.

One issue, though, is that src/modules/emotion/generic/Emotion_Generic_Plugin.h has inlined functions using mmap()

Test Plan: compilation on Windows

Reviewers: cedric, raster, zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D9542
2019-08-19 09:55:13 -04:00
Hermet Park 24a49c8938 ecore_evas: prevent double free evas.
When user manually free the ecore evas,
it could delete evas internally,
then evas_invalidate would be triggered,
invalidate callback would try free evas again,
this causes double free evas.

TEST SCENARIO:
   ee = ecore_evas_new(...);
   ...
   ecore_evas_free(ee);
      -> free evas
         -> invalidated cb
            -> free evas (**double free)

This is a regression bug by 5847886a3f
2019-07-26 16:54:31 +09:00
Cedric BAIL 5847886a3f ecore_evas: on internal Evas canvas uncontrolled death, properly clean up Ecore_Evas.
This allow evas test to work with an Ecore_Evas directly. It prevent leaking of memory
in the case of half destroying Ecore_Evas.

Reviewed-by: Hermet Park <hermetpark@gmail.com>
Differential Revision: https://phab.enlightenment.org/D9104
2019-07-12 09:54:21 -07:00
Marcel Hollerbach f77bc6957c efl_input_pointer: rename tool to touch_id
tool was not very helpfull, and additionally, the docuemtnation of it
was completly wrong. After searching through the code where tool was
actaully set (efl_ui_win.c) it turned out that it is actaully the "id"
of the pointer when there are multiple touch events.

ref T7963

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D9135
2019-06-20 17:14:54 +02:00
Mike Blumenkrantz 2cf3dc7a39 ecore-evas: check for internal evas presence before using it during free
Summary:
some engines do not have an evas

@fix
Depends on D8971

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8972
2019-05-29 12:29:04 -04:00
Vincent Torri a5267d3d9c remove Evil.h when not necessary, include evil_private.h when necessary
Test Plan: compilation

Reviewers: zmike, raster, cedric

Reviewed By: zmike

Subscribers: #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D8925
2019-05-20 09:10:00 -04:00
Hermet Park 53599a8d39 ecore wayland: expand internal interface to pass engine option list.
This is a prepartion patch to support msaa in wayland.
ui window needs to deliver engine options (stencil, depth, msaa bits)
to evas engine side, ecore_evas_wayland_egl should have the argument to pass.
2019-04-25 16:56:40 +09:00
Mike Blumenkrantz af7d1ef7ed interfaces: move animator,tick to efl.canvas.object and remove efl.animator
Summary:
this interface only contains a single event which is implemented only by the
canvas object

ref T7561

Reviewers: cedric, segfaultxavi

Reviewed By: segfaultxavi

Subscribers: #reviewers, #committers

Tags: #efl

Maniphest Tasks: T7561

Differential Revision: https://phab.enlightenment.org/D7905
2019-02-21 22:04:30 +01:00
Marcel Hollerbach 3b2a5a429b efl_input: remove the API of efl_input_instance_get
there is basically no reason for this API. You can only use the API when
you know the class, when you know the class you can also just know the
function to call to get this API.
The reason this API needs to go is that we don't want to use
polymorphism on class-functions.

ref T7675

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7900
2019-02-13 16:59:57 +01:00
Derek Foreman 625955a597 ecore_evas: Don't walk mice list twice
We know the item is in there, so we can remove it directly.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7609
2019-01-15 13:47:16 -06:00
Derek Foreman 1139cde9a6 ecore_evas: Validate shadow geometry
Negative values in shadow geometry make no sense at all, however it's
happening all the time in wayland.  Let's throw an ERR so it doesn't go
unnoticed.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Differential Revision: https://phab.enlightenment.org/D7434
2018-12-14 10:29:56 -06:00
Carsten Haitzler 12827e8873 ecore_evas - fix aninmator based frame render ticking to full framerate
so i was seeing ecore evas only rendering every 2nd frame... this is
because it was adding and deleting animatiors every time it rendered
instead of keeping one around as lon as updates where there to render
and then remove it afterwards. this caused nasty timing problems and
thus problems assessing framerate of rendered content etc. etc. ...
not good. this fixes that. this only happened if you only used pure
legacy ecore animators. if you used the efl animator tick events it
worked right.

@fix
2018-12-03 11:04:27 +00:00
Yeongjong Lee 9de082eb83 ecore: remove duplicated conditions
Summary: The macro already checks eina_main_loop_is() when DEBUG_THREADS is enabled.

Test Plan: make

Reviewers: segfaultxavi, ManMower, Hermet, bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7183
2018-10-26 19:25:09 +09:00
Derek Foreman 4dc1e8273d ecore: Add new way to register animators
Summary:
We have back-ends that can generate their own tick sources, but
ecore_animator_add()/ecore_animator_timeline_add() gives no indication
which backend the animator is running on.  This means that all animators
have to cause all currently in use backends to tick.

For example, if under wayland 4 application windows are open, all 4
windows will create ticks when any animator is present.

These new animator APIs that take an evas object allow us to figure out
out the backend and only cause the appropriate one to tick.

Depends on D7040

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7041
2018-09-18 09:42:38 -05:00
Derek Foreman 501114e679 ecore_evas: Refactor out ticking start/stop as functions
Summary:
These are the refcounted ticky guts of the signal add/del catchers, we'll
need to use these to start/stop from other call chains in the near
future.

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7039
2018-09-18 09:42:30 -05:00
Mike Blumenkrantz f2adbe1452 ecore-evas: make manual_render_set a no-op when setting the current value
Summary:
this should not take any action if the existing value of manual_render is
set to the passed value

Reviewers: devilhorns, kimcinoo, ManMower

Reviewed By: devilhorns, kimcinoo, ManMower

Subscribers: ManMower, cedric, #reviewers, #committers

Tags: #efl_display_system

Differential Revision: https://phab.enlightenment.org/D6786
2018-08-09 15:51:41 -04:00
Derek Foreman e382bac1a0 wayland: Fix elementary setting window parents at creation time
Summary:
We need to pass the entire pointer, not just 32-bits of it.

Fixes a crash with enlightenment sandbox gadgets where
ecore_wl2_window_alpha_get() is called with an invalid pointer while
trying to display a pop-up.

Reviewers: zmike, devilhorns

Reviewed By: zmike, devilhorns

Subscribers: devilhorns, cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6775
2018-08-08 09:37:30 -04:00
Derek Foreman 35622614d0 ecore_evas: Make sure a manual render does a manual render
Summary:
If we call ecore_evas_manual_render() during an async render, it does
nothing.

This is harmful if we've added render post callbacks during that async
render and expect them to fire.

Force a sync and another render if we're in an async render.

ref T7156
Depends on D6714

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Maniphest Tasks: T7156

Differential Revision: https://phab.enlightenment.org/D6715
2018-07-31 17:03:16 -04:00
Derek Foreman b7444e0b87 ecore_evas: Sync evas on manual_render_set
Summary:
Make sure any ongoing async rendering is finished before manual_render_set
returns.
Depends on D6711

Reviewers: zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6714
2018-07-31 17:03:16 -04:00
Hosang Kim 1b2408d5f7 ecore_evas: skip rendering evas and making animator tick
Summary:
Some ecore_evas such as ecore_evas_extn_plug doesn't have evas.

ecore_evas_extn_plug seems to be Ecore_Evas, but actually it is Evas_Object_Image.
ecore_evas_extn_plug makes new ecore evas, but it only exists to communicate with ecore_evas_extn_socket.
newly ecore evas  only open and close file(ecore_evas_extn_socket). so it doesn't have evas.

```
EAPI Evas_Object *
ecore_evas_extn_plug_new_internal(Ecore_Evas *ee_target)
{
...
   ee = calloc(1, sizeof(Ecore_Evas));
...
   o = evas_object_image_filled_add(ee_target->evas);
...
  return o;
}
```

Reviewers: zmike, Hermet, woohyun, raster, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6504
2018-07-05 15:15:55 -04:00
Hosang Kim df652673fe evas: move clearing cows to right place.
Summary:
Evas is child of main loop now, so evas is deleted when main loop is quitted.
In case of not calling evas_free() explicitly by app side, a crash occurs.
So move clearing cows to below ecore_shutdown().

Test Plan:
//Compile with:
//gcc evas_test.c -o evas_test `pkg-config --cflags --libs ecore evas`

#include <Evas.h>
#include <Ecore.h>

Eina_Bool
_timer_cb (void *data)
{
    ecore_main_loop_quit();
    return 0;
}
int
main(int argc, char *argv[])
{

   evas_init();
   Evas *evas = evas_new();
   Evas_Object *obj = evas_object_box_add(evas);
   Evas_Object *rect = evas_object_rectangle_add(evas);
   evas_object_color_set(rect, 255, 255, 255, 255);
   evas_object_resize(rect, 300, 400);
   evas_object_show(rect);

   evas_object_box_append(obj, rect);

   evas_object_show(obj);
   ecore_timer_add(2.0, _timer_cb, NULL);
   ecore_main_loop_begin();

   evas_shutdown();
   return 0;
}

Reviewers: devilhorns, cedric, jpeg, id213sin, woohyun, zmike

Reviewed By: zmike

Subscribers: cedric, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6346
2018-06-27 07:50:31 -04:00
YeongJong Lee a522bf5d76 ecore_evas: prevent duplicated ecore_evas registration
Summary:
After a44697c37a, we can register same ecore_evas
to ecore_evases using ecore_evas_input_event_register.
(ecore_evas_input_event_register -> ecore_evas_done -> _ecore_evas_register)
This can make infinite loop in EINA_INLIST_FOREACH(ecore_evases, ee) because
next inlist of ecore_evases is ecore_evases after double call of
_ecore_evas_register.

This patch prevent it.

Test Plan:
Ecore_Evas *ee = ecore_evas_new(NULL, 0, 0, 800, 600, NULL);
ecore_evas_input_event_register(ee);
(part of document of ecore_fb_input_device_window_set)

Check that there is no infinite loop

Reviewers: zmike, devilhorns

Reviewed By: zmike

Subscribers: cedric, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6390
2018-06-25 15:14:31 -04:00
Cedric BAIL fe14abd929 evas: refactor efl_input_event and remove some of the lifecycle hack.
Differential Revision: https://phab.enlightenment.org/D6101
2018-05-24 16:02:18 -07:00
Cedric BAIL ccb5642eb9 Revert "efl_add_ref - fis to use efl_add properly with a parent."
This reverts commit 2fb5cc3ad0.

Most of this change where wrong as they didn't affect the destruction
of the object. efl_add_ref allow for manual handling of the lifecycle
of the object and make sure it is still alive during destructor. efl_add
will not allow you to access an object after invalidate also efl.parent.get
will always return NULL once the object is invalidated.

Differential Revision: https://phab.enlightenment.org/D6062
2018-05-24 16:02:17 -07:00
Carsten Haitzler 5b08611a9e ecore animator, x, vsync ecore evas restore x vsync to work again
so i found the work with wayland and having animator sources broke
that same source from ecore_x that was there from long ago, so i've
put in an exception if there are x based engines from restting to a
timer animator because ecore_x would have switched toa custom ticker
already, and this just resets it. also just set the source after
setting the tick callbacks and ensure tick cb's are null before going
to timer source as well. this cleans up this little but of animaatior
vsync modification to properly vsync in both x and wayland too now.

@fix
2018-04-30 15:32:10 +09:00
Xavi Artigas 65ee277a66 Efl.Canvas.Scene (from Efl.Canvas)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:23 -07:00
Derek Foreman 2dbaef9b7c ecore_evas: Make draw_block block drawing
This was only used in the X custom render function, now it's meaningful
everywhere.  (Nothing that uses this code path currently sets it)

ref T6834
2018-04-12 15:59:39 -05:00
Chris Michael c18fac91ff ecore-evas: Remove unused variable 2018-04-11 10:05:33 -04:00
Cedric Bail 23800a06a0 ecore_evas: remove dead code. 2018-04-10 15:01:43 -07:00
Cedric Bail 1ca196fbcd ecore_evas: add a hook interceptor for evas_new, will be useful for a portable Exactness. 2018-04-02 15:12:31 -07:00
Cedric Bail a44697c37a ecore_evas: refactor logic for creating Ecore_Evas. 2018-04-02 15:12:31 -07:00
Carsten Haitzler 2fb5cc3ad0 efl_add_ref - fis to use efl_add properly with a parent.
fixes bc18b7e7ad and
168849e8a0
2018-03-29 13:30:55 +09:00
Hosang Kim 86ae239bae ecore_evas: don't set in_async_render flag if not in use async render.
Reviewers: jypark, raster, cedric

Subscribers: cedric

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

Reviewed-by: Cedric BAIL <cedric@osg.samsung.com>
2018-03-26 15:58:54 -07:00
Cedric BAIL bc18b7e7ad efl: replace efl_del with efl_unref for cases where no parent exists
Signed-off-by: Mike Blumenkrantz <zmike@osg.samsung.com>
2018-03-20 17:20:57 -07:00
Carsten Haitzler 1bdd9e4dd1 ecore - a different take on efl.app class as a super class to efl.loop
so the MAIN loop is actually an efl.app object. which inherits from
efl.loop. the idea is that other loops in threads will not be efl.app
objects. thread on the creator side return an efl.thread object.
inside the thread, like the mainloop, there is now an efl.appthread
object that is for all non-main-loop threads.

every thread (main loop or child) when it spawns a thread is the
parent. there are i/o pipes from parnet to child and back. so parents
are generally expected to, if they want to talk to child thread, so
use the efl.io interfaces on efl.thread, and the main loop's elf.app
class allows you to talk to stdio back to the parent process like the
efl.appthread does the same using the efl.io interfaces to talk to its
parent app or appthread. it's symmetrical

no tests here - sure. i have been holding off on tests until things
settle. that's why i haven't done them yet. those will come back in a
subsequent commit

for really quick examples on using this see:

https://phab.enlightenment.org/F2983118
https://phab.enlightenment.org/F2983142

they are just my test code for this.

Please see this design document:

https://phab.enlightenment.org/w/efl-loops-threads/
2018-03-03 13:40:33 +09:00
Myoungwoon Roy, Kim 1b7089a26b ecore_evas: Check for null ptr deref
Summary:
This patch fixes a tentative crash owing to ptr dereference.
Unlike ecore_evas_object_cursor_set and ecore_evas_object_cursor_device_set,
ecore_evas_cursor_set uses Ecore_Evas *ee before calling internal function which
internally checks null ptr dereference of Ecore_Evas *ee.

Test Plan: Executes test suite

Reviewers: cedric, raster, stefan, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5753
2018-01-22 18:28:24 +09:00
Vincent Torri 4ae6eeb2cf efl: remove _MSC_VER (Visual Studio macro) usage in source code 2018-01-04 12:59:47 -08:00
Carsten Haitzler 0fd8cd82e3 ecore evas init - init ecore then evas not the other way...
because as of... i don't know when, evas relies on ecore with
ecore_pipe_add to create the async fd... and if you init evas then
ecore this doesnt work. obviously. well now it isn't working. probably
due to new efl loop work. but the efl loop code is correct.
ecore_pipe_add should never work until you init ecore... it just
happesn to have managed to be gotten away with for a while.

@fix
2018-01-05 02:34:16 +09:00