From 56fae6ede117fc4a43d73d9ba6917b379beb31b1 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Mon, 25 May 2009 13:35:16 +0200 Subject: [PATCH] Add functions for managing a simple_window's opacity Signed-off-by: Uli Schlachter Signed-off-by: Julien Danjou --- swindow.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/swindow.h b/swindow.h index 9df3fd19..c9db525d 100644 --- a/swindow.h +++ b/swindow.h @@ -23,6 +23,7 @@ #define AWESOME_SWINDOW_H #include "draw.h" +#include "window.h" /** A simple window. */ typedef struct simple_window_t @@ -78,5 +79,23 @@ simplewindow_refresh_pixmap(simple_window_t *sw) simplewindow_refresh_pixmap_partial(sw, 0, 0, sw->geometry.width, sw->geometry.height); } +/** Set a simplewindow's opacity. + * \param opacity A value between 0 and 1 which describes the opacity. + */ +static inline void +simplewindow_opacity_set(simple_window_t *sw, double opacity) +{ + window_opacity_set(sw->window, opacity); +} + +/** Get a simplewindow's opacity. + * \return The opacity as a value between 0 and 1, or -1 if unset. + */ +static inline double +simplewindow_opacity_get(simple_window_t *sw) +{ + return window_opacity_get(sw->window); +} + #endif // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80