1
/* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 8; tab-width: 8 -*-
3
* On-screen-display (OSD) window for gnome-settings-daemon's plugins
5
* Copyright (C) 2006 William Jon McCann <mccann@jhu.edu>
6
* Copyright (C) 2009 Novell, Inc
9
* William Jon McCann <mccann@jhu.edu>
10
* Federico Mena-Quintero <federico@novell.com>
12
* This program is free software; you can redistribute it and/or
13
* modify it under the terms of the GNU Lesser General Public
14
* License as published by the Free Software Foundation; either
15
* version 2, or (at your option) any later version.
17
* This program is distributed in the hope that it will be
18
* useful, but WITHOUT ANY WARRANTY; without even the implied
19
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
20
* PURPOSE. See the GNU Lesser General Public License for more
23
* You should have received a copy of the GNU Lesser General
24
* Public License along with this program; if not, write to the
25
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26
* Boston, MA 02111-1307, USA.
30
/* GsdOsdWindow is an "on-screen-display" window (OSD). It is the cute,
31
* semi-transparent, curved popup that appears when you press a hotkey global to
32
* the desktop, such as to change the volume, switch your monitor's parameters,
35
* You can create a GsdOsdWindow and use it as a normal GtkWindow. It will
36
* automatically center itself, figure out if it needs to be composited, etc.
37
* Just pack your widgets in it, sit back, and enjoy the ride.
40
#ifndef GSD_OSD_WINDOW_H
41
#define GSD_OSD_WINDOW_H
43
#include <glib-object.h>
48
/* Alpha value to be used for foreground objects drawn in an OSD window */
49
#define GSD_OSD_WINDOW_FG_ALPHA 1.0
51
#define GSD_TYPE_OSD_WINDOW (gsd_osd_window_get_type ())
52
#define GSD_OSD_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GSD_TYPE_OSD_WINDOW, GsdOsdWindow))
53
#define GSD_OSD_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GSD_TYPE_OSD_WINDOW, GsdOsdWindowClass))
54
#define GSD_IS_OSD_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GSD_TYPE_OSD_WINDOW))
55
#define GSD_IS_OSD_WINDOW_CLASS(klass) (G_TYPE_INSTANCE_GET_CLASS ((klass), GSD_TYPE_OSD_WINDOW))
56
#define GSD_OSD_WINDOW_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GSD_TYPE_OSD_WINDOW, GsdOsdWindowClass))
58
typedef struct GsdOsdWindow GsdOsdWindow;
59
typedef struct GsdOsdWindowClass GsdOsdWindowClass;
60
typedef struct GsdOsdWindowPrivate GsdOsdWindowPrivate;
65
GsdOsdWindowPrivate *priv;
68
struct GsdOsdWindowClass {
69
GtkWindowClass parent_class;
71
void (* draw_when_composited) (GsdOsdWindow *window, cairo_t *cr);
74
GType gsd_osd_window_get_type (void);
76
GtkWidget * gsd_osd_window_new (void);
77
gboolean gsd_osd_window_is_composited (GsdOsdWindow *window);
78
gboolean gsd_osd_window_is_valid (GsdOsdWindow *window);
79
void gsd_osd_window_update_and_hide (GsdOsdWindow *window);
81
void gsd_osd_window_draw_rounded_rectangle (cairo_t *cr,
85
gdouble corner_radius,
89
void gsd_osd_window_color_reverse (GdkRGBA *a);
90
void gsd_osd_window_color_shade (GdkRGBA *a,