g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (CLUTTER_ACTOR_IS_MAPPED (self) &&
(G_UNLIKELY (context->pick_mode == CLUTTER_PICK_ALL) ||
g_return_if_fail (CLUTTER_IS_ACTOR (self));
priv = self->priv;
- context = clutter_context_get_default ();
+
+ context = _clutter_context_get_default ();
/* It's an important optimization that we consider painting of
* actors with 0 opacity to be a NOP... */
clutter_actor_set_parent (ClutterActor *self,
ClutterActor *parent)
{
- ClutterMainContext *clutter_context;
ClutterActorPrivate *priv;
- clutter_context = clutter_context_get_default ();
-
g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (CLUTTER_IS_ACTOR (parent));
g_return_if_fail (self != parent);
- g_return_if_fail (clutter_context != NULL);
priv = self->priv;
if (!shader_data)
return;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
shader = shader_data->shader;
if (shader)
if (!shader_data)
return;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
shader = shader_data->shader;
if (shader)
ClutterBackendPrivate *priv = CLUTTER_BACKEND (gobject)->priv;
ClutterMainContext *clutter_context;
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
if (clutter_context && clutter_context->events_queue)
{
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), FALSE);
g_return_val_if_fail (CLUTTER_IS_STAGE (wrapper), FALSE);
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (!context->stage_manager)
context->stage_manager = clutter_stage_manager_get_default ();
ClutterBackendClass *klass;
ClutterMainContext *clutter_context;
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
g_return_if_fail (CLUTTER_IS_BACKEND (backend));
g_return_if_fail (clutter_context != NULL);
{
ClutterMainContext *clutter_context;
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
return clutter_context->backend;
}
ClutterEvent *
clutter_event_get (void)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
if (!context->events_queue)
return NULL;
ClutterEvent *
clutter_event_peek (void)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
g_return_val_if_fail (context != NULL, NULL);
void
clutter_event_put (ClutterEvent *event)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
ClutterEvent *event_copy;
/* FIXME: check queue is valid */
gboolean
clutter_events_pending (void)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
g_return_val_if_fail (context != NULL, FALSE);
guint32
clutter_get_current_event_time (void)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
g_return_val_if_fail (context != NULL, FALSE);
if (__features->features_set)
return;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
__features->flags = (_clutter_features_from_cogl (cogl_get_features ())
- | _clutter_backend_get_features (context->backend));
+ | _clutter_backend_get_features (context->backend));
__features->features_set = TRUE;
static GTimer *timer = NULL;
static guint timer_n_frames = 0;
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
master_clock = _clutter_master_clock_get_default ();
/* Before we can paint, we have to be sure we have the latest layout */
void
clutter_set_motion_events_enabled (gboolean enable)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
context->motion_events_per_actor = enable;
}
gboolean
clutter_get_motion_events_enabled (void)
{
- ClutterMainContext *context = clutter_context_get_default ();
+ ClutterMainContext *context = _clutter_context_get_default ();
return context->motion_events_per_actor;
}
if (G_LIKELY (done))
return;
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
done = TRUE;
}
_clutter_id_to_color (guint id, ClutterColor *col)
{
ClutterMainContext *ctx;
- gint red, green, blue;
- ctx = clutter_context_get_default ();
+ gint red, green, blue;
+
+ ctx = _clutter_context_get_default ();
/* compute the numbers we'll store in the components */
red = (id >> (ctx->fb_g_mask_used+ctx->fb_b_mask_used))
gint red, green, blue;
guint id;
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
/* reduce the pixel components to the number of bits actually used of the
* 8bits.
guint32 id;
GLboolean dither_was_on;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
_clutter_backend_ensure_context (context->backend, stage);
}
ClutterMainContext *
-clutter_context_get_default (void)
+_clutter_context_get_default (void)
{
if (G_UNLIKELY(!ClutterCntx))
{
ClutterMainContext *ctx;
ClutterCntx = ctx = g_new0 (ClutterMainContext, 1);
+
ctx->backend = g_object_new (_clutter_backend_impl_get_type (), NULL);
ctx->is_initialized = FALSE;
ClutterMainContext *ctx;
gdouble seconds;
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
/* FIXME: may need a custom timer for embedded setups */
seconds = g_timer_elapsed (ctx->timer, NULL);
/* Note, creates backend if not already existing, though parse args will
* have likely created it
*/
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
backend = ctx->backend;
if (!ctx->options_parsed)
g_warning ("Locale not supported by C library.\n"
"Using the fallback 'C' locale.");
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
clutter_context->id_pool = clutter_id_pool_new (256);
if (clutter_is_initialized)
return TRUE;
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
backend = clutter_context->backend;
g_assert (CLUTTER_IS_BACKEND (backend));
clutter_base_init ();
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
group = g_option_group_new ("clutter",
_("Clutter Options"),
clutter_base_init ();
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
context->defer_display_setup = TRUE;
group = clutter_get_option_group ();
clutter_base_init ();
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
if (!ctx->defer_display_setup)
{
clutter_base_init ();
- ctx = clutter_context_get_default ();
+ ctx = _clutter_context_get_default ();
if (!ctx->defer_display_setup)
{
guint double_click_time;
guint double_click_distance;
- backend = clutter_context_get_default ()->backend;
+ backend = _clutter_context_get_default ()->backend;
double_click_distance = clutter_backend_get_double_click_distance (backend);
double_click_time = clutter_backend_get_double_click_time (backend);
ClutterActor *stage;
ClutterInputDevice *device = NULL;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
backend = context->backend;
stage = CLUTTER_ACTOR(event->any.stage);
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
g_return_val_if_fail (context != NULL, NULL);
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
return context->frame_rate;
}
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (context->frame_rate != frames_per_sec)
context->frame_rate = frames_per_sec;
ClutterInputDevice *dev = (ClutterInputDevice *)data;
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (dev)
{
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (context->pointer_grab_actor == actor)
return;
clutter_get_pointer_grab (void)
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
return context->pointer_grab_actor;
}
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
context->keyboard_grab_actor = NULL;
clutter_ungrab_keyboard ();
g_return_if_fail (actor == NULL || CLUTTER_IS_ACTOR (actor));
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (context->keyboard_grab_actor == actor)
return;
clutter_get_keyboard_grab (void)
{
ClutterMainContext *context;
- context = clutter_context_get_default ();
+
+ context = _clutter_context_get_default ();
return context->keyboard_grab_actor;
}
ClutterInputDevice *device = NULL;
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
for (item = context->input_devices;
item != NULL;
GList *repaint_funcs;
};
-#define CLUTTER_CONTEXT() (clutter_context_get_default ())
-ClutterMainContext *clutter_context_get_default (void);
+#define CLUTTER_CONTEXT() (_clutter_context_get_default ())
+ClutterMainContext *_clutter_context_get_default (void);
PangoContext *_clutter_context_create_pango_context (ClutterMainContext *self);
PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self);
void
clutter_stage_ensure_current (ClutterStage *stage)
{
- ClutterMainContext *ctx = clutter_context_get_default ();
+ ClutterBackend *backend;
g_return_if_fail (CLUTTER_IS_STAGE (stage));
- _clutter_backend_ensure_context (ctx->backend, stage);
+ backend = clutter_get_default_backend ();
+ _clutter_backend_ensure_context (backend, stage);
}
/**
ClutterActor *stage = NULL;
ClutterPerspective perspective;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (context->shaders)
shader = clutter_actor_get_shader (context->shaders->data);
clutter_threads_enter ();
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
#ifdef HAVE_TSLIB
/* FIXME while would be better here but need to deal with lockups */
clutter_backend_set_double_click_time (backend, 250);
clutter_backend_set_double_click_distance (backend, 5);
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
-#define MAX_FINGERS 5
+#define MAX_FINGERS 5
- for (i=0; i<MAX_FINGERS; i++)
+ for (i = 0; i < MAX_FINGERS; i++)
{
ClutterFruityFingerDevice *device;
device->x = 0;
device->y = 0;
}
+
+#undef MAX_FINGERS
}
GType
ClutterStage *stage = CLUTTER_STAGE_EGL(ba->stage)->wrapper;
MEvent *event = (MEvent*)gs_event;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
bool mapped[MAX_FINGERS] = {false, false, false, false, false}; /* an event has been mapped to this device */
int evs[MAX_FINGERS] = {0,0,0,0,0};
clutter_threads_enter ();
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
while (SDL_PollEvent(&sdl_event))
{
clutter_backend_win32_dispose (GObject *gobject)
{
ClutterBackendWin32 *backend_win32 = CLUTTER_BACKEND_WIN32 (gobject);
- ClutterMainContext *context;
ClutterStageManager *stage_manager;
CLUTTER_NOTE (BACKEND, "Disposing the of stages");
- context = clutter_context_get_default ();
- stage_manager = context->stage_manager;
+ stage_manager = clutter_stage_manager_get_default ();
/* Destroy all of the stages. g_slist_foreach is used because the
finalizer for the stages will remove the stage from the
clutter_win32_disable_event_retrieval (void)
{
ClutterBackendWin32 *backend;
- ClutterMainContext *clutter_context;
- clutter_context = clutter_context_get_default ();
- backend = CLUTTER_BACKEND_WIN32 (clutter_context->backend);
+ backend = CLUTTER_BACKEND_WIN32 (clutter_get_default_backend ());
backend->no_event_retrieval = TRUE;
}
ClutterMainContext *clutter_context;
DWORD message_pos = GetMessagePos ();
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
msg.hwnd = hwnd;
msg.message = umsg;
{
/* Otherwise it might be a foreign window so we should check the
stage list */
- ClutterMainContext *context = clutter_context_get_default ();
- ClutterStageManager *stage_manager = context->stage_manager;
- GSList *l;
+ ClutterStageManager *stage_manager
+ const GSList *stages, *l;
- for (l = stage_manager->stages; l; l = l->next)
+ stage_manager = clutter_stage_manager_get_default ();
+ stages = clutter_stage_manager_peek_stages (stage_manager);
+
+ for (l = stages; l != NULL; l = l->next)
{
ClutterStage *stage = l->data;
ClutterStageWindow *impl;
CLUTTER_NOTE (BACKEND, "Disposing the of stages");
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
stage_manager = context->stage_manager;
/* Destroy all of the stages. g_slist_foreach is used because the
void
clutter_x11_set_display (Display *xdpy)
{
- ClutterMainContext *ctx = clutter_context_get_default ();
+ ClutterMainContext *ctx = _clutter_context_get_default ();
if (ctx->is_initialized)
{
void
clutter_x11_enable_xinput ()
{
- ClutterMainContext *ctx = clutter_context_get_default ();
+ ClutterMainContext *ctx = _clutter_context_get_default ();
if (ctx->is_initialized)
{
void
clutter_x11_disable_event_retrieval (void)
{
- ClutterMainContext *ctx = clutter_context_get_default ();
+ ClutterMainContext *ctx = _clutter_context_get_default ();
if (ctx->is_initialized)
{
return;
}
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
backend_singleton->have_xinput = TRUE;
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (!backend_singleton)
{
ClutterX11XInputDevice *device = NULL;
ClutterMainContext *context;
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
if (!backend_singleton)
{
return NULL;
}
- context = clutter_context_get_default ();
+ context = _clutter_context_get_default ();
return context->input_devices;
#else /* !HAVE_XINPUT */
XEvent xevent;
ClutterMainContext *clutter_context;
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
while (!clutter_events_pending () && XPending (xdisplay))
{
clutter_threads_enter ();
- clutter_context = clutter_context_get_default ();
+ clutter_context = _clutter_context_get_default ();
backend = clutter_context->backend;
event = clutter_event_new (CLUTTER_NOTHING);
ClutterStage *
clutter_x11_get_stage_from_window (Window win)
{
- ClutterMainContext *context;
ClutterStageManager *stage_manager;
- GSList *l;
+ const GSList *stages, *s;
- context = clutter_context_get_default ();
+ stage_manager = clutter_stage_manager_get_default ();
+ stages = clutter_stage_manager_peek_stages (stage_manager);
- stage_manager = context->stage_manager;
-
- /* FIXME: use a hash here for performance resaon */
- for (l = stage_manager->stages; l; l = l->next)
+ /* XXX: might use a hash here for performance resaon */
+ for (s = stages; s != NULL; s = s->next)
{
- ClutterStage *stage = l->data;
+ ClutterStage *stage = s->data;
ClutterStageWindow *impl;
impl = _clutter_stage_get_window (stage);