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.
This commit is contained in:
Benjamin Otte 2010-08-29 01:15:28 +02:00
parent eee6c002d1
commit 5b9bbf9de2
4 changed files with 46 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -2172,6 +2172,46 @@ gdk_window_get_window_type (GdkWindow *window)
return GDK_WINDOW_TYPE (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

View File

@ -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);