]> Pileus Git - ~andy/gtk/commitdiff
API: Add size getters for GdkWindow
authorBenjamin Otte <otte@redhat.com>
Mon, 20 Sep 2010 09:10:37 +0000 (11:10 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 26 Sep 2010 13:11:43 +0000 (15:11 +0200)
gdk_window_get_width() and gdk_window_get_height() will replace
gdk_drawable_get_size().

docs/reference/gdk/gdk3-sections.txt
gdk/gdk.symbols
gdk/gdkwindow.c
gdk/gdkwindow.h

index d03fa857d0d5b22705d4ffba22ce36fe1faa2251..38f00694db0b59912b7e8ddc62b6fc9dfa9a7092 100644 (file)
@@ -431,6 +431,8 @@ gdk_window_get_cursor
 gdk_window_get_user_data
 gdk_window_get_geometry
 gdk_window_set_geometry_hints
+gdk_window_get_width
+gdk_window_get_height
 gdk_window_set_icon_list
 gdk_window_set_modal_hint
 gdk_window_get_modal_hint
index cc9dbcf11978b8f6dbffe80af5180aa96c76d22f..c62d64646cc8d59b597db5d8aaac7e6f5fb4546a 100644 (file)
@@ -560,6 +560,7 @@ gdk_window_get_cursor
 gdk_window_get_display
 gdk_window_get_focus_on_map
 gdk_window_get_geometry
+gdk_window_get_height
 gdk_window_get_modal_hint
 gdk_window_get_origin
 gdk_window_get_root_coords
@@ -567,6 +568,7 @@ gdk_window_set_support_multidevice
 gdk_window_get_support_multidevice
 gdk_window_get_screen
 gdk_window_get_visual
+gdk_window_get_width
 gdk_window_has_native
 gdk_window_set_background
 gdk_window_set_background_pattern
index 524a5d977bf82f20f3b8b57b33c490bf2221c92e..9d562990fcc78e540f6cde19861adb087f34fb3b 100644 (file)
@@ -7006,6 +7006,54 @@ gdk_window_get_geometry (GdkWindow *window,
     }
 }
 
+/**
+ * gdk_window_get_width:
+ * @window: a #GdkWindow
+ *
+ * Returns the width of the given @window.
+ *
+ * On the X11 platform the returned size is the size reported in the
+ * most-recently-processed configure event, rather than the current
+ * size on the X server.
+ * 
+ * Returns: The width of @window
+ */
+int
+gdk_window_get_width (GdkWindow *window)
+{
+  GdkWindowObject *private;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+
+  private = (GdkWindowObject *) window;
+
+  return private->width;
+}
+
+/**
+ * gdk_window_get_height:
+ * @window: a #GdkWindow
+ *
+ * Returns the height of the given @window.
+ *
+ * On the X11 platform the returned size is the size reported in the
+ * most-recently-processed configure event, rather than the current
+ * size on the X server.
+ * 
+ * Returns: The height of @window
+ */
+int
+gdk_window_get_height (GdkWindow *window)
+{
+  GdkWindowObject *private;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), 0);
+
+  private = (GdkWindowObject *) window;
+
+  return private->height;
+}
+
 /**
  * gdk_window_get_origin:
  * @window: a #GdkWindow
index a8c4448e7cb8f59bf28731cac2d03a4ab9093c82..995679579a8eba2335f452fb3baa7299a40eb20c 100644 (file)
@@ -694,6 +694,8 @@ void              gdk_window_get_geometry    (GdkWindow       *window,
                                          gint            *width,
                                          gint            *height,
                                          gint            *depth);
+int           gdk_window_get_width       (GdkWindow       *window);
+int           gdk_window_get_height      (GdkWindow       *window);
 void         gdk_window_get_position    (GdkWindow       *window,
                                          gint            *x,
                                          gint            *y);