The _clutter_context_get_default() function will automatically
create the main Clutter context; if we just want to check whether
Clutter has been initialized this will complicate matters, by
requiring a call to g_type_init() inside the client code.
Instead, we should simply provide an internal API that checks
whether the main Clutter context exists and if it has been
initialized, without any side effect.
#endif
}
+gboolean
+_clutter_context_is_initialized (void)
+{
+ if (ClutterCntx == NULL)
+ return FALSE;
+
+ return ClutterCntx->is_initialized;
+}
+
ClutterMainContext *
_clutter_context_get_default (void)
{
- if (G_UNLIKELY(!ClutterCntx))
+ if (G_UNLIKELY (ClutterCntx == NULL))
{
ClutterMainContext *ctx;
ctx->motion_events_per_actor = TRUE;
#ifdef CLUTTER_ENABLE_DEBUG
- ctx->timer = g_timer_new ();
+ ctx->timer = g_timer_new ();
g_timer_start (ctx->timer);
#endif
}
#define CLUTTER_CONTEXT() (_clutter_context_get_default ())
ClutterMainContext *_clutter_context_get_default (void);
+gboolean _clutter_context_is_initialized (void);
PangoContext *_clutter_context_create_pango_context (ClutterMainContext *self);
PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self);