[gtk+/rendering-cleanup: 14/55] x11: Move xid member from GdkDrawableImplX11 to GdkWindowImplX11



commit c1859ee6a3f43303d7ba622861bd57a1d7371ff1
Author: Benjamin Otte <otte redhat com>
Date:   Wed Oct 6 02:15:51 2010 +0200

    x11: Move xid member from GdkDrawableImplX11 to GdkWindowImplX11

 gdk/x11/gdkdrawable-x11.c |    2 +-
 gdk/x11/gdkdrawable-x11.h |    2 --
 gdk/x11/gdkwindow-x11.c   |   25 ++++++++++++-------------
 gdk/x11/gdkwindow-x11.h   |    2 ++
 gdk/x11/gdkx.h            |    4 ++--
 5 files changed, 17 insertions(+), 18 deletions(-)
---
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 73dbcd3..15808f3 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -123,7 +123,7 @@ gdk_x11_create_cairo_surface (GdkDrawable *drawable,
     
   visual = gdk_window_get_visual (impl->wrapper);
   return cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (impl->wrapper),
-                                    impl->xid,
+                                    GDK_WINDOW_IMPL_X11 (impl)->xid,
                                     GDK_VISUAL_XVISUAL (visual),
                                     width, height);
 }
diff --git a/gdk/x11/gdkdrawable-x11.h b/gdk/x11/gdkdrawable-x11.h
index e4996a8..70a92d7 100644
--- a/gdk/x11/gdkdrawable-x11.h
+++ b/gdk/x11/gdkdrawable-x11.h
@@ -51,8 +51,6 @@ struct _GdkDrawableImplX11
 
   GdkDrawable *wrapper;
   
-  Window xid;
-
   cairo_surface_t *cairo_surface;
 };
  
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 6303132..dad4861 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -196,7 +196,7 @@ gdk_window_impl_x11_finalize (GObject *object)
     {
       GdkDisplay *display = GDK_WINDOW_DISPLAY ((GdkWindow *) wrapper);
       
-      _gdk_xid_table_remove (display, draw_impl->xid);
+      _gdk_xid_table_remove (display, window_impl->xid);
       if (window_impl->toplevel && window_impl->toplevel->focus_window)
 	_gdk_xid_table_remove (display, window_impl->toplevel->focus_window);
     }
@@ -439,7 +439,7 @@ _gdk_windowing_window_init (GdkScreen * screen)
 
   draw_impl = GDK_DRAWABLE_IMPL_X11 (private->impl);
   
-  draw_impl->xid = screen_x11->xroot_window;
+  GDK_WINDOW_IMPL_X11 (draw_impl)->xid = screen_x11->xroot_window;
   draw_impl->wrapper = GDK_DRAWABLE (private);
   
   private->window_type = GDK_WINDOW_ROOT;
@@ -665,7 +665,6 @@ _gdk_window_impl_new (GdkWindow     *window,
   Window xparent;
   Visual *xvisual;
   Display *xdisplay;
-  Window xid;
 
   XSetWindowAttributes xattributes;
   long xattributes_mask;
@@ -765,15 +764,15 @@ _gdk_window_impl_new (GdkWindow     *window,
 	private->height = 65535;
     }
   
-  xid = draw_impl->xid = XCreateWindow (xdisplay, xparent,
-					private->x + private->parent->abs_x,
-					private->y + private->parent->abs_y,
-					private->width, private->height,
-					0, private->depth, class, xvisual,
-					xattributes_mask, &xattributes);
+  impl->xid = XCreateWindow (xdisplay, xparent,
+                             private->x + private->parent->abs_x,
+                             private->y + private->parent->abs_y,
+                             private->width, private->height,
+                             0, private->depth, class, xvisual,
+                             xattributes_mask, &xattributes);
 
   g_object_ref (window);
-  _gdk_xid_table_insert (screen_x11->display, &draw_impl->xid, window);
+  _gdk_xid_table_insert (screen_x11->display, &impl->xid, window);
 
   switch (GDK_WINDOW_TYPE (private))
     {
@@ -791,7 +790,7 @@ _gdk_window_impl_new (GdkWindow     *window,
 	  class_hint = XAllocClassHint ();
 	  class_hint->res_name = attributes->wmclass_name;
 	  class_hint->res_class = attributes->wmclass_class;
-	  XSetClassHint (xdisplay, xid, class_hint);
+	  XSetClassHint (xdisplay, impl->xid, class_hint);
 	  XFree (class_hint);
 	}
   
@@ -904,7 +903,7 @@ gdk_window_foreign_new_for_display (GdkDisplay     *display,
   
   private->parent->children = g_list_prepend (private->parent->children, window);
 
-  draw_impl->xid = anid;
+  impl->xid = anid;
 
   private->x = attrs.x;
   private->y = attrs.y;
@@ -5615,6 +5614,6 @@ gdk_x11_window_get_xid (GdkWindow *window)
   
   impl = ((GdkWindowObject *) window)->impl;
 
-  return ((GdkDrawableImplX11 *)impl)->xid;
+  return ((GdkWindowImplX11 *)impl)->xid;
 }
 
diff --git a/gdk/x11/gdkwindow-x11.h b/gdk/x11/gdkwindow-x11.h
index d9c617f..57ba01a 100644
--- a/gdk/x11/gdkwindow-x11.h
+++ b/gdk/x11/gdkwindow-x11.h
@@ -58,6 +58,8 @@ struct _GdkWindowImplX11
 {
   GdkDrawableImplX11 parent_instance;
 
+  Window xid;
+
   GdkToplevelX11 *toplevel;	/* Toplevel-specific information */
   GdkCursor *cursor;
   GHashTable *device_cursor;
diff --git a/gdk/x11/gdkx.h b/gdk/x11/gdkx.h
index 9e736e1..0a6178e 100644
--- a/gdk/x11/gdkx.h
+++ b/gdk/x11/gdkx.h
@@ -117,8 +117,8 @@ gint     gdk_x11_get_default_screen       (void);
  * Returns: an Xlib <type>Display*</type>.
  */
 #define GDK_WINDOW_XDISPLAY(win)      (GDK_SCREEN_X11 (GDK_WINDOW_SCREEN (win))->xdisplay)
-#define GDK_WINDOW_XID(win)           (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
-#define GDK_WINDOW_XWINDOW(win)       (GDK_DRAWABLE_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
+#define GDK_WINDOW_XID(win)           (GDK_WINDOW_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
+#define GDK_WINDOW_XWINDOW(win)	      (GDK_WINDOW_IMPL_X11(((GdkWindowObject *)win)->impl)->xid)
 
 #define GDK_SCREEN_XDISPLAY(screen)   (GDK_SCREEN_X11 (screen)->xdisplay)
 



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