libwacom Wacom model identification library

Macros | Typedefs | Enumerations | Functions
libwacom.h File Reference
`#include <stdint.h>`
`#include <stdio.h>`

Go to the source code of this file.

## Macros
#define | LIBWACOM_DEPRECATED
#define | WACOM_STYLUS_FALLBACK_ID 0xfffff
#define | WACOM_ERASER_FALLBACK_ID 0xffffe

## Typedefs
typedef struct _WacomDevice | WacomDevice
typedef struct _WacomMatch | WacomMatch
typedef struct _WacomStylus | WacomStylus
typedef struct _WacomError | WacomError
typedef struct _WacomDeviceDatabase | WacomDeviceDatabase

## Enumerations
enum | WacomErrorCode { WERROR_NONE , WERROR_BAD_ALLOC , WERROR_INVALID_PATH , WERROR_INVALID_DB , WERROR_BAD_ACCESS , WERROR_UNKNOWN_MODEL , WERROR_BUG_CALLER }
| Possible error codes. More...
enum | WacomBusType { WBUSTYPE_UNKNOWN , WBUSTYPE_USB , WBUSTYPE_SERIAL , WBUSTYPE_BLUETOOTH , WBUSTYPE_I2C }
| Bus types for tablets. More...
enum | WacomIntegrationFlags { WACOM_DEVICE_INTEGRATED_NONE = 0 , WACOM_DEVICE_INTEGRATED_DISPLAY = (1 << 0) , WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1) }
| Tablet integration. More...
enum | WacomClass { WCLASS_UNKNOWN , WCLASS_INTUOS3 , WCLASS_INTUOS4 , WCLASS_INTUOS5 , WCLASS_CINTIQ , WCLASS_BAMBOO , WCLASS_GRAPHIRE , WCLASS_ISDV4 , WCLASS_INTUOS , WCLASS_INTUOS2 , WCLASS_PEN_DISPLAYS , WCLASS_REMOTE }
| Classes of devices. More...
enum | WacomStylusType { WSTYLUS_UNKNOWN , WSTYLUS_GENERAL , WSTYLUS_INKING , WSTYLUS_AIRBRUSH , WSTYLUS_CLASSIC , WSTYLUS_MARKER , WSTYLUS_STROKE , WSTYLUS_PUCK , WSTYLUS_3D , WSTYLUS_MOBILE }
| Class of stylus. More...
enum | WacomEraserType { WACOM_ERASER_UNKNOWN , WACOM_ERASER_NONE , WACOM_ERASER_INVERT , WACOM_ERASER_BUTTON }
| Type of eraser on a stylus. More...
enum | WacomButtonFlags { WACOM_BUTTON_NONE = 0 , WACOM_BUTTON_POSITION_LEFT = (1 << 1) , WACOM_BUTTON_POSITION_RIGHT = (1 << 2) , WACOM_BUTTON_POSITION_TOP = (1 << 3) , WACOM_BUTTON_POSITION_BOTTOM = (1 << 4) , WACOM_BUTTON_RING_MODESWITCH = (1 << 5) , WACOM_BUTTON_RING2_MODESWITCH = (1 << 6) , WACOM_BUTTON_TOUCHSTRIP_MODESWITCH = (1 << 7) , WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH = (1 << 8) , WACOM_BUTTON_OLED = (1 << 9) , WACOM_BUTTON_MODESWITCH = (WACOM_BUTTON_RING_MODESWITCH | WACOM_BUTTON_RING2_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH) , WACOM_BUTTON_DIRECTION = (WACOM_BUTTON_POSITION_LEFT | WACOM_BUTTON_POSITION_RIGHT | WACOM_BUTTON_POSITION_TOP | WACOM_BUTTON_POSITION_BOTTOM) , WACOM_BUTTON_RINGS_MODESWITCH = (WACOM_BUTTON_RING_MODESWITCH | WACOM_BUTTON_RING2_MODESWITCH) , WACOM_BUTTON_TOUCHSTRIPS_MODESWITCH = (WACOM_BUTTON_TOUCHSTRIP_MODESWITCH | WACOM_BUTTON_TOUCHSTRIP2_MODESWITCH) }
| Capabilities of the various tablet buttons. More...
enum | WacomAxisTypeFlags { WACOM_AXIS_TYPE_NONE = 0 , WACOM_AXIS_TYPE_TILT = (1 << 1) , WACOM_AXIS_TYPE_ROTATION_Z = (1 << 2) , WACOM_AXIS_TYPE_DISTANCE = (1 << 3) , WACOM_AXIS_TYPE_PRESSURE = (1 << 4) , WACOM_AXIS_TYPE_SLIDER = (1 << 5) }
| Axis type for a stylus. More...
enum | WacomFallbackFlags { WFALLBACK_NONE = 0 , WFALLBACK_GENERIC = 1 }
enum | WacomCompareFlags { WCOMPARE_NORMAL = 0 , WCOMPARE_MATCHES = (1 << 1) }
enum | WacomStatusLEDs { WACOM_STATUS_LED_UNAVAILABLE = -1 , WACOM_STATUS_LED_RING = 0 , WACOM_STATUS_LED_RING2 = 1 , WACOM_STATUS_LED_TOUCHSTRIP = 2 , WACOM_STATUS_LED_TOUCHSTRIP2 = 3 }

