[gtk+/rendering-cleanup-next: 158/203] API: Add size getters for GdkWindow
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/rendering-cleanup-next: 158/203] API: Add size getters for GdkWindow
- Date: Thu, 23 Sep 2010 10:44:22 +0000 (UTC)
commit f954bdef48a0fb7a31cb0edd28295e64612747ae
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 20 11:10:37 2010 +0200
API: Add size getters for GdkWindow
gdk_window_get_width() and gdk_window_get_height() will replace
gdk_drawable_get_size().
docs/reference/gdk/gdk3-sections.txt | 2 +
gdk/gdk.symbols | 2 +
gdk/gdkwindow.c | 48 ++++++++++++++++++++++++++++++++++
gdk/gdkwindow.h | 2 +
4 files changed, 54 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index cf3f9aa..45a4740 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -430,6 +430,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
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index cc56e60..a3377c8 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -559,6 +559,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
@@ -566,6 +567,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 25daeab..774ff3b 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -7004,6 +7004,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 a8c4448..9956795 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]