2
* Copyright (C) 2011 Red Hat, Inc.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; either version 2 of the License, or
7
* (at your option) any later version.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
* Author: Bastien Nocera <hadess@hadess.net>
22
#ifndef __GSD_WACOM_DEVICE_MANAGER_H
23
#define __GSD_WACOM_DEVICE_MANAGER_H
25
#include <glib-object.h>
26
#include "gsd-enums.h"
30
#define NUM_ELEMS_MATRIX 9
32
#define GSD_TYPE_WACOM_DEVICE (gsd_wacom_device_get_type ())
33
#define GSD_WACOM_DEVICE(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDevice))
34
#define GSD_WACOM_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))
35
#define GSD_IS_WACOM_DEVICE(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_DEVICE))
36
#define GSD_IS_WACOM_DEVICE_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_DEVICE))
37
#define GSD_WACOM_DEVICE_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_DEVICE, GsdWacomDeviceClass))
39
typedef struct GsdWacomDevicePrivate GsdWacomDevicePrivate;
44
GsdWacomDevicePrivate *priv;
49
GObjectClass parent_class;
50
} GsdWacomDeviceClass;
52
#define GSD_TYPE_WACOM_STYLUS (gsd_wacom_stylus_get_type ())
53
#define GSD_WACOM_STYLUS(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylus))
54
#define GSD_WACOM_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))
55
#define GSD_IS_WACOM_STYLUS(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), GSD_TYPE_WACOM_STYLUS))
56
#define GSD_IS_WACOM_STYLUS_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSD_TYPE_WACOM_STYLUS))
57
#define GSD_WACOM_STYLUS_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GSD_TYPE_WACOM_STYLUS, GsdWacomStylusClass))
59
typedef struct GsdWacomStylusPrivate GsdWacomStylusPrivate;
64
GsdWacomStylusPrivate *priv;
69
GObjectClass parent_class;
70
} GsdWacomStylusClass;
73
WACOM_STYLUS_TYPE_UNKNOWN,
74
WACOM_STYLUS_TYPE_GENERAL,
75
WACOM_STYLUS_TYPE_INKING,
76
WACOM_STYLUS_TYPE_AIRBRUSH,
77
WACOM_STYLUS_TYPE_CLASSIC,
78
WACOM_STYLUS_TYPE_MARKER,
79
WACOM_STYLUS_TYPE_STROKE,
80
WACOM_STYLUS_TYPE_PUCK
83
GType gsd_wacom_stylus_get_type (void);
84
GSettings * gsd_wacom_stylus_get_settings (GsdWacomStylus *stylus);
85
const char * gsd_wacom_stylus_get_name (GsdWacomStylus *stylus);
86
const char * gsd_wacom_stylus_get_icon_name (GsdWacomStylus *stylus);
87
GsdWacomDevice * gsd_wacom_stylus_get_device (GsdWacomStylus *stylus);
88
gboolean gsd_wacom_stylus_get_has_eraser (GsdWacomStylus *stylus);
89
guint gsd_wacom_stylus_get_num_buttons(GsdWacomStylus *stylus);
90
int gsd_wacom_stylus_get_id (GsdWacomStylus *stylus);
91
GsdWacomStylusType gsd_wacom_stylus_get_stylus_type (GsdWacomStylus *stylus);
95
WACOM_TABLET_BUTTON_TYPE_NORMAL,
96
WACOM_TABLET_BUTTON_TYPE_ELEVATOR,
97
WACOM_TABLET_BUTTON_TYPE_HARDCODED
98
} GsdWacomTabletButtonType;
100
#define MAX_GROUP_ID 4
107
GsdWacomTabletButtonType type;
109
} GsdWacomTabletButton;
111
void gsd_wacom_tablet_button_free (GsdWacomTabletButton *button);
112
GsdWacomTabletButton *gsd_wacom_tablet_button_copy (GsdWacomTabletButton *button);
114
/* Device types to apply a setting to */
116
WACOM_TYPE_INVALID = 0,
117
WACOM_TYPE_STYLUS = (1 << 1),
118
WACOM_TYPE_ERASER = (1 << 2),
119
WACOM_TYPE_CURSOR = (1 << 3),
120
WACOM_TYPE_PAD = (1 << 4),
121
WACOM_TYPE_TOUCH = (1 << 5),
122
WACOM_TYPE_ALL = WACOM_TYPE_STYLUS | WACOM_TYPE_ERASER | WACOM_TYPE_CURSOR | WACOM_TYPE_PAD | WACOM_TYPE_TOUCH
123
} GsdWacomDeviceType;
125
/* We use -1 for entire screen when setting/getting monitor value */
126
#define GSD_WACOM_SET_ALL_MONITORS -1
128
GType gsd_wacom_device_get_type (void);
130
void gsd_wacom_device_set_display (GsdWacomDevice *device,
132
gint gsd_wacom_device_get_display_monitor (GsdWacomDevice *device);
133
gboolean gsd_wacom_device_get_display_matrix (GsdWacomDevice *device,
134
float matrix[NUM_ELEMS_MATRIX]);
135
GsdWacomRotation gsd_wacom_device_get_display_rotation (GsdWacomDevice *device);
137
GsdWacomDevice * gsd_wacom_device_new (GdkDevice *device);
138
GList * gsd_wacom_device_list_styli (GsdWacomDevice *device);
139
const char * gsd_wacom_device_get_name (GsdWacomDevice *device);
140
const char * gsd_wacom_device_get_path (GsdWacomDevice *device);
141
const char * gsd_wacom_device_get_icon_name (GsdWacomDevice *device);
142
const char * gsd_wacom_device_get_tool_name (GsdWacomDevice *device);
143
gboolean gsd_wacom_device_reversible (GsdWacomDevice *device);
144
gboolean gsd_wacom_device_is_screen_tablet (GsdWacomDevice *device);
145
gboolean gsd_wacom_device_is_fallback (GsdWacomDevice *device);
146
gint gsd_wacom_device_get_num_strips (GsdWacomDevice *device);
147
gint gsd_wacom_device_get_num_rings (GsdWacomDevice *device);
148
GSettings * gsd_wacom_device_get_settings (GsdWacomDevice *device);
149
void gsd_wacom_device_set_current_stylus (GsdWacomDevice *device,
151
GsdWacomStylus * gsd_wacom_device_get_stylus_for_type (GsdWacomDevice *device,
152
GsdWacomStylusType type);
154
GsdWacomDeviceType gsd_wacom_device_get_device_type (GsdWacomDevice *device);
155
gint * gsd_wacom_device_get_area (GsdWacomDevice *device);
156
const char * gsd_wacom_device_type_to_string (GsdWacomDeviceType type);
157
GList * gsd_wacom_device_get_buttons (GsdWacomDevice *device);
158
GsdWacomTabletButton *gsd_wacom_device_get_button (GsdWacomDevice *device,
160
GtkDirectionType *dir);
161
int gsd_wacom_device_set_next_mode (GsdWacomDevice *device,
163
GsdWacomRotation gsd_wacom_device_rotation_name_to_type (const char *rotation);
164
const char * gsd_wacom_device_rotation_type_to_name (GsdWacomRotation type);
167
/* Helper and debug functions */
168
GsdWacomDevice * gsd_wacom_device_create_fake (GsdWacomDeviceType type,
170
const char *tool_name);
172
GList * gsd_wacom_device_create_fake_cintiq (void);
173
GList * gsd_wacom_device_create_fake_bt (void);
174
GList * gsd_wacom_device_create_fake_x201 (void);
175
GList * gsd_wacom_device_create_fake_intuos4 (void);
179
#endif /* __GSD_WACOM_DEVICE_MANAGER_H */