libwacom
Wacom model identification library
 All Files Functions Typedefs Enumerations Enumerator Macros
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 
105 };
106 
110 typedef enum {
115 } WacomBusType;
116 
120 typedef enum {
132 } WacomClass;
133 
137 typedef enum {
147 
151 typedef enum {
161  WACOM_BUTTON_OLED = (1 << 9),
167 
168 typedef enum {
172 
173 typedef enum {
175  WCOMPARE_MATCHES = (1 << 1),
177 
185 
193 void libwacom_error_free(WacomError **error);
194 
199 
203 const char* libwacom_error_get_message(WacomError *error);
204 
212 
222 
229 
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 
283 
290 void libwacom_print_device_description (int fd, WacomDevice *device);
291 
292 
298 void libwacom_destroy(WacomDevice *device);
299 
310 
316 
321 const char* libwacom_get_name(WacomDevice *device);
322 
328 
334 const char* libwacom_get_match(WacomDevice *device);
335 
342 
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 
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 
413 
419 
426 
432 
438 int libwacom_is_builtin(WacomDevice *device);
439 
446 
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  */
459  char button);
460 
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 
511 
518 void libwacom_print_stylus_description (int fd, const WacomStylus *stylus);
519 
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: */