libwacom
Wacom model identification library
Main Page
Files
File List
Globals
All
Files
Functions
Typedefs
Enumerations
Enumerator
Macros
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>
82
typedef
struct
_WacomDevice
WacomDevice
;
83
84
typedef
struct
_WacomMatch
WacomMatch
;
85
86
typedef
struct
_WacomStylus
WacomStylus
;
87
88
typedef
struct
_WacomError
WacomError
;
89
90
typedef
struct
_WacomDeviceDatabase
WacomDeviceDatabase
;
91
92
#define WACOM_STYLUS_FALLBACK_ID 0xfffff
93
#define WACOM_ERASER_FALLBACK_ID 0xffffe
94
98
enum
WacomErrorCode
{
99
WERROR_NONE
,
100
WERROR_BAD_ALLOC
,
101
WERROR_INVALID_PATH
,
102
WERROR_INVALID_DB
,
103
WERROR_BAD_ACCESS
,
104
WERROR_UNKNOWN_MODEL
,
105
};
106
110
typedef
enum
{
111
WBUSTYPE_UNKNOWN
,
112
WBUSTYPE_USB
,
113
WBUSTYPE_SERIAL
,
114
WBUSTYPE_BLUETOOTH
115
}
WacomBusType
;
116
120
typedef
enum
{
121
WCLASS_UNKNOWN
,
122
WCLASS_INTUOS3
,
123
WCLASS_INTUOS4
,
124
WCLASS_INTUOS5
,
125
WCLASS_CINTIQ
,
126
WCLASS_BAMBOO
,
127
WCLASS_GRAPHIRE
,
128
WCLASS_ISDV4
,
129
WCLASS_INTUOS
,
130
WCLASS_INTUOS2
,
131
WCLASS_PEN_DISPLAYS
,
132
}
WacomClass
;
133
137
typedef
enum
{
138
WSTYLUS_UNKNOWN
,
139
WSTYLUS_GENERAL
,
140
WSTYLUS_INKING
,
141
WSTYLUS_AIRBRUSH
,
142
WSTYLUS_CLASSIC
,
143
WSTYLUS_MARKER
,
144
WSTYLUS_STROKE
,
145
WSTYLUS_PUCK
146
}
WacomStylusType
;
147
151
typedef
enum
{
152
WACOM_BUTTON_NONE
= 0,
153
WACOM_BUTTON_POSITION_LEFT
= (1 << 1),
154
WACOM_BUTTON_POSITION_RIGHT
= (1 << 2),
155
WACOM_BUTTON_POSITION_TOP
= (1 << 3),
156
WACOM_BUTTON_POSITION_BOTTOM
= (1 << 4),
157
WACOM_BUTTON_RING_MODESWITCH
= (1 << 5),
158
WACOM_BUTTON_RING2_MODESWITCH
= (1 << 6),
159
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
= (1 << 7),
160
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
= (1 << 8),
161
WACOM_BUTTON_OLED
= (1 << 9),
162
WACOM_BUTTON_MODESWITCH
= (
WACOM_BUTTON_RING_MODESWITCH
|
WACOM_BUTTON_RING2_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
),
163
WACOM_BUTTON_DIRECTION
= (
WACOM_BUTTON_POSITION_LEFT
|
WACOM_BUTTON_POSITION_RIGHT
|
WACOM_BUTTON_POSITION_TOP
|
WACOM_BUTTON_POSITION_BOTTOM
),
164
WACOM_BUTTON_RINGS_MODESWITCH
= (
WACOM_BUTTON_RING_MODESWITCH
|
WACOM_BUTTON_RING2_MODESWITCH
),
165
WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH
= (
WACOM_BUTTON_TOUCHSTRIP_MODESWITCH
|
WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH
),
166
}
WacomButtonFlags
;
167
168
typedef
enum
{
169
WFALLBACK_NONE
= 0,
170
WFALLBACK_GENERIC
= 1
171
}
WacomFallbackFlags
;
172
173
typedef
enum
{
174
WCOMPARE_NORMAL
= 0,
175
WCOMPARE_MATCHES
= (1 << 1),
176
}
WacomCompareFlags
;
177
184
WacomError
*
libwacom_error_new
(
void
);
185
193
void
libwacom_error_free
(
WacomError
**error);
194
198
enum
WacomErrorCode
libwacom_error_get_code
(
WacomError
*error);
199
203
const
char
*
libwacom_error_get_message
(
WacomError
*error);
204
211
WacomDeviceDatabase
*
libwacom_database_new
(
void
);
212
221
WacomDeviceDatabase
*
libwacom_database_new_for_path
(
const
char
*datadir);
222
228
void
libwacom_database_destroy
(
WacomDeviceDatabase
*db);
229
242
WacomDevice
*
libwacom_new_from_path
(
WacomDeviceDatabase
*db,
const
char
*path,
WacomFallbackFlags
fallback,
WacomError
*error);
243
256
WacomDevice
*
libwacom_new_from_usbid
(
WacomDeviceDatabase
*db,
int
vendor_id,
int
product_id,
WacomError
*error);
257
269
WacomDevice
*
libwacom_new_from_name
(
WacomDeviceDatabase
*db,
const
char
*name,
WacomError
*error);
270
282
WacomDevice
**
libwacom_list_devices_from_database
(
WacomDeviceDatabase
*db,
WacomError
*error);
283
290
void
libwacom_print_device_description
(
int
fd,
WacomDevice
*device);
291
292
298
void
libwacom_destroy
(
WacomDevice
*device);
299
309
int
libwacom_compare
(
WacomDevice
*a,
WacomDevice
*b,
WacomCompareFlags
flags);
310
315
WacomClass
libwacom_get_class
(
WacomDevice
*device);
316
321
const
char
*
libwacom_get_name
(
WacomDevice
*device);
322
327
int
libwacom_get_vendor_id
(
WacomDevice
*device);
328
334
const
char
*
libwacom_get_match
(
WacomDevice
*device);
335
341
const
WacomMatch
**
libwacom_get_matches
(
WacomDevice
*device);
342
347
int
libwacom_get_product_id
(
WacomDevice
*device);
348
357
int
libwacom_get_width
(
WacomDevice
*device);
358
367
int
libwacom_get_height
(
WacomDevice
*device);
368
373
int
libwacom_has_stylus
(
WacomDevice
*device);
374
379
int
libwacom_has_touch
(
WacomDevice
*device);
380
387
int
libwacom_get_num_buttons
(
WacomDevice
*device);
388
394
const
int
*
libwacom_get_supported_styli
(
WacomDevice
*device,
int
*num_styli);
395
400
int
libwacom_has_ring
(
WacomDevice
*device);
401
406
int
libwacom_has_ring2
(
WacomDevice
*device);
407
412
int
libwacom_get_ring_num_modes
(
WacomDevice
*device);
413
418
int
libwacom_get_ring2_num_modes
(
WacomDevice
*device);
419
425
int
libwacom_get_num_strips
(
WacomDevice
*device);
426
431
int
libwacom_get_strips_num_modes
(
WacomDevice
*device);
432
438
int
libwacom_is_builtin
(
WacomDevice
*device);
439
445
int
libwacom_is_reversible
(
WacomDevice
*device);
446
451
WacomBusType
libwacom_get_bustype
(
WacomDevice
*device);
452
453
/*
454
* @param device The tablet to query
455
* @param button The ID of the button to check for, between 'A' and 'Z'
456
* @return a WacomButtonFlags with information about the button
457
*/
458
WacomButtonFlags
libwacom_get_button_flag
(
WacomDevice
*device,
459
char
button);
460
468
const
WacomStylus
*
libwacom_stylus_get_for_id
(
WacomDeviceDatabase
*db,
int
id
);
469
474
int
libwacom_stylus_get_id
(
const
WacomStylus
*stylus);
475
480
const
char
*
libwacom_stylus_get_name
(
const
WacomStylus
*stylus);
481
486
int
libwacom_stylus_get_num_buttons
(
const
WacomStylus
*stylus);
487
492
int
libwacom_stylus_has_eraser
(
const
WacomStylus
*stylus);
493
498
int
libwacom_stylus_is_eraser
(
const
WacomStylus
*stylus);
499
504
int
libwacom_stylus_has_lens
(
const
WacomStylus
*stylus);
505
510
WacomStylusType
libwacom_stylus_get_type
(
const
WacomStylus
*stylus);
511
518
void
libwacom_print_stylus_description
(
int
fd,
const
WacomStylus
*stylus);
519
520
WacomBusType
libwacom_match_get_bustype
(
const
WacomMatch
*match);
521
uint32_t
libwacom_match_get_product_id
(
const
WacomMatch
*match);
522
uint32_t
libwacom_match_get_vendor_id
(
const
WacomMatch
*match);
523
const
char
*
libwacom_match_get_match_string
(
const
WacomMatch
*match);
524
525
#endif
/* _LIBWACOM_H_ */
526
527
/* vim: set noexpandtab tabstop=8 shiftwidth=8: */
Generated on Fri Nov 9 2012 11:08:48 for libwacom by
1.8.1.1