Commit Graph

968 Commits

Author SHA1 Message Date
Myoungwoon Roy, Kim e9d1a1e988 ecore_main: Check for the valid flag
Summary:
This patch checks for the valid Ecore_Fd_Handler_Flags.
The flags should be checked like previous verion because
There are no default handlings in case of out of Ecore_Fd_Handler enum values in other funcs.

Test Plan: Execute a test case

Reviewers: cedric, raster, jpeg, stefan, Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5775
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
Myoungwoon Roy, Kim 6bb2b8b402 ecore_timer: Check for the valid callback func
Summary:
This patch checks whether the callback function is valid or not.
Callback function must be set up for the class.

Test Plan: Execute test suite

Reviewers: cedric, raster, stefan, Jaehyun_Cho

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5762
2018-01-30 14:43:11 +09:00
Mike Blumenkrantz 8f2b36b774 ecore: prune existing thread_join callbacks during ecore_fork_reset
permitting these to persist and trigger at a later point will cause
the process to deadlock while attempting to join non-existent threads

@fix
2018-01-25 15:33:25 -05:00
Myoungwoon Roy, Kim 0a5b15ccac ecore_main: Check for null ptr deref
Summary: This patch fixes a tentative crash owing to dereference of fd_handler.

Test Plan: Execute test suite

Reviewers: cedric, raster, stefan, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5754
2018-01-22 21:27:20 +09:00
Myoungwoon Roy, Kim 6629df5e67 ecore_anim: Check for null ptr deref
Summary:
This patch fixes a tentative crash owing to null ptr dereference
ecore_animator_freeze() has a same patch already.

Test Plan: execute test suite

Reviewers: cedric, raster, jpeg, stefan, Jaehyun_Cho

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D5752
2018-01-22 17:07:58 +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
Carsten Haitzler 20605953f5 Revert "efl loop - provide efl namespace versions of begin/end locks on mainloop"
This reverts commit 76b837002e.

seems no one wants efl api's for this
2018-01-17 21:30:49 +09:00
Cedric BAIL e90a9f3eef Revert "promise: Add even simpler helper for main loop promise creation"
This reverts commit e931fd698d.
2018-01-12 09:37:47 -08:00
Cedric BAIL f5a5609c27 Revert "efl-loop: Don't use 'main' as a variable name"
This reverts commit 214dbdbd59.
2018-01-12 09:37:47 -08:00
Carsten Haitzler 659d5d2894 ecore signal - since we arent going to use threads due to osx, remove
remove thread code since osx is not happy with threads trapping
signals (or at least a thread setting up the handler and trapping
there with signal blocks...). this should now work universally.
2018-01-11 23:13:13 +09:00
Carsten Haitzler af681a1091 ecore signal write - save and restore errno since may be on mainloop
now i disabled the signal thread watcher ... save+restore errno.
2018-01-11 17:25:24 +09:00
Carsten Haitzler 21c8e73111 ecore signal - for now disable the sig watcher thread and do on mainloop
we used to do signals on main loop. keep doing. the pipes should work
in cleanly serializing the signals irrespective of when/where they are
caught (because we do into kernel and back out again). hoping this
makes osx work again. can't test as i have no osx box or vm. works on
linux and freebsd though.
2018-01-11 16:17:54 +09:00
Cedric Bail 0b6f74fde6 ecore: no write after del for efl_loop_timeout. 2018-01-10 18:16:25 -08:00
Cedric BAIL 1f28dce028 ecore: make loop quit exit code work with EINA_VALUE_EMPTY. 2018-01-08 13:40:02 -08:00
Carsten Haitzler f62e051343 efl signals - add signal callbacks for minimal signal set on loops
this willonly apply to the main loop, but to be able to see these
signals as callbacks, we have to expose them. term/quit/int are
already handled internally where the loop will terminate (efl will
enforce this) AND ... there is a terminate event already on the loop
to deal with this cleanup. other signals really arent applicable IMHO
except usr1/2 and hup.
2018-01-06 18:49:07 +09:00
Carsten Haitzler ba16dee6b3 ecore signal - move to using a pipe (and optional thread) tfor signals
this should remove any races in catching signals. it should also be
portable. as well.
2018-01-06 18:20:23 +09:00
Carsten Haitzler 76b837002e efl loop - provide efl namespace versions of begin/end locks on mainloop
add efl_main_loop_steal() and efl_main_loop_release() for new efl
namespace versiosn of ecore_thread_main_loop_begin() and
ecore_thread_main_loop_end().
2018-01-05 15:04:05 +09:00
Vincent Torri f2364053b4 ecore, elementary: remove useless inclusion of Evil.h on public headers when compiling with Visual Studio
Evil.h is already included on Windows in Eina.h
2018-01-04 13:00:00 -08:00
Vincent Torri 4ae6eeb2cf efl: remove _MSC_VER (Visual Studio macro) usage in source code 2018-01-04 12:59:47 -08:00
Cedric BAIL 298915c627 ecore: Efl_Core.h means using EFL_BETA_API_SUPPORT at the moment. 2018-01-04 11:45:10 -08:00
Cedric BAIL 526415d903 eo: make efl_provider_find a @const function. 2018-01-04 11:45:10 -08:00
Cedric BAIL ce373c9b1f ecore: fallback to use efl_provider_find if the passed object isn't an Efl.Loop_Consumer. 2018-01-04 11:45:10 -08:00
Carsten Haitzler df61af9efa eocre timechanges - set obj to null before deletion on stop
stops double-deletion due to callback nesting
2018-01-05 02:34:16 +09:00
Andy Williams 76d8ff590a ecore: fix future -> promise doc 2018-01-04 17:02:57 +00:00
Chris Michael 214dbdbd59 efl-loop: Don't use 'main' as a variable name
Gcc issues a warning here that 'main' is usually a function, so just
rename the variable to avoid the warning.

NB: No funtional changes

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2018-01-04 09:26:28 -05:00
Andy Williams e931fd698d promise: Add even simpler helper for main loop promise creation 2018-01-04 11:56:01 +00:00
Cedric BAIL 5628ecddd6 ecore: introduce efl_loop_promise_new to simplify creation of Eina_Promise. 2018-01-03 12:16:25 -08:00
Cedric BAIL 5efb8f3eb2 ecore: add some documentation for efl_loop_future_scheduler_get. 2018-01-03 12:16:25 -08: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
Cedric BAIL c19ef91020 Revert "efl_loop: move scheduler_get to eo API"
This reverts commit f910ba248e.

