libwacom Wacom model identification library

libwacom.h
Go to the documentation of this file.
1 /*
2 * Copyright © 2011 Red Hat, Inc.
3 *
4 * Permission to use, copy, modify, distribute, and sell this software
5 * and its documentation for any purpose is hereby granted without
6 * fee, provided that the above copyright notice appear in all copies
7 * and that both that copyright notice and this permission notice
8 * appear in supporting documentation, and that the name of Red Hat
9 * not be used in advertising or publicity pertaining to distribution
10 * of the software without specific, written prior permission. Red
11 * Hat makes no representations about the suitability of this software
12 * for any purpose. It is provided "as is" without express or implied
13 * warranty.
14 *
15 * THE AUTHORS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN
17 * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
18 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
19 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
20 * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 * Authors:
24 * Peter Hutterer (peter.hutterer@redhat.com)
25 */
26
27
29 #ifndef _LIBWACOM_H_
30 #define _LIBWACOM_H_
31
33 #include <stdint.h>
34 #include <stdio.h>
35
36 #if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
37 #define LIBWACOM_DEPRECATED __attribute__((deprecated))
38 #else
39 #define LIBWACOM_DEPRECATED
40 #endif /* __GNUC__ */
41
85 typedef struct _WacomDevice WacomDevice;
86
87 typedef struct _WacomMatch WacomMatch;
88
89 typedef struct _WacomStylus WacomStylus;
90
91 typedef struct _WacomError WacomError;
92
93 typedef struct _WacomDeviceDatabase WacomDeviceDatabase;
94
95 #define WACOM_STYLUS_FALLBACK_ID 0xfffff
96 #define WACOM_ERASER_FALLBACK_ID 0xffffe
97
101 enum WacomErrorCode {
102 WERROR_NONE,
103 WERROR_BAD_ALLOC,
104 WERROR_INVALID_PATH,
105 WERROR_INVALID_DB,
106 WERROR_BAD_ACCESS,
107 WERROR_UNKNOWN_MODEL,
108 WERROR_BUG_CALLER,
109 };
110
114 typedef enum {
115 WBUSTYPE_UNKNOWN,
116 WBUSTYPE_USB,
117 WBUSTYPE_SERIAL,
118 WBUSTYPE_BLUETOOTH,
119 WBUSTYPE_I2C,
120 } WacomBusType;
121
125 typedef enum {
126 WACOM_DEVICE_INTEGRATED_NONE = 0,
127 WACOM_DEVICE_INTEGRATED_DISPLAY = (1 << 0),
128 WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1)
129 } WacomIntegrationFlags;
130
137 typedef enum {
138 WCLASS_UNKNOWN,
139 WCLASS_INTUOS3,
140 WCLASS_INTUOS4,
141 WCLASS_INTUOS5,
142 WCLASS_CINTIQ,
143 WCLASS_BAMBOO,
144 WCLASS_GRAPHIRE,
145 WCLASS_ISDV4,
146 WCLASS_INTUOS,
147 WCLASS_INTUOS2,
148 WCLASS_PEN_DISPLAYS,
149 WCLASS_REMOTE,
150 } WacomClass;
151
155 typedef enum {
156 WSTYLUS_UNKNOWN,
157 WSTYLUS_GENERAL,
158 WSTYLUS_INKING,
159 WSTYLUS_AIRBRUSH,
160 WSTYLUS_CLASSIC,
161 WSTYLUS_MARKER,
162 WSTYLUS_STROKE,
163 WSTYLUS_PUCK,
164 WSTYLUS_3D,
165 WSTYLUS_MOBILE,
166 } WacomStylusType;
167
171 typedef enum {
172 WACOM_ERASER_UNKNOWN,
173 WACOM_ERASER_NONE,
174 WACOM_ERASER_INVERT,
175 WACOM_ERASER_BUTTON,
176 } WacomEraserType;
177
181 typedef enum {
182 WACOM_BUTTON_NONE = 0,
183 WACOM_BUTTON_POSITION_LEFT = (1 << 1),
184 WACOM_BUTTON_POSITION_RIGHT = (1 << 2),
185 WACOM_BUTTON_POSITION_TOP = (1 << 3),
186 WACOM_BUTTON_POSITION_BOTTOM = (1 << 4),
187 WACOM_BUTTON_RING_MODESWITCH = (1 << 5),
188 WACOM_BUTTON_RING2_MODESWITCH = (1 << 6),
189 WACOM_BUTTON_TOUCHSTRIP_MODESWITCH = (1 << 7),
190 WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH = (1 << 8),
191 WACOM_BUTTON_OLED = (1 << 9),
192 WACOM_BUTTON_MODESWITCH = (WACOM_BUTTON_RING_MODESWITCH | WACOM_BUTTON_RING2_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH),
193 WACOM_BUTTON_DIRECTION = (WACOM_BUTTON_POSITION_LEFT | WACOM_BUTTON_POSITION_RIGHT | WACOM_BUTTON_POSITION_TOP | WACOM_BUTTON_POSITION_BOTTOM),
194 WACOM_BUTTON_RINGS_MODESWITCH = (WACOM_BUTTON_RING_MODESWITCH | WACOM_BUTTON_RING2_MODESWITCH),
195 WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH = (WACOM_BUTTON_TOUCHSTRIP_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH),
196 } WacomButtonFlags;
197
201 typedef enum {
202 WACOM_AXIS_TYPE_NONE = 0,
204 WACOM_AXIS_TYPE_TILT = (1 << 1),
206 WACOM_AXIS_TYPE_ROTATION_Z = (1 << 2),
208 WACOM_AXIS_TYPE_DISTANCE = (1 << 3),
210 WACOM_AXIS_TYPE_PRESSURE = (1 << 4),
212 WACOM_AXIS_TYPE_SLIDER = (1 << 5),
213 } WacomAxisTypeFlags;
214
215 typedef enum {
216 WFALLBACK_NONE = 0,
217 WFALLBACK_GENERIC = 1
218 } WacomFallbackFlags;
219
220 typedef enum {
221 WCOMPARE_NORMAL = 0,
222 WCOMPARE_MATCHES = (1 << 1),
223 } WacomCompareFlags;
224
225 typedef enum {
226 WACOM_STATUS_LED_UNAVAILABLE = -1,
227 WACOM_STATUS_LED_RING = 0,
228 WACOM_STATUS_LED_RING2 = 1,
229 WACOM_STATUS_LED_TOUCHSTRIP = 2,
230 WACOM_STATUS_LED_TOUCHSTRIP2 = 3
231 } WacomStatusLEDs;
232
239 WacomError* libwacom_error_new(void);
240
248 void libwacom_error_free(WacomError **error);
249
253 enum WacomErrorCode libwacom_error_get_code(WacomError *error);
254
258 const char* libwacom_error_get_message(WacomError *error);
259
266 WacomDeviceDatabase* libwacom_database_new(void);
267
276 WacomDeviceDatabase* libwacom_database_new_for_path(const char *datadir);
277
283 void libwacom_database_destroy(WacomDeviceDatabase *db);
284
297 WacomDevice* libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error);
298
314 WacomDevice* libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error);
315
327 WacomDevice* libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error);
328
340 WacomDevice** libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *error);
341
348 void libwacom_print_device_description (int fd, const WacomDevice *device);
349
350
356 void libwacom_destroy(WacomDevice *device);
357
367 int libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags);
368
376 LIBWACOM_DEPRECATED
377 WacomClass libwacom_get_class(const WacomDevice *device);
378
383 const char* libwacom_get_name(const WacomDevice *device);
384
389 const char* libwacom_get_model_name(const WacomDevice *device);
390
396 const char* libwacom_get_layout_filename(const WacomDevice *device);
397
406 int libwacom_get_vendor_id(const WacomDevice *device);
407
413 const char* libwacom_get_match(const WacomDevice *device);
414
420 const WacomMatch** libwacom_get_matches(const WacomDevice *device);
421
436 const WacomMatch* libwacom_get_paired_device(const WacomDevice *device);
437
446 int libwacom_get_product_id(const WacomDevice *device);
447
456 int libwacom_get_width(const WacomDevice *device);
457
466 int libwacom_get_height(const WacomDevice *device);
467
472 int libwacom_has_stylus(const WacomDevice *device);
473
478 int libwacom_has_touch(const WacomDevice *device);
479
486 int libwacom_get_num_buttons(const WacomDevice *device);
487
493 const int *libwacom_get_supported_styli(const WacomDevice *device, int *num_styli);
494
499 int libwacom_has_ring(const WacomDevice *device);
500
505 int libwacom_has_ring2(const WacomDevice *device);
506
511 int libwacom_has_touchswitch(const WacomDevice *device);
512
517 int libwacom_get_ring_num_modes(const WacomDevice *device);
518
523 int libwacom_get_ring2_num_modes(const WacomDevice *device);
524
530 int libwacom_get_num_strips(const WacomDevice *device);
531
536 int libwacom_get_strips_num_modes(const WacomDevice *device);
537
543 const WacomStatusLEDs *libwacom_get_status_leds(const WacomDevice *device, int *num_leds);
544
551 int libwacom_get_button_led_group (const WacomDevice *device,
552 char button);
553
560 int libwacom_is_builtin(const WacomDevice *device) LIBWACOM_DEPRECATED;
561
567 int libwacom_is_reversible(const WacomDevice *device);
568
573 WacomIntegrationFlags libwacom_get_integration_flags (const WacomDevice *device);
574
579 WacomBusType libwacom_get_bustype(const WacomDevice *device);
580
586 WacomButtonFlags libwacom_get_button_flag(const WacomDevice *device,
587 char button);
588
595 int libwacom_get_button_evdev_code(const WacomDevice *device,
596 char button);
597
605 const WacomStylus *libwacom_stylus_get_for_id (const WacomDeviceDatabase *db, int id);
606
611 int libwacom_stylus_get_id (const WacomStylus *stylus);
612
617 const char *libwacom_stylus_get_name (const WacomStylus *stylus);
618
624 const int *libwacom_stylus_get_paired_ids(const WacomStylus *stylus, int *num_paired_ids);
625
630 int libwacom_stylus_get_num_buttons (const WacomStylus *stylus);
631
644 int libwacom_stylus_has_eraser (const WacomStylus *stylus);
645
659 int libwacom_stylus_is_eraser (const WacomStylus *stylus);
660
665 int libwacom_stylus_has_lens (const WacomStylus *stylus);
666
671 int libwacom_stylus_has_wheel (const WacomStylus *stylus);
672
677 WacomAxisTypeFlags libwacom_stylus_get_axes (const WacomStylus *stylus);
678
683 WacomStylusType libwacom_stylus_get_type (const WacomStylus *stylus);
684
689 WacomEraserType libwacom_stylus_get_eraser_type (const WacomStylus *stylus);
690
697 void libwacom_print_stylus_description (int fd, const WacomStylus *stylus);
698
699 const char *libwacom_match_get_name(const WacomMatch *match);
700 WacomBusType libwacom_match_get_bustype(const WacomMatch *match);
701 uint32_t libwacom_match_get_product_id(const WacomMatch *match);
702 uint32_t libwacom_match_get_vendor_id(const WacomMatch *match);
703 const char* libwacom_match_get_match_string(const WacomMatch *match);
704
706 #endif /* _LIBWACOM_H_ */
707
709 /* vim: set noexpandtab tabstop=8 shiftwidth=8: */
WCLASS_BAMBOO
@ WCLASS_BAMBOO
Any Bamboo device.
Definition: libwacom.h:143
WACOM_AXIS_TYPE_TILT
@ WACOM_AXIS_TYPE_TILT
Tilt in x and y direction.
Definition: libwacom.h:204
libwacom_match_get_bustype
WacomBusType libwacom_match_get_bustype(const WacomMatch *match)
WCLASS_UNKNOWN
@ WCLASS_UNKNOWN
Unknown/unsupported device class.
Definition: libwacom.h:138
WACOM_STATUS_LED_RING2
@ WACOM_STATUS_LED_RING2
Definition: libwacom.h:228
libwacom_stylus_get_paired_ids
const int * libwacom_stylus_get_paired_ids(const WacomStylus *stylus, int *num_paired_ids)
WCLASS_GRAPHIRE
@ WCLASS_GRAPHIRE
Any Graphire device.
Definition: libwacom.h:144
WBUSTYPE_BLUETOOTH
@ WBUSTYPE_BLUETOOTH
Bluetooth tablet.
Definition: libwacom.h:118
libwacom_get_layout_filename
const char * libwacom_get_layout_filename(const WacomDevice *device)
libwacom_get_matches
const WacomMatch ** libwacom_get_matches(const WacomDevice *device)
WacomMatch
struct _WacomMatch WacomMatch
Definition: libwacom.h:87
libwacom_stylus_get_num_buttons
int libwacom_stylus_get_num_buttons(const WacomStylus *stylus)
WSTYLUS_MARKER
@ WSTYLUS_MARKER
Definition: libwacom.h:161
libwacom_get_ring_num_modes
int libwacom_get_ring_num_modes(const WacomDevice *device)
WACOM_BUTTON_NONE
@ WACOM_BUTTON_NONE
Definition: libwacom.h:182
libwacom_list_devices_from_database
WacomDevice ** libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *error)
Returns the list of devices in the given database.
WACOM_AXIS_TYPE_SLIDER
@ WACOM_AXIS_TYPE_SLIDER
A absolute-position slider like the wheel on the airbrush.
Definition: libwacom.h:212
libwacom_destroy
void libwacom_destroy(WacomDevice *device)
Remove the device and free all memory and references to it.
WCLASS_INTUOS2
@ WCLASS_INTUOS2
Any Intuos2 series.
Definition: libwacom.h:147
libwacom_get_height
int libwacom_get_height(const WacomDevice *device)
Retrieve the height of the device.
libwacom_stylus_is_eraser
int libwacom_stylus_is_eraser(const WacomStylus *stylus)
Check if the given stylus may act like an eraser.
WacomClass
WacomClass
Classes of devices.
Definition: libwacom.h:137
WSTYLUS_CLASSIC
@ WSTYLUS_CLASSIC
Definition: libwacom.h:160
WacomDeviceDatabase
struct _WacomDeviceDatabase WacomDeviceDatabase
Definition: libwacom.h:93
WBUSTYPE_UNKNOWN
@ WBUSTYPE_UNKNOWN
Unknown/unsupported bus type.
Definition: libwacom.h:115
libwacom_get_strips_num_modes
int libwacom_get_strips_num_modes(const WacomDevice *device)
WACOM_ERASER_NONE
@ WACOM_ERASER_NONE
No eraser is present on the stylus.
Definition: libwacom.h:173
libwacom_has_stylus
int libwacom_has_stylus(const WacomDevice *device)
libwacom_get_supported_styli
const int * libwacom_get_supported_styli(const WacomDevice *device, int *num_styli)
libwacom_stylus_get_eraser_type
WacomEraserType libwacom_stylus_get_eraser_type(const WacomStylus *stylus)
libwacom_error_get_code
enum WacomErrorCode libwacom_error_get_code(WacomError *error)
WACOM_BUTTON_RING_MODESWITCH
@ WACOM_BUTTON_RING_MODESWITCH
Definition: libwacom.h:187
libwacom_has_touch
int libwacom_has_touch(const WacomDevice *device)
libwacom_stylus_has_wheel
int libwacom_stylus_has_wheel(const WacomStylus *stylus)
libwacom_is_reversible
int libwacom_is_reversible(const WacomDevice *device)
libwacom_get_ring2_num_modes
int libwacom_get_ring2_num_modes(const WacomDevice *device)
WACOM_AXIS_TYPE_NONE
@ WACOM_AXIS_TYPE_NONE
Definition: libwacom.h:202
WacomError
struct _WacomError WacomError
Definition: libwacom.h:91
WCLASS_REMOTE
@ WCLASS_REMOTE
Any Wacom Remote.
Definition: libwacom.h:149
libwacom_database_new_for_path
WacomDeviceDatabase * libwacom_database_new_for_path(const char *datadir)
Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions, from the prefix path...
WACOM_BUTTON_MODESWITCH
@ WACOM_BUTTON_MODESWITCH
Definition: libwacom.h:192
WacomStylusType
WacomStylusType
Class of stylus.
Definition: libwacom.h:155
libwacom_match_get_name
const char * libwacom_match_get_name(const WacomMatch *match)
WACOM_ERASER_UNKNOWN
@ WACOM_ERASER_UNKNOWN
Definition: libwacom.h:172
libwacom_database_destroy
void libwacom_database_destroy(WacomDeviceDatabase *db)
Free all memory used by the database.
libwacom_get_num_strips
int libwacom_get_num_strips(const WacomDevice *device)
WFALLBACK_NONE
@ WFALLBACK_NONE
Definition: libwacom.h:216
WERROR_NONE
@ WERROR_NONE
No error has occured.
Definition: libwacom.h:102
LIBWACOM_DEPRECATED
#define LIBWACOM_DEPRECATED
Definition: libwacom.h:39
WacomDevice
struct _WacomDevice WacomDevice
Definition: libwacom.h:85
WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH
@ WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH
Definition: libwacom.h:195
WACOM_BUTTON_RING2_MODESWITCH
@ WACOM_BUTTON_RING2_MODESWITCH
Definition: libwacom.h:188
WCOMPARE_MATCHES
@ WCOMPARE_MATCHES
compare all possible matches too
Definition: libwacom.h:222
WERROR_INVALID_DB
@ WERROR_INVALID_DB
The passed DB is invalid.
Definition: libwacom.h:105
libwacom_new_from_path
WacomDevice * libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error)
Create a new device reference from the given device path.
libwacom_database_new
WacomDeviceDatabase * libwacom_database_new(void)
Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions.
WSTYLUS_UNKNOWN
@ WSTYLUS_UNKNOWN
Definition: libwacom.h:156
WACOM_AXIS_TYPE_DISTANCE
@ WACOM_AXIS_TYPE_DISTANCE
Distance to surface.
Definition: libwacom.h:208
WACOM_BUTTON_POSITION_LEFT
@ WACOM_BUTTON_POSITION_LEFT
Definition: libwacom.h:183
WacomFallbackFlags
WacomFallbackFlags
Definition: libwacom.h:215
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
@ WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
Definition: libwacom.h:189
WacomStylus
struct _WacomStylus WacomStylus
Definition: libwacom.h:89
libwacom_get_bustype
WacomBusType libwacom_get_bustype(const WacomDevice *device)
libwacom_get_name
const char * libwacom_get_name(const WacomDevice *device)
libwacom_get_status_leds
const WacomStatusLEDs * libwacom_get_status_leds(const WacomDevice *device, int *num_leds)
WERROR_BAD_ALLOC
@ WERROR_BAD_ALLOC
Allocation error.
Definition: libwacom.h:103
libwacom_stylus_has_lens
int libwacom_stylus_has_lens(const WacomStylus *stylus)
WSTYLUS_AIRBRUSH
@ WSTYLUS_AIRBRUSH
Definition: libwacom.h:159
WacomEraserType
WacomEraserType
Type of eraser on a stylus.
Definition: libwacom.h:171
WCLASS_PEN_DISPLAYS
@ WCLASS_PEN_DISPLAYS
Any "interactive pen display".
Definition: libwacom.h:148
WACOM_ERASER_BUTTON
@ WACOM_ERASER_BUTTON
Eraser is a button alongside any other stylus buttons.
Definition: libwacom.h:175
WCOMPARE_NORMAL
@ WCOMPARE_NORMAL
compare the device only
Definition: libwacom.h:221
libwacom_get_class
LIBWACOM_DEPRECATED WacomClass libwacom_get_class(const WacomDevice *device)
WSTYLUS_INKING
@ WSTYLUS_INKING
Definition: libwacom.h:158
libwacom_get_match
const char * libwacom_get_match(const WacomDevice *device)
libwacom_print_device_description
void libwacom_print_device_description(int fd, const WacomDevice *device)
Print the description of this device to the given file.
WERROR_INVALID_PATH
@ WERROR_INVALID_PATH
A path specified is invalid.
Definition: libwacom.h:104
libwacom_get_vendor_id
int libwacom_get_vendor_id(const WacomDevice *device)
libwacom_get_button_flag
WacomButtonFlags libwacom_get_button_flag(const WacomDevice *device, char button)
WACOM_STATUS_LED_UNAVAILABLE
@ WACOM_STATUS_LED_UNAVAILABLE
Definition: libwacom.h:226
libwacom_get_model_name
const char * libwacom_get_model_name(const WacomDevice *device)
libwacom_has_touchswitch
int libwacom_has_touchswitch(const WacomDevice *device)
WacomCompareFlags
WacomCompareFlags
Definition: libwacom.h:220
WACOM_BUTTON_POSITION_BOTTOM
@ WACOM_BUTTON_POSITION_BOTTOM
Definition: libwacom.h:186
libwacom_get_product_id
int libwacom_get_product_id(const WacomDevice *device)
WCLASS_INTUOS5
@ WCLASS_INTUOS5
Any Intuos5 series.
Definition: libwacom.h:141
libwacom_match_get_product_id
uint32_t libwacom_match_get_product_id(const WacomMatch *match)
libwacom_error_get_message
const char * libwacom_error_get_message(WacomError *error)
WSTYLUS_MOBILE
@ WSTYLUS_MOBILE
Definition: libwacom.h:165
WCLASS_INTUOS4
@ WCLASS_INTUOS4
Any Intuos4 series.
Definition: libwacom.h:140
WacomAxisTypeFlags
WacomAxisTypeFlags
Axis type for a stylus.
Definition: libwacom.h:201
WSTYLUS_PUCK
@ WSTYLUS_PUCK
Definition: libwacom.h:163
libwacom_is_builtin
int libwacom_is_builtin(const WacomDevice *device) LIBWACOM_DEPRECATED
WSTYLUS_STROKE
@ WSTYLUS_STROKE
Definition: libwacom.h:162
WACOM_BUTTON_OLED
@ WACOM_BUTTON_OLED
Definition: libwacom.h:191
libwacom_match_get_match_string
const char * libwacom_match_get_match_string(const WacomMatch *match)
WSTYLUS_3D
@ WSTYLUS_3D
Definition: libwacom.h:164
WACOM_BUTTON_POSITION_TOP
@ WACOM_BUTTON_POSITION_TOP
Definition: libwacom.h:185
libwacom_compare
int libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags)
Compare the two devices for equal-ness.
libwacom_stylus_has_eraser
int libwacom_stylus_has_eraser(const WacomStylus *stylus)
Check if the given stylus is paired with a separate eraser.
libwacom_print_stylus_description
void libwacom_print_stylus_description(int fd, const WacomStylus *stylus)
Print the description of this stylus to the given file.
WCLASS_CINTIQ
@ WCLASS_CINTIQ
Any Cintiq device.
Definition: libwacom.h:142
libwacom_error_free
void libwacom_error_free(WacomError **error)
Free the error and associated memory.
libwacom_stylus_get_for_id
const WacomStylus * libwacom_stylus_get_for_id(const WacomDeviceDatabase *db, int id)
Get the WacomStylus for the given tool ID.
WACOM_STATUS_LED_TOUCHSTRIP2
@ WACOM_STATUS_LED_TOUCHSTRIP2
Definition: libwacom.h:230
WCLASS_INTUOS
@ WCLASS_INTUOS
Any Intuos series.
Definition: libwacom.h:146
WACOM_STATUS_LED_TOUCHSTRIP
@ WACOM_STATUS_LED_TOUCHSTRIP
Definition: libwacom.h:229
libwacom_match_get_vendor_id
uint32_t libwacom_match_get_vendor_id(const WacomMatch *match)
libwacom_error_new
WacomError * libwacom_error_new(void)
Allocate a new structure for error reporting.
WACOM_BUTTON_POSITION_RIGHT
@ WACOM_BUTTON_POSITION_RIGHT
Definition: libwacom.h:184
libwacom_stylus_get_axes
WacomAxisTypeFlags libwacom_stylus_get_axes(const WacomStylus *stylus)
WACOM_BUTTON_RINGS_MODESWITCH
@ WACOM_BUTTON_RINGS_MODESWITCH
Definition: libwacom.h:194
libwacom_has_ring
int libwacom_has_ring(const WacomDevice *device)
WacomStatusLEDs
WacomStatusLEDs
Definition: libwacom.h:225
libwacom_get_num_buttons
int libwacom_get_num_buttons(const WacomDevice *device)
Tablet buttons are numbered 'A' through to 'A' + number of buttons.
libwacom_get_button_evdev_code
int libwacom_get_button_evdev_code(const WacomDevice *device, char button)
WSTYLUS_GENERAL
@ WSTYLUS_GENERAL
Definition: libwacom.h:157
WCLASS_INTUOS3
@ WCLASS_INTUOS3
Any Intuos3 series.
Definition: libwacom.h:139
libwacom_get_integration_flags
WacomIntegrationFlags libwacom_get_integration_flags(const WacomDevice *device)
WACOM_DEVICE_INTEGRATED_SYSTEM
@ WACOM_DEVICE_INTEGRATED_SYSTEM
Definition: libwacom.h:128
libwacom_stylus_get_name
const char * libwacom_stylus_get_name(const WacomStylus *stylus)
WERROR_BUG_CALLER
@ WERROR_BUG_CALLER
A bug in the caller.
Definition: libwacom.h:108
WACOM_BUTTON_DIRECTION
@ WACOM_BUTTON_DIRECTION
Definition: libwacom.h:193
WBUSTYPE_SERIAL
@ WBUSTYPE_SERIAL
Serial tablet.
Definition: libwacom.h:117
libwacom_stylus_get_id
int libwacom_stylus_get_id(const WacomStylus *stylus)
WacomIntegrationFlags
WacomIntegrationFlags
Tablet integration.
Definition: libwacom.h:125
WacomBusType
WacomBusType
Bus types for tablets.
Definition: libwacom.h:114
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
@ WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
Definition: libwacom.h:190
WacomErrorCode
WacomErrorCode
Possible error codes.
Definition: libwacom.h:101
libwacom_new_from_name
WacomDevice * libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error)
Create a new device reference from the given name.
libwacom_has_ring2
int libwacom_has_ring2(const WacomDevice *device)
WCLASS_ISDV4
@ WCLASS_ISDV4
Any serial ISDV4 device.
Definition: libwacom.h:145
WACOM_DEVICE_INTEGRATED_NONE
@ WACOM_DEVICE_INTEGRATED_NONE
Definition: libwacom.h:126
WACOM_STATUS_LED_RING
@ WACOM_STATUS_LED_RING
Definition: libwacom.h:227
WACOM_AXIS_TYPE_ROTATION_Z
@ WACOM_AXIS_TYPE_ROTATION_Z
Rotation in the z-axis.
Definition: libwacom.h:206
WFALLBACK_GENERIC
@ WFALLBACK_GENERIC
Definition: libwacom.h:217
libwacom_get_width
int libwacom_get_width(const WacomDevice *device)
Retrieve the width of the device.
WERROR_BAD_ACCESS
@ WERROR_BAD_ACCESS
Invalid permissions to access the path.
Definition: libwacom.h:106
WBUSTYPE_USB
@ WBUSTYPE_USB
USB tablet.
Definition: libwacom.h:116
WACOM_AXIS_TYPE_PRESSURE
@ WACOM_AXIS_TYPE_PRESSURE
Tip pressure.
Definition: libwacom.h:210
WERROR_UNKNOWN_MODEL
@ WERROR_UNKNOWN_MODEL
Unsupported/unknown device.
Definition: libwacom.h:107
WACOM_DEVICE_INTEGRATED_DISPLAY
@ WACOM_DEVICE_INTEGRATED_DISPLAY
Definition: libwacom.h:127
WBUSTYPE_I2C
@ WBUSTYPE_I2C
I2C tablet.
Definition: libwacom.h:119
libwacom_new_from_usbid
WacomDevice * libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error)
Create a new device reference from the given vendor/product IDs.
WacomButtonFlags
WacomButtonFlags
Capabilities of the various tablet buttons.
Definition: libwacom.h:181
libwacom_get_button_led_group
int libwacom_get_button_led_group(const WacomDevice *device, char button)
libwacom_stylus_get_type
WacomStylusType libwacom_stylus_get_type(const WacomStylus *stylus)
WACOM_ERASER_INVERT
@ WACOM_ERASER_INVERT
Eraser is a separate tool on the opposite end of the stylus.
Definition: libwacom.h:174
libwacom_get_paired_device
const WacomMatch * libwacom_get_paired_device(const WacomDevice *device)
Return the match string of the paired device for this device.