mirror of
https://github.com/brl/mutter.git
synced 2024-11-23 00:20:42 -05:00
clutter: Rename ClutterMainContext to ClutterContext
The intention for ClutterContext is to be more or less the MetaContext or CoglContext equivalent. Lets rename the type so that it becomes more consistent with the other similar types. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2016>
This commit is contained in:
parent
6ad0114d1f
commit
579532f644
@ -93,7 +93,7 @@ clutter_backend_dispose (GObject *gobject)
|
|||||||
static void
|
static void
|
||||||
clutter_backend_real_resolution_changed (ClutterBackend *backend)
|
clutter_backend_real_resolution_changed (ClutterBackend *backend)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
ClutterSettings *settings;
|
ClutterSettings *settings;
|
||||||
gdouble resolution;
|
gdouble resolution;
|
||||||
gint dpi;
|
gint dpi;
|
||||||
@ -405,7 +405,7 @@ _clutter_backend_create_context (ClutterBackend *backend,
|
|||||||
ClutterBackend *
|
ClutterBackend *
|
||||||
clutter_get_default_backend (void)
|
clutter_get_default_backend (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *clutter_context;
|
ClutterContext *clutter_context;
|
||||||
|
|
||||||
clutter_context = _clutter_context_get_default ();
|
clutter_context = _clutter_context_get_default ();
|
||||||
|
|
||||||
|
@ -962,7 +962,7 @@ clutter_event_free (ClutterEvent *event)
|
|||||||
ClutterEvent *
|
ClutterEvent *
|
||||||
clutter_event_get (void)
|
clutter_event_get (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
ClutterEvent *event;
|
ClutterEvent *event;
|
||||||
|
|
||||||
event = g_async_queue_try_pop (context->events_queue);
|
event = g_async_queue_try_pop (context->events_queue);
|
||||||
@ -974,7 +974,7 @@ void
|
|||||||
_clutter_event_push (const ClutterEvent *event,
|
_clutter_event_push (const ClutterEvent *event,
|
||||||
gboolean do_copy)
|
gboolean do_copy)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
|
|
||||||
g_assert (context != NULL);
|
g_assert (context != NULL);
|
||||||
|
|
||||||
@ -1016,7 +1016,7 @@ clutter_event_put (const ClutterEvent *event)
|
|||||||
gboolean
|
gboolean
|
||||||
clutter_events_pending (void)
|
clutter_events_pending (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
|
|
||||||
g_return_val_if_fail (context != NULL, FALSE);
|
g_return_val_if_fail (context != NULL, FALSE);
|
||||||
|
|
||||||
@ -1058,7 +1058,7 @@ clutter_get_current_event_time (void)
|
|||||||
const ClutterEvent *
|
const ClutterEvent *
|
||||||
clutter_get_current_event (void)
|
clutter_get_current_event (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
|
|
||||||
g_return_val_if_fail (context != NULL, NULL);
|
g_return_val_if_fail (context != NULL, NULL);
|
||||||
|
|
||||||
@ -1269,7 +1269,7 @@ gboolean
|
|||||||
_clutter_event_process_filters (ClutterEvent *event,
|
_clutter_event_process_filters (ClutterEvent *event,
|
||||||
ClutterActor *event_actor)
|
ClutterActor *event_actor)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
GList *l, *next;
|
GList *l, *next;
|
||||||
|
|
||||||
/* Event filters are handled in order from least recently added to
|
/* Event filters are handled in order from least recently added to
|
||||||
@ -1312,7 +1312,7 @@ clutter_event_add_filter (ClutterStage *stage,
|
|||||||
GDestroyNotify notify,
|
GDestroyNotify notify,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
ClutterEventFilter *event_filter = g_new0 (ClutterEventFilter, 1);
|
ClutterEventFilter *event_filter = g_new0 (ClutterEventFilter, 1);
|
||||||
static guint event_filter_id = 0;
|
static guint event_filter_id = 0;
|
||||||
|
|
||||||
@ -1339,7 +1339,7 @@ clutter_event_add_filter (ClutterStage *stage,
|
|||||||
void
|
void
|
||||||
clutter_event_remove_filter (guint id)
|
clutter_event_remove_filter (guint id)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
for (l = context->event_filters; l; l = l->next)
|
for (l = context->event_filters; l; l = l->next)
|
||||||
|
@ -732,7 +732,7 @@ clutter_input_pointer_a11y_update (ClutterInputDevice *device,
|
|||||||
const ClutterEvent *event)
|
const ClutterEvent *event)
|
||||||
{
|
{
|
||||||
|
|
||||||
ClutterMainContext *clutter_context;
|
ClutterContext *clutter_context;
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
ClutterEventType event_type;
|
ClutterEventType event_type;
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
#include "cally/cally.h" /* For accessibility support */
|
#include "cally/cally.h" /* For accessibility support */
|
||||||
|
|
||||||
/* main context */
|
/* main context */
|
||||||
static ClutterMainContext *ClutterCntx = NULL;
|
static ClutterContext *ClutterCntx = NULL;
|
||||||
|
|
||||||
/* command line options */
|
/* command line options */
|
||||||
static gboolean clutter_is_initialized = FALSE;
|
static gboolean clutter_is_initialized = FALSE;
|
||||||
@ -142,7 +142,7 @@ static const GDebugKey clutter_paint_debug_keys[] = {
|
|||||||
gboolean
|
gboolean
|
||||||
_clutter_context_get_show_fps (void)
|
_clutter_context_get_show_fps (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
|
|
||||||
return context->show_fps;
|
return context->show_fps;
|
||||||
}
|
}
|
||||||
@ -186,7 +186,7 @@ clutter_disable_accessibility (void)
|
|||||||
static CoglPangoFontMap *
|
static CoglPangoFontMap *
|
||||||
clutter_context_get_pango_fontmap (void)
|
clutter_context_get_pango_fontmap (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *self;
|
ClutterContext *self;
|
||||||
CoglPangoFontMap *font_map;
|
CoglPangoFontMap *font_map;
|
||||||
gdouble resolution;
|
gdouble resolution;
|
||||||
gboolean use_mipmapping;
|
gboolean use_mipmapping;
|
||||||
@ -488,7 +488,7 @@ _clutter_context_is_initialized (void)
|
|||||||
return ClutterCntx->is_initialized;
|
return ClutterCntx->is_initialized;
|
||||||
}
|
}
|
||||||
|
|
||||||
ClutterMainContext *
|
ClutterContext *
|
||||||
_clutter_context_get_default (void)
|
_clutter_context_get_default (void)
|
||||||
{
|
{
|
||||||
g_assert (ClutterCntx);
|
g_assert (ClutterCntx);
|
||||||
@ -496,8 +496,8 @@ _clutter_context_get_default (void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
clutter_init_real (ClutterMainContext *clutter_context,
|
clutter_init_real (ClutterContext *clutter_context,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ clutter_init_real (ClutterMainContext *clutter_context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
init_clutter_debug (ClutterMainContext *clutter_context)
|
init_clutter_debug (ClutterContext *clutter_context)
|
||||||
{
|
{
|
||||||
const char *env_string;
|
const char *env_string;
|
||||||
|
|
||||||
@ -595,7 +595,7 @@ clutter_context_new (ClutterBackendConstructor backend_constructor,
|
|||||||
gpointer user_data,
|
gpointer user_data,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
ClutterMainContext *clutter_context;
|
ClutterContext *clutter_context;
|
||||||
|
|
||||||
if (ClutterCntx)
|
if (ClutterCntx)
|
||||||
{
|
{
|
||||||
@ -606,7 +606,7 @@ clutter_context_new (ClutterBackendConstructor backend_constructor,
|
|||||||
|
|
||||||
clutter_graphene_init ();
|
clutter_graphene_init ();
|
||||||
|
|
||||||
clutter_context = g_new0 (ClutterMainContext, 1);
|
clutter_context = g_new0 (ClutterContext, 1);
|
||||||
init_clutter_debug (clutter_context);
|
init_clutter_debug (clutter_context);
|
||||||
clutter_context->show_fps = clutter_show_fps;
|
clutter_context->show_fps = clutter_show_fps;
|
||||||
clutter_context->is_initialized = FALSE;
|
clutter_context->is_initialized = FALSE;
|
||||||
@ -632,7 +632,7 @@ clutter_context_new (ClutterBackendConstructor backend_constructor,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
clutter_context_free (ClutterMainContext *clutter_context)
|
clutter_context_free (ClutterContext *clutter_context)
|
||||||
{
|
{
|
||||||
g_clear_pointer (&clutter_context->events_queue, g_async_queue_unref);
|
g_clear_pointer (&clutter_context->events_queue, g_async_queue_unref);
|
||||||
g_clear_pointer (&clutter_context->backend, clutter_backend_destroy);
|
g_clear_pointer (&clutter_context->backend, clutter_backend_destroy);
|
||||||
@ -853,9 +853,9 @@ clutter_stage_handle_event (ClutterStage *stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_clutter_process_event_details (ClutterActor *stage,
|
_clutter_process_event_details (ClutterActor *stage,
|
||||||
ClutterMainContext *context,
|
ClutterContext *context,
|
||||||
ClutterEvent *event)
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
switch (clutter_event_type (event))
|
switch (clutter_event_type (event))
|
||||||
{
|
{
|
||||||
@ -907,7 +907,7 @@ void
|
|||||||
clutter_stage_process_event (ClutterStage *stage,
|
clutter_stage_process_event (ClutterStage *stage,
|
||||||
ClutterEvent *event)
|
ClutterEvent *event)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
|
|
||||||
context = _clutter_context_get_default ();
|
context = _clutter_context_get_default ();
|
||||||
@ -960,7 +960,7 @@ void
|
|||||||
clutter_threads_remove_repaint_func (guint handle_id)
|
clutter_threads_remove_repaint_func (guint handle_id)
|
||||||
{
|
{
|
||||||
ClutterRepaintFunction *repaint_func;
|
ClutterRepaintFunction *repaint_func;
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
GList *l;
|
GList *l;
|
||||||
|
|
||||||
g_return_if_fail (handle_id > 0);
|
g_return_if_fail (handle_id > 0);
|
||||||
@ -1077,7 +1077,7 @@ clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags,
|
|||||||
gpointer data,
|
gpointer data,
|
||||||
GDestroyNotify notify)
|
GDestroyNotify notify)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
ClutterRepaintFunction *repaint_func;
|
ClutterRepaintFunction *repaint_func;
|
||||||
|
|
||||||
g_return_val_if_fail (func != NULL, 0);
|
g_return_val_if_fail (func != NULL, 0);
|
||||||
@ -1111,7 +1111,7 @@ clutter_threads_add_repaint_func_full (ClutterRepaintFlags flags,
|
|||||||
void
|
void
|
||||||
_clutter_run_repaint_functions (ClutterRepaintFlags flags)
|
_clutter_run_repaint_functions (ClutterRepaintFlags flags)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
ClutterRepaintFunction *repaint_func;
|
ClutterRepaintFunction *repaint_func;
|
||||||
GList *invoke_list, *reinvoke_list, *l;
|
GList *invoke_list, *reinvoke_list, *l;
|
||||||
|
|
||||||
@ -1187,7 +1187,7 @@ clutter_get_default_text_direction (void)
|
|||||||
void
|
void
|
||||||
_clutter_clear_events_queue (void)
|
_clutter_clear_events_queue (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
ClutterEvent *event;
|
ClutterEvent *event;
|
||||||
GAsyncQueue *events_queue;
|
GAsyncQueue *events_queue;
|
||||||
|
|
||||||
|
@ -44,8 +44,6 @@
|
|||||||
* various matrix calculations. */
|
* various matrix calculations. */
|
||||||
#define CLUTTER_COORDINATE_EPSILON (1.0 / 256.0)
|
#define CLUTTER_COORDINATE_EPSILON (1.0 / 256.0)
|
||||||
|
|
||||||
typedef struct _ClutterMainContext ClutterContext;
|
|
||||||
|
|
||||||
typedef ClutterBackend * (* ClutterBackendConstructor) (gpointer user_data);
|
typedef ClutterBackend * (* ClutterBackendConstructor) (gpointer user_data);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -63,9 +61,7 @@ CLUTTER_EXPORT
|
|||||||
void clutter_context_free (ClutterContext *clutter_context);
|
void clutter_context_free (ClutterContext *clutter_context);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_context_get_backend:
|
* clutter_context_get_backend: (skip)
|
||||||
*
|
|
||||||
* Returns: (transfer none): The corresponding %ClutterBackend
|
|
||||||
*/
|
*/
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
ClutterBackend * clutter_context_get_backend (ClutterContext *clutter_context);
|
ClutterBackend * clutter_context_get_backend (ClutterContext *clutter_context);
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
|
|
||||||
G_BEGIN_DECLS
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
typedef struct _ClutterMainContext ClutterMainContext;
|
typedef struct _ClutterContext ClutterContext;
|
||||||
|
|
||||||
#define CLUTTER_REGISTER_VALUE_TRANSFORM_TO(TYPE_TO,func) { \
|
#define CLUTTER_REGISTER_VALUE_TRANSFORM_TO(TYPE_TO,func) { \
|
||||||
g_value_register_transform_func (g_define_type_id, TYPE_TO, func); \
|
g_value_register_transform_func (g_define_type_id, TYPE_TO, func); \
|
||||||
@ -108,11 +108,11 @@ typedef enum
|
|||||||
} ClutterPrivateFlags;
|
} ClutterPrivateFlags;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ClutterMainContext:
|
* ClutterContext:
|
||||||
*
|
*
|
||||||
* The shared state of Clutter
|
* The shared state of Clutter
|
||||||
*/
|
*/
|
||||||
struct _ClutterMainContext
|
struct _ClutterContext
|
||||||
{
|
{
|
||||||
/* the main windowing system backend */
|
/* the main windowing system backend */
|
||||||
ClutterBackend *backend;
|
ClutterBackend *backend;
|
||||||
@ -157,7 +157,7 @@ typedef struct
|
|||||||
gboolean _clutter_threads_dispatch (gpointer data);
|
gboolean _clutter_threads_dispatch (gpointer data);
|
||||||
void _clutter_threads_dispatch_free (gpointer data);
|
void _clutter_threads_dispatch_free (gpointer data);
|
||||||
|
|
||||||
ClutterMainContext * _clutter_context_get_default (void);
|
ClutterContext * _clutter_context_get_default (void);
|
||||||
void _clutter_context_lock (void);
|
void _clutter_context_lock (void);
|
||||||
void _clutter_context_unlock (void);
|
void _clutter_context_unlock (void);
|
||||||
CLUTTER_EXPORT
|
CLUTTER_EXPORT
|
||||||
|
@ -241,7 +241,7 @@ settings_update_fontmap (ClutterSettings *self,
|
|||||||
|
|
||||||
if (self->last_fontconfig_timestamp != stamp)
|
if (self->last_fontconfig_timestamp != stamp)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
gboolean update_needed = FALSE;
|
gboolean update_needed = FALSE;
|
||||||
|
|
||||||
context = _clutter_context_get_default ();
|
context = _clutter_context_get_default ();
|
||||||
|
@ -162,7 +162,7 @@ clutter_stage_manager_init (ClutterStageManager *stage_manager)
|
|||||||
ClutterStageManager *
|
ClutterStageManager *
|
||||||
clutter_stage_manager_get_default (void)
|
clutter_stage_manager_get_default (void)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context = _clutter_context_get_default ();
|
ClutterContext *context = _clutter_context_get_default ();
|
||||||
|
|
||||||
if (G_UNLIKELY (context->stage_manager == NULL))
|
if (G_UNLIKELY (context->stage_manager == NULL))
|
||||||
context->stage_manager = g_object_new (CLUTTER_TYPE_STAGE_MANAGER, NULL);
|
context->stage_manager = g_object_new (CLUTTER_TYPE_STAGE_MANAGER, NULL);
|
||||||
|
@ -3933,7 +3933,7 @@ clutter_stage_grab_full (ClutterStage *stage,
|
|||||||
|
|
||||||
if (!priv->topmost_grab)
|
if (!priv->topmost_grab)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
|
|
||||||
/* First grab in the chain, trigger a backend grab too */
|
/* First grab in the chain, trigger a backend grab too */
|
||||||
@ -4048,7 +4048,7 @@ clutter_stage_unlink_grab (ClutterStage *stage,
|
|||||||
|
|
||||||
if (!priv->topmost_grab)
|
if (!priv->topmost_grab)
|
||||||
{
|
{
|
||||||
ClutterMainContext *context;
|
ClutterContext *context;
|
||||||
ClutterSeat *seat;
|
ClutterSeat *seat;
|
||||||
|
|
||||||
/* This was the last remaining grab, trigger a backend ungrab */
|
/* This was the last remaining grab, trigger a backend ungrab */
|
||||||
|
Loading…
Reference in New Issue
Block a user