mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
clutter/stage: Remove color property
The property is deprecated and the current implementation simply redirects it to ClutterActor::background-color, so remove it. Also update the tests to set the background color directly. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1332
This commit is contained in:
parent
ce3e293a18
commit
ae49f89cf3
@ -57,7 +57,6 @@
|
||||
#include "clutter-actor-private.h"
|
||||
#include "clutter-backend-private.h"
|
||||
#include "clutter-cairo.h"
|
||||
#include "clutter-color.h"
|
||||
#include "clutter-container.h"
|
||||
#include "clutter-debug.h"
|
||||
#include "clutter-enum-types.h"
|
||||
@ -154,7 +153,6 @@ enum
|
||||
{
|
||||
PROP_0,
|
||||
|
||||
PROP_COLOR,
|
||||
PROP_PERSPECTIVE,
|
||||
PROP_TITLE,
|
||||
PROP_KEY_FOCUS,
|
||||
@ -1722,11 +1720,6 @@ clutter_stage_set_property (GObject *object,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_COLOR:
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
|
||||
clutter_value_get_color (value));
|
||||
break;
|
||||
|
||||
case PROP_TITLE:
|
||||
clutter_stage_set_title (stage, g_value_get_string (value));
|
||||
break;
|
||||
@ -1751,16 +1744,6 @@ clutter_stage_get_property (GObject *gobject,
|
||||
|
||||
switch (prop_id)
|
||||
{
|
||||
case PROP_COLOR:
|
||||
{
|
||||
ClutterColor bg_color;
|
||||
|
||||
clutter_actor_get_background_color (CLUTTER_ACTOR (gobject),
|
||||
&bg_color);
|
||||
clutter_value_set_color (value, &bg_color);
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_PERSPECTIVE:
|
||||
g_value_set_boxed (value, &priv->perspective);
|
||||
break;
|
||||
@ -1876,22 +1859,6 @@ clutter_stage_class_init (ClutterStageClass *klass)
|
||||
|
||||
klass->paint_view = clutter_stage_real_paint_view;
|
||||
|
||||
/**
|
||||
* ClutterStage:color:
|
||||
*
|
||||
* The background color of the main stage.
|
||||
*
|
||||
* Deprecated: 1.10: Use the #ClutterActor:background-color property of
|
||||
* #ClutterActor instead.
|
||||
*/
|
||||
obj_props[PROP_COLOR] =
|
||||
clutter_param_spec_color ("color",
|
||||
P_("Color"),
|
||||
P_("The color of the stage"),
|
||||
&default_stage_color,
|
||||
CLUTTER_PARAM_READWRITE |
|
||||
G_PARAM_DEPRECATED);
|
||||
|
||||
/**
|
||||
* ClutterStage:perspective:
|
||||
*
|
||||
@ -2192,40 +2159,6 @@ clutter_stage_get_default (void)
|
||||
return CLUTTER_ACTOR (stage);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_set_color:
|
||||
* @stage: A #ClutterStage
|
||||
* @color: A #ClutterColor
|
||||
*
|
||||
* Sets the stage color.
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_set_background_color() instead.
|
||||
*/
|
||||
void
|
||||
clutter_stage_set_color (ClutterStage *stage,
|
||||
const ClutterColor *color)
|
||||
{
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), color);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (stage), obj_props[PROP_COLOR]);
|
||||
}
|
||||
|
||||
/**
|
||||
* clutter_stage_get_color:
|
||||
* @stage: A #ClutterStage
|
||||
* @color: (out caller-allocates): return location for a #ClutterColor
|
||||
*
|
||||
* Retrieves the stage color.
|
||||
*
|
||||
* Deprecated: 1.10: Use clutter_actor_get_background_color() instead.
|
||||
*/
|
||||
void
|
||||
clutter_stage_get_color (ClutterStage *stage,
|
||||
ClutterColor *color)
|
||||
{
|
||||
clutter_actor_get_background_color (CLUTTER_ACTOR (stage), color);
|
||||
}
|
||||
|
||||
static void
|
||||
clutter_stage_set_perspective (ClutterStage *stage,
|
||||
ClutterPerspective *perspective)
|
||||
|
@ -74,15 +74,6 @@ gboolean clutter_stage_is_default (ClutterStage *stage);
|
||||
CLUTTER_DEPRECATED_FOR(clutter_actor_queue_redraw)
|
||||
void clutter_stage_queue_redraw (ClutterStage *stage);
|
||||
|
||||
|
||||
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);
|
||||
|
||||
CLUTTER_DEPRECATED
|
||||
void clutter_stage_ensure_current (ClutterStage *stage);
|
||||
|
||||
|
@ -8,5 +8,5 @@ test_simple_rig (void)
|
||||
ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
|
||||
stage = clutter_stage_get_default ();
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ test_multitexture (TestUtilsGTestFixture *fixture,
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
group = clutter_actor_new ();
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);
|
||||
|
@ -156,7 +156,7 @@ test_readpixels (TestUtilsGTestFixture *fixture,
|
||||
ClutterActor *stage;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
/* We force continuous redrawing of the stage, since we need to skip
|
||||
* the first few frames, and we wont be doing anything else that
|
||||
|
@ -115,7 +115,7 @@ test_texture_mipmaps (TestUtilsGTestFixture *fixture,
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
group = clutter_actor_new ();
|
||||
clutter_container_add_actor (CLUTTER_CONTAINER (stage), group);
|
||||
|
@ -217,7 +217,7 @@ test_texture_pixmap_x11 (TestUtilsGTestFixture *fixture,
|
||||
state.pixmap = create_pixmap (&state);
|
||||
state.tfp = cogl_texture_pixmap_x11_new (state.pixmap, TRUE);
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (state.stage), &stage_color);
|
||||
|
||||
paint_handler = g_signal_connect_after (state.stage, "paint",
|
||||
G_CALLBACK (on_paint), &state);
|
||||
|
@ -394,7 +394,7 @@ test_viewport (TestUtilsGTestFixture *fixture,
|
||||
ClutterActor *stage;
|
||||
|
||||
stage = clutter_stage_get_default ();
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
/* We force continuous redrawing of the stage, since we need to skip
|
||||
* the first few frames, and we wont be doing anything else that
|
||||
|
@ -48,7 +48,7 @@ main (int argc, char *argv[])
|
||||
stage = clutter_stage_new ();
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkComponent Test");
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_size (stage, WIDTH, HEIGHT);
|
||||
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
@ -169,7 +169,7 @@ make_ui (ClutterActor *stage)
|
||||
ClutterActor *button = NULL;
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test");
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_size (stage, WIDTH, HEIGHT);
|
||||
|
||||
/* text */
|
||||
|
@ -93,7 +93,7 @@ make_ui (ClutterActor *stage)
|
||||
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
|
||||
float label_geom_y, editable_geom_y;
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_size (stage, WIDTH, HEIGHT);
|
||||
|
||||
label_geom_y = 50;
|
||||
|
@ -180,7 +180,7 @@ make_ui (ClutterActor *stage)
|
||||
ClutterActor *rectangle = NULL;
|
||||
ClutterActor *label = NULL;
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &color_stage);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &color_stage);
|
||||
clutter_actor_set_size (stage, WIDTH, HEIGHT);
|
||||
|
||||
/* text */
|
||||
|
@ -45,7 +45,7 @@ make_ui (ClutterActor *stage)
|
||||
ClutterActor *cloned_entry = NULL;
|
||||
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &color_stage);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &color_stage);
|
||||
clutter_actor_set_size (stage, WIDTH, HEIGHT);
|
||||
|
||||
label = clutter_text_new_full ("Sans Bold 32px",
|
||||
|
@ -169,7 +169,7 @@ texture_fbo (TestConformSimpleFixture *fixture,
|
||||
|
||||
state.stage = clutter_stage_new ();
|
||||
|
||||
clutter_stage_set_color (CLUTTER_STAGE (state.stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (state.stage), &stage_color);
|
||||
|
||||
/* Onscreen source with clone next to it */
|
||||
actor = create_source ();
|
||||
|
@ -130,7 +130,7 @@ test_cogl_multitexture_main (int argc, char *argv[])
|
||||
clutter_actor_get_size (stage, &stage_w, &stage_h);
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl: Multi-texturing");
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
||||
|
@ -254,7 +254,7 @@ test_cogl_point_sprites_main (int argc, char *argv[])
|
||||
}
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Point Sprites");
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
g_signal_connect_after (stage, "paint", G_CALLBACK (paint_cb), &data);
|
||||
|
@ -310,7 +310,7 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
|
||||
stage = clutter_stage_new ();
|
||||
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Assembly Shader Test");
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
|
||||
file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
|
||||
error = NULL;
|
||||
|
@ -399,7 +399,7 @@ test_cogl_tex_polygon_main (int argc, char *argv[])
|
||||
|
||||
/* Stage */
|
||||
stage = clutter_stage_new ();
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &blue);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &blue);
|
||||
clutter_actor_set_size (stage, 640, 480);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Texture Polygon");
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
@ -153,7 +153,7 @@ main (int argc, char *argv[])
|
||||
state.stage = stage = clutter_stage_new ();
|
||||
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_White);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Performance Test");
|
||||
|
||||
/* We want continuous redrawing of the stage... */
|
||||
|
@ -91,7 +91,7 @@ main (int argc, char **argv)
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 512, 512);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking");
|
||||
|
||||
printf ("Picking performance test with "
|
||||
|
@ -131,7 +131,7 @@ main (int argc, char *argv[])
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Performance");
|
||||
|
||||
g_signal_connect (stage, "paint", G_CALLBACK (on_paint), NULL);
|
||||
|
@ -55,7 +55,7 @@ main (int argc, char *argv[])
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text");
|
||||
|
||||
group = clutter_actor_new ();
|
||||
|
@ -85,7 +85,7 @@ main (int argc, char **argv)
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, 512, 512);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_Black);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking Performance");
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
||||
|
@ -109,7 +109,7 @@ main (int argc, char *argv[])
|
||||
|
||||
stage = clutter_stage_new ();
|
||||
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
|
||||
clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
|
||||
clutter_actor_set_background_color (CLUTTER_ACTOR (stage), &stage_color);
|
||||
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Performance");
|
||||
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user