Fix more colour deprecation warnings.

Wed, 12 Feb 2014 19:32:57 -0500

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Wed, 12 Feb 2014 19:32:57 -0500
changeset 35549
1128302c7511
parent 35548
e3ee59a7965c
child 35550
b18fa06ff063

Fix more colour deprecation warnings.

pidgin/gtkwhiteboard.c file | annotate | diff | comparison | revisions
--- a/pidgin/gtkwhiteboard.c	Wed Feb 12 17:00:39 2014 -0500
+++ b/pidgin/gtkwhiteboard.c	Wed Feb 12 19:32:57 2014 -0500
@@ -383,6 +383,9 @@
 	PidginWhiteboard *gtkwb = (PidginWhiteboard*)data;
 	cairo_t *cr;
 	GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+	GdkRGBA white = {1.0, 1.0, 1.0, 1.0};
+#endif
 
 	if (gtkwb->priv->cr)
 		cairo_destroy(gtkwb->priv->cr);
@@ -394,7 +397,11 @@
 	gtkwb->priv->surface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
 		allocation.width, allocation.height);
 	gtkwb->priv->cr = cr = cairo_create(gtkwb->priv->surface);
+#if GTK_CHECK_VERSION(3,0,0)
+	gdk_cairo_set_source_rgba(cr, &white);
+#else
 	gdk_cairo_set_source_color(cr, &gtk_widget_get_style(widget)->white);
+#endif
 	cairo_rectangle(cr, 0, 0, allocation.width, allocation.height);
 	cairo_fill(cr);
 
@@ -632,11 +639,22 @@
 	GtkWidget *widget = gtkwb->drawing_area;
 	cairo_t *gfx_con = gtkwb->priv->cr;
 	GdkColor col;
+#if GTK_CHECK_VERSION(3,0,0)
+	GdkRGBA rgba;
+#endif
 
 	/* Interpret and convert color */
 	pidgin_whiteboard_rgb24_to_rgb48(color, &col);
 
+#if GTK_CHECK_VERSION(3,0,0)
+	rgba.red = col.red / 0xffff;
+	rgba.green = col.green / 0xffff;
+	rgba.blue = col.blue / 0xffff;
+	rgba.alpha = 1.0;
+	gdk_cairo_set_source_rgba(gfx_con, &rgba);
+#else
 	gdk_cairo_set_source_color(gfx_con, &col);
+#endif
 
 	/* Draw a circle */
 	cairo_arc(gfx_con,
@@ -739,11 +757,18 @@
 	GtkWidget *drawing_area = gtkwb->drawing_area;
 	cairo_t *cr = gtkwb->priv->cr;
 	GtkAllocation allocation;
+#if GTK_CHECK_VERSION(3,0,0)
+	GdkRGBA white = {1.0, 1.0, 1.0, 1.0};
+#endif
 
 	gtk_widget_get_allocation(drawing_area, &allocation);
 
+#if GTK_CHECK_VERSION(3,0,0)
+	gdk_cairo_set_source_rgba(cr, &white);
+#else
 	gdk_cairo_set_source_color(cr,
 		&gtk_widget_get_style(drawing_area)->white);
+#endif
 	cairo_rectangle(cr, 0, 0, allocation.width, allocation.height);
 	cairo_fill(cr);
 

mercurial