2007-07-31 Emmanuele Bassi <ebassi@openedhand.com>

* 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.
This commit is contained in:
Emmanuele Bassi 2007-07-31 17:01:52 +00:00
parent 6145261040
commit 4170d7cc43
5 changed files with 57 additions and 27 deletions

View File

@ -1,3 +1,11 @@
2007-07-31 Emmanuele Bassi <ebassi@openedhand.com>
* 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 <ebassi@openedhand.com>
* clutter/clutter-backend.[ch]: Add clutter_backend_set_resolution()

View File

@ -61,7 +61,7 @@ struct _ClutterStagePrivate
guint is_fullscreen : 1;
guint is_offscreen : 1;
guint is_cursor_visible : 1;
guint is_user_resizeable : 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,
@ -440,7 +440,7 @@ clutter_stage_init (ClutterStage *self)
priv->is_offscreen = FALSE;
priv->is_fullscreen = FALSE;
priv->is_user_resizeable = FALSE;
priv->is_user_resizable = FALSE;
priv->is_cursor_visible = TRUE;
priv->color.red = 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

View File

@ -174,9 +174,9 @@ gboolean clutter_stage_event (ClutterStage *stage,
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_user_resizable (ClutterStage *stage,
gboolean resizable);
gboolean clutter_stage_get_user_resizable (ClutterStage *stage);
G_END_DECLS

View File

@ -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)
{

View File

@ -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
<SUBSECTION Standard>
CLUTTER_STAGE
CLUTTER_IS_STAGE