gail: Use GdkRGBA instead GdkColor

This commit is contained in:
Javier Jardón 2011-06-06 16:47:10 +01:00
parent c26b83a0ea
commit 02285b232c
2 changed files with 20 additions and 14 deletions

View File

@ -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;
}

View File

@ -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;