### 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.])],
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
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);
}
#endif
+#ifdef GLIB_INTEGRATION_ALWAYS
+ if (_ecore_glib_always_integrate) ecore_main_loop_glib_integrate();
+#endif
+
return _ecore_init_count;
shutdown_log_dom:
#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;
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;
+}
extern int _ecore_fps_debug;
extern double _ecore_loop_time;
+extern Eina_Bool _ecore_glib_always_integrate;
#endif