[gtk+/client-side-windows: 54/284] Make gdk_windowing_window_destroy a GdkWindowImpl method



commit 0ba99e6e7b522973ab2721b13c9dd5c488eeeb66
Author: Alexander Larsson <alexl redhat com>
Date:   Mon Dec 15 15:04:44 2008 +0100

    Make gdk_windowing_window_destroy a GdkWindowImpl method
---
 gdk/gdkinternals.h       |   19 -------------------
 gdk/gdkoffscreenwindow.c |    8 +++++---
 gdk/gdkwindow.c          |    5 +----
 gdk/gdkwindowimpl.h      |   18 +++++++++++++++++-
 gdk/x11/gdkwindow-x11.c  |    9 +++++----
 5 files changed, 28 insertions(+), 31 deletions(-)

diff --git a/gdk/gdkinternals.h b/gdk/gdkinternals.h
index ecc9b09..322825f 100644
--- a/gdk/gdkinternals.h
+++ b/gdk/gdkinternals.h
@@ -360,23 +360,6 @@ gint _gdk_windowing_get_bits_for_depth (GdkDisplay *display,
 #define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)
 
 
-/* Called to do the windowing system specific part of gdk_window_destroy(),
- *
- * window: The window being destroyed
- * recursing: If TRUE, then this is being called because a parent
- *            was destroyed. This generally means that the call to the windowing system
- *            to destroy the window can be omitted, since it will be destroyed as a result
- *            of the parent being destroyed. Unless @foreign_destroy
- *            
- * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
- *            agency. The window has already been destroyed and no windowing
- *            system calls should be made. (This may never happen for some
- *            windowing systems.)
- */
-void _gdk_windowing_window_destroy (GdkWindow *window,
-				    gboolean   recursing,
-				    gboolean   foreign_destroy);
-
 /* Called when gdk_window_destroy() is called on a foreign window
  * or an ancestor of the foreign window. It should generally reparent
  * the window out of it's current heirarchy, hide it, and then
@@ -546,8 +529,6 @@ void       _gdk_offscreen_window_new                 (GdkWindow     *window,
 						      GdkVisual     *visual,
 						      GdkWindowAttr *attributes,
 						      gint           attributes_mask);
-void       _gdk_offscreen_window_destroy             (GdkWindow     *window,
-                                                      gboolean       recursing);
 
 
 /************************************
diff --git a/gdk/gdkoffscreenwindow.c b/gdk/gdkoffscreenwindow.c
index 03b52a6..9b17bf8 100644
--- a/gdk/gdkoffscreenwindow.c
+++ b/gdk/gdkoffscreenwindow.c
@@ -103,9 +103,10 @@ gdk_offscreen_window_init (GdkOffscreenWindow *window)
 {
 }
 
-void
-_gdk_offscreen_window_destroy (GdkWindow *window,
-                               gboolean   recursing)
+static void
+gdk_offscreen_window_destroy (GdkWindow *window,
+			      gboolean   recursing,
+			      gboolean   foreign_destroy)
 {
   GdkWindowObject *private = GDK_WINDOW_OBJECT (window);
   GdkOffscreenWindow *offscreen;
@@ -1184,6 +1185,7 @@ gdk_offscreen_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->queue_antiexpose = gdk_offscreen_window_queue_antiexpose;
   iface->queue_translation = gdk_offscreen_window_queue_translation;
   iface->get_origin = gdk_offscreen_window_get_origin;
+  iface->destroy = gdk_offscreen_window_destroy;
 }
 
 #define __GDK_OFFSCREEN_WINDOW_C__
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 8bcdd37..dd8cdfc 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1261,10 +1261,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
 
 	  if (gdk_window_has_impl (private))
 	    {
-	      if (gdk_window_is_offscreen (private))
-		_gdk_offscreen_window_destroy (window, recursing);
-	      else
-		_gdk_windowing_window_destroy (window, recursing, foreign_destroy);
+	      GDK_WINDOW_IMPL_GET_IFACE (private->impl)->destroy (window, recursing, foreign_destroy);
 	    }
 	  else
 	    {
diff --git a/gdk/gdkwindowimpl.h b/gdk/gdkwindowimpl.h
index ad1f620..eff05b9 100644
--- a/gdk/gdkwindowimpl.h
+++ b/gdk/gdkwindowimpl.h
@@ -112,7 +112,23 @@ struct _GdkWindowImplIface
 					 GdkRegion       *area,
 					 gint            dx,
 					 gint            dy);
-  
+
+/* Called to do the windowing system specific part of gdk_window_destroy(),
+ *
+ * window: The window being destroyed
+ * recursing: If TRUE, then this is being called because a parent
+ *            was destroyed. This generally means that the call to the windowing system
+ *            to destroy the window can be omitted, since it will be destroyed as a result
+ *            of the parent being destroyed. Unless @foreign_destroy
+ *            
+ * foreign_destroy: If TRUE, the window or a parent was destroyed by some external 
+ *            agency. The window has already been destroyed and no windowing
+ *            system calls should be made. (This may never happen for some
+ *            windowing systems.)
+ */
+  void         (* destroy)              (GdkWindow       *window,
+					 gboolean         recursing,
+					 gboolean         foreign_destroy);
 };
 
 /* Interface Functions */
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 3b6d563..6a51cf7 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1001,10 +1001,10 @@ gdk_toplevel_x11_free_contents (GdkDisplay *display,
 #endif
 }
 
-void
-_gdk_windowing_window_destroy (GdkWindow *window,
-			       gboolean   recursing,
-			       gboolean   foreign_destroy)
+static void
+_gdk_x11_window_destroy (GdkWindow *window,
+			 gboolean   recursing,
+			 gboolean   foreign_destroy)
 {
   GdkWindowObject *private = (GdkWindowObject *)window;
   GdkToplevelX11 *toplevel;
@@ -5926,6 +5926,7 @@ gdk_window_impl_iface_init (GdkWindowImplIface *iface)
   iface->set_static_gravities = gdk_window_x11_set_static_gravities;
   iface->queue_antiexpose = _gdk_x11_window_queue_antiexpose;
   iface->queue_translation = _gdk_x11_window_queue_translation;
+  iface->destroy = _gdk_x11_window_destroy;
 }
 
 #define __GDK_WINDOW_X11_C__



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