Commit 85747da9 authored by Javier Jardón's avatar Javier Jardón

tests: use GdkRGBA instead GdkColor

parent 4a9bd917
...@@ -664,9 +664,9 @@ static void ...@@ -664,9 +664,9 @@ static void
color_modified (GtkColorButton *cb, gpointer data) color_modified (GtkColorButton *cb, gpointer data)
{ {
ObjectProperty *p = data; ObjectProperty *p = data;
GdkColor color; GdkRGBA rgba;
gtk_color_button_get_color (cb, &color); gtk_color_button_get_rgba (cb, &rgba);
if (is_child_property (p->spec)) if (is_child_property (p->spec))
{ {
...@@ -674,10 +674,10 @@ color_modified (GtkColorButton *cb, gpointer data) ...@@ -674,10 +674,10 @@ color_modified (GtkColorButton *cb, gpointer data)
GtkWidget *parent = gtk_widget_get_parent (widget); GtkWidget *parent = gtk_widget_get_parent (widget);
gtk_container_child_set (GTK_CONTAINER (parent), gtk_container_child_set (GTK_CONTAINER (parent),
widget, p->spec->name, &color, NULL); widget, p->spec->name, &rgba, NULL);
} }
else else
g_object_set (p->obj, p->spec->name, &color, NULL); g_object_set (p->obj, p->spec->name, &rgba, NULL);
} }
static void static void
...@@ -685,19 +685,19 @@ color_changed (GObject *object, GParamSpec *pspec, gpointer data) ...@@ -685,19 +685,19 @@ color_changed (GObject *object, GParamSpec *pspec, gpointer data)
{ {
GtkColorButton *cb = GTK_COLOR_BUTTON (data); GtkColorButton *cb = GTK_COLOR_BUTTON (data);
GValue val = { 0, }; GValue val = { 0, };
GdkColor *color; GdkRGBA *color;
GdkColor cb_color; GdkRGBA cb_color;
g_value_init (&val, GDK_TYPE_COLOR); g_value_init (&val, GDK_TYPE_RGBA);
get_property_value (object, pspec, &val); get_property_value (object, pspec, &val);
color = g_value_get_boxed (&val); color = g_value_get_boxed (&val);
gtk_color_button_get_color (cb, &cb_color); gtk_color_button_get_rgba (cb, &cb_color);
if (color != NULL && !gdk_color_equal (color, &cb_color)) if (color != NULL && !gdk_rgba_equal (color, &cb_color))
{ {
block_controller (G_OBJECT (cb)); block_controller (G_OBJECT (cb));
gtk_color_button_set_color (cb, color); gtk_color_button_set_rgba (cb, color);
unblock_controller (G_OBJECT (cb)); unblock_controller (G_OBJECT (cb));
} }
......
...@@ -31,13 +31,13 @@ static GdkPixbuf * ...@@ -31,13 +31,13 @@ static GdkPixbuf *
create_color_pixbuf (const char *color) create_color_pixbuf (const char *color)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkColor col; GdkRGBA rgba;
int x; int x;
int num; int num;
guchar *pixels, *p; guchar *pixels, *p;
if (!gdk_color_parse (color, &col)) if (!gdk_rgba_parse (&rgba, color))
return NULL; return NULL;
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
...@@ -50,9 +50,9 @@ create_color_pixbuf (const char *color) ...@@ -50,9 +50,9 @@ create_color_pixbuf (const char *color)
gdk_pixbuf_get_height (pixbuf); gdk_pixbuf_get_height (pixbuf);
for (x = 0; x < num; x++) { for (x = 0; x < num; x++) {
p[0] = col.red / 65535 * 255; p[0] = rgba.red * 255;
p[1] = col.green / 65535 * 255; p[1] = rgba.green * 255;
p[2] = col.blue / 65535 * 255; p[2] = rgba.blue * 255;
p += 3; p += 3;
} }
......
...@@ -11,14 +11,14 @@ static GdkPixbuf * ...@@ -11,14 +11,14 @@ static GdkPixbuf *
create_color_pixbuf (const char *color) create_color_pixbuf (const char *color)
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkColor col; GdkRGBA rgba;
int x; int x;
int num; int num;
int rowstride; int rowstride;
guchar *pixels, *p; guchar *pixels, *p;
if (!gdk_color_parse (color, &col)) if (!gdk_rgba_parse (color, &col))
return NULL; return NULL;
pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB, pixbuf = gdk_pixbuf_new (GDK_COLORSPACE_RGB,
...@@ -32,9 +32,9 @@ create_color_pixbuf (const char *color) ...@@ -32,9 +32,9 @@ create_color_pixbuf (const char *color)
gdk_pixbuf_get_height (pixbuf); gdk_pixbuf_get_height (pixbuf);
for (x = 0; x < num; x++) { for (x = 0; x < num; x++) {
p[0] = col.red / 65535 * 255; p[0] = col.red * 255;
p[1] = col.green / 65535 * 255; p[1] = col.green * 255;
p[2] = col.blue / 65535 * 255; p[2] = col.blue * 255;
p += 3; p += 3;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment