]> Pileus Git - ~andy/gtk/blobdiff - modules/other/gail/libgail-util/gailmisc.c
gail: Use GdkRGBA instead GdkColor
[~andy/gtk] / modules / other / gail / libgail-util / gailmisc.c
index e1ad192df3304f44d1858c3bf42142cf6c29b9b4..fd0917a6f5f8f59228c96eb2efe6563584f93043 100644 (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;