[gtk+/rendering-cleanup: 123/144] API: Add gdk_window_get_visual() and gdk_window_get_screen()



commit c021c3070432ad9fc96f213c1864ce316d3f5315
Author: Benjamin Otte <otte redhat com>
Date:   Sun Aug 29 01:15:28 2010 +0200

    API: Add gdk_window_get_visual() and gdk_window_get_screen()
    
    Now that we store the visual in the GdkWindow, these are rather trivial
    accessors.

 docs/reference/gdk/gdk3-sections.txt |    2 +
 gdk/gdk.symbols                      |    2 +
 gdk/gdkwindow.c                      |   40 ++++++++++++++++++++++++++++++++++
 gdk/gdkwindow.h                      |    2 +
 4 files changed, 46 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index 29bc8c5..b3961c4 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -363,6 +363,8 @@ GdkWindowAttributesType
 gdk_window_new
 gdk_window_destroy
 gdk_window_get_window_type
+gdk_window_get_screen
+gdk_window_get_visual
 gdk_window_at_pointer
 gdk_window_show
 gdk_window_show_unraised
diff --git a/gdk/gdk.symbols b/gdk/gdk.symbols
index 310865f..c34f486 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -581,6 +581,8 @@ gdk_window_get_origin
 gdk_window_get_root_coords
 gdk_window_set_support_multidevice
 gdk_window_get_support_multidevice
+gdk_window_get_screen
+gdk_window_get_visual
 gdk_window_has_native
 gdk_window_set_background
 gdk_window_set_background_pattern
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 6e8917f..cdd6fde 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -2173,6 +2173,46 @@ gdk_window_get_window_type (GdkWindow *window)
 }
 
 /**
+ * gdk_window_get_visual:
+ * @window: a #GdkWindow
+ * 
+ * Gets the #GdkVisual describing the pixel format of @window.
+ * 
+ * Return value: a #GdkVisual
+ **/
+GdkVisual*
+gdk_window_get_visual (GdkWindow *window)
+{
+  GdkWindowObject *private;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+  
+  private = (GdkWindowObject *) window;
+
+  return private->visual;
+}
+
+/**
+ * gdk_window_get_screen:
+ * @window: a #GdkWindow
+ * 
+ * Gets the #GdkScreen associated with a #GdkWindow.
+ * 
+ * Return value: the #GdkScreen associated with @window
+ **/
+GdkScreen*
+gdk_window_get_screen (GdkWindow *window)
+{
+  GdkWindowObject *private;
+
+  g_return_val_if_fail (GDK_IS_WINDOW (window), NULL);
+
+  private = (GdkWindowObject *) window;
+
+  return gdk_visual_get_screen (private->visual);
+}
+
+/**
  * gdk_window_is_destroyed:
  * @window: a #GdkWindow
  *
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index 25c8ed0..74667ca 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -505,6 +505,8 @@ void          gdk_window_destroy               (GdkWindow     *window);
 GdkWindowType gdk_window_get_window_type       (GdkWindow     *window);
 gboolean      gdk_window_is_destroyed          (GdkWindow     *window);
 
+GdkVisual *   gdk_window_get_visual            (GdkWindow     *window);
+GdkScreen *   gdk_window_get_screen            (GdkWindow     *window);
 #ifndef GDK_MULTIDEVICE_SAFE
 GdkWindow*    gdk_window_at_pointer            (gint          *win_x,
                                                 gint          *win_y);



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