[gtk+] Remove some deprecated stuff from GdkWindow



commit 2b64a7fd54f7fe573b263de870d5f8b53255a901
Author: Javier Jardón <jjardon gnome org>
Date:   Wed May 12 04:25:46 2010 +0200

    Remove some deprecated stuff from GdkWindow
    
    Also, substitute the deprecated functions with the correct ones

 docs/faq/gtk-faq.sgml                      |    2 +-
 docs/reference/gdk/gdk3-sections.txt       |   10 ---
 docs/reference/gdk/tmpl/event_structs.sgml |    2 +-
 docs/reference/gdk/tmpl/windows.sgml       |   88 ----------------------------
 docs/reference/gdk/tmpl/x_interaction.sgml |    8 ---
 gdk/directfb/gdkwindow-directfb.c          |   20 ------
 gdk/gdk.symbols                            |    3 -
 gdk/gdkwindow.h                            |   23 -------
 gdk/quartz/gdkwindow-quartz.c              |   19 +-----
 gdk/testgdk.c                              |   12 ++--
 gdk/win32/gdkdnd-win32.c                   |    2 +-
 gdk/win32/gdkwin32.h                       |    2 -
 gdk/win32/gdkwindow-win32.c                |   46 --------------
 gdk/x11/gdkwindow-x11.c                    |   66 ---------------------
 gtk/gtkwidget.c                            |    4 +-
 15 files changed, 14 insertions(+), 293 deletions(-)
---
diff --git a/docs/faq/gtk-faq.sgml b/docs/faq/gtk-faq.sgml
index 481f17f..0da5e48 100644
--- a/docs/faq/gtk-faq.sgml
+++ b/docs/faq/gtk-faq.sgml
@@ -3102,7 +3102,7 @@ like this:</para>
   gc = gdk_gc_new(widget->window);
 
   /* find proper dimensions for rectangle */
-  gdk_window_get_size(widget->window, &amp;width, &amp;height);
+  gdk_drawable_get_size(widget->window, &amp;width, &amp;height);
 
   /* the color we want to use */
   color = (GdkColor *)malloc(sizeof(GdkColor));
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 065a670..58d069a 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -612,8 +612,6 @@ GdkWindowAttr
 GdkWindowAttributesType
 gdk_window_new
 gdk_window_destroy
-gdk_window_ref
-gdk_window_unref
 gdk_window_get_window_type
 gdk_window_at_pointer
 gdk_window_show
@@ -647,7 +645,6 @@ gdk_window_reparent
 gdk_window_clear
 gdk_window_clear_area
 gdk_window_clear_area_e
-gdk_window_copy_area
 gdk_window_raise
 gdk_window_lower
 gdk_window_restack
@@ -696,14 +693,12 @@ gdk_window_input_shape_combine_region
 gdk_window_set_child_input_shapes
 gdk_window_merge_child_input_shapes
 gdk_window_set_static_gravities
-gdk_window_set_hints
 gdk_window_set_title
 gdk_window_set_background
 gdk_window_set_back_pixmap
 GDK_PARENT_RELATIVE
 gdk_window_set_cursor
 gdk_window_get_cursor
-gdk_window_set_colormap
 gdk_window_get_user_data
 gdk_window_get_geometry
 gdk_window_set_geometry_hints
@@ -717,10 +712,6 @@ gdk_window_set_urgency_hint
 gdk_window_get_position
 gdk_window_get_root_origin
 gdk_window_get_frame_extents
-gdk_window_get_size
-gdk_window_get_visual
-gdk_window_get_colormap
-gdk_window_get_type
 gdk_window_get_origin
 gdk_window_get_deskrelative_origin
 gdk_window_get_root_coords
@@ -1237,7 +1228,6 @@ gdk_drag_context_get_type
 <TITLE>X Window System Interaction</TITLE>
 <FILE>x_interaction</FILE>
 GDK_ROOT_WINDOW
-GDK_ROOT_PARENT
 GDK_DISPLAY
 GDK_WINDOW_XDISPLAY
 GDK_WINDOW_XID
diff --git a/docs/reference/gdk/tmpl/event_structs.sgml b/docs/reference/gdk/tmpl/event_structs.sgml
index 42c54b0..2ba3139 100644
--- a/docs/reference/gdk/tmpl/event_structs.sgml
+++ b/docs/reference/gdk/tmpl/event_structs.sgml
@@ -383,7 +383,7 @@ union, 16-bit data uses the s array, and 32-bit data uses the l array.
 <!-- ##### STRUCT GdkEventNoExpose ##### -->
 <para>
 Generated when the area of a #GdkDrawable being copied, with gdk_draw_drawable()
