From 4170d7cc43e9c34d38c9e14ef01c47216e026c8c Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Tue, 31 Jul 2007 17:01:52 +0000 Subject: [PATCH] 2007-07-31 Emmanuele Bassi * clutter/clutter-stage.[ch]: Fix clutter_stage_set_user_resizable() name, and add a getter for the property. * clutter/glx/clutter-stage-glx.c: Use the accessor, not g_object_get() to retrieve the value of the resizable property. --- ChangeLog | 8 ++++ clutter/clutter-stage.c | 59 ++++++++++++++++++++---------- clutter/clutter-stage.h | 12 +++--- clutter/glx/clutter-stage-glx.c | 2 +- doc/reference/clutter-sections.txt | 3 +- 5 files changed, 57 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index b55770434..cd7b538fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-31 Emmanuele Bassi + + * clutter/clutter-stage.[ch]: Fix clutter_stage_set_user_resizable() + name, and add a getter for the property. + + * clutter/glx/clutter-stage-glx.c: Use the accessor, not + g_object_get() to retrieve the value of the resizable property. + 2007-07-31 Emmanuele Bassi * clutter/clutter-backend.[ch]: Add clutter_backend_set_resolution() diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index bb944c41b..f248c33ec 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -58,10 +58,10 @@ struct _ClutterStagePrivate ClutterColor color; ClutterPerspective perspective; - guint is_fullscreen : 1; - guint is_offscreen : 1; - guint is_cursor_visible : 1; - guint is_user_resizeable : 1; + guint is_fullscreen : 1; + guint is_offscreen : 1; + guint is_cursor_visible : 1; + guint is_user_resizable : 1; gchar *title; }; @@ -160,7 +160,7 @@ clutter_stage_set_property (GObject *object, clutter_stage_set_title (stage, g_value_get_string (value)); break; case PROP_USER_RESIZE: - clutter_stage_set_user_resizeable (stage, g_value_get_boolean (value)); + clutter_stage_set_user_resizable (stage, g_value_get_boolean (value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -205,7 +205,7 @@ clutter_stage_get_property (GObject *object, g_value_set_string (value, priv->title); break; case PROP_USER_RESIZE: - g_value_set_boolean (value, priv->is_user_resizeable); + g_value_set_boolean (value, priv->is_user_resizable); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); @@ -256,8 +256,8 @@ clutter_stage_class_init (ClutterStageClass *klass) g_object_class_install_property (gobject_class, PROP_USER_RESIZE, - g_param_spec_boolean ("user-resizeable", - "User Resizeable", + g_param_spec_boolean ("user-resizable", + "User Resizable", "Whether the stage is able to be resized via " "user interaction", FALSE, @@ -438,10 +438,10 @@ clutter_stage_init (ClutterStage *self) self->priv = priv = CLUTTER_STAGE_GET_PRIVATE (self); - priv->is_offscreen = FALSE; - priv->is_fullscreen = FALSE; - priv->is_user_resizeable = FALSE; - priv->is_cursor_visible = TRUE; + priv->is_offscreen = FALSE; + priv->is_fullscreen = FALSE; + priv->is_user_resizable = FALSE; + priv->is_cursor_visible = TRUE; priv->color.red = 0xff; priv->color.green = 0xff; @@ -703,15 +703,18 @@ clutter_stage_unfullscreen (ClutterStage *stage) } /** - * clutter_stage_set_user_resizeable: + * clutter_stage_set_user_resizable: * @stage: a #ClutterStage - * @value: a boolean indicating if the stage should be user resizable. + * @resizable: whether if the stage should be user resizable. * * Sets if the stage is able to be resized by user interaction (i.e via * window manager controls) + * + * Since: 0.4 */ void -clutter_stage_set_user_resizeable (ClutterStage *stage, gboolean value) +clutter_stage_set_user_resizable (ClutterStage *stage, + gboolean resizable) { ClutterStagePrivate *priv; @@ -720,17 +723,35 @@ clutter_stage_set_user_resizeable (ClutterStage *stage, gboolean value) priv = stage->priv; if (clutter_feature_available (CLUTTER_FEATURE_STAGE_USER_RESIZE) - && priv->is_user_resizeable != value + && priv->is_user_resizable != resizable && CLUTTER_STAGE_GET_CLASS (stage)->set_user_resize) { - priv->is_user_resizeable = value; + priv->is_user_resizable = resizable; - CLUTTER_STAGE_GET_CLASS (stage)->set_user_resize (stage, value); + CLUTTER_STAGE_GET_CLASS (stage)->set_user_resize (stage, resizable); - g_object_notify (G_OBJECT (stage), "user-resizeable"); + g_object_notify (G_OBJECT (stage), "user-resizable"); } } +/** + * clutter_stage_get_user_resizable: + * @stage: a #ClutterStage + * + * Retrieves the value set with clutter_stage_set_user_resizable(). + * + * Return value: %TRUE is the stage is resizable by the user. + * + * Since: 0.4 + */ +gboolean +clutter_stage_get_user_resizable (ClutterStage *stage) +{ + g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE); + + return stage->priv->is_user_resizable; +} + /** * clutter_stage_show_cursor: * @stage: a #ClutterStage diff --git a/clutter/clutter-stage.h b/clutter/clutter-stage.h index d9fe79b0d..990c6fbcb 100644 --- a/clutter/clutter-stage.h +++ b/clutter/clutter-stage.h @@ -171,12 +171,12 @@ GdkPixbuf * clutter_stage_snapshot (ClutterStage *stage, gboolean clutter_stage_event (ClutterStage *stage, ClutterEvent *event); -void clutter_stage_set_title (ClutterStage *stage, - const gchar *title); -G_CONST_RETURN gchar *clutter_stage_get_title (ClutterStage *stage); - -void clutter_stage_set_user_resizeable (ClutterStage *stage, - gboolean value); +void clutter_stage_set_title (ClutterStage *stage, + const gchar *title); +G_CONST_RETURN gchar *clutter_stage_get_title (ClutterStage *stage); +void clutter_stage_set_user_resizable (ClutterStage *stage, + gboolean resizable); +gboolean clutter_stage_get_user_resizable (ClutterStage *stage); G_END_DECLS diff --git a/clutter/glx/clutter-stage-glx.c b/clutter/glx/clutter-stage-glx.c index b73e3ae73..b969765f6 100644 --- a/clutter/glx/clutter-stage-glx.c +++ b/clutter/glx/clutter-stage-glx.c @@ -55,7 +55,7 @@ fix_window_size (ClutterStageGLX *stage_glx) { gboolean resize; - g_object_get (stage_glx, "user-resizeable", &resize, NULL); + resize = clutter_stage_get_user_resizable (CLUTTER_STAGE (stage_glx)); if (stage_glx->xwin != None && stage_glx->is_foreign_xwin == FALSE) { diff --git a/doc/reference/clutter-sections.txt b/doc/reference/clutter-sections.txt index d0daa15b9..b21448fd4 100644 --- a/doc/reference/clutter-sections.txt +++ b/doc/reference/clutter-sections.txt @@ -429,7 +429,8 @@ clutter_stage_get_perspective clutter_stage_get_perspectivex clutter_stage_set_title clutter_stage_get_title -clutter_stage_set_user_resizeable +clutter_stage_set_user_resizable +clutter_stage_get_user_resizable CLUTTER_STAGE CLUTTER_IS_STAGE