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>
|
2018-06-22 11:18:59 -07:00
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
# include <sys/socket.h>
|
|
|
|
#endif
|
|
|
|
#ifdef _WIN32
|
|
|
|
# include <ws2tcpip.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
# include <netdb.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
# include <netinet/in.h>
|
|
|
|
#endif
|
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
|
|
|
|
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 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;
|
2015-10-22 12:28:51 -07:00
|
|
|
#if GLIB_CHECK_VERSION(2,32,0)
|
|
|
|
static GRecMutex *_ecore_glib_select_lock;
|
|
|
|
#else
|
|
|
|
static GStaticRecMutex *_ecore_glib_select_lock;
|
|
|
|
#endif
|
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_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;
|
2018-06-16 23:52:48 -07:00
|
|
|
struct stat st;
|
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--;
|
2018-06-16 23:52:48 -07:00
|
|
|
if (!fstat(itr->fd, &st))
|
|
|
|
{
|
|
|
|
if (S_ISSOCK(st.st_mode))
|
|
|
|
{
|
|
|
|
struct sockaddr_in peer;
|
|
|
|
socklen_t length = sizeof(peer);
|
|
|
|
|
|
|
|
memset(&peer, 0, sizeof(peer));
|
|
|
|
if (getpeername(itr->fd, (struct sockaddr *)&peer,
|
|
|
|
&length))
|
|
|
|
itr->revents |= G_IO_ERR;
|
|
|
|
}
|
|
|
|
}
|
2010-09-29 23:09:20 -07:00
|
|
|
}
|
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
|
|
|
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
|
|
|
ctx = g_main_context_default();
|
|
|
|
|
2017-08-09 00:18:10 -07:00
|
|
|
while (!g_main_context_acquire(ctx))
|
|
|
|
g_thread_yield();
|
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
|
|
|
|
2015-10-22 12:28:51 -07:00
|
|
|
#if GLIB_CHECK_VERSION(2,32,0)
|
|
|
|
g_rec_mutex_lock(_ecore_glib_select_lock);
|
|
|
|
#else
|
|
|
|
g_static_rec_mutex_lock(_ecore_glib_select_lock);
|
|
|
|
#endif
|
|
|
|
|
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
|
|
|
|
2015-10-22 12:28:51 -07:00
|
|
|
#if GLIB_CHECK_VERSION(2,32,0)
|
|
|
|
g_rec_mutex_unlock(_ecore_glib_select_lock);
|
|
|
|
#else
|
|
|
|
g_static_rec_mutex_unlock(_ecore_glib_select_lock);
|
|
|
|
#endif
|
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);
|
|
|
|
|
|
|
|
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)
|
|
|
|
{
|
2013-01-25 05:01:56 -08:00
|
|
|
#ifdef HAVE_GLIB
|
|
|
|
#if GLIB_CHECK_VERSION(2,32,0)
|
2015-10-22 12:28:51 -07:00
|
|
|
_ecore_glib_select_lock = malloc(sizeof(GRecMutex));
|
|
|
|
g_rec_mutex_init(_ecore_glib_select_lock);
|
2013-01-25 05:01:56 -08:00
|
|
|
#else
|
2013-03-11 17:47:18 -07:00
|
|
|
if (!g_thread_get_initialized()) g_thread_init(NULL);
|
2015-10-22 12:28:51 -07:00
|
|
|
_ecore_glib_select_lock = malloc(sizeof(GStaticRecMutex));
|
|
|
|
g_static_rec_mutex_init(_ecore_glib_select_lock);
|
2013-01-25 05:01:56 -08:00
|
|
|
#endif
|
|
|
|
#endif
|
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
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
|
|
|
|
2013-01-25 05:01:56 -08:00
|
|
|
#if GLIB_CHECK_VERSION(2,32,0)
|
2015-10-22 12:28:51 -07:00
|
|
|
g_rec_mutex_clear(_ecore_glib_select_lock);
|
2013-01-25 05:01:56 -08:00
|
|
|
free(_ecore_glib_select_lock);
|
|
|
|
_ecore_glib_select_lock = NULL;
|
|
|
|
#else
|
2015-10-22 12:28:51 -07:00
|
|
|
g_static_rec_mutex_free(_ecore_glib_select_lock);
|
2013-01-25 05:01:56 -08:00
|
|
|
_ecore_glib_select_lock = NULL;
|
|
|
|
#endif
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
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;
|
2016-03-04 16:00:58 -08:00
|
|
|
|
|
|
|
/* Init only when requested */
|
|
|
|
_ecore_glib_init();
|
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_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;
|
|
|
|
|
|
|
|
EAPI void
|
|
|
|
ecore_main_loop_glib_always_integrate_disable(void)
|
|
|
|
{
|
|
|
|
_ecore_glib_always_integrate = 0;
|
|
|
|
}
|