[gtk+/rendering-cleanup: 123/141] gdk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual



commit 4a82d92b51dc0df8bd47cb01380e59c74697fd77
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 29 01:32:52 2010 +0200

    gdk: gdk_drawable_get_screen/visual => gdk_window_get_screen/visual

 gdk/gdkdevice.c               |    8 ++++----
 gdk/gdkdnd.c                  |    4 ++--
 gdk/gdkevents.c               |    2 +-
 gdk/gdkwindow.c               |   10 +++++-----
 gdk/quartz/gdkwindow-quartz.c |    2 +-
 gdk/win32/gdkdevice-win32.c   |    2 +-
 gdk/win32/gdkmain-win32.c     |    2 +-
 gdk/win32/gdkwindow-win32.c   |    4 ++--
 gdk/x11/gdkdrawable-x11.c     |    3 +--
 gdk/x11/gdkgeometry-x11.c     |    4 ++--
 gdk/x11/gdkwindow-x11.c       |    8 ++++----
 11 files changed, 24 insertions(+), 25 deletions(-)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 19fa1dc..a6a4d24 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -1241,7 +1241,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
     x_min = axis_info_x->min_value;
   else
     {
-      device_width = gdk_screen_get_width (gdk_drawable_get_screen (window));
+      device_width = gdk_screen_get_width (gdk_window_get_screen (window));
       x_min = 0;
     }
 
