GdkWindow: Add gdk_window_set_background_rgba()

This new function takes a GdkRGBA in order to set the background to
an alpha color. Keep in mind that RGBA visuals and a composited environment
are still necessary to have an alpha background displayed.
This commit is contained in:
Carlos Garnacho 2010-10-21 15:26:40 +02:00
parent 5a5f8081f0
commit ce06043f17
3 changed files with 29 additions and 0 deletions

View File

@ -436,6 +436,7 @@ gdk_window_merge_child_input_shapes
gdk_window_set_static_gravities
gdk_window_set_title
gdk_window_set_background
gdk_window_set_background_rgba
gdk_window_set_background_pattern
gdk_window_get_background_pattern
GDK_PARENT_RELATIVE

View File

@ -6669,6 +6669,32 @@ gdk_window_set_background (GdkWindow *window,
cairo_pattern_destroy (pattern);
}
/**
* gdk_window_set_background_rgba:
* @window: a #GdkWindow
* @rgba: a #GdkRGBA color
*
* Sets the background color of @window.
*
* See also gdk_window_set_background_pattern().
**/
void
gdk_window_set_background_rgba (GdkWindow *window,
GdkRGBA *rgba)
{
cairo_pattern_t *pattern;
g_return_if_fail (GDK_IS_WINDOW (window));
g_return_if_fail (rgba != NULL);
pattern = cairo_pattern_create_rgba (rgba->red, rgba->green,
rgba->blue, rgba->alpha);
gdk_window_set_background_pattern (window, pattern);
cairo_pattern_destroy (pattern);
}
/**
* gdk_window_set_background_pattern:
* @window: a #GdkWindow

View File

@ -697,6 +697,8 @@ void gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent);
void gdk_window_set_background (GdkWindow *window,
const GdkColor *color);
void gdk_window_set_background_rgba (GdkWindow *window,
GdkRGBA *rgba);
void gdk_window_set_background_pattern (GdkWindow *window,
cairo_pattern_t *pattern);
cairo_pattern_t *gdk_window_get_background_pattern (GdkWindow *window);