## Functions
WacomError * | libwacom_error_new (void)
| Allocate a new structure for error reporting. More...
void | libwacom_error_free (WacomError **error)
| Free the error and associated memory. More...
enum WacomErrorCode | libwacom_error_get_code (WacomError *error)
const char * | libwacom_error_get_message (WacomError *error)
WacomDeviceDatabase * | libwacom_database_new (void)
| Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions. More...
WacomDeviceDatabase * | libwacom_database_new_for_path (const char *datadir)
| Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions, from the prefix path passes. More...
void | libwacom_database_destroy (WacomDeviceDatabase *db)
| Free all memory used by the database. More...
WacomDevice * | libwacom_new_from_path (const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error)
| Create a new device reference from the given device path. More...
WacomDevice * | libwacom_new_from_usbid (const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error)
| Create a new device reference from the given vendor/product IDs. More...
WacomDevice * | libwacom_new_from_name (const WacomDeviceDatabase *db, const char *name, WacomError *error)
| Create a new device reference from the given name. More...
WacomDevice ** | libwacom_list_devices_from_database (const WacomDeviceDatabase *db, WacomError *error)
| Returns the list of devices in the given database. More...
void | libwacom_print_device_description (int fd, const WacomDevice *device)
| Print the description of this device to the given file. More...
void | libwacom_destroy (WacomDevice *device)
| Remove the device and free all memory and references to it. More...
int | libwacom_compare (const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags)
| Compare the two devices for equal-ness. More...
LIBWACOM_DEPRECATED WacomClass | libwacom_get_class (const WacomDevice *device)
const char * | libwacom_get_name (const WacomDevice *device)
const char * | libwacom_get_model_name (const WacomDevice *device)
const char * | libwacom_get_layout_filename (const WacomDevice *device)
int | libwacom_get_vendor_id (const WacomDevice *device)
const char * | libwacom_get_match (const WacomDevice *device)
const WacomMatch ** | libwacom_get_matches (const WacomDevice *device)
const WacomMatch * | libwacom_get_paired_device (const WacomDevice *device)
| Return the match string of the paired device for this device. More...
int | libwacom_get_product_id (const WacomDevice *device)
int | libwacom_get_width (const WacomDevice *device)
| Retrieve the width of the device. More...
int | libwacom_get_height (const WacomDevice *device)
| Retrieve the height of the device. More...
int | libwacom_has_stylus (const WacomDevice *device)
int | libwacom_has_touch (const WacomDevice *device)
int | libwacom_get_num_buttons (const WacomDevice *device)
| Tablet buttons are numbered 'A' through to 'A' + number of buttons. More...
const int * | libwacom_get_supported_styli (const WacomDevice *device, int *num_styli)
int | libwacom_has_ring (const WacomDevice *device)
int | libwacom_has_ring2 (const WacomDevice *device)
int | libwacom_has_touchswitch (const WacomDevice *device)
int | libwacom_get_ring_num_modes (const WacomDevice *device)
int | libwacom_get_ring2_num_modes (const WacomDevice *device)
int | libwacom_get_num_strips (const WacomDevice *device)
int | libwacom_get_strips_num_modes (const WacomDevice *device)
const WacomStatusLEDs * | libwacom_get_status_leds (const WacomDevice *device, int *num_leds)
int | libwacom_get_button_led_group (const WacomDevice *device, char button)
int | libwacom_is_builtin (const WacomDevice *device) LIBWACOM_DEPRECATED
int | libwacom_is_reversible (const WacomDevice *device)
WacomIntegrationFlags | libwacom_get_integration_flags (const WacomDevice *device)
WacomBusType | libwacom_get_bustype (const WacomDevice *device)
WacomButtonFlags | libwacom_get_button_flag (const WacomDevice *device, char button)
int | libwacom_get_button_evdev_code (const WacomDevice *device, char button)
const WacomStylus * | libwacom_stylus_get_for_id (const WacomDeviceDatabase *db, int id)
| Get the WacomStylus for the given tool ID. More...
int | libwacom_stylus_get_id (const WacomStylus *stylus)
const char * | libwacom_stylus_get_name (const WacomStylus *stylus)
const int * | libwacom_stylus_get_paired_ids (const WacomStylus *stylus, int *num_paired_ids)
int | libwacom_stylus_get_num_buttons (const WacomStylus *stylus)
int | libwacom_stylus_has_eraser (const WacomStylus *stylus)
| Check if the given stylus is paired with a separate eraser. More...
int | libwacom_stylus_is_eraser (const WacomStylus *stylus)
| Check if the given stylus may act like an eraser. More...
int | libwacom_stylus_has_lens (const WacomStylus *stylus)
int | libwacom_stylus_has_wheel (const WacomStylus *stylus)
WacomAxisTypeFlags | libwacom_stylus_get_axes (const WacomStylus *stylus)
WacomStylusType | libwacom_stylus_get_type (const WacomStylus *stylus)
WacomEraserType | libwacom_stylus_get_eraser_type (const WacomStylus *stylus)
void | libwacom_print_stylus_description (int fd, const WacomStylus *stylus)
| Print the description of this stylus to the given file. More...
const char * | libwacom_match_get_name (const WacomMatch *match)
WacomBusType | libwacom_match_get_bustype (const WacomMatch *match)
uint32_t | libwacom_match_get_product_id (const WacomMatch *match)
uint32_t | libwacom_match_get_vendor_id (const WacomMatch *match)
const char * | libwacom_match_get_match_string (const WacomMatch *match)

## Macro Definition Documentation

## ◆ LIBWACOM_DEPRECATED

#define LIBWACOM_DEPRECATED