libwacom
Wacom model identification library
|
#include <stdint.h>
#include <stdio.h>
Go to the source code of this file.
Macros | |
#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 |
Functions | |
WacomError * | libwacom_error_new (void) |
Allocate a new structure for error reporting. | |
void | libwacom_error_free (WacomError **error) |
Free the error and associated memory. | |
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. | |
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. | |
void | libwacom_database_destroy (WacomDeviceDatabase *db) |
Free all memory used by the database. | |
WacomDevice * | libwacom_new_from_path (WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error) |
Create a new device reference from the given device path. | |
WacomDevice * | libwacom_new_from_usbid (WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error) |
Create a new device reference from the given vendor/product IDs. | |
WacomDevice * | libwacom_new_from_name (WacomDeviceDatabase *db, const char *name, WacomError *error) |
Create a new device reference from the given name. | |
WacomDevice ** | libwacom_list_devices_from_database (WacomDeviceDatabase *db, WacomError *error) |
Returns the list of devices in the given database. | |
void | libwacom_print_device_description (int fd, WacomDevice *device) |
Print the description of this device to the given file. | |
void | libwacom_destroy (WacomDevice *device) |
Remove the device and free all memory and references to it. | |
int | libwacom_compare (WacomDevice *a, WacomDevice *b, WacomCompareFlags flags) |
Compare the two devices for equal-ness. | |
WacomClass | libwacom_get_class (WacomDevice *device) |
const char * | libwacom_get_name (WacomDevice *device) |
int | libwacom_get_vendor_id (WacomDevice *device) |
const char * | libwacom_get_match (WacomDevice *device) |
const WacomMatch ** | libwacom_get_matches (WacomDevice *device) |
int | libwacom_get_product_id (WacomDevice *device) |
int | libwacom_get_width (WacomDevice *device) |
Retrieve the width of the device. | |
int | libwacom_get_height (WacomDevice *device) |
Retrieve the height of the device. | |
int | libwacom_has_stylus (WacomDevice *device) |
int | libwacom_has_touch (WacomDevice *device) |
int | libwacom_get_num_buttons (WacomDevice *device) |
Tablet buttons are numbered 'A' through to 'A' + number of buttons. | |
const int * | libwacom_get_supported_styli (WacomDevice *device, int *num_styli) |
int | libwacom_has_ring (WacomDevice *device) |
int | libwacom_has_ring2 (WacomDevice *device) |
int | libwacom_get_ring_num_modes (WacomDevice *device) |
int | libwacom_get_ring2_num_modes (WacomDevice *device) |
int | libwacom_get_num_strips (WacomDevice *device) |
int | libwacom_get_strips_num_modes (WacomDevice *device) |
int | libwacom_is_builtin (WacomDevice *device) |
int | libwacom_is_reversible (WacomDevice *device) |
WacomBusType | libwacom_get_bustype (WacomDevice *device) |
WacomButtonFlags | libwacom_get_button_flag (WacomDevice *device, char button) |
const WacomStylus * | libwacom_stylus_get_for_id (WacomDeviceDatabase *db, int id) |
Get the WacomStylus for the given tool ID. | |
int | libwacom_stylus_get_id (const WacomStylus *stylus) |
const char * | libwacom_stylus_get_name (const WacomStylus *stylus) |
int | libwacom_stylus_get_num_buttons (const WacomStylus *stylus) |
int | libwacom_stylus_has_eraser (const WacomStylus *stylus) |
int | libwacom_stylus_is_eraser (const WacomStylus *stylus) |
int | libwacom_stylus_has_lens (const WacomStylus *stylus) |
WacomStylusType | libwacom_stylus_get_type (const WacomStylus *stylus) |
void | libwacom_print_stylus_description (int fd, const WacomStylus *stylus) |
Print the description of this stylus to the given file. | |
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) |
#define WACOM_ERASER_FALLBACK_ID 0xffffe |
#define WACOM_STYLUS_FALLBACK_ID 0xfffff |
typedef struct _WacomDevice WacomDevice |
typedef struct _WacomDeviceDatabase WacomDeviceDatabase |
typedef struct _WacomError WacomError |
typedef struct _WacomMatch WacomMatch |
typedef struct _WacomStylus WacomStylus |
enum WacomBusType |
enum WacomButtonFlags |
Capabilities of the various tablet buttons.
enum WacomClass |
Classes of devices.
enum WacomCompareFlags |
enum WacomErrorCode |
Possible error codes.
enum WacomFallbackFlags |
enum WacomStylusType |
int libwacom_compare | ( | WacomDevice * | a, |
WacomDevice * | b, | ||
WacomCompareFlags | flags | ||
) |
Compare the two devices for equal-ness.
a | The first device |
b | The second device |
flags | Flags to dictate what constitutes a match |
void libwacom_database_destroy | ( | WacomDeviceDatabase * | db | ) |
Free all memory used by the database.
db | A Tablet and Stylus database. |
WacomDeviceDatabase* libwacom_database_new | ( | void | ) |
Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions.
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.
This is only useful for diagnostics applications.
void libwacom_destroy | ( | WacomDevice * | device | ) |
Remove the device and free all memory and references to it.
device | The device to delete |
void libwacom_error_free | ( | WacomError ** | error | ) |
Free the error and associated memory.
Resets error to NULL.
error | A reference to a error struct. |
enum WacomErrorCode libwacom_error_get_code | ( | WacomError * | error | ) |
const char* libwacom_error_get_message | ( | WacomError * | error | ) |
WacomError* libwacom_error_new | ( | void | ) |
Allocate a new structure for error reporting.
WacomBusType libwacom_get_bustype | ( | WacomDevice * | device | ) |
device | The tablet to query |
WacomButtonFlags libwacom_get_button_flag | ( | WacomDevice * | device, |
char | button | ||
) |
WacomClass libwacom_get_class | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_height | ( | WacomDevice * | device | ) |
Retrieve the height of the device.
This is the height of the usable area as advertised, not the total size of the physical tablet. For e.g. an Intuos4 6x9 this will return 6.
device | The tablet to query |
const char* libwacom_get_match | ( | WacomDevice * | device | ) |
device | The tablet to query |
const WacomMatch** libwacom_get_matches | ( | WacomDevice * | device | ) |
device | The tablet to query |
const char* libwacom_get_name | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_num_buttons | ( | WacomDevice * | device | ) |
Tablet buttons are numbered 'A' through to 'A' + number of buttons.
device | The tablet to query |
int libwacom_get_num_strips | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_product_id | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_ring2_num_modes | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_ring_num_modes | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_strips_num_modes | ( | WacomDevice * | device | ) |
device | The tablet to query |
const int* libwacom_get_supported_styli | ( | WacomDevice * | device, |
int * | num_styli | ||
) |
device | The tablet to query |
num_styli | Return location for the number of listed styli |
int libwacom_get_vendor_id | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_get_width | ( | WacomDevice * | device | ) |
Retrieve the width of the device.
This is the width of the usable area as advertised, not the total size of the physical tablet. For e.g. an Intuos4 6x9 this will return 9.
device | The tablet to query |
int libwacom_has_ring | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_has_ring2 | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_has_stylus | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_has_touch | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_is_builtin | ( | WacomDevice * | device | ) |
device | The tablet to query |
int libwacom_is_reversible | ( | WacomDevice * | device | ) |
device | The tablet to query |
WacomDevice** libwacom_list_devices_from_database | ( | WacomDeviceDatabase * | db, |
WacomError * | error | ||
) |
Returns the list of devices in the given database.
db | A device database |
error | If not NULL, set to the error if any occurs |
WacomBusType libwacom_match_get_bustype | ( | const WacomMatch * | match | ) |
const char* libwacom_match_get_match_string | ( | const WacomMatch * | match | ) |
uint32_t libwacom_match_get_product_id | ( | const WacomMatch * | match | ) |
uint32_t libwacom_match_get_vendor_id | ( | const WacomMatch * | match | ) |
WacomDevice* libwacom_new_from_name | ( | WacomDeviceDatabase * | db, |
const char * | name, | ||
WacomError * | error | ||
) |
Create a new device reference from the given name.
In case of error, NULL is returned and the error is set to the appropriate value.
db | A device database |
name | The name identifying the device |
error | If not NULL, set to the error if any occurs |
WacomDevice* libwacom_new_from_path | ( | WacomDeviceDatabase * | db, |
const char * | path, | ||
WacomFallbackFlags | fallback, | ||
WacomError * | error | ||
) |
Create a new device reference from the given device path.
In case of error, NULL is returned and the error is set to the appropriate value.
db | A device database |
path | A device path in the form of e.g. /dev/input/event0 |
fallback | Whether we should create a generic if model is unknown |
error | If not NULL, set to the error if any occurs |
WacomDevice* libwacom_new_from_usbid | ( | WacomDeviceDatabase * | db, |
int | vendor_id, | ||
int | product_id, | ||
WacomError * | error | ||
) |
Create a new device reference from the given vendor/product IDs.
In case of error, NULL is returned and the error is set to the appropriate value.
db | A device database |
vendor_id | The vendor ID of the device |
product_id | The product ID of the device |
error | If not NULL, set to the error if any occurs |
void libwacom_print_device_description | ( | int | fd, |
WacomDevice * | device | ||
) |
Print the description of this device to the given file.
fd | The file descriptor to print to |
device | The device to print the description for. |
void libwacom_print_stylus_description | ( | int | fd, |
const WacomStylus * | stylus | ||
) |
Print the description of this stylus to the given file.
fd | The file descriptor |
stylus | The stylus to print the description for. |
const WacomStylus* libwacom_stylus_get_for_id | ( | WacomDeviceDatabase * | db, |
int | id | ||
) |
Get the WacomStylus for the given tool ID.
db | A Tablet and Stylus database. |
id | The Tool ID for this stylus |
int libwacom_stylus_get_id | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
const char* libwacom_stylus_get_name | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
int libwacom_stylus_get_num_buttons | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
WacomStylusType libwacom_stylus_get_type | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
int libwacom_stylus_has_eraser | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
int libwacom_stylus_has_lens | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |
int libwacom_stylus_is_eraser | ( | const WacomStylus * | stylus | ) |
stylus | The stylus to query |