cleanup: Port from ClutterColor to CoglColor

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3544>
This commit is contained in:
Bilal Elmoussaoui 2024-06-13 03:09:15 +02:00
parent 5851738db4
commit dc52ccc75a
63 changed files with 327 additions and 356 deletions

View File

@ -2024,7 +2024,7 @@ static AtkAttributeSet*
_cally_misc_add_actor_color_to_attribute_set (AtkAttributeSet *attrib_set,
ClutterText *clutter_text)
{
ClutterColor color;
CoglColor color;
gchar *value;
clutter_text_get_color (clutter_text, &color);

View File

@ -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_INIT (0xf5, 0x79, 0x00, 0xff));
* clutter_actor_set_background_color (actor, &COGL_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_INIT (0x00, 0x00, 0xff, 0xff));
* clutter_actor_set_background_color (child, &COGL_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_INIT (255, 255, 255, 255),
* node = clutter_texture_node_new (cogl_texture, &COGL_COLOR_INIT (255, 255, 255, 255),
* CLUTTER_SCALING_FILTER_TRILINEAR,
* CLUTTER_SCALING_FILTER_LINEAR);
*
@ -518,7 +518,7 @@
#include "clutter/clutter-transition.h"
static const ClutterColor transparent = { 0x00, 0x00, 0x00, 0x00 };
static const CoglColor 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
@ -654,7 +654,7 @@ struct _ClutterActorPrivate
*/
ClutterPaintVolume visible_paint_volume;
ClutterColor bg_color;
CoglColor bg_color;
/* a string used for debugging messages */
char *debug_name;
@ -929,8 +929,8 @@ static ClutterPaintVolume *_clutter_actor_get_paint_volume_mutable (ClutterActor
static guint8 clutter_actor_get_paint_opacity_internal (ClutterActor *self);
static inline void clutter_actor_set_background_color_internal (ClutterActor *self,
const ClutterColor *color);
static inline void clutter_actor_set_background_color_internal (ClutterActor *self,
const CoglColor *color);
static void on_layout_manager_changed (ClutterLayoutManager *manager,
ClutterActor *self);
@ -3013,7 +3013,7 @@ _clutter_actor_apply_relative_transformation_matrix (ClutterActor *self,
static void
_clutter_actor_draw_paint_volume_full (ClutterActor *self,
ClutterPaintVolume *pv,
const ClutterColor *color,
const CoglColor *color,
ClutterPaintNode *node)
{
g_autoptr (ClutterPaintNode) pipeline_node = NULL;
@ -3023,7 +3023,6 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
int n_vertices;
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());
CoglColor cogl_color;
if (outline == NULL)
outline = cogl_pipeline_new (ctx);
@ -3057,12 +3056,7 @@ _clutter_actor_draw_paint_volume_full (ClutterActor *self,
n_vertices,
(CoglVertexP3 *)line_ends);
cogl_color_init_from_4f (&cogl_color,
color->red / 255.0,
color->green / 255.0,
color->blue / 255.0,
color->alpha / 255.0);
cogl_pipeline_set_color (outline, &cogl_color);
cogl_pipeline_set_color (outline, color);
pipeline_node = clutter_pipeline_node_new (outline);
clutter_paint_node_set_static_name (pipeline_node,
@ -3092,7 +3086,7 @@ _clutter_actor_draw_paint_volume (ClutterActor *self,
clutter_paint_volume_set_height (&fake_pv, height);
_clutter_actor_draw_paint_volume_full (self, &fake_pv,
&CLUTTER_COLOR_INIT (0, 0, 255, 255),
&COGL_COLOR_INIT (0, 0, 255, 255),
node);
clutter_paint_volume_free (&fake_pv);
@ -3100,7 +3094,7 @@ _clutter_actor_draw_paint_volume (ClutterActor *self,
else
{
_clutter_actor_draw_paint_volume_full (self, pv,
&CLUTTER_COLOR_INIT (0, 255, 0, 255),
&COGL_COLOR_INIT (0, 255, 0, 255),
node);
}
}
@ -3112,25 +3106,25 @@ _clutter_actor_paint_cull_result (ClutterActor *self,
ClutterPaintNode *node)
{
ClutterPaintVolume *pv;
ClutterColor color;
CoglColor color;
if (success)
{
switch (result)
{
case CLUTTER_CULL_RESULT_IN:
color = CLUTTER_COLOR_INIT (0, 255, 0, 255);
color = COGL_COLOR_INIT (0, 255, 0, 255);
break;
case CLUTTER_CULL_RESULT_OUT:
color = CLUTTER_COLOR_INIT (0, 0, 255, 255);
color = COGL_COLOR_INIT (0, 0, 255, 255);
break;
default:
color = CLUTTER_COLOR_INIT (0, 255, 255, 255);
color = COGL_COLOR_INIT (0, 255, 255, 255);
break;
}
}
else
color = CLUTTER_COLOR_INIT (255, 255, 255, 255);
color = COGL_COLOR_INIT (255, 255, 255, 255);
if (success && (pv = _clutter_actor_get_paint_volume_mutable (self)))
_clutter_actor_draw_paint_volume_full (self, pv,
@ -3349,7 +3343,7 @@ clutter_actor_paint_node (ClutterActor *actor,
{
ClutterActorPrivate *priv = actor->priv;
ClutterActorBox box;
ClutterColor bg_color;
CoglColor bg_color;
box.x1 = 0.f;
box.y1 = 0.f;
@ -3360,7 +3354,7 @@ clutter_actor_paint_node (ClutterActor *actor,
if (!CLUTTER_ACTOR_IS_TOPLEVEL (actor) &&
priv->bg_color_set &&
!clutter_color_equal (&priv->bg_color, &transparent))
!cogl_color_equal (&priv->bg_color, &transparent))
{
ClutterPaintNode *node;
@ -6619,12 +6613,12 @@ clutter_actor_class_init (ClutterActorClass *klass)
* The [property@Clutter.Actor:background-color] property is animatable.
*/
obj_props[PROP_BACKGROUND_COLOR] =
clutter_param_spec_color ("background-color", NULL, NULL,
&transparent,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY |
CLUTTER_PARAM_ANIMATABLE);
cogl_param_spec_color ("background-color", NULL, NULL,
&transparent,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
G_PARAM_EXPLICIT_NOTIFY |
CLUTTER_PARAM_ANIMATABLE);
/**
* ClutterActor:first-child:
@ -12098,7 +12092,7 @@ clutter_actor_set_animatable_property (ClutterActor *actor,
break;
case PROP_BACKGROUND_COLOR:
clutter_actor_set_background_color_internal (actor, clutter_value_get_color (value));
clutter_actor_set_background_color_internal (actor, cogl_value_get_color (value));
break;
case PROP_PIVOT_POINT:
@ -15845,12 +15839,12 @@ clutter_actor_get_margin_right (ClutterActor *self)
static inline void
clutter_actor_set_background_color_internal (ClutterActor *self,
const ClutterColor *color)
const CoglColor *color)
{
ClutterActorPrivate *priv = self->priv;
GObject *obj;
if (priv->bg_color_set && clutter_color_equal (color, &priv->bg_color))
if (priv->bg_color_set && cogl_color_equal (color, &priv->bg_color))
return;
obj = G_OBJECT (self);
@ -15867,7 +15861,7 @@ clutter_actor_set_background_color_internal (ClutterActor *self,
/**
* clutter_actor_set_background_color:
* @self: a #ClutterActor
* @color: (nullable): a #ClutterColor, or %NULL to unset a previously
* @color: (nullable): a #CoglColor, or %NULL to unset a previously
* set color
*
* Sets the background color of a #ClutterActor.
@ -15881,8 +15875,8 @@ clutter_actor_set_background_color_internal (ClutterActor *self,
* The [property@Clutter.Actor:background-color] property is animatable.
*/
void
clutter_actor_set_background_color (ClutterActor *self,
const ClutterColor *color)
clutter_actor_set_background_color (ClutterActor *self,
const CoglColor *color)
{
ClutterActorPrivate *priv;
@ -15910,13 +15904,13 @@ clutter_actor_set_background_color (ClutterActor *self,
/**
* clutter_actor_get_background_color:
* @self: a #ClutterActor
* @color: (out caller-allocates): return location for a #ClutterColor
* @color: (out caller-allocates): return location for a #CoglColor
*
* Retrieves the color set using [method@Clutter.Actor.set_background_color].
*/
void
clutter_actor_get_background_color (ClutterActor *self,
ClutterColor *color)
CoglColor *color)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (color != NULL);
@ -18349,7 +18343,7 @@ clutter_actor_create_texture_paint_node (ClutterActor *self,
ClutterActorPrivate *priv = clutter_actor_get_instance_private (self);
ClutterPaintNode *node;
ClutterActorBox box;
ClutterColor color;
CoglColor color;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
g_return_val_if_fail (texture != NULL, NULL);

View File

@ -572,10 +572,10 @@ void clutter_actor_get_content_box
ClutterActorBox *box);
CLUTTER_EXPORT
void clutter_actor_set_background_color (ClutterActor *self,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
void clutter_actor_get_background_color (ClutterActor *self,
ClutterColor *color);
CoglColor *color);
CLUTTER_EXPORT
const ClutterPaintVolume * clutter_actor_get_paint_volume (ClutterActor *self);
CLUTTER_EXPORT

View File

@ -76,8 +76,8 @@ static const gchar *brightness_contrast_source =
"cogl_color_out.rgb = ((cogl_color_out.rgb - 0.5 * cogl_color_out.a) *\n"
" contrast + 0.5 * cogl_color_out.a);\n";
static const ClutterColor no_brightness_change = { 0x7f, 0x7f, 0x7f, 0xff };
static const ClutterColor no_contrast_change = { 0x7f, 0x7f, 0x7f, 0xff };
static const CoglColor no_brightness_change = { 0x7f, 0x7f, 0x7f, 0xff };
static const CoglColor no_contrast_change = { 0x7f, 0x7f, 0x7f, 0xff };
static const gfloat no_change = 0.0f;
enum
@ -165,7 +165,7 @@ clutter_brightness_contrast_effect_set_property (GObject *gobject,
{
case PROP_BRIGHTNESS:
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_brightness_contrast_effect_set_brightness_full (effect,
color->red / 127.0f - 1.0f,
color->green / 127.0f - 1.0f,
@ -175,7 +175,7 @@ clutter_brightness_contrast_effect_set_property (GObject *gobject,
case PROP_CONTRAST:
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_brightness_contrast_effect_set_contrast_full (effect,
color->red / 127.0f - 1.0f,
color->green / 127.0f - 1.0f,
@ -198,7 +198,7 @@ clutter_brightness_contrast_effect_get_property (GObject *gobject,
ClutterBrightnessContrastEffect *effect = CLUTTER_BRIGHTNESS_CONTRAST_EFFECT (gobject);
ClutterBrightnessContrastEffectPrivate *priv =
clutter_brightness_contrast_effect_get_instance_private (effect);
ClutterColor color;
CoglColor color;
switch (prop_id)
{
@ -209,7 +209,7 @@ clutter_brightness_contrast_effect_get_property (GObject *gobject,
color.blue = (priv->brightness_blue + 1.0f) * 127.0f;
color.alpha = 0xff;
clutter_value_set_color (value, &color);
cogl_value_set_color (value, &color);
}
break;
@ -220,7 +220,7 @@ clutter_brightness_contrast_effect_get_property (GObject *gobject,
color.blue = (priv->contrast_blue + 1.0f) * 127.0f;
color.alpha = 0xff;
clutter_value_set_color (value, &color);
cogl_value_set_color (value, &color);
}
break;
@ -251,34 +251,34 @@ clutter_brightness_contrast_effect_class_init (ClutterBrightnessContrastEffectCl
*
* The brightness change to apply to the effect.
*
* This property uses a #ClutterColor to represent the changes to each
* This property uses a #CoglColor to represent the changes to each
* color channel. The range is [ 0, 255 ], with 127 as the value used
* to indicate no change; values smaller than 127 indicate a decrease
* in brightness, and values larger than 127 indicate an increase in
* brightness.
*/
obj_props[PROP_BRIGHTNESS] =
clutter_param_spec_color ("brightness", NULL, NULL,
&no_brightness_change,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
cogl_param_spec_color ("brightness", NULL, NULL,
&no_brightness_change,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
/**
* ClutterBrightnessContrastEffect:contrast:
*
* The contrast change to apply to the effect.
*
* This property uses a #ClutterColor to represent the changes to each
* This property uses a #CoglColor to represent the changes to each
* color channel. The range is [ 0, 255 ], with 127 as the value used
* to indicate no change; values smaller than 127 indicate a decrease
* in contrast, and values larger than 127 indicate an increase in
* contrast.
*/
obj_props[PROP_CONTRAST] =
clutter_param_spec_color ("contrast", NULL, NULL,
&no_contrast_change,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
cogl_param_spec_color ("contrast", NULL, NULL,
&no_contrast_change,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
}

View File

@ -46,7 +46,7 @@ typedef struct _ClutterColorizeEffectPrivate
ClutterOffscreenEffect parent_instance;
/* the tint of the colorization */
ClutterColor tint;
CoglColor tint;
gint tint_uniform;
@ -68,7 +68,7 @@ static const gchar *colorize_glsl_source =
"cogl_color_out.rgb = gray * tint;\n";
/* a lame sepia */
static const ClutterColor default_tint = { 255, 204, 153, 255 };
static const CoglColor default_tint = { 255, 204, 153, 255 };
enum
{
@ -122,7 +122,7 @@ clutter_colorize_effect_set_property (GObject *gobject,
{
case PROP_TINT:
clutter_colorize_effect_set_tint (effect,
clutter_value_get_color (value));
cogl_value_get_color (value));
break;
default:
@ -144,7 +144,7 @@ clutter_colorize_effect_get_property (GObject *gobject,
switch (prop_id)
{
case PROP_TINT:
clutter_value_set_color (value, &priv->tint);
cogl_value_set_color (value, &priv->tint);
break;
default:
@ -172,10 +172,10 @@ clutter_colorize_effect_class_init (ClutterColorizeEffectClass *klass)
* The tint to apply to the actor
*/
obj_props[PROP_TINT] =
clutter_param_spec_color ("tint", NULL, NULL,
&default_tint,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
cogl_param_spec_color ("tint", NULL, NULL,
&default_tint,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS);
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
}
@ -244,7 +244,7 @@ clutter_colorize_effect_init (ClutterColorizeEffect *self)
* Return value: the newly created #ClutterColorizeEffect or %NULL
*/
ClutterEffect *
clutter_colorize_effect_new (const ClutterColor *tint)
clutter_colorize_effect_new (const CoglColor *tint)
{
return g_object_new (CLUTTER_TYPE_COLORIZE_EFFECT,
"tint", tint,
@ -260,7 +260,7 @@ clutter_colorize_effect_new (const ClutterColor *tint)
*/
void
clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
const ClutterColor *tint)
const CoglColor *tint)
{
ClutterColorizeEffectPrivate *priv;
@ -285,7 +285,7 @@ clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
*/
void
clutter_colorize_effect_get_tint (ClutterColorizeEffect *effect,
ClutterColor *tint)
CoglColor *tint)
{
ClutterColorizeEffectPrivate *priv;

View File

@ -28,9 +28,9 @@
#error "Only <clutter/clutter.h> can be included directly."
#endif
#include "clutter/clutter-color.h"
#include "clutter/clutter-effect.h"
#include "clutter/clutter-offscreen-effect.h"
#include "cogl/cogl-color.h"
G_BEGIN_DECLS
@ -50,13 +50,13 @@ struct _ClutterColorizeEffectClass
};
CLUTTER_EXPORT
ClutterEffect *clutter_colorize_effect_new (const ClutterColor *tint);
ClutterEffect *clutter_colorize_effect_new (const CoglColor *tint);
CLUTTER_EXPORT
void clutter_colorize_effect_set_tint (ClutterColorizeEffect *effect,
const ClutterColor *tint);
const CoglColor *tint);
CLUTTER_EXPORT
void clutter_colorize_effect_get_tint (ClutterColorizeEffect *effect,
ClutterColor *tint);
CoglColor *tint);
G_END_DECLS

View File

@ -324,7 +324,7 @@ clutter_deform_effect_paint_target (ClutterOffscreenEffect *effect,
if (G_UNLIKELY (priv->lines_primitive != NULL))
{
static ClutterColor red = CLUTTER_COLOR_INIT (255, 0, 0, 255);
static CoglColor red = COGL_COLOR_INIT (255, 0, 0, 255);
ClutterPaintNode *lines_node;
lines_node = clutter_color_node_new (&red);

View File

@ -151,9 +151,9 @@ clutter_root_node_init (ClutterRootNode *self)
}
ClutterPaintNode *
clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color,
CoglBufferBit clear_flags)
clutter_root_node_new (CoglFramebuffer *framebuffer,
const CoglColor *clear_color,
CoglBufferBit clear_flags)
{
ClutterRootNode *res;
@ -161,11 +161,7 @@ clutter_root_node_new (CoglFramebuffer *framebuffer,
res = _clutter_paint_node_create (CLUTTER_TYPE_ROOT_NODE);
cogl_color_init_from_4f (&res->clear_color,
clear_color->red / 255.0,
clear_color->green / 255.0,
clear_color->blue / 255.0,
clear_color->alpha / 255.0);
res->clear_color = *cogl_color_copy (clear_color);
cogl_color_premultiply (&res->clear_color);
res->framebuffer = g_object_ref (framebuffer);
@ -555,7 +551,7 @@ clutter_color_node_init (ClutterColorNode *cnode)
* clutter_paint_node_unref() when done
*/
ClutterPaintNode *
clutter_color_node_new (const ClutterColor *color)
clutter_color_node_new (const CoglColor *color)
{
ClutterPipelineNode *cnode;
@ -563,16 +559,11 @@ clutter_color_node_new (const ClutterColor *color)
if (color != NULL)
{
CoglColor cogl_color;
CoglColor pipeline_color;
cogl_color_init_from_4f (&cogl_color,
color->red / 255.0,
color->green / 255.0,
color->blue / 255.0,
color->alpha / 255.0);
cogl_color_premultiply (&cogl_color);
cogl_pipeline_set_color (cnode->pipeline, &cogl_color);
pipeline_color = *cogl_color_copy (color);
cogl_color_premultiply (&pipeline_color);
cogl_pipeline_set_color (cnode->pipeline, &pipeline_color);
}
return (ClutterPaintNode *) cnode;
@ -636,7 +627,7 @@ clutter_scaling_filter_to_cogl_pipeline_filter (ClutterScalingFilter filter)
/**
* clutter_texture_node_new:
* @texture: a #CoglTexture
* @color: (allow-none): a #ClutterColor used for blending, or %NULL
* @color: (allow-none): a #CoglColor used for blending, or %NULL
* @min_filter: the minification filter for the texture
* @mag_filter: the magnification filter for the texture
*
@ -645,7 +636,7 @@ clutter_scaling_filter_to_cogl_pipeline_filter (ClutterScalingFilter filter)
* This function will take a reference on @texture, so it is safe to
* call g_object_unref() on @texture when it returns.
*
* The @color must not be pre-multiplied with its #ClutterColor.alpha
* The @color must not be pre-multiplied with its #CoglColor.alpha
* channel value; if @color is %NULL, a fully opaque white color will
* be used for blending.
*
@ -654,12 +645,12 @@ clutter_scaling_filter_to_cogl_pipeline_filter (ClutterScalingFilter filter)
*/
ClutterPaintNode *
clutter_texture_node_new (CoglTexture *texture,
const ClutterColor *color,
const CoglColor *color,
ClutterScalingFilter min_filter,
ClutterScalingFilter mag_filter)
{
ClutterPipelineNode *tnode;
CoglColor cogl_color;
CoglColor pipeline_color;
CoglPipelineFilter min_f, mag_f;
g_return_val_if_fail (COGL_IS_TEXTURE (texture), NULL);
@ -674,17 +665,13 @@ clutter_texture_node_new (CoglTexture *texture,
if (color != NULL)
{
cogl_color_init_from_4f (&cogl_color,
color->red / 255.0,
color->green / 255.0,
color->blue / 255.0,
color->alpha / 255.0);
cogl_color_premultiply (&cogl_color);
pipeline_color = *cogl_color_copy (color);
cogl_color_premultiply (&pipeline_color);
}
else
cogl_color_init_from_4f (&cogl_color, 1.0, 1.0, 1.0, 1.0);
cogl_color_init_from_4f (&pipeline_color, 1.0, 1.0, 1.0, 1.0);
cogl_pipeline_set_color (tnode->pipeline, &cogl_color);
cogl_pipeline_set_color (tnode->pipeline, &pipeline_color);
return (ClutterPaintNode *) tnode;
}
@ -829,8 +816,8 @@ clutter_text_node_init (ClutterTextNode *self)
* Use clutter_paint_node_unref() when done
*/
ClutterPaintNode *
clutter_text_node_new (PangoLayout *layout,
const ClutterColor *color)
clutter_text_node_new (PangoLayout *layout,
const CoglColor *color)
{
ClutterTextNode *res;
@ -842,13 +829,7 @@ clutter_text_node_new (PangoLayout *layout,
res->layout = g_object_ref (layout);
if (color != NULL)
{
cogl_color_init_from_4f (&res->color,
color->red / 255.0,
color->green / 255.0,
color->blue / 255.0,
color->alpha / 255.0);
}
res->color = *cogl_color_copy (color);
return (ClutterPaintNode *) res;
}

View File

@ -44,7 +44,7 @@ CLUTTER_EXPORT
GType clutter_color_node_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterPaintNode * clutter_color_node_new (const ClutterColor *color);
ClutterPaintNode * clutter_color_node_new (const CoglColor *color);
#define CLUTTER_TYPE_TEXTURE_NODE (clutter_texture_node_get_type ())
#define CLUTTER_TEXTURE_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_TEXTURE_NODE, ClutterTextureNode))
@ -58,7 +58,7 @@ GType clutter_texture_node_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterPaintNode * clutter_texture_node_new (CoglTexture *texture,
const ClutterColor *color,
const CoglColor *color,
ClutterScalingFilter min_filter,
ClutterScalingFilter mag_filter);
@ -100,7 +100,7 @@ GType clutter_text_node_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterPaintNode * clutter_text_node_new (PangoLayout *layout,
const ClutterColor *color);
const CoglColor *color);
#define CLUTTER_TYPE_ACTOR_NODE (clutter_actor_node_get_type ())
#define CLUTTER_ACTOR_NODE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ACTOR_NODE, ClutterActorNode))
@ -128,7 +128,7 @@ GType clutter_root_node_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
ClutterPaintNode * clutter_root_node_new (CoglFramebuffer *framebuffer,
const ClutterColor *clear_color,
const CoglColor *clear_color,
CoglBufferBit clear_flags);
#define CLUTTER_TYPE_LAYER_NODE (clutter_layer_node_get_type ())

View File

@ -93,7 +93,7 @@
* // uniform vec3 component;
* //
* // and it's defined to contain the normalized components
* // of a #ClutterColor
* // of a #CoglColor
* component_r = self->color.red / 255.0f;
* component_g = self->color.green / 255.0f;
* component_b = self->color.blue / 255.0f;

View File

@ -173,7 +173,7 @@ enum
static guint stage_signals[LAST_SIGNAL] = { 0, };
static const ClutterColor default_stage_color = { 255, 255, 255, 255 };
static const CoglColor default_stage_color = { 255, 255, 255, 255 };
static void free_pointer_device_entry (PointerDeviceEntry *entry);
static void free_event_receiver (EventReceiver *receiver);
@ -406,7 +406,7 @@ clutter_stage_do_paint_view (ClutterStage *stage,
graphene_frustum_t clip_frustum;
ClutterPaintNode *root_node;
CoglFramebuffer *fb;
ClutterColor bg_color;
CoglColor bg_color;
int n_rectangles;
ClutterPaintFlag paint_flags;
@ -1267,7 +1267,7 @@ clutter_stage_paint (ClutterActor *actor,
pango_layout_get_pixel_extents (layout, NULL, &logical);
node = clutter_text_node_new (layout,
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_COLOR_INIT (255, 255, 255, 255));
box.x1 = view_layout.x;
box.y1 = view_layout.y + 30;

View File

@ -24,7 +24,7 @@
/**
* ClutterText:
*
*
* An actor for displaying and editing text
*
* #ClutterText is an actor that displays custom text using Pango
@ -48,7 +48,6 @@
#include "clutter/clutter-animatable.h"
#include "clutter/clutter-backend-private.h"
#include "clutter/clutter-binding-pool.h"
#include "clutter/clutter-color.h"
#include "clutter/clutter-debug.h"
#include "clutter/clutter-enum-types.h"
#include "clutter/clutter-keysyms.h"
@ -111,7 +110,7 @@ typedef struct _ClutterTextPrivate
gchar *preedit_str;
ClutterColor text_color;
CoglColor text_color;
LayoutCache cached_layouts[N_CACHED_LAYOUTS];
guint cache_age;
@ -155,7 +154,7 @@ typedef struct _ClutterTextPrivate
/* Where to draw the cursor */
graphene_rect_t cursor_rect;
ClutterColor cursor_color;
CoglColor cursor_color;
guint cursor_size;
/* Box representing the paint volume. The box is lazily calculated
@ -165,9 +164,9 @@ typedef struct _ClutterTextPrivate
guint preedit_cursor_pos;
gint preedit_n_chars;
ClutterColor selection_color;
CoglColor selection_color;
ClutterColor selected_text_color;
CoglColor selected_text_color;
gunichar password_char;
@ -274,10 +273,10 @@ static void buffer_connect_signals (ClutterText *self);
static void buffer_disconnect_signals (ClutterText *self);
static ClutterTextBuffer *get_buffer (ClutterText *self);
static const ClutterColor default_cursor_color = { 0, 0, 0, 255 };
static const ClutterColor default_selection_color = { 0, 0, 0, 255 };
static const ClutterColor default_text_color = { 0, 0, 0, 255 };
static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
static const CoglColor default_cursor_color = { 0, 0, 0, 255 };
static const CoglColor default_selection_color = { 0, 0, 0, 255 };
static const CoglColor default_text_color = { 0, 0, 0, 255 };
static const CoglColor default_selected_text_color = { 0, 0, 0, 255 };
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
@ -1496,7 +1495,7 @@ clutter_text_set_property (GObject *gobject,
break;
case PROP_COLOR:
clutter_text_set_color (self, clutter_value_get_color (value));
clutter_text_set_color (self, cogl_value_get_color (value));
break;
case PROP_FONT_NAME:
@ -1584,7 +1583,7 @@ clutter_text_set_property (GObject *gobject,
break;
case PROP_SELECTED_TEXT_COLOR:
clutter_text_set_selected_text_color (self, clutter_value_get_color (value));
clutter_text_set_selected_text_color (self, cogl_value_get_color (value));
break;
case PROP_INPUT_PURPOSE:
@ -1632,7 +1631,7 @@ clutter_text_get_property (GObject *gobject,
break;
case PROP_COLOR:
clutter_value_set_color (value, &priv->text_color);
cogl_value_set_color (value, &priv->text_color);
break;
case PROP_CURSOR_VISIBLE:
@ -1640,7 +1639,7 @@ clutter_text_get_property (GObject *gobject,
break;
case PROP_CURSOR_COLOR:
clutter_value_set_color (value, &priv->cursor_color);
cogl_value_set_color (value, &priv->cursor_color);
break;
case PROP_CURSOR_COLOR_SET:
@ -1668,7 +1667,7 @@ clutter_text_get_property (GObject *gobject,
break;
case PROP_SELECTION_COLOR:
clutter_value_set_color (value, &priv->selection_color);
cogl_value_set_color (value, &priv->selection_color);
break;
case PROP_SELECTION_COLOR_SET:
@ -1716,7 +1715,7 @@ clutter_text_get_property (GObject *gobject,
break;
case PROP_SELECTED_TEXT_COLOR:
clutter_value_set_color (value, &priv->selected_text_color);
cogl_value_set_color (value, &priv->selected_text_color);
break;
case PROP_SELECTED_TEXT_COLOR_SET:
@ -1915,7 +1914,7 @@ paint_selection_rectangle (ClutterText *self,
CoglPipeline *color_pipeline = create_color_pipeline ();
PangoLayout *layout = clutter_text_get_layout (self);
CoglColor cogl_color = { 0, };
const ClutterColor *color;
const CoglColor *color;
/* Paint selection background */
if (priv->selection_color_set)
@ -1965,7 +1964,7 @@ selection_paint (ClutterText *self,
ClutterTextPrivate *priv = clutter_text_get_instance_private (self);
ClutterActor *actor = CLUTTER_ACTOR (self);
guint8 paint_opacity = clutter_actor_get_paint_opacity (actor);
const ClutterColor *color;
const CoglColor *color;
if (!clutter_text_should_draw_cursor (self))
return;
@ -3571,9 +3570,9 @@ clutter_text_add_move_binding (ClutterBindingPool *pool,
}
static void
clutter_text_set_color_internal (ClutterText *self,
GParamSpec *pspec,
const ClutterColor *color)
clutter_text_set_color_internal (ClutterText *self,
GParamSpec *pspec,
const CoglColor *color)
{
ClutterTextPrivate *priv =
clutter_text_get_instance_private (self);
@ -3634,9 +3633,9 @@ clutter_text_set_color_internal (ClutterText *self,
}
static void
clutter_text_set_color_animated (ClutterText *self,
GParamSpec *pspec,
const ClutterColor *color)
clutter_text_set_color_animated (ClutterText *self,
GParamSpec *pspec,
const CoglColor *color)
{
ClutterActor *actor = CLUTTER_ACTOR (self);
ClutterTextPrivate *priv = clutter_text_get_instance_private (self);
@ -3685,22 +3684,22 @@ clutter_text_set_color_animated (ClutterText *self,
switch (pspec->param_id)
{
case PROP_COLOR:
clutter_transition_set_from (transition, CLUTTER_TYPE_COLOR,
clutter_transition_set_from (transition, COGL_TYPE_COLOR,
&priv->text_color);
break;
case PROP_CURSOR_COLOR:
clutter_transition_set_from (transition, CLUTTER_TYPE_COLOR,
clutter_transition_set_from (transition, COGL_TYPE_COLOR,
&priv->cursor_color);
break;
case PROP_SELECTION_COLOR:
clutter_transition_set_from (transition, CLUTTER_TYPE_COLOR,
clutter_transition_set_from (transition, COGL_TYPE_COLOR,
&priv->selection_color);
break;
case PROP_SELECTED_TEXT_COLOR:
clutter_transition_set_from (transition, CLUTTER_TYPE_COLOR,
clutter_transition_set_from (transition, COGL_TYPE_COLOR,
&priv->selected_text_color);
break;
@ -3708,7 +3707,7 @@ clutter_text_set_color_animated (ClutterText *self,
g_assert_not_reached ();
}
clutter_transition_set_to (transition, CLUTTER_TYPE_COLOR, color);
clutter_transition_set_to (transition, COGL_TYPE_COLOR, color);
/* always use the current easing state */
clutter_timeline_set_duration (CLUTTER_TIMELINE (transition),
@ -3728,27 +3727,27 @@ clutter_text_set_final_state (ClutterAnimatable *animatable,
{
if (strcmp (property_name, "color") == 0)
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_text_set_color_internal (CLUTTER_TEXT (animatable),
obj_props[PROP_COLOR], color);
}
else if (strcmp (property_name, "cursor-color") == 0)
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_text_set_color_internal (CLUTTER_TEXT (animatable),
obj_props[PROP_CURSOR_COLOR],
color);
}
else if (strcmp (property_name, "selected-text-color") == 0)
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_text_set_color_internal (CLUTTER_TEXT (animatable),
obj_props[PROP_SELECTED_TEXT_COLOR],
color);
}
else if (strcmp (property_name, "selection-color") == 0)
{
const ClutterColor *color = clutter_value_get_color (value);
const CoglColor *color = cogl_value_get_color (value);
clutter_text_set_color_internal (CLUTTER_TEXT (animatable),
obj_props[PROP_SELECTION_COLOR],
color);
@ -3859,11 +3858,11 @@ clutter_text_class_init (ClutterTextClass *klass)
*
* The color used to render the text.
*/
pspec = clutter_param_spec_color ("color", NULL, NULL,
&default_text_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
pspec = cogl_param_spec_color ("color", NULL, NULL,
&default_text_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
obj_props[PROP_COLOR] = pspec;
g_object_class_install_property (gobject_class, PROP_COLOR, pspec);
@ -3925,11 +3924,11 @@ clutter_text_class_init (ClutterTextClass *klass)
*
* The color of the cursor.
*/
pspec = clutter_param_spec_color ("cursor-color", NULL, NULL,
&default_cursor_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
pspec = cogl_param_spec_color ("cursor-color", NULL, NULL,
&default_cursor_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
obj_props[PROP_CURSOR_COLOR] = pspec;
g_object_class_install_property (gobject_class, PROP_CURSOR_COLOR, pspec);
@ -3989,11 +3988,11 @@ clutter_text_class_init (ClutterTextClass *klass)
*
* The color of the selection.
*/
pspec = clutter_param_spec_color ("selection-color", NULL, NULL,
&default_selection_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
pspec = cogl_param_spec_color ("selection-color", NULL, NULL,
&default_selection_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
obj_props[PROP_SELECTION_COLOR] = pspec;
g_object_class_install_property (gobject_class, PROP_SELECTION_COLOR, pspec);
@ -4161,11 +4160,11 @@ clutter_text_class_init (ClutterTextClass *klass)
*
* The color of selected text.
*/
pspec = clutter_param_spec_color ("selected-text-color", NULL, NULL,
&default_selected_text_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
pspec = cogl_param_spec_color ("selected-text-color", NULL, NULL,
&default_selected_text_color,
G_PARAM_READWRITE |
G_PARAM_STATIC_STRINGS |
CLUTTER_PARAM_ANIMATABLE);
obj_props[PROP_SELECTED_TEXT_COLOR] = pspec;
g_object_class_install_property (gobject_class, PROP_SELECTED_TEXT_COLOR, pspec);
@ -4495,9 +4494,9 @@ clutter_text_new (void)
* Return value: the newly created #ClutterText actor
*/
ClutterActor *
clutter_text_new_full (const gchar *font_name,
const gchar *text,
const ClutterColor *color)
clutter_text_new_full (const gchar *font_name,
const gchar *text,
const CoglColor *color)
{
return g_object_new (CLUTTER_TYPE_TEXT,
"font-name", font_name,
@ -5010,8 +5009,8 @@ clutter_text_get_cursor_visible (ClutterText *self)
* text color.
*/
void
clutter_text_set_cursor_color (ClutterText *self,
const ClutterColor *color)
clutter_text_set_cursor_color (ClutterText *self,
const CoglColor *color)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
@ -5021,13 +5020,13 @@ clutter_text_set_cursor_color (ClutterText *self,
/**
* clutter_text_get_cursor_color:
* @self: a #ClutterText
* @color: (out): return location for a #ClutterColor
* @color: (out): return location for a #CoglColor
*
* Retrieves the color of the cursor of a #ClutterText actor.
*/
void
clutter_text_get_cursor_color (ClutterText *self,
ClutterColor *color)
clutter_text_get_cursor_color (ClutterText *self,
CoglColor *color)
{
ClutterTextPrivate *priv;
@ -5185,8 +5184,8 @@ clutter_text_get_selection_bound (ClutterText *self)
* the same as the text color.
*/
void
clutter_text_set_selection_color (ClutterText *self,
const ClutterColor *color)
clutter_text_set_selection_color (ClutterText *self,
const CoglColor *color)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
@ -5197,13 +5196,13 @@ clutter_text_set_selection_color (ClutterText *self,
/**
* clutter_text_get_selection_color:
* @self: a #ClutterText
* @color: (out caller-allocates): return location for a #ClutterColor
* @color: (out caller-allocates): return location for a #CoglColor
*
* Retrieves the color of the selection of a #ClutterText actor.
*/
void
clutter_text_get_selection_color (ClutterText *self,
ClutterColor *color)
CoglColor *color)
{
ClutterTextPrivate *priv;
@ -5226,8 +5225,8 @@ clutter_text_get_selection_color (ClutterText *self,
* selection color, which then falls back to cursor, and then text color.
*/
void
clutter_text_set_selected_text_color (ClutterText *self,
const ClutterColor *color)
clutter_text_set_selected_text_color (ClutterText *self,
const CoglColor *color)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
@ -5238,13 +5237,13 @@ clutter_text_set_selected_text_color (ClutterText *self,
/**
* clutter_text_get_selected_text_color:
* @self: a #ClutterText
* @color: (out caller-allocates): return location for a [struct@Color]
* @color: (out caller-allocates): return location for a [struct@Cogl.Color]
*
* Retrieves the color of selected text of a #ClutterText actor.
*/
void
clutter_text_get_selected_text_color (ClutterText *self,
ClutterColor *color)
clutter_text_get_selected_text_color (ClutterText *self,
CoglColor *color)
{
ClutterTextPrivate *priv;
@ -5557,7 +5556,7 @@ clutter_text_get_layout (ClutterText *self)
/**
* clutter_text_set_color:
* @self: a #ClutterText
* @color: a #ClutterColor
* @color: a #CoglColor
*
* Sets the color of the contents of a #ClutterText actor.
*
@ -5567,8 +5566,8 @@ clutter_text_get_layout (ClutterText *self)
* by [method@Actor.get_paint_opacity].
*/
void
clutter_text_set_color (ClutterText *self,
const ClutterColor *color)
clutter_text_set_color (ClutterText *self,
const CoglColor *color)
{
g_return_if_fail (CLUTTER_IS_TEXT (self));
g_return_if_fail (color != NULL);
@ -5579,13 +5578,13 @@ clutter_text_set_color (ClutterText *self,
/**
* clutter_text_get_color:
* @self: a #ClutterText
* @color: (out caller-allocates): return location for a [struct@Color]
* @color: (out caller-allocates): return location for a [struct@Cogl.Color]
*
* Retrieves the text color as set by [method@Text.set_color].
*/
void
clutter_text_get_color (ClutterText *self,
ClutterColor *color)
CoglColor *color)
{
ClutterTextPrivate *priv;

View File

@ -67,7 +67,7 @@ ClutterActor * clutter_text_new (void);
CLUTTER_EXPORT
ClutterActor * clutter_text_new_full (const gchar *font_name,
const gchar *text,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
ClutterActor * clutter_text_new_with_text (const gchar *font_name,
const gchar *text);
@ -88,10 +88,10 @@ void clutter_text_set_markup (ClutterText *s
const gchar *markup);
CLUTTER_EXPORT
void clutter_text_set_color (ClutterText *self,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
void clutter_text_get_color (ClutterText *self,
ClutterColor *color);
CoglColor *color);
CLUTTER_EXPORT
void clutter_text_set_font_name (ClutterText *self,
const gchar *font_name);
@ -182,10 +182,10 @@ CLUTTER_EXPORT
gboolean clutter_text_get_cursor_visible (ClutterText *self);
CLUTTER_EXPORT
void clutter_text_set_cursor_color (ClutterText *self,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
void clutter_text_get_cursor_color (ClutterText *self,
ClutterColor *color);
CoglColor *color);
CLUTTER_EXPORT
void clutter_text_set_cursor_size (ClutterText *self,
gint size);
@ -212,10 +212,10 @@ CLUTTER_EXPORT
gchar * clutter_text_get_selection (ClutterText *self);
CLUTTER_EXPORT
void clutter_text_set_selection_color (ClutterText *self,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
void clutter_text_get_selection_color (ClutterText *self,
ClutterColor *color);
CoglColor *color);
CLUTTER_EXPORT
gboolean clutter_text_delete_selection (ClutterText *self);
CLUTTER_EXPORT
@ -236,10 +236,10 @@ gboolean clutter_text_get_single_line_mode (ClutterText *s
CLUTTER_EXPORT
void clutter_text_set_selected_text_color (ClutterText *self,
const ClutterColor *color);
const CoglColor *color);
CLUTTER_EXPORT
void clutter_text_get_selected_text_color (ClutterText *self,
ClutterColor *color);
CoglColor *color);
CLUTTER_EXPORT
gboolean clutter_text_activate (ClutterText *self);

View File

@ -1331,7 +1331,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_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (flash, &COGL_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);
@ -1370,7 +1370,7 @@ meta_compositor_flash_window (MetaCompositor *compositor,
ClutterTransition *transition;
flash = clutter_actor_new ();
clutter_actor_set_background_color (flash, &CLUTTER_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (flash, &COGL_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,

View File

@ -58,8 +58,8 @@ struct _MetaBackground
GDesktopBackgroundStyle style;
GDesktopBackgroundShading shading_direction;
ClutterColor color;
ClutterColor second_color;
CoglColor color;
CoglColor second_color;
GFile *file1;
MetaBackgroundImage *background_image1;
@ -945,9 +945,9 @@ meta_background_new (MetaDisplay *display)
void
meta_background_set_color (MetaBackground *self,
ClutterColor *color)
CoglColor *color)
{
ClutterColor dummy = { 0 };
CoglColor dummy = { 0 };
g_return_if_fail (META_IS_BACKGROUND (self));
g_return_if_fail (color != NULL);
@ -960,8 +960,8 @@ meta_background_set_color (MetaBackground *self,
void
meta_background_set_gradient (MetaBackground *self,
GDesktopBackgroundShading shading_direction,
ClutterColor *color,
ClutterColor *second_color)
CoglColor *color,
CoglColor *second_color)
{
g_return_if_fail (META_IS_BACKGROUND (self));
g_return_if_fail (color != NULL);

View File

@ -599,7 +599,7 @@ do_sync_geometry (MetaWindowActorWayland *self)
{
self->background = clutter_actor_new ();
clutter_actor_set_background_color (self->background,
&CLUTTER_COLOR_INIT (0, 0, 0, 255));
&COGL_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_reactive (self->background, TRUE);
clutter_actor_insert_child_below (CLUTTER_ACTOR (self),
self->background,

View File

@ -350,7 +350,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
background = meta_background_new (display);
meta_background_set_color (background,
&CLUTTER_COLOR_INIT (red, green, blue, 255));
&COGL_COLOR_INIT (red, green, blue, 255));
meta_background_content_set_background (background_content, background);
g_object_unref (background);
@ -824,7 +824,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_INIT (0, 0, 255, 255));
clutter_actor_set_background_color (preview->actor, &COGL_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);

View File

@ -51,13 +51,13 @@ MetaBackground *meta_background_new (MetaDisplay *display);
META_EXPORT
void meta_background_set_color (MetaBackground *self,
ClutterColor *color);
CoglColor *color);
META_EXPORT
void meta_background_set_gradient (MetaBackground *self,
GDesktopBackgroundShading shading_direction,
ClutterColor *color,
ClutterColor *second_color);
CoglColor *color,
CoglColor *second_color);
META_EXPORT
void meta_background_set_file (MetaBackground *self,

View File

@ -44,22 +44,22 @@ main (int argc, char *argv[])
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkComponent Test");
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_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_INIT (255, 255, 0, 255));
clutter_actor_set_background_color (button1, &COGL_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_INIT (0, 255, 0, 255));
clutter_actor_set_background_color (button2, &COGL_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_INIT (0, 0, 255, 255));
clutter_actor_set_background_color (button3, &COGL_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);
@ -67,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_INIT (255, 0, 255, 255));
clutter_actor_set_background_color (button4, &COGL_COLOR_INIT (255, 0, 255, 255));
clutter_actor_set_position (button4, SIZE / 2, SIZE / 2);
clutter_actor_set_size (button4, SIZE, SIZE);

View File

@ -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_INIT (255, 0, 255, 255));
clutter_actor_set_background_color (rectangle, &COGL_COLOR_INIT (255, 0, 255, 255));
clutter_actor_set_size (rectangle, 375, 35);
label = clutter_text_new_full ("Sans Bold 32px",
text,
&CLUTTER_COLOR_INIT (0, 0, 0, 255));
&COGL_COLOR_INIT (0, 0, 0, 255));
clutter_actor_add_child (button, rectangle);
clutter_actor_add_child (button, label);
clutter_actor_set_reactive (button, TRUE);
@ -169,24 +169,24 @@ make_ui (ClutterActor *stage)
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cally - AtkEditable Test");
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_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_INIT (255, 0, 0, 255));
&COGL_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_INIT (255, 0, 0, 255));
&COGL_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_INIT (0, 255, 0, 255));
&COGL_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);

View File

@ -86,13 +86,13 @@ make_ui (ClutterActor *stage)
ClutterActor *editable = NULL;
ClutterActor *rectangle = NULL;
ClutterActor *label = NULL;
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterColor color_label = { 0x00, 0xff, 0x55, 0xff };
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
CoglColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
CoglColor color_label = { 0x00, 0xff, 0x55, 0xff };
CoglColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
float label_geom_y, editable_geom_y;
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_COLOR_INIT (255, 255, 255, 255));
clutter_actor_set_size (stage, WIDTH, HEIGHT);
label_geom_y = 50;
@ -109,7 +109,7 @@ make_ui (ClutterActor *stage)
/* editable */
editable = clutter_text_new_full ("Sans Bold 32px",
"ddd",
&CLUTTER_COLOR_INIT (255, 0, 0, 255));
&COGL_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);

View File

@ -169,11 +169,11 @@ button_press_cb (ClutterActor *actor,
static void
make_ui (ClutterActor *stage)
{
ClutterColor color_stage = { 0x00, 0x00, 0x00, 0xff };
ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff };
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0xff };
ClutterColor color_label = { 0x00, 0x00, 0x00, 0xff };
CoglColor color_stage = { 0x00, 0x00, 0x00, 0xff };
CoglColor color_text = { 0xff, 0x00, 0x00, 0xff };
CoglColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
CoglColor color_rect = { 0x00, 0xff, 0xff, 0xff };
CoglColor color_label = { 0x00, 0x00, 0x00, 0xff };
ClutterActor *button = NULL;
ClutterActor *rectangle = NULL;
ClutterActor *label = NULL;

View File

@ -34,11 +34,11 @@ make_ui (ClutterActor *stage)
ClutterActor *editable = NULL;
ClutterActor *rectangle = NULL;
ClutterActor *label = NULL;
ClutterColor color_stage = { 0x00, 0x00, 0x00, 0xff };
ClutterColor color_text = { 0xff, 0x00, 0x00, 0xff };
ClutterColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
ClutterColor color_label = { 0x00, 0xff, 0x55, 0xff };
ClutterColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
CoglColor color_stage = { 0x00, 0x00, 0x00, 0xff };
CoglColor color_text = { 0xff, 0x00, 0x00, 0xff };
CoglColor color_sel = { 0x00, 0xff, 0x00, 0x55 };
CoglColor color_label = { 0x00, 0xff, 0x55, 0xff };
CoglColor color_rect = { 0x00, 0xff, 0xff, 0x55 };
ClutterActor *full_entry = NULL;
ClutterActor *cloned_entry = NULL;

View File

@ -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_INIT (255, 0, 0, 255));
clutter_actor_set_background_color (flower[0], &COGL_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_INIT (255, 255, 0, 255));
clutter_actor_set_background_color (flower[1], &COGL_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_INIT (0, 255, 0, 255));
clutter_actor_set_background_color (flower[2], &COGL_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_INIT (255, 0, 0, 255));
clutter_actor_set_background_color (flower[0], &COGL_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_INIT (255, 255, 0, 255));
clutter_actor_set_background_color (flower[1], &COGL_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_INIT (0, 255, 0, 255));
clutter_actor_set_background_color (flower[2], &COGL_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);

View File

@ -415,7 +415,7 @@ actor_offscreen_redirect (void)
data.stage = clutter_test_get_stage ();
data.parent_container = clutter_actor_new ();
clutter_actor_set_background_color (data.parent_container,
&(ClutterColor) { 255, 255, 255, 255 });
&(CoglColor) { 255, 255, 255, 255 });
data.container = g_object_new (foo_group_get_type (), NULL);
data.foo_actor = g_object_new (foo_actor_get_type (), NULL);

View File

@ -8,8 +8,8 @@ opacity_label (void)
{
ClutterActor *stage;
ClutterActor *label;
ClutterColor label_color = { 255, 0, 0, 128 };
ClutterColor color_check = { 0, };
CoglColor label_color = { 255, 0, 0, 128 };
CoglColor color_check = { 0, };
stage = clutter_test_get_stage ();
@ -47,8 +47,8 @@ opacity_rectangle (void)
{
ClutterActor *stage;
ClutterActor *rect;
ClutterColor rect_color = { 0, 0, 255, 255 };
ClutterColor color_check = { 0, };
CoglColor rect_color = { 0, 0, 255, 255 };
CoglColor color_check = { 0, };
stage = clutter_test_get_stage ();
@ -83,9 +83,9 @@ opacity_paint (void)
{
ClutterActor *stage, *group1, *group2;
ClutterActor *label, *rect;
ClutterColor label_color = { 255, 0, 0, 128 };
ClutterColor rect_color = { 0, 0, 255, 255 };
ClutterColor color_check = { 0, };
CoglColor label_color = { 255, 0, 0, 128 };
CoglColor rect_color = { 0, 0, 255, 255 };
CoglColor color_check = { 0, };
stage = clutter_test_get_stage ();

View File

@ -54,7 +54,7 @@ on_timeout (gpointer data)
}
if (test_num == 1)
{
static const ClutterColor red = { 0xff, 0x00, 0x00, 0xff };
static const CoglColor red = { 0xff, 0x00, 0x00, 0xff };
/* Create an actor that covers the whole stage but that
isn't visible so it shouldn't affect the picking */
over_actor = clutter_actor_new ();
@ -182,7 +182,7 @@ actor_pick (void)
for (y = 0; y < ACTORS_Y; y++)
for (x = 0; x < ACTORS_X; x++)
{
ClutterColor color = { x * 255 / (ACTORS_X - 1),
CoglColor color = { x * 255 / (ACTORS_X - 1),
y * 255 / (ACTORS_Y - 1),
128, 255 };
ClutterActor *rect = clutter_actor_new ();

View File

@ -201,7 +201,7 @@ static ClutterActor *
make_actor (GType shader_type)
{
ClutterActor *rect;
const ClutterColor white = { 0xff, 0xff, 0xff, 0xff };
const CoglColor white = { 0xff, 0xff, 0xff, 0xff };
rect = clutter_actor_new ();
clutter_actor_set_background_color (rect, &white);

View File

@ -133,7 +133,7 @@ static gboolean
do_tests (CallbackData *data)
{
PangoFontDescription *fd;
static const ClutterColor red = { 0xff, 0x00, 0x00, 0xff };
static const CoglColor red = { 0xff, 0x00, 0x00, 0xff };
PangoAttrList *attr_list, *attr_list_copy;
PangoAttribute *attr;

View File

@ -9,7 +9,7 @@
#define DIVISION_WIDTH (SOURCE_SIZE / SOURCE_DIVISIONS_X)
#define DIVISION_HEIGHT (SOURCE_SIZE / SOURCE_DIVISIONS_Y)
static const ClutterColor
static const CoglColor
corner_colors[SOURCE_DIVISIONS_X * SOURCE_DIVISIONS_Y] =
{
{ 0xff, 0x00, 0x00, 0xff }, /* red top left */
@ -18,7 +18,7 @@ corner_colors[SOURCE_DIVISIONS_X * SOURCE_DIVISIONS_Y] =
{ 0xff, 0x00, 0xff, 0xff } /* purple bottom right */
};
static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static const CoglColor stage_color = { 0x0, 0x0, 0x0, 0xff };
typedef struct _TestState
{
@ -84,7 +84,7 @@ validate_part (TestState *state,
for (x = 0; x < SOURCE_DIVISIONS_X; x++)
{
guchar *pixels;
const ClutterColor *correct_color;
const CoglColor *correct_color;
/* Read the center pixels of this division */
pixels = clutter_stage_read_pixels (CLUTTER_STAGE (state->stage),

View File

@ -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_INIT (114, 159, 207, 255));
clutter_actor_set_background_color (oh->stage, &COGL_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");

View File

@ -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;
ClutterColor new_color;
CoglColor new_color;
guint8 new_opacity;
clutter_actor_get_position (actor, &old_x, &old_y);
@ -47,7 +47,7 @@ on_clicked (ClutterClickAction *action,
new_height = old_height + 200;
new_angle = 360.0;
new_color = CLUTTER_COLOR_INIT (164, 0, 0, 255);
new_color = COGL_COLOR_INIT (164, 0, 0, 255);
new_opacity = 255;
}
else
@ -58,7 +58,7 @@ on_clicked (ClutterClickAction *action,
new_height = old_height - 200;
new_angle = 0.0;
new_color = CLUTTER_COLOR_INIT (206, 92, 0, 255);
new_color = COGL_COLOR_INIT (206, 92, 0, 255);
new_opacity = 128;
}
@ -93,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_INIT (114, 159, 207, 255));
clutter_actor_set_background_color (stage, &COGL_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_INIT (252, 175, 62, 255));
clutter_actor_set_background_color (rect, &COGL_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);

View File

@ -174,7 +174,7 @@ test_bind_constraint_main (int argc, char *argv[])
ClutterActor *stage, *rect;
ClutterConstraint *constraint;
ClutterEffect *effect;
ClutterColor rect_color;
CoglColor rect_color;
gint i;
clutter_test_init (&argc, &argv);
@ -185,7 +185,7 @@ test_bind_constraint_main (int argc, char *argv[])
clutter_actor_set_size (stage, 800, 600);
/* main rectangle */
clutter_color_from_string (&rect_color, "#3465a4");
cogl_color_from_string (&rect_color, "#3465a4");
rect = clutter_actor_new ();
g_signal_connect (rect, "button-release-event",
G_CALLBACK (on_button_release),
@ -226,7 +226,7 @@ test_bind_constraint_main (int argc, char *argv[])
if (i == Center)
continue;
clutter_color_from_string (&rect_color, colors[i]);
cogl_color_from_string (&rect_color, colors[i]);
rect = clutter_actor_new ();
clutter_actor_set_background_color (rect, &rect_color);

View File

@ -273,7 +273,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_INIT (255, 0, 0, 255),
"background-color", &COGL_COLOR_INIT (255, 0, 0, 255),
"name", "Red Rectangle",
"width", 100.0,
"height", 100.0,
@ -282,7 +282,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_INIT (0, 255, 0, 255),
"background-color", &COGL_COLOR_INIT (0, 255, 0, 255),
"name", "Green Rectangle",
"width", 100.0,
"height", 100.0,
@ -291,7 +291,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_INIT (0, 0, 255, 255),
"background-color", &COGL_COLOR_INIT (0, 0, 255, 255),
"name", "Blue Rectangle",
"width", 100.0,
"height", 100.0,

View File

@ -114,7 +114,7 @@ test_cogl_multitexture_main (int argc, char *argv[])
{
GError *error = NULL;
ClutterActor *stage;
ClutterColor stage_color = { 0x61, 0x56, 0x56, 0xff };
CoglColor stage_color = { 0x61, 0x56, 0x56, 0xff };
g_autofree TestMultiLayerPipelineState *state = g_new0 (TestMultiLayerPipelineState, 1);
gfloat stage_w, stage_h;
gchar **files;

View File

@ -22,7 +22,7 @@ struct _Firework
float size;
float x, y;
float start_x, start_y;
ClutterColor color;
CoglColor color;
/* Velocities are in units per second */
float initial_x_velocity;
@ -36,8 +36,8 @@ typedef struct _Spark Spark;
struct _Spark
{
float x, y;
ClutterColor color;
ClutterColor base_color;
CoglColor color;
CoglColor base_color;
};
typedef struct _Data Data;
@ -137,12 +137,12 @@ on_after_paint (ClutterActor *stage,
/* Pick a random color out of six */
if (g_random_boolean ())
{
memset (&firework->color, 0, sizeof (ClutterColor));
memset (&firework->color, 0, sizeof (CoglColor));
((guint8 *) &firework->color)[g_random_int_range (0, 3)] = 255;
}
else
{
memset (&firework->color, 255, sizeof (ClutterColor));
memset (&firework->color, 255, sizeof (CoglColor));
((guint8 *) &firework->color)[g_random_int_range (0, 3)] = 0;
}
firework->color.alpha = 255;
@ -262,7 +262,7 @@ test_cogl_point_sprites_main (int argc, char *argv[])
stage = clutter_test_get_stage ();
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
&CLUTTER_COLOR_INIT (0, 0, 0, 255));
&COGL_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);

View File

@ -313,7 +313,7 @@ test_cogl_shader_glsl_main (int argc, char *argv[])
ClutterActor *actor;
char *file;
GError *error;
ClutterColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
CoglColor stage_color = { 0x61, 0x64, 0x8c, 0xff };
CoglPipeline *shader_pipeline;
CoglContext *ctx =
clutter_backend_get_cogl_context (clutter_get_default_backend ());

View File

@ -340,7 +340,7 @@ test_cogl_tex_polygon_main (int argc, char *argv[])
ClutterActor *slicing_toggle;
ClutterActor *note;
ClutterTimeline *timeline;
ClutterColor blue = { 0x30, 0x30, 0xff, 0xff };
CoglColor blue = { 0x30, 0x30, 0xff, 0xff };
clutter_test_init (&argc, &argv);

View File

@ -41,7 +41,7 @@ color_content_paint_content (ClutterContent *content,
{
ColorContent *self = (ColorContent *) content;
ClutterActorBox box, content_box;
ClutterColor color;
CoglColor color;
PangoLayout *layout;
PangoRectangle logical;
ClutterPaintNode *node;
@ -206,7 +206,7 @@ test_content_main (int argc, char *argv[])
for (i = 0; i < n_rects; i++)
{
ClutterActor *box = clutter_actor_new ();
ClutterColor bg_color = {
CoglColor bg_color = {
g_random_int_range (0, 255),
g_random_int_range (0, 255),
g_random_int_range (0, 255),
@ -214,7 +214,7 @@ test_content_main (int argc, char *argv[])
};
char *name, *color;
color = clutter_color_to_string (&bg_color);
color = cogl_color_to_string (&bg_color);
name = g_strconcat ("Box <", color, ">", NULL);
clutter_actor_set_name (box, name);

View File

@ -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_INIT (114, 159, 207, 255));
clutter_actor_set_background_color (stage, &COGL_COLOR_INIT (114, 159, 207, 255));
clutter_stage_set_title (CLUTTER_STAGE (stage), "Devices");
g_signal_connect (stage,
"destroy", G_CALLBACK (clutter_test_quit),

View File

@ -389,16 +389,13 @@ 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_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (focus_box, &COGL_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_INIT (0, 255, 0, 255));
clutter_actor_set_background_color (actor, &COGL_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);
clutter_actor_set_reactive (actor, TRUE);
clutter_actor_add_child (stage, actor);
g_signal_connect (actor, "event", G_CALLBACK (input_cb), (char *) "green box");
g_signal_connect (actor, "key-focus-in", G_CALLBACK (key_focus_in_cb),
@ -409,7 +406,7 @@ test_events_main (int argc, char *argv[])
/* non reactive */
actor = clutter_actor_new ();
clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (actor, &COGL_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 +419,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_INIT (255, 255, 0, 255));
clutter_actor_set_background_color (actor, &COGL_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 +434,7 @@ test_events_main (int argc, char *argv[])
/* border actor */
actor = clutter_actor_new ();
clutter_actor_set_background_color (actor, &CLUTTER_COLOR_INIT (255, 0, 255, 255));
clutter_actor_set_background_color (actor, &COGL_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,

View File

@ -200,10 +200,10 @@ G_MODULE_EXPORT int
test_grab_main (int argc, char *argv[])
{
ClutterActor *stage, *actor;
ClutterColor rcol = { 0xff, 0, 0, 0xff},
bcol = { 0, 0, 0xff, 0xff },
ccol = { 0, 0xff, 0xff, 0xff },
ycol = { 0xff, 0xff, 0, 0xff };
CoglColor rcol = { 0xff, 0, 0, 0xff},
bcol = { 0, 0, 0xff, 0xff },
ccol = { 0, 0xff, 0xff, 0xff },
ycol = { 0xff, 0xff, 0, 0xff };
clutter_test_init (&argc, &argv);

View File

@ -42,7 +42,7 @@ solid_content_paint_content (ClutterContent *content,
{
SolidContent *self = (SolidContent *) content;
ClutterActorBox box, content_box;
ClutterColor color;
CoglColor color;
PangoLayout *layout;
PangoRectangle logical;
ClutterPaintNode *node;
@ -227,7 +227,7 @@ test_image_main (int argc, char *argv[])
for (i = 0; i < n_rects; i++)
{
ClutterActor *box = clutter_actor_new ();
ClutterColor bg_color = {
CoglColor bg_color = {
g_random_int_range (0, 255),
g_random_int_range (0, 255),
g_random_int_range (0, 255),
@ -235,7 +235,7 @@ test_image_main (int argc, char *argv[])
};
char *name, *str;
str = clutter_color_to_string (&bg_color);
str = cogl_color_to_string (&bg_color);
name = g_strconcat ("Box <", color, ">", NULL);
clutter_actor_set_name (box, name);

View File

@ -4,7 +4,7 @@
#include "tests/clutter-test-utils.h"
static const ClutterColor colors[] = {
static const CoglColor colors[] = {
{ 255, 0, 0, 255 },
{ 0, 255, 0, 255 },
{ 0, 0, 255, 255 },

View File

@ -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_INIT (186, 189, 182, 255));
clutter_actor_set_background_color (stage, &COGL_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_INIT (206, 92, 0, 255));
clutter_actor_set_background_color (rect, &COGL_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);

View File

@ -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_INIT (52, 101, 164, 255));
clutter_actor_set_background_color (rect, &COGL_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_INIT (237, 212, 0, 255));
clutter_actor_set_background_color (rect, &COGL_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);

View File

@ -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_INIT (255, 0, 0, 255));
clutter_actor_set_background_color (rect, &COGL_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_INIT (0, 0, 255, 255));
clutter_actor_set_background_color (rect, &COGL_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_INIT (0, 255, 0, 255));
clutter_actor_set_background_color (rect, &COGL_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);

View File

@ -198,8 +198,8 @@ on_captured_event (ClutterText *text,
}
static ClutterActor *
create_label (const ClutterColor *color,
const gchar *text)
create_label (const CoglColor *color,
const gchar *text)
{
ClutterActor *retval = clutter_text_new ();
@ -214,15 +214,15 @@ create_label (const ClutterColor *color,
}
static ClutterActor *
create_entry (const ClutterColor *color,
const gchar *text,
PangoAttrList *attrs,
gunichar password_char,
gint max_length)
create_entry (const CoglColor *color,
const gchar *text,
PangoAttrList *attrs,
gunichar password_char,
gint max_length)
{
ClutterActor *retval = clutter_text_new_full (NULL, text, color);
ClutterColor selection = { 0, };
ClutterColor selected_text = { 0x00, 0x00, 0xff, 0xff };
CoglColor selection = { 0, };
CoglColor selected_text = { 0x00, 0x00, 0xff, 0xff };
clutter_actor_set_reactive (retval, TRUE);
@ -234,7 +234,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_INIT (192, 192, 192, 255));
clutter_actor_set_background_color (retval, &COGL_COLOR_INIT (192, 192, 192, 255));
if (attrs)
clutter_text_set_attributes (CLUTTER_TEXT (retval), attrs);
@ -261,7 +261,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_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (stage, &COGL_COLOR_INIT (0, 0, 0, 255));
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_test_quit), NULL);
grid = clutter_grid_layout_new ();
@ -275,7 +275,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_INIT (255, 255, 255, 255), "<b>Input field:</b>");
label = create_label (&COGL_COLOR_INIT (255, 255, 255, 255), "<b>Input field:</b>");
g_object_set (label, "min-width", 150.0, NULL);
clutter_actor_add_child (box, label);
clutter_layout_manager_child_set (grid, box, label,
@ -288,7 +288,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_INIT (0, 0, 0, 255), "somme misspeeled textt", entry_attrs, 0, 0);
entry = create_entry (&COGL_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,
@ -299,7 +299,7 @@ test_text_field_main (gint argc,
NULL);
clutter_actor_grab_key_focus (entry);
label = create_label (&CLUTTER_COLOR_INIT (255, 255, 255, 255), "<b>A very long password field:</b>");
label = create_label (&COGL_COLOR_INIT (255, 255, 255, 255), "<b>A very long password field:</b>");
clutter_actor_add_child (box, label);
clutter_layout_manager_child_set (grid, box, label,
"row", 1,
@ -308,7 +308,7 @@ test_text_field_main (gint argc,
"y-expand", FALSE,
NULL);
entry = create_entry (&CLUTTER_COLOR_INIT (0, 0, 0, 255), "password", NULL, '*', 8);
entry = create_entry (&COGL_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,

View File

@ -25,15 +25,15 @@ test_text_main (gint argc,
{
ClutterActor *stage;
ClutterActor *text, *text2;
ClutterColor text_color = { 0x33, 0xff, 0x33, 0xff };
ClutterColor cursor_color = { 0xff, 0x33, 0x33, 0xff };
CoglColor text_color = { 0x33, 0xff, 0x33, 0xff };
CoglColor cursor_color = { 0xff, 0x33, 0x33, 0xff };
ClutterTextBuffer *buffer;
clutter_test_init (&argc, &argv);
stage = clutter_test_get_stage ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text Editing");
clutter_actor_set_background_color (stage, &CLUTTER_COLOR_INIT (0, 0, 0, 255));
clutter_actor_set_background_color (stage, &COGL_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_INIT (0, 0, 255, 255));
clutter_text_set_selected_text_color (CLUTTER_TEXT (text), &COGL_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_INIT (0, 255, 0, 255));
clutter_text_set_selected_text_color (CLUTTER_TEXT (text2), &COGL_COLOR_INIT (0, 255, 0, 255));
if (argv[1])
{

View File

@ -139,7 +139,7 @@ main (int argc, char *argv[])
clutter_actor_set_size (stage, STAGE_WIDTH, STAGE_HEIGHT);
clutter_actor_set_background_color (CLUTTER_ACTOR (stage),
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_COLOR_INIT (255, 255, 255, 255));
clutter_stage_set_title (CLUTTER_STAGE (stage), "Cogl Performance Test");
/* We want continuous redrawing of the stage... */

View File

@ -58,7 +58,7 @@ main (int argc, char **argv)
{
glong i;
gdouble angle;
ClutterColor color = { 0x00, 0x00, 0x00, 0xff };
CoglColor color = { 0x00, 0x00, 0x00, 0xff };
ClutterActor *stage, *rect;
g_setenv ("CLUTTER_VBLANK", "none", FALSE);
@ -70,7 +70,7 @@ 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_INIT (0, 0, 0, 255));
&COGL_COLOR_INIT (0, 0, 0, 255));
clutter_stage_set_title (CLUTTER_STAGE (stage), "Picking");
printf ("Picking performance test with "

View File

@ -85,7 +85,7 @@ get_character (int ch)
static ClutterActor *
create_label (void)
{
ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff };
CoglColor label_color = { 0xff, 0xff, 0xff, 0xff };
ClutterActor *label;
char *font_name;
GString *str;
@ -134,7 +134,7 @@ 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_INIT (0, 0, 0, 255));
&COGL_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);

View File

@ -58,7 +58,7 @@ 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_INIT (0, 0, 0, 255));
&COGL_COLOR_INIT (0, 0, 0, 255));
clutter_stage_set_title (CLUTTER_STAGE (stage), "Text");
group = clutter_actor_new ();
@ -103,7 +103,7 @@ main (int argc, char *argv[])
label = clutter_text_new_with_text (font_name, text);
clutter_text_set_color (CLUTTER_TEXT (label),
&CLUTTER_COLOR_INIT (255, 255, 255, 255));
&COGL_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),

View File

@ -51,7 +51,7 @@ main (int argc, char **argv)
{
glong i;
gdouble angle;
ClutterColor color = { 0x00, 0x00, 0x00, 0xff };
CoglColor color = { 0x00, 0x00, 0x00, 0xff };
ClutterActor *stage, *rect;
clutter_perf_fps_init ();
@ -61,7 +61,7 @@ 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_INIT (0, 0, 0, 255));
&COGL_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);

View File

@ -56,7 +56,7 @@ get_character (int ch)
static ClutterActor *
create_label (void)
{
ClutterColor label_color = { 0xff, 0xff, 0xff, 0xff };
CoglColor label_color = { 0xff, 0xff, 0xff, 0xff };
ClutterActor *label;
char *font_name;
GString *str;
@ -81,7 +81,7 @@ int
main (int argc, char *argv[])
{
ClutterActor *stage;
ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
CoglColor stage_color = { 0x00, 0x00, 0x00, 0xff };
ClutterActor *label;
int w, h;
int row, col;

View File

@ -4,7 +4,7 @@
#include "test-conform-common.h"
static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static const CoglColor stage_color = { 0x0, 0x0, 0x0, 0xff };
#define QUAD_WIDTH 20

View File

@ -11,7 +11,7 @@
#define FRAMEBUFFER_WIDTH 640
#define FRAMEBUFFER_HEIGHT 480
static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static const CoglColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static void

View File

@ -4,7 +4,7 @@
#include "test-conform-common.h"
static const ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
static const CoglColor stage_color = { 0x00, 0x00, 0x00, 0xff };
#define TEX_SIZE 64

View File

@ -2,7 +2,7 @@
#include "test-conform-common.h"
static const ClutterColor stage_color = { 0x00, 0x00, 0x00, 0xff };
static const CoglColor stage_color = { 0x00, 0x00, 0x00, 0xff };
#ifdef HAVE_X11

View File

@ -12,7 +12,7 @@
#define FRAMEBUFFER_WIDTH 640
#define FRAMEBUFFER_HEIGHT 480
static const ClutterColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static const CoglColor stage_color = { 0x0, 0x0, 0x0, 0xff };
static void
assert_region_color (int x,

View File

@ -284,7 +284,7 @@ on_monitors_changed (MetaMonitorManager *monitor_manager,
background = meta_background_new (display);
meta_background_set_color (background,
&CLUTTER_COLOR_INIT (red, green, blue, 255));
&COGL_COLOR_INIT (red, green, blue, 255));
meta_background_content_set_background (background_content, background);
g_object_unref (background);
@ -699,7 +699,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_INIT (0, 0, 255, 255));
clutter_actor_set_background_color (preview->actor, &COGL_COLOR_INIT (0, 0, 255, 255));
clutter_actor_set_opacity (preview->actor, 100);
clutter_actor_add_child (meta_get_window_group_for_display (display),

View File

@ -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_INIT (114, 159, 207, 255));
clutter_actor_set_background_color (actor, &COGL_COLOR_INIT (114, 159, 207, 255));
clutter_actor_add_child (meta_backend_get_stage (backend), actor);
for (i = 0; i < 5; i++)

View File

@ -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_INIT (245, 121, 0, 255));
clutter_actor_set_background_color (actor1, &COGL_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_INIT (52, 101, 164, 255));
clutter_actor_set_background_color (actor2, &COGL_COLOR_INIT (52, 101, 164, 255));
clutter_actor_add_child (stage, actor2);
g_test_expect_message ("libmutter-test",