The scheduler is meant to be used only in C, not by bindings so there isn't really
a use for it in the loop class. Now this patch was triggered due to complexity in
using future/promise, so will do a follow up patch to improve that.
2018-01-03 11:21:34 -08:00
Andy Williams f910ba248e efl_loop: move scheduler_get to eo API 2018-01-03 12:46:06 +00: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
Carsten Haitzler c3e322be28 efl loop - make param as unused to remove warning 2018-01-02 15:11:06 +09: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 bfeded7252 ecore/efl loop - use efl_loop_time_get on loop obj where needed
stop using the legacy ecore_loop_time_get() func when it should be
coming from the loop object's loop time. also ecore_time_get should
never fall back on ecore_loop_time_get for similar reasons.

part of making the ecore/efl loop a non-global instance (allow loops
in threads)
2017-12-27 01:40:07 +09:00
Carsten Haitzler 27ac9a2be2 ecore main loop - fix fd handler clearning
so loop object destruction was clearing out fd handlers but those may
be later deleted by destructors of child objects. so leave legacy
fdh's and just remove them from the list
2017-12-23 21:13:47 +09:00
Andy Williams 7b4441e2b8 ecore: Reduce the number of lines in our error log
And align for readability
2017-12-22 14:48:28 +00:00
Andy Williams 9a4eedb078 Remove all ocurrences of SPANK from our user facing errors.
This has been bugging me for some time but now we are triggering new errors internally
this is appearing to end users for problems they did not cause.

Additionally I was able to improve a couple of the errors by copying the
explanation from code comments into the error message.

Shorter error logs now too :)
2017-12-22 11:18:46 +00: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
Andy Williams e942dd6420 Eo docs: update for grammar and readability 2017-12-20 09:41:46 +00: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 c8a28b9780 ecore: Properly shutdown pollers 2017-12-19 13:44:33 +09:00
Cedric BAIL 90f30ea418 eina: make __eina_promise_cancel_all an internal only function. 2017-12-18 16:17:04 -08:00
Cedric BAIL 29d4cb864b ecore: make message_process and message_exists internal function. 2017-12-18 16:10:11 -08: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
Jean-Philippe Andre 06fea06c86 ecore: Simplify code 2017-12-18 19:54:31 +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
Jean-Philippe Andre fed8123448 ecore: Avoid double free with promises 2017-12-18 19:54:31 +09:00
Jean-Philippe Andre 796b1dd566 ecore: Fix legacy message handlers destruction 2017-12-18 19:54:31 +09:00
Jean-Philippe Andre 9427862d40 ecore: Fix clean shutdown
There is no good reason to not shutdown a library properly. The loop
object can easily be deleted safely, if it is properly initialized. The
del event happens before destruction so it is too early to set the
singleton variable to NULL. Do that as late as possible and all calls to
efl_loop_main_get() will work as expected.

The issue with fd's was simply that they were not initialized to -1
(timer_fd), as some #ifdef statements have disappeared.
2017-12-18 19:54:31 +09:00
Jean-Philippe Andre b6eeed74bb ecore: Fix warning with enum 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 679d41fc3c ecore - remove warning for win build 2017-12-17 16:27:08 +09:00
Carsten Haitzler 52c9c0e939 windows build - try fix again 2017-12-17 16:03:33 +09:00
Carsten Haitzler 4abe5d90e4 ecore main - try fix windows build
i hope this fixes T6517
2017-12-17 15:07:37 +09:00
Carsten Haitzler 24d43f2f48 efl loop - fix merge issue with future changes. 2017-12-16 12:09:52 +09:00
Carsten Haitzler d9e149eb4d efl loop message stuff - document the eo files. 2017-12-16 12:09:52 +09:00
Carsten Haitzler 02737b1308 ecore - unify comment style 2017-12-15 14:36:30 +09: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
Cedric BAIL df032058fd ecore: rename Efl.Loop_User to Efl.Loop.Consumer. 2017-12-13 14:54:57 -08:00
Ross Vandegrift 71e5c74eb6 efl: drop deprecated Encoding key from desktop files
Summary:
The Encoding key is no longer required, all desktop files are assumed to
be UTF-8 encoded.  See details at:
https://standards.freedesktop.org/desktop-entry-spec/1.1/apc.html

Fix various typos and misspellings

lintian, Debian's package checker, uses strings to check for common typos
in compiled binaries.  This change fixes the ones it identified in 1.20.6.

Reviewers: cedric

Reviewed By: cedric

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-12-13 10:27:48 -08:00
Cedric BAIL c976f16606 ecore: rename efl_loop_Eina_FutureXXX_idle to efl_loop_idle 2017-12-11 14:04:09 -08:00
Cedric BAIL d614894d04 ecore: rename efl_loop_Eina_FutureXXX_job to efl_loop_job. 2017-12-11 14:04:09 -08:00
Cedric BAIL d95a0a1377 ecore: remove efl_loop_job(). 2017-12-11 14:04:09 -08:00
Cedric BAIL 5bc465253b ecore: use Eina_Future variant for job internally to. 2017-12-11 14:04:09 -08:00
Marcel Hollerbach ec56282186 efl_loop: we are creating there efl classes
we should also delete them with efl_del, ecore_timer is only for legacy
2017-12-11 12:58:22 +01:00
Vincent Torri 771bb6e6a7 Evil: use static buffer to store error messages
Reviewers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5394
2017-12-11 16:04:02 +09:00
Stefan Schmidt b4b2711408 docs: fil in missing items for efl_model eo class 2017-12-08 17:04:35 +01:00
Stefan Schmidt 1aeec585b9 docs: fill missing items in efl_interpolator_* eo classes 2017-12-08 16:17:27 +01:00
Lauro Moura c316a2ef37 ecore: Fix compilation for GCC 4
Summary:
GCC4 support compound literals for static initializers only in C89. This
commit reverts to the previous behavior when using this version.

Currently we are using it to build on Windows.

Reviewers: felipealmeida, cedric, barbieri

Subscribers: jpeg

Differential Revision: https://phab.enlightenment.org/D5518
2017-12-04 15:47:52 -03:00
Pawel Aksiutowicz 767eefbf21 ecore: removed warning from ecore_anim
Reviewers: stanluk, lukasz.stanislawski, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D5535
2017-12-04 19:35:06 +09:00
Pawel Aksiutowicz c41480e46c ecore: munmap() call get size of the same type as nmap() call in "len" argument
Reviewers: stanluk, lukasz.stanislawski, jpeg

Reviewed By: jpeg

Subscribers: cedric

