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 28 /** @cond hide_from_doxygen */ 29 #ifndef _LIBWACOM_H_ 30 #define _LIBWACOM_H_ 31 /** @endcond */ 32 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 42 /** 43 @mainpage 44 45 @section Introduction 46 47 libwacom is a library to identify wacom tablets and their model-specific 48 features. It provides easy access to information such as "is this a 49 built-in on-screen tablet", "what is the size of this model", etc. 50 51 @section Usage 52 The usage of libwacom in an application could look like this: 53 54 <pre> 55 WacomDeviceDatabase *db; 56 WacomDevice *device; 57 WacomError *error; 58 59 db = libwacom_database_new(); 60 error = libwacom_error_new(); 61 device = libwacom_new_from_path(db, "/dev/input/event0", WFALLBACK_NONE, error); 62 if (!device) 63 return; // should check for error here 64 65 if (libwacom_device_is_builtin(device)) 66 printf("This is a built-in device\n"); 67 68 libwacom_destroy(device); 69 libwacom_database_destroy(db); 70 </pre> 71 72 For a full API reference to see libwacom.h. 73 74 @section Database 75 76 libwacom comes with a database of models and their features in key-value 77 format. If you cannot use libwacom, the files may be parsed directly. Note 78 that the file format may change over time, especially in the beginning. 79 */ 80 81 /** 82 @file libwacom.h 83 */ 84 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 98 /** 99 * Possible error codes. 100 */ 101 enum WacomErrorCode { 102 WERROR_NONE, /**< No error has occured */ 103 WERROR_BAD_ALLOC, /**< Allocation error */ 104 WERROR_INVALID_PATH, /**< A path specified is invalid */ 105 WERROR_INVALID_DB, /**< The passed DB is invalid */ 106 WERROR_BAD_ACCESS, /**< Invalid permissions to access the path */ 107 WERROR_UNKNOWN_MODEL, /**< Unsupported/unknown device */ 108 WERROR_BUG_CALLER, /**< A bug in the caller */ 109 }; 110 111 /** 112 * Bus types for tablets. 113 */ 114 typedef enum { 115 WBUSTYPE_UNKNOWN, /**< Unknown/unsupported bus type */ 116 WBUSTYPE_USB, /**< USB tablet */ 117 WBUSTYPE_SERIAL, /**< Serial tablet */ 118 WBUSTYPE_BLUETOOTH, /**< Bluetooth tablet */ 119 WBUSTYPE_I2C, /**< I2C tablet */ 120 } WacomBusType; 121 122 /** 123 * Tablet integration. 124 */ 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 131 /** 132 * Classes of devices. 133 * 134 * @deprecated This enum should no longer be used. The classes are not 135 * fine-grained or reliable enough to be useful. 136 */ 137 typedef enum { 138 WCLASS_UNKNOWN, /**< Unknown/unsupported device class */ 139 WCLASS_INTUOS3, /**< Any Intuos3 series */ 140 WCLASS_INTUOS4, /**< Any Intuos4 series */ 141 WCLASS_INTUOS5, /**< Any Intuos5 series */ 142 WCLASS_CINTIQ, /**< Any Cintiq device */ 143 WCLASS_BAMBOO, /**< Any Bamboo device */ 144 WCLASS_GRAPHIRE, /**< Any Graphire device */ 145 WCLASS_ISDV4, /**< Any serial ISDV4 device */ 146 WCLASS_INTUOS, /**< Any Intuos series */ 147 WCLASS_INTUOS2, /**< Any Intuos2 series */ 148 WCLASS_PEN_DISPLAYS, /**< Any "interactive pen display" */ 149 WCLASS_REMOTE, /**< Any Wacom Remote */ 150 } WacomClass; 151 152 /** 153 * Class of stylus 154 */ 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 168 /** 169 * Type of eraser on a stylus 170 */ 171 typedef enum { 172 WACOM_ERASER_UNKNOWN, 173 WACOM_ERASER_NONE, /**< No eraser is present on the stylus */ 174 WACOM_ERASER_INVERT, /**< Eraser is a separate tool on the opposite end of the stylus */ 175 WACOM_ERASER_BUTTON, /**< Eraser is a button alongside any other stylus buttons */ 176 } WacomEraserType; 177 178 /** 179 * Capabilities of the various tablet buttons 180 */ 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 198 /** 199 * Axis type for a stylus. Note that x/y is implied. 200 */ 201 typedef enum { 202 WACOM_AXIS_TYPE_NONE = 0, 203 /** Tilt in x and y direction */ 204 WACOM_AXIS_TYPE_TILT = (1 << 1), 205 /** Rotation in the z-axis */ 206 WACOM_AXIS_TYPE_ROTATION_Z = (1 << 2), 207 /** Distance to surface */ 208 WACOM_AXIS_TYPE_DISTANCE = (1 << 3), 209 /** Tip pressure */ 210 WACOM_AXIS_TYPE_PRESSURE = (1 << 4), 211 /** A absolute-position slider like the wheel on the airbrush */ 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, /**< compare the device only */ 222 WCOMPARE_MATCHES = (1 << 1), /**< compare all possible matches too */ 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 233 /** 234 * Allocate a new structure for error reporting. 235 * 236 * @return A newly allocated error structure or NULL if the allocation 237 * failed. 238 */ 239 WacomError* libwacom_error_new(void); 240 241 /** 242 * Free the error and associated memory. 243 * Resets error to NULL. 244 * 245 * @param error A reference to a error struct. 246 * @see libwacom_error_new 247 */ 248 void libwacom_error_free(WacomError **error); 249 250 /** 251 * @return The code for this error. 252 */ 253 enum WacomErrorCode libwacom_error_get_code(WacomError *error); 254 255 /** 256 * @return A human-readable message for this error 257 */ 258 const char* libwacom_error_get_message(WacomError *error); 259 260 /** 261 * Loads the Tablet and Stylus databases, to be used 262 * in libwacom_new_*() functions. 263 * 264 * @return A new database or NULL on error. 265 */ 266 WacomDeviceDatabase* libwacom_database_new(void); 267 268 /** 269 * Loads the Tablet and Stylus databases, to be used 270 * in libwacom_new_*() functions, from the prefix 271 * path passes. This is only useful for diagnostics 272 * applications. 273 * 274 * @return A new database or NULL on error. 275 */ 276 WacomDeviceDatabase* libwacom_database_new_for_path(const char *datadir); 277 278 /** 279 * Free all memory used by the database. 280 * 281 * @param db A Tablet and Stylus database. 282 */ 283 void libwacom_database_destroy(WacomDeviceDatabase *db); 284 285 /** 286 * Create a new device reference from the given device path. 287 * In case of error, NULL is returned and the error is set to the 288 * appropriate value. 289 * 290 * @param db A device database 291 * @param path A device path in the form of e.g. /dev/input/event0 292 * @param fallback Whether we should create a generic if model is unknown 293 * @param error If not NULL, set to the error if any occurs 294 * 295 * @return A new reference to this device or NULL on errror. 296 */ 297 WacomDevice* libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error); 298 299 /** 300 * Create a new device reference from the given vendor/product IDs. 301 * In case of error, NULL is returned and the error is set to the 302 * appropriate value. 303 * 304 * @param db A device database 305 * @param vendor_id The vendor ID of the device 306 * @param product_id The product ID of the device 307 * @param error If not NULL, set to the error if any occurs 308 * 309 * @return A new reference to this device or NULL on errror. 310 */ 311 WacomDevice* libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error); 312 313 /** 314 * Create a new device reference from the given name. 315 * In case of error, NULL is returned and the error is set to the 316 * appropriate value. 317 * 318 * @param db A device database 319 * @param name The name identifying the device 320 * @param error If not NULL, set to the error if any occurs 321 * 322 * @return A new reference to this device or NULL on error. 323 */ 324 WacomDevice* libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error); 325 326 /** 327 * Returns the list of devices in the given database. 328 * 329 * @param db A device database 330 * @param error If not NULL, set to the error if any occurs 331 * 332 * @return A NULL terminated list of pointers to all the devices inside the 333 * database. 334 * The content of the list is owned by the database and should not be 335 * modified or freed. Use free() to free the list. 336 */ 337 WacomDevice** libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *error); 338 339 /** 340 * Print the description of this device to the given file. 341 * 342 * @param fd The file descriptor to print to 343 * @param device The device to print the description for. 344 */ 345 void libwacom_print_device_description (int fd, const WacomDevice *device); 346 347 348 /** 349 * Remove the device and free all memory and references to it. 350 * 351 * @param device The device to delete 352 */ 353 void libwacom_destroy(WacomDevice *device); 354 355 /** 356 * Compare the two devices for equal-ness. 357 * 358 * @param a The first device 359 * @param b The second device 360 * @param flags Flags to dictate what constitutes a match 361 * 362 * @return 0 if the devices are identical, nonzero otherwise 363 */ 364 int libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags); 365 366 /** 367 * @param device The tablet to query 368 * @return The class of the device 369 * 370 * @deprecated This function should no longer be used. The classes are not 371 * fine-grained or reliable enough to be useful. 372 */ 373 LIBWACOM_DEPRECATED 374 WacomClass libwacom_get_class(const WacomDevice *device); 375 376 /** 377 * @param device The tablet to query 378 * @return The human-readable name for this device 379 */ 380 const char* libwacom_get_name(const WacomDevice *device); 381 382 /** 383 * @param device The tablet to query 384 * @return The vendor-specific model name (e.g. CTE-650 for a Bamboo Fun), or NULL if none is set 385 */ 386 const char* libwacom_get_model_name(const WacomDevice *device); 387 388 /** 389 * @param device The tablet to query 390 * @return The full filename including path to the SVG layout of the device 391 * if available, or NULL otherwise 392 */ 393 const char* libwacom_get_layout_filename(const WacomDevice *device); 394 395 /** 396 * @param device The tablet to query 397 * @return The numeric vendor ID for this device 398 * 399 * @bug The return value is a signed int but libwacom_match_get_vendor_id() 400 * returns an unsigned int. This may cause compiler warnings, but the 401 * effective range for vendor IDs is 16-bit only anyway. 402 */ 403 int libwacom_get_vendor_id(const WacomDevice *device); 404 405 /** 406 * @param device The tablet to query 407 * @return The current match string used for this device (if set) or the first 408 * match string in the tablet definition. 409 */ 410 const char* libwacom_get_match(const WacomDevice *device); 411 412 /** 413 * @param device The tablet to query 414 * @return A pointer to the null-terminated list of possible matches for this device. Do not 415 * modify this pointer or any content! 416 */ 417 const WacomMatch** libwacom_get_matches(const WacomDevice *device); 418 419 /** 420 * Return the match string of the paired device for this device. A paired 421 * device is a device with a different match string but that shares the 422 * physical device with this device. 423 * 424 * If the return value is NULL, no device is paired with this device or all 425 * paired devices have the same WacomMatch as this device. 426 * 427 * The returned device may not be a libwacom device itself. 428 * 429 * @param device The tablet to query 430 * @return A pointer to paired device for this device. Do not 431 * modify this pointer or any content! 432 */ 433 const WacomMatch* libwacom_get_paired_device(const WacomDevice *device); 434 435 /** 436 * @param device The tablet to query 437 * @return The numeric product ID for this device 438 * 439 * @bug The return value is a signed int but libwacom_match_get_product_id() 440 * returns an unsigned int. This may cause compiler warning, but the 441 * effective range for product IDs is 16-bit only anyway. 442 */ 443 int libwacom_get_product_id(const WacomDevice *device); 444 445 /** 446 * Retrieve the width of the device. This is the width of the usable area as 447 * advertised, not the total size of the physical tablet. For e.g. an 448 * Intuos4 6x9 this will return 9. 449 * 450 * @param device The tablet to query 451 * @return The width of this device in inches 452 */ 453 int libwacom_get_width(const WacomDevice *device); 454 455 /** 456 * Retrieve the height of the device. This is the height of the usable area as 457 * advertised, not the total size of the physical tablet. For e.g. an 458 * Intuos4 6x9 this will return 6. 459 * 460 * @param device The tablet to query 461 * @return The width of this device in inches 462 */ 463 int libwacom_get_height(const WacomDevice *device); 464 465 /** 466 * @param device The tablet to query 467 * @return non-zero if the device supports styli or zero otherwise 468 */ 469 int libwacom_has_stylus(const WacomDevice *device); 470 471 /** 472 * @param device The tablet to query 473 * @return non-zero if the device supports touch or zero otherwise 474 */ 475 int libwacom_has_touch(const WacomDevice *device); 476 477 /** 478 * Tablet buttons are numbered 'A' through to 'A' + number of buttons. 479 * 480 * @param device The tablet to query 481 * @return The number of buttons on the tablet 482 */ 483 int libwacom_get_num_buttons(const WacomDevice *device); 484 485 /** 486 * @param device The tablet to query 487 * @param num_styli Return location for the number of listed styli 488 * @return an array of Styli IDs supported by the device 489 */ 490 const int *libwacom_get_supported_styli(const WacomDevice *device, int *num_styli); 491 492 /** 493 * @param device The tablet to query 494 * @return non-zero if the device has a touch ring or zero otherwise 495 */ 496 int libwacom_has_ring(const WacomDevice *device); 497 498 /** 499 * @param device The tablet to query 500 * @return non-zero if the device has a second touch ring or zero otherwise 501 */ 502 int libwacom_has_ring2(const WacomDevice *device); 503 504 /** 505 * @param device The tablet to query 506 * @return non-zero if the device has a touch switch or zero otherwise 507 */ 508 int libwacom_has_touchswitch(const WacomDevice *device); 509 510 /** 511 * @param device The tablet to query 512 * @return the number of modes for the touchring if it has a mode switch 513 */ 514 int libwacom_get_ring_num_modes(const WacomDevice *device); 515 516 /** 517 * @param device The tablet to query 518 * @return the number of modes for the second touchring if it has a mode switch 519 */ 520 int libwacom_get_ring2_num_modes(const WacomDevice *device); 521 522 /** 523 * @param device The tablet to query 524 * @return the number of touch strips on the tablet 525 * otherwise 526 */ 527 int libwacom_get_num_strips(const WacomDevice *device); 528 529 /** 530 * @param device The tablet to query 531 * @return the number of modes for each of the touchstrips if any 532 */ 533 int libwacom_get_strips_num_modes(const WacomDevice *device); 534 535 /** 536 * @param device The tablet to query 537 * @param num_leds Return location for the number of supported status LEDs 538 * @return an array of status LEDs supported by the device 539 */ 540 const WacomStatusLEDs *libwacom_get_status_leds(const WacomDevice *device, int *num_leds); 541 542 /** 543 * @param device The tablet to query 544 * @param button The ID of the button to check for, between 'A' and 'Z' 545 * @return the status LED group id to use 546 * or -1 if no LED is available for the given tablet / button 547 */ 548 int libwacom_get_button_led_group (const WacomDevice *device, 549 char button); 550 551 /** 552 * @param device The tablet to query 553 * @return non-zero if the device is built into the screen (ie a screen tablet) 554 * or zero if the device is an external tablet 555 * @deprecated 0.7 Use libwacom_get_integration_flags() instead. 556 */ 557 int libwacom_is_builtin(const WacomDevice *device) LIBWACOM_DEPRECATED; 558 559 /** 560 * @param device The tablet to query 561 * @return non-zero if the device can be used left-handed 562 * (rotated 180 degrees) 563 */ 564 int libwacom_is_reversible(const WacomDevice *device); 565 566 /** 567 * @param device The tablet to query 568 * @return the integration flags for the device 569 */ 570 WacomIntegrationFlags libwacom_get_integration_flags (const WacomDevice *device); 571 572 /** 573 * @param device The tablet to query 574 * @return The bustype of this device. 575 */ 576 WacomBusType libwacom_get_bustype(const WacomDevice *device); 577 578 /** 579 * @param device The tablet to query 580 * @param button The ID of the button to check for, between 'A' and 'Z' 581 * @return a WacomButtonFlags with information about the button 582 */ 583 WacomButtonFlags libwacom_get_button_flag(const WacomDevice *device, 584 char button); 585 586 /** 587 * @param device The tablet to query 588 * @param button The ID of the button to check for, between 'A' and 'Z' 589 * @return The evdev event code sent when the button is pressed or 0 if 590 * unknown. 591 */ 592 int libwacom_get_button_evdev_code(const WacomDevice *device, 593 char button); 594 595 /** 596 * Get the WacomStylus for the given tool ID. 597 * 598 * @param db A Tablet and Stylus database. 599 * @param id The Tool ID for this stylus 600 * @return A WacomStylus representing the stylus. Do not free. 601 */ 602 const WacomStylus *libwacom_stylus_get_for_id (const WacomDeviceDatabase *db, int id); 603 604 /** 605 * @param stylus The stylus to query 606 * @return the ID of the tool 607 */ 608 int libwacom_stylus_get_id (const WacomStylus *stylus); 609 610 /** 611 * @param stylus The stylus to query 612 * @return The name of the stylus 613 */ 614 const char *libwacom_stylus_get_name (const WacomStylus *stylus); 615 616 /** 617 * @param stylus The stylus to query 618 * @param num_paired_ids The length of the returned list 619 * @return The list of other IDs paired to this stylus 620 */ 621 const int *libwacom_stylus_get_paired_ids(const WacomStylus *stylus, int *num_paired_ids); 622 623 /** 624 * @param stylus The stylus to query 625 * @return The number of buttons on the stylus 626 */ 627 int libwacom_stylus_get_num_buttons (const WacomStylus *stylus); 628 629 /** 630 * Check if the given stylus is paired with a separate eraser. 631 * 632 * If this function returns @c true then the tool described by the given 633 * WacomStylus is paired with a separate eraser tool. The actual eraser 634 * tool may be located by iterating over the list of paired styli. 635 * 636 * @param stylus The stylus to query 637 * @return Whether the stylus is paired with an eraser 638 * @see libwacom_stylus_get_paired_ids 639 * @see libwacom_stylus_is_eraser 640 */ 641 int libwacom_stylus_has_eraser (const WacomStylus *stylus); 642 643 /** 644 * Check if the given stylus may act like an eraser. 645 * 646 * If this function returns @c true then the tool described by the given 647 * WacomStylus may act like an eraser. Such a tool may be dedicated to 648 * sending just eraser events (and paired with a separate tool for "tip" 649 * events) or capable of sending both both tip and eraser events. 650 * 651 * @param stylus The stylus to query 652 * @return Whether the stylus can act as an eraser 653 * @see libwacom_stylus_get_eraser_type 654 * @see libwacom_stylus_has_eraser 655 */ 656 int libwacom_stylus_is_eraser (const WacomStylus *stylus); 657 658 /** 659 * @param stylus The stylus to query 660 * @return Whether the stylus has a lens 661 */ 662 int libwacom_stylus_has_lens (const WacomStylus *stylus); 663 664 /** 665 * @param stylus The stylus to query 666 * @return Whether the stylus has a relative mouse wheel 667 */ 668 int libwacom_stylus_has_wheel (const WacomStylus *stylus); 669 670 /** 671 * @param stylus The stylus to query 672 * @return The flags specifying the list of absolute axes 673 */ 674 WacomAxisTypeFlags libwacom_stylus_get_axes (const WacomStylus *stylus); 675 676 /** 677 * @param stylus The stylus to query 678 * @return The type of stylus 679 */ 680 WacomStylusType libwacom_stylus_get_type (const WacomStylus *stylus); 681 682 /** 683 * @param stylus The stylus to query 684 * @return The type of eraser on the stylus 685 */ 686 WacomEraserType libwacom_stylus_get_eraser_type (const WacomStylus *stylus); 687 688 /** 689 * Print the description of this stylus to the given file. 690 * 691 * @param fd The file descriptor 692 * @param stylus The stylus to print the description for. 693 */ 694 void libwacom_print_stylus_description (int fd, const WacomStylus *stylus); 695 696 const char *libwacom_match_get_name(const WacomMatch *match); 697 WacomBusType libwacom_match_get_bustype(const WacomMatch *match); 698 uint32_t libwacom_match_get_product_id(const WacomMatch *match); 699 uint32_t libwacom_match_get_vendor_id(const WacomMatch *match); 700 const char* libwacom_match_get_match_string(const WacomMatch *match); 701 702 /** @cond hide_from_doxygen */ 703 #endif /* _LIBWACOM_H_ */ 704 /** @endcond */ 705 706 /* vim: set noexpandtab tabstop=8 shiftwidth=8: */ 707