@@ -1249,7 +1249,7 @@ _gdk_device_translate_window_coord (GdkDevice *device,
     y_min = axis_info_y->min_value;
   else
     {
-      device_height = gdk_screen_get_height (gdk_drawable_get_screen (window));
+      device_height = gdk_screen_get_height (gdk_window_get_screen (window));
       y_min = 0;
     }
 
@@ -1342,7 +1342,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
   if (axis_info.use == GDK_AXIS_X)
     {
       if (axis_width > 0)
-        scale = gdk_screen_get_width (gdk_drawable_get_screen (window)) / axis_width;
+        scale = gdk_screen_get_width (gdk_window_get_screen (window)) / axis_width;
       else
         scale = 1;
 
@@ -1351,7 +1351,7 @@ _gdk_device_translate_screen_coord (GdkDevice *device,
   else
     {
       if (axis_width > 0)
-        scale = gdk_screen_get_height (gdk_drawable_get_screen (window)) / axis_width;
+        scale = gdk_screen_get_height (gdk_window_get_screen (window)) / axis_width;
       else
         scale = 1;
 
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index b080ebe..3301b87 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -26,8 +26,8 @@
 
 #include "config.h"
 #include <gdkdnd.h>
-#include <gdkdrawable.h>
 #include <gdkdisplay.h>
+#include <gdkwindow.h>
 
 
 /**
@@ -71,7 +71,7 @@ gdk_drag_find_window (GdkDragContext  *context,
 		      GdkDragProtocol *protocol)
 {
   gdk_drag_find_window_for_screen (context, drag_window,
-				   gdk_drawable_get_screen (context->source_window),
+				   gdk_window_get_screen (context->source_window),
 				   x_root, y_root, dest_window, protocol);
 }
 
diff --git a/gdk/gdkevents.c b/gdk/gdkevents.c
index 9d7cbef..e10106b 100644
--- a/gdk/gdkevents.c
+++ b/gdk/gdkevents.c
@@ -1275,7 +1275,7 @@ gdk_event_get_screen (const GdkEvent *event)
     }
 
   if (event->any.window)
-    return gdk_drawable_get_screen (event->any.window);
+    return gdk_window_get_screen (event->any.window);
 
   return NULL;
 }
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 7bcd97e..d106843 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -1274,7 +1274,7 @@ gdk_window_new (GdkWindow     *parent,
       parent = gdk_screen_get_root_window (screen);
     }
   else
-    screen = gdk_drawable_get_screen (parent);
+    screen = gdk_window_get_screen (parent);
 
   g_return_val_if_fail (GDK_IS_WINDOW (parent), NULL);
 
@@ -1396,7 +1396,7 @@ gdk_window_new (GdkWindow     *parent,
 	   ((attributes_mask & GDK_WA_COLORMAP &&
 	     attributes->colormap != gdk_drawable_get_colormap ((GdkDrawable *)private->parent)) ||
 	    (attributes_mask & GDK_WA_VISUAL &&
-	     attributes->visual != gdk_drawable_get_visual ((GdkDrawable *)private->parent))))
+	     attributes->visual != gdk_window_get_visual (GDK_WINDOW (private->parent)))))
     native = TRUE; /* InputOutput window with different colormap or visual than parent, needs native window */
 
   if (gdk_window_is_offscreen (private))
@@ -1551,7 +1551,7 @@ gdk_window_reparent (GdkWindow *window,
       (new_parent && GDK_WINDOW_DESTROYED (new_parent)))
     return;
 
-  screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
+  screen = gdk_window_get_screen (window);
   if (!new_parent)
     new_parent = gdk_screen_get_root_window (screen);
 
@@ -1806,7 +1806,7 @@ gdk_window_ensure_native (GdkWindow *window)
 
   gdk_window_drop_cairo_surface (private);
 
-  screen = gdk_drawable_get_screen (window);
+  screen = gdk_window_get_screen (window);
 
   attributes.colormap = gdk_drawable_get_colormap (window);
 
@@ -1944,7 +1944,7 @@ _gdk_window_destroy_hierarchy (GdkWindow *window,
     return;
 
   display = gdk_drawable_get_display (GDK_DRAWABLE (window));
-  screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
+  screen = gdk_window_get_screen (window);
   temp_window = g_object_get_qdata (G_OBJECT (screen), quark_pointer_window);
   if (temp_window == window)
     g_object_set_qdata (G_OBJECT (screen), quark_pointer_window, NULL);
diff --git a/gdk/quartz/gdkwindow-quartz.c b/gdk/quartz/gdkwindow-quartz.c
index 3f0b2e4..1429780 100644
--- a/gdk/quartz/gdkwindow-quartz.c
+++ b/gdk/quartz/gdkwindow-quartz.c
@@ -1724,7 +1724,7 @@ gdk_window_quartz_get_geometry (GdkWindow *window,
     }
     
   if (depth)
-      *depth = gdk_drawable_get_depth (window);
+      *depth = gdk_visual_get_depth (gdk_window_get_visual (window));
 }
 
 static gint
diff --git a/gdk/win32/gdkdevice-win32.c b/gdk/win32/gdkdevice-win32.c
index 9e4eb81..31c6f5e 100644
--- a/gdk/win32/gdkdevice-win32.c
+++ b/gdk/win32/gdkdevice-win32.c
@@ -300,7 +300,7 @@ gdk_device_win32_query_state (GdkDevice        *device,
     {
       GdkScreen *screen;
 
-      screen = gdk_drawable_get_screen (GDK_DRAWABLE (window));
+      screen = gdk_window_get_screen (window);
       *root_window = gdk_screen_get_root_window (screen);
     }
 
diff --git a/gdk/win32/gdkmain-win32.c b/gdk/win32/gdkmain-win32.c
index 02ab4ea..27764a8 100644
--- a/gdk/win32/gdkmain-win32.c
+++ b/gdk/win32/gdkmain-win32.c
@@ -1045,7 +1045,7 @@ _gdk_win32_drawable_description (GdkDrawable *d)
   g_return_val_if_fail (GDK_IS_DRAWABLE (d), NULL);
 
   gdk_drawable_get_size (d, &width, &height);
-  depth = gdk_drawable_get_depth (d);
+  depth = gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (d)));
 
   return static_printf ("%s:%p:%dx%dx%d",
 			G_OBJECT_TYPE_NAME (d),
diff --git a/gdk/win32/gdkwindow-win32.c b/gdk/win32/gdkwindow-win32.c
index 69be5aa..23e525b 100644
--- a/gdk/win32/gdkwindow-win32.c
+++ b/gdk/win32/gdkwindow-win32.c
@@ -1881,12 +1881,12 @@ gdk_win32_window_get_geometry (GdkWindow *window,
       if (height)
 	*height = rect.bottom - rect.top;
       if (depth)
-	*depth = gdk_drawable_get_visual (window)->depth;
+	*depth = gdk_window_get_visual (window)->depth;
 
       GDK_NOTE (MISC, g_print ("gdk_win32_window_get_geometry: %p: %ldx%ldx%d %+ld%+ld\n",
 			       GDK_WINDOW_HWND (window),
 			       rect.right - rect.left, rect.bottom - rect.top,
-			       gdk_drawable_get_visual (window)->depth,
+			       gdk_window_get_visual (window)->depth,
 			       rect.left, rect.top));
     }
 }
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 2011a1c..c080a22 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -256,7 +256,7 @@ gdk_x11_create_cairo_surface (GdkDrawable *drawable,
   GdkDrawableImplX11 *impl = GDK_DRAWABLE_IMPL_X11 (drawable);
   GdkVisual *visual;
     
-  visual = gdk_drawable_get_visual (drawable);
+  visual = gdk_window_get_visual (impl->wrapper);
   if (visual) 
     return cairo_xlib_surface_create (GDK_SCREEN_XDISPLAY (impl->screen),
 				      impl->xid,
@@ -274,7 +274,6 @@ gdk_x11_create_cairo_surface (GdkDrawable *drawable,
 		 "so why is this code even reached?");
       return NULL;
     }
-  
 }
 
 static cairo_surface_t *
diff --git a/gdk/x11/gdkgeometry-x11.c b/gdk/x11/gdkgeometry-x11.c
index de6ac46..2ec2e08 100644
--- a/gdk/x11/gdkgeometry-x11.c
+++ b/gdk/x11/gdkgeometry-x11.c
@@ -233,8 +233,8 @@ _get_scratch_gc (GdkWindowObject *window, cairo_region_t *clip_region)
   gint n_rects;
   gint depth;
 
-  screen = GDK_SCREEN_X11 (gdk_drawable_get_screen (GDK_DRAWABLE (window)));
-  depth = gdk_drawable_get_depth (GDK_DRAWABLE (window)) - 1;
+  screen = GDK_SCREEN_X11 (gdk_window_get_screen (GDK_WINDOW (window)));
+  depth = gdk_visual_get_depth (gdk_window_get_visual (GDK_WINDOW (window))) - 1;
 
   if (!screen->subwindow_gcs[depth])
     {
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 718ed27..4c13d1f 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -292,7 +292,7 @@ gdk_x11_window_create_pixmap_surface (GdkWindow *window,
                           DefaultDepthOfScreen (GDK_SCREEN_XSCREEN (GDK_WINDOW_SCREEN (window))));
   surface = cairo_xlib_surface_create (GDK_WINDOW_XDISPLAY (window),
                                        pixmap,
-                                       GDK_VISUAL_XVISUAL (gdk_drawable_get_visual (window)),
+                                       GDK_VISUAL_XVISUAL (gdk_window_get_visual (window)),
                                        width, height);
   attach_free_pixmap_handler (surface, GDK_WINDOW_DISPLAY (window), pixmap);
 
@@ -1131,7 +1131,7 @@ _gdk_windowing_window_destroy_foreign (GdkWindow *window)
 static GdkWindow *
 get_root (GdkWindow *window)
 {
-  GdkScreen *screen = gdk_drawable_get_screen (window);
+  GdkScreen *screen = gdk_window_get_screen (window);
 
   return gdk_screen_get_root_window (screen);
 }
@@ -3038,7 +3038,7 @@ _gdk_windowing_get_device_state (GdkDisplay       *display,
                                                   x, y,
                                                   NULL, NULL,
                                                   mask);
-      *screen = gdk_drawable_get_screen (root);
+      *screen = gdk_window_get_screen (root);
     }
   else
     {
@@ -3063,7 +3063,7 @@ _gdk_windowing_get_device_state (GdkDisplay       *display,
       if (root != None)
         {
           GdkWindow *gdk_root = gdk_window_lookup_for_display (display, root);
-          *screen = gdk_drawable_get_screen (gdk_root);
+          *screen = gdk_window_get_screen (gdk_root);
         }
 
       *x = rootx;



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