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



commit ba66de8921c13cbb784f1dc013a84166dca2660d
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 e31cd32..7725bc6 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -362,6 +362,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 aa13bd2..f86938b 100644
--- a/gdk/gdk.symbols
+++ b/gdk/gdk.symbols
@@ -580,6 +580,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 c992132..7bcd97e 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]