diff options
author | Javier Jardón <jjardon@gnome.org> | 2011-06-06 16:47:10 +0100 |
---|---|---|
committer | Javier Jardón <jjardon@gnome.org> | 2011-06-07 17:42:24 +0100 |
commit | 02285b232ccc18fe6db745346046c9690fb382eb (patch) | |
tree | 0fd5d63f6a6ffb640b1231d01c1249696cd2748d /modules | |
parent | c26b83a0eaec1961ec7a68e425baff7b5d8f4f8c (diff) | |
download | gtk+-02285b232ccc18fe6db745346046c9690fb382eb.tar.gz |
gail: Use GdkRGBA instead GdkColor
Diffstat (limited to 'modules')
-rw-r--r-- | modules/other/gail/gailtextcell.c | 12 | ||||
-rw-r--r-- | modules/other/gail/libgail-util/gailmisc.c | 22 |
2 files changed, 20 insertions, 14 deletions
diff --git a/modules/other/gail/gailtextcell.c b/modules/other/gail/gailtextcell.c index 220191709a..3dce3fc39b 100644 --- a/modules/other/gail/gailtextcell.c +++ b/modules/other/gail/gailtextcell.c @@ -451,7 +451,7 @@ static PangoLayout* create_pango_layout(GtkCellRendererText *gtk_renderer, GtkWidget *widget) { - GdkColor *foreground_gdk; + GdkRGBA *foreground_rgba; PangoAttrList *attr_list, *attributes; PangoLayout *layout; PangoUnderline uline, underline; @@ -467,7 +467,7 @@ create_pango_layout(GtkCellRendererText *gtk_renderer, "text", &renderer_text, "attributes", &attributes, "foreground-set", &foreground_set, - "foreground-gdk", &foreground_gdk, + "foreground-gdk", &foreground_rgba, "strikethrough-set", &strikethrough_set, "strikethrough", &strikethrough, "font-desc", &font_desc, @@ -488,9 +488,9 @@ create_pango_layout(GtkCellRendererText *gtk_renderer, if (foreground_set) { - add_attr (attr_list, pango_attr_foreground_new (foreground_gdk->red, - foreground_gdk->green, - foreground_gdk->blue)); + add_attr (attr_list, pango_attr_foreground_new (foreground_rgba->red * 65535, + foreground_rgba->green * 65535, + foreground_rgba->blue * 65535)); } if (strikethrough_set) @@ -540,7 +540,7 @@ create_pango_layout(GtkCellRendererText *gtk_renderer, pango_font_description_free (font_desc); pango_attr_list_unref (attributes); g_free (renderer_text); - gdk_color_free (foreground_gdk); + gdk_rgba_free (foreground_rgba); return layout; } diff --git a/modules/other/gail/libgail-util/gailmisc.c b/modules/other/gail/libgail-util/gailmisc.c index e1ad192df3..fd0917a6f5 100644 --- a/modules/other/gail/libgail-util/gailmisc.c +++ b/modules/other/gail/libgail-util/gailmisc.c @@ -720,12 +720,15 @@ gail_misc_buffer_get_run_attributes (GtkTextBuffer *buffer, g_object_get (tag, "foreground-set", &val_set, NULL); if (val_set) { - GdkColor *c; + GdkRGBA *rgba; gchar *value; - g_object_get (tag, "foreground-gdk", &c, NULL); - value = g_strdup_printf ("%u,%u,%u", c->red, c->green, c->blue); - gdk_color_free (c); + g_object_get (tag, "foreground-rgba", &rgba, NULL); + value = g_strdup_printf ("%u,%u,%u", + (guint) rgba->red * 65535, + (guint) rgba->green * 65535, + (guint) rgba->blue * 65535); + gdk_rgba_free (rgba); attrib_set = gail_misc_add_attribute (attrib_set, ATK_TEXT_ATTR_FG_COLOR, value); } temp_tags = temp_tags->next; @@ -740,12 +743,15 @@ gail_misc_buffer_get_run_attributes (GtkTextBuffer *buffer, g_object_get (tag, "background-set", &val_set, NULL); if (val_set) { - GdkColor *c; + GdkRGBA *rgba; gchar *value; - g_object_get (tag, "background-gdk", &c, NULL); - value = g_strdup_printf ("%u,%u,%u", c->red, c->green, c->blue); - gdk_color_free (c); + g_object_get (tag, "background-rgba", &rgba, NULL); + value = g_strdup_printf ("%u,%u,%u", + (guint) rgba->red * 65535, + (guint) rgba->green * 65535, + (guint) rgba->blue * 65535); + gdk_rgba_free (rgba); attrib_set = gail_misc_add_attribute (attrib_set, ATK_TEXT_ATTR_BG_COLOR, value); } temp_tags = temp_tags->next; |