[gtk+/rendering-cleanup: 119/140] API: Remove gdk_drawable_set_colormap()



commit 3d9552e7e494a5ce76897f28d175981dbbcdf59f
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 29 00:03:01 2010 +0200

    API: Remove gdk_drawable_set_colormap()

 docs/reference/gdk/gdk3-sections.txt |    1 -
 gdk/gdk.symbols                      |    1 -
 gdk/gdkdraw.c                        |   23 ----------------------
 gdk/gdkdrawable.h                    |    5 ----
 gdk/gdkoffscreenwindow.c             |   22 ---------------------
 gdk/gdkwindow.c                      |   26 -------------------------
 gdk/quartz/gdkdrawable-quartz.c      |   17 ----------------
 gdk/win32/gdkdrawable-win32.c        |   22 ---------------------
 gdk/win32/gdkwindow-win32.c          |   25 ------------------------
 gdk/x11/gdkdrawable-x11.c            |   35 ----------------------------------
 gdk/x11/gdkwindow-x11.c              |   32 -------------------------------
 11 files changed, 0 insertions(+), 209 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 36e03eb..cda5953 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -287,7 +287,6 @@ GdkDrawable
 gdk_drawable_get_display
 gdk_drawable_get_screen
 gdk_drawable_get_visual
-gdk_drawable_set_colormap
 gdk_drawable_get_colormap
 gdk_drawable_get_depth
 gdk_drawable_get_size
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 086c876..8be98a6 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -540,7 +540,6 @@ gdk_drawable_get_size
 gdk_drawable_get_type G_GNUC_CONST
 gdk_drawable_get_visible_region
 gdk_drawable_get_visual
-gdk_drawable_set_colormap
 #endif
 #endif
 
diff --git a/gdk/gdkdraw.c b/gdk/gdkdraw.c
index 7ea8e69..c3e2d4c 100644
--- a/gdk/gdkdraw.c
+++ b/gdk/gdkdraw.c
@@ -151,29 +151,6 @@ gdk_drawable_get_display (GdkDrawable *drawable)
 }
 	
 /**
- * gdk_drawable_set_colormap:
- * @drawable: a #GdkDrawable
- * @colormap: a #GdkColormap
- *
- * Sets the colormap associated with @drawable. Normally this will
- * happen automatically when the drawable is created; you only need to
- * use this function if the drawable-creating function did not have a
- * way to determine the colormap, and you then use drawable operations
- * that require a colormap. The colormap for all drawables and
- * graphics contexts you intend to use together should match.
- **/
-void
-gdk_drawable_set_colormap (GdkDrawable *drawable,
-                           GdkColormap *cmap)
-{
-  g_return_if_fail (GDK_IS_DRAWABLE (drawable));
-  g_return_if_fail (cmap == NULL || gdk_drawable_get_depth (drawable)
-                    == cmap->visual->depth);
-
-  GDK_DRAWABLE_GET_CLASS (drawable)->set_colormap (drawable, cmap);
-}
-
-/**
  * gdk_drawable_get_colormap:
  * @drawable: a #GdkDrawable
  * 
diff --git a/gdk/gdkdrawable.h b/gdk/gdkdrawable.h
index 7e02b29..db146c3 100644
--- a/gdk/gdkdrawable.h
+++ b/gdk/gdkdrawable.h
@@ -61,9 +61,6 @@ struct _GdkDrawableClass
                           gint         *width,
                           gint         *height);
 
-  void (*set_colormap)   (GdkDrawable  *drawable,
-                          GdkColormap  *cmap);
-
   GdkColormap* (*get_colormap)	(GdkDrawable  *drawable);
   GdkVisual*   (*get_visual)	(GdkDrawable  *drawable);
   GdkScreen*   (*get_screen)	(GdkDrawable  *drawable);
@@ -98,8 +95,6 @@ GType           gdk_drawable_get_type     (void) G_GNUC_CONST;
 void            gdk_drawable_get_size     (GdkDrawable	  *drawable,
 					   gint	          *width,
 					   gint  	  *height);
-void	        gdk_drawable_set_colormap (GdkDrawable	  *drawable,
-					   GdkColormap	  *colormap);
 GdkColormap*    gdk_drawable_get_colormap (GdkDrawable	  *drawable);
 GdkVisual*      gdk_drawable_get_visual   (GdkDrawable	  *drawable);
 gint            gdk_drawable_get_depth    (GdkDrawable	  *drawable);
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 8cd5af7..1605b39 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -148,27 +148,6 @@ gdk_offscreen_window_get_colormap (GdkDrawable *drawable)
   return offscreen->colormap;
 }
 
-static void
-gdk_offscreen_window_set_colormap (GdkDrawable *drawable,
-				   GdkColormap*colormap)
-{
-  GdkOffscreenWindow *offscreen = GDK_OFFSCREEN_WINDOW (drawable);
-
-  if (colormap && GDK_WINDOW_DESTROYED (offscreen->wrapper))
-    return;
-
-  if (offscreen->colormap == colormap)
-    return;
-
-  if (offscreen->colormap)
-    g_object_unref (offscreen->colormap);
-
-  offscreen->colormap = colormap;
-  if (offscreen->colormap)
-    g_object_ref (offscreen->colormap);
-}
-
-
 static gint
 gdk_offscreen_window_get_depth (GdkDrawable *drawable)
 {
@@ -791,7 +770,6 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
   object_class->finalize = gdk_offscreen_window_finalize;
 
   drawable_class->ref_cairo_surface = gdk_offscreen_window_ref_cairo_surface;
-  drawable_class->set_colormap = gdk_offscreen_window_set_colormap;
   drawable_class->get_colormap = gdk_offscreen_window_get_colormap;
   drawable_class->get_depth = gdk_offscreen_window_get_depth;
   drawable_class->get_screen = gdk_offscreen_window_get_screen;
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 268a397..8e0798a 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -230,8 +230,6 @@ static void   gdk_window_real_get_size  (GdkDrawable     *drawable,
 static GdkVisual*   gdk_window_real_get_visual   (GdkDrawable *drawable);
 static gint         gdk_window_real_get_depth    (GdkDrawable *drawable);
 static GdkScreen*   gdk_window_real_get_screen   (GdkDrawable *drawable);
-static void         gdk_window_real_set_colormap (GdkDrawable *drawable,
-						  GdkColormap *cmap);
 static GdkColormap* gdk_window_real_get_colormap (GdkDrawable *drawable);
 
 static cairo_region_t*   gdk_window_get_clip_region        (GdkDrawable *drawable);
@@ -381,7 +379,6 @@ gdk_window_class_init (GdkWindowObjectClass *klass)
   drawable_class->get_depth = gdk_window_real_get_depth;
   drawable_class->get_screen = gdk_window_real_get_screen;
   drawable_class->get_size = gdk_window_real_get_size;
-  drawable_class->set_colormap = gdk_window_real_set_colormap;
   drawable_class->get_colormap = gdk_window_real_get_colormap;
   drawable_class->get_visual = gdk_window_real_get_visual;
   drawable_class->ref_cairo_surface = gdk_window_ref_cairo_surface;
@@ -2062,8 +2059,6 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
 
 	  window_remove_filters (window);
 
-	  gdk_drawable_set_colormap (GDK_DRAWABLE (window), NULL);
-
 	  window_remove_from_pointer_info (window, display);
 
 	  if (private->clip_region)
@@ -3644,27 +3639,6 @@ gdk_window_real_get_screen (GdkDrawable *drawable)
   return gdk_drawable_get_screen (GDK_WINDOW_OBJECT (drawable)->impl);
 }
 
-static void
-gdk_window_real_set_colormap (GdkDrawable *drawable,
-			      GdkColormap *cmap)
-{
-  GdkWindowObject *private;
-
-  g_return_if_fail (GDK_IS_WINDOW (drawable));
-
-  if (GDK_WINDOW_DESTROYED (drawable))
-    return;
-
-  private = (GdkWindowObject *)drawable;
-
-  /* different colormap than parent, requires native window */
-  if (!private->input_only &&
-      cmap != gdk_drawable_get_colormap ((GdkDrawable *)(private->parent)))
-    gdk_window_ensure_native ((GdkWindow *)drawable);
-
-  gdk_drawable_set_colormap (private->impl, cmap);
-}
-
 static GdkColormap*
 gdk_window_real_get_colormap (GdkDrawable *drawable)
 {
diff --git a/gdk/quartz/gdkdrawable-quartz.c b/gdk/quartz/gdkdrawable-quartz.c
index ea8736a..64845b9 100644
--- a/gdk/quartz/gdkdrawable-quartz.c
+++ b/gdk/quartz/gdkdrawable-quartz.c
@@ -106,22 +106,6 @@ gdk_quartz_ref_cairo_surface (GdkDrawable *drawable)
   return impl->cairo_surface;
 }
 
-static void
-gdk_quartz_set_colormap (GdkDrawable *drawable,
-			 GdkColormap *colormap)
-{
-  GdkDrawableImplQuartz *impl = GDK_DRAWABLE_IMPL_QUARTZ (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 static GdkColormap*
 gdk_quartz_get_colormap (GdkDrawable *drawable)
 {
@@ -172,7 +156,6 @@ gdk_drawable_impl_quartz_class_init (GdkDrawableImplQuartzClass *klass)
   drawable_class->ref_cairo_surface = gdk_quartz_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_quartz_create_cairo_surface;
 
-  drawable_class->set_colormap = gdk_quartz_set_colormap;
   drawable_class->get_colormap = gdk_quartz_get_colormap;
 
   drawable_class->get_depth = gdk_quartz_get_depth;
diff --git a/gdk/win32/gdkdrawable-win32.c b/gdk/win32/gdkdrawable-win32.c
index e594b88..2ad840e 100644
--- a/gdk/win32/gdkdrawable-win32.c
+++ b/gdk/win32/gdkdrawable-win32.c
@@ -53,9 +53,6 @@ static cairo_surface_t *gdk_win32_create_cairo_surface (GdkDrawable *drawable,
                                                         int          width,
                                                         int          height);
      
-static void gdk_win32_set_colormap   (GdkDrawable    *drawable,
-				      GdkColormap    *colormap);
-
 static GdkColormap* gdk_win32_get_colormap   (GdkDrawable    *drawable);
 
 static gint         gdk_win32_get_depth      (GdkDrawable    *drawable);
@@ -82,7 +79,6 @@ _gdk_drawable_impl_win32_class_init (GdkDrawableImplWin32Class *klass)
   drawable_class->ref_cairo_surface = gdk_win32_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_win32_create_cairo_surface;
   
-  drawable_class->set_colormap = gdk_win32_set_colormap;
   drawable_class->get_colormap = gdk_win32_get_colormap;
 
   drawable_class->get_depth = gdk_win32_get_depth;
@@ -98,8 +94,6 @@ _gdk_drawable_impl_win32_init (GdkDrawableImplWin32 *impl)
 static void
 gdk_drawable_impl_win32_finalize (GObject *object)
 {
-  gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
   G_OBJECT_CLASS (_gdk_drawable_impl_win32_parent_class)->finalize (object);
 }
 
@@ -113,22 +107,6 @@ gdk_win32_get_colormap (GdkDrawable *drawable)
   return GDK_DRAWABLE_IMPL_WIN32 (drawable)->colormap;
 }
 
-static void
-gdk_win32_set_colormap (GdkDrawable *drawable,
-			GdkColormap *colormap)
-{
-  GdkDrawableImplWin32 *impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 /* Drawing
  */
 
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 0bacc1d..d41c5c6 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -38,8 +38,6 @@
 #include "gdkenumtypes.h"
 
 static GdkColormap* gdk_window_impl_win32_get_colormap (GdkDrawable *drawable);
-static void         gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
-							GdkColormap *cmap);
 static void gdk_window_impl_win32_init       (GdkWindowImplWin32      *window);
 static void gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass);
 static void gdk_window_impl_win32_finalize   (GObject                 *object);
@@ -134,7 +132,6 @@ gdk_window_impl_win32_class_init (GdkWindowImplWin32Class *klass)
 
   object_class->finalize = gdk_window_impl_win32_finalize;
 
-  drawable_class->set_colormap = gdk_window_impl_win32_set_colormap;
   drawable_class->get_colormap = gdk_window_impl_win32_get_colormap;
 }
 
@@ -211,28 +208,6 @@ gdk_window_impl_win32_get_colormap (GdkDrawable *drawable)
   return drawable_impl->colormap;
 }
 
