aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-21 07:56:26 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:50:04 +0800
commit200df519f19c1bf9c2d7596919d542c3856f3020 (patch)
tree6f90bfa3cc92c8b15b03aa24d8159c4f48fc9426
parentb6cc0f11b8607ef713300f384e279d7ffa4f2abb (diff)
downloadgsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar.gz
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar.bz2
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar.lz
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar.xz
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.tar.zst
gsoc2013-evolution-200df519f19c1bf9c2d7596919d542c3856f3020.zip
gnome-canvas: Remove functions that allocate colors
Cairo doesn't need allocated colors. Yay, gnome-canvas now compiles with GDK_DISABLE_DEPRECATED.
-rw-r--r--libgnomecanvas/gnome-canvas.c69
-rw-r--r--libgnomecanvas/gnome-canvas.h10
2 files changed, 0 insertions, 79 deletions
diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c
index 758a7ee728..92cd664a96 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 33fee2a00c..884adbb383 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