-or gdk_window_copy_area(), was completely available.
+, was completely available.
 </para>
 <para>
 FIXME: add more here.
diff --git a/docs/reference/gdk/tmpl/windows.sgml b/docs/reference/gdk/tmpl/windows.sgml
index 0b2d714..c2e725e 100644
--- a/docs/reference/gdk/tmpl/windows.sgml
+++ b/docs/reference/gdk/tmpl/windows.sgml
@@ -510,21 +510,6 @@ corresponding flag in #GdkWindowAttributesType.
 @window: 
 
 
-<!-- ##### MACRO gdk_window_ref ##### -->
-<para>
-Deprecated equivalent of g_object_ref()
-</para>
-
- Returns: the window
-
-
-<!-- ##### MACRO gdk_window_unref ##### -->
-<para>
-Deprecated equivalent of g_object_unref()
-</para>
-
-
-
 <!-- ##### FUNCTION gdk_window_get_window_type ##### -->
 <para>
 
@@ -825,26 +810,6 @@ Deprecated equivalent of g_object_unref()
 @height: 
 
 
-<!-- ##### MACRO gdk_window_copy_area ##### -->
-<para>
-Deprecated equivalent to gdk_draw_drawable(), see that function for docs
-</para>
-
- drawable: a #GdkDrawable
- gc: a #GdkGC sharing the drawable's visual and colormap
- x: X position in @drawable where the rectangle should be drawn
- y: Y position in @drawable where the rectangle should be drawn
- source_drawable: the source #GdkDrawable, which may be the same as @drawable
- source_x: X position in @src of rectangle to draw
- source_y: Y position in @src of rectangle to draw
- width: width of rectangle to draw, or -1 for entire @src width
- height: height of rectangle to draw, or -1 for entire @src height
-<!-- # Unused Parameters # -->
- drawable: a #GdkDrawable
- xdest: X position in @drawable where the rectangle should be drawn
- ydest: Y position in @drawable where the rectangle should be drawn
-
-
 <!-- ##### FUNCTION gdk_window_raise ##### -->
 <para>
 
@@ -1248,21 +1213,6 @@ backend, <type>MSG</type>s for Win32).
 @Returns: 
 
 
-<!-- ##### FUNCTION gdk_window_set_hints ##### -->
-<para>
-
-</para>
-
- window: 
- x: 
- y: 
- min_width: 
- min_height: 
- max_width: 
- max_height: 
- flags: 
-
-
 <!-- ##### FUNCTION gdk_window_set_title ##### -->
 <para>
 
@@ -1318,13 +1268,6 @@ window.
 @Returns: 
 
 
-<!-- ##### MACRO gdk_window_set_colormap ##### -->
-<para>
-Deprecated equivalent to gdk_drawable_set_colormap()
-</para>
-
-
-
 <!-- ##### FUNCTION gdk_window_get_user_data ##### -->
 <para>
 
@@ -1449,37 +1392,6 @@ Deprecated equivalent to gdk_drawable_set_colormap()
 @rect: 
 
 
-<!-- ##### MACRO gdk_window_get_size ##### -->
-<para>
-Deprecated equivalent of gdk_drawable_get_size().
-</para>
-
-
-
-<!-- ##### MACRO gdk_window_get_visual ##### -->
-<para>
-Deprecated equivalent of gdk_drawable_get_visual().
-</para>
-
- Returns: the #GdkVisual of the window
-
-
-<!-- ##### MACRO gdk_window_get_colormap ##### -->
-<para>
-Deprecated equivalent of gdk_drawable_get_colormap().
-</para>
-
- Returns: colormap for the window
-
-
-<!-- ##### MACRO gdk_window_get_type ##### -->
-<para>
-Deprecated equivalent of gdk_drawable_get_type().
-</para>
-
- Returns: type of drawable
-
-
 <!-- ##### FUNCTION gdk_window_get_origin ##### -->
 <para>
 
diff --git a/docs/reference/gdk/tmpl/x_interaction.sgml b/docs/reference/gdk/tmpl/x_interaction.sgml
index 66a5a07..350073f 100644
--- a/docs/reference/gdk/tmpl/x_interaction.sgml
+++ b/docs/reference/gdk/tmpl/x_interaction.sgml
@@ -26,14 +26,6 @@ Obtains the Xlib window id of the root window of the current screen.
 </para>
 
 
