libwacom
Wacom model identification library
Main Page
Related Pages
Files
File List
Globals
All
Files
Functions
Typedefs
Enumerations
Enumerator
Macros
Pages
libwacom
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
#ifdef HAVE_CONFIG_H
28
#include "config.h"
29
#endif
30
31
33
#ifndef _LIBWACOM_H_
34
#define _LIBWACOM_H_
35
37
#include <stdint.h>
38
#include <stdio.h>
39
40
#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 301)
41
#define LIBWACOM_DEPRECATED __attribute__((deprecated))
42
#else
43
#define LIBWACOM_DEPRECATED
44
#endif
/* __GNUC__ */
45
89
typedef
struct
_WacomDevice
WacomDevice
;
90
91
typedef
struct
_WacomMatch
WacomMatch
;
92
93
typedef
struct
_WacomStylus
WacomStylus
;
94
95
typedef
struct
_WacomError
WacomError
;
96
97
typedef
struct
_WacomDeviceDatabase
WacomDeviceDatabase
;
98
99
#define WACOM_STYLUS_FALLBACK_ID 0xfffff
100
#define WACOM_ERASER_FALLBACK_ID 0xffffe
101
105
enum
WacomErrorCode
{
106
WERROR_NONE
,
107
WERROR_BAD_ALLOC
,
108
WERROR_INVALID_PATH
,
109
WERROR_INVALID_DB
,
110
WERROR_BAD_ACCESS
,
111
WERROR_UNKNOWN_MODEL
,
112
};
113
117
typedef
enum
{
118
WBUSTYPE_UNKNOWN
,
119
WBUSTYPE_USB
,
120
WBUSTYPE_SERIAL
,
121
WBUSTYPE_BLUETOOTH
122
}
WacomBusType
;
123
127
typedef
enum
{
128
WACOM_DEVICE_INTEGRATED_NONE
= 0,
129
WACOM_DEVICE_INTEGRATED_DISPLAY
= (1 << 0),
130
WACOM_DEVICE_INTEGRATED_SYSTEM
= (1 << 1)
131
}
WacomIntegrationFlags
;
132
136
typedef
enum
{
137
WCLASS_UNKNOWN
,
138
WCLASS_INTUOS3
,
139
WCLASS_INTUOS4
,
140
WCLASS_INTUOS5
,
141
WCLASS_CINTIQ
,
142
WCLASS_BAMBOO
,
143
WCLASS_GRAPHIRE
,
144
WCLASS_ISDV4
,
145
WCLASS_INTUOS
,
146
WCLASS_INTUOS2
,
147
WCLASS_PEN_DISPLAYS
,
148
}
WacomClass
;
149
153
typedef
enum
{
154
WSTYLUS_UNKNOWN
,
155
WSTYLUS_GENERAL
,
156
WSTYLUS_INKING
,
157
WSTYLUS_AIRBRUSH
,
158
WSTYLUS_CLASSIC
,
159
WSTYLUS_MARKER
,
160
WSTYLUS_STROKE
,
161
WSTYLUS_PUCK
162
}
WacomStylusType
;
163
167
typedef
enum
{
168
WACOM_BUTTON_NONE
= 0,
169
WACOM_BUTTON_POSITION_LEFT
= (1 << 1),
170
WACOM_BUTTON_POSITION_RIGHT
= (1 << 2),
171
WACOM_BUTTON_POSITION_TOP
= (1 << 3),
172
WACOM_BUTTON_POSITION_BOTTOM
= (1 << 4),
173
WACOM_BUTTON_RING_MODESWITCH
= (1 << 5),
174
WACOM_BUTTON_RING2_MODESWITCH
= (1 << 6),
175
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
= (1 << 7),
176
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
= (1 << 8),
177
WACOM_BUTTON_OLED
= (1 << 9),
178
WACOM_BUTTON_MODESWITCH
= (
WACOM_BUTTON_RING_MODESWITCH
|
WACOM_BUTTON_RING2_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
),
179
WACOM_BUTTON_DIRECTION
= (
WACOM_BUTTON_POSITION_LEFT
|
WACOM_BUTTON_POSITION_RIGHT
|
WACOM_BUTTON_POSITION_TOP
|
WACOM_BUTTON_POSITION_BOTTOM
),
180
WACOM_BUTTON_RINGS_MODESWITCH
= (
WACOM_BUTTON_RING_MODESWITCH
|
WACOM_BUTTON_RING2_MODESWITCH
),
181
WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH
= (
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
),
182
}
WacomButtonFlags
;
183
184
typedef
enum
{
185
WFALLBACK_NONE
= 0,
186
WFALLBACK_GENERIC
= 1
187
}
WacomFallbackFlags
;
188
189
typedef
enum
{
190
WCOMPARE_NORMAL
= 0,
191
WCOMPARE_MATCHES
= (1 << 1),
192
}
WacomCompareFlags
;
193
194
typedef
enum
{
195
WACOM_STATUS_LED_UNAVAILABLE
= -1,
196
WACOM_STATUS_LED_RING
= 0,
197
WACOM_STATUS_LED_RING2
= 1,
198
WACOM_STATUS_LED_TOUCHSTRIP
= 2,
199
WACOM_STATUS_LED_TOUCHSTRIP2
= 3
200
}
WacomStatusLEDs
;
201
208
WacomError
*
libwacom_error_new
(
void
);
209
217
void
libwacom_error_free
(
WacomError
**error);
218
222
enum
WacomErrorCode
libwacom_error_get_code
(
WacomError
*error);
223
227
const
char
*
libwacom_error_get_message
(
WacomError
*error);
228
235
WacomDeviceDatabase
*
libwacom_database_new
(
void
);
236
245
WacomDeviceDatabase
*
libwacom_database_new_for_path
(
const
char
*datadir);
246
252
void
libwacom_database_destroy
(
WacomDeviceDatabase
*db);
253
266
WacomDevice
*
libwacom_new_from_path
(
const
WacomDeviceDatabase
*db,
const
char
*path,
WacomFallbackFlags
fallback,
WacomError
*error);
267
280
WacomDevice
*
libwacom_new_from_usbid
(
const
WacomDeviceDatabase
*db,
int
vendor_id,
int
product_id,
WacomError
*error);
281
293
WacomDevice
*
libwacom_new_from_name
(
const
WacomDeviceDatabase
*db,
const
char
*name,
WacomError
*error);
294
306
WacomDevice
**
libwacom_list_devices_from_database
(
const
WacomDeviceDatabase
*db,
WacomError
*error);
307
314
void
libwacom_print_device_description
(
int
fd,
const
WacomDevice
*device);
315
316
322
void
libwacom_destroy
(
WacomDevice
*device);
323
333
int
libwacom_compare
(
const
WacomDevice
*a,
const
WacomDevice
*b,
WacomCompareFlags
flags);
334
339
WacomClass
libwacom_get_class
(
const
WacomDevice
*device);
340
345
const
char
*
libwacom_get_name
(
const
WacomDevice
*device);
346
352
const
char
*
libwacom_get_layout_filename
(
const
WacomDevice
*device);
353
358
int
libwacom_get_vendor_id
(
const
WacomDevice
*device);
359
365
const
char
*
libwacom_get_match
(
const
WacomDevice
*device);
366
372
const
WacomMatch
**
libwacom_get_matches
(
const
WacomDevice
*device);
373
378
int
libwacom_get_product_id
(
const
WacomDevice
*device);
379
388
int
libwacom_get_width
(
const
WacomDevice
*device);
389
398
int
libwacom_get_height
(
const
WacomDevice
*device);
399
404
int
libwacom_has_stylus
(
const
WacomDevice
*device);
405
410
int
libwacom_has_touch
(
const
WacomDevice
*device);
411
418
int
libwacom_get_num_buttons
(
const
WacomDevice
*device);
419
425
const
int
*
libwacom_get_supported_styli
(
const
WacomDevice
*device,
int
*num_styli);
426
431
int
libwacom_has_ring
(
const
WacomDevice
*device);
432
437
int
libwacom_has_ring2
(
const
WacomDevice
*device);
438
443
int
libwacom_get_ring_num_modes
(
const
WacomDevice
*device);
444
449
int
libwacom_get_ring2_num_modes
(
const
WacomDevice
*device);
450
456
int
libwacom_get_num_strips
(
const
WacomDevice
*device);
457
462
int
libwacom_get_strips_num_modes
(
const
WacomDevice
*device);
463
469
const
WacomStatusLEDs
*
libwacom_get_status_leds
(
const
WacomDevice
*device,
int
*num_leds);
470
477
int
libwacom_get_button_led_group
(
const
WacomDevice
*device,
478
char
button);
479
486
int
libwacom_is_builtin
(
const
WacomDevice
*device)
LIBWACOM_DEPRECATED
;
487
493
int
libwacom_is_reversible
(
const
WacomDevice
*device);
494
499
WacomIntegrationFlags
libwacom_get_integration_flags
(
const
WacomDevice
*device);
500
505
WacomBusType
libwacom_get_bustype
(
const
WacomDevice
*device);
506
507
/*
508
* @param device The tablet to query
509
* @param button The ID of the button to check for, between 'A' and 'Z'
510
* @return a WacomButtonFlags with information about the button
511
*/
512
WacomButtonFlags
libwacom_get_button_flag
(
const
WacomDevice
*device,
513
char
button);
514
522
const
WacomStylus
*
libwacom_stylus_get_for_id
(
const
WacomDeviceDatabase
*db,
int
id
);
523
528
int
libwacom_stylus_get_id
(
const
WacomStylus
*stylus);
529
534
const
char
*
libwacom_stylus_get_name
(
const
WacomStylus
*stylus);
535
540
int
libwacom_stylus_get_num_buttons
(
const
WacomStylus
*stylus);
541
546
int
libwacom_stylus_has_eraser
(
const
WacomStylus
*stylus);
547
552
int
libwacom_stylus_is_eraser
(
const
WacomStylus
*stylus);
553
558
int
libwacom_stylus_has_lens
(
const
WacomStylus
*stylus);
559
564
WacomStylusType
libwacom_stylus_get_type
(
const
WacomStylus
*stylus);
565
572
void
libwacom_print_stylus_description
(
int
fd,
const
WacomStylus
*stylus);
573
574
WacomBusType
libwacom_match_get_bustype
(
const
WacomMatch
*match);
575
uint32_t
libwacom_match_get_product_id
(
const
WacomMatch
*match);
576
uint32_t
libwacom_match_get_vendor_id
(
const
WacomMatch
*match);
577
const
char
*
libwacom_match_get_match_string
(
const
WacomMatch
*match);
578
579
#endif
/* _LIBWACOM_H_ */
580
581
/* vim: set noexpandtab tabstop=8 shiftwidth=8: */
Generated on Thu Dec 20 2012 10:29:01 for libwacom by
1.8.1.2