summaryrefslogtreecommitdiff
path: root/plugins/wacom/gsd-wacom-device.h
blob: d21067fdb42eb4ad121270daf1f873d585c20ac6 (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
/*
 * Copyright (C) 2011 Red Hat, Inc.
 *
 * 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 *
 * Author: Bastien Nocera <hadess@hadess.net>
 *
 */

#ifndef __GSD_WACOM_DEVICE_MANAGER_H
#define __GSD_WACOM_DEVICE_MANAGER_H

#include <glib-object.h>

G_BEGIN_DECLS

#define GSD_TYPE_WACOM_STYLUS         (gsd_wacom_stylus_get_type ())
#define GSD_WACOM_STYLUS(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylus))
#define GSD_WACOM_STYLUS_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))
#define GSD_IS_WACOM_STYLUS(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_STYLUS))
#define GSD_IS_WACOM_STYLUS_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_STYLUS))
#define GSD_WACOM_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))

typedef struct GsdWacomStylusPrivate GsdWacomStylusPrivate;

typedef struct
{
        GObject                parent;
        GsdWacomStylusPrivate *priv;
} GsdWacomStylus;

typedef struct
{
        GObjectClass   parent_class;
} GsdWacomStylusClass;

GType gsd_wacom_stylus_get_type     (void);
GSettings   * gsd_wacom_stylus_get_settings (GsdWacomStylus *stylus);
const char  * gsd_wacom_stylus_get_name     (GsdWacomStylus *stylus);

#define GSD_TYPE_WACOM_DEVICE         (gsd_wacom_device_get_type ())
#define GSD_WACOM_DEVICE(o)           (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDevice))
#define GSD_WACOM_DEVICE_CLASS(k)     (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))
#define GSD_IS_WACOM_DEVICE(o)        (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_DEVICE))
#define GSD_IS_WACOM_DEVICE_CLASS(k)  (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_DEVICE))
#define GSD_WACOM_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))

/* Device types to apply a setting to */
typedef enum {
	WACOM_TYPE_INVALID =     0,
        WACOM_TYPE_STYLUS  =     (1 << 1),
        WACOM_TYPE_ERASER  =     (1 << 2),
        WACOM_TYPE_CURSOR  =     (1 << 3),
        WACOM_TYPE_PAD     =     (1 << 4),
        WACOM_TYPE_ALL     =     WACOM_TYPE_STYLUS | WACOM_TYPE_ERASER | WACOM_TYPE_CURSOR | WACOM_TYPE_PAD
} GsdWacomDeviceType;

typedef struct GsdWacomDevicePrivate GsdWacomDevicePrivate;

typedef struct
{
        GObject                parent;
        GsdWacomDevicePrivate *priv;
} GsdWacomDevice;

typedef struct
{
        GObjectClass   parent_class;
} GsdWacomDeviceClass;

GType gsd_wacom_device_get_type     (void);

GsdWacomDevice * gsd_wacom_device_new              (GdkDevice *device);
GList          * gsd_wacom_device_list_styli       (GsdWacomDevice *device);
const char     * gsd_wacom_device_get_name         (GsdWacomDevice *device);
gboolean         gsd_wacom_device_reversible       (GsdWacomDevice *device);
gboolean         gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device);
GSettings      * gsd_wacom_device_get_settings     (GsdWacomDevice *device);
GSettings      * gsd_wacom_device_get_tool_settings     (GsdWacomDevice *device);

GsdWacomDeviceType gsd_wacom_device_get_device_type (GsdWacomDevice *device);
const char     * gsd_wacom_device_type_to_string   (GsdWacomDeviceType type);

G_END_DECLS

#endif /* __GSD_WACOM_DEVICE_MANAGER_H */