-
-<!-- ##### MACRO GDK_ROOT_PARENT ##### -->
-<para>
-Obtains the Xlib window id of the root window of the default screen.
-</para>
-
-
-
 <!-- ##### MACRO GDK_DISPLAY ##### -->
 <para>
 The current display.
diff --git a/gdk/directfb/gdkwindow-directfb.c b/gdk/directfb/gdkwindow-directfb.c
index e35da69..83da5b8 100644
--- a/gdk/directfb/gdkwindow-directfb.c
+++ b/gdk/directfb/gdkwindow-directfb.c
@@ -1527,26 +1527,6 @@ gdk_window_directfb_lower (GdkWindow *window)
 }
 
 void
-gdk_window_set_hints (GdkWindow *window,
-                      gint       x,
-                      gint       y,
-                      gint       min_width,
-                      gint       min_height,
-                      gint       max_width,
-                      gint       max_height,
-                      gint       flags)
-{
-  g_return_if_fail (GDK_IS_WINDOW (window));
-
-  if (GDK_WINDOW_DESTROYED (window))
-    return;
-
-  D_DEBUG_AT( GDKDFB_Window, "%s( %p, %3d,%3d, min %4dx%4d, max %4dx%4d, flags 0x%08x )\n", G_STRFUNC,
-              window, x,y, min_width, min_height, max_width, max_height, flags );
-  /* N/A */
-}
-
-void
 gdk_window_set_geometry_hints (GdkWindow         *window,
                                const GdkGeometry *geometry,
                                GdkWindowHints     geom_mask)
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 992d276..8f1aaf3 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -744,9 +744,6 @@ gdk_window_foreign_new_for_display
 gdk_window_focus
 gdk_window_lookup
 gdk_window_lookup_for_display
-#ifndef GDK_DISABLE_DEPRECATED
-gdk_window_set_hints
-#endif
 gdk_window_get_type_hint
 gdk_window_set_type_hint
 gdk_window_set_modal_hint
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index f901f28..5d2ade8 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -475,16 +475,6 @@ GdkWindow*    gdk_window_lookup_for_display (GdkDisplay      *display,
 
 /* GdkWindow */
 
-#ifndef GDK_DISABLE_DEPRECATED
-void	      gdk_window_set_hints	 (GdkWindow	  *window,
-					  gint		   x,
-					  gint		   y,
-					  gint		   min_width,
-					  gint		   min_height,
-					  gint		   max_width,
-					  gint		   max_height,
-					  gint		   flags);
-#endif
 void              gdk_window_set_type_hint (GdkWindow        *window,
                                             GdkWindowTypeHint hint);
 GdkWindowTypeHint gdk_window_get_type_hint (GdkWindow        *window);
@@ -699,19 +689,6 @@ void       gdk_window_redirect_to_drawable   (GdkWindow     *window,
                                               gint           height);
 void       gdk_window_remove_redirection     (GdkWindow     *window);
 
-#ifndef GDK_DISABLE_DEPRECATED
-#define GDK_ROOT_PARENT()             (gdk_get_default_root_window ())
-#define gdk_window_get_size            gdk_drawable_get_size
-#define gdk_window_get_type            gdk_window_get_window_type
-#define gdk_window_get_colormap        gdk_drawable_get_colormap
-#define gdk_window_set_colormap        gdk_drawable_set_colormap
-#define gdk_window_get_visual          gdk_drawable_get_visual
-#define gdk_window_ref                 g_object_ref
-#define gdk_window_unref               g_object_unref
-
-#define gdk_window_copy_area(drawable,gc,x,y,source_drawable,source_x,source_y,width,height) \
-   gdk_draw_pixmap(drawable,gc,source_drawable,source_x,source_y,x,y,width,height)
-#endif /* GDK_DISABLE_DEPRECATED */
 
 G_END_DECLS
 
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index a8e385f..9717b31 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -1333,9 +1333,9 @@ move_resize_window_internal (GdkWindow *window,
       old_visible.x = -private->x;
       old_visible.y = -private->y;
 
-      gdk_window_get_size (GDK_DRAWABLE (private->parent), 
-                           &old_visible.width, 
-                           &old_visible.height);
+      gdk_drawable_get_size (GDK_DRAWABLE (private->parent),
+                             &old_visible.width,
+                             &old_visible.height);
     }
 
   if (x != -1)
@@ -2341,19 +2341,6 @@ gdk_window_focus (GdkWindow *window,
     }
 }
 
-void
-gdk_window_set_hints (GdkWindow *window,
-		      gint       x,
-		      gint       y,
-		      gint       min_width,
-		      gint       min_height,
-		      gint       max_width,
-		      gint       max_height,
-		      gint       flags)
-{
-  /* FIXME: Implement */
-}
-
 static
 gint window_type_hint_to_level (GdkWindowTypeHint hint)
 {
diff --git a/gdk/testgdk.c b/gdk/testgdk.c
index 9b4687c..0532ab2 100644
--- a/gdk/testgdk.c
+++ b/gdk/testgdk.c
@@ -361,7 +361,7 @@ test_pixmaps (gint depth)
       {
 	pixmap = gdk_pixmap_new (NULL, width, height, depth);
 	ASSERT (pixmap != NULL);
-	gdk_window_get_size (pixmap, &w, &h);
+	gdk_drawable_get_size (pixmap, &w, &h);
 	QTESTF (w == width, (" w:%d", w));
 	QTESTF (h == height, (" h:%d", h));
 	image = gdk_drawable_get_image (pixmap, 0, 0, w, h);
@@ -444,10 +444,10 @@ test_temp_windows (void)
 	gdk_window_get_geometry (window, &x, &y, &w, &h, &d);
 	QTESTF (w == 37, ("w:%d", w));
 	QTESTF (h == 19, ("h:%d", h));
-	visual = gdk_window_get_visual (window);
+	visual = gdk_drawable_get_visual (window);
 	QTEST (visual == system_visual);
 	gdk_window_hide (window);
-	gdk_window_unref (window);
+	g_object_unref (window);
       }
   TEST (retval);
 }
@@ -600,7 +600,7 @@ test_one_line_on_drawable (GdkDrawable *drawable,
   line_width = gcvalues.line_width > 0 ? gcvalues.line_width : 1;
   w_up = w_left = line_width/2;
   w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
-  gdk_window_get_size (drawable, &w, &h);
+  gdk_drawable_get_size (drawable, &w, &h);
   oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
 
   if (depth == 32)
@@ -714,7 +714,7 @@ test_one_rectangle_on_drawable (GdkDrawable *drawable,
       w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
     }
 
-  gdk_window_get_size (drawable, &w, &h);
+  gdk_drawable_get_size (drawable, &w, &h);
   oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
 
   if (depth == 32)
@@ -820,7 +820,7 @@ test_some_arcs_on_drawable (GdkDrawable *drawable,
       w_down = w_right = (line_width & 1) ? line_width/2 : line_width/2-1;
     }
 
-  gdk_window_get_size (drawable, &w, &h);
+  gdk_drawable_get_size (drawable, &w, &h);
   oldimage = gdk_drawable_get_image (drawable, 0, 0, w, h);
 
   if (depth == 32)
diff --git a/gdk/win32/gdkdnd-win32.c b/gdk/win32/gdkdnd-win32.c
index dc34afe..f0b57a9 100644
--- a/gdk/win32/gdkdnd-win32.c
+++ b/gdk/win32/gdkdnd-win32.c
@@ -2359,7 +2359,7 @@ gdk_window_register_dnd (GdkWindow *window)
 	    OTHER_API_FAILED ("RegisterDragDrop");
 	  else
 	    {
-	      gdk_window_ref (window);
+	      g_object_ref (window);
 	      g_hash_table_insert (target_ctx_for_window, GDK_WINDOW_HWND (window), ctx);
 	    }
 	}
diff --git a/gdk/win32/gdkwin32.h b/gdk/win32/gdkwin32.h
index bf1fd4b..401bca8 100644
--- a/gdk/win32/gdkwin32.h
+++ b/gdk/win32/gdkwin32.h
@@ -41,8 +41,6 @@ G_BEGIN_DECLS
 
 #include "gdkprivate-win32.h"
 
-#undef GDK_ROOT_PARENT /* internal access is direct */
-#define GDK_ROOT_PARENT()             ((GdkWindow *) _gdk_parent_root)
 #define GDK_WINDOW_HWND(win)          (GDK_DRAWABLE_IMPL_WIN32(((GdkWindowObject *)win)->impl)->handle)
 #define GDK_PIXMAP_HBITMAP(pixmap)    (GDK_DRAWABLE_IMPL_WIN32(((GdkPixmapObject *)pixmap)->impl)->handle)
 #define GDK_DRAWABLE_IMPL_WIN32_HANDLE(d) (((GdkDrawableImplWin32 *) d)->handle)
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 598d291..55ca651 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -1461,52 +1461,6 @@ gdk_win32_window_lower (GdkWindow *window)
 }
 
 void