-static void
-gdk_window_impl_win32_set_colormap (GdkDrawable *drawable,
-				    GdkColormap *cmap)
-{
-  GdkWindowImplWin32 *impl;
-  GdkDrawableImplWin32 *draw_impl;
-  
-  g_return_if_fail (GDK_IS_WINDOW_IMPL_WIN32 (drawable));
-
-  impl = GDK_WINDOW_IMPL_WIN32 (drawable);
-  draw_impl = GDK_DRAWABLE_IMPL_WIN32 (drawable);
-
-  /* chain up */
-  GDK_DRAWABLE_CLASS (parent_class)->set_colormap (drawable, cmap);
-  
-  if (cmap)
-    {
-      /* XXX */
-      g_print ("gdk_window_impl_win32_set_colormap: XXX\n");
-    }
-}
-
 void
 _gdk_root_window_size_init (void)
 {
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index a715bd1..2011a1c 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -44,16 +44,11 @@ static cairo_surface_t *gdk_x11_create_cairo_surface (GdkDrawable *drawable,
                                                       int          width,
                                                       int          height);
      
-static void gdk_x11_set_colormap   (GdkDrawable    *drawable,
-                                    GdkColormap    *colormap);
-
 static GdkColormap* gdk_x11_get_colormap   (GdkDrawable    *drawable);
 static gint         gdk_x11_get_depth      (GdkDrawable    *drawable);
 static GdkScreen *  gdk_x11_get_screen	   (GdkDrawable    *drawable);
 static GdkVisual*   gdk_x11_get_visual     (GdkDrawable    *drawable);
 
-static void gdk_drawable_impl_x11_finalize   (GObject *object);
-
 static const cairo_user_data_key_t gdk_x11_cairo_key;
 
 G_DEFINE_TYPE (GdkDrawableImplX11, _gdk_drawable_impl_x11, GDK_TYPE_DRAWABLE)
@@ -62,14 +57,10 @@ static void
 _gdk_drawable_impl_x11_class_init (GdkDrawableImplX11Class *klass)
 {
   GdkDrawableClass *drawable_class = GDK_DRAWABLE_CLASS (klass);
-  GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  
-  object_class->finalize = gdk_drawable_impl_x11_finalize;
   
   drawable_class->ref_cairo_surface = gdk_x11_ref_cairo_surface;
   drawable_class->create_cairo_surface = gdk_x11_create_cairo_surface;
 
-  drawable_class->set_colormap = gdk_x11_set_colormap;
   drawable_class->get_colormap = gdk_x11_get_colormap;
 
   drawable_class->get_depth = gdk_x11_get_depth;
@@ -82,14 +73,6 @@ _gdk_drawable_impl_x11_init (GdkDrawableImplX11 *impl)
 {
 }
 
-static void
-gdk_drawable_impl_x11_finalize (GObject *object)
-{
-  gdk_drawable_set_colormap (GDK_DRAWABLE (object), NULL);
-
-  G_OBJECT_CLASS (_gdk_drawable_impl_x11_parent_class)->finalize (object);
-}
-
 /**
  * _gdk_x11_drawable_finish:
  * @drawable: a #GdkDrawableImplX11.
@@ -144,24 +127,6 @@ gdk_x11_get_colormap (GdkDrawable *drawable)
   return impl->colormap;
 }
 
-static void
-gdk_x11_set_colormap (GdkDrawable *drawable,
-                      GdkColormap *colormap)
-{
-  GdkDrawableImplX11 *impl;
-
-  impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  if (impl->colormap == colormap)
-    return;
-  
-  if (impl->colormap)
-    g_object_unref (impl->colormap);
-  impl->colormap = colormap;
-  if (impl->colormap)
-    g_object_ref (impl->colormap);
-}
-
 static gint
 gdk_x11_get_depth (GdkDrawable *drawable)
 {
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index ad51e8c..f27ffe0 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -112,8 +112,6 @@ static void     gdk_window_x11_set_background     (GdkWindow      *window,
                                                    cairo_pattern_t *pattern);
 
 static GdkColormap* gdk_window_impl_x11_get_colormap (GdkDrawable *drawable);
-static void         gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
-						      GdkColormap *cmap);
 static void        gdk_window_impl_x11_finalize   (GObject            *object);
 static void        gdk_window_impl_iface_init     (GdkWindowImplIface *iface);
 
@@ -182,7 +180,6 @@ gdk_window_impl_x11_class_init (GdkWindowImplX11Class *klass)
   
   object_class->finalize = gdk_window_impl_x11_finalize;
 
-  drawable_class->set_colormap = gdk_window_impl_x11_set_colormap;
   drawable_class->get_colormap = gdk_window_impl_x11_get_colormap;
 }
 
@@ -454,35 +451,6 @@ gdk_window_impl_x11_get_colormap (GdkDrawable *drawable)
   return drawable_impl->colormap;
 }
 
-static void
-gdk_window_impl_x11_set_colormap (GdkDrawable *drawable,
-                                  GdkColormap *cmap)
-{
-  GdkDrawableImplX11 *draw_impl;
-  
-  g_return_if_fail (GDK_IS_WINDOW_IMPL_X11 (drawable));
-
-  draw_impl = GDK_DRAWABLE_IMPL_X11 (drawable);
-
-  if (cmap && GDK_WINDOW_DESTROYED (draw_impl->wrapper))
-    return;
-
-  /* chain up */
-  GDK_DRAWABLE_CLASS (gdk_window_impl_x11_parent_class)->set_colormap (drawable, cmap);
-
-  if (cmap)
-    {
-      XSetWindowColormap (GDK_SCREEN_XDISPLAY (draw_impl->screen),
-                          draw_impl->xid,
-                          GDK_COLORMAP_XCOLORMAP (cmap));
-
-      if (((GdkWindowObject*)draw_impl->wrapper)->window_type !=
-          GDK_WINDOW_TOPLEVEL)
-        gdk_window_add_colormap_windows (GDK_WINDOW (draw_impl->wrapper));
-    }
-}
-
-
 void
 _gdk_windowing_window_init (GdkScreen * screen)
 {



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