[stage] Rename fullscreen methods

The clutter_stage_fullscreen() and clutter_stage_unfullscreen() are
a GDK-ism. The underlying implementation is already using an accessor
with a boolean parameter.

This should take the amount of collisions between properties, methods
and signals to zero.
This commit is contained in:
Emmanuele Bassi 2009-06-09 14:05:03 +01:00
parent 7c89a0ccfa
commit 33f5fe73b3
8 changed files with 54 additions and 53 deletions

View File

@ -173,4 +173,7 @@
#define clutter_key_event_unicode clutter_key_event_unicode_REPLACED_BY_clutter_event_get_key_unicode
#define clutter_button_event_button clutter_button_event_button_REPLACED_BY_clutter_event_get_button
#define clutter_stage_fullscreen clutter_stage_fullscreen_REPLACED_BY_clutter_stage_set_fullscreen
#define clutter_stage_unfullscreen clutter_stage_unfullscreen_REPLACED_BY_clutter_stage_set_fullscreen
#endif /* CLUTTER_DEPRECATED_H */

View File

@ -666,8 +666,11 @@ clutter_stage_class_init (ClutterStageClass *klass)
*
* Whether the stage should be fullscreen or not.
*
* This property is set by calling clutter_stage_fullscreen()
* and clutter_stage_unfullscreen()
* This property is set by calling clutter_stage_set_fullscreen()
* but since the actual implementation is delegated to the backend
* you should connect to the notify::fullscreen-set signal in order
* to get notification if the fullscreen state has been successfully
* achieved.
*
* Since: 1.0
*/
@ -1044,23 +1047,36 @@ clutter_stage_get_perspective (ClutterStage *stage,
}
/**
* clutter_stage_fullscreen:
* clutter_stage_set_fullscreen:
* @stage: a #ClutterStage
( @fullscreen: %TRUE to to set the stage fullscreen
*
* Asks to place the stage window in the fullscreen state. Note that you
* shouldn't assume the window is definitely full screen afterward, because
* other entities (e.g. the user or window manager) could unfullscreen it
* again, and not all window managers honor requests to fullscreen windows.
* Asks to place the stage window in the fullscreen or unfullscreen
* states.
*
( Note that you shouldn't assume the window is definitely full screen
* afterward, because other entities (e.g. the user or window manager)
* could unfullscreen it again, and not all window managers honor
* requests to fullscreen windows.
*
* If you want to receive notification of the fullscreen state you
* should either use the #ClutterStage::fullscreen and
* #ClutterStage::unfullscreen signals, or use the notify signal
* for the #ClutterStage:fullscreen-set property
*
* Since: 1.0
*/
void
clutter_stage_fullscreen (ClutterStage *stage)
clutter_stage_set_fullscreen (ClutterStage *stage,
gboolean fullscreen)
{
ClutterStagePrivate *priv;
g_return_if_fail (CLUTTER_IS_STAGE (stage));
priv = stage->priv;
if (!priv->is_fullscreen)
if (priv->is_fullscreen != fullscreen)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
@ -1068,46 +1084,31 @@ clutter_stage_fullscreen (ClutterStage *stage)
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
/* Only set if backend implements.
*
* Also see clutter_stage_event() for setting priv->is_fullscreen
* on state change event.
*/
if (iface->set_fullscreen)
iface->set_fullscreen (impl, TRUE);
iface->set_fullscreen (impl, fullscreen);
}
}
/**
* clutter_stage_unfullscreen:
* clutter_stage_get_fullscreen:
* @stage: a #ClutterStage
*
* Asks to toggle off the fullscreen state for the stage window. Note that
* you shouldn't assume the window is definitely not full screen afterward,
* because other entities (e.g. the user or window manager) could fullscreen
* it again, and not all window managers honor requests to unfullscreen
* windows.
* Retrieves whether the stage is full screen or not
*
* Return value: %TRUE if the stage is full screen
*
* Since: 1.0
*/
void
clutter_stage_unfullscreen (ClutterStage *stage)
gboolean
clutter_stage_get_fullscreen (ClutterStage *stage)
{
ClutterStagePrivate *priv;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
g_return_if_fail (CLUTTER_IS_STAGE (stage));
priv = stage->priv;
if (priv->is_fullscreen)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
/* Only set if backend implements.
* Also see clutter_stage_event() for setting priv->is_fullscreen
* on state change event.
*/
if (iface->set_fullscreen)
iface->set_fullscreen (impl, FALSE);
}
return stage->priv->is_fullscreen;
}
/**

View File

@ -202,8 +202,9 @@ void clutter_stage_set_perspective (ClutterStage *stage,
ClutterPerspective *perspective);
void clutter_stage_get_perspective (ClutterStage *stage,
ClutterPerspective *perspective);
void clutter_stage_fullscreen (ClutterStage *stage);
void clutter_stage_unfullscreen (ClutterStage *stage);
void clutter_stage_set_fullscreen (ClutterStage *stage,
gboolean fullscreen);
gboolean clutter_stage_get_fullscreen (ClutterStage *stage);
void clutter_stage_show_cursor (ClutterStage *stage);
void clutter_stage_hide_cursor (ClutterStage *stage);

View File

@ -476,8 +476,8 @@ clutter_stage_is_default
<SUBSECTION>
clutter_stage_set_color
clutter_stage_get_color
clutter_stage_fullscreen
clutter_stage_unfullscreen
clutter_stage_set_fullscreen
clutter_stage_get_fullscreen
clutter_stage_show_cursor
clutter_stage_hide_cursor
ClutterPickMode

View File

@ -178,7 +178,7 @@ test_clutter_cairo_flowers_main (int argc, char **argv)
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
for (i=0; i< N_FLOWERS; i++)
{

View File

@ -23,15 +23,11 @@ blue_button_cb (ClutterActor *actor,
stage = clutter_stage_get_default ();
if (IsFullScreen)
{
IsFullScreen = FALSE;
clutter_stage_unfullscreen (CLUTTER_STAGE (stage));
}
else
{
IsFullScreen = TRUE;
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
}
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), IsFullScreen);
g_print ("*** Fullscreen %s ***\n",
IsFullScreen ? "enabled" : "disabled");

View File

@ -54,7 +54,7 @@ toggle_fullscreen (gpointer dummy)
case SHOW:
g_debug ("show: is_fullscreen := %s", is_fullscreen ? "true" : "false");
clutter_stage_unfullscreen (CLUTTER_STAGE (stage));
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), FALSE);
state = DONE;
return TRUE;
@ -82,7 +82,7 @@ test_fullscreen_main (int argc, char *argv[])
"unfullscreen", G_CALLBACK (on_unfullscreen),
NULL);
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
clutter_actor_show (stage);
g_debug ("stage size: %.2fx%.2f, mapped: %s",

View File

@ -12,7 +12,7 @@ test_perspective_main (int argc, char *argv[])
stage = clutter_stage_get_default ();
clutter_stage_set_color (CLUTTER_STAGE (stage), &red);
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
rect = clutter_rectangle_new_with_color (&white);
clutter_actor_set_size (rect,