[clutter/deprecate-default-stage: 10/14] stage: Deprecate the default stage
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/deprecate-default-stage: 10/14] stage: Deprecate the default stage
- Date: Thu, 10 Nov 2011 15:52:56 +0000 (UTC)
commit 0c18dc6bf90cf521327869738b206274584c695e
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Nov 9 17:12:45 2011 +0000
stage: Deprecate the default stage
Deprecate the clutter_stage_get_default() function, as well as the
clutter_stage_is_default() one, and replace its internal usage.
clutter/clutter-stage.c | 38 +++++++++++++++++++++++------------
clutter/clutter-stage.h | 2 -
clutter/deprecated/clutter-stage.h | 6 +++++
3 files changed, 31 insertions(+), 15 deletions(-)
---
diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c
index f606ec2..60370f1 100644
--- a/clutter/clutter-stage.c
+++ b/clutter/clutter-stage.c
@@ -276,6 +276,23 @@ queue_full_redraw (ClutterStage *stage)
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
}
+static gboolean
+stage_is_default (ClutterStage *stage)
+{
+ ClutterStageManager *stage_manager;
+ ClutterStageWindow *impl;
+
+ stage_manager = clutter_stage_manager_get_default ();
+ if (stage != clutter_stage_manager_get_default_stage (stage_manager))
+ return FALSE;
+
+ impl = _clutter_stage_get_window (stage);
+ if (impl != _clutter_stage_get_default_window ())
+ return FALSE;
+
+ return TRUE;
+}
+
static void
clutter_stage_allocate (ClutterActor *self,
const ClutterActorBox *box,
@@ -1472,7 +1489,7 @@ static gboolean
clutter_stage_real_delete_event (ClutterStage *stage,
ClutterEvent *event)
{
- if (clutter_stage_is_default (stage))
+ if (stage_is_default (stage))
clutter_main_quit ();
else
clutter_actor_destroy (CLUTTER_ACTOR (stage));
@@ -2197,6 +2214,8 @@ clutter_stage_init (ClutterStage *self)
* Return value: (transfer none) (type Clutter.Stage): the main
* #ClutterStage. You should never destroy or unref the returned
* actor.
+ *
+ * Deprecated: 1.10: Use clutter_stage_new() instead.
*/
ClutterActor *
clutter_stage_get_default (void)
@@ -3497,24 +3516,17 @@ clutter_stage_queue_redraw (ClutterStage *stage)
* Return value: %TRUE if the passed stage is the default one
*
* Since: 0.8
+ *
+ * Deprecated: 1.10: Track the stage pointer inside your application
+ * code, or use clutter_actor_get_stage() to retrieve the stage for
+ * a given actor.
*/
gboolean
clutter_stage_is_default (ClutterStage *stage)
{
- ClutterStageManager *stage_manager;
- ClutterStageWindow *impl;
-
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
- stage_manager = clutter_stage_manager_get_default ();
- if (stage != clutter_stage_manager_get_default_stage (stage_manager))
- return FALSE;
-
- impl = _clutter_stage_get_window (stage);
- if (impl != _clutter_stage_get_default_window ())
- return FALSE;
-
- return TRUE;
+ return stage_is_default (stage);
}
void
diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h
index 4606d52..6ca0f71 100644
--- a/clutter/clutter-stage.h
+++ b/clutter/clutter-stage.h
@@ -146,7 +146,6 @@ GType clutter_perspective_get_type (void) G_GNUC_CONST;
GType clutter_fog_get_type (void) G_GNUC_CONST;
GType clutter_stage_get_type (void) G_GNUC_CONST;
-ClutterActor *clutter_stage_get_default (void);
ClutterActor *clutter_stage_new (void);
void clutter_stage_set_color (ClutterStage *stage,
@@ -194,7 +193,6 @@ void clutter_stage_set_key_focus (ClutterStage *stage,
ClutterActor * clutter_stage_get_key_focus (ClutterStage *stage);
void clutter_stage_ensure_current (ClutterStage *stage);
void clutter_stage_queue_redraw (ClutterStage *stage);
-gboolean clutter_stage_is_default (ClutterStage *stage);
void clutter_stage_ensure_viewport (ClutterStage *stage);
void clutter_stage_ensure_redraw (ClutterStage *stage);
diff --git a/clutter/deprecated/clutter-stage.h b/clutter/deprecated/clutter-stage.h
index 98d16da..8d1951a 100644
--- a/clutter/deprecated/clutter-stage.h
+++ b/clutter/deprecated/clutter-stage.h
@@ -40,6 +40,12 @@ G_BEGIN_DECLS
#endif /* CLUTTER_DISABLE_DEPRECATED */
+CLUTTER_DEPRECATED_FOR(clutter_stage_new)
+ClutterActor * clutter_stage_get_default (void);
+
+CLUTTER_DEPRECATED
+gboolean clutter_stage_is_default (ClutterStage *stage);
+
G_END_DECLS
#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]