Commit Graph

76 Commits

Author SHA1 Message Date
Mike Blumenkrantz 17f433c57b ecore: avoid breaking next main loop start if quit occurs outside of loop
in the case where ecore_main_loop_quit() was called before ecore_main_loop_begin(),
the latter call would exit immediately without ever iterating the main loop

@fix

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D9360
2019-07-19 15:04:56 -07:00
Cedric BAIL 0aba6030bd ecore: rely on efl_provider_{un,}register to do the job of efl_loop_{un,}register.
Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D9294
2019-07-17 21:57:55 +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
Mike Blumenkrantz 1cab2e5fde ecore_exe: 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/D8125
2019-03-06 13:02:49 -08: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
Derek Foreman 66ce295fc9 ecore_main: Add ECORE_FD_ALWAYS flag
This allows an fd handler to be called after select exits unconditionally.

Our wayland client code needs this to be thread safe, as it needs to
call prepare_read before entering select, and then either read or
cancel_read after select.

Signed-off-by: Derek Foreman <derek.foreman.samsung@gmail.com>
Reviewed-by: Chris Michael <cp.michael@samsung.com>
Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7914
2019-02-13 10:33:40 -06:00
Christopher Michael 4c587ef679 Revert this as it should not have been pushed yet
Revert "ecore_main: Add ECORE_FD_ALWAYS flag"

This reverts commit b5e90ebe0d.
2019-02-13 10:01:22 -05:00
Derek Foreman b5e90ebe0d ecore_main: Add ECORE_FD_ALWAYS flag
Summary:
This allows an fd handler to be called after select exits unconditionally.

Our wayland client code needs this to be thread safe, as it needs to
call prepare_read before entering select, and then either read or
cancel_read after select.

Reviewers: cedric

Reviewed By: cedric

Subscribers: zmike, cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7914
2019-02-13 09:58:06 -05:00
Marcel Hollerbach 06160466e8 Revert "Revert the env object because it's broken portability - please redo"
This reverts commit d6294fa22b.
2019-02-12 21:34:27 +01:00
Carsten Haitzler d6294fa22b Revert the env object because it's broken portability - please redo
setenv and unsetenv are not portable. i explained to you at fosdem
there are issues and it's why i used putenv in the original
implementation and even though it's a pain (the string tou pass to
putenv is a pointer used literallt from there on in and you get it
from getenv, thus making ownership a pain -this is a libc issue we
can't readily solve). use putenv like the original code. then put it
back in. vtorri now has windows porting issues with the setenv use. i
knew there was a reason that still existed...

in addition your in_sync stuff is broken.  psuedocode:

// assuming BLAGH env is not set to anything here
c = efl_core_env_get(global_env, "BLAH");
...
putenv("BLAH=10");
...
c = efl_core_env_Get(global_env, "BLAH");

i will get NULL in both cases for c ... but i should get "10" for the
2nd in reality. reality is lots of code across application code and
libraries will at times mess with the environment. it has to work with
this. the prior implementation did work with this.

Revert "ecore: here comes a env object"
  This reverts commit 2373d5db5b.

Revert "efl_task: remove env from this object"
  This reverts commit c3d69f66a6.
2019-02-12 20:22:28 +00:00
Marcel Hollerbach c3d69f66a6 efl_task: remove env from this object
the env operations are moved to the efl.core.env objects, which can be
used there.

Differential Revision: https://phab.enlightenment.org/D7514
2019-02-12 11:19:28 +01: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 448c7ca2ce ecore_anim: Move struct Ecore_Animator to private header
Summary:
We're going to use this in ecore_evas shortly.

Depends on D7039

Reviewers: devilhorns

Reviewed By: devilhorns

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7040
2018-09-18 09:42:34 -05:00
Cedric BAIL cdbbaede7e efl: remove old Efl_Future, Efl_Promise. 2018-05-01 10:39:01 -07:00
Cedric BAIL 119cba7d1c ecore: make sure that we only install and expose EFL unified API we intend to. 2018-05-01 10:39:01 -07:00
Cedric BAIL 725c8add86 ecore: move efl_loop_message_process to ecore_internal.h to allow other EFL component to use it. 2018-04-30 14:21:11 -07:00
Carsten Haitzler 6865ad1773 ecore - efl threads - add thredio class
this adds a simple indata and outdata void ptr to begin that you can
set on efl.thread objects (set the indata) and get the outdata too to
get results. then on the efl.appthread side the indata is set on the
efl.appthread before it runs and on quit the thresad can set the
outdata on the appthread, and this appears back on the efl.thread
object in the parent thread.

so you can basically share pointers to anything in and out this way on
start/exit in addition to string args etc.

the reason i made it an extra class (mixin actually) is for future
expansion. sharing more complex data - eina values maybe or objects as
long as they are shared objects, and perhaps acting as an interface
for calling a function at the other end like ecore_thread_async_call
etc.
2018-03-07 02:32:15 +09:00
Carsten Haitzler 1ac60fe022 ecore efl exe/task/thread - move stdin/out flags to task class
also use them in efl thread to determine if io handlers are set up and
pipes created at all etc.
2018-03-07 02:32:15 +09: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
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
Carsten Haitzler 47ff2d8126 ecore - start work on efl task/exe/thread
this is  astart of the work for having a common task class/interface
between loops, threads ane exe's so the i/o is all symmetric and works
the same way between all of them as well as similarly for launching
and knowing when the exit etc. etc.

