diff --git a/clutter/clutter/clutter-actor.c b/clutter/clutter/clutter-actor.c index e5be720a9..a89e329b0 100644 --- a/clutter/clutter/clutter-actor.c +++ b/clutter/clutter/clutter-actor.c @@ -80,7 +80,7 @@ * clutter_actor_set_size (actor, 480, 640); * * // set the background color of the actor - * clutter_actor_set_background_color (actor, CLUTTER_COLOR_Orange); + * clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (0xf5, 0x79, 0x00, 0xff)); * * // set the bounding box of the child, relative to the parent * ClutterActor *child = clutter_actor_new (); @@ -88,7 +88,7 @@ * clutter_actor_set_size (child, 80, 240); * * // set the background color of the child - * clutter_actor_set_background_color (child, CLUTTER_COLOR_Blue); + * clutter_actor_set_background_color (child, &CLUTTER_COLOR_INIT (0x00, 0x00, 0xff, 0xff)); * * // add the child to the actor * clutter_actor_add_child (actor, child); @@ -154,7 +154,7 @@ * clutter_actor_get_allocation_box (actor, &box); * * // the cogl_texture variable is set elsewhere - * node = clutter_texture_node_new (cogl_texture, CLUTTER_COLOR_White, + * node = clutter_texture_node_new (cogl_texture, &CLUTTER_COLOR_INIT (255, 255, 255, 255), * CLUTTER_SCALING_FILTER_TRILINEAR, * CLUTTER_SCALING_FILTER_LINEAR); * @@ -492,7 +492,6 @@ #include "clutter/clutter-actor-meta-private.h" #include "clutter/clutter-animatable.h" #include "clutter/clutter-color-state.h" -#include "clutter/clutter-color-static.h" #include "clutter/clutter-color.h" #include "clutter/clutter-constraint-private.h" #include "clutter/clutter-content-private.h" @@ -518,6 +517,9 @@ #include "clutter/clutter-timeline.h" #include "clutter/clutter-transition.h" + +static const ClutterColor transparent = { 0x00, 0x00, 0x00, 0x00 }; + /* Internal enum used to control mapped state update. This is a hint * which indicates when to do something other than just enforce * invariants. @@ -3360,7 +3362,7 @@ clutter_actor_paint_node (ClutterActor *actor, if (!CLUTTER_ACTOR_IS_TOPLEVEL (actor) && priv->bg_color_set && - !clutter_color_equal (&priv->bg_color, CLUTTER_COLOR_Transparent)) + !clutter_color_equal (&priv->bg_color, &transparent)) { ClutterPaintNode *node; @@ -6620,7 +6622,7 @@ clutter_actor_class_init (ClutterActorClass *klass) */ obj_props[PROP_BACKGROUND_COLOR] = clutter_param_spec_color ("background-color", NULL, NULL, - CLUTTER_COLOR_Transparent, + &transparent, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS | G_PARAM_EXPLICIT_NOTIFY | diff --git a/clutter/clutter/clutter-color-static.h b/clutter/clutter/clutter-color-static.h deleted file mode 100644 index fa3f16cfc..000000000 --- a/clutter/clutter/clutter-color-static.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Clutter. - * - * An OpenGL based 'interactive canvas' library. - * - * Copyright (C) 2010 Intel Corporation. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#pragma once - -#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) -#error "Only can be included directly." -#endif - -#define __CLUTTER_COLOR_SYM(x) (clutter_color_get_static (CLUTTER_COLOR_##x)) - -#define CLUTTER_COLOR_White (__CLUTTER_COLOR_SYM (WHITE)) -#define CLUTTER_COLOR_Black (__CLUTTER_COLOR_SYM (BLACK)) -#define CLUTTER_COLOR_Red (__CLUTTER_COLOR_SYM (RED)) -#define CLUTTER_COLOR_DarkRed (__CLUTTER_COLOR_SYM (DARK_RED)) -#define CLUTTER_COLOR_Green (__CLUTTER_COLOR_SYM (GREEN)) -#define CLUTTER_COLOR_DarkGreen (__CLUTTER_COLOR_SYM (DARK_GREEN)) -#define CLUTTER_COLOR_Blue (__CLUTTER_COLOR_SYM (BLUE)) -#define CLUTTER_COLOR_DarkBlue (__CLUTTER_COLOR_SYM (DARK_BLUE)) -#define CLUTTER_COLOR_Cyan (__CLUTTER_COLOR_SYM (CYAN)) -#define CLUTTER_COLOR_DarkCyan (__CLUTTER_COLOR_SYM (DARK_CYAN)) -#define CLUTTER_COLOR_Magenta (__CLUTTER_COLOR_SYM (MAGENTA)) -#define CLUTTER_COLOR_DarkMagenta (__CLUTTER_COLOR_SYM (DARK_MAGENTA)) -#define CLUTTER_COLOR_Yellow (__CLUTTER_COLOR_SYM (YELLOW)) -#define CLUTTER_COLOR_DarkYellow (__CLUTTER_COLOR_SYM (DARK_YELLOW)) -#define CLUTTER_COLOR_Gray (__CLUTTER_COLOR_SYM (GRAY)) -#define CLUTTER_COLOR_DarkGray (__CLUTTER_COLOR_SYM (DARK_GRAY)) -#define CLUTTER_COLOR_LightGray (__CLUTTER_COLOR_SYM (LIGHT_GRAY)) - -#define CLUTTER_COLOR_Butter (__CLUTTER_COLOR_SYM (BUTTER)) -#define CLUTTER_COLOR_LightButter (__CLUTTER_COLOR_SYM (BUTTER_LIGHT)) -#define CLUTTER_COLOR_DarkButter (__CLUTTER_COLOR_SYM (BUTTER_DARK)) -#define CLUTTER_COLOR_Orange (__CLUTTER_COLOR_SYM (ORANGE)) -#define CLUTTER_COLOR_LightOrange (__CLUTTER_COLOR_SYM (ORANGE_LIGHT)) -#define CLUTTER_COLOR_DarkOrange (__CLUTTER_COLOR_SYM (ORANGE_DARK)) -#define CLUTTER_COLOR_Chocolate (__CLUTTER_COLOR_SYM (CHOCOLATE)) -#define CLUTTER_COLOR_LightChocolate (__CLUTTER_COLOR_SYM (CHOCOLATE_LIGHT)) -#define CLUTTER_COLOR_DarkChocolate (__CLUTTER_COLOR_SYM (CHOCOLATE_DARK)) -#define CLUTTER_COLOR_Chameleon (__CLUTTER_COLOR_SYM (CHAMELEON)) -#define CLUTTER_COLOR_LightChameleon (__CLUTTER_COLOR_SYM (CHAMELEON_LIGHT)) -#define CLUTTER_COLOR_DarkChameleon (__CLUTTER_COLOR_SYM (CHAMELEON_DARK)) -#define CLUTTER_COLOR_SkyBlue (__CLUTTER_COLOR_SYM (SKY_BLUE)) -#define CLUTTER_COLOR_LightSkyBlue (__CLUTTER_COLOR_SYM (SKY_BLUE_LIGHT)) -#define CLUTTER_COLOR_DarkSkyBlue (__CLUTTER_COLOR_SYM (SKY_BLUE_DARK)) -#define CLUTTER_COLOR_Plum (__CLUTTER_COLOR_SYM (PLUM)) -#define CLUTTER_COLOR_LightPlum (__CLUTTER_COLOR_SYM (PLUM_LIGHT)) -#define CLUTTER_COLOR_DarkPlum (__CLUTTER_COLOR_SYM (PLUM_DARK)) -#define CLUTTER_COLOR_ScarletRed (__CLUTTER_COLOR_SYM (SCARLET_RED)) -#define CLUTTER_COLOR_LightScarletRed (__CLUTTER_COLOR_SYM (SCARLET_RED_LIGHT)) -#define CLUTTER_COLOR_DarkScarletRed (__CLUTTER_COLOR_SYM (SCARLET_RED_DARK)) -#define CLUTTER_COLOR_Aluminium1 (__CLUTTER_COLOR_SYM (ALUMINIUM_1)) -#define CLUTTER_COLOR_Aluminium2 (__CLUTTER_COLOR_SYM (ALUMINIUM_2)) -#define CLUTTER_COLOR_Aluminium3 (__CLUTTER_COLOR_SYM (ALUMINIUM_3)) -#define CLUTTER_COLOR_Aluminium4 (__CLUTTER_COLOR_SYM (ALUMINIUM_4)) -#define CLUTTER_COLOR_Aluminium5 (__CLUTTER_COLOR_SYM (ALUMINIUM_5)) -#define CLUTTER_COLOR_Aluminium6 (__CLUTTER_COLOR_SYM (ALUMINIUM_6)) - -#define CLUTTER_COLOR_Transparent (__CLUTTER_COLOR_SYM (TRANSPARENT)) diff --git a/clutter/clutter/clutter-color.c b/clutter/clutter/clutter-color.c index 936ee8444..9259226ef 100644 --- a/clutter/clutter/clutter-color.c +++ b/clutter/clutter/clutter-color.c @@ -33,81 +33,6 @@ #include "clutter/clutter-private.h" #include "clutter/clutter-debug.h" -/* XXX - keep in sync with the ClutterStaticColor enumeration order */ -static const ClutterColor static_colors[] = { - /* CGA/EGA color palette */ - { 0xff, 0xff, 0xff, 0xff }, /* white */ - { 0x00, 0x00, 0x00, 0xff }, /* black */ - { 0xff, 0x00, 0x00, 0xff }, /* red */ - { 0x80, 0x00, 0x00, 0xff }, /* dark red */ - { 0x00, 0xff, 0x00, 0xff }, /* green */ - { 0x00, 0x80, 0x00, 0xff }, /* dark green */ - { 0x00, 0x00, 0xff, 0xff }, /* blue */ - { 0x00, 0x00, 0x80, 0xff }, /* dark blue */ - { 0x00, 0xff, 0xff, 0xff }, /* cyan */ - { 0x00, 0x80, 0x80, 0xff }, /* dark cyan */ - { 0xff, 0x00, 0xff, 0xff }, /* magenta */ - { 0x80, 0x00, 0x80, 0xff }, /* dark magenta */ - { 0xff, 0xff, 0x00, 0xff }, /* yellow */ - { 0x80, 0x80, 0x00, 0xff }, /* dark yellow */ - { 0xa0, 0xa0, 0xa4, 0xff }, /* gray */ - { 0x80, 0x80, 0x80, 0xff }, /* dark gray */ - { 0xc0, 0xc0, 0xc0, 0xff }, /* light gray */ - - /* Tango Icon color palette */ - { 0xed, 0xd4, 0x00, 0xff }, /* butter */ - { 0xfc, 0xe9, 0x4f, 0xff }, /* butter light */ - { 0xc4, 0xa0, 0x00, 0xff }, /* butter dark */ - { 0xf5, 0x79, 0x00, 0xff }, /* orange */ - { 0xfc, 0xaf, 0x3e, 0xff }, /* orange light */ - { 0xce, 0x5c, 0x00, 0xff }, /* orange dark */ - { 0xc1, 0x7d, 0x11, 0xff }, /* chocolate */ - { 0xe9, 0xb9, 0x6e, 0xff }, /* chocolate light */ - { 0x8f, 0x59, 0x02, 0xff }, /* chocolate dark */ - { 0x73, 0xd2, 0x16, 0xff }, /* chameleon */ - { 0x8a, 0xe2, 0x34, 0xff }, /* chameleon light */ - { 0x4e, 0x9a, 0x06, 0xff }, /* chameleon dark */ - { 0x34, 0x65, 0xa4, 0xff }, /* sky blue */ - { 0x72, 0x9f, 0xcf, 0xff }, /* sky blue light */ - { 0x20, 0x4a, 0x87, 0xff }, /* sky blue dark */ - { 0x75, 0x50, 0x7b, 0xff }, /* plum */ - { 0xad, 0x7f, 0xa8, 0xff }, /* plum light */ - { 0x5c, 0x35, 0x66, 0xff }, /* plum dark */ - { 0xcc, 0x00, 0x00, 0xff }, /* scarlet red */ - { 0xef, 0x29, 0x29, 0xff }, /* scarlet red light */ - { 0xa4, 0x00, 0x00, 0xff }, /* scarlet red dark */ - { 0xee, 0xee, 0xec, 0xff }, /* aluminium 1 */ - { 0xd3, 0xd7, 0xcf, 0xff }, /* aluminium 2 */ - { 0xba, 0xbd, 0xb6, 0xff }, /* aluminium 3 */ - { 0x88, 0x8a, 0x85, 0xff }, /* aluminium 4 */ - { 0x55, 0x57, 0x53, 0xff }, /* aluminium 5 */ - { 0x2e, 0x34, 0x36, 0xff }, /* aluminium 6 */ - - /* last color */ - { 0x00, 0x00, 0x00, 0x00 } /* transparent */ -}; - -/** - * clutter_color_get_static: - * @color: the named global color - * - * Retrieves a static color for the given @color name - * - * Static colors are created by Clutter and are guaranteed to always be - * available and valid - * - * Return value: a pointer to a static color; the returned pointer - * is owned by Clutter and it should never be modified or freed - */ -const ClutterColor * -clutter_color_get_static (ClutterStaticColor color) -{ - g_return_val_if_fail (color >= CLUTTER_COLOR_WHITE && - color <= CLUTTER_COLOR_TRANSPARENT, NULL); - - return &static_colors[color]; -} - /** * clutter_color_add: * @a: a #ClutterColor diff --git a/clutter/clutter/clutter-color.h b/clutter/clutter/clutter-color.h index d75e9e55d..6570254be 100644 --- a/clutter/clutter/clutter-color.h +++ b/clutter/clutter/clutter-color.h @@ -68,7 +68,13 @@ struct _ClutterColor * * A macro that initializes a #ClutterColor, to be used when declaring it. */ -#define CLUTTER_COLOR_INIT(r,g,b,a) { (r), (g), (b), (a) } +#define CLUTTER_COLOR_INIT(_r, _g, _b, _a) \ + (ClutterColor) { \ + .red = (_r), \ + .green = (_g), \ + .blue = (_b), \ + .alpha = (_a) \ + } CLUTTER_EXPORT GType clutter_color_get_type (void) G_GNUC_CONST; @@ -192,7 +198,4 @@ GParamSpec * clutter_param_spec_color (const gchar *name, const ClutterColor *default_value, GParamFlags flags); -CLUTTER_EXPORT -const ClutterColor *clutter_color_get_static (ClutterStaticColor color); - G_END_DECLS diff --git a/clutter/clutter/clutter-deform-effect.c b/clutter/clutter/clutter-deform-effect.c index ad9cba964..64b954ba1 100644 --- a/clutter/clutter/clutter-deform-effect.c +++ b/clutter/clutter/clutter-deform-effect.c @@ -324,12 +324,10 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect, if (G_UNLIKELY (priv->lines_primitive != NULL)) { - const ClutterColor *red; + static ClutterColor red = CLUTTER_COLOR_INIT (255, 0, 0, 255); ClutterPaintNode *lines_node; - red = clutter_color_get_static (CLUTTER_COLOR_RED); - - lines_node = clutter_color_node_new (red); + lines_node = clutter_color_node_new (&red); clutter_paint_node_set_static_name (lines_node, "ClutterDeformEffect (lines)"); clutter_paint_node_add_child (node, lines_node); diff --git a/clutter/clutter/clutter-enums.h b/clutter/clutter/clutter-enums.h index e03f3d4fd..608cb0fc7 100644 --- a/clutter/clutter/clutter-enums.h +++ b/clutter/clutter/clutter-enums.h @@ -526,110 +526,6 @@ typedef enum /*< prefix=CLUTTER_LONG_PRESS >*/ CLUTTER_LONG_PRESS_CANCEL } ClutterLongPressState; -/** - * ClutterStaticColor: - * @CLUTTER_COLOR_WHITE: White color (ffffffff) - * @CLUTTER_COLOR_BLACK: Black color (000000ff) - * @CLUTTER_COLOR_RED: Red color (ff0000ff) - * @CLUTTER_COLOR_DARK_RED: Dark red color (800000ff) - * @CLUTTER_COLOR_GREEN: Green color (00ff00ff) - * @CLUTTER_COLOR_DARK_GREEN: Dark green color (008000ff) - * @CLUTTER_COLOR_BLUE: Blue color (0000ffff) - * @CLUTTER_COLOR_DARK_BLUE: Dark blue color (000080ff) - * @CLUTTER_COLOR_CYAN: Cyan color (00ffffff) - * @CLUTTER_COLOR_DARK_CYAN: Dark cyan color (008080ff) - * @CLUTTER_COLOR_MAGENTA: Magenta color (ff00ffff) - * @CLUTTER_COLOR_DARK_MAGENTA: Dark magenta color (800080ff) - * @CLUTTER_COLOR_YELLOW: Yellow color (ffff00ff) - * @CLUTTER_COLOR_DARK_YELLOW: Dark yellow color (808000ff) - * @CLUTTER_COLOR_GRAY: Gray color (a0a0a4ff) - * @CLUTTER_COLOR_DARK_GRAY: Dark Gray color (808080ff) - * @CLUTTER_COLOR_LIGHT_GRAY: Light gray color (c0c0c0ff) - * @CLUTTER_COLOR_BUTTER: Butter color (edd400ff) - * @CLUTTER_COLOR_BUTTER_LIGHT: Light butter color (fce94fff) - * @CLUTTER_COLOR_BUTTER_DARK: Dark butter color (c4a000ff) - * @CLUTTER_COLOR_ORANGE: Orange color (f57900ff) - * @CLUTTER_COLOR_ORANGE_LIGHT: Light orange color (fcaf3fff) - * @CLUTTER_COLOR_ORANGE_DARK: Dark orange color (ce5c00ff) - * @CLUTTER_COLOR_CHOCOLATE: Chocolate color (c17d11ff) - * @CLUTTER_COLOR_CHOCOLATE_LIGHT: Light chocolate color (e9b96eff) - * @CLUTTER_COLOR_CHOCOLATE_DARK: Dark chocolate color (8f5902ff) - * @CLUTTER_COLOR_CHAMELEON: Chameleon color (73d216ff) - * @CLUTTER_COLOR_CHAMELEON_LIGHT: Light chameleon color (8ae234ff) - * @CLUTTER_COLOR_CHAMELEON_DARK: Dark chameleon color (4e9a06ff) - * @CLUTTER_COLOR_SKY_BLUE: Sky color (3465a4ff) - * @CLUTTER_COLOR_SKY_BLUE_LIGHT: Light sky color (729fcfff) - * @CLUTTER_COLOR_SKY_BLUE_DARK: Dark sky color (204a87ff) - * @CLUTTER_COLOR_PLUM: Plum color (75507bff) - * @CLUTTER_COLOR_PLUM_LIGHT: Light plum color (ad7fa8ff) - * @CLUTTER_COLOR_PLUM_DARK: Dark plum color (5c3566ff) - * @CLUTTER_COLOR_SCARLET_RED: Scarlet red color (cc0000ff) - * @CLUTTER_COLOR_SCARLET_RED_LIGHT: Light scarlet red color (ef2929ff) - * @CLUTTER_COLOR_SCARLET_RED_DARK: Dark scarlet red color (a40000ff) - * @CLUTTER_COLOR_ALUMINIUM_1: Aluminium, first variant (eeeeecff) - * @CLUTTER_COLOR_ALUMINIUM_2: Aluminium, second variant (d3d7cfff) - * @CLUTTER_COLOR_ALUMINIUM_3: Aluminium, third variant (babdb6ff) - * @CLUTTER_COLOR_ALUMINIUM_4: Aluminium, fourth variant (888a85ff) - * @CLUTTER_COLOR_ALUMINIUM_5: Aluminium, fifth variant (555753ff) - * @CLUTTER_COLOR_ALUMINIUM_6: Aluminium, sixth variant (2e3436ff) - * @CLUTTER_COLOR_TRANSPARENT: Transparent color (00000000) - * - * Named colors, for accessing global colors defined by Clutter - */ -typedef enum /*< prefix=CLUTTER_COLOR >*/ -{ - /* CGA/EGA-like palette */ - CLUTTER_COLOR_WHITE = 0, - CLUTTER_COLOR_BLACK, - CLUTTER_COLOR_RED, - CLUTTER_COLOR_DARK_RED, - CLUTTER_COLOR_GREEN, - CLUTTER_COLOR_DARK_GREEN, - CLUTTER_COLOR_BLUE, - CLUTTER_COLOR_DARK_BLUE, - CLUTTER_COLOR_CYAN, - CLUTTER_COLOR_DARK_CYAN, - CLUTTER_COLOR_MAGENTA, - CLUTTER_COLOR_DARK_MAGENTA, - CLUTTER_COLOR_YELLOW, - CLUTTER_COLOR_DARK_YELLOW, - CLUTTER_COLOR_GRAY, - CLUTTER_COLOR_DARK_GRAY, - CLUTTER_COLOR_LIGHT_GRAY, - - /* Tango icon palette */ - CLUTTER_COLOR_BUTTER, - CLUTTER_COLOR_BUTTER_LIGHT, - CLUTTER_COLOR_BUTTER_DARK, - CLUTTER_COLOR_ORANGE, - CLUTTER_COLOR_ORANGE_LIGHT, - CLUTTER_COLOR_ORANGE_DARK, - CLUTTER_COLOR_CHOCOLATE, - CLUTTER_COLOR_CHOCOLATE_LIGHT, - CLUTTER_COLOR_CHOCOLATE_DARK, - CLUTTER_COLOR_CHAMELEON, - CLUTTER_COLOR_CHAMELEON_LIGHT, - CLUTTER_COLOR_CHAMELEON_DARK, - CLUTTER_COLOR_SKY_BLUE, - CLUTTER_COLOR_SKY_BLUE_LIGHT, - CLUTTER_COLOR_SKY_BLUE_DARK, - CLUTTER_COLOR_PLUM, - CLUTTER_COLOR_PLUM_LIGHT, - CLUTTER_COLOR_PLUM_DARK, - CLUTTER_COLOR_SCARLET_RED, - CLUTTER_COLOR_SCARLET_RED_LIGHT, - CLUTTER_COLOR_SCARLET_RED_DARK, - CLUTTER_COLOR_ALUMINIUM_1, - CLUTTER_COLOR_ALUMINIUM_2, - CLUTTER_COLOR_ALUMINIUM_3, - CLUTTER_COLOR_ALUMINIUM_4, - CLUTTER_COLOR_ALUMINIUM_5, - CLUTTER_COLOR_ALUMINIUM_6, - - /* Fully transparent black */ - CLUTTER_COLOR_TRANSPARENT -} ClutterStaticColor; - /** * ClutterEventFlags: * @CLUTTER_EVENT_NONE: No flag set diff --git a/clutter/clutter/clutter.h b/clutter/clutter/clutter.h index 2fd1c7f8e..a1de321aa 100644 --- a/clutter/clutter/clutter.h +++ b/clutter/clutter/clutter.h @@ -45,7 +45,6 @@ #include "clutter/clutter-clone.h" #include "clutter/clutter-color.h" #include "clutter/clutter-color-state.h" -#include "clutter/clutter-color-static.h" #include "clutter/clutter-colorize-effect.h" #include "clutter/clutter-constraint.h" #include "clutter/clutter-content.h" diff --git a/clutter/clutter/meson.build b/clutter/clutter/meson.build index 55aaa30a4..eb0341d06 100644 --- a/clutter/clutter/meson.build +++ b/clutter/clutter/meson.build @@ -18,7 +18,6 @@ clutter_headers = [ 'clutter-click-action.h', 'clutter-clone.h', 'clutter-color-state.h', - 'clutter-color-static.h', 'clutter-color.h', 'clutter-colorize-effect.h', 'clutter-constraint.h', diff --git a/src/compositor/compositor.c b/src/compositor/compositor.c index 4c89cd696..017ea9d56 100644 --- a/src/compositor/compositor.c +++ b/src/compositor/compositor.c @@ -1332,7 +1332,7 @@ meta_compositor_flash_display (MetaCompositor *compositor, clutter_actor_get_size (stage, &width, &height); flash = clutter_actor_new (); - clutter_actor_set_background_color (flash, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (flash, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_set_size (flash, width, height); clutter_actor_set_opacity (flash, 0); clutter_actor_add_child (stage, flash); @@ -1371,7 +1371,7 @@ meta_compositor_flash_window (MetaCompositor *compositor, ClutterTransition *transition; flash = clutter_actor_new (); - clutter_actor_set_background_color (flash, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (flash, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_set_size (flash, window->rect.width, window->rect.height); clutter_actor_set_position (flash, window->custom_frame_extents.left, diff --git a/src/compositor/meta-window-actor-wayland.c b/src/compositor/meta-window-actor-wayland.c index b19e361fd..a943b98e5 100644 --- a/src/compositor/meta-window-actor-wayland.c +++ b/src/compositor/meta-window-actor-wayland.c @@ -590,7 +590,7 @@ do_sync_geometry (MetaWindowActorWayland *self) { self->background = clutter_actor_new (); clutter_actor_set_background_color (self->background, - CLUTTER_COLOR_Black); + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_set_reactive (self->background, TRUE); clutter_actor_insert_child_below (CLUTTER_ACTOR (self), self->background, diff --git a/src/compositor/plugins/default.c b/src/compositor/plugins/default.c index 6e430799f..a63e4abed 100644 --- a/src/compositor/plugins/default.c +++ b/src/compositor/plugins/default.c @@ -825,7 +825,7 @@ get_display_tile_preview (MetaDisplay *display) preview = g_new0 (DisplayTilePreview, 1); preview->actor = clutter_actor_new (); - clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue); + clutter_actor_set_background_color (preview->actor, &CLUTTER_COLOR_INIT (0, 0, 255, 255)); clutter_actor_set_opacity (preview->actor, 100); clutter_actor_add_child (meta_get_window_group_for_display (display), preview->actor); diff --git a/src/tests/clutter/accessibility/cally-atkcomponent-example.c b/src/tests/clutter/accessibility/cally-atkcomponent-example.c index 05f404b04..594bf319e 100644 --- a/src/tests/clutter/accessibility/cally-atkcomponent-example.c +++ b/src/tests/clutter/accessibility/cally-atkcomponent-example.c @@ -43,22 +43,23 @@ main (int argc, char *argv[]) stage = clutter_test_get_stage (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkComponent Test"); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (255, 255, 255, 255)); clutter_actor_set_size (stage, WIDTH, HEIGHT); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); button1 = clutter_actor_new (); - clutter_actor_set_background_color (button1, CLUTTER_COLOR_Yellow); + clutter_actor_set_background_color (button1, &CLUTTER_COLOR_INIT (255, 255, 0, 255)); clutter_actor_set_size (button1, SIZE, SIZE); button2 = clutter_actor_new (); - clutter_actor_set_background_color (button2, CLUTTER_COLOR_Green); + clutter_actor_set_background_color (button2, &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_actor_set_position (button2, 2 * SIZE, 0); clutter_actor_set_size (button2, SIZE, SIZE); button3 = clutter_actor_new (); - clutter_actor_set_background_color (button3, CLUTTER_COLOR_Blue); + clutter_actor_set_background_color (button3, &CLUTTER_COLOR_INIT (0, 0, 255, 255)); clutter_actor_set_position (button3, 0, 2 * SIZE); clutter_actor_set_size (button3, SIZE, SIZE); clutter_actor_set_z_position (button3, DEPTH); @@ -66,7 +67,7 @@ main (int argc, char *argv[]) /* a nested hierarchy, to check that the relative positions are computed properly */ button4 = clutter_actor_new (); - clutter_actor_set_background_color (button4, CLUTTER_COLOR_Magenta); + clutter_actor_set_background_color (button4, &CLUTTER_COLOR_INIT (255, 0, 255, 255)); clutter_actor_set_position (button4, SIZE / 2, SIZE / 2); clutter_actor_set_size (button4, SIZE, SIZE); diff --git a/src/tests/clutter/accessibility/cally-atkeditabletext-example.c b/src/tests/clutter/accessibility/cally-atkeditabletext-example.c index 1a2d01f17..cd24692ee 100644 --- a/src/tests/clutter/accessibility/cally-atkeditabletext-example.c +++ b/src/tests/clutter/accessibility/cally-atkeditabletext-example.c @@ -149,12 +149,12 @@ _create_button (const gchar *text) button = clutter_actor_new (); rectangle = clutter_actor_new (); - clutter_actor_set_background_color (rectangle, CLUTTER_COLOR_Magenta); + clutter_actor_set_background_color (rectangle, &CLUTTER_COLOR_INIT (255, 0, 255, 255)); clutter_actor_set_size (rectangle, 375, 35); label = clutter_text_new_full ("Sans Bold 32px", text, - CLUTTER_COLOR_Black); + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_add_child (button, rectangle); clutter_actor_add_child (button, label); clutter_actor_set_reactive (button, TRUE); @@ -168,24 +168,25 @@ make_ui (ClutterActor *stage) ClutterActor *button = NULL; clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test"); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (255, 255, 255, 255)); clutter_actor_set_size (stage, WIDTH, HEIGHT); /* text */ text_actor = clutter_text_new_full ("Sans Bold 32px", "Lorem ipsum dolor sit amet", - CLUTTER_COLOR_Red); + &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_add_child (stage, text_actor); /* text_editable */ text_editable_actor = clutter_text_new_full ("Sans Bold 32px", "consectetur adipisicing elit", - CLUTTER_COLOR_Red); + &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_set_position (text_editable_actor, 0, 100); clutter_text_set_editable (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_selectable (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_selection_color (CLUTTER_TEXT (text_editable_actor), - CLUTTER_COLOR_Green); + &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_text_set_activatable (CLUTTER_TEXT (text_editable_actor), TRUE); clutter_text_set_line_wrap (CLUTTER_TEXT (text_editable_actor), TRUE); diff --git a/src/tests/clutter/accessibility/cally-atkevents-example.c b/src/tests/clutter/accessibility/cally-atkevents-example.c index 888a34f88..1d6ec3262 100644 --- a/src/tests/clutter/accessibility/cally-atkevents-example.c +++ b/src/tests/clutter/accessibility/cally-atkevents-example.c @@ -91,7 +91,8 @@ make_ui (ClutterActor *stage) ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 }; float label_geom_y, editable_geom_y; - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (255, 255, 255, 255)); clutter_actor_set_size (stage, WIDTH, HEIGHT); label_geom_y = 50; @@ -108,7 +109,7 @@ make_ui (ClutterActor *stage) /* editable */ editable = clutter_text_new_full ("Sans Bold 32px", "ddd", - CLUTTER_COLOR_Red); + &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_set_position (editable, 150, editable_geom_y); clutter_actor_set_size (editable, 500, 75); clutter_text_set_editable (CLUTTER_TEXT (editable), TRUE); diff --git a/src/tests/clutter/conform/actor-layout.c b/src/tests/clutter/conform/actor-layout.c index 276386639..c0f908f4d 100644 --- a/src/tests/clutter/conform/actor-layout.c +++ b/src/tests/clutter/conform/actor-layout.c @@ -16,19 +16,19 @@ actor_basic_layout (void) clutter_actor_add_child (stage, vase); flower[0] = clutter_actor_new (); - clutter_actor_set_background_color (flower[0], CLUTTER_COLOR_Red); + clutter_actor_set_background_color (flower[0], &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_set_size (flower[0], 100, 100); clutter_actor_set_name (flower[0], "Red Flower"); clutter_actor_add_child (vase, flower[0]); flower[1] = clutter_actor_new (); - clutter_actor_set_background_color (flower[1], CLUTTER_COLOR_Yellow); + clutter_actor_set_background_color (flower[1], &CLUTTER_COLOR_INIT (255, 255, 0, 255)); clutter_actor_set_size (flower[1], 100, 100); clutter_actor_set_name (flower[1], "Yellow Flower"); clutter_actor_add_child (vase, flower[1]); flower[2] = clutter_actor_new (); - clutter_actor_set_background_color (flower[2], CLUTTER_COLOR_Green); + clutter_actor_set_background_color (flower[2], &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_actor_set_size (flower[2], 100, 100); clutter_actor_set_name (flower[2], "Green Flower"); clutter_actor_add_child (vase, flower[2]); @@ -59,13 +59,13 @@ actor_margin_layout (void) clutter_actor_add_child (stage, vase); flower[0] = clutter_actor_new (); - clutter_actor_set_background_color (flower[0], CLUTTER_COLOR_Red); + clutter_actor_set_background_color (flower[0], &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_set_size (flower[0], 100, 100); clutter_actor_set_name (flower[0], "Red Flower"); clutter_actor_add_child (vase, flower[0]); flower[1] = clutter_actor_new (); - clutter_actor_set_background_color (flower[1], CLUTTER_COLOR_Yellow); + clutter_actor_set_background_color (flower[1], &CLUTTER_COLOR_INIT (255, 255, 0, 255)); clutter_actor_set_size (flower[1], 100, 100); clutter_actor_set_name (flower[1], "Yellow Flower"); clutter_actor_set_margin_right (flower[1], 6); @@ -73,7 +73,7 @@ actor_margin_layout (void) clutter_actor_add_child (vase, flower[1]); flower[2] = clutter_actor_new (); - clutter_actor_set_background_color (flower[2], CLUTTER_COLOR_Green); + clutter_actor_set_background_color (flower[2], &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_actor_set_size (flower[2], 100, 100); clutter_actor_set_name (flower[2], "Green Flower"); clutter_actor_set_margin_top (flower[2], 6); diff --git a/src/tests/clutter/interactive/test-actors.c b/src/tests/clutter/interactive/test-actors.c index 4c825d8a3..d18e4a049 100644 --- a/src/tests/clutter/interactive/test-actors.c +++ b/src/tests/clutter/interactive/test-actors.c @@ -156,7 +156,7 @@ test_actors_main (int argc, char *argv[]) oh->stage = clutter_test_get_stage (); clutter_actor_set_size (oh->stage, 800, 600); clutter_actor_set_name (oh->stage, "Default Stage"); - clutter_actor_set_background_color (oh->stage, CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (oh->stage, &CLUTTER_COLOR_INIT (114, 159, 207, 255)); g_signal_connect (oh->stage, "destroy", G_CALLBACK (stop_and_quit), oh); clutter_stage_set_title (CLUTTER_STAGE (oh->stage), "Actors"); diff --git a/src/tests/clutter/interactive/test-animation.c b/src/tests/clutter/interactive/test-animation.c index 12cea0f6d..1302e0aa7 100644 --- a/src/tests/clutter/interactive/test-animation.c +++ b/src/tests/clutter/interactive/test-animation.c @@ -30,7 +30,7 @@ on_clicked (ClutterClickAction *action, gfloat old_x, old_y, new_x, new_y; gfloat old_width, old_height, new_width, new_height; gdouble new_angle; - const ClutterColor *new_color; + ClutterColor new_color; guint8 new_opacity; clutter_actor_get_position (actor, &old_x, &old_y); @@ -47,8 +47,7 @@ on_clicked (ClutterClickAction *action, new_height = old_height + 200; new_angle = 360.0; - new_color = CLUTTER_COLOR_DarkScarletRed; - + clutter_color_init (&new_color, 164, 0, 0, 255); new_opacity = 255; } else @@ -59,7 +58,7 @@ on_clicked (ClutterClickAction *action, new_height = old_height - 200; new_angle = 0.0; - new_color = CLUTTER_COLOR_LightOrange; + clutter_color_init (&new_color, 206, 92, 0, 255); new_opacity = 128; } @@ -70,7 +69,7 @@ on_clicked (ClutterClickAction *action, clutter_actor_set_position (actor, new_x, new_y); clutter_actor_set_size (actor, new_width, new_height); - clutter_actor_set_background_color (actor, new_color); + clutter_actor_set_background_color (actor, &new_color); clutter_actor_set_rotation_angle (actor, CLUTTER_Z_AXIS, new_angle); clutter_actor_set_reactive (actor, FALSE); @@ -94,12 +93,12 @@ test_animation_main (int argc, char *argv[]) clutter_test_init (&argc, &argv); stage = clutter_test_get_stage (); - clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (114, 159, 207, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Animation"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); rect = clutter_actor_new (); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_LightOrange); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (252, 175, 62, 255)); clutter_actor_add_child (stage, rect); clutter_actor_set_size (rect, 50, 50); clutter_actor_set_pivot_point (rect, .5f, .5f); diff --git a/src/tests/clutter/interactive/test-binding-pool.c b/src/tests/clutter/interactive/test-binding-pool.c index ad58e3c07..be8c674de 100644 --- a/src/tests/clutter/interactive/test-binding-pool.c +++ b/src/tests/clutter/interactive/test-binding-pool.c @@ -271,7 +271,7 @@ test_binding_pool_main (int argc, char *argv[]) /* add three rectangles to the key group */ clutter_actor_add_child (key_group, g_object_new (CLUTTER_TYPE_ACTOR, - "background-color", CLUTTER_COLOR_Red, + "background-color", &CLUTTER_COLOR_INIT (255, 0, 0, 255), "name", "Red Rectangle", "width", 100.0, "height", 100.0, @@ -280,7 +280,7 @@ test_binding_pool_main (int argc, char *argv[]) NULL)); clutter_actor_add_child (key_group, g_object_new (CLUTTER_TYPE_ACTOR, - "background-color", CLUTTER_COLOR_Green, + "background-color", &CLUTTER_COLOR_INIT (0, 255, 0, 255), "name", "Green Rectangle", "width", 100.0, "height", 100.0, @@ -289,7 +289,7 @@ test_binding_pool_main (int argc, char *argv[]) NULL)); clutter_actor_add_child (key_group, g_object_new (CLUTTER_TYPE_ACTOR, - "background-color", CLUTTER_COLOR_Blue, + "background-color", &CLUTTER_COLOR_INIT (0, 0, 255, 255), "name", "Blue Rectangle", "width", 100.0, "height", 100.0, diff --git a/src/tests/clutter/interactive/test-cogl-point-sprites.c b/src/tests/clutter/interactive/test-cogl-point-sprites.c index 963f5eeaf..c29723670 100644 --- a/src/tests/clutter/interactive/test-cogl-point-sprites.c +++ b/src/tests/clutter/interactive/test-cogl-point-sprites.c @@ -261,7 +261,8 @@ test_cogl_point_sprites_main (int argc, char *argv[]) } stage = clutter_test_get_stage (); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Point Sprites"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), &data); diff --git a/src/tests/clutter/interactive/test-devices.c b/src/tests/clutter/interactive/test-devices.c index 96644bf10..d4fdf0fbd 100644 --- a/src/tests/clutter/interactive/test-devices.c +++ b/src/tests/clutter/interactive/test-devices.c @@ -170,7 +170,7 @@ test_devices_main (int argc, char **argv) app->devices = g_hash_table_new (g_direct_hash, g_direct_equal) ; stage = clutter_test_get_stage (); - clutter_actor_set_background_color (stage, CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (114, 159, 207, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Devices"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), diff --git a/src/tests/clutter/interactive/test-events.c b/src/tests/clutter/interactive/test-events.c index 7a1db9e02..fdf810238 100644 --- a/src/tests/clutter/interactive/test-events.c +++ b/src/tests/clutter/interactive/test-events.c @@ -389,12 +389,12 @@ test_events_main (int argc, char *argv[]) g_signal_connect (stage, "event", G_CALLBACK (input_cb), (char *) "stage"); focus_box = clutter_actor_new (); - clutter_actor_set_background_color (focus_box, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (focus_box, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_set_name (focus_box, "Focus Box"); clutter_actor_add_child (stage, focus_box); actor = clutter_actor_new (); - clutter_actor_set_background_color (actor, CLUTTER_COLOR_Green); + clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_actor_set_name (actor, "Green Box"); clutter_actor_set_size (actor, 100, 100); clutter_actor_set_position (actor, 250, 100); @@ -409,7 +409,7 @@ test_events_main (int argc, char *argv[]) /* non reactive */ actor = clutter_actor_new (); - clutter_actor_set_background_color (actor, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_actor_set_name (actor, "Black Box"); clutter_actor_set_size (actor, 400, 50); clutter_actor_set_position (actor, 100, 250); @@ -422,7 +422,7 @@ test_events_main (int argc, char *argv[]) /* non reactive group, with reactive child */ actor = clutter_actor_new (); - clutter_actor_set_background_color (actor, CLUTTER_COLOR_Yellow); + clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (255, 255, 0, 255)); clutter_actor_set_name (actor, "Yellow Box"); clutter_actor_set_size (actor, 100, 100); clutter_actor_set_reactive (actor, TRUE); @@ -437,7 +437,7 @@ test_events_main (int argc, char *argv[]) /* border actor */ actor = clutter_actor_new (); - clutter_actor_set_background_color (actor, CLUTTER_COLOR_Magenta); + clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (255, 0, 255, 255)); clutter_actor_set_name (actor, "Border Box"); clutter_actor_set_size (actor, 100, 100); clutter_actor_set_position (actor, diff --git a/src/tests/clutter/interactive/test-shader-effects.c b/src/tests/clutter/interactive/test-shader-effects.c index 820669596..ac159b4d9 100644 --- a/src/tests/clutter/interactive/test-shader-effects.c +++ b/src/tests/clutter/interactive/test-shader-effects.c @@ -23,7 +23,7 @@ test_shader_effects_main (int argc, char *argv[]) stage = clutter_test_get_stage (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Rotations"); - clutter_actor_set_background_color (stage, CLUTTER_COLOR_Aluminium3); + clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (186, 189, 182, 255)); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); /* Make a timeline */ @@ -50,7 +50,7 @@ test_shader_effects_main (int argc, char *argv[]) NULL); rect = clutter_actor_new (); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_DarkOrange); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (206, 92, 0, 255)); clutter_actor_add_effect_with_name (rect, "blur", clutter_blur_effect_new ()); clutter_actor_set_position (rect, 415, 215); clutter_actor_set_size (rect, 150, 150); diff --git a/src/tests/clutter/interactive/test-stage-sizing.c b/src/tests/clutter/interactive/test-stage-sizing.c index 6dad0483b..d39cbcf2d 100644 --- a/src/tests/clutter/interactive/test-stage-sizing.c +++ b/src/tests/clutter/interactive/test-stage-sizing.c @@ -47,7 +47,7 @@ test_stage_sizing_main (int argc, char *argv[]) rect = clutter_actor_new (); clutter_actor_set_layout_manager (rect, clutter_bin_layout_new ()); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_SkyBlue); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (52, 101, 164, 255)); clutter_actor_set_reactive (rect, TRUE); g_signal_connect_swapped (rect, "button-press-event", G_CALLBACK (shrink_clicked_cb), stage); @@ -58,7 +58,7 @@ test_stage_sizing_main (int argc, char *argv[]) rect = clutter_actor_new (); clutter_actor_set_layout_manager (rect, clutter_bin_layout_new ()); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_Butter); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (237, 212, 0, 255)); clutter_actor_set_reactive (rect, TRUE); g_signal_connect_swapped (rect, "button-press-event", G_CALLBACK (expand_clicked_cb), stage); diff --git a/src/tests/clutter/interactive/test-swipe-action.c b/src/tests/clutter/interactive/test-swipe-action.c index 0595c4917..ef2979bd6 100644 --- a/src/tests/clutter/interactive/test-swipe-action.c +++ b/src/tests/clutter/interactive/test-swipe-action.c @@ -125,7 +125,7 @@ test_swipe_action_main (int argc, char *argv[]) g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); rect = clutter_actor_new (); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_Red); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (255, 0, 0, 255)); clutter_actor_set_name (rect, "Vertical swipes"); clutter_actor_set_size (rect, 150, 150); clutter_actor_set_position (rect, 10, 100); @@ -134,7 +134,7 @@ test_swipe_action_main (int argc, char *argv[]) attach_action (rect, VERTICAL); rect = clutter_actor_new (); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_Blue); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (0, 0, 255, 255)); clutter_actor_set_name (rect, "Horizontal swipes"); clutter_actor_set_size (rect, 150, 150); clutter_actor_set_position (rect, 170, 100); @@ -143,7 +143,7 @@ test_swipe_action_main (int argc, char *argv[]) attach_action (rect, HORIZONTAL); rect = clutter_actor_new (); - clutter_actor_set_background_color (rect, CLUTTER_COLOR_Green); + clutter_actor_set_background_color (rect, &CLUTTER_COLOR_INIT (0, 255, 0, 255)); clutter_actor_set_name (rect, "All swipes"); clutter_actor_set_size (rect, 150, 150); clutter_actor_set_position (rect, 330, 100); diff --git a/src/tests/clutter/interactive/test-text-field.c b/src/tests/clutter/interactive/test-text-field.c index 4ff939897..5768b07a3 100644 --- a/src/tests/clutter/interactive/test-text-field.c +++ b/src/tests/clutter/interactive/test-text-field.c @@ -236,7 +236,7 @@ create_entry (const ClutterColor *color, clutter_text_set_cursor_color (CLUTTER_TEXT (retval), &selection); clutter_text_set_max_length (CLUTTER_TEXT (retval), max_length); clutter_text_set_selected_text_color (CLUTTER_TEXT (retval), &selected_text); - clutter_actor_set_background_color (retval, CLUTTER_COLOR_LightGray); + clutter_actor_set_background_color (retval, &CLUTTER_COLOR_INIT (192, 192, 192, 255)); if (attrs) clutter_text_set_attributes (CLUTTER_TEXT (retval), attrs); @@ -263,7 +263,7 @@ test_text_field_main (gint argc, stage = clutter_test_get_stage (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Fields"); - clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); grid = clutter_grid_layout_new (); @@ -277,7 +277,7 @@ test_text_field_main (gint argc, clutter_actor_set_position (box, 12, 12); clutter_actor_add_child (stage, box); - label = create_label (CLUTTER_COLOR_White, "Input field:"); + label = create_label (&CLUTTER_COLOR_INIT (255, 255, 255, 255), "Input field:"); g_object_set (label, "min-width", 150.0, NULL); clutter_actor_add_child (box, label); clutter_layout_manager_child_set (grid, box, label, @@ -290,7 +290,7 @@ test_text_field_main (gint argc, entry_attrs = pango_attr_list_new (); pango_attr_list_insert (entry_attrs, pango_attr_underline_new (PANGO_UNDERLINE_ERROR)); pango_attr_list_insert (entry_attrs, pango_attr_underline_color_new (65535, 0, 0)); - entry = create_entry (CLUTTER_COLOR_Black, "somme misspeeled textt", entry_attrs, 0, 0); + entry = create_entry (&CLUTTER_COLOR_INIT (0, 0, 0, 255), "somme misspeeled textt", entry_attrs, 0, 0); clutter_actor_add_child (box, entry); clutter_layout_manager_child_set (grid, box, entry, "row", 0, @@ -301,7 +301,7 @@ test_text_field_main (gint argc, NULL); clutter_actor_grab_key_focus (entry); - label = create_label (CLUTTER_COLOR_White, "A very long password field:"); + label = create_label (&CLUTTER_COLOR_INIT (255, 255, 255, 255), "A very long password field:"); clutter_actor_add_child (box, label); clutter_layout_manager_child_set (grid, box, label, "row", 1, @@ -310,7 +310,7 @@ test_text_field_main (gint argc, "y-expand", FALSE, NULL); - entry = create_entry (CLUTTER_COLOR_Black, "password", NULL, '*', 8); + entry = create_entry (&CLUTTER_COLOR_INIT (0, 0, 0, 255), "password", NULL, '*', 8); clutter_actor_add_child (box, entry); clutter_layout_manager_child_set (grid, box, entry, "row", 1, diff --git a/src/tests/clutter/interactive/test-text.c b/src/tests/clutter/interactive/test-text.c index b438fbe65..965916f64 100644 --- a/src/tests/clutter/interactive/test-text.c +++ b/src/tests/clutter/interactive/test-text.c @@ -33,7 +33,7 @@ test_text_main (gint argc, stage = clutter_test_get_stage (); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Editing"); - clutter_actor_set_background_color (stage, CLUTTER_COLOR_Black); + clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (0, 0, 0, 255)); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); buffer = clutter_text_buffer_new_with_text ("ยท", -1); @@ -53,7 +53,7 @@ test_text_main (gint argc, clutter_text_set_editable (CLUTTER_TEXT (text), TRUE); clutter_text_set_selectable (CLUTTER_TEXT (text), TRUE); clutter_text_set_cursor_color (CLUTTER_TEXT (text), &cursor_color); - clutter_text_set_selected_text_color (CLUTTER_TEXT (text), CLUTTER_COLOR_Blue); + clutter_text_set_selected_text_color (CLUTTER_TEXT (text), &CLUTTER_COLOR_INIT (0, 0, 255, 255)); text2 = clutter_text_new_with_buffer (buffer); clutter_text_set_color (CLUTTER_TEXT (text2), &text_color); @@ -66,7 +66,7 @@ test_text_main (gint argc, clutter_text_set_editable (CLUTTER_TEXT (text2), TRUE); clutter_text_set_selectable (CLUTTER_TEXT (text2), TRUE); clutter_text_set_cursor_color (CLUTTER_TEXT (text2), &cursor_color); - clutter_text_set_selected_text_color (CLUTTER_TEXT (text2), CLUTTER_COLOR_Green); + clutter_text_set_selected_text_color (CLUTTER_TEXT (text2), &CLUTTER_COLOR_INIT (0, 255, 0, 255)); if (argv[1]) { diff --git a/src/tests/clutter/micro-bench/test-cogl-perf.c b/src/tests/clutter/micro-bench/test-cogl-perf.c index aa8cfb851..9dbe8a0a2 100644 --- a/src/tests/clutter/micro-bench/test-cogl-perf.c +++ b/src/tests/clutter/micro-bench/test-cogl-perf.c @@ -134,7 +134,8 @@ main (int argc, char *argv[]) clutter_actor_add_child (stage, actor); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_White); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (255, 255, 255, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Performance Test"); /* We want continuous redrawing of the stage... */ diff --git a/src/tests/clutter/micro-bench/test-picking.c b/src/tests/clutter/micro-bench/test-picking.c index 8b4412ed1..aa8519b14 100644 --- a/src/tests/clutter/micro-bench/test-picking.c +++ b/src/tests/clutter/micro-bench/test-picking.c @@ -69,7 +69,8 @@ main (int argc, char **argv) stage = clutter_test_get_stage (); clutter_actor_set_size (stage, 512, 512); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking"); printf ("Picking performance test with " diff --git a/src/tests/clutter/micro-bench/test-text-perf.c b/src/tests/clutter/micro-bench/test-text-perf.c index 706bd054d..e83be197e 100644 --- a/src/tests/clutter/micro-bench/test-text-perf.c +++ b/src/tests/clutter/micro-bench/test-text-perf.c @@ -133,7 +133,8 @@ main (int argc, char *argv[]) stage = clutter_test_get_stage (); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Performance"); g_signal_connect (CLUTTER_STAGE (stage), "after-paint", G_CALLBACK (on_after_paint), NULL); diff --git a/src/tests/clutter/micro-bench/test-text.c b/src/tests/clutter/micro-bench/test-text.c index f658e0c5e..bf47f8550 100644 --- a/src/tests/clutter/micro-bench/test-text.c +++ b/src/tests/clutter/micro-bench/test-text.c @@ -57,7 +57,8 @@ main (int argc, char *argv[]) stage = clutter_test_get_stage (); clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Text"); group = clutter_actor_new (); @@ -101,7 +102,8 @@ main (int argc, char *argv[]) } label = clutter_text_new_with_text (font_name, text); - clutter_text_set_color (CLUTTER_TEXT (label), CLUTTER_COLOR_White); + clutter_text_set_color (CLUTTER_TEXT (label), + &CLUTTER_COLOR_INIT (255, 255, 255, 255)); clutter_actor_set_position (label, (1.0*STAGE_WIDTH/COLS)*col, (1.0*STAGE_HEIGHT/ROWS)*row); /*clutter_actor_set_clip (label, 0,0, (1.0*STAGE_WIDTH/COLS), diff --git a/src/tests/clutter/performance/test-picking.c b/src/tests/clutter/performance/test-picking.c index 25d6b0756..b712b7789 100644 --- a/src/tests/clutter/performance/test-picking.c +++ b/src/tests/clutter/performance/test-picking.c @@ -60,7 +60,8 @@ main (int argc, char **argv) stage = clutter_test_get_stage (); clutter_actor_set_size (stage, 512, 512); - clutter_actor_set_background_color (CLUTTER_ACTOR (stage), CLUTTER_COLOR_Black); + clutter_actor_set_background_color (CLUTTER_ACTOR (stage), + &CLUTTER_COLOR_INIT (0, 0, 0, 255)); clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking Performance"); g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL); diff --git a/src/tests/meta-test-shell.c b/src/tests/meta-test-shell.c index a58a70bca..822239f60 100644 --- a/src/tests/meta-test-shell.c +++ b/src/tests/meta-test-shell.c @@ -700,7 +700,7 @@ get_display_tile_preview (MetaDisplay *display) preview = g_new0 (DisplayTilePreview, 1); preview->actor = clutter_actor_new (); - clutter_actor_set_background_color (preview->actor, CLUTTER_COLOR_Blue); + clutter_actor_set_background_color (preview->actor, &CLUTTER_COLOR_INIT (0, 0, 255, 255)); clutter_actor_set_opacity (preview->actor, 100); clutter_actor_add_child (meta_get_window_group_for_display (display), diff --git a/src/tests/native-virtual-monitor.c b/src/tests/native-virtual-monitor.c index bd1057a2c..a27845668 100644 --- a/src/tests/native-virtual-monitor.c +++ b/src/tests/native-virtual-monitor.c @@ -106,7 +106,7 @@ meta_test_virtual_monitor_create (void) actor = clutter_actor_new (); clutter_actor_set_position (actor, 10, 10); clutter_actor_set_size (actor, 40, 40); - clutter_actor_set_background_color (actor, CLUTTER_COLOR_LightSkyBlue); + clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (114, 159, 207, 255)); clutter_actor_add_child (meta_backend_get_stage (backend), actor); for (i = 0; i < 5; i++) diff --git a/src/tests/ref-test-sanity.c b/src/tests/ref-test-sanity.c index 5ee2446ae..12a07bb6e 100644 --- a/src/tests/ref-test-sanity.c +++ b/src/tests/ref-test-sanity.c @@ -95,7 +95,7 @@ meta_test_ref_test_sanity (void) actor1 = clutter_actor_new (); clutter_actor_set_position (actor1, 10, 10); clutter_actor_set_size (actor1, 50, 50); - clutter_actor_set_background_color (actor1, CLUTTER_COLOR_Orange); + clutter_actor_set_background_color (actor1, &CLUTTER_COLOR_INIT (245, 121, 0, 255)); clutter_actor_add_child (stage, actor1); meta_ref_test_verify_view (get_view (), @@ -105,7 +105,7 @@ meta_test_ref_test_sanity (void) actor2 = clutter_actor_new (); clutter_actor_set_position (actor2, 20, 20); clutter_actor_set_size (actor2, 50, 50); - clutter_actor_set_background_color (actor2, CLUTTER_COLOR_SkyBlue); + clutter_actor_set_background_color (actor2, &CLUTTER_COLOR_INIT (52, 101, 164, 255)); clutter_actor_add_child (stage, actor2); g_test_expect_message ("libmutter-test",