summaryrefslogtreecommitdiff
path: root/src/gs-prefs.h
blob: dd2ccebeaa46fb98aa70c433da3ebc13269adb22 (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2004-2006 William Jon McCann <mccann@jhu.edu>
 * Copyright (C) 2012-2021 MATE Developers
 *
 * 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_PREFS_H
#define __GS_PREFS_H

#include <glib.h>

G_BEGIN_DECLS

#define GS_TYPE_PREFS         (gs_prefs_get_type ())
#define GS_PREFS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GS_TYPE_PREFS, GSPrefs))
#define GS_PREFS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GS_TYPE_PREFS, GSPrefsClass))
#define GS_IS_PREFS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GS_TYPE_PREFS))
#define GS_IS_PREFS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GS_TYPE_PREFS))
#define GS_PREFS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GS_TYPE_PREFS, GSPrefsClass))

typedef enum
{
    GS_MODE_BLANK_ONLY,
    GS_MODE_RANDOM,
    GS_MODE_SINGLE
} GSSaverMode;

typedef struct GSPrefsPrivate GSPrefsPrivate;

typedef struct
{
	GObject          parent;

	GSPrefsPrivate  *priv;

	guint            idle_activation_enabled : 1; /* whether to activate when idle */
	guint            lock_enabled : 1;              /* whether to lock when active */
	guint            logout_enabled : 1;    /* Whether to offer the logout option */
	guint            lock_disabled : 1;     /* Whether locking the system is disabled */
	guint            user_switch_disabled : 1;      /* Whether user switching is disabled */
	guint            user_switch_enabled : 1;       /* Whether to offer the user switch option */
	guint            keyboard_enabled : 1;  /* Whether to try to embed a keyboard */
	guint            status_message_enabled : 1; /* show the status message in the lock */

	guint            power_timeout;         /* how much idle time before power management */
	guint            timeout;               /* how much idle time before activation */
	guint            lock_timeout;          /* how long after activation locking starts */
	guint            logout_timeout;        /* how long until the logout option appears */
	guint            cycle;                 /* how long each theme should run */

	char            *logout_command;        /* command to use to logout */
	char            *keyboard_command;      /* command to use to embed a keyboard */

	GSList          *themes;                /* the screensaver themes to run */
	GSSaverMode      mode;                  /* theme selection mode */
} GSPrefs;

typedef struct
{
	GObjectClass     parent_class;

	void            (* changed)        (GSPrefs *prefs);
} GSPrefsClass;

GType       gs_prefs_get_type        (void);
GSPrefs   * gs_prefs_new             (void);
void        gs_prefs_load            (GSPrefs *prefs);

G_END_DECLS

#endif /* __GS_PREFS_H */