Commit Graph

30 Commits

Author SHA1 Message Date
Felipe Magno de Almeida ea6f250683 ecore: Rename EAPI macro to ECORE_API in Ecore library
Patch from a series of patches to rename EAPI symbols to specific
library DSOs.

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>
2020-12-14 13:22:21 -03:00
junsu choi 39bde2cedf ecore_event: Remove unused goto define
Summary:
   For remove -Wunused-label warning

Test Plan: N/A

Reviewers: Hermet, kimcinoo, YOhoho

Reviewed By: YOhoho

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D10584
2019-11-01 12:46:24 +09:00
Cedric Bail aacb6bc0c8 ecore: remove custom code for generating Eina_Future_Schedule attached on Efl.Loop.
This leverage the new infrastructure from Eo that provide a scheduler for any event
attached to any object.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10481
2019-10-31 14:52:49 +01:00
Cedric Bail 514a96f4d6 ecore: remove unecessary code for Eina_Future scheduler.
As we do not rely on legacy Ecore Event directly anymore, we do not
need to mind the shutting down of EFL.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D10477
2019-10-31 14:52:38 +01:00
Cedric BAIL e0ee318fe1 eo: use efl_provider_{un,}register infrastructure instead of Efl_Loop one.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9296
2019-07-17 21:57:57 +02:00
Cedric BAIL 1ec4ad1556 ecore: rely on event instead of creating one Eo object per future that need resolving.
This was a terrible oversight, but the point of having a small native type for future was
for making them efficient. Still we were using one Eo object for dispatching per future
to dispatch new value. I could have gathered all the dispatch with just one object, but
at the end we do have one object that notify us of the loop iteration... the loop object!
And we have event on that object that we can rely to trigger the dispatching of future
without requiring any additional object. So let's do that instead.

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D8567
2019-04-23 12:40:55 -07:00
Marcel Hollerbach cc9f236a29 efl_loop: remove message_handler_get
it appears that this could be emulated with other functions. Plus the
function had the limitation, that no constructors could be used.

ref T7597

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7985
2019-02-21 19:13:41 +01:00
Marcel Hollerbach 37d2d378ec eolian: drop class function overriding
Until this commit eo did class functions as part of the vtable, which
enabled those functions to be overwritten in classes inheriting another
class. However in task T7675 we decided that this is not really good for
bindings, as most OOP languages do not support this sort of feature.

After this commit eolian realizes class function completly outside of
the vtable, the c-symbol that is the class funciton is now just directly
redirecting to a implementation, without the involvement of the vtable.

This also means a change to the syntax created by eo:

Calling before:
  class_function(CLASS_A);
Calling after:
   class_function();

Implementation before:
   class_function(const Eo *obj, void *pd) { ... }
Implementation after:
   class_function(void) { ... }

This fixes T7675.

Co-authored-by: lauromauro <lauromoura@expertisesolutions.com.br>

Reviewed-by: Daniel Kolesa <daniel@octaforge.org>
Differential Revision: https://phab.enlightenment.org/D7901
2019-02-13 16:59:58 +01:00
Carsten Haitzler 1c74aaa7e9 Revert "cxx: Fix manual code after efl_app change."
This reverts commit 135154303b.

Revert "efl: move signal events from efl.loop to efl.app"
This reverts commit 3dbca39f98.

Revert "efl: add test suite for efl_app"
This reverts commit 3e94be5d73.

Revert "efl: create Efl.App class, the parent of Efl.Loop"
This reverts commit 28fe00b94e.

Go back to before efl.app because I think this should be done with
superclassing here not a parent object. reasons?

1. multiple loops per single thread make no sense. so if multilpe loop
objects they wont be contained in a single app object and then deleted
like this.
2. the app object is not really sharable in this design so it cant be
accessed from other threads
3. it makes it harder to get the main loop or app object (well 2 func
calls one calling the other and more typing. it is longer to type and
more work where it is not necessary, and again it can't work from
other threads unless we go duplicating efl.app per thread and then
what is the point of splittyign out the signal events from efl.loop
then?)

etc.
2018-03-03 13:40:33 +09:00
Mike Blumenkrantz 28fe00b94e efl: create Efl.App class, the parent of Efl.Loop 2018-02-26 14:02:51 -05:00
Myoungwoon Roy, Kim b203ff1878 ecore_event: Fix a break of consistency of return data
Summary:
This patch fixes a break of consistency of return data from ecore_event_del.
Before EFL 1.20, when calling ecore_event_add(ECORE_EVENT_SIGNAL_USER, event_data, NULL, &data);
The user data(data) is saved at event->data. and when user calls ecore_event_del(event_handler),
ecore_event_del returns event->data. However, current ecore_event_del returns pd->ev.
I think it is ABI break.

Test Plan: Execute test suite

Reviewers: cedric, raster, stefan_schmidt, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5786
2018-02-07 13:50:24 +09:00
Myoungwoon Roy, Kim 211093b7c5 ecore_event: Check for the valid type
Summary:
This patch checks for the valid types.
As mentioned API reference documentation, user must know its type before hand.
The type should be chedked like previous efl version and ecore_event_type_flush_internal()

Test Plan: Execute a ecore test suite.

Reviewers: cedric, raster, jpeg, stefan_schmidt, Jaehyun_Cho

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5776
2018-01-31 18:55:40 +09:00
Mike Blumenkrantz da9eef6027 ecore: add function for prepending an event handler
@feature
2018-01-30 13:02:07 -05:00
Carsten Haitzler b27ca559f6 remove elgacy ecore event usage in futures that limit to mainloop only
also eina_procmis was not threadsafe so cannto use loops in different
threads at all until this was made safe. needed to disable the old
ecore_event using code in for ecore futures and create a new efl loop
message future and handler instead ... but now a quick experiment with
multiple loops in 10 threads plus mainloop have timers at least work.
i need to test more like fd handlers etc etc. but it's a step.
2017-12-28 02:24:12 +09:00
Jean-Philippe Andre 147ef4f91d ecore: Avoid access to invalid eo id
Not a fan of the solution, as I think some of the logic handling those
futures is a bit broken. I'm not 100% sure about this patch. But this
improves make check with CK_FORK=no in elm_suite.
2017-12-18 19:54:31 +09:00
Andy Williams a34aca27a0 ecore: Additional safety for bad futures
Fixes T6519
2017-12-17 14:38:19 +00:00
Carsten Haitzler 5dd52fd09b ecore - begin moving data into the efl loop data in the object
we really should have data inside the loop object, so begin moving it
one small thing at a time. this is the basics that will allow multiple
efl loops. make an eo efl object and class for fd handlers that is efl loop
bound make fd handlers really bound to their parent loop and not global  as
well as have a nice class/obj. create an message queue per loop and
put legacy ecore events on top of it... and a lot more.

this is not 100% done, but it's a lot of the core and groundwork.
various ecore_timer_add(), ecore_diler_add() etc. need changes.

The following still need doing:

  ecore_timer (internal usage for sure)
  ecore_idler (internal usage for sure)
  ecore_idle_enterer
  ecore_idle_exiter
  ecore_pollers? (is the new efl loop stuff ok?)
  ecore_exe (fork/spawn from any thread and track exe from that thread?)
  ecore_signal code
  ecore_throttle (should we have a single global too? we have per loop)
  ecore_app ? (should every loop be given its own argv/argc?)

Lots of internal ecore code uses/calls these legacy calls and we
should have efl loop replacements and/or use the ones we have

The following will bedifferently designed for loop to loop
control/messaging/ipc:

  ecore_thread
  ecore_pipe
2017-12-15 14:16:53 +09:00
Guilherme Iscaro 5bd8c9a78d Eina: Add Eina_Promise/Eina_Future.
This commit adds a new promise/future API which aims to replace
efl_future.
2017-09-04 10:24:00 -03:00
WooHyun Jung 9ef214ec08 ecore_events: inarray should be flushed before return
@fix
2017-07-26 18:57:37 +09:00
Jean-Philippe Andre d14b6e3f84 ecore: Fix memory leak and logic
@cedric... how could this even happen??
2017-03-14 22:38:43 +09:00
Cedric BAIL 614c255f3b ecore: add ecore_event_type_flush.
During shutdown it is possible that some event are still in ecore events
queue and get processed after the shutdown of the module that did emit them.
This would lead to crash in some case. The answer to this problem is to
normally manually track all ecore event in the queue and destroy them
before shutdown... Of course that make the API difficult to use and
basically nobody got it right.

This new API do actually as it says remove all the ecore event of a
certain type from ecore events queue. It is to be called on shutdown.

@fix
2017-03-09 16:17:58 -08:00
Mike Blumenkrantz e263cbf9d0 Revert "ecore: forcefully flush pending event when ecore_shutdown is called."
This reverts commit 2c6808e4ee.

this breaks a number of expectations and guarantees in efl:

* causes unexpected event iteration during app startup before main loop begins
  - leads to event loss
* causes unexpected event iteration during app shutdown after main loop quits
  - leads to invalid memory access
* causes recursive event iteration during event handler callbacks
  - leads to ?????????????????????????????????????????????????????????????????

all of these can be easily seen by running enlightenment, and all of these cause
unexpected behaviors in enlightenment including, but not limited to, a lot of crashes

fix T5232
2017-03-03 11:56:04 -05:00
Cedric BAIL 2c6808e4ee ecore: forcefully flush pending event when ecore_shutdown is called.
If a component emit Ecore_Event and they aren't processed before the
call it call ecore_shutdown, there is no way to prevent this event
from being triggered after the component at shutdown itself. Which
may well lead to a use after free case. As we don't know which event
are pending and we also are not shuting down ecore completely as they
are still other component using it, we can only flush all pending event
right away.
2017-02-27 15:05:35 -08:00
Jean Guyomarc'h 334d32a575 ecore: don't use an unspecified amount of arguments 2016-05-06 22:18:57 +02:00
Cedric BAIL 8cc6c7561a ecore: remove useless ecore_lock/unlock. 2016-02-02 10:45:42 -08:00
Carsten Haitzler 2aeb289063 eina - begin event log infra we can get from the new debug monitor
we can down dump event logs. some ecore mainloop bits are logging at
the moment.
2015-05-10 19:05:54 +09:00
ChunEon Park 28871750b7 Revert "ecore/ecore_event - logically this check is redundant."
This reverts commit df60e63bf9.

seems this patch is wrong.
2014-05-27 22:27:05 +09:00
ChunEon Park df60e63bf9 ecore/ecore_event - logically this check is redundant.
remove check so that prevent tool doens't notify this anymore.
2014-05-27 20:36:42 +09:00
Mike Blumenkrantz b2de05f49a all efl object deletion functions now take NULL without crashing or erroring
SVN revision: 81667
2012-12-24 09:35:56 +00:00
Vincent Torri 7d6010b12c merge: add escape ecore, fix several bugs
SVN revision: 79995
2012-12-02 22:35:45 +00:00