Commit Graph

28 Commits

Author SHA1 Message Date
Gustavo Sverzut Barbieri 306ec6937b Efl.Loop.coro: easy to use coroutines attached to a main loop.
While Eina_Coro provides a solid base, to use the main loop to
schedule coroutines it needs some manual work we want to avoid.

Efl.Loop.coro method will take a function and schedule it using the
given priority, the returned value is then resolved in a promise for
the returned future.

Basically all users must do is write a function that looks like a
synchronous code and calls eina_coro_yield() (or helper macros), that
will go back to the main loop and then it will reschedule the
coroutine to run according to its priority.

This should reduce the number of callbacks in user's code.
2017-08-27 11:47:55 -03:00
Gustavo Sverzut Barbieri 4d7661b174 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-08-27 11:47:55 -03:00
Guilherme Iscaro d30c0d4f03 Eina: Add Eina_Promise/Eina_Future.
This commit adds a new promise/future API which aims to replace
efl_future.
2017-08-25 19:53:49 -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
Stefan Schmidt 6a322b1b2c docs: ecore: finish up eo file docs in ecore 2016-11-11 10:58:22 +01:00
Daniel Kolesa d773f33612 efl_loop: remove pointers 2016-11-03 17:01:31 +01:00
Stefan Schmidt b889beb0fc docs: ecore: document missing structs 2016-10-27 18:22:41 +02:00
Stefan Schmidt f4ae4bfb69 docs: ecore: make consistent use of $true and $false keywords in docs 2016-10-24 17:21:48 +02:00
Cedric Bail dfc65aef6e ecore: migrate job and timeout to use future. 2016-09-15 21:49:08 -07:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Cedric BAIL cdf04241db ecore: on first arguments event notify the needs to initialize the process state. 2016-07-06 15:51:25 -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
Jean-Philippe Andre a73e51136f loop: Add main class property to return the main loop
Note: this is both @class and @property. Hope that's ok for
all bindings.

This returns same as ecore_main_loop_get() (which now uses the eo
api instead).

Ping @cedric (so he can check this patch).
2016-06-29 11:17:44 +09:00
Jean-Philippe Andre 4d6216c7f6 ecore: Replace TABs with spaces 2016-06-27 17:29:06 +09:00
Cedric BAIL f441859bfb ecore: add the possibility to return an exit code when leaving the main loop. 2016-06-24 16:44:59 -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
Daniel Kolesa b1946ca5d6 eolian: utilize the new void_ptr builtin across eo files
This lets me narrow down the remaining cases of pointers across the EFL.
The void pointers will later need to be reevaluated on per-case basis and
replaced appropriately where possible/feasible.
2016-06-02 13:00:26 +01:00
Daniel Kolesa 6fc482aa9b eolian: utilize the new builtin string type across eo files 2016-05-31 16:05:43 +01:00
Carsten Haitzler f0335bde28 efl loop - add an args event and ability to produce it
this is an args event. right now we don't use it, but this should be
done by some of the setup/init of an app and then produce an args
event. the idea would be that this can be used by single-instance apps
like web browsers, terminology to treat launch as an event.
2016-05-30 19:47:21 +09:00
Daniel Kolesa e984e5a11a eolian: remove pointers from complex and class types
Complex types (i.e. list, array, hash, accessor etc.) now do not require
pointers with them anymore (the pointer is implied) and the same goes for
class handles. Eolian now explicitly disallows creating pointers to these
as well. This is the first part of the work to remove pointers from Eolian
completely, with the goal of simplifying the DSL (higher level) and therefore
making it easier for bindings (as well as easier API usage).

@feature
2016-05-23 15:58:33 +01:00
Cedric Bail 4f43c27450 ecore: promise for timeout and job are clearly never optional, so return them. 2016-05-20 02:25:48 -07:00
Tom Hacohen 96c4c88070 Efl: Remove "legacy_prefix: null;" as it's now the default. 2016-05-12 17:27:35 +01:00
Cedric BAIL 8d50990a27 ecore: add a timeout promise. 2016-05-04 15:42:59 -07:00
Marcel Hollerbach c66695bedb eo: replace loop_get with object_find
Summary:
object_find is more generic, so other mechanisms can also reuse the
code.
The object itself has to support the function, so there is no need for
eo_isa which would have a negative performance impact.
The base class implementation calls interface_get on the parent, so a
override of the function can just call the super function to continue in
the recursion.

Test Plan: just run the eo test suite

Reviewers: raster, tasn, jpeg

Reviewed By: tasn, jpeg

Subscribers: felipealmeida, netstar, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3909
2016-05-04 10:43:55 +02:00
Cedric Bail 7fa953e9ae ecore: add Efl.Loop.Job promise. 2016-05-02 18:17:09 -07:00
Carsten Haitzler 0d0ba19e51 efl loop: implement loop.get property to return self
this means that on loop_get on any obj as long as its a child of a
loop obj... it'll retunr that loop now. it will work. no more code
needed.

we can shortcut this with ui/gfx objects returning the mainloop
singletone.
2016-04-22 09:38:58 +09:00
Cedric BAIL 454722cf6f ecore: rename Ecore_Mainloop to Efl.Loop. 2016-04-21 15:11:32 -07:00