libwacom
Wacom model identification library
|
#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 _WacomBuilder | WacomBuilder |
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 datadir given in the argument. | |
void | libwacom_database_destroy (WacomDeviceDatabase *db) |
Free all memory used by the database. | |
WacomDevice * | libwacom_new_from_builder (const WacomDeviceDatabase *db, const WacomBuilder *builder, WacomFallbackFlags fallback, WacomError *error) |
Create a new device reference for the given builder. | |
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. | |
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. | |
WacomDevice * | libwacom_new_from_name (const WacomDeviceDatabase *db, const char *name, WacomError *error) |
Create a new device reference from the given name. | |
WacomDevice ** | libwacom_list_devices_from_database (const WacomDeviceDatabase *db, WacomError *error) |
Returns the list of devices in the given database. | |
void | libwacom_print_device_description (int fd, const 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 (const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags) |
Compare the two devices for equal-ness. | |
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. | |
int | libwacom_get_product_id (const WacomDevice *device) |
int | libwacom_get_width (const WacomDevice *device) |
Retrieve the width of the device. | |
int | libwacom_get_height (const WacomDevice *device) |
Retrieve the height of the device. | |
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. | |
int | libwacom_get_num_keys (const WacomDevice *device) |
Tablet keys indices are numbered from zero. | |
LIBWACOM_DEPRECATED const int * | libwacom_get_supported_styli (const WacomDevice *device, int *num_styli) |
const WacomStylus ** | libwacom_get_styli (const WacomDevice *device, int *num_styli) |
int | libwacom_has_ring (const WacomDevice *device) LIBWACOM_DEPRECATED |
int | libwacom_has_ring2 (const WacomDevice *device) LIBWACOM_DEPRECATED |
int | libwacom_get_num_rings (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) |
int | libwacom_get_num_dials (const WacomDevice *device) |
int | libwacom_get_dial_num_modes (const WacomDevice *device) |
int | libwacom_get_dial2_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) |
LIBWACOM_DEPRECATED const WacomStylus * | libwacom_stylus_get_for_id (const WacomDeviceDatabase *db, int id) |
Get the WacomStylus for the given tool ID. | |
int | libwacom_stylus_get_id (const WacomStylus *stylus) |
int | libwacom_stylus_get_vendor_id (const WacomStylus *stylus) |
const char * | libwacom_stylus_get_name (const WacomStylus *stylus) |
LIBWACOM_DEPRECATED const int * | libwacom_stylus_get_paired_ids (const WacomStylus *stylus, int *num_paired_ids) |
const WacomStylus ** | libwacom_stylus_get_paired_styli (const WacomStylus *stylus, int *num_paired) |
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. | |
int | libwacom_stylus_is_eraser (const WacomStylus *stylus) |
Check if the given stylus may act like an eraser. | |
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. | |
const char * | libwacom_match_get_name (const WacomMatch *match) |
const char * | libwacom_match_get_uniq (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) |
WacomBuilder * | libwacom_builder_new (void) |
Create a new builder to be used into libwacom_new_from_builder(). | |
void | libwacom_builder_destroy (WacomBuilder *builder) |
void | libwacom_builder_set_bustype (WacomBuilder *builder, WacomBusType bustype) |
Change the bustype to the given bustype, overriding the currently set one (if any). | |
void | libwacom_builder_set_usbid (WacomBuilder *builder, int vendor_id, int product_id) |
Change the vendor and product id to the given ids, overriding the currently set ones (if any). | |
void | libwacom_builder_set_device_name (WacomBuilder *builder, const char *name) |
Change the device name to the given name, overriding the currently set one (if any). | |
void | libwacom_builder_set_match_name (WacomBuilder *builder, const char *name) |
Change the match name to the given name, overriding the currently set one (if any). | |
void | libwacom_builder_set_uniq (WacomBuilder *builder, const char *uniq) |
Change the uniq to the given uniq, overriding the currently set one (if any). | |
#define LIBWACOM_DEPRECATED |
void libwacom_builder_destroy | ( | WacomBuilder * | builder | ) |
WacomBuilder * libwacom_builder_new | ( | void | ) |
Create a new builder to be used into libwacom_new_from_builder().
The returned builder must be freed with libwacom_builder_destroy().
void libwacom_builder_set_bustype | ( | WacomBuilder * | builder, |
WacomBusType | bustype | ||
) |
Change the bustype to the given bustype, overriding the currently set one (if any).
void libwacom_builder_set_device_name | ( | WacomBuilder * | builder, |
const char * | name | ||
) |
Change the device name to the given name, overriding the currently set one (if any).
The device name is the name set in the libwacom database and may not match the kernel name for this device. See libwacom_builder_set_match_name() to set the kernel name.
void libwacom_builder_set_match_name | ( | WacomBuilder * | builder, |
const char * | name | ||
) |
Change the match name to the given name, overriding the currently set one (if any).
The match name is the device name advertised by the kernel and may be different to the device name, the human-readable name as set in the libwacom database.
void libwacom_builder_set_uniq | ( | WacomBuilder * | builder, |
const char * | uniq | ||
) |
Change the uniq to the given uniq, overriding the currently set one (if any).
void libwacom_builder_set_usbid | ( | WacomBuilder * | builder, |
int | vendor_id, | ||
int | product_id | ||
) |
Change the vendor and product id to the given ids, overriding the currently set ones (if any).