Commit Graph

52 Commits

Author SHA1 Message Date
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Cedric Bail aa4da11b33 ecore: do not create another main loop object
So ecore main loop does restart everything with an main loop shutdown
and init when it detect a bad fd. This can happen if you del a fd after
you have destroyed it. Something terminology is doing (and should be
legal), but that then ended up with a main loop with no event handler
registered and the process was looking like stuck with nothing happening.
2016-05-17 07:41:13 -07:00
Cedric BAIL 93af61f255 ecore: rename ecore_timer to efl_timer. 2016-05-04 10:30:13 -07:00
Cedric Bail 7fa953e9ae ecore: add Efl.Loop.Job promise. 2016-05-02 18:17:09 -07:00
Cedric BAIL 3108f023ba ecore: move ecore idle exiter to relly on the factorized main loop event. 2016-04-21 14:49:00 -07:00
Cedric BAIL 5c87f2762f ecore: use new refactorized idle infrastructure to make idle enterer rely on mainloop events 2016-04-21 14:07:49 -07:00
Cedric BAIL 3ff21c021d ecore: move Ecore_Idler to legacy and rely on Eo event restart capability. 2016-04-21 12:07:50 -07:00
Cedric BAIL bc7174262f ecore: make the main loop singleton initialized and available early on. 2016-04-21 12:07:50 -07:00
Jean-Philippe Andre 83a591b335 Ecore: Try to fix build for windows
Move efl.h above ecore.h to not mess with EAPI's dllimport
vs. dllexport definition. This addresses T3423.
2016-04-07 15:25:42 +09:00
Jean-Philippe Andre 4e4b42ec03 Efl: Add internal strong symbol to fix build on GCC < 5.3
This fixes a crash in ecore_init, calling a weak function from
libefl that was resolved to NULL.

So, here's a fun thing happening with GCC < 5.3. Since a1a506e13e
all EOAPI and EO class_get() functions are weak symbols. This means
that all APIs inside libefl.so are weak.

As a result, gcc linker with --as-needed skipped linking to libefl
since not a single strong symbol from libefl was required by
libecore. This is actually a bug in gcc linker since we do in fact
use symbols from libefl, just weak ones.

GCC 5.3 seems to be fixed, so people with GCC 5.3+ will not
experience any build/runtime issue. The current patch is
a workaround that bug, by artifically creating a strong symbol
required by ecore.

Other libraries than ecore might also need to call
__efl_internal_init, if they end up not being linked to libefl.
2016-04-07 14:40:10 +09:00
Carsten Haitzler 7c8b2da286 efl ecore - init vpath on ecore init so we have a base object working
this inits a new vpath object and adds it at priority 0 to the vpath
manager so you can use the vpath manager to create vpath file objects
and look things up.

@feature
2016-04-05 16:22:59 +09:00
Tom Hacohen f24210caac Revert "Automatic migration to the new eo_add syntax."
This reverts commit 4f949a2757.
2016-03-11 12:29:03 +00:00
Tom Hacohen 4f949a2757 Automatic migration to the new eo_add syntax. 2016-03-09 16:09:14 +00:00
Jean Guyomarc'h 15ddd174a1 ecore: better resources use in the glib integration
Summary:
When glib support is enabled (HAVE_GLIB), _ecore_glib_init()
was always reserving resources. However, its counterpart may not
be called when:
- glib is not always integrated and
- when a user didn't explicitly required the integration.

Calling _ecore_glib_init() within the request code will cause the
resources to be reserved only when the integration with glib is
required and furthermore guarantees that resources always have a
chance to be released.

Reviewers: cedric, raster

Subscribers: cedric, jpeg

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

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2016-03-04 16:09:51 -08:00
Cedric BAIL 8cc6c7561a ecore: remove useless ecore_lock/unlock. 2016-02-02 10:45:42 -08:00
Felipe Magno de Almeida a3db1dddd3 efl-js: JavaScript Eolian binding
To configure efl sources with bindings to use in nodejs add ––with-js=nodejs in configure flags to generate node files

