]> Pileus Git - ~andy/gtk/commitdiff
API: remove gdk_colormap_query_color
authorBenjamin Otte <otte@redhat.com>
Sat, 31 Jul 2010 10:47:38 +0000 (12:47 +0200)
committerBenjamin Otte <otte@redhat.com>
Tue, 10 Aug 2010 19:02:30 +0000 (21:02 +0200)
docs/reference/gdk/gdk3-sections.txt
docs/reference/gdk/tmpl/colors.sgml
gdk/directfb/gdkcolor-directfb.c
gdk/gdk.symbols
gdk/gdkcolor.h
gdk/quartz/gdkcolor-quartz.c
gdk/win32/gdkcolor-win32.c
gdk/x11/gdkcolor-x11.c

index ccec2bca9b1e60dad042f47a76de78e765f9aeb1..0b74887c9489c9c1eb64ac071356cf8ebe0c4247 100644 (file)
@@ -288,7 +288,6 @@ gdk_colormap_get_system
 gdk_colormap_alloc_colors
 gdk_colormap_alloc_color
 gdk_colormap_free_colors
-gdk_colormap_query_color
 gdk_colormap_get_visual
 gdk_colormap_get_screen
 gdk_color_copy
index d313f5a3d583f9dccb181b07d7d15206811032e9..28ce9b8c252b29ed6746358817f0c4cdc579ca6c 100644 (file)
@@ -116,16 +116,6 @@ The colormap structure contains the following public fields.
 @n_colors: 
 
 
-<!-- ##### FUNCTION gdk_colormap_query_color ##### -->
-<para>
-
-</para>
-
-@colormap: 
-@pixel: 
-@result: 
-
-
 <!-- ##### FUNCTION gdk_colormap_get_visual ##### -->
 <para>
 </para>
index 67d0f7c715297f4f889ba00f9a5f09a52f4572e6..77322f02b1f6aaf0009acd30d6df6d3fc235100f 100644 (file)
@@ -304,54 +304,6 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
   return 0;
 }
 
