[gtk+/rendering-cleanup-next: 161/203] x11: Get rid of gdk_drawable_get_size() usage



commit 99eba6d08a2bba4c5f062279fa0c0e61e6140201
Author: Benjamin Otte <otte redhat com>
Date:   Mon Sep 20 12:52:26 2010 +0200

    x11: Get rid of gdk_drawable_get_size() usage

 gdk/x11/gdkdevicemanager-xi2.c |    3 ++-
 gdk/x11/gdkdrawable-x11.c      |   15 ++++++---------
 gdk/x11/gdktestutils-x11.c     |   18 ++++++++++--------
 gdk/x11/gdkwindow-x11.c        |   12 ++++++------
 4 files changed, 24 insertions(+), 24 deletions(-)
---
diff --git a/gdk/x11/gdkdevicemanager-xi2.c b/gdk/x11/gdkdevicemanager-xi2.c
index 36ae37e..25ef248 100644
--- a/gdk/x11/gdkdevicemanager-xi2.c
+++ b/gdk/x11/gdkdevicemanager-xi2.c
@@ -729,7 +729,8 @@ translate_axes (GdkDevice       *device,
   axes = g_new0 (gdouble, n_axes);
   vals = valuators->values;
 
-  gdk_drawable_get_size (GDK_DRAWABLE (window), &width, &height);
+  width = gdk_window_get_width (window);
+  height = gdk_window_get_height (window);
 
   for (i = 0; i < valuators->mask_len * 8; i++)
     {
diff --git a/gdk/x11/gdkdrawable-x11.c b/gdk/x11/gdkdrawable-x11.c
index 433add4..9214364 100644
--- a/gdk/x11/gdkdrawable-x11.c
+++ b/gdk/x11/gdkdrawable-x11.c
@@ -95,10 +95,9 @@ _gdk_x11_drawable_update_size (GdkDrawable *drawable)
   
   if (impl->cairo_surface)
     {
-      int width, height;
-      
-      gdk_drawable_get_size (impl->wrapper, &width, &height);
-      cairo_xlib_surface_set_size (impl->cairo_surface, width, height);
+      cairo_xlib_surface_set_size (impl->cairo_surface,
+                                   gdk_window_get_width (impl->wrapper),
+                                   gdk_window_get_height (impl->wrapper));
     }
 }
 
@@ -230,11 +229,9 @@ gdk_x11_ref_cairo_surface (GdkDrawable *drawable)
 
   if (!impl->cairo_surface)
     {
-      int width, height;
-  
-      gdk_drawable_get_size (impl->wrapper, &width, &height);
-
-      impl->cairo_surface = gdk_x11_create_cairo_surface (drawable, width, height);
+      impl->cairo_surface = gdk_x11_create_cairo_surface (drawable,
+                                                          gdk_window_get_width (impl->wrapper),
+                                                          gdk_window_get_height (impl->wrapper));
       
       if (impl->cairo_surface)
 	cairo_surface_set_user_data (impl->cairo_surface, &gdk_x11_cairo_key,
diff --git a/gdk/x11/gdktestutils-x11.c b/gdk/x11/gdktestutils-x11.c
index a66df58..1b782b9 100644
--- a/gdk/x11/gdktestutils-x11.c
+++ b/gdk/x11/gdktestutils-x11.c
@@ -102,15 +102,16 @@ gdk_test_simulate_key (GdkWindow      *window,
   g_return_val_if_fail (window != NULL, FALSE);
   if (!GDK_WINDOW_IS_MAPPED (window))
     return FALSE;
+
   screen = gdk_window_get_screen (window);
+  priv = (GdkWindowObject *)window;
+
   if (x < 0 && y < 0)
     {
-      gdk_drawable_get_size (window, &x, &y);
-      x /= 2;
-      y /= 2;
+      x = priv->width / 2;
+      y = priv->height / 2;
     }
 
-  priv = (GdkWindowObject *)window;
   /* Convert to impl coordinates */
   x = x + priv->abs_x;
   y = y + priv->abs_y;
@@ -208,15 +209,16 @@ gdk_test_simulate_button (GdkWindow      *window,
 
   if (!GDK_WINDOW_IS_MAPPED (window))
     return FALSE;
+
   screen = gdk_window_get_screen (window);
+  priv = (GdkWindowObject *)window;
+
   if (x < 0 && y < 0)
     {
-      gdk_drawable_get_size (window, &x, &y);
-      x /= 2;
-      y /= 2;
+      x = priv->width / 2;
+      y = priv->height / 2;
     }
 
-  priv = (GdkWindowObject *)window;
   /* Convert to impl coordinates */
   x = x + priv->abs_x;
   y = y + priv->abs_y;
diff --git a/gdk/x11/gdkwindow-x11.c b/gdk/x11/gdkwindow-x11.c
index 32516c8..15afd39 100644
--- a/gdk/x11/gdkwindow-x11.c
+++ b/gdk/x11/gdkwindow-x11.c
@@ -1353,8 +1353,8 @@ post_unmap (GdkWindow *window)
 	  GdkRectangle invalid_rect;
       
 	  gdk_window_get_position (window, &invalid_rect.x, &invalid_rect.y);
-	  gdk_drawable_get_size (GDK_DRAWABLE (window),
-				 &invalid_rect.width, &invalid_rect.height);
+	  invalid_rect.width = gdk_window_get_width (window);
+	  invalid_rect.height = gdk_window_get_height (window);
 	  gdk_window_invalidate_rect ((GdkWindow *)private->parent,
 				      &invalid_rect, TRUE);
 	}
@@ -2863,7 +2863,8 @@ gdk_window_get_frame_extents (GdkWindow    *window,
   /* Refine our fallback answer a bit using local information */
   rect->x = private->x;
   rect->y = private->y;
-  gdk_drawable_get_size ((GdkDrawable *)private, &rect->width, &rect->height);
+  rect->width = private->width;
+  rect->height = private->height;
 
   impl = GDK_WINDOW_IMPL_X11 (private->impl);
   if (GDK_WINDOW_DESTROYED (private) || impl->override_redirect)
@@ -5170,9 +5171,8 @@ emulate_resize_drag (GdkWindow     *window,
   mv_resize->moveresize_y = root_y;
   mv_resize->moveresize_window = g_object_ref (window);
 
-  gdk_drawable_get_size (window,
-			 &mv_resize->moveresize_orig_width,
-			 &mv_resize->moveresize_orig_height);
+  mv_resize->moveresize_orig_width = gdk_window_get_width (window);
+  mv_resize->moveresize_orig_height = gdk_window_get_height (window);
 
   mv_resize->moveresize_geom_mask = 0;
   gdk_window_get_geometry_hints (window,



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