[gtk+] GdkWindow: Add gdk_window_set_background_rgba()
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] GdkWindow: Add gdk_window_set_background_rgba()
- Date: Fri, 22 Oct 2010 18:15:56 +0000 (UTC)
commit ce06043f17556d40b009628cf7c3bd51827ffa8b
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Oct 21 15:26:40 2010 +0200
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.
docs/reference/gdk/gdk3-sections.txt | 1 +
gdk/gdkwindow.c | 26 ++++++++++++++++++++++++++
gdk/gdkwindow.h | 2 ++
3 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/docs/reference/gdk/gdk3-sections.txt b/docs/reference/gdk/gdk3-sections.txt
index db074de..40bcaaf 100644
--- a/docs/reference/gdk/gdk3-sections.txt
+++ b/docs/reference/gdk/gdk3-sections.txt
@@ -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
diff --git a/gdk/gdkwindow.c b/gdk/gdkwindow.c
index 9ff1934..d186b4d 100644
--- a/gdk/gdkwindow.c
+++ b/gdk/gdkwindow.c
@@ -6670,6 +6670,32 @@ gdk_window_set_background (GdkWindow *window,
}
/**
+ * 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
* @pattern: (allow-none): a pattern to use, or %NULL
diff --git a/gdk/gdkwindow.h b/gdk/gdkwindow.h
index b7897ce..8a2fd4b 100644
--- a/gdk/gdkwindow.h
+++ b/gdk/gdkwindow.h
@@ -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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]