summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-09-20 11:10:37 +0200
committerBenjamin Otte <otte@redhat.com>2010-09-26 15:11:43 +0200
commitaf32c9c9beec6dd004326b3d064befae66b27d44 (patch)
tree673743c6555d1797059ad010bc315b0c5c22f286 /gdk
parentf3ccf2fccf5d6d64f7484ef737aa22e7a8f47c07 (diff)
downloadgtk+-af32c9c9beec6dd004326b3d064befae66b27d44.tar.gz
API: Add size getters for GdkWindow
gdk_window_get_width() and gdk_window_get_height() will replace gdk_drawable_get_size().
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdk.symbols2
-rw-r--r--gdk/gdkwindow.c48
-rw-r--r--gdk/gdkwindow.h2
3 files changed, 52 insertions, 0 deletions
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index cc9dbcf119..c62d64646c 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -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
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 524a5d977b..9d562990fc 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -7007,6 +7007,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
* @x: return location for X coordinate
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index a8c4448e7c..995679579a 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -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);