-void
-gdk_colormap_query_color (GdkColormap *colormap,
-                          gulong       pixel,
-                          GdkColor    *result)
-{
-  GdkVisual *visual;
-
-  g_return_if_fail (GDK_IS_COLORMAP (colormap));
-
-  visual = gdk_colormap_get_visual (colormap);
-
-  switch (visual->type)
-    {
-    case GDK_VISUAL_TRUE_COLOR:
-      result->red = 65535. *
-        (gdouble)((pixel & visual->red_mask) >> visual->red_shift) /
-        ((1 << visual->red_prec) - 1);
-
-      result->green = 65535. *
-        (gdouble)((pixel & visual->green_mask) >> visual->green_shift) /
-        ((1 << visual->green_prec) - 1);
-
-      result->blue = 65535. *
-        (gdouble)((pixel & visual->blue_mask) >> visual->blue_shift) /
-        ((1 << visual->blue_prec) - 1);
-      break;
-
-    case GDK_VISUAL_STATIC_COLOR:
-    case GDK_VISUAL_PSEUDO_COLOR:
-      if (pixel >= 0 && pixel < colormap->size)
-        {
-          result->red   = colormap->colors[pixel].red;
-          result->green = colormap->colors[pixel].green;
-          result->blue  = colormap->colors[pixel].blue;
-        }
-      else
-        g_warning ("gdk_colormap_query_color: pixel outside colormap");
-      break;
-
-    case GDK_VISUAL_DIRECT_COLOR:
-    case GDK_VISUAL_GRAYSCALE:
-    case GDK_VISUAL_STATIC_GRAY:
-      /* unsupported */
-      g_assert_not_reached ();
-      break;
-    }
-}
-
 IDirectFBPalette *
 gdk_directfb_colormap_get_palette (GdkColormap *colormap)
 {
index b52bfd3ae12ee5381fb109cf7be1b0479e1bd9a2..bdefe9a47a15844964cad817804a20dcf6656923 100644 (file)
@@ -318,7 +318,6 @@ gdk_colormap_new
 gdk_colormap_get_type G_GNUC_CONST
 gdk_colormap_alloc_colors
 gdk_colormap_free_colors
-gdk_colormap_query_color
 gdk_colormap_get_screen
 #endif
 #endif
index 1312991e16500410f950f0d2ea67a3f264a0b35d..dfb21cd6c65834475bfe68edc52c0c7661fd9f3a 100644 (file)
@@ -110,9 +110,6 @@ gboolean gdk_colormap_alloc_color (GdkColormap    *colormap,
 void     gdk_colormap_free_colors (GdkColormap    *colormap,
                                   const GdkColor *colors,
                                   gint            n_colors);
-void     gdk_colormap_query_color (GdkColormap    *colormap,
-                                  gulong          pixel,
-                                  GdkColor       *result);
 
 GdkVisual *gdk_colormap_get_visual (GdkColormap *colormap);
 
index 315dd28be52fb0f8063b07f23bbd2ff528bb1601..9a7884d2be7148b33d80559de8fb21eb21bdb562 100644 (file)
@@ -140,21 +140,6 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
   return 0;
 }
 
-void
-gdk_colormap_query_color (GdkColormap *colormap,
-                         gulong       pixel,
-                         GdkColor    *result)
-{
-  result->red = pixel >> 16 & 0xff;
-  result->red += result->red << 8;
-
-  result->green = pixel >> 8 & 0xff;
-  result->green += result->green << 8;
-
-  result->blue = pixel & 0xff;
-  result->blue += result->blue << 8;
-}
-
 GdkScreen*
 gdk_colormap_get_screen (GdkColormap *cmap)
 {
index 5e49907d6c2c5da2a850bf8a92f37c353e9dd09d..08a16b8e0c739faa68087985b7546f38d7968b6a 100644 (file)
@@ -1120,44 +1120,6 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
   return nremaining;
 }
 
-void
-gdk_colormap_query_color (GdkColormap *colormap,
-                         gulong       pixel,
-                         GdkColor    *result)
-{
-  GdkVisual *visual;
-
-  g_return_if_fail (GDK_IS_COLORMAP (colormap));
-  
-  visual = gdk_colormap_get_visual (colormap);
-
-  switch (visual->type)
-    {
-    case GDK_VISUAL_DIRECT_COLOR:
-    case GDK_VISUAL_TRUE_COLOR:
-      result->red = 65535. * (double)((pixel & visual->red_mask) >> visual->red_shift) / ((1 << visual->red_prec) - 1);
-      result->green = 65535. * (double)((pixel & visual->green_mask) >> visual->green_shift) / ((1 << visual->green_prec) - 1);
-      result->blue = 65535. * (double)((pixel & visual->blue_mask) >> visual->blue_shift) / ((1 << visual->blue_prec) - 1);
-      break;
-
-    case GDK_VISUAL_STATIC_GRAY:
-    case GDK_VISUAL_GRAYSCALE:
-      result->red = result->green = result->blue = 65535. * (double)pixel/((1<<visual->depth) - 1);
-      break;
-
-    case GDK_VISUAL_STATIC_COLOR:
-    case GDK_VISUAL_PSEUDO_COLOR:
-      result->red = colormap->colors[pixel].red;
-      result->green = colormap->colors[pixel].green;
-      result->blue = colormap->colors[pixel].blue;
-      break;
-
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-}
-
 static gint
 gdk_colormap_match_color (GdkColormap *cmap,
                          GdkColor    *color,
index 2d412146878aecfd94215e85f4341e50d7d80974..bbfae0d9712b53f97e9510510b79f51630fc3075 100644 (file)
@@ -1009,72 +1009,6 @@ gdk_colormap_alloc_colors (GdkColormap *colormap,
   return nremaining;
 }
 
-/**
- * gdk_colormap_query_color:
- * @colormap: a #GdkColormap
- * @pixel: pixel value in hardware display format
- * @result: #GdkColor with red, green, blue fields initialized
- * 
- * Locates the RGB color in @colormap corresponding to the given
- * hardware pixel @pixel. @pixel must be a valid pixel in the
- * colormap; it's a programmer error to call this function with a
- * pixel which is not in the colormap. Hardware pixels are normally
- * obtained from gdk_colormap_alloc_colors().
- *
- * This function is rarely useful; it's used for example to
- * implement the eyedropper feature in #GtkColorSelection.
- * 
- **/
-void
-gdk_colormap_query_color (GdkColormap *colormap,
-                         gulong       pixel,
-                         GdkColor    *result)
-{
-  XColor xcolor;
-  GdkVisual *visual;
-  GdkColormapPrivateX11 *private;
-  
-  g_return_if_fail (GDK_IS_COLORMAP (colormap));
-  
-  private = GDK_COLORMAP_PRIVATE_DATA (colormap);
-
-  visual = gdk_colormap_get_visual (colormap);
-
-  switch (visual->type) {
-  case GDK_VISUAL_DIRECT_COLOR:
-  case GDK_VISUAL_TRUE_COLOR:
-    result->red = 65535. * (double)((pixel & visual->red_mask) >> visual->red_shift) / ((1 << visual->red_prec) - 1);
-    result->green = 65535. * (double)((pixel & visual->green_mask) >> visual->green_shift) / ((1 << visual->green_prec) - 1);
-    result->blue = 65535. * (double)((pixel & visual->blue_mask) >> visual->blue_shift) / ((1 << visual->blue_prec) - 1);
-    break;
-  case GDK_VISUAL_STATIC_GRAY:
-  case GDK_VISUAL_GRAYSCALE:
-    result->red = result->green = result->blue = 65535. * (double)pixel/((1<<visual->depth) - 1);
-    break;
-  case GDK_VISUAL_STATIC_COLOR:
-    xcolor.pixel = pixel;
-    if (!private->screen->closed)
-      {
-       XQueryColor (GDK_SCREEN_XDISPLAY (private->screen), private->xcolormap, &xcolor);
-       result->red = xcolor.red;
-       result->green = xcolor.green;
-       result->blue =  xcolor.blue;
-      }
-    else
-      result->red = result->green = result->blue = 0;
-    break;
-  case GDK_VISUAL_PSEUDO_COLOR:
-    g_return_if_fail (pixel < colormap->size);
-    result->red = colormap->colors[pixel].red;
-    result->green = colormap->colors[pixel].green;
-    result->blue = colormap->colors[pixel].blue;
-    break;
-  default:
-    g_assert_not_reached ();
-    break;
-  }
-}
-
 /**
  * gdk_x11_colormap_foreign_new:
  * @visual: a #GdkVisual