Deprecate ClutterStage:color
ClutterActor has a background-color property, now; we should use it for the Stage, re-implement the color property in terms of background-color. and deprecate the Stage property.
This commit is contained in:
parent
d808367fe4
commit
bc7959069b
@ -121,7 +121,6 @@ struct _ClutterStagePrivate
|
|||||||
/* the stage implementation */
|
/* the stage implementation */
|
||||||
ClutterStageWindow *impl;
|
ClutterStageWindow *impl;
|
||||||
|
|
||||||
ClutterColor color;
|
|
||||||
ClutterPerspective perspective;
|
ClutterPerspective perspective;
|
||||||
CoglMatrix projection;
|
CoglMatrix projection;
|
||||||
CoglMatrix inverse_projection;
|
CoglMatrix inverse_projection;
|
||||||
@ -673,6 +672,7 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
{
|
{
|
||||||
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
ClutterStagePrivate *priv = CLUTTER_STAGE (self)->priv;
|
||||||
CoglBufferBit clear_flags;
|
CoglBufferBit clear_flags;
|
||||||
|
ClutterColor bg_color;
|
||||||
CoglColor stage_color;
|
CoglColor stage_color;
|
||||||
ClutterActorIter iter;
|
ClutterActorIter iter;
|
||||||
ClutterActor *child;
|
ClutterActor *child;
|
||||||
@ -687,8 +687,9 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
CLUTTER_NOTE (PAINT, "Initializing stage paint");
|
CLUTTER_NOTE (PAINT, "Initializing stage paint");
|
||||||
|
|
||||||
/* composite the opacity to the stage color */
|
/* composite the opacity to the stage color */
|
||||||
|
clutter_actor_get_background_color (self, &bg_color);
|
||||||
real_alpha = clutter_actor_get_opacity (self)
|
real_alpha = clutter_actor_get_opacity (self)
|
||||||
* priv->color.alpha
|
* bg_color.alpha
|
||||||
/ 255;
|
/ 255;
|
||||||
|
|
||||||
clear_flags = COGL_BUFFER_BIT_DEPTH;
|
clear_flags = COGL_BUFFER_BIT_DEPTH;
|
||||||
@ -702,9 +703,9 @@ clutter_stage_paint (ClutterActor *self)
|
|||||||
* set; the effect depends entirely on the Clutter backend
|
* set; the effect depends entirely on the Clutter backend
|
||||||
*/
|
*/
|
||||||
cogl_color_init_from_4ub (&stage_color,
|
cogl_color_init_from_4ub (&stage_color,
|
||||||
priv->color.red,
|
bg_color.red,
|
||||||
priv->color.green,
|
bg_color.green,
|
||||||
priv->color.blue,
|
bg_color.blue,
|
||||||
priv->use_alpha ? real_alpha : 255);
|
priv->use_alpha ? real_alpha : 255);
|
||||||
cogl_color_premultiply (&stage_color);
|
cogl_color_premultiply (&stage_color);
|
||||||
cogl_clear (&stage_color, clear_flags);
|
cogl_clear (&stage_color, clear_flags);
|
||||||
@ -1625,7 +1626,8 @@ clutter_stage_set_property (GObject *object,
|
|||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_COLOR:
|
case PROP_COLOR:
|
||||||
clutter_stage_set_color (stage, clutter_value_get_color (value));
|
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
|
||||||
|
clutter_value_get_color (value));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_OFFSCREEN:
|
case PROP_OFFSCREEN:
|
||||||
@ -1693,7 +1695,13 @@ clutter_stage_get_property (GObject *gobject,
|
|||||||
switch (prop_id)
|
switch (prop_id)
|
||||||
{
|
{
|
||||||
case PROP_COLOR:
|
case PROP_COLOR:
|
||||||
clutter_value_set_color (value, &priv->color);
|
{
|
||||||
|
ClutterColor bg_color;
|
||||||
|
|
||||||
|
clutter_actor_get_background_color (CLUTTER_ACTOR (gobject),
|
||||||
|
&bg_color);
|
||||||
|
clutter_value_set_color (value, &bg_color);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PROP_OFFSCREEN:
|
case PROP_OFFSCREEN:
|
||||||
@ -1906,13 +1914,17 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
|||||||
/**
|
/**
|
||||||
* ClutterStage:color:
|
* ClutterStage:color:
|
||||||
*
|
*
|
||||||
* The color of the main stage.
|
* The background color of the main stage.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use the #ClutterActor:background-color property of
|
||||||
|
* #ClutterActor instead.
|
||||||
*/
|
*/
|
||||||
pspec = clutter_param_spec_color ("color",
|
pspec = clutter_param_spec_color ("color",
|
||||||
P_("Color"),
|
P_("Color"),
|
||||||
P_("The color of the stage"),
|
P_("The color of the stage"),
|
||||||
&default_stage_color,
|
&default_stage_color,
|
||||||
CLUTTER_PARAM_READWRITE);
|
CLUTTER_PARAM_READWRITE |
|
||||||
|
G_PARAM_DEPRECATED);
|
||||||
g_object_class_install_property (gobject_class, PROP_COLOR, pspec);
|
g_object_class_install_property (gobject_class, PROP_COLOR, pspec);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -2213,7 +2225,8 @@ clutter_stage_init (ClutterStage *self)
|
|||||||
*/
|
*/
|
||||||
priv->motion_events_enabled = _clutter_context_get_motion_events_enabled ();
|
priv->motion_events_enabled = _clutter_context_get_motion_events_enabled ();
|
||||||
|
|
||||||
priv->color = default_stage_color;
|
clutter_actor_set_background_color (CLUTTER_ACTOR (self),
|
||||||
|
&default_stage_color);
|
||||||
|
|
||||||
priv->perspective.fovy = 60.0; /* 60 Degrees */
|
priv->perspective.fovy = 60.0; /* 60 Degrees */
|
||||||
priv->perspective.aspect = (float) geom.width / (float) geom.height;
|
priv->perspective.aspect = (float) geom.width / (float) geom.height;
|
||||||
@ -2322,21 +2335,14 @@ clutter_stage_get_default (void)
|
|||||||
* @color: A #ClutterColor
|
* @color: A #ClutterColor
|
||||||
*
|
*
|
||||||
* Sets the stage color.
|
* Sets the stage color.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_set_background_color() instead.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_stage_set_color (ClutterStage *stage,
|
clutter_stage_set_color (ClutterStage *stage,
|
||||||
const ClutterColor *color)
|
const ClutterColor *color)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv;
|
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), color);
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
g_return_if_fail (color != NULL);
|
|
||||||
|
|
||||||
priv = stage->priv;
|
|
||||||
|
|
||||||
priv->color = *color;
|
|
||||||
|
|
||||||
clutter_actor_queue_redraw (CLUTTER_ACTOR (stage));
|
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (stage), "color");
|
g_object_notify (G_OBJECT (stage), "color");
|
||||||
}
|
}
|
||||||
@ -2347,19 +2353,14 @@ clutter_stage_set_color (ClutterStage *stage,
|
|||||||
* @color: (out caller-allocates): return location for a #ClutterColor
|
* @color: (out caller-allocates): return location for a #ClutterColor
|
||||||
*
|
*
|
||||||
* Retrieves the stage color.
|
* Retrieves the stage color.
|
||||||
|
*
|
||||||
|
* Deprecated: 1.10: Use clutter_actor_get_background_color() instead.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
clutter_stage_get_color (ClutterStage *stage,
|
clutter_stage_get_color (ClutterStage *stage,
|
||||||
ClutterColor *color)
|
ClutterColor *color)
|
||||||
{
|
{
|
||||||
ClutterStagePrivate *priv;
|
clutter_actor_get_background_color (CLUTTER_ACTOR (stage), color);
|
||||||
|
|
||||||
g_return_if_fail (CLUTTER_IS_STAGE (stage));
|
|
||||||
g_return_if_fail (color != NULL);
|
|
||||||
|
|
||||||
priv = stage->priv;
|
|
||||||
|
|
||||||
*color = priv->color;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -141,10 +141,6 @@ GType clutter_stage_get_type (void) G_GNUC_CONST;
|
|||||||
|
|
||||||
ClutterActor * clutter_stage_new (void);
|
ClutterActor * clutter_stage_new (void);
|
||||||
|
|
||||||
void clutter_stage_set_color (ClutterStage *stage,
|
|
||||||
const ClutterColor *color);
|
|
||||||
void clutter_stage_get_color (ClutterStage *stage,
|
|
||||||
ClutterColor *color);
|
|
||||||
void clutter_stage_set_perspective (ClutterStage *stage,
|
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,
|
||||||
|
@ -69,25 +69,34 @@ CLUTTER_DEPRECATED_FOR(clutter_stage_new)
|
|||||||
ClutterActor * clutter_stage_get_default (void);
|
ClutterActor * clutter_stage_get_default (void);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
gboolean clutter_stage_is_default (ClutterStage *stage);
|
gboolean clutter_stage_is_default (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
||||||
void clutter_stage_queue_redraw (ClutterStage *stage);
|
void clutter_stage_queue_redraw (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
void clutter_stage_set_use_fog (ClutterStage *stage,
|
void clutter_stage_set_use_fog (ClutterStage *stage,
|
||||||
gboolean fog);
|
gboolean fog);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
gboolean clutter_stage_get_use_fog (ClutterStage *stage);
|
gboolean clutter_stage_get_use_fog (ClutterStage *stage);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
void clutter_stage_set_fog (ClutterStage *stage,
|
void clutter_stage_set_fog (ClutterStage *stage,
|
||||||
ClutterFog *fog);
|
ClutterFog *fog);
|
||||||
|
|
||||||
CLUTTER_DEPRECATED
|
CLUTTER_DEPRECATED
|
||||||
void clutter_stage_get_fog (ClutterStage *stage,
|
void clutter_stage_get_fog (ClutterStage *stage,
|
||||||
ClutterFog *fog);
|
ClutterFog *fog);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_set_background_color)
|
||||||
|
void clutter_stage_set_color (ClutterStage *stage,
|
||||||
|
const ClutterColor *color);
|
||||||
|
|
||||||
|
CLUTTER_DEPRECATED_FOR(clutter_actor_get_background_color)
|
||||||
|
void clutter_stage_get_color (ClutterStage *stage,
|
||||||
|
ClutterColor *color);
|
||||||
|
|
||||||
G_END_DECLS
|
G_END_DECLS
|
||||||
|
|
||||||
#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */
|
#endif /* __CLUTTER_STAGE_DEPRECATED_H__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user