Differential Revision: https://phab.enlightenment.org/D5553
2017-12-04 19:32:46 +09:00
Cedric Bail 25747d0881 ecore: rename efl_loop_Eina_FutureXXX_timeout to efl_loop_timeout. 2017-12-03 16:30:53 -08:00
Cedric Bail d0518f7325 ecore: remove efl_loop_timeout. 2017-12-03 16:20:20 -08:00
Cedric Bail a1ea022cf6 ecore: during fd cleanup we didn't remove freed fd handler from the ready fd list. 2017-11-23 15:12:30 -08:00
Mike Blumenkrantz 7cdbe6e029 ecore: reformat ecore_exe_posix.c 2017-11-21 12:31:30 -05:00
Cedric Bail 1112ce2a8a ecore: should be the one triggering EFL_LOOP_EVENT_TERMINATE. 2017-11-15 16:29:14 -08:00
Cedric Bail 23902aabe9 elementary: make sure efl_general.h detection work also when you are not using BETA interface. 2017-11-14 21:04:55 -08:00
Cedric Bail 07da1facaa elementary: protect from stall include.
This should be reverted before next release as this header was only
there during this release cycle.
2017-11-14 20:14:44 -08:00
Cedric Bail f455215ef5 ecore: always declare EFL_MAIN not just for application using the BETA flag. 2017-11-14 20:10:33 -08:00
Cedric Bail 663e31413a Revert "Revert series of patches from cedric (due to dependencies and conflicts)"
This reverts commit 2cea85db38.

Their was a typo that I made during cleanup of the patch before pushing that I didn't
notice broke some stuff. But also you may have an old efl_general.h in your elementary
directory that is now being picked instead of the one provided by the tree.
2017-11-14 20:08:09 -08:00
Carsten Haitzler 2cea85db38 Revert series of patches from cedric (due to dependencies and conflicts)
Revert "elementary: currently double declare elm_init/shutdown."
This reverts commit 44bb0c1848.
Revert "elementary: fix efl_ui_multibutton installed headers."
This reverts commit 32a213dc72.
Revert "elementary: introduce Efl_Ui.h."
This reverts commit df3d3f7334.
Revert "ecore: do not display error message on cancel."
This reverts commit 99654b7cd2.
Revert "efl: and don't forget to install the new dependencies."
This reverts commit 814ffb9b6b.
Revert "ecore: remove EFL_OBJECT_BETA as Efl_Core.h is for Efl new inerfaces."
This reverts commit 619d0f3cff.
Revert "ecore: move EAPI_MAIN from elementary to ecore."
This reverts commit e5d84da864.

as such commit e5d84da864 starts the
breaking. enlightenment, terminologya and other apps can't compile
against that efl anymore. 619d0f3cff
then makes this even worse with even more header errors and undefined
types. on top of this df3d3f7334 then
starts making elementary_test segfault when it runs. it wont even
start up.

asu such of these 7 commits in the first 4 (that are then relied on
later) 3 of these first 4 cause serious breakage. this simply is a
complete lack of testing changes, so i've rolled fl back to before
these things so it builds and works again and you can build against it.

