--enable-glib-integration-always <- option. can be disabled by

ecore_main_loop_glib_always_integrate_disable() before ecore_init()



SVN revision: 47360
This commit is contained in:
Carsten Haitzler 2010-03-22 03:30:40 +00:00
parent 11b1398008
commit e8d5b972b4
5 changed files with 36 additions and 10 deletions

View File

@ -242,6 +242,15 @@ requirements_ecore_wince=""
### Additional options to configure
want_glib_integration_always=no
AC_ARG_ENABLE(glib-integration-always,
AC_HELP_STRING([--enable-glib-integration-always], [enable glib integration when ecore_init() is called always]),
[want_glib_integration_always=$enableval])
if test "x${want_glib_integration_always}" = "xyes" ; then
AC_DEFINE([GLIB_INTEGRATION_ALWAYS], [1], [Always integrate glib if support compiled])
fi
# abstract sockets (ecore_con.c)
AC_ARG_ENABLE([abstract-sockets],
[AC_HELP_STRING([--disable-abstract-sockets], [disable abstract sockets.])],
@ -1369,6 +1378,7 @@ echo
echo " Ecore........................: always"
echo " Thread support.............: $have_pthread"
echo " GLib support...............: $have_glib"
echo " Always integrate GLib......: $want_glib_integration_always"
echo " Gathering memory statistic.: $have_mallinfo"
echo " Ecore_Con....................: $have_ecore_con"
if test "x$have_ecore_con" = "xyes" ; then

View File

@ -293,7 +293,8 @@ extern "C" {
EAPI void *ecore_main_loop_select_func_get(void);
EAPI Eina_Bool ecore_main_loop_glib_integrate(void);
EAPI void ecore_main_loop_glib_always_integrate_disable(void);
EAPI void ecore_main_loop_begin(void);
EAPI void ecore_main_loop_quit(void);
EAPI Ecore_Fd_Handler *ecore_main_fd_handler_add(int fd, Ecore_Fd_Handler_Flags flags, int (*func) (void *data, Ecore_Fd_Handler *fd_handler), const void *data, int (*buf_func) (void *buf_data, Ecore_Fd_Handler *fd_handler), const void *buf_data);

View File

@ -124,6 +124,10 @@ ecore_init(void)
}
#endif
#ifdef GLIB_INTEGRATION_ALWAYS
if (_ecore_glib_always_integrate) ecore_main_loop_glib_integrate();
#endif
return _ecore_init_count;
shutdown_log_dom:

View File

@ -260,16 +260,9 @@ ecore_main_loop_glib_integrate(void)
#ifdef HAVE_GLIB
void *func;
if (_ecore_glib_active)
return EINA_TRUE;
if (_ecore_glib_active) return EINA_TRUE;
func = ecore_main_loop_select_func_get();
if (func == _ecore_glib_select)
{
fputs("ERROR: glib already integrated.\n", stderr);
return EINA_FALSE;
}
if (func == _ecore_glib_select) return EINA_TRUE;
_ecore_glib_select_original = func;
ecore_main_loop_select_func_set(_ecore_glib_select);
_ecore_glib_active = EINA_TRUE;
@ -279,3 +272,20 @@ ecore_main_loop_glib_integrate(void)
return EINA_FALSE;
#endif
}
Eina_Bool _ecore_glib_always_integrate = 1;
/**
* Disable always integrating glib
*
* 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;
}

View File

@ -196,5 +196,6 @@ void _ecore_job_shutdown(void);
extern int _ecore_fps_debug;
extern double _ecore_loop_time;
extern Eina_Bool _ecore_glib_always_integrate;
#endif