summaryrefslogtreecommitdiff
path: root/src/gpm-button.h
blob: 943b0cb84495d1afd3e7f329a6b457d824fc4305 (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
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
 *
 * Copyright (C) 2006-2007 Richard Hughes <richard@hughsie.com>
 * Copyright (C) 2012-2021 MATE Developers
 *
 * Licensed under the GNU General Public License Version 2
 *
 * 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 Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

#ifndef __GPMBUTTON_H
#define __GPMBUTTON_H

#include <glib-object.h>

G_BEGIN_DECLS

#define GPM_TYPE_BUTTON		(gpm_button_get_type ())
#define GPM_BUTTON(o)		(G_TYPE_CHECK_INSTANCE_CAST ((o), GPM_TYPE_BUTTON, GpmButton))
#define GPM_BUTTON_CLASS(k)	(G_TYPE_CHECK_CLASS_CAST((k), GPM_TYPE_BUTTON, GpmButtonClass))
#define GPM_IS_BUTTON(o)	(G_TYPE_CHECK_INSTANCE_TYPE ((o), GPM_TYPE_BUTTON))
#define GPM_IS_BUTTON_CLASS(k)	(G_TYPE_CHECK_CLASS_TYPE ((k), GPM_TYPE_BUTTON))
#define GPM_BUTTON_GET_CLASS(o)	(G_TYPE_INSTANCE_GET_CLASS ((o), GPM_TYPE_BUTTON, GpmButtonClass))

typedef struct GpmButtonPrivate GpmButtonPrivate;

#define GPM_BUTTON_POWER		"power"
#define GPM_BUTTON_SLEEP		"sleep"
#define GPM_BUTTON_SUSPEND		"suspend"
#define GPM_BUTTON_HIBERNATE		"hibernate"
#define GPM_BUTTON_LID_DEP		"lid"		/* Remove when HAL drops input support */
#define GPM_BUTTON_LID_OPEN		"lid-up"
#define GPM_BUTTON_LID_CLOSED		"lid-down"
#define GPM_BUTTON_BRIGHT_UP		"brightness-up"
#define GPM_BUTTON_BRIGHT_DOWN		"brightness-down"
#define GPM_BUTTON_KBD_BRIGHT_UP	"kbd-illum-up"
#define GPM_BUTTON_KBD_BRIGHT_DOWN	"kbd-illum-down"
#define GPM_BUTTON_KBD_BRIGHT_TOGGLE	"kbd-illum-toggle"
#define GPM_BUTTON_LOCK			"lock"
#define GPM_BUTTON_BATTERY		"battery"

typedef struct
{
	GObject		 parent;
	GpmButtonPrivate *priv;
} GpmButton;

typedef struct
{
	GObjectClass	parent_class;
	void		(* button_pressed)	(GpmButton	*button,
						 const gchar	*type);
} GpmButtonClass;

GType		 gpm_button_get_type		(void);
GpmButton	*gpm_button_new			(void);
gboolean	 gpm_button_is_lid_closed	(GpmButton *button);
gboolean	 gpm_button_reset_time		(GpmButton *button);

G_END_DECLS

#endif	/* __GPMBUTTON_H */