Commit Graph

17 Commits

Author SHA1 Message Date
Cedric BAIL 563f91eaf9 ecore: remove data parameters of Efl.Loop_Consumer.promise_new to reduce the risk of inadvertently using the wrong data.
If you need data, use a efl_future_then as done in every case here to get the same feature.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7577
2019-01-16 14:33:26 -08:00
Cedric BAIL d67a7df9ca Revert "fix crashes created by "make efl_loop_promise_new a function""
This serie of patch didn't address the core problem in the design of the
ownership of eina_promise_data_{set/get} usage. It is also redundant with
other infrastructure in eina_promise and so not necessary completely.

This reverts commit de2ec0559b.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7573
2019-01-16 14:33:18 -08:00
Cedric BAIL 4e4176c84c ecore: make Efl.Loop_Consumer.promise_new an @const function.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Differential Revision: https://phab.enlightenment.org/D7544
2019-01-16 14:33:13 -08:00
Cedric BAIL 07e60713fe ecore: correct object constness and documentation of future_resolved and future_rejected functions.
Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7486
2019-01-02 13:39:23 -08:00
Lauro Moura 28c4380eaa ecore: Fix promise cb signature
After the loop_promise_new changes. Also fix unused var warning.

Reviewed-by: Cedric BAIL <cedric.bail@free.fr>
Differential Revision: https://phab.enlightenment.org/D7531
2019-01-02 10:39:11 -08:00
Carsten Haitzler 318d16846f Revert "Revert "ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer.""
This reverts commit 42e886d8d6.
2018-12-26 17:50:09 +00:00
Carsten Haitzler de2ec0559b fix crashes created by "make efl_loop_promise_new a function"
commit 9b5155c9f1 brought about crashes
- specifically that i saw in terminology because it actually uses
eina_promise_data_set() and the new efl_loop_promise_new basically
took over ownership of that data, but if anyone used
eina_promise_data_set() the data ptr used by this new code would bwe
overwritten, causing segfauls when terminology loses selection
ownership. for days i had mysterious crashes of terminology until i
narrowed it down to the above, so if you have too, then this will fix
it.

what this does is create a data set intercept function callback that
for now is only for use inside efl to everride data sets so they set
data inside the new struct that tracks data. i also had to add and
intercept for eina_promise_data_free_cb_set() as this in theory could
also ber a similar problem.

so perhaps the idea/design of efl_loop_promise_new() is not right and
this kind of thgn has to be internal to eina promise... this means
eina promise and loops are much more tied together.
2018-12-26 17:49:34 +00:00
Marcel Hollerbach 42e886d8d6 Revert "ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer."
This reverts commit 9b5155c9f1.

For now lets revert this, this breaks copy and paste, further more it
has the potential to break a lot more things, as eio_model tends to use
efl_loop_promise new, and then eina_promise_data_set, which is
explicitly forbidden.

This fixes crashing terminology instances.
2018-12-26 12:31:08 +01:00
Cedric BAIL 9b5155c9f1 ecore: make efl_loop_promise_new a function of Efl.Loop_Consumer.
I am not sure this is the right way to do it as binding would have to likely
to bind it manually.

Reviewed-by: Lauro Neto <Lauro Moura <lauromoura@expertisesolutions.com.br>>
Differential Revision: https://phab.enlightenment.org/D7492
2018-12-20 12:42:34 -08:00
Cedric BAIL 31eab2cff9 ecore: add an helper on Efl.Loop_Consumer to build resolved and rejected future more easily.
This make all object that inherit from Efl.Loop_Consumer have an easy ability to create a future
from their link to a loop provider. This way there is no need to further lookup for a scheduler.

This can by applied after the patch series from T7471.

Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es>
Differential Revision: https://phab.enlightenment.org/D7337
2018-11-30 14:58:14 -08: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
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 9bedda14b3 efl loop - rename ecore_main_loop_get to efl_main_loop_get
ecore_main_loop_get() is really a new "eo api" but it's using our old
ecore_* namespace, so move to the new efl namespace.
2018-01-02 16:13:54 +09:00
Jean-Philippe Andre 0d85525dc8 loop: Fix loop_get search priority
According to comments by @k-s & @raster.

See 784a5b56a3 this was intended to be a fallback, not the first
lookup indeed. Since this is an error case, let's print an ERR message
at least.
2017-12-20 13:39:11 +09:00
Jean-Philippe Andre 784a5b56a3 loop: Try harder to find the main loop
If the object has no parent or anything else goes a bit wrong,
efl_loop_get() may fail to return the loop object. It's a bit ridiculous
when we're in the main loop as we know which loop object was requested.

This avoids returning NULL.
2017-12-18 19:54:31 +09:00
Cedric BAIL df032058fd ecore: rename Efl.Loop_User to Efl.Loop.Consumer. 2017-12-13 14:54:57 -08:00