]> Pileus Git - ~andy/gtk/commitdiff
gail: Use GdkRGBA instead GdkColor
authorJavier Jardón <jjardon@gnome.org>
Mon, 6 Jun 2011 15:47:10 +0000 (16:47 +0100)
committerJavier Jardón <jjardon@gnome.org>
Tue, 7 Jun 2011 16:42:24 +0000 (17:42 +0100)
modules/other/gail/gailtextcell.c
modules/other/gail/libgail-util/gailmisc.c

index 220191709a3a61a9190fcc65327b488d4ab1fbbc..3dce3fc39b9ef07f0b105087f4a60cd0b520212c 100644 (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;
 }
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;