welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include <config.h>
|
|
|
|
#endif
|
|
|
|
|
2011-12-06 14:33:01 -08:00
|
|
|
#include <stdlib.h>
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2009-10-14 23:26:01 -07:00
|
|
|
#include "Ecore.h"
|
2009-12-22 13:15:12 -08:00
|
|
|
#include "ecore_private.h"
|
2009-10-14 23:26:01 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
#ifdef HAVE_GLIB
|
2012-11-18 22:26:48 -08:00
|
|
|
# include <glib.h>
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
static Eina_Bool _ecore_glib_active = EINA_FALSE;
|
2010-08-03 19:55:20 -07:00
|
|
|
static Ecore_Select_Function _ecore_glib_select_original;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
static GCond *_ecore_glib_cond = NULL;
|
|
|
|
static GPollFD *_ecore_glib_fds = NULL;
|
|
|
|
static size_t _ecore_glib_fds_size = 0;
|
|
|
|
static const size_t ECORE_GLIB_FDS_INITIAL = 128;
|
|
|
|
static const size_t ECORE_GLIB_FDS_STEP = 8;
|
|
|
|
static const size_t ECORE_GLIB_FDS_MAX_FREE = 256;
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_ecore_glib_fds_resize(size_t size)
|
|
|
|
{
|
|
|
|
void *tmp = realloc(_ecore_glib_fds, sizeof(GPollFD) * size);
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
if (!tmp)
|
|
|
|
{
|
2010-09-29 23:09:20 -07:00
|
|
|
ERR("Could not realloc from %zu to %zu buckets.",
|
|
|
|
_ecore_glib_fds_size, size);
|
|
|
|
return EINA_FALSE;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
_ecore_glib_fds = tmp;
|
|
|
|
_ecore_glib_fds_size = size;
|
|
|
|
return EINA_TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-20 22:40:39 -07:00
|
|
|
_ecore_glib_context_query(GMainContext *ctx,
|
|
|
|
int priority,
|
|
|
|
int *p_timer)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
|
|
|
int reqfds;
|
|
|
|
|
|
|
|
if (_ecore_glib_fds_size == 0)
|
|
|
|
{
|
2010-04-26 21:30:55 -07:00
|
|
|
if (!_ecore_glib_fds_resize(ECORE_GLIB_FDS_INITIAL)) return -1;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
while (1)
|
|
|
|
{
|
|
|
|
size_t size;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
reqfds = g_main_context_query
|
2011-10-20 22:40:39 -07:00
|
|
|
(ctx, priority, p_timer, _ecore_glib_fds, _ecore_glib_fds_size);
|
2010-04-26 21:30:55 -07:00
|
|
|
if (reqfds <= (int)_ecore_glib_fds_size) break;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
size = (1 + reqfds / ECORE_GLIB_FDS_STEP) * ECORE_GLIB_FDS_STEP;
|
2010-04-26 21:30:55 -07:00
|
|
|
if (!_ecore_glib_fds_resize(size)) return -1;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
if (reqfds + ECORE_GLIB_FDS_MAX_FREE < _ecore_glib_fds_size)
|
|
|
|
{
|
|
|
|
size_t size;
|
|
|
|
|
2010-09-29 23:09:20 -07:00
|
|
|
size = (1 + reqfds / ECORE_GLIB_FDS_MAX_FREE) * ECORE_GLIB_FDS_MAX_FREE;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
_ecore_glib_fds_resize(size);
|
|
|
|
}
|
|
|
|
|
|
|
|
return reqfds;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-20 22:40:39 -07:00
|
|
|
_ecore_glib_context_poll_from(const GPollFD *pfds,
|
|
|
|
int count,
|
|
|
|
fd_set *rfds,
|
|
|
|
fd_set *wfds,
|
|
|
|
fd_set *efds)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
|
|
|
const GPollFD *itr = pfds, *itr_end = pfds + count;
|
|
|
|
int glib_fds = -1;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
for (; itr < itr_end; itr++)
|
|
|
|
{
|
|
|
|
if (glib_fds < itr->fd)
|
2010-09-29 23:09:20 -07:00
|
|
|
glib_fds = itr->fd;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
if (itr->events & G_IO_IN)
|
2010-09-29 23:09:20 -07:00
|
|
|
FD_SET(itr->fd, rfds);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
if (itr->events & G_IO_OUT)
|
2010-09-29 23:09:20 -07:00
|
|
|
FD_SET(itr->fd, wfds);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
if (itr->events & (G_IO_HUP | G_IO_ERR))
|
2010-09-29 23:09:20 -07:00
|
|
|
FD_SET(itr->fd, efds);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return glib_fds + 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-20 22:40:39 -07:00
|
|
|
_ecore_glib_context_poll_to(GPollFD *pfds,
|
|
|
|
int count,
|
|
|
|
const fd_set *rfds,
|
|
|
|
const fd_set *wfds,
|
|
|
|
const fd_set *efds,
|
|
|
|
int ready)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
|
|
|
GPollFD *itr = pfds, *itr_end = pfds + count;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2012-03-28 20:15:36 -07:00
|
|
|
for (; (itr < itr_end) && (ready > 0); itr++)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
|
|
|
itr->revents = 0;
|
From: 이병우 <bw80.lee@samsung.com>
I found a bug in ecore main loop while debuging cpu 100% issue on RSS
application.
1. [RSS] RSS application register two io watch callbacks(for G_IO_IN,
G_IO_OUT seperately) for a GIOChannel with g_io_add_watch().
2. [ecore] In _ecore_glib_context_query() function, g_main_context_query()
returns a fd list, and it has 2 fd items for the GIOChannel (channel
id = 20).
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 0) (G_IO_IN, 0)
itr[3] (20, 4, 0) (G_IO_OUT, 0)
itr[4] (18, 1, 0)
3. [ecore] In _ecore_glib_context_poll_from() function, create read, write,
exception fd list according to the events flags of each fd item.
[6 15 16 18 20], [20], []
4. [ecore] in _ecore_glib_select__locked() function, get active fd number from
select() call
select(21, [6 15 16 18 20], [20], [], NULL) = 1 (out [20])
5. [ecore] In _ecore_glib_context_poll_to() function, there is a bug on
setting revents flag.
(because of incorrect condition check - currently, the logic of the
function cannot handle this case)
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 4) (set incorrectly)
itr[3] (20, 4, 0) => this should be set as (20, 4, 4)!!!!
itr[4] (18, 1, 0)
6. [ecore] In _ecore_glib_select__locked(), g_main_context_check() function
returns false because of the above bug, so g_main_context_dispatch()
function will not be called.
>> After this, the 2~6 flow is executed repeatedly on ecore main loop
(because 20 out is still active fd) and this makes cpu 100% problem.
SVN revision: 69739
2012-03-29 03:36:23 -07:00
|
|
|
if (FD_ISSET(itr->fd, rfds) && (itr->events & G_IO_IN))
|
2010-09-29 23:09:20 -07:00
|
|
|
{
|
|
|
|
itr->revents |= G_IO_IN;
|
|
|
|
ready--;
|
|
|
|
}
|
From: 이병우 <bw80.lee@samsung.com>
I found a bug in ecore main loop while debuging cpu 100% issue on RSS
application.
1. [RSS] RSS application register two io watch callbacks(for G_IO_IN,
G_IO_OUT seperately) for a GIOChannel with g_io_add_watch().
2. [ecore] In _ecore_glib_context_query() function, g_main_context_query()
returns a fd list, and it has 2 fd items for the GIOChannel (channel
id = 20).
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 0) (G_IO_IN, 0)
itr[3] (20, 4, 0) (G_IO_OUT, 0)
itr[4] (18, 1, 0)
3. [ecore] In _ecore_glib_context_poll_from() function, create read, write,
exception fd list according to the events flags of each fd item.
[6 15 16 18 20], [20], []
4. [ecore] in _ecore_glib_select__locked() function, get active fd number from
select() call
select(21, [6 15 16 18 20], [20], [], NULL) = 1 (out [20])
5. [ecore] In _ecore_glib_context_poll_to() function, there is a bug on
setting revents flag.
(because of incorrect condition check - currently, the logic of the
function cannot handle this case)
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 4) (set incorrectly)
itr[3] (20, 4, 0) => this should be set as (20, 4, 4)!!!!
itr[4] (18, 1, 0)
6. [ecore] In _ecore_glib_select__locked(), g_main_context_check() function
returns false because of the above bug, so g_main_context_dispatch()
function will not be called.
>> After this, the 2~6 flow is executed repeatedly on ecore main loop
(because 20 out is still active fd) and this makes cpu 100% problem.
SVN revision: 69739
2012-03-29 03:36:23 -07:00
|
|
|
if (FD_ISSET(itr->fd, wfds) && (itr->events & G_IO_OUT))
|
2010-09-29 23:09:20 -07:00
|
|
|
{
|
|
|
|
itr->revents |= G_IO_OUT;
|
|
|
|
ready--;
|
|
|
|
}
|
From: 이병우 <bw80.lee@samsung.com>
I found a bug in ecore main loop while debuging cpu 100% issue on RSS
application.
1. [RSS] RSS application register two io watch callbacks(for G_IO_IN,
G_IO_OUT seperately) for a GIOChannel with g_io_add_watch().
2. [ecore] In _ecore_glib_context_query() function, g_main_context_query()
returns a fd list, and it has 2 fd items for the GIOChannel (channel
id = 20).
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 0) (G_IO_IN, 0)
itr[3] (20, 4, 0) (G_IO_OUT, 0)
itr[4] (18, 1, 0)
3. [ecore] In _ecore_glib_context_poll_from() function, create read, write,
exception fd list according to the events flags of each fd item.
[6 15 16 18 20], [20], []
4. [ecore] in _ecore_glib_select__locked() function, get active fd number from
select() call
select(21, [6 15 16 18 20], [20], [], NULL) = 1 (out [20])
5. [ecore] In _ecore_glib_context_poll_to() function, there is a bug on
setting revents flag.
(because of incorrect condition check - currently, the logic of the
function cannot handle this case)
itr[0] (16, 1, 0)
itr[1] (15, 1, 0)
itr[2] (20, 1, 4) (set incorrectly)
itr[3] (20, 4, 0) => this should be set as (20, 4, 4)!!!!
itr[4] (18, 1, 0)
6. [ecore] In _ecore_glib_select__locked(), g_main_context_check() function
returns false because of the above bug, so g_main_context_dispatch()
function will not be called.
>> After this, the 2~6 flow is executed repeatedly on ecore main loop
(because 20 out is still active fd) and this makes cpu 100% problem.
SVN revision: 69739
2012-03-29 03:36:23 -07:00
|
|
|
if (FD_ISSET(itr->fd, efds) && (itr->events & (G_IO_HUP | G_IO_ERR)))
|
2010-09-29 23:09:20 -07:00
|
|
|
{
|
|
|
|
itr->revents |= G_IO_ERR;
|
|
|
|
ready--;
|
|
|
|
}
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
return ready;
|
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-20 22:40:39 -07:00
|
|
|
_ecore_glib_select__locked(GMainContext *ctx,
|
|
|
|
int ecore_fds,
|
|
|
|
fd_set *rfds,
|
|
|
|
fd_set *wfds,
|
|
|
|
fd_set *efds,
|
|
|
|
struct timeval *ecore_timeout)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
|
|
|
int priority, maxfds, glib_fds, reqfds, reqtimeout, ret;
|
|
|
|
struct timeval *timeout, glib_timeout;
|
|
|
|
|
|
|
|
g_main_context_prepare(ctx, &priority);
|
|
|
|
reqfds = _ecore_glib_context_query(ctx, priority, &reqtimeout);
|
2010-04-26 21:30:55 -07:00
|
|
|
if (reqfds < 0) goto error;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
glib_fds = _ecore_glib_context_poll_from
|
2011-10-20 22:40:39 -07:00
|
|
|
(_ecore_glib_fds, reqfds, rfds, wfds, efds);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
if (reqtimeout == -1)
|
|
|
|
timeout = ecore_timeout;
|
2010-04-26 21:30:55 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
glib_timeout.tv_sec = reqtimeout / 1000;
|
|
|
|
glib_timeout.tv_usec = (reqtimeout % 1000) * 1000;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-04-26 21:30:55 -07:00
|
|
|
if (!ecore_timeout || timercmp(ecore_timeout, &glib_timeout, >))
|
|
|
|
timeout = &glib_timeout;
|
|
|
|
else
|
|
|
|
timeout = ecore_timeout;
|
|
|
|
}
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
maxfds = (ecore_fds >= glib_fds) ? ecore_fds : glib_fds;
|
|
|
|
ret = _ecore_glib_select_original(maxfds, rfds, wfds, efds, timeout);
|
|
|
|
|
|
|
|
ret = _ecore_glib_context_poll_to
|
2011-10-20 22:40:39 -07:00
|
|
|
(_ecore_glib_fds, reqfds, rfds, wfds, efds, ret);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
if (g_main_context_check(ctx, priority, _ecore_glib_fds, reqfds))
|
|
|
|
g_main_context_dispatch(ctx);
|
|
|
|
|
|
|
|
return ret;
|
|
|
|
|
2011-10-20 22:40:39 -07:00
|
|
|
error:
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
return _ecore_glib_select_original
|
2011-10-20 22:40:39 -07:00
|
|
|
(ecore_fds, rfds, wfds, efds, ecore_timeout);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-20 22:40:39 -07:00
|
|
|
_ecore_glib_select(int ecore_fds,
|
|
|
|
fd_set *rfds,
|
|
|
|
fd_set *wfds,
|
|
|
|
fd_set *efds,
|
|
|
|
struct timeval *ecore_timeout)
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
{
|
2012-11-15 03:14:19 -08:00
|
|
|
GStaticMutex lock;
|
|
|
|
GMutex *mutex;
|
|
|
|
GMainContext *ctx;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
int ret;
|
|
|
|
|
2012-11-15 03:14:19 -08:00
|
|
|
g_static_mutex_init(&lock);
|
|
|
|
mutex = g_static_mutex_get_mutex(&lock);
|
|
|
|
ctx = g_main_context_default();
|
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
if (g_main_context_acquire(ctx))
|
2011-12-19 21:57:57 -08:00
|
|
|
{
|
|
|
|
if (mutex) g_mutex_lock(mutex);
|
|
|
|
}
|
2010-02-22 12:09:44 -08:00
|
|
|
else
|
|
|
|
{
|
2010-09-29 23:09:20 -07:00
|
|
|
if (!_ecore_glib_cond)
|
|
|
|
_ecore_glib_cond = g_cond_new();
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
2010-09-29 23:09:20 -07:00
|
|
|
while (!g_main_context_wait(ctx, _ecore_glib_cond, mutex))
|
|
|
|
g_thread_yield();
|
2010-02-22 12:09:44 -08:00
|
|
|
}
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
ret = _ecore_glib_select__locked
|
2011-10-20 22:40:39 -07:00
|
|
|
(ctx, ecore_fds, rfds, wfds, efds, ecore_timeout);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
2011-12-19 21:57:57 -08:00
|
|
|
if (mutex) g_mutex_unlock(mutex);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
g_main_context_release(ctx);
|
2011-12-19 21:57:57 -08:00
|
|
|
g_static_mutex_free(&lock);
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
|
|
|
|
return ret;
|
|
|
|
}
|
2011-10-20 22:40:39 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_glib_init(void)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
_ecore_glib_shutdown(void)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_GLIB
|
2010-04-26 21:30:55 -07:00
|
|
|
if (!_ecore_glib_active) return;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
_ecore_glib_active = EINA_FALSE;
|
|
|
|
|
|
|
|
if (ecore_main_loop_select_func_get() == _ecore_glib_select)
|
|
|
|
ecore_main_loop_select_func_set(_ecore_glib_select_original);
|
2011-04-20 07:15:33 -07:00
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
if (_ecore_glib_fds)
|
|
|
|
{
|
2010-09-29 23:09:20 -07:00
|
|
|
free(_ecore_glib_fds);
|
|
|
|
_ecore_glib_fds = NULL;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
_ecore_glib_fds_size = 0;
|
|
|
|
|
|
|
|
if (_ecore_glib_cond)
|
|
|
|
{
|
2010-09-29 23:09:20 -07:00
|
|
|
g_cond_free(_ecore_glib_cond);
|
|
|
|
_ecore_glib_cond = NULL;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2010-10-17 00:03:28 -07:00
|
|
|
/**
|
2011-08-10 12:14:48 -07:00
|
|
|
* @addtogroup Ecore_Main_Loop_Group
|
2010-10-17 00:03:28 -07:00
|
|
|
*
|
|
|
|
* @}
|
|
|
|
*/
|
|
|
|
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
/**
|
|
|
|
* Request ecore to integrate GLib's main loop.
|
|
|
|
*
|
|
|
|
* This will add a small overhead during every main loop interaction
|
|
|
|
* by checking glib's default main context (used by its main loop). If
|
|
|
|
* it have events to be checked (timers, file descriptors or idlers),
|
|
|
|
* then these will be polled alongside with Ecore's own events, then
|
|
|
|
* dispatched before Ecore's. This is done by calling
|
|
|
|
* ecore_main_loop_select_func_set().
|
|
|
|
*
|
|
|
|
* This will cooperate with previously set
|
|
|
|
* ecore_main_loop_select_func_set() by calling the old
|
|
|
|
* function. Similarly, if you want to override
|
|
|
|
* ecore_main_loop_select_func_set() after main loop is integrated,
|
|
|
|
* call the new select function set by this call (get it by calling
|
|
|
|
* ecore_main_loop_select_func_get() right after
|
|
|
|
* ecore_main_loop_glib_integrate()).
|
|
|
|
*
|
|
|
|
* This is useful to use GMainLoop libraries, like GTK, GUPnP,
|
|
|
|
* LibSoup, GConf and more. Adobe Flash plugin and other plugins
|
|
|
|
* systems depend on this as well.
|
|
|
|
*
|
|
|
|
* Once initialized/integrated, it will be valid until Ecore is
|
|
|
|
* completely shut down.
|
|
|
|
*
|
2011-06-22 08:00:44 -07:00
|
|
|
* Example of use:
|
|
|
|
* @code
|
|
|
|
*
|
|
|
|
* int main(void)
|
|
|
|
* {
|
|
|
|
* ecore_init();
|
|
|
|
* ecore_main_loop_glib_integrate();
|
|
|
|
*
|
|
|
|
* // some code here
|
|
|
|
*
|
|
|
|
* ecore_main_loop_begin();
|
|
|
|
*
|
|
|
|
* ecore_shutdown();
|
|
|
|
*
|
|
|
|
* return 0;
|
|
|
|
* }
|
|
|
|
*
|
|
|
|
* @endcode
|
|
|
|
*
|
|
|
|
* @note This is only available if Ecore was compiled with GLib support.
|
|
|
|
* @note You don't need to call this function if Ecore was compiled with
|
|
|
|
* --enable-glib-integration-always.
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
*
|
|
|
|
* @return @c EINA_TRUE on success of @c EINA_FALSE if it failed,
|
|
|
|
* likely no GLib support in Ecore.
|
|
|
|
*/
|
|
|
|
EAPI Eina_Bool
|
|
|
|
ecore_main_loop_glib_integrate(void)
|
|
|
|
{
|
|
|
|
#ifdef HAVE_GLIB
|
|
|
|
void *func;
|
|
|
|
|
2010-03-21 20:30:40 -07:00
|
|
|
if (_ecore_glib_active) return EINA_TRUE;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
func = ecore_main_loop_select_func_get();
|
2010-03-21 20:30:40 -07:00
|
|
|
if (func == _ecore_glib_select) return EINA_TRUE;
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
_ecore_glib_select_original = func;
|
|
|
|
ecore_main_loop_select_func_set(_ecore_glib_select);
|
|
|
|
_ecore_glib_active = EINA_TRUE;
|
|
|
|
return EINA_TRUE;
|
|
|
|
#else
|
2012-11-18 22:28:55 -08:00
|
|
|
ERR("No glib support");
|
welcome glib main loop integration support.
that's it, it's here... tested and works fine, please try with your
favorite gmainloop dependent library and report problems. Suggestions:
* GConf to access Gnome and its applications settings.
* GtkSettings to access other properties of Gnome and its applications.
* GUPnP (okay, we have EUPnP, but they have more features so far)
* Rygel, based on GUPnP.
* Libsoup, SOAP and HTTP access, useful for web access and required
by other libraries.
* Mojito, by Moblin, access to various web2.0 services like flickr,
picasa, twitter...
And last but not least, this enables Flash plugin on WebKit-EFL and
may enable us to get Google Gadgets sooner (before someone writes a
proper EFL backend).
Support is auto-detected at compile time but can be disabled with
--disable-glib. Runtime support is not enabled by default (so
compiling with it will just link yet another library), one needs to
call ecore_main_loop_glib_integrate() to do so.
Thanks to INdT folks that provided the initial implementation. I
rewrote it to make it correct, but the idea was good.
SVN revision: 42825
2009-09-30 20:56:38 -07:00
|
|
|
return EINA_FALSE;
|
|
|
|
#endif
|
|
|
|
}
|
2010-03-21 20:30:40 -07:00
|
|
|
|
|
|
|
Eina_Bool _ecore_glib_always_integrate = 1;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Disable always integrating glib
|
2011-04-20 07:15:33 -07:00
|
|
|
*
|
2010-03-21 20:30:40 -07:00
|
|
|
* If ecore is compiled with --enable-glib-integration-always (to always
|
|
|
|
* call ecore_main_loop_glib_integrate() when ecore_init() is called), then
|
|
|
|
* calling this before calling ecore_init() will disable the integration.
|
|
|
|
* This is for apps that explicitly do not want this to happen for whatever
|
|
|
|
* reasons they may have.
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
ecore_main_loop_glib_always_integrate_disable(void)
|
|
|
|
{
|
|
|
|
_ecore_glib_always_integrate = 0;
|
|
|
|
}
|
2010-10-17 00:03:28 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @}
|
|
|
|
*/
|