[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:
parent
7c89a0ccfa
commit
33f5fe73b3
@ -173,4 +173,7 @@
|
|||||||
#define clutter_key_event_unicode clutter_key_event_unicode_REPLACED_BY_clutter_event_get_key_unicode
|
#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_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 */
|
#endif /* CLUTTER_DEPRECATED_H */
|
||||||
|
@ -666,8 +666,11 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
|||||||
*
|
*
|
||||||
* Whether the stage should be fullscreen or not.
|
* Whether the stage should be fullscreen or not.
|
||||||
*
|
*
|
||||||
* This property is set by calling clutter_stage_fullscreen()
|
* This property is set by calling clutter_stage_set_fullscreen()
|
||||||
* and clutter_stage_unfullscreen()
|
* 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
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
@ -1044,23 +1047,36 @@ clutter_stage_get_perspective (ClutterStage *stage,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_fullscreen:
|
* clutter_stage_set_fullscreen:
|
||||||
* @stage: a #ClutterStage
|
* @stage: a #ClutterStage
|
||||||
|
( @fullscreen: %TRUE to to set the stage fullscreen
|
||||||
*
|
*
|
||||||
* Asks to place the stage window in the fullscreen state. Note that you
|
* Asks to place the stage window in the fullscreen or unfullscreen
|
||||||
* shouldn't assume the window is definitely full screen afterward, because
|
* states.
|
||||||
* other entities (e.g. the user or window manager) could unfullscreen it
|
*
|
||||||
* again, and not all window managers honor requests to fullscreen windows.
|
( 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
|
void
|
||||||
clutter_stage_fullscreen (ClutterStage *stage)
|
clutter_stage_set_fullscreen (ClutterStage *stage,
|
||||||
|
gboolean fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv;
|
ClutterStagePrivate *priv;
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
||||||
|
|
||||||
priv = stage->priv;
|
priv = stage->priv;
|
||||||
if (!priv->is_fullscreen)
|
|
||||||
|
if (priv->is_fullscreen != fullscreen)
|
||||||
{
|
{
|
||||||
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
|
||||||
ClutterStageWindowIface *iface;
|
ClutterStageWindowIface *iface;
|
||||||
@ -1068,46 +1084,31 @@ clutter_stage_fullscreen (ClutterStage *stage)
|
|||||||
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
|
||||||
|
|
||||||
/* Only set if backend implements.
|
/* Only set if backend implements.
|
||||||
|
*
|
||||||
* Also see clutter_stage_event() for setting priv->is_fullscreen
|
* Also see clutter_stage_event() for setting priv->is_fullscreen
|
||||||
* on state change event.
|
* on state change event.
|
||||||
*/
|
*/
|
||||||
if (iface->set_fullscreen)
|
if (iface->set_fullscreen)
|
||||||
iface->set_fullscreen (impl, TRUE);
|
iface->set_fullscreen (impl, fullscreen);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* clutter_stage_unfullscreen:
|
* clutter_stage_get_fullscreen:
|
||||||
* @stage: a #ClutterStage
|
* @stage: a #ClutterStage
|
||||||
*
|
*
|
||||||
* Asks to toggle off the fullscreen state for the stage window. Note that
|
* Retrieves whether the stage is full screen or not
|
||||||
* you shouldn't assume the window is definitely not full screen afterward,
|
*
|
||||||
* because other entities (e.g. the user or window manager) could fullscreen
|
* Return value: %TRUE if the stage is full screen
|
||||||
* it again, and not all window managers honor requests to unfullscreen
|
*
|
||||||
* windows.
|
* Since: 1.0
|
||||||
*/
|
*/
|
||||||
void
|
gboolean
|
||||||
clutter_stage_unfullscreen (ClutterStage *stage)
|
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));
|
return stage->priv->is_fullscreen;
|
||||||
|
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -202,8 +202,9 @@ void clutter_stage_set_perspective (ClutterStage *stage,
|
|||||||
ClutterPerspective *perspective);
|
ClutterPerspective *perspective);
|
||||||
void clutter_stage_get_perspective (ClutterStage *stage,
|
void clutter_stage_get_perspective (ClutterStage *stage,
|
||||||
ClutterPerspective *perspective);
|
ClutterPerspective *perspective);
|
||||||
void clutter_stage_fullscreen (ClutterStage *stage);
|
void clutter_stage_set_fullscreen (ClutterStage *stage,
|
||||||
void clutter_stage_unfullscreen (ClutterStage *stage);
|
gboolean fullscreen);
|
||||||
|
gboolean clutter_stage_get_fullscreen (ClutterStage *stage);
|
||||||
void clutter_stage_show_cursor (ClutterStage *stage);
|
void clutter_stage_show_cursor (ClutterStage *stage);
|
||||||
void clutter_stage_hide_cursor (ClutterStage *stage);
|
void clutter_stage_hide_cursor (ClutterStage *stage);
|
||||||
|
|
||||||
|
@ -476,8 +476,8 @@ clutter_stage_is_default
|
|||||||
<SUBSECTION>
|
<SUBSECTION>
|
||||||
clutter_stage_set_color
|
clutter_stage_set_color
|
||||||
clutter_stage_get_color
|
clutter_stage_get_color
|
||||||
clutter_stage_fullscreen
|
clutter_stage_set_fullscreen
|
||||||
clutter_stage_unfullscreen
|
clutter_stage_get_fullscreen
|
||||||
clutter_stage_show_cursor
|
clutter_stage_show_cursor
|
||||||
clutter_stage_hide_cursor
|
clutter_stage_hide_cursor
|
||||||
ClutterPickMode
|
ClutterPickMode
|
||||||
|
@ -178,7 +178,7 @@ test_clutter_cairo_flowers_main (int argc, char **argv)
|
|||||||
stage = clutter_stage_get_default ();
|
stage = clutter_stage_get_default ();
|
||||||
|
|
||||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
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++)
|
for (i=0; i< N_FLOWERS; i++)
|
||||||
{
|
{
|
||||||
|
@ -23,15 +23,11 @@ blue_button_cb (ClutterActor *actor,
|
|||||||
stage = clutter_stage_get_default ();
|
stage = clutter_stage_get_default ();
|
||||||
|
|
||||||
if (IsFullScreen)
|
if (IsFullScreen)
|
||||||
{
|
IsFullScreen = FALSE;
|
||||||
IsFullScreen = FALSE;
|
|
||||||
clutter_stage_unfullscreen (CLUTTER_STAGE (stage));
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
IsFullScreen = TRUE;
|
||||||
IsFullScreen = TRUE;
|
|
||||||
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
|
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), IsFullScreen);
|
||||||
}
|
|
||||||
|
|
||||||
g_print ("*** Fullscreen %s ***\n",
|
g_print ("*** Fullscreen %s ***\n",
|
||||||
IsFullScreen ? "enabled" : "disabled");
|
IsFullScreen ? "enabled" : "disabled");
|
||||||
|
@ -54,7 +54,7 @@ toggle_fullscreen (gpointer dummy)
|
|||||||
|
|
||||||
case SHOW:
|
case SHOW:
|
||||||
g_debug ("show: is_fullscreen := %s", is_fullscreen ? "true" : "false");
|
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;
|
state = DONE;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ test_fullscreen_main (int argc, char *argv[])
|
|||||||
"unfullscreen", G_CALLBACK (on_unfullscreen),
|
"unfullscreen", G_CALLBACK (on_unfullscreen),
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
clutter_stage_fullscreen (CLUTTER_STAGE (stage));
|
clutter_stage_set_fullscreen (CLUTTER_STAGE (stage), TRUE);
|
||||||
clutter_actor_show (stage);
|
clutter_actor_show (stage);
|
||||||
|
|
||||||
g_debug ("stage size: %.2fx%.2f, mapped: %s",
|
g_debug ("stage size: %.2fx%.2f, mapped: %s",
|
||||||
|
@ -12,7 +12,7 @@ test_perspective_main (int argc, char *argv[])
|
|||||||
|
|
||||||
stage = clutter_stage_get_default ();
|
stage = clutter_stage_get_default ();
|
||||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &red);
|
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);
|
rect = clutter_rectangle_new_with_color (&white);
|
||||||
clutter_actor_set_size (rect,
|
clutter_actor_set_size (rect,
|
||||||
|
Loading…
Reference in New Issue
Block a user