1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
2  *
3  * Copyright (C) 2004-2005 William Jon McCann <mccann@jhu.edu>
4  * Copyright (C) 2006-2009 Richard Hughes <richard@hughsie.com>
5  * Copyright (C) 2012-2021 MATE Developers
6  *
7  * Licensed under the GNU General Public License Version 2
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23 
24 #ifndef __GPM_DPMS_H
25 #define __GPM_DPMS_H
26 
27 G_BEGIN_DECLS
28 
29 #define GPM_TYPE_DPMS		(gpm_dpms_get_type ())
30 #define GPM_DPMS(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GPM_TYPE_DPMS, GpmDpms))
31 #define GPM_DPMS_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GPM_TYPE_DPMS, GpmDpmsClass))
32 #define GPM_IS_DPMS(o)		(G_TYPE_CHECK_INSTANCE_TYPE ((o), GPM_TYPE_DPMS))
33 #define GPM_IS_DPMS_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GPM_TYPE_DPMS))
34 #define GPM_DPMS_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GPM_TYPE_DPMS, GpmDpmsClass))
35 
36 typedef enum {
37 	GPM_DPMS_MODE_ON,
38 	GPM_DPMS_MODE_STANDBY,
39 	GPM_DPMS_MODE_SUSPEND,
40 	GPM_DPMS_MODE_OFF,
41 	GPM_DPMS_MODE_UNKNOWN
42 } GpmDpmsMode;
43 
44 typedef struct GpmDpmsPrivate GpmDpmsPrivate;
45 
46 typedef struct
47 {
48 	GObject	 	parent;
49 	GpmDpmsPrivate *priv;
50 } GpmDpms;
51 
52 typedef struct
53 {
54 	GObjectClass	parent_class;
55 	void		(* mode_changed)	(GpmDpms 	*dpms,
56 						 GpmDpmsMode	 mode);
57 } GpmDpmsClass;
58 
59 typedef enum
60 {
61 	GPM_DPMS_ERROR_GENERAL
62 } GpmDpmsError;
63 
64 #define GPM_DPMS_ERROR gpm_dpms_error_quark ()
65 
66 GQuark		 gpm_dpms_error_quark		(void);
67 GType		 gpm_dpms_get_type		(void);
68 GpmDpms		*gpm_dpms_new			(void);
69 gboolean	 gpm_dpms_get_mode	 	(GpmDpms	*dpms,
70 						 GpmDpmsMode	*mode,
71 						 GError		**error);
72 gboolean	 gpm_dpms_set_mode	 	(GpmDpms	*dpms,
73 						 GpmDpmsMode	 mode,
74 						 GError		**error);
75 void		 gpm_dpms_test			(gpointer	 data);
76 
77 G_END_DECLS
78 
79 #endif /* __GPM_DPMS_H */
80