libwacom
Wacom model identification library
 All Files Functions Typedefs Enumerations Enumerator Macros Pages
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 
112 };
113 
117 typedef enum {
122 } WacomBusType;
123 
127 typedef enum {
132 
136 typedef enum {
148 } WacomClass;
149 
153 typedef enum {
163 
167 typedef enum {
177  WACOM_BUTTON_OLED = (1 << 9),
183 
184 typedef enum {
188 
189 typedef enum {
191  WCOMPARE_MATCHES = (1 << 1),
193 
194 typedef enum {
201 
209 
217 void libwacom_error_free(WacomError **error);
218 
223 
227 const char* libwacom_error_get_message(WacomError *error);
228 
236 
246 
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 
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 
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 
487 
493 int libwacom_is_reversible(const WacomDevice *device);
494 
500 
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  */
513  char button);
514 
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 
565 
572 void libwacom_print_stylus_description (int fd, const WacomStylus *stylus);
573 
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: */