PLEASE test these things. this looks ot me to be obviously a lack of
any testing... :(
2017-11-15 11:48:55 +09:00
Cedric BAIL 619d0f3cff ecore: remove EFL_OBJECT_BETA as Efl_Core.h is for Efl new inerfaces. 2017-11-14 14:17:00 -08:00
Cedric BAIL e5d84da864 ecore: move EAPI_MAIN from elementary to ecore. 2017-11-14 13:50:13 -08:00
Cedric Bail fee2b1beb4 ecore_con: add support for EFL_MAIN with ecore_con support. 2017-11-09 15:25:51 -08:00
Cedric Bail bd83a76393 ecore: move EFL_MAIN to Efl_Core.h
This make EFL_MAIN available and working with just Ecore. For simplicity
it is available with Efl_Core.h. Ideally it should also work with Efl_Net.h
alone and finally with an Efl_Ui.h.

T6262
2017-11-09 15:13:37 -08:00
Jean-Philippe Andre cc1ed7183c edje: Hide edje_global from the rest of the world
Call provider_find on the loop (or basically any object) with the
color/text/size class interface instead, to find it. The main loop is
the main holder of those objects.

Note: This makes use of provider_find instead of direct access to the
variable, in order to self-test the code. In theory release builds will
not do this and user directly the variable.
2017-11-08 20:02:31 +09:00
Andy Williams d5dbcdabd1 eo: Rename efl_ref_get to efl_ref_count 2017-11-08 09:30:42 +00:00
Carsten Haitzler a3b1b5d540 efl - fix build after cedric breakage
25b6a280c0 broke the build...
specifically building AGAINST efl.
2017-11-08 15:05:11 +09:00
Cedric BAIL ee65414ef6 ecore: introduce ecore_init_ex/ecore_shutdown_ex to propagate argc,argv properly. 2017-11-07 16:08:39 -08:00
Cedric BAIL 3d72cb8da3 ecore: report startup time of the main loop with EFL_FIRST_LOOP environment variable. 2017-11-07 16:08:39 -08:00
Cedric BAIL dd40079185 ecore,elementary: move startup time accounting in ecore. 2017-11-07 16:08:39 -08:00
Daniel Kolesa 4f5b72a3ed eo files: convert various to use @cref 2017-11-02 16:41:01 +01:00
Jean Guyomarc'h 9d6cde74ba ecore: fix typo in documentation 2017-10-29 13:59:17 +01:00
Cedric Bail 1ecbe5cffb ecore: add Efl_Core.h 2017-10-27 18:51:38 -07:00
Cedric Bail 173de925ed elementary, ecore: move efl_exit helper to Ecore. 2017-10-27 16:37:58 -07:00
Cedric Bail 1451a2ee3f ecore: add infrastructure to handle an Eina_Value as an exit code. 2017-10-27 15:34:50 -07:00
Cedric Bail 1c82250994 ecore: efl_loop should actually handle exit via Eina_Value.
This is for binding consistency. Example with python :
sys.exit("Bye, world")

Which with efl would be :
loop.quit("Bye, world")

T6228
2017-10-27 15:34:42 -07:00
Taehyub Kim 5360034675 ecore: remove doxygen warning messages
Summary:
remove doxygen warning messages
@fix

Reviewers: jpeg, cedric, woohyun

Reviewed By: jpeg

Differential Revision: https://phab.enlightenment.org/D5339
2017-10-18 19:24:28 +09:00
Jaehyun Cho 2ae42b00ab ecore: Add Efl.Interpolator class
Efl.Interpolator class is to interpolate a value.
Efl.Interpolator class has the following interpolation function classes
as its subclasses.

Efl.Interpolator.Linear
Efl.Interpolator.Accelerate
Efl.Interpolator.Decelerate
Efl.Interpolator.Sinusoidal
Efl.Interpolator.Divisor
Efl.Interpolator.Bounce
Efl.Interpolator.Spring
Efl.Interpolator.Cubic_Bezier
2017-10-12 21:03:49 +09:00
Carsten Haitzler 0889d5b76d efl model - fix checking return of eina_accessor_data_get
coverity - fixes CID 1380995
2017-09-29 12:26:57 +09:00
Cedric Bail ab1080bdd3 ecore: allow other thread to write local data on a thread to increase utility. 2017-09-28 18:31:34 -07:00
Daniel Kolesa 7c7e5ec423 eolian: validate inner types of complex types
This makes sure the inner types are all correctly defined and
that freefuncs are actually correctly filled.
2017-09-28 23:22:05 +02:00
Cedric BAIL 37d6bc03fd ecore: we can actually inherit from Efl.Object, just not in the first position. 2017-09-26 11:13:06 -07:00
Cedric BAIL 5c14be4ecf ecore: we need a different event for tracking the lifecycle of the main loop.
If the main loop is destroyed a lot of companion information might already
have been so relying on EFL_EVENT_DEL might be way to late in the shutdown
process. terminate will be triggered as soon as the process of shutting down
is started, so all the data are still valid and have not been destroyed yet.
2017-09-26 10:15:07 -07:00
Jean-Philippe Andre 25520583a7 ecore: Reset do_quit when ecore shuts down
After ecore_shutdown the main loop is dead, so the flag do_quit can be
safely reset to 0. This will fix issues with cycles of
elm_init/shutdown. This fixes:
  CK_FORK=no tests/elementary/elm_suite elm_win

This patch relies on a few of the previous patches which ensure that
ecore is well shut down.

@fix
2017-09-26 17:58:07 +09:00
Cedric BAIL ec9869b933 ecore: start adding life cycle support to Efl.Loop.
pause event is triggered when no more windows are visible to any user.
resume event is triggered when a window make the application visible
for the first time to the user after a pause or when starting the application.
2017-09-25 15:47:00 -07:00
Carsten Haitzler d136961e3e ecore exe - add an "isolate io"f lag for sending io to /dev/null
this is useful for security to disallow child processes access to
stdio/err of the parent process.

@feature
2017-09-23 22:44:17 +09:00
Cedric Bail 17507bab43 ecore: force initialization of Efl.Io.Closer.Fd.
This will prevent closing magically fd 0 when the object is not
initialized yet.
2017-09-22 14:57:15 -07:00
Daniel Kolesa fdd27cadf8 eo: make more freefuncs implicit 2017-09-22 16:17:19 +02:00
Vincent Torri 0cdd501246 EFL For WIN32: Replace HAVE_EVIL define with _WIN32 2017-09-22 05:06:10 -05:00
Cedric BAIL 8400859213 ecore: make efl_loop_future_scheduler_get shouldn't be exposed in the object function.
Function declared in a .eo are something that we want to allow people to inherit from
or use in a binding. I can't think of a situation where that would be the case for
this function and it solves at the same time problem of needing a shared interface
for both loop and loop_user.
2017-09-18 13:33:34 -07:00
Daniel Kolesa 8f6ba61011 ecore: convert existing eo files to new ownership 2017-09-15 16:51:37 +02:00
Carsten Haitzler dc137aba43 ecore exe - fix fix malloc fail handling
for both ecore_exe_win32.c and ecore_exe_posix.c when the rare case
(basically almost never) that malloc fails for the exe read/err
buffers also set the data size to 0 so it doesn't lie with a NULL ptr
for data.

@fix
2017-09-15 07:44:58 +09:00
Cedric BAIL a10a1fa641 ecore: update buffer size before allocation, not after. 2017-09-14 11:46:28 -07:00
Cedric BAIL 024c6a9fc3 efl: silent warnings shown on solaris due to missing header files. 2017-09-14 09:59:02 -07:00
Cedric Bail ba34b998eb ecore: allow efl_loop_future_scheduler_get on all Efl.Loop.User. 2017-09-13 15:53:00 -07:00
Felipe Magno de Almeida df9f2e0772 ecore: Add efl_model_copmosite_selection model 2017-09-07 14:23:51 +09:00
Jean Guyomarc'h 660e76a562 ecore: fix return value 2017-09-04 19:59:35 +02:00
Guilherme Iscaro de4825a274 efl_io_copier: Use the new Eina_Future API. 2017-09-04 10:24:00 -03: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
Carsten Haitzler f53ea559a1 ecore_exe - fix failed finalize fork to reutrn NULL not ecore_exe_free
dont delete the obj during finalize... just retyurn NULL to fail.
fork() failed for me so i found this... ask not why fork failed... but
it did... and thus found this error handling case.

@fix
2017-09-02 22:33:00 +09:00
Jean-Philippe Andre eb5d9a07ec ecore: Fix shadow warning (with nodejs enabled) 2017-08-23 15:24:37 +09:00
Mike Blumenkrantz c03ea430ab ecore: always set delete_me before removing fd from poll
ensure bad fds don't immediately get re-added to polling

@fix
2017-08-11 18:43:13 -04:00
Daniel Kolesa 436815ca00 ecore, ecore_con: fix const on Eina.Slice
Fixes TODOs from dd5cdda64b
after fixing T5024.
2017-08-10 12:53:14 +02:00
Carsten Haitzler 89aeb2b682 ecore glib support - if we are not the main ctx owner loop to acquire
the code didn't try acquire every loop if we were not, so it wouldnt
wake up if someone stole context (and then gave it up). found by roy!

@fix
2017-08-09 16:19:45 +09:00
Guilherme Iscaro c61ac48f1a Efl_Copier: Add efl_wref_del() for pd->job.
In order to perform IO operations the copier will create futures using
efl_future_use(&pd->job, ...), which will set pd->job to NULL once the
future is destroyed. However this may lead to problems, because in some
cases the copier may be deleted at the _efl_io_copier_job() function,
which is the future's callback. Since the copier may be deleted before
the future, the area pointed by pd->job will have disappeared by the time the future
tries to set pd->job to NULL. To avoid this problem the copier must
explicily call efl_wref_del().

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-08-02 16:03:11 -07:00
WooHyun Jung 9ef214ec08 ecore_events: inarray should be flushed before return
@fix
2017-07-26 18:57:37 +09:00
Carsten Haitzler fe6dc2000d ecore exe - pisix - handle malloc fails
handle malloc fails better
@fix
2017-07-24 16:59:53 +09:00
Carsten Haitzler 829d0bc3f9 ecore win32 exe handling - check realloc and malloc returns
handle out of memory errors better
@fix
2017-07-24 16:57:22 +09:00
Carsten Haitzler b47cbdcb65 ecore_exe - handle realloc failures by complaining and rolling back
@fix
2017-07-24 14:10:17 +09:00
Carsten Haitzler 144f5f73e0 add comment about poll high/medium/low implementation of events
not brilliant as it stands. :(
2017-07-23 19:18:55 +09:00
Carsten Haitzler 8a80005f25 ecore main - fix division to remain a double/float as expected
1/60 != 1.0/60.0 ... the first is an integer which is 0... the second
is 0.016666666 .... a float/double. fix CID 1377532
2017-07-23 19:12:32 +09:00
Derek Foreman 599cdc93fa ecore_anim: set the tick thread's fds CLOEXEC
If we don't set them CLOEXEC then they end up in the fd space of every
client Enlightenment launches, allowing any client to write to them
and mess with animator timings or freeze the compositor.
2017-07-12 13:04:58 -05:00
Chris Michael cd615667d5 ecore: Fix coverity resource leak
Coverity CID1377544 reports that poller is leaked here if we error out
and return null. As poller is created with calloc, we should free it
before returning.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-07-12 10:58:28 -04:00
Cedric BAIL 3c62a5fab8 ecore: properly cleanup callbacks of future/promise. 2017-07-11 11:02:47 -07:00
Larry Jr 891976ae1c Ecore: fix Efl.Model.Item
sent property_changed signal in property_set
2017-06-08 19:12:13 -03:00
Myoungwoon Roy, Kim 802b547310 docs: Fix typos and some wrong expressions in Ecore, Ecore_Audio, Ecore_Cocoa, Ecore_Con, and Ector API reference doxygen.
Summary: I had fixed some typos and wrong expressions, such as capital letters, $simbols in .eo and singulars in Ecore, Ecore_Audio, Ecore_Cocoa, Ecore_Con, and Ector API reference doxygen.

Test Plan: Doxygen Revision

Reviewers: Jaehyun_Cho, stefan, jpeg, cedric, raster

Reviewed By: Jaehyun_Cho

Differential Revision: https://phab.enlightenment.org/D4943
2017-06-07 13:01:13 +09: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 88fc88a305 ecore: poller will be legacy only. 2017-06-02 16:28:28 -07:00
Jean-Philippe Andre 5971277e71 ecore: Try to fix build
ecore_types.eot does not exist anymore.
2017-05-29 13:36:51 +09:00
Jean-Philippe Andre 71678f301a ecore: Remove ecore_types.eot
This moves one enum from EO to legacy only (Ecore_Pos_Map).
Ideally the type should be in Ecore_Legacy and no Common, that
can be done later.

Ref T5522
2017-05-29 10:49:16 +09:00
Jean-Philippe Andre 127c4ac9c2 elm: Remove elm_box_layout_set from EO
This removes a type from ecore_types.eot
elm_box is legacy. Efl.Ui.Box is the new EO-enabled box.

Ref T5522
2017-05-24 15:24:13 +09:00
Mike Blumenkrantz bcdd87ce35 ecore: resolve compiler warning
/home/jpeg/e/core/efl/src/lib/ecore/ecore_main.c:1381: warning: comparison of unsigned enum expression < 0 is always false [-Wtautological-compare]

THANKS @JPEG FOR REPORTING
2017-05-19 12:41:16 -04:00
Mike Blumenkrantz 34999448c2 ecore: allow creation of fd handlers with no flags
it's possible to set flags to 0 with another function, so allowing
creation with 0 makes the api more consistent without breaking the
documented behavior
2017-05-12 12:08:25 -04:00
Stefan Schmidt f406bae8b7 ecore: efl_promise: remove superfluous NULL check
f is already checked against NULL in the eina array macro. No need to check
again.

CID: 1362730
2017-04-26 15:12:53 +02:00
Carsten Haitzler 29feb60d50 ecore - fix epoll ifdefs and case handling 2017-04-22 12:22:17 +09:00
Carsten Haitzler c6eacd6f27 efl_io_closer - fix warning about error print
lazy removal of fcntl without fixing up error print... fixed.
2017-04-21 16:23:16 +09:00
Carsten Haitzler 7282716820 ecore_pipe - fix warning of sign vs unsigned comparison 2017-04-21 16:19:43 +09:00
Ivan Furs c9469e0b01 ecore_pipe: Fixed dead lock with epoll
See a76ebea2d8 and the following
commits on this file.

The following test scenario let to easily reproducible
application hangs:

  elementary_test -to "Icon Desktops"
  # then scroll vigorously with the mouse wheel up/down

This patch was applied as a new revision on the below diff:

Differential Revision: https://phab.enlightenment.org/D4754
2017-04-19 10:33:03 +09:00
Cedric BAIL 712f7e878b ecore: use new API eina_file_close_on_exec. 2017-04-18 16:55:31 -07:00
Carsten Haitzler 3e494a0a21 ecore pipe - fix checking return of read for pipes in new code 2017-04-18 14:30:22 +09:00
Carsten Haitzler 352174784e ecore pipe - fix new coverity complaint about using closed socket
this should fix CID 1374297
2017-04-18 14:25:56 +09:00
Carsten Haitzler 1eb36e6f84 ecore pipe - fix potential use of freed pipe data
new thanks to new patches so not an existing bug in the last release
2017-04-18 14:25:56 +09:00
Carsten Haitzler 0911370790 ecore pipe - clean up formatting a bit 2017-04-18 14:25:56 +09:00
Carsten Haitzler 2055a876c4 ecore pipe - fix cast warning by casting (validly) 2017-04-17 17:08:33 +09:00
Jean Guyomarc'h 8f0402e2fb ecore: fix build on macOS
Epoll/timerfd is not available on "everything but Windows".
This fixes a76ebea2d8.
2017-04-17 09:57:53 +02:00
Carsten Haitzler 2ea4872869 ecore_pipe - fix recent patch to close on exec the epoll fd 2017-04-17 14:23:33 +09:00
Ivan Furs a76ebea2d8 ecore_pipe: added epoll
Summary: integration epoll in ecore_pipe

Reviewers: cedric, NikaWhite, rimmed, an.kroitor, vtorri, raster

Reviewed By: raster

Subscribers: artem.popov, cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4754
2017-04-17 12:28:42 +09:00
Mike Blumenkrantz d956f34021 doc: add explicit note for timeline animator about first frame position 2017-03-31 14:57:25 -04:00
Carsten Haitzler 479fd24650 ecore timeline animators - actually state the starting time
the starting time has always been "now" like in timers (loop time). it
would appear some people don't know this.
2017-03-28 11:44:22 +09:00
Carsten Haitzler 1fa1b46ebf ecore pub headers - use __sun not __sun__ for ifdef for solaris 2017-03-27 19:09:25 +09:00
Vincent Torri ac47c93330 Ecore: siginfo_t type is defined in sys/siginfo.h on Solaris 2017-03-27 08:22:06 +09:00
Umesh Tanwar b313b30cf7 ecore: proper macro usage for double comparision. Summary: The comparisions are done between doubles. EINA_FLT_EQ -> EINA_DBL_EQ
Summary: Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: singh.amitesh, cedric

Subscribers: jpeg, atulfokk

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-03-21 11:11:23 -07: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
Umesh Tanwar b938e2b5d8 ecore_animator: improve comparision check for stopping animator.
Summary:
Time cmparision does not ensure the corrctness of posotion.
It is beacuse of double number calculation. Double number calculation
are not convertable.for example:
   1/39 = 0.02564102564;
   but 0.02564102564 * 39 = 0.99999999996 != 1;

The addition check for pos ensure the pos to be reached at its correct
position.

@fix

Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: cedric, singh.amitesh, jpeg, raster

Reviewed By: raster

Subscribers: atulfokk, cedric, jpeg

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

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-03-14 14:38:44 +05:30
Umesh Tanwar 3b4cbc56bb ecore_animator: use EINA_DBL_EQ for comparing double values
Summary:
EINA_FLT_EQ was used to compare double values. replace it with EINA_DBL_EQ

@fix
Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>

Reviewers: raster, cedric, singh.amitesh

Reviewed By: singh.amitesh

Subscribers: atulfokk

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

Signed-off-by: Amitesh Singh <amitesh.sh@samsung.com>
2017-03-10 11:57:08 +05:30
Cedric BAIL b80cfb38a1 ecore: avoid potential crash on shutdown in Ecore_Exe 2017-03-09 16:17:58 -08: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
Chris Michael ad1e5ead40 ecore-anim: Remove unused variable
Gcc reports 'i' as unused here and checking the code confirms that, so
remove unused variable.

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-09 08:51:18 -05:00
Ivan Furs c1a2c89ac8 win32: removed duplicate winsock2.h and added WIN32_LEAN_AND_MEAN in Ecore.h
Summary: winsock2.h is dublicate in src/lib/ecore/ecore_main.c

Reviewers: NikaWhite, an.kroitor, cedric, raster, rimmed, vtorri

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D4688
2017-03-09 17:39:39 +09:00
Cedric BAIL 4e1567b41e ecore: switch back to use ecore_thread_wait.
We need to make sure that we wait properly on the animator thread
otherwise we end up with the animator finish callback being called
later on during the shutdown process which means trouble.
2017-03-07 11:08:52 -08:00
Jean Guyomarc'h ccbab08a4b ecore: fix build when debugging threads 2017-03-07 00:52:28 +01: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
Marcel Hollerbach 097f9cfe5f ecore_thread: do not override the data field of a thread
otherwise a currently executed ecore_thread is going to pass a complete
wrong data to its callbacks.

fix T5175
fix T5173
2017-03-02 20:13:58 +01:00
Bryce Harrington ad109b0bc4 ecore: Fix typo in error message
Reviewers: cedric, jpeg

Reviewed By: jpeg

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D4689
2017-03-02 11:52:22 +09:00
Chris Michael b09dcc1e0e ecore: Don't use logging domains with spaces
Small patch to change the name of the ecore_animator logging domain.
Names with spaces in them make it impossible to export
EINA_LOG_LEVELS_GLOB inside a bashrc

Signed-off-by: Chris Michael <cp.michael@samsung.com>
2017-03-01 10:50:52 -05:00
Cedric BAIL d8edf70c32 ecore: improve debugging of animator. 2017-02-28 11:04:34 -08: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
Mike Blumenkrantz 83f38d2b2c ecore: do not access 'timer_thread' global from animator thread
@fix
2017-02-24 14:13:11 -05:00
Myoungwoon Roy, Kim e4b37d7cb4 doxygen: Fix typos & invalid statements in Ecore_Getopt and Ecore_Legacy
Summary: There are some typos and calogique statements in doxygen
of Ecore_Getopt and Ecore_Legacy so I had fixed typos and cacologique statements.

Test Plan: Doxygen revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho

Subscribers: jpeg, conr2d

Differential Revision: https://phab.enlightenment.org/D4651
2017-02-13 19:54:29 +09:00
Carsten Haitzler b3f0db816a efl io - fix using wrong type for return values pointed to
this potentially could be a bug on 32bit systems. this fixes that and
addresses the warning that pointed it out
2017-02-11 23:13:00 +09:00
Carsten Haitzler a7d7af0d21 ecore pipe - fix warning of comparing integers of differing sizes 2017-02-11 23:13:00 +09:00
Derek Foreman 44804a9579 ecore: Don't call _ecore_fd_valid() in release builds
Not sure _ecore_fd_valid() is all that useful anymore, as the
commit that introduced it said it would be removed "before release"
a long time ago - it's a debug assist that probably doesn't need
to be in release builds.

(I'm counting syscalls on rpi3 - still, calling this an optimization
seems like a bit of a stretch.)
2017-02-10 12:13:06 -06:00
Stefan Schmidt 174f86b2e8 docs: ecore: document newly added efl model composite classes 2017-02-09 14:47:21 +01:00
Myoungwoon Roy, Kim 0f446c10be doxygen: fix typos, cacologique statements in API reference doxygen of Ecore_Common
Summary: There are some typos and calogique statements in doxygen of Ecore_Common so I had fixed typos, cacologique statements.

Test Plan: doxygen revision

Reviewers: stefan, cedric, raster, Jaehyun_Cho

Subscribers: conr2d, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-08 11:09:18 -08:00
Cedric BAIL 4f2af24755 ecore: reset during timer callback execution doesn't make sense.
@fix
T3222
2017-02-07 16:39:02 -08:00
Carsten Haitzler 51c7c9bc99 ecore thread - up default 3 of thread workers to 4x cpu cures
this ups it from number of cpu cores to 4 times that (so if threads to
blocking i/o the spare cycles can be used up).
2017-02-08 08:48:35 +09:00
Myoungwoon Roy, Kim 1f1d52503e doxygen: fix typo, cacologique expressions in API reference doxygen.
Summary: Fix typos, cacologique expressions in Ecore API reference doxygen.

Test Plan: doxygen

Reviewers: stefan, cedric, raster, Jaehyun_Cho

Subscribers: jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-07 13:28:50 -08:00
Cedric BAIL a8eeca3c2f ecore: make sure we always manipulate a valid timer. 2017-02-06 15:35:48 -08:00
Felipe Magno de Almeida 8054037992 efl: add composite model for boolean properties
Add Efl.Model.Composite.Boolean, a model for wrapping another Efl.Model and
adding boolean properties to its children.
Children of the given composite model will have the boolean properties
specified in Efl.Model.Composite.Boolean with the specified default value.
A call to Efl.Model.Property_set can change the property value for a child.

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-06 15:26:27 -08:00
Larry Jr 093c592188 efl: add efl_model and efl_ui_view classes
Efl.Model.Container and Efl.Model.Item to efl/interfaces are used
to create Efl.Model objects with predefined property values.
This is useful to any situation where we want an Efl.Model with
explicit defined property values.

Efl.Ui.View and Efl.Ui.Factory are used to connect Efl.Models with
Widgets, Elm.Layout and Efl.Ui.Image has changed to use news interfaces

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2017-02-06 15:26:21 -08:00
Cedric BAIL de83cc77d3 ecore: handle initialization of timer correctly. 2017-02-06 14:29:56 -08:00
Chidambar Zinnoury cece2b53d7 ecore thread: Fix waiting.
Waiting would sometimes return as if the thread finished correctly while it is still running.

 This is because we’re waiting for the waiter data to be null… but this is always the case if the user-passed data is null!

 @fix
2017-02-04 23:44:31 +01:00
Cedric BAIL 7819333875 ecore: poller could actually be related to the main loop timing.
Reduce call to ecore_time_get which is a syscall to gettimeofday.
2017-02-03 13:05:44 -08:00
Gustavo Sverzut Barbieri 8dc853f230 ifdef RUN_IN_TREE logic.
This logic is only needed for autotools, cmake will replicate the
installation file structure and thus eina_prefix works out of box.
2017-02-03 12:36:38 -02:00
Cedric BAIL f66559a4cd ecore: avoid calling ecore_time_get everytime we create a timer.
This is particularly useful for ecore_timer_loop_add which are not
supposed to trigger any syscall. It does add a new requirement
on the EFL_LOOP_TIME_CLASS to always have an interval defined during
construction.
2017-02-02 16:56:57 -08:00
Gustavo Sverzut Barbieri f958921177 cmake: add ecore.
no tests or modules (which depend on eldbus).
2017-01-25 19:29:20 -02:00
Jean-Philippe Andre 4550b4cf83 eina: Introduce Eina_Slstr for short-lived strings
Built on top of the new 'postponed' free queue, the short-lived
strings API allows users to return new strings without caring
about freeing them. EFL main loop will do this automatically for
them you at a later point in time (at the end of an iteration).

The APIs provided will either duplicate (copy) or more generally
steal an existing string (char *, stringshare, tmpstr, strbuf),
taking ownership of it and controling its lifetime. Those strings
can then be safely returned by an API. From a user point of view,
those strings must be considered like simple const char *, ie.
no need to free() them and their validity is limited to the
local scope.

There is no function to remove such a string from the freeq.

The short lived strings API is not thread-safe: do not send a
short-lived object from one thread to another.

@feature
2017-01-17 14:20:55 +09:00
Daniel Kolesa 85fbc333dd eolian: enforce specification of both get and set in prop impls
Now you can't use the same syntax as you would for a method to
implement a property as whole, instead you need to specify the
getter and/or setter explicitly. This is to allow parent classes
to expand their properties without altering behavior of the child
classes.
2017-01-11 16:38:41 +01:00
Cedric BAIL 8f1c071d6a eina: rename EINA_{FLT,DBL}_CMP to EINA_{FLT,DBL}_EQ. 2017-01-06 15:58:46 -08:00
Marcel Hollerbach f32486ced5 ecore_thread: reset waiter and worker when we have failed
otherwise the func_end and func_cancel can get into a endless recursion.
2016-12-28 12:19:40 +01:00
Marcel Hollerbach 46131ea80c ecore_thread: null out the struct before returning it
it can contain old callback values which are not overwritten in every
case. This just ensures that in both cases, empty trasher or none empty
trasher, are returning the same state of the struct.
2016-12-27 17:55:25 +01:00
Daniel Kolesa c4cb70199f ecore: use new property impl syntax 2016-12-27 16:19:06 +01:00
Andrii Kroitor ea66c8302a ecore_main: don't wait on marked to delete handlers on Windows
This could lead to greedy wait with 100% CPU consumption because on wait
error we never reach actual handlers deletion.
2016-12-27 15:52:33 +02:00
Andrii Kroitor 792acc9f9e ecore_exe: do not try to send 0 bytes
Summary: This action is meaningless when communicating with child process.

Reviewers: barbieri

Reviewed By: barbieri

Subscribers: jpeg, vtorri, cedric, raster

Differential Revision: https://phab.enlightenment.org/D4510
2016-12-22 19:28:44 +02:00
Andrii Kroitor 7e156742b3 ecore_exe_win32: fix typo in input poll thread 2016-12-22 14:39:33 +02:00
Andrii Kroitor 11e687578d ecore_exe: fix send on Windows
Check for bytes written only if more than 0 bytes were sent.
I don't know why some efl code is trying to send 0 bytes, but that works on
Linux and therefore should be fixed on Windows.
2016-12-22 14:13:40 +02:00
Andrii Kroitor 053613db52 ecore: fix wait for stdin on Windows
We can't directly wait on stdin handle because it is signaled imediatly even
if there is no new data on input stream.
2016-12-22 14:13:40 +02:00
Andrii Kroitor bceb263910 ecore_exe is broken on Windows
Summary:
T4938

diff from @raster
Aaaargh! There is no other way to get code from diff on phab..

Reviewers: vtorri

Subscribers: vtorri, i.furs, cedric, jpeg, raster

Differential Revision: https://phab.enlightenment.org/D4448
2016-12-22 11:11:02 +09:00
Cedric BAIL ef166eff14 ecore: we need to process future and promise before the internal start loop. 2016-12-21 11:36:42 -08:00
Gustavo Sverzut Barbieri fd6dbe3393 efl_io_buffered_stream: eos-mark and flush sender on close.
By marking EOS on the outgoing queue we allow the sender to flush
pending data if that's possible.

This also fixes a typo in the condition for eos_mark, it operates on
outgoing, not incoming queue.
2016-12-20 10:18:33 -02:00
Gustavo Sverzut Barbieri c152aad8c5 efl_io_reader/writer: silent errors when operating on unset-objects.
if we're operating on unset objects, fd are now -1 and would complain,
relax that.
2016-12-20 10:18:33 -02:00
Gustavo Sverzut Barbieri 4d5105afeb efl_io_buffered_stream: if there is a copier, check if it's done.
Before we're exiting if there was nothing pending, but in some cases
this was too aggressive as the copier's source may be alive (ie:
not-EOS), however nothing was read to its internal buffer, thus no
pending.

Since the copier will track its source's EOS, just check if it's done.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 829d1d71fb efl_io_copier: fix typo in efl_io_copier_flush().
We should check if destination 'can write', not source.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 08c38713ce do not emit events from efl_io_closer_close() on destructor.
On destructor we're not supposed to emit events, I even thought that
would be implicit, but it's not. If we do, for example an event
handler that would 'efl_del()' on "EFL_IO_CLOSER_EVENT_CLOSED" would
trigger too-many unrefs.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 963e3a793d efl_io_reader/writer: always set 'can_*' to FALSE on errors.
If user tries to read or write and that fails then set 'can_read' or
'can_write' to false, regardless of the error code.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 2666e927a5 efl_io_copier: avoid extra copy, todo--.
Avoid the intermediate buffer and use the new eina_binbuf_expand() +
eina_binbuf_use(), reading directly to the binbuf.
2016-12-20 10:18:32 -02:00
Gustavo Sverzut Barbieri 22837eacc9 efl_io_copier: remove TODO leftovers.
Copier is based on Efl.Io.Reader.can_read,changed and
Efl.Io.Writer.can_write,changed, these events do not keep being posted
until it's actually read/written, instead they trigger only once when
the property change -- unlike Efl.Loop_Fd read/write events.
2016-12-20 10:18:32 -02:00
Cedric BAIL 77a7d6d9e5 ecore: remove float comparison warning from Ecore_Animator code. 2016-12-19 16:33:46 -08:00
Cedric BAIL 1a6dc04fa1 ecore: remove float comparison warning from Ecore_Poller code. 2016-12-19 16:33:46 -08:00
Cedric BAIL 667b4340b9 ecore: remove floating point comparison warning from Ecore_Thread code. 2016-12-19 16:33:46 -08:00
Cedric BAIL 0a05725cc1 ecore: remove floating point comparison warning from Ecore main loop code. 2016-12-19 16:33:46 -08:00
Cedric BAIL 172c07d5cd ecore: remove float comparison warning from Ecore_Pipe. 2016-12-19 16:33:46 -08:00
Gustavo Sverzut Barbieri dd5cdda64b more eo simplified to use Eina_Slice instead of pointer to.
Working directly with Eina_Slice is easier than a pointer to it,
requires no validation of the pointers and is cheap since it's just
putting together size_t + void*.

However we can't hint the user of 'const(Eina.Slice)' properties as
Eolian is incorrectly generating getters as:

   const Eina_Slice class_property_get(...)

which is makes compilers complain about ignored qualifiers:

   ../src/lib/ecore/efl_io_copier.eo.h:329:7: warning: 'const' type qualifier on return type has no effect [-Wignored-qualifiers]

Leave some TODO so @q66 can fix those.
2016-12-19 15:30:56 -02:00
Gustavo Sverzut Barbieri 25a9e1d886 Efl.Io.{Queue,Buffer,Buffered_Stream}: slice_get is now a property.
Previously we couldn't return a slice, instead required the user to
pass a slice and we'd fill it since Eolian couldn't generate fallbacks
for structures.

Since @q66 fixed eolian, we can now return the structure itself as
initially wanted, ditching some TODO from the code.
2016-12-19 15:30:56 -02:00
Gustavo Sverzut Barbieri fe668ef52c efl_io_file: initialize all fd to -1.
Since 0 is a valid fd, we should initialize these to -1.
2016-12-19 13:03:33 -02:00
Cedric BAIL 637073813b ecore: add helper to automatically connect a future result to a promise.
This helper is to be used likely with next and an external request.
2016-12-16 14:10:58 -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 5882c30a98 ecore: refactor promise propagation code. 2016-12-16 10:19:37 -08:00
Daniel Kolesa c813e94606 eolian: unary expr eval for floats and add a signed number mask
This adds a new mask for all signed numbers (sint + float) and
fixes unary expr evaluation for floats, as well as fixes eval
error messages.
2016-12-14 18:23:16 +01:00
Jean-Philippe Andre bcb251e6ab evas: Make evas object loop users
This makes efl_loop_get() work on evas objects, returning the
main loop as expected. Also make the loop a property of the
Loop_User class (shouldn't it be called Efl.Loop.User instead?)
2016-12-13 16:12:27 +09:00
Gustavo Sverzut Barbieri 47ddca0f42 Efl_Future: class name (string) using "." for namespace.
Following recent eolian change, the string must have "." to split
namespace, not "_".
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri 21759f713a yoda-style inactivity timeout.
s/inactivity_timeout/timeout_inactivity/g so it matches the EFL names
with scope first, like timeout_connect, etc.
2016-12-12 02:30:33 -02:00
Gustavo Sverzut Barbieri e5b3d43c4f efl_io_closer_fd: fix warning on windows. 2016-12-09 19:12:33 -02:00
Gustavo Sverzut Barbieri 83cbcf7cb5 efl_io_copier: callbacks may close the copier.
direct or indirect events may trigger the user to close the buffer.
2016-12-09 13:47:04 -02:00
Gustavo Sverzut Barbieri 47f9d06d0b efl_io_buffered_stream: del inner_io if we're the parent.
This is a nice convenience if inner_io was reparented to the wrapper.
2016-12-09 13:47:04 -02:00
Jihoon Kim fdbc5a4019 Fix typo in doxygen about ecore_idler_add 2016-12-09 19:58:54 +09:00
Gustavo Sverzut Barbieri 994d66513f efl_io_buffered_stream: better detection of 'finished' state.
When used with sockets, if it's EOS (ie: remote peer terminated the
connection), but not closed, then it would not emit 'finished' event.

Now it does.
2016-12-08 11:40:45 -02:00
Gustavo Sverzut Barbieri c33ed61e17 efl_io_copier: expose pending_size and add debug to done_get.
In some cases the copier isn't done but you know there is not more
data to arrive at it, then you want to know if all pending data was
flushed from the copier's intermediate buffer to the destination, if
so you can call it closed yourself.
2016-12-08 11:40:45 -02:00
Gustavo Sverzut Barbieri bb5f91273c efl_io_buffered_stream: property and event 'progress'
useful to get feedback on when data was actually sent/received, and
how much.
2016-12-08 11:40:45 -02:00
Andrii Kroitor 52d4313bb6 ecore_exe: fix ecore_exe_send on Windows
Do not repeat already sent data.
Remove pipe_write.data_buf because data was sent directly anyway and it was
used only in this method.
2016-12-08 15:18:46 +02:00
Andrii Kroitor 6f6323d12e Revert "exore_exe: fix from @raster"
This reverts commit c505b754ce.

Accidentally pushed this with build fix. Sorry :(
This commit is related to T4938 and it's goint to be updated, checked and pushed later.
2016-12-08 14:16:38 +02:00
Andrii Kroitor c505b754ce exore_exe: fix from @raster 2016-12-08 14:07:02 +02:00
Vyacheslav Reutskiy 299471991c ecore_exe_win32: fix ecore_exe_send
Write to the child pipe corect data size.
@fix
2016-12-02 11:50:39 +02:00
Carsten Haitzler b3361f1aad ecore exe - handle scope data get null returns when ppl do bad things
peolpe using ecore_exe in threads... for example.
2016-12-01 08:49:25 +09:00