$ configure --with-js=nodejs

and compile normally with:

$ make
$ make install

To use, you have to require efl:

efl = require('efl')

The bindings is divided in two parts: generated and manually
written. The generation uses the Eolian library for parsing Eo files
and generate C++ code that is compiled against V8 interpreter library
to create a efl.node file that can be required in a node.js instance.

@feature
2015-12-23 23:59:40 -02:00
Vincent Torri 0497b9685c efl: add binary mode to open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:06:04 +01:00
Vincent Torri 3b44645363 efl: add binary mode to f(re)open() calls
This allows better compatibility with Windows

Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
2015-12-05 21:04:36 +01:00
Vincent Torri 16063b8ab1 Use eina_environment_tmp_get() 2015-07-22 09:22:02 +01:00
ChunEon Park be0c2f5a31 ecore: null cb function is unacceptable.
@fix
2015-06-10 17:46:31 +09:00
Carsten Haitzler 009ec26460 eina + ecore - fix main loop thread id tracking on fork
if you fork and even if you do ecore_fork_reset() a thread calling
ecore_main_loop_thread_safe_call_async(0 for example eill end up
resetting the mainloop thread id to itself (a non mainlopo thread) via
calling eina_main_loop_is() since pid changed. there is little point
in doing this so remove the pid tracking from eina and ensure mainloop
thread id is updated in ecore's fork reset.

@fix
2015-02-26 19:47:51 +09:00
Cedric BAIL e5ddfb4b2b ecore: add ecore_thread_wait and necessary infrastructure.
This enable the possibility to block the main loop until a
specific thread is done. It may trigger still process ending
of other thread during that function call, but not any other
type of event (timer, animator, idler, ... are all ignored).
2015-01-07 16:45:07 +01:00
Carsten Haitzler 164ea41b3e move ecore documentation not in headers to .h files for consistency 2014-07-26 12:30:12 +09:00
Yossi Kantor 86ec4e28bc Eolian: Integration of Ecore Parent 2014-04-02 10:05:37 +03:00
Cedric Bail 30d7779178 ecore: @fix race condition when using ecore_main_loop_thread_safe_call_sync. 2014-02-27 12:24:28 -03:00
Carsten Haitzler e8c13118eb fix mingw build for setuid fix/checks 2014-01-08 22:06:41 +09:00
Carsten Haitzler b95ef3801f setuid safeness - ensure if an app that is setuid doesn't do bad things
this makes efl ignore certain env vars for thnigs and entirely removes
user modules (that no one ever used) etc. etc. to ensure that *IF* an
app is setuid, there isn't a priv escalation path that is easy.
2014-01-08 19:46:23 +09:00
Carsten Haitzler 6f685d7608 fixme notes - fixme: many instances of module loading that bloat our mem 2014-01-06 12:16:36 +09:00
Cedric BAIL 324f4aebe8 ecore: fix shutdown when using system module.
This patch will detect how many more times ecore_init was called
during initialization and use that as a threshold to do a clean shutdown.
It is a necessary evil as we do have ecore module that will initialize
eldbus that will then reinit ecore_init from within ecore_init and without
a chance for the application to act on it.

I also reenable a test to make sure we will catch earlier this kind of issue.
2013-12-23 11:58:17 +09:00
Gustavo Sverzut Barbieri 8e362c7ad4 allow ecore to not load system modules.
this won't go to changelog/news as it's mainly internal, I can't see
people wanting to use it except rare cases as edje tools.
2013-11-14 13:27:19 -02:00
Tom Hacohen c7addf4083 Changed Eo class names to be consistent.
All the class names are now of the format: Lib_Type_Subtype_Extra.
2013-11-07 11:17:52 +00:00
Cedric Bail e570ea7805 ecore: remove coroutine for now. Can easily be reverted for 1.9. 2013-11-05 11:12:20 +09:00
Cedric Bail 0082c1b4eb ecore: add infrastructure to get info from malloc_info to. 2013-08-27 16:52:00 +09:00
Cedric Bail 56983ed0d4 ecore: fix build without mallinfo. 2013-08-27 16:06:56 +09:00
Cedric Bail d2da83fed8 ecore: fix function call order to actually make mallinfo call work. 2013-08-27 15:57:05 +09:00
José Roberto de Souza 76e69f9323 ecore system: Add Tizen backend 2013-08-15 14:46:30 -03:00
Carsten Haitzler 393040a9fe adjust (as discussed) to have enums for memory and battery state. 2013-08-10 23:23:06 +09:00
Gustavo Sverzut Barbieri c0c5736a4e ecore: add system modules, implement 'systemd'.
Ecore will now load "system modules" on ecore_init(). The "systemd"
module will use DBus to monitor localed, hostnamed and timedated and
add system events related to those changes.
2013-08-09 14:28:02 -03:00
Gustavo Sverzut Barbieri 0a9c78896b ecore: add system-level events.
- ECORE_EVENT_LOW_MEMORY: Low memory state changed
 - ECORE_EVENT_LOW_BATTERY: Low battery state changed
 - ECORE_EVENT_LOCALE_CHANGED:  Locale changed
 - ECORE_EVENT_HOSTNAME_CHANGED: Hostname changed
 - ECORE_EVENT_SYSTEM_TIMEDATE_CHANGED: Time or Date changed
2013-08-09 12:14:00 -03:00
Doug Newgard 95bc804a2e efl: fix systemd spelling.
Signed-off-by: Cedric Bail <cedric.bail@samsung.com>
2013-06-24 12:04:18 +09:00
Cedric Bail cd57e792bc ecore: actually return the real value, even if they were the same in this case. 2013-06-04 11:20:25 +09:00
Cedric Bail a49d3d6bb2 ecore: add some usefull debugging information. 2013-03-30 19:29:14 +09:00
Cedric Bail 7bb467819b ecore: add systemd watchdog support to Ecore main loop. 2013-03-28 23:28:32 +09:00
Cedric BAIL 2063e4353d efl: integrate eina_log_timing. 2013-03-27 21:43:45 +09:00
Cedric Bail a831609e63 ecore: include mman.h also when Evil is found.
I don't really like this patch. I think it would be nicer to have mmap
been correctly detected when Evil or Exotic is there, but at this point
I don't feel at ease with configure.ac.
2013-03-20 10:59:56 +09:00
Cedric BAIL d40fdc2e5f ecore: improve systemd support after fork. 2013-03-15 11:41:42 +09:00
Cedric Bail 3fe8098e9c include some header files conditionally add specific test for fcntl 2013-03-11 10:34:47 +09:00
Cedric BAIL 91711d8a69 ecore: add Ecore_Coroutine.
That work clearly was possible thanks to Leandro. If you want more information
go to his blog : http://tia.mat.br/posts/async_io_with_coroutines/ .

The main difference with his implementation is more portable and not thread safe.
It does not have a custom swapcontext (would make sense as we don't need to save
the sigcontext) so it will be less fast. If people are ready to contribute asm
patch for that purpose I will be happy to apply them.

As for portability this code should work on all architecture we already support
thanks to a nice hack with setjmp/longjmp borowed from libcoroutine. We do use
Fiber for Windows support, but as 1.8 is completely borken in that regard, this
is theorical work only.

Thinks left to do :
- Eoify the API
- Documentation
- More tests
- Add support for coroutine in fd handler
- Add coroutine support to ecore_thread api
- Write some example
2013-02-18 14:38:33 +01:00
Lucas De Marchi f1ca8b54d6 efl: remove check for langinfo.h and locale.h
SVN revision: 82583
2013-01-10 20:25:53 +00:00