summaryrefslogtreecommitdiff
path: root/src/gs-window.h
blob: 7878a9406c0fafaa3420d42f336e64f5031f5a90 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2004-2005 William Jon McCann <mccann@jhu.edu>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * Authors: William Jon McCann <mccann@jhu.edu>
 *
 */

#ifndef __GS_WINDOW_H
#define __GS_WINDOW_H

#include <gdk/gdk.h>
#include <gtk/gtk.h>

G_BEGIN_DECLS

#define GS_TYPE_WINDOW         (gs_window_get_type ())
#define GS_WINDOW(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_WINDOW, GSWindow))
#define GS_WINDOW_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_WINDOW, GSWindowClass))
#define GS_IS_WINDOW(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_WINDOW))
#define GS_IS_WINDOW_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_WINDOW))
#define GS_WINDOW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_WINDOW, GSWindowClass))

typedef struct GSWindowPrivate GSWindowPrivate;

typedef struct
{
	GtkWindow        window;

	GSWindowPrivate *priv;
} GSWindow;

typedef struct
{
	GtkWindowClass   parent_class;

	gboolean        (* activity)            (GSWindow *window);
	void            (* deactivated)         (GSWindow *window);
	void            (* dialog_up)           (GSWindow *window);
	void            (* dialog_down)         (GSWindow *window);
} GSWindowClass;

GType       gs_window_get_type           (void);

gboolean    gs_window_is_obscured        (GSWindow  *window);
gboolean    gs_window_is_dialog_up       (GSWindow  *window);

GdkDisplay * gs_window_get_display       (GSWindow  *window);
#if GTK_CHECK_VERSION (3, 22, 0)
void        gs_window_set_monitor        (GSWindow   *window,
                                          GdkMonitor *monitor);
GdkMonitor * gs_window_get_monitor        (GSWindow  *window);
#else
void        gs_window_set_monitor        (GSWindow   *window,
                                          int         monitor);
int         gs_window_get_monitor        (GSWindow  *window);
#endif

void        gs_window_set_background_surface (GSWindow *window,
        cairo_surface_t *surface);
void        gs_window_set_lock_enabled   (GSWindow  *window,
        gboolean   lock_enabled);
void        gs_window_set_logout_enabled (GSWindow  *window,
        gboolean   logout_enabled);
void        gs_window_set_keyboard_enabled (GSWindow  *window,
        gboolean   enabled);
void        gs_window_set_keyboard_command (GSWindow   *window,
        const char *command);
void        gs_window_set_user_switch_enabled (GSWindow  *window,
        gboolean   user_switch_enabled);
void        gs_window_set_logout_timeout (GSWindow  *window,
        glong      timeout);
void        gs_window_set_logout_command (GSWindow   *window,
        const char *command);
void        gs_window_set_status_message   (GSWindow   *window,
        const char *status_message);
void        gs_window_show_message         (GSWindow   *window,
        const char *summary,
        const char *body,
        const char *icon);

void        gs_window_request_unlock     (GSWindow  *window);
void        gs_window_cancel_unlock_request (GSWindow  *window);

GSWindow  * gs_window_new                (GdkDisplay *display,
#if GTK_CHECK_VERSION (3, 22, 0)
                                          GdkMonitor *monitor,
#else
                                          int         monitor,
#endif
                                          gboolean   lock_enabled);
void        gs_window_show               (GSWindow  *window);
void        gs_window_destroy            (GSWindow  *window);
GdkWindow * gs_window_get_gdk_window     (GSWindow  *window);
GtkWidget * gs_window_get_drawing_area   (GSWindow  *window);
void        gs_window_clear              (GSWindow  *window);

G_END_DECLS

#endif /* __GS_WINDOW_H */