-gdk_window_set_hints (GdkWindow *window,
-		      gint       x,
-		      gint       y,
-		      gint       min_width,
-		      gint       min_height,
-		      gint       max_width,
-		      gint       max_height,
-		      gint       flags)
-{
-  /* Note that this function is obsolete */
-
-  GdkWindowImplWin32 *impl;
-
-  g_return_if_fail (GDK_IS_WINDOW (window));
-  
-  if (GDK_WINDOW_DESTROYED (window))
-    return;
-  
-  impl = GDK_WINDOW_IMPL_WIN32 (GDK_WINDOW_OBJECT (window)->impl);
-
-  GDK_NOTE (MISC, g_print ("gdk_window_set_hints: %p: %dx%d..%dx%d @%+d%+d\n",
-			   GDK_WINDOW_HWND (window),
-			   min_width, min_height, max_width, max_height,
-			   x, y));
-
-  if (flags)
-    {
-      GdkGeometry geom;
-      gint geom_mask = 0;
-
-      geom.min_width  = min_width;
-      geom.min_height = min_height;
-      geom.max_width  = max_width;
-      geom.max_height = max_height;
-
-      if (flags & GDK_HINT_MIN_SIZE)
-        geom_mask |= GDK_HINT_MIN_SIZE;
-
-      if (flags & GDK_HINT_MAX_SIZE)
-        geom_mask |= GDK_HINT_MAX_SIZE;
-
-      gdk_window_set_geometry_hints (window, &geom, geom_mask);
-    }
-}
-
-void
 gdk_window_set_urgency_hint (GdkWindow *window,
 			     gboolean   urgent)
 {
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index e2dd131..2dc074a 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1878,72 +1878,6 @@ gdk_window_focus (GdkWindow *window,
 }
 
 /**
- * gdk_window_set_hints:
- * @window: a #GdkWindow
- * @x: ignored field, does not matter
- * @y: ignored field, does not matter
- * @min_width: minimum width hint
- * @min_height: minimum height hint
- * @max_width: max width hint
- * @max_height: max height hint
- * @flags: logical OR of GDK_HINT_POS, GDK_HINT_MIN_SIZE, and/or GDK_HINT_MAX_SIZE
- *
- * This function is broken and useless and you should ignore it.
- * If using GTK+, use functions such as gtk_window_resize(), gtk_window_set_size_request(),
- * gtk_window_move(), gtk_window_parse_geometry(), and gtk_window_set_geometry_hints(),
- * depending on what you're trying to do.
- *
- * If using GDK directly, use gdk_window_set_geometry_hints().
- * 
- **/
-void
-gdk_window_set_hints (GdkWindow *window,
-		      gint       x,
-		      gint       y,
-		      gint       min_width,
-		      gint       min_height,
-		      gint       max_width,
-		      gint       max_height,
-		      gint       flags)
-{
-  XSizeHints size_hints;
-  
-  if (GDK_WINDOW_DESTROYED (window) ||
-      !WINDOW_IS_TOPLEVEL_OR_FOREIGN (window))
-    return;
-  
-  size_hints.flags = 0;
-  
-  if (flags & GDK_HINT_POS)
-    {
-      size_hints.flags |= PPosition;
-      size_hints.x = x;
-      size_hints.y = y;
-    }
-  
-  if (flags & GDK_HINT_MIN_SIZE)
-    {
-      size_hints.flags |= PMinSize;
-      size_hints.min_width = min_width;
-      size_hints.min_height = min_height;
-    }
-  
-  if (flags & GDK_HINT_MAX_SIZE)
-    {
-      size_hints.flags |= PMaxSize;
-      size_hints.max_width = max_width;
-      size_hints.max_height = max_height;
-    }
-  
-  /* FIXME: Would it be better to delete this property if
-   *        flags == 0? It would save space on the server
-   */
-  XSetWMNormalHints (GDK_WINDOW_XDISPLAY (window),
-		     GDK_WINDOW_XID (window),
-		     &size_hints);
-}
-
-/**
  * gdk_window_set_type_hint:
  * @window: A toplevel #GdkWindow
  * @hint: A hint of the function this window will have
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c97a561..1ef3526 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -2170,8 +2170,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * @event: the #GdkEventNoExpose which triggered this signal
    *
    * The ::no-expose-event will be emitted when the @widget's window is 
-   * drawn as a copy of another #GdkDrawable (with gdk_draw_drawable() or
-   * gdk_window_copy_area()) which was completely unobscured. If the source
+   * drawn as a copy of another #GdkDrawable (with gdk_draw_drawable())
+   * which was completely unobscured. If the source
    * window was partially obscured #GdkEventExpose events will be generated
    * for those areas.
    *



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