Clean up ClutterMainContext and clutter-private.h

Do a better job at documenting the main context structure fields; remove
unused members; clean up the declarations.
This commit is contained in:
Emmanuele Bassi 2011-02-09 12:55:25 +00:00
parent ef4688fd0e
commit 719e3b7e20

View File

@ -99,54 +99,66 @@ typedef enum {
CLUTTER_INTERNAL_CHILD = 1 << 6 CLUTTER_INTERNAL_CHILD = 1 << 6
} ClutterPrivateFlags; } ClutterPrivateFlags;
/*
* ClutterMainContext:
*
* The shared state of Clutter
*/
struct _ClutterMainContext struct _ClutterMainContext
{ {
ClutterBackend *backend; /* holds a pointer to the windowing /* the main windowing system backend */
system backend */ ClutterBackend *backend;
GQueue *events_queue; /* the main event queue */
guint is_initialized : 1; /* the main event queue */
guint motion_events_per_actor : 1;/* set for enter/leave events */ GQueue *events_queue;
guint defer_display_setup : 1;
guint options_parsed : 1;
GTimer *timer; /* Used for debugging scheduler */ /* timer used to print the FPS count */
GTimer *timer;
ClutterPickMode pick_mode; /* Indicates pick render mode */ ClutterPickMode pick_mode;
gint num_reactives; /* Num of reactive actors */ /* mapping between reused integer ids and actors */
ClutterIDPool *id_pool;
ClutterIDPool *id_pool; /* mapping between reused integer ids /* default FPS; this is only used if we cannot sync to vblank */
* and actors guint frame_rate;
*/
guint frame_rate; /* Default FPS */
ClutterActor *pointer_grab_actor; /* The actor having the pointer grab /* actors with a grab on all devices */
* (or NULL if there is no pointer grab ClutterActor *pointer_grab_actor;
*/ ClutterActor *keyboard_grab_actor;
ClutterActor *keyboard_grab_actor; /* The actor having the pointer grab
* (or NULL if there is no pointer
* grab)
*/
GSList *shaders; /* stack of overridden shaders */
ClutterActor *motion_last_actor; /* stack of overridden shaders during paint */
GSList *shaders;
/* fb bit masks for col<->id mapping in picking */ /* fb bit masks for col<->id mapping in picking */
gint fb_r_mask, fb_g_mask, fb_b_mask; gint fb_r_mask;
gint fb_r_mask_used, fb_g_mask_used, fb_b_mask_used; gint fb_g_mask;
gint fb_b_mask;
gint fb_r_mask_used;
gint fb_g_mask_used;
gint fb_b_mask_used;
PangoContext *pango_context; /* Global Pango context */ PangoContext *pango_context; /* Global Pango context */
CoglPangoFontMap *font_map; /* Global font map */ CoglPangoFontMap *font_map; /* Global font map */
ClutterEvent *current_event; ClutterEvent *current_event;
guint32 last_event_time; guint32 last_event_time;
gulong redraw_count; gulong redraw_count;
/* list of repaint functions installed through
* clutter_threads_add_repaint_func()
*/
GList *repaint_funcs; GList *repaint_funcs;
/* main settings singleton */
ClutterSettings *settings; ClutterSettings *settings;
/* boolean flags */
guint is_initialized : 1;
guint motion_events_per_actor : 1;
guint defer_display_setup : 1;
guint options_parsed : 1;
}; };
/* shared between clutter-main.c and clutter-frame-source.c */ /* shared between clutter-main.c and clutter-frame-source.c */
@ -161,18 +173,16 @@ gboolean _clutter_threads_dispatch (gpointer data);
void _clutter_threads_dispatch_free (gpointer data); void _clutter_threads_dispatch_free (gpointer data);
#define CLUTTER_CONTEXT() (_clutter_context_get_default ()) #define CLUTTER_CONTEXT() (_clutter_context_get_default ())
ClutterMainContext *_clutter_context_get_default (void); ClutterMainContext * _clutter_context_get_default (void);
gboolean _clutter_context_is_initialized (void); gboolean _clutter_context_is_initialized (void);
PangoContext *_clutter_context_create_pango_context (ClutterMainContext *self); PangoContext * _clutter_context_create_pango_context (ClutterMainContext *self);
PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self); PangoContext * _clutter_context_get_pango_context (ClutterMainContext *self);
#define CLUTTER_PARAM_READABLE \ #define CLUTTER_PARAM_READABLE (G_PARAM_READABLE | G_PARAM_STATIC_STRINGS)
G_PARAM_READABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB #define CLUTTER_PARAM_WRITABLE (G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
#define CLUTTER_PARAM_WRITABLE \ #define CLUTTER_PARAM_READWRITE (G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_STRINGS)
G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB
#define CLUTTER_PARAM_READWRITE \
G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK |G_PARAM_STATIC_BLURB
/* automagic interning of a static string */
#define I_(str) (g_intern_static_string ((str))) #define I_(str) (g_intern_static_string ((str)))
/* mark all properties under the "Property" context */ /* mark all properties under the "Property" context */