diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 6cbcc57e3..cca8a38a3 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -231,6 +231,7 @@ source_h_priv = \ $(srcdir)/clutter-profile.h \ $(srcdir)/clutter-script-private.h \ $(srcdir)/clutter-stage-manager-private.h \ + $(srcdir)/clutter-stage-private.h \ $(srcdir)/clutter-timeout-interval.h \ $(NULL) diff --git a/clutter/clutter-actor.c b/clutter/clutter-actor.c index 0770574b3..2435e250c 100644 --- a/clutter/clutter-actor.c +++ b/clutter/clutter-actor.c @@ -303,7 +303,7 @@ #include "clutter-profile.h" #include "clutter-scriptable.h" #include "clutter-script-private.h" -#include "clutter-stage.h" +#include "clutter-stage-private.h" #include "clutter-units.h" typedef struct _ShaderData ShaderData; diff --git a/clutter/clutter-backend.c b/clutter/clutter-backend.c index 0e5a0d957..ff6635cf1 100644 --- a/clutter/clutter-backend.c +++ b/clutter/clutter-backend.c @@ -48,6 +48,8 @@ #include "clutter-marshal.h" #include "clutter-private.h" #include "clutter-profile.h" +#include "clutter-stage-manager-private.h" +#include "clutter-stage-private.h" #include diff --git a/clutter/clutter-input-device.c b/clutter/clutter-input-device.c index 549917d7e..677103fe7 100644 --- a/clutter/clutter-input-device.c +++ b/clutter/clutter-input-device.c @@ -40,6 +40,7 @@ #include "clutter-enum-types.h" #include "clutter-input-device.h" #include "clutter-private.h" +#include "clutter-stage-private.h" enum { diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index 189a2725a..4b4d8bbaf 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -104,7 +104,7 @@ #include "clutter-master-clock.h" #include "clutter-feature.h" #include "clutter-actor.h" -#include "clutter-stage.h" +#include "clutter-stage-private.h" #include "clutter-private.h" #include "clutter-debug.h" #include "clutter-version.h" /* For flavour define */ diff --git a/clutter/clutter-master-clock.c b/clutter/clutter-master-clock.c index f4ffb2b43..42267feca 100644 --- a/clutter/clutter-master-clock.c +++ b/clutter/clutter-master-clock.c @@ -39,6 +39,7 @@ #include "clutter-debug.h" #include "clutter-private.h" #include "clutter-profile.h" +#include "clutter-stage-private.h" #define CLUTTER_MASTER_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClockClass)) #define CLUTTER_IS_MASTER_CLOCK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_MASTER_CLOCK)) diff --git a/clutter/clutter-offscreen-effect.c b/clutter/clutter-offscreen-effect.c index 045698f3e..8725c2f02 100644 --- a/clutter/clutter-offscreen-effect.c +++ b/clutter/clutter-offscreen-effect.c @@ -71,6 +71,7 @@ #include "clutter-debug.h" #include "clutter-private.h" +#include "clutter-stage-private.h" struct _ClutterOffscreenEffectPrivate { diff --git a/clutter/clutter-private.h b/clutter/clutter-private.h index 5ed34668c..c3b5bd101 100644 --- a/clutter/clutter-private.h +++ b/clutter/clutter-private.h @@ -126,13 +126,6 @@ typedef enum CLUTTER_REDRAW_CLIPPED_TO_ALLOCATION = 1 << 0 } ClutterRedrawFlags; -struct _ClutterStageManager -{ - GObject parent_instance; - - GSList *stages; -}; - struct _ClutterMainContext { ClutterBackend *backend; /* holds a pointer to the windowing @@ -281,8 +274,6 @@ typedef enum _ClutterActorTraverseFlags typedef gboolean (*ClutterForeachCallback) (ClutterActor *actor, void *user_data); -typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry; - #define CLUTTER_CONTEXT() (_clutter_context_get_default ()) ClutterMainContext *_clutter_context_get_default (void); gboolean _clutter_context_is_initialized (void); @@ -307,66 +298,6 @@ PangoContext *_clutter_context_get_pango_context (ClutterMainContext *self); G_CONST_RETURN gchar *_clutter_gettext (const gchar *str); -/* stage */ -void _clutter_stage_do_paint (ClutterStage *stage, - const ClutterGeometry *clip); -void _clutter_stage_set_window (ClutterStage *stage, - ClutterStageWindow *stage_window); -ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage); -ClutterStageWindow *_clutter_stage_get_default_window (void); -void _clutter_stage_get_projection_matrix (ClutterStage *stage, - CoglMatrix *projection); - -void _clutter_stage_dirty_projection (ClutterStage *stage); -void _clutter_stage_set_viewport (ClutterStage *stage, - int x, - int y, - int width, - int height); -void _clutter_stage_get_viewport (ClutterStage *stage, - int *x, - int *y, - int *width, - int *height); -void _clutter_stage_dirty_viewport (ClutterStage *stage); - - -void _clutter_stage_maybe_setup_viewport (ClutterStage *stage); -void _clutter_stage_maybe_relayout (ClutterActor *stage); -gboolean _clutter_stage_needs_update (ClutterStage *stage); -gboolean _clutter_stage_do_update (ClutterStage *stage); - - -void _clutter_stage_queue_event (ClutterStage *stage, - ClutterEvent *event); -gboolean _clutter_stage_has_queued_events (ClutterStage *stage); -void _clutter_stage_process_queued_events (ClutterStage *stage); -void _clutter_stage_update_input_devices (ClutterStage *stage); - -int _clutter_stage_get_pending_swaps (ClutterStage *stage); - -gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage); - -void _clutter_stage_set_pick_buffer_valid (ClutterStage *stage, - gboolean valid); -gboolean _clutter_stage_get_pick_buffer_valid (ClutterStage *stage); -void _clutter_stage_increment_picks_per_frame_counter (ClutterStage *stage); -void _clutter_stage_reset_picks_per_frame_counter (ClutterStage *stage); -guint _clutter_stage_get_picks_per_frame_counter (ClutterStage *stage); - -ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage); -void _clutter_stage_paint_volume_stack_free_all (ClutterStage *stage); - -const ClutterGeometry *_clutter_stage_get_clip (ClutterStage *stage); - -ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage, - ClutterStageQueueRedrawEntry *entry, - ClutterActor *actor, - ClutterPaintVolume *clip); - -void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry); - - /* vfuncs implemented by backend */ GType _clutter_backend_impl_get_type (void); diff --git a/clutter/clutter-stage-manager-private.h b/clutter/clutter-stage-manager-private.h index 8b74089ef..eb1c4c2f0 100644 --- a/clutter/clutter-stage-manager-private.h +++ b/clutter/clutter-stage-manager-private.h @@ -5,6 +5,13 @@ G_BEGIN_DECLS +struct _ClutterStageManager +{ + GObject parent_instance; + + GSList *stages; +}; + /* stage manager */ void _clutter_stage_manager_add_stage (ClutterStageManager *stage_manager, ClutterStage *stage); diff --git a/clutter/clutter-stage-private.h b/clutter/clutter-stage-private.h new file mode 100644 index 000000000..9d2da7986 --- /dev/null +++ b/clutter/clutter-stage-private.h @@ -0,0 +1,64 @@ +#ifndef __CLUTTER_STAGE_PRIVATE_H__ +#define __CLUTTER_STAGE_PRIVATE_H__ + +#include +#include + +G_BEGIN_DECLS + +typedef struct _ClutterStageQueueRedrawEntry ClutterStageQueueRedrawEntry; + +/* stage */ +ClutterStageWindow *_clutter_stage_get_default_window (void); +void _clutter_stage_do_paint (ClutterStage *stage, + const ClutterGeometry *clip); +void _clutter_stage_set_window (ClutterStage *stage, + ClutterStageWindow *stage_window); +ClutterStageWindow *_clutter_stage_get_window (ClutterStage *stage); +void _clutter_stage_get_projection_matrix (ClutterStage *stage, + CoglMatrix *projection); +void _clutter_stage_dirty_projection (ClutterStage *stage); +void _clutter_stage_set_viewport (ClutterStage *stage, + int x, + int y, + int width, + int height); +void _clutter_stage_get_viewport (ClutterStage *stage, + int *x, + int *y, + int *width, + int *height); +void _clutter_stage_dirty_viewport (ClutterStage *stage); +void _clutter_stage_maybe_setup_viewport (ClutterStage *stage); +void _clutter_stage_maybe_relayout (ClutterActor *stage); +gboolean _clutter_stage_needs_update (ClutterStage *stage); +gboolean _clutter_stage_do_update (ClutterStage *stage); + +void _clutter_stage_queue_event (ClutterStage *stage, + ClutterEvent *event); +gboolean _clutter_stage_has_queued_events (ClutterStage *stage); +void _clutter_stage_process_queued_events (ClutterStage *stage); +void _clutter_stage_update_input_devices (ClutterStage *stage); +int _clutter_stage_get_pending_swaps (ClutterStage *stage); +gboolean _clutter_stage_has_full_redraw_queued (ClutterStage *stage); +void _clutter_stage_set_pick_buffer_valid (ClutterStage *stage, + gboolean valid); +gboolean _clutter_stage_get_pick_buffer_valid (ClutterStage *stage); +void _clutter_stage_increment_picks_per_frame_counter (ClutterStage *stage); +void _clutter_stage_reset_picks_per_frame_counter (ClutterStage *stage); +guint _clutter_stage_get_picks_per_frame_counter (ClutterStage *stage); + +ClutterPaintVolume *_clutter_stage_paint_volume_stack_allocate (ClutterStage *stage); +void _clutter_stage_paint_volume_stack_free_all (ClutterStage *stage); + +const ClutterGeometry *_clutter_stage_get_clip (ClutterStage *stage); + +ClutterStageQueueRedrawEntry *_clutter_stage_queue_actor_redraw (ClutterStage *stage, + ClutterStageQueueRedrawEntry *entry, + ClutterActor *actor, + ClutterPaintVolume *clip); +void _clutter_stage_queue_redraw_entry_invalidate (ClutterStageQueueRedrawEntry *entry); + +G_END_DECLS + +#endif /* __CLUTTER_STAGE_PRIVATE_H__ */ diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 80ac80192..d62da3846 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -65,12 +65,12 @@ #include "clutter-private.h" #include "clutter-debug.h" #include "clutter-stage-manager-private.h" -#include "clutter-stage-window.h" #include "clutter-version.h" /* For flavour */ #include "clutter-id-pool.h" #include "clutter-container.h" #include "clutter-profile.h" #include "clutter-device-manager-private.h" +#include "clutter-stage-private.h" #include "cogl/cogl.h" diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index 40c0b6db9..97b92cc7d 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -54,6 +54,7 @@ #include "clutter-debug.h" #include "clutter-fixed.h" #include "clutter-enum-types.h" +#include "clutter-stage-private.h" #include "cogl/cogl.h" diff --git a/clutter/egl/clutter-backend-egl.c b/clutter/egl/clutter-backend-egl.c index dafa6851d..7804004fc 100644 --- a/clutter/egl/clutter-backend-egl.c +++ b/clutter/egl/clutter-backend-egl.c @@ -40,10 +40,11 @@ #include "clutter-stage-egl.h" #include "clutter-egl.h" -#include "../clutter-private.h" -#include "../clutter-main.h" -#include "../clutter-debug.h" -#include "../clutter-version.h" +#include "clutter-debug.h" +#include "clutter-private.h" +#include "clutter-main.h" +#include "clutter-stage-private.h" +#include "clutter-version.h" static ClutterBackendEGL *backend_singleton = NULL; diff --git a/clutter/egl/clutter-stage-egl.c b/clutter/egl/clutter-stage-egl.c index ca5d3c283..3a2a55768 100644 --- a/clutter/egl/clutter-stage-egl.c +++ b/clutter/egl/clutter-stage-egl.c @@ -6,17 +6,14 @@ #include "clutter-egl.h" #include "clutter-backend-egl.h" -#include "../clutter-main.h" -#include "../clutter-feature.h" -#include "../clutter-color.h" -#include "../clutter-util.h" -#include "../clutter-event.h" -#include "../clutter-enum-types.h" -#include "../clutter-private.h" -#include "../clutter-debug.h" -#include "../clutter-units.h" -#include "../clutter-stage.h" -#include "../clutter-stage-window.h" +#include "clutter-debug.h" +#include "clutter-event.h" +#include "clutter-enum-types.h" +#include "clutter-feature.h" +#include "clutter-main.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" +#include "clutter-util.h" #ifdef COGL_HAS_X11_SUPPORT static ClutterStageWindowIface *clutter_stage_egl_parent_iface = NULL; diff --git a/clutter/fruity/clutter-backend-fruity.c b/clutter/fruity/clutter-backend-fruity.c index d9279d91d..a6e9142e4 100644 --- a/clutter/fruity/clutter-backend-fruity.c +++ b/clutter/fruity/clutter-backend-fruity.c @@ -4,9 +4,11 @@ #include "clutter-backend-fruity.h" #include "clutter-stage-fruity.h" -#include "../clutter-private.h" -#include "../clutter-main.h" -#include "../clutter-debug.h" + +#include "clutter-debug.h" +#include "clutter-main.h" +#include "clutter-stage-private.h" +#include "clutter-private.h" static ClutterBackendEGL *backend_singleton = NULL; diff --git a/clutter/glx/clutter-backend-glx.c b/clutter/glx/clutter-backend-glx.c index cfa997863..d7a6117e5 100644 --- a/clutter/glx/clutter-backend-glx.c +++ b/clutter/glx/clutter-backend-glx.c @@ -42,11 +42,12 @@ #include "clutter-glx.h" #include "clutter-profile.h" -#include "../clutter-event.h" -#include "../clutter-main.h" -#include "../clutter-debug.h" -#include "../clutter-private.h" -#include "../clutter-version.h" +#include "clutter-debug.h" +#include "clutter-event.h" +#include "clutter-main.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" +#include "clutter-version.h" #include "cogl/cogl.h" diff --git a/clutter/glx/clutter-event-glx.c b/clutter/glx/clutter-event-glx.c index 7c0f4a29c..dadb3b130 100644 --- a/clutter/glx/clutter-event-glx.c +++ b/clutter/glx/clutter-event-glx.c @@ -28,7 +28,9 @@ #include "clutter-backend-x11.h" #include "clutter-stage-glx.h" #include "clutter-backend-glx.h" + #include "clutter-private.h" +#include "clutter-stage-private.h" #include #include diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index d22ca99df..13005b2e8 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -28,20 +28,13 @@ #include "clutter-glx.h" #include "clutter-profile.h" -#include "../clutter-main.h" -#include "../clutter-feature.h" -#include "../clutter-color.h" -#include "../clutter-util.h" -#include "../clutter-event.h" -#include "../clutter-enum-types.h" -#include "../clutter-private.h" -#include "../clutter-debug.h" -#include "../clutter-units.h" -#include "../clutter-shader.h" -#include "../clutter-group.h" -#include "../clutter-container.h" -#include "../clutter-stage.h" -#include "../clutter-stage-window.h" +#include "clutter-debug.h" +#include "clutter-event.h" +#include "clutter-enum-types.h" +#include "clutter-feature.h" +#include "clutter-main.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" #include "cogl/cogl.h" diff --git a/clutter/osx/clutter-backend-osx.c b/clutter/osx/clutter-backend-osx.c index d13610a92..501743cdb 100644 --- a/clutter/osx/clutter-backend-osx.c +++ b/clutter/osx/clutter-backend-osx.c @@ -24,10 +24,13 @@ #include "clutter-osx.h" #include "clutter-backend-osx.h" #include "clutter-stage-osx.h" -#include "../clutter-private.h" + +#include "clutter-debug.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" + #include "cogl/cogl.h" -#include #import G_DEFINE_TYPE (ClutterBackendOSX, clutter_backend_osx, CLUTTER_TYPE_BACKEND) diff --git a/clutter/osx/clutter-stage-osx.c b/clutter/osx/clutter-stage-osx.c index 934011949..e5b55e8c1 100644 --- a/clutter/osx/clutter-stage-osx.c +++ b/clutter/osx/clutter-stage-osx.c @@ -24,10 +24,12 @@ #include "clutter-osx.h" #include "clutter-stage-osx.h" #include "clutter-backend-osx.h" -#import -#include -#include +#include "clutter-debug.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" + +#import static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface); diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c index 7c10793e3..34f0b50b6 100644 --- a/clutter/wayland/clutter-backend-wayland.c +++ b/clutter/wayland/clutter-backend-wayland.c @@ -39,15 +39,16 @@ #include #include -#include "../clutter-private.h" -#include "../clutter-main.h" -#include "../clutter-debug.h" -#include "../clutter-version.h" - #include "clutter-backend-wayland.h" #include "clutter-stage-wayland.h" #include "clutter-wayland.h" +#include "clutter-debug.h" +#include "clutter-main.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" +#include "clutter-version.h" + static ClutterBackendWayland *backend_singleton = NULL; G_DEFINE_TYPE (ClutterBackendWayland, _clutter_backend_wayland, CLUTTER_TYPE_BACKEND); diff --git a/clutter/wayland/clutter-stage-wayland.c b/clutter/wayland/clutter-stage-wayland.c index a1c7925cc..f6cab309f 100644 --- a/clutter/wayland/clutter-stage-wayland.c +++ b/clutter/wayland/clutter-stage-wayland.c @@ -33,22 +33,18 @@ #include #include -#include "../clutter-main.h" -#include "../clutter-feature.h" -#include "../clutter-color.h" -#include "../clutter-util.h" -#include "../clutter-event.h" -#include "../clutter-enum-types.h" -#include "../clutter-private.h" -#include "../clutter-debug.h" -#include "../clutter-units.h" -#include "../clutter-stage.h" -#include "../clutter-stage-window.h" - #include "clutter-stage-wayland.h" #include "clutter-wayland.h" #include "clutter-backend-wayland.h" +#include "clutter-main.h" +#include "clutter-feature.h" +#include "clutter-event.h" +#include "clutter-enum-types.h" +#include "clutter-private.h" +#include "clutter-debug.h" +#include "clutter-stage-private.h" + #include "cogl/cogl-framebuffer-private.h" static void diff --git a/clutter/win32/clutter-backend-win32.c b/clutter/win32/clutter-backend-win32.c index 6613468ea..5b8a53980 100644 --- a/clutter/win32/clutter-backend-win32.c +++ b/clutter/win32/clutter-backend-win32.c @@ -30,12 +30,13 @@ #include "clutter-win32.h" #include "clutter-device-manager-win32.h" -#include "../clutter-event.h" -#include "../clutter-main.h" -#include "../clutter-input-device.h" -#include "../clutter-debug.h" -#include "../clutter-private.h" -#include "../clutter-version.h" +#include "clutter-event.h" +#include "clutter-main.h" +#include "clutter-device-manager-private.h" +#include "clutter-debug.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" +#include "clutter-version.h" #include "cogl/cogl.h" diff --git a/clutter/win32/clutter-event-win32.c b/clutter/win32/clutter-event-win32.c index 09f72c316..ce9f7b2cb 100644 --- a/clutter/win32/clutter-event-win32.c +++ b/clutter/win32/clutter-event-win32.c @@ -34,6 +34,7 @@ #include "clutter-keysyms.h" #include "clutter-main.h" #include "clutter-private.h" +#include "clutter-stage-private.h" #include #include diff --git a/clutter/win32/clutter-stage-win32.c b/clutter/win32/clutter-stage-win32.c index c52bbf4c5..6d5ce3ef5 100644 --- a/clutter/win32/clutter-stage-win32.c +++ b/clutter/win32/clutter-stage-win32.c @@ -27,18 +27,13 @@ #include "clutter-stage-win32.h" #include "clutter-win32.h" -#include "../clutter-stage-window.h" -#include "../clutter-main.h" -#include "../clutter-feature.h" -#include "../clutter-color.h" -#include "../clutter-util.h" -#include "../clutter-event.h" -#include "../clutter-enum-types.h" -#include "../clutter-private.h" -#include "../clutter-debug.h" -#include "../clutter-units.h" -#include "../clutter-shader.h" -#include "../clutter-stage.h" +#include "clutter-main.h" +#include "clutter-feature.h" +#include "clutter-event.h" +#include "clutter-enum-types.h" +#include "clutter-private.h" +#include "clutter-debug.h" +#include "clutter-stage-private.h" #include "cogl/cogl.h" diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c index 084839674..14284d57c 100644 --- a/clutter/x11/clutter-backend-x11.c +++ b/clutter/x11/clutter-backend-x11.c @@ -445,11 +445,7 @@ clutter_backend_x11_dispose (GObject *gobject) CLUTTER_NOTE (BACKEND, "Disposing the of stages"); 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 - stage_manager's list and g_slist_foreach has some basic - protection against this */ - g_slist_foreach (stage_manager->stages, (GFunc) clutter_actor_destroy, NULL); + g_object_unref (stage_manager); CLUTTER_NOTE (BACKEND, "Removing the event source"); _clutter_backend_x11_events_uninit (CLUTTER_BACKEND (backend_x11)); diff --git a/clutter/x11/clutter-event-x11.c b/clutter/x11/clutter-event-x11.c index 885389006..8dc3a2719 100644 --- a/clutter/x11/clutter-event-x11.c +++ b/clutter/x11/clutter-event-x11.c @@ -39,6 +39,7 @@ #include "clutter-event.h" #include "clutter-main.h" #include "clutter-private.h" +#include "clutter-stage-private.h" #include "cogl/cogl-internal.h" diff --git a/clutter/x11/clutter-stage-x11.c b/clutter/x11/clutter-stage-x11.c index 45a67637d..ecef07982 100644 --- a/clutter/x11/clutter-stage-x11.c +++ b/clutter/x11/clutter-stage-x11.c @@ -31,16 +31,13 @@ #include "clutter-stage-x11.h" #include "clutter-x11.h" -#include "../clutter-stage-window.h" -#include "../clutter-main.h" -#include "../clutter-feature.h" -#include "../clutter-color.h" -#include "../clutter-util.h" -#include "../clutter-event.h" -#include "../clutter-enum-types.h" -#include "../clutter-private.h" -#include "../clutter-debug.h" -#include "../clutter-units.h" +#include "clutter-debug.h" +#include "clutter-main.h" +#include "clutter-feature.h" +#include "clutter-event.h" +#include "clutter-enum-types.h" +#include "clutter-private.h" +#include "clutter-stage-private.h" #include "cogl/cogl.h"