this is not final and not perfect, but it's a start. comments of
course welcome
2018-02-21 16:56:38 +09:00
Vincent Torri f5b01ac5ce all: Simplify definition of EAPI
This will help in the transition from Autotools to Meson. This has been
tested on Windows for which EFL_XXX_BUILD were first introduced.
2018-01-18 18:04:03 +09:00
Cedric BAIL b8ab0ca1f5 ecore: efl_loop_future_scheduler_get actually should be considered a const method. 2018-01-03 12:16:25 -08: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
Carsten Haitzler 6b70cd5f97 ecore/efl loop - refactor idle stuff to be less convluted when
less jumping around the codebase and no need for a message exists
method on the loop as we can find out internally, so only the process
left.
2017-12-21 19:45:21 +09:00
Carsten Haitzler 04a01c13af ecore/efl loop. remove internal ecore_timer legacy api usage for eflloop
efl.loop was still using legacy ecore_timer_* calls inside. of course
this is a big no-no if we are to allow multiple loops, so clean this
up and convert them to efl.loop.timers.
2017-12-21 17:55:03 +09:00
Cedric BAIL 29d4cb864b ecore: make message_process and message_exists internal function. 2017-12-18 16:10:11 -08: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
Gustavo Sverzut Barbieri 22cee38239 Efl_Loop: add job, timeout and idle based on Eina_Future.
Since some clash with old version, then add Eina_FutureXXX to their
name, later we'll sed.
2017-09-04 10:24:00 -03: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
Cedric BAIL bc13f96ae8 ecore: simplify usage of poller by giving 3 class of event on the main loop object.
The internal logic should be improved further in the future to synchronize itself
with loop wake up whenever possible (Especially true for the high frequency poller).
2017-06-02 16:28:28 -07:00
Cedric BAIL 712f7e878b ecore: use new API eina_file_close_on_exec. 2017-04-18 16:55:31 -07:00
Cedric BAIL d8edf70c32 ecore: improve debugging of animator. 2017-02-28 11:04:34 -08:00
Cedric BAIL ca1762be21 ecore: delay promise fulfillment to next loop iteration. 2016-12-16 14:10:58 -08:00
Cedric BAIL b85332fc89 ecore: remove useless information from header. 2016-12-16 10:42:59 -08:00
Cedric BAIL e4958e9faa ecore: remove useless ecore_parent.eo. 2016-09-19 13:05:32 -07:00
Cedric Bail cd6a8aa6b3 ecore: add support for optional futures. 2016-09-08 14:58:05 -07:00
Tom Hacohen d5e321466e Efl object: Rename Eo_Event -> Efl_Event.
This is the last step of the Eo renaming efforts.
2016-08-30 13:34:10 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Cedric BAIL fd5d31696d ecore: early destruction of animator allow for tick end to always be triggered.
T4043
2016-07-13 15:32:15 -07:00
Jean-Philippe Andre 45cd0465a4 efl: Add Efl.Version struct and APIs
The original idea behind knowing the app's version of EFL is not
a great story. It comes from the fact that some bugs exist in
earlier versions of EFL, and some things need to be fixed. But
those fixes may break behaviour for older apps. This patch is
opening the way to the slippery slope of bug compatibility.

Unfortunately this is a requirement if we want to be able to move
forward and not break apps when we fix bugs (behaviour or ABI).

I hope we will not need to implement too many (if any) workaround
such issues. For now, this will only be used as debugging info.

EFL_MAIN() and ELM_MAIN() will both set the app's EFL version
automatically at startup time. Some internal helpers can be added
later to check how the app build-time and run-time version of
EFL differ.

@feature
2016-06-29 15:01:34 +09:00
Cedric BAIL c512bb68e7 ecore: fix Windows build by properly defining EAPI in all case for internal API user. 2016-06-23 10:53:46 -07:00
Cedric BAIL 068f57a79d ecore: fix arguments to use Eo native array type. 2016-06-22 14:36:39 -07:00
Cedric BAIL ec77773aa3 ecore: add ability for the main loop to provide other class of object. 2016-06-22 10:17:06 -07:00
Tom Hacohen 6202cc7485 Adjust the code according to the eo event stop changes.
This was changed in the previous commit.
2016-06-20 18:02:00 +01:00
Cedric BAIL 0e6d5df60c ecore: use EINA_ERROR_PROMISE_CANCEL instead of a custom Ecore one. 2016-06-03 17:00:12 -07:00
Cedric BAIL b3d56820d5 ecore: Efl.Timer should be Efl.Loop.Timer for coherence.
As we add more object in the main loop, they can't live in the top
namespace as they make little sense there (Efl.Fd !). For coherence,
everyone should in the loop namespace, so move timer there.
2016-06-03 17:00:12 -07:00
Jean-Philippe Andre 5aa00004a5 ecore_evas: Register direct input cb from modules
If the ecore_evas modules were using
ecore_event_window_register() then they can also redirect
everything though the direct callback instead.
2016-05-31 19:03:04 +09:00
Cedric BAIL 0c4880e99d efl: everyone should now rely on Eina MIN/MAX redefinition. 2016-05-09 16:58:53 -07:00