[gimp/gtk3-port: 218/236] app: use GdkRGBA instead of GdkColor in some places



commit 78128cc3745ce9595cd06ada31f5af80d216945a
Author: Michael Natterer <mitch gimp org>
Date:   Wed Feb 23 08:04:07 2011 +0100

    app: use GdkRGBA instead of GdkColor in some places

 app/display/gimpcanvas.c |    5 ++---
 app/gui/splash.c         |   11 ++++++-----
 2 files changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/app/display/gimpcanvas.c b/app/display/gimpcanvas.c
index 77a3b14..3cdff59 100644
--- a/app/display/gimpcanvas.c
+++ b/app/display/gimpcanvas.c
@@ -284,13 +284,12 @@ gimp_canvas_set_bg_color (GimpCanvas *canvas,
                           GimpRGB    *color)
 {
   GtkWidget *widget = GTK_WIDGET (canvas);
-  GdkColor   gdk_color;
 
   if (! gtk_widget_get_realized (widget))
     return;
 
-  gimp_rgb_get_gdk_color (color, &gdk_color);
-  gdk_window_set_background (gtk_widget_get_window (widget), &gdk_color);
+  gdk_window_set_background_rgba (gtk_widget_get_window (widget),
+                                  (GdkRGBA *) color);
 
   gtk_widget_queue_draw (GTK_WIDGET (canvas));
 }
diff --git a/app/gui/splash.c b/app/gui/splash.c
index d9f9c87..ae4b764 100644
--- a/app/gui/splash.c
+++ b/app/gui/splash.c
@@ -45,7 +45,7 @@ typedef struct
   gint            width;
   gint            height;
   GtkWidget      *progress;
-  GdkColor        color;
+  GdkRGBA         color;
   PangoLayout    *upper;
   gint            upper_x;
   gint            upper_y;
@@ -76,7 +76,7 @@ static void        splash_rectangle_union     (GdkRectangle   *dest,
                                                gint            offset_y);
 static void        splash_average_text_area   (GimpSplash     *splash,
                                                GdkPixbuf      *pixbuf,
-                                               GdkColor       *color);
+                                               GdkRGBA        *rgba);
 
 static GdkPixbufAnimation * splash_image_load          (gboolean     be_verbose);
 static GdkPixbufAnimation * splash_image_pick_from_dir (const gchar *dirname,
@@ -264,7 +264,7 @@ splash_area_draw (GtkWidget  *widget,
                   cairo_t    *cr,
                   GimpSplash *splash)
 {
-  gdk_cairo_set_source_color (cr, &splash->color);
+  gdk_cairo_set_source_rgba (cr, &splash->color);
 
   cairo_move_to (cr, splash->upper_x, splash->upper_y);
   pango_cairo_show_layout (cr, splash->upper);
@@ -345,7 +345,7 @@ splash_rectangle_union (GdkRectangle   *dest,
 static void
 splash_average_text_area (GimpSplash *splash,
                           GdkPixbuf  *pixbuf,
-                          GdkColor   *color)
+                          GdkRGBA    *color)
 {
   const guchar *pixels;
   gint          rowstride;
@@ -400,7 +400,8 @@ splash_average_text_area (GimpSplash *splash,
 
     }
 
-  color->red = color->green = color->blue = (luminance << 8 | luminance);
+  color->red = color->green = color->blue = (luminance << 8 | luminance) / 255.0;
+  color->alpha = 1.0;
 }
 
 static GdkPixbufAnimation *



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]