[evolution/rendering-cleanup: 91/97] gnome-canvas: Remove functions that allocate colors



commit 2802b982bdc42dc437daaed43b101bdfea16dc02
Author: Benjamin Otte <otte redhat com>
Date:   Thu Oct 21 01:56:26 2010 +0200

    gnome-canvas: Remove functions that allocate colors
    
    Cairo doesn't need allocated colors.
    
    Yay, gnome-canvas now compiles with GDK_DISABLE_DEPRECATED.

 libgnomecanvas/gnome-canvas.c |   69 -----------------------------------------
 libgnomecanvas/gnome-canvas.h |   10 ------
 2 files changed, 0 insertions(+), 79 deletions(-)
---
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 7618706..231ad73 100644
--- a/libgnomecanvas/gnome-canvas.c
+++ b/libgnomecanvas/gnome-canvas.c
@@ -3455,75 +3455,6 @@ gnome_canvas_world_to_window (GnomeCanvas *canvas, gdouble worldx, gdouble world
 		*winy = (canvas->pixels_per_unit)*(worldy - canvas->scroll_y1) + canvas->zoom_yofs;
 }
 
-/**
- * gnome_canvas_get_color:
- * @canvas: A canvas.
- * @spec: X color specification, or NULL for "transparent".
- * @color: Returns the allocated color.
- *
- * Allocates a color based on the specified X color specification.  As a
- * convenience to item implementations, it returns TRUE if the color was
- * allocated, or FALSE if the specification was NULL.  A NULL color
- * specification is considered as "transparent" by the canvas.
- *
- * Return value: TRUE if @spec is non-NULL and the color is allocated.  If @spec
- * is NULL, then returns FALSE.
- **/
-gint
-gnome_canvas_get_color (GnomeCanvas *canvas, const gchar *spec, GdkColor *color)
-{
-	GdkColormap *colormap;
-
-	g_return_val_if_fail (GNOME_IS_CANVAS (canvas), FALSE);
-	g_return_val_if_fail (color != NULL, FALSE);
-
-	if (!spec) {
-		color->pixel = 0;
-		color->red = 0;
-		color->green = 0;
-		color->blue = 0;
-		return FALSE;
-	}
-
-	gdk_color_parse (spec, color);
-
-	colormap = gtk_widget_get_colormap (GTK_WIDGET (canvas));
-
-	gdk_rgb_find_color (colormap, color);
-
-	return TRUE;
-}
-
-/**
- * gnome_canvas_get_color_pixel:
- * @canvas: A canvas.
- * @rgba: RGBA color specification.
- *
- * Allocates a color from the RGBA value passed into this function.  The alpha
- * opacity value is discarded, since normal X colors do not support it.
- *
- * Return value: Allocated pixel value corresponding to the specified color.
- **/
-gulong
-gnome_canvas_get_color_pixel (GnomeCanvas *canvas, guint rgba)
-{
-	GdkColormap *colormap;
-	GdkColor color;
-
-	g_return_val_if_fail (GNOME_IS_CANVAS (canvas), 0);
-
-	color.red = ((rgba & 0xff000000) >> 16) + ((rgba & 0xff000000) >> 24);
-	color.green = ((rgba & 0x00ff0000) >> 8) + ((rgba & 0x00ff0000) >> 16);
-	color.blue = (rgba & 0x0000ff00) + ((rgba & 0x0000ff00) >> 8);
-	color.pixel = 0;
-
-	colormap = gtk_widget_get_colormap (GTK_WIDGET (canvas));
-
-	gdk_rgb_find_color (colormap, &color);
-
-	return color.pixel;
-}
-
 static gboolean
 boolean_handled_accumulator (GSignalInvocationHint *ihint,
 			     GValue                *return_accu,
diff --git a/libgnomecanvas/gnome-canvas.h b/libgnomecanvas/gnome-canvas.h
index 33fee2a..884adbb 100644
--- a/libgnomecanvas/gnome-canvas.h
+++ b/libgnomecanvas/gnome-canvas.h
@@ -507,16 +507,6 @@ void gnome_canvas_window_to_world (GnomeCanvas *canvas,
 void gnome_canvas_world_to_window (GnomeCanvas *canvas,
 				   gdouble worldx, gdouble worldy, gdouble *winx, gdouble *winy);
 
-/* Takes a string specification for a color and allocates it into the specified
- * GdkColor.  If the string is null, then it returns FALSE. Otherwise, it
- * returns TRUE.
- */
-gint gnome_canvas_get_color (GnomeCanvas *canvas, const gchar *spec, GdkColor *color);
-
-/* Allocates a color from the RGB value passed into this function. */
-gulong gnome_canvas_get_color_pixel (GnomeCanvas *canvas,
-				     guint        rgba);
-
 G_END_DECLS
 
 #endif



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