### Initialize libwacom and query device integration flags Source: https://linuxwacom.github.io/libwacom/index.html Shows the basic usage of libwacom: create a database, create an error object, get a device from a path, check integration flags, and clean up. The example uses "/dev/input/event0" and WFALLBACK_NONE; if the device is not found, it returns without checking the error. The output prints "This is a built-in device" when the WACOM_DEVICE_INTEGRATED_SYSTEM flag is set. ```c WacomDeviceDatabase *db; WacomDevice *device; WacomError *error; db = libwacom_database_new(); error = libwacom_error_new(); device = libwacom_new_from_path(db, "/dev/input/event0", WFALLBACK_NONE, error); if (!device) return; // should check for error here if (libwacom_get_integration_flags(device) & WACOM_DEVICE_INTEGRATED_SYSTEM) printf("This is a built-in device\n"); libwacom_destroy(device); libwacom_database_destroy(db); ``` -------------------------------- ### libwacom_get_matches Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets all match strings of a WacomDevice. ```APIDOC ## libwacom_get_matches ### Description Returns an array of all match strings for the device. ### Signature ```c const WacomMatch **libwacom_get_matches(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const WacomMatch*** - A NULL-terminated array of match objects. ``` -------------------------------- ### libwacom_get_match Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the match string of a WacomDevice. ```APIDOC ## libwacom_get_match ### Description Returns the match string used to identify the device. ### Signature ```c const char *libwacom_get_match(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const char*** - The match string. ``` -------------------------------- ### libwacom_get_layout_filename Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the layout filename of a WacomDevice. ```APIDOC ## libwacom_get_layout_filename ### Description Returns the layout filename associated with the device. ### Signature ```c const char *libwacom_get_layout_filename(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const char*** - The layout filename. ``` -------------------------------- ### libwacom_get_num_rings Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the number of rings on a WacomDevice. ```APIDOC ## libwacom_get_num_rings ### Description Returns the number of rings on the device. ### Signature ```c int libwacom_get_num_rings(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The number of rings. ``` -------------------------------- ### libwacom_get_width Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the width of a WacomDevice in pixels. ```APIDOC ## libwacom_get_width ### Description Returns the width of the device in pixels. ### Signature ```c int libwacom_get_width(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The width in pixels. ``` -------------------------------- ### libwacom_database_new Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a new WacomDeviceDatabase using the default data directory. ```APIDOC ## libwacom_database_new ### Description Creates a new WacomDeviceDatabase by loading device data from the default system data directory. ### Signature ```c WacomDeviceDatabase *libwacom_database_new(void); ``` ### Returns - **WacomDeviceDatabase*** - A pointer to the newly created database, or NULL on failure. ``` -------------------------------- ### libwacom_get_name Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the name of a WacomDevice. ```APIDOC ## libwacom_get_name ### Description Returns the name of the device. ### Signature ```c const char *libwacom_get_name(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const char*** - The device name. ``` -------------------------------- ### libwacom_list_devices_from_database() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the list of devices in the given database. ```APIDOC ## libwacom_list_devices_from_database() ### Description Returns the list of devices in the given database. ### Function Signature WacomDevice** libwacom_list_devices_from_database(const WacomDeviceDatabase *db, WacomError *error) ### Parameters - **db** (const WacomDeviceDatabase*) - Required - A device database. - **error** (WacomError*) - Optional - If not NULL, set to the error if any occurs. ### Returns - **WacomDevice*** - A NULL terminated list of pointers to all the devices inside the database. The content of the list is owned by the database and should not be modified or freed. Use free() to free the list. ``` -------------------------------- ### libwacom_get_height_mm Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the height of a WacomDevice in millimeters. ```APIDOC ## libwacom_get_height_mm ### Description Returns the height of the device in millimeters. ### Signature ```c int libwacom_get_height_mm(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The height in millimeters. ``` -------------------------------- ### libwacom_compare Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Compares the two devices for equal-ness. ```APIDOC ## libwacom_compare ### Description Compare the two devices for equal-ness. ### Function Signature int libwacom_compare (const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags) ### Parameters - **a** (const WacomDevice*) - First device. - **b** (const WacomDevice*) - Second device. - **flags** (WacomCompareFlags) - Comparison flags. ### Returns - **int** - Non-zero if equal, zero otherwise. ``` -------------------------------- ### libwacom_get_width_mm Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the width of a WacomDevice in millimeters. ```APIDOC ## libwacom_get_width_mm ### Description Returns the width of the device in millimeters. ### Signature ```c int libwacom_get_width_mm(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The width in millimeters. ``` -------------------------------- ### libwacom_new_from_builder() Source: https://linuxwacom.github.io/libwacom/group__devices.html Creates a new device reference from a builder. Returns NULL on error and sets the error if provided. ```APIDOC ## libwacom_new_from_builder() ### Description Creates a new device reference for the given builder. In case of error, NULL is returned and the error is set to the appropriate value. The behavior for unset values in the builder is as follows: - if the bus is WBUSTYPE_UNKNOWN but product and vendor ID are set (and optionally device name, match name, and/or uniq), all known bus types are tested until a match is found (if any) - if the device name is set but all other values are empty the behavior matches libwacom_new_from_name(), i.e. the name alone will be used as lookup - if the uniq is set but all other values are empty the only the uniq string will be used for lookup device is the first with a corresponding uniq match. - if one of vendor or product id is zero and the other one is nonzero, no match will be found and the fallback device (if requested) is returned ### Function Signature WacomDevice *libwacom_new_from_builder(const WacomDeviceDatabase *_db_, const WacomBuilder *_builder_, WacomFallbackFlags _fallback_, WacomError *_error_) ### Parameters - **_db_** (const WacomDeviceDatabase *) - Required - A device database. - **_builder_** (const WacomBuilder *) - Required - A builder specifying the known fields for this device. - **_fallback_** (WacomFallbackFlags) - Required - Whether we should create a generic if model is unknown. - **_error_** (WacomError *) - Optional - If not NULL, set to the error if any occurs. ### Returns WacomDevice * - A new reference to this device or NULL on error. ``` -------------------------------- ### libwacom_get_height Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the height of a WacomDevice in pixels. ```APIDOC ## libwacom_get_height ### Description Returns the height of the device in pixels. ### Signature ```c int libwacom_get_height(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The height in pixels. ``` -------------------------------- ### libwacom_new_from_path() Source: https://linuxwacom.github.io/libwacom/group__devices.html Creates a new device reference from the given device path. Returns NULL on error and sets the error if provided. ```APIDOC ## libwacom_new_from_path() ### Description 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. ### Function Signature ```c WacomDevice * libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error) ``` ### Parameters - **db** (const WacomDeviceDatabase *) - Required - A device database - **path** (const char *) - Required - A device path in the form of e.g. /dev/input/event0 - **fallback** (WacomFallbackFlags) - Required - Whether we should create a generic if model is unknown - **error** (WacomError *) - Optional - If not NULL, set to the error if any occurs ### Returns A new reference to this device or NULL on error. ``` -------------------------------- ### libwacom_new_from_path Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a WacomDevice from a device path. ```APIDOC ## libwacom_new_from_path ### Description Creates a new WacomDevice by matching the device at the given path. ### Signature ```c WacomDevice *libwacom_new_from_path(const WacomDeviceDatabase *db, const char *path, WacomFallbackFlags fallback, WacomError *error); ``` ### Parameters - **db** (const WacomDeviceDatabase*) - The database to use. - **path** (const char*) - Path to the device node. - **fallback** (WacomFallbackFlags) - Fallback flags. - **error** (WacomError*) - Optional error object. ### Returns - **WacomDevice*** - A pointer to the created device, or NULL on failure. ``` -------------------------------- ### libwacom_database_new_for_path Source: https://linuxwacom.github.io/libwacom/group__context.html Loads the Tablet and Stylus databases from the datadir given in the argument. ```APIDOC ## libwacom_database_new_for_path ### Description Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions, from the datadir given in the argument. ### Parameters - **datadir** (const char*) - Required - The directory containing the database files. ### Returns A pointer to the newly allocated WacomDeviceDatabase structure. ``` -------------------------------- ### libwacom_database_new_for_path Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a new WacomDeviceDatabase using a custom data directory. ```APIDOC ## libwacom_database_new_for_path ### Description Creates a new WacomDeviceDatabase by loading device data from the specified directory. ### Signature ```c WacomDeviceDatabase *libwacom_database_new_for_path(const char *datadir); ``` ### Parameters - **datadir** (const char*) - Path to the directory containing device data. ### Returns - **WacomDeviceDatabase*** - A pointer to the newly created database, or NULL on failure. ``` -------------------------------- ### libwacom_new_from_usbid Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a WacomDevice from USB vendor and product IDs. ```APIDOC ## libwacom_new_from_usbid ### Description Creates a new WacomDevice by matching the given USB vendor and product IDs. ### Signature ```c WacomDevice *libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error); ``` ### Parameters - **db** (const WacomDeviceDatabase*) - The database to use. - **vendor_id** (int) - USB vendor ID. - **product_id** (int) - USB product ID. - **error** (WacomError*) - Optional error object. ### Returns - **WacomDevice*** - A pointer to the created device, or NULL on failure. ``` -------------------------------- ### libwacom_get_model_name Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Gets the model name of a WacomDevice. ```APIDOC ## libwacom_get_model_name ### Description Returns the model name of the device. ### Signature ```c const char *libwacom_get_model_name(const WacomDevice *device); ``` ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const char*** - The model name. ``` -------------------------------- ### libwacom_new_from_usbid() Source: https://linuxwacom.github.io/libwacom/group__devices.html Creates a new device reference from the given vendor/product IDs. Returns NULL on error and sets the error if provided. ```APIDOC ## libwacom_new_from_usbid() ### Description 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. ### Function Signature ```c WacomDevice * libwacom_new_from_usbid(const WacomDeviceDatabase *db, int vendor_id, int product_id, WacomError *error) ``` ### Parameters - **db** (const WacomDeviceDatabase *) - Required - A device database - **vendor_id** (int) - Required - The vendor ID of the device - **product_id** (int) - Required - The product ID of the device - **error** (WacomError *) - Optional - If not NULL, set to the error if any occurs ### Returns A new reference to this device or NULL on error. ``` -------------------------------- ### libwacom_new_from_builder Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a WacomDevice from a builder object. ```APIDOC ## libwacom_new_from_builder ### Description Creates a new WacomDevice based on the provided builder and fallback flags. ### Signature ```c WacomDevice *libwacom_new_from_builder(const WacomDeviceDatabase *db, const WacomBuilder *builder, WacomFallbackFlags fallback, WacomError *error); ``` ### Parameters - **db** (const WacomDeviceDatabase*) - The database to use. - **builder** (const WacomBuilder*) - The builder object describing the device. - **fallback** (WacomFallbackFlags) - Fallback flags (e.g., WFALLBACK_NONE, WFALLBACK_GENERIC). - **error** (WacomError*) - Optional error object to store error information. ### Returns - **WacomDevice*** - A pointer to the created device, or NULL on failure. ``` -------------------------------- ### libwacom_stylus_get_for_id Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Get the WacomStylus for the given tool ID. ```APIDOC ## libwacom_stylus_get_for_id ### Description Get the WacomStylus for the given tool ID. ### Signature `LIBWACOM_DEPRECATED const WacomStylus * libwacom_stylus_get_for_id(const WacomDeviceDatabase *db, int id)` ### Parameters - `db` (const WacomDeviceDatabase*) - The database to search. - `id` (int) - The tool ID. ### Returns `const WacomStylus *` - The matching stylus, or NULL if not found. ``` -------------------------------- ### libwacom_database_new() Source: https://linuxwacom.github.io/libwacom/group__context.html Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions. ```APIDOC ## libwacom_database_new() ### Description Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions. ### Function Signature WacomDeviceDatabase *libwacom_database_new(void) ### Parameters None ### Returns A new database or NULL on error. ``` -------------------------------- ### libwacom_error_get_message Source: https://linuxwacom.github.io/libwacom/group__context.html Gets the error message from a WacomError structure. ```APIDOC ## libwacom_error_get_message ### Description Gets the error message from a WacomError structure. ### Parameters - **error** (WacomError*) - Required - The error structure. ### Returns A const char* containing the error message. ``` -------------------------------- ### libwacom_error_get_code Source: https://linuxwacom.github.io/libwacom/group__context.html Gets the error code from a WacomError structure. ```APIDOC ## libwacom_error_get_code ### Description Gets the error code from a WacomError structure. ### Parameters - **error** (WacomError*) - Required - The error structure. ### Returns An enum WacomErrorCode value. ``` -------------------------------- ### libwacom_database_new_for_path() Source: https://linuxwacom.github.io/libwacom/group__context.html Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions, from the datadir given in the argument. This is only useful for diagnostics applications. ```APIDOC ## libwacom_database_new_for_path() ### Description Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions, from the datadir given in the argument. This is only useful for diagnostics applications. ### Function Signature WacomDeviceDatabase *libwacom_database_new_for_path(const char *datadir) ### Parameters - **datadir** (const char*) - Required - The datadir must contain the libwacom .tablet files and optionally a layouts/ subdirectory for the svg files if any of the .tablet files references an svg. datadir may be a colon-separated list of directories. ### Returns A new database or NULL on error. ``` -------------------------------- ### libwacom_new_from_name() Source: https://linuxwacom.github.io/libwacom/group__devices.html Creates a new device reference from the given device name. Returns NULL on error and sets the error if provided. ```APIDOC ## libwacom_new_from_name() ### Description 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. ### Function Signature ```c WacomDevice * libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error) ``` ### Parameters - **db** (const WacomDeviceDatabase *) - Required - A device database - **name** (const char *) - Required - The name identifying the device - **error** (WacomError *) - Optional - If not NULL, set to the error if any occurs ### Returns A new reference to this device or NULL on error. ``` -------------------------------- ### libwacom_builder_new Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Creates a new builder for constructing device matches. ```APIDOC ## libwacom_builder_new ### Description Creates a new builder to be used with libwacom_new_from_builder(). ### Function Signature ```c WacomBuilder *libwacom_builder_new(void) ``` ### Parameters - None. ### Return Value - **WacomBuilder *** - A new builder instance. ``` -------------------------------- ### libwacom_database_new Source: https://linuxwacom.github.io/libwacom/group__context.html Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions. ```APIDOC ## libwacom_database_new ### Description Loads the Tablet and Stylus databases, to be used in libwacom_new_*() functions. ### Returns A pointer to the newly allocated WacomDeviceDatabase structure. ``` -------------------------------- ### libwacom_database_new() Source: https://linuxwacom.github.io/libwacom/globals_func.html Creates a new libwacom database object using the default database path. ```APIDOC ## libwacom_database_new() ### Description Creates a new libwacom database object using the default database path. ### Function `LibwacomDatabase *libwacom_database_new(void);` ### Parameters None. ### Returns A pointer to the newly created database object, or NULL on failure. ``` -------------------------------- ### libwacom_new_from_name Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a WacomDevice from a device name. ```APIDOC ## libwacom_new_from_name ### Description Creates a new WacomDevice by matching the given device name. ### Signature ```c WacomDevice *libwacom_new_from_name(const WacomDeviceDatabase *db, const char *name, WacomError *error); ``` ### Parameters - **db** (const WacomDeviceDatabase*) - The database to use. - **name** (const char*) - The device name. - **error** (WacomError*) - Optional error object. ### Returns - **WacomDevice*** - A pointer to the created device, or NULL on failure. ``` -------------------------------- ### libwacom_database_new_for_path() Source: https://linuxwacom.github.io/libwacom/globals_func.html Creates a new libwacom database object using a specified path. ```APIDOC ## libwacom_database_new_for_path() ### Description Creates a new libwacom database object using a specified path. ### Function `LibwacomDatabase *libwacom_database_new_for_path(const char *path);` ### Parameters - **path** (const char*) - Required - The path to the database directory. ### Returns A pointer to the newly created database object, or NULL on failure. ``` -------------------------------- ### libwacom_get_matches() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns a pointer to the null-terminated list of possible matches for the device. The pointer and its content must not be modified. ```APIDOC ## libwacom_get_matches() ### Description Returns a pointer to the null-terminated list of possible matches for the device. The pointer and its content must not be modified. ### Function Signature const WacomMatch ** libwacom_get_matches(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns - A pointer to the null-terminated list of possible matches for this device. Do not modify this pointer or any content! ``` -------------------------------- ### libwacom_builder_new Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Creates a new WacomBuilder object. ```APIDOC ## libwacom_builder_new ### Description Creates a new WacomBuilder object. ### Function Signature ```c WacomBuilder *libwacom_builder_new(void); ``` ### Returns - **WacomBuilder*** - New builder object. ``` -------------------------------- ### libwacom_builder_new() Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Creates a new builder object for use with libwacom_new_from_builder(). The returned builder must be freed with libwacom_builder_destroy(). ```APIDOC ## libwacom_builder_new() ### Description Creates a new builder to be used into libwacom_new_from_builder(). The returned builder must be freed with libwacom_builder_destroy(). ### Function Signature WacomBuilder * libwacom_builder_new(void) ### Parameters None. ### Returns A pointer to a new WacomBuilder object. ### Notes - The returned builder must be freed with libwacom_builder_destroy(). ``` -------------------------------- ### libwacom_compare Source: https://linuxwacom.github.io/libwacom/group__devices.html Compares two Wacom devices for equality based on the given flags. Returns 0 if identical, nonzero otherwise. ```APIDOC ## libwacom_compare() ### Description Compares two Wacom devices for equality based on the given flags. ### Function Signature int libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags) ### Parameters - **a** (const WacomDevice*) - Required - The first device - **b** (const WacomDevice*) - Required - The second device - **flags** (WacomCompareFlags) - Required - Flags to dictate what constitutes a match ### Returns - **int** - 0 if the devices are identical, nonzero otherwise ``` -------------------------------- ### libwacom_compare Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Compares two WacomDevice objects. ```APIDOC ## libwacom_compare ### Description Compares two WacomDevice objects according to the given flags. ### Signature ```c int libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags flags); ``` ### Parameters - **a** (const WacomDevice*) - First device. - **b** (const WacomDevice*) - Second device. - **flags** (WacomCompareFlags) - Comparison flags (e.g., WCOMPARE_NORMAL, WCOMPARE_MATCHES). ### Returns - **int** - 0 if equal, non-zero otherwise. ``` -------------------------------- ### libwacom_list_styli_from_database Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Returns the list of styli in the given database. ```APIDOC ## libwacom_list_styli_from_database ### Description Returns the list of styli in the given database. ### Function Signature const WacomStylus ** libwacom_list_styli_from_database (const WacomDeviceDatabase *db, WacomError *error) ### Parameters - **db** (const WacomDeviceDatabase*) - The database handle. - **error** (WacomError*) - Error reporting structure. ### Returns - **const WacomStylus**** - A NULL-terminated array of stylus pointers. ``` -------------------------------- ### libwacom_get_integration_flags() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the integration flags for the device. ```APIDOC ## libwacom_get_integration_flags() ### Description Returns the integration flags for the device. ### Method Function ### Signature WacomIntegrationFlags libwacom_get_integration_flags(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **WacomIntegrationFlags** - The integration flags for the device ``` -------------------------------- ### libwacom_print_device_description() Source: https://linuxwacom.github.io/libwacom/group__devices.html Prints the description of a Wacom device to a given file descriptor. ```APIDOC ## libwacom_print_device_description() ### Description Print the description of this device to the given file. ### Method Function ### Signature void libwacom_print_device_description(int fd, const WacomDevice *device) ### Parameters - **fd** (int) - Required - The file descriptor to print to - **device** (const WacomDevice *) - Required - The device to print the description for. ``` -------------------------------- ### libwacom_get_status_leds() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns an array of status LEDs supported by the device. ```APIDOC ## libwacom_get_status_leds() ### Description Returns an array of status LEDs supported by the device. ### Function Signature const WacomStatusLEDs *libwacom_get_status_leds(const WacomDevice *device, int *num_leds) ### Parameters - **device** (const WacomDevice*) - The tablet to query. - **num_leds** (int*) - Return location for the number of supported status LEDs. ### Returns - **const WacomStatusLEDs*** - An array of status LEDs supported by the device. ``` -------------------------------- ### libwacom_get_product_id() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the numeric product ID for this device. Note: The return value is a signed int but libwacom_match_get_product_id() returns an unsigned int. This may cause compiler warning, but the effective range for product IDs is 16-bit only anyway. ```APIDOC ## libwacom_get_product_id() ### Description Returns the numeric product ID for this device. ### Function Signature int libwacom_get_product_id(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **int** - The numeric product ID for this device ### Bug The return value is a signed int but libwacom_match_get_product_id() returns an unsigned int. This may cause compiler warning, but the effective range for product IDs is 16-bit only anyway. ``` -------------------------------- ### libwacom_get_paired_device() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the match string of the paired device for this device. A paired device is a device with a different match string but that shares the physical device with this device. If NULL, no device is paired or all paired devices have the same WacomMatch. ```APIDOC ## libwacom_get_paired_device() ### Description Return the match string of the paired device for this device. A paired device is a device with a different match string but that shares the physical device with this device. If the return value is NULL, no device is paired with this device or all paired devices have the same WacomMatch as this device. The returned device may not be a libwacom device itself. ### Function Signature const WacomMatch *libwacom_get_paired_device(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **const WacomMatch*** - A pointer to paired device for this device. Do not modify this pointer or any content! ``` -------------------------------- ### libwacom_get_supported_styli() Source: https://linuxwacom.github.io/libwacom/globals_func.html Retrieves the list of supported styli for a libwacom device. ```APIDOC ## libwacom_get_supported_styli() ### Description Retrieves the list of supported styli for a libwacom device. ### Function `const LibwacomStylus **libwacom_get_supported_styli(const LibwacomDevice *device);` ### Parameters - **device** (const LibwacomDevice*) - Required - The device object. ### Returns An array of stylus objects. ``` -------------------------------- ### libwacom_get_match() Source: https://linuxwacom.github.io/libwacom/group__devices.html Retrieves the current match string for the device, or the first match string in the tablet definition if not set. ```APIDOC ## libwacom_get_match() ### Description Retrieves the current match string for the device, or the first match string in the tablet definition if not set. ### Function Signature const char * libwacom_get_match(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns - The current match string used for this device (if set) or the first match string in the tablet definition. ``` -------------------------------- ### libwacom_builder_set_usbid Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Sets the vendor and product IDs on the builder. ```APIDOC ## libwacom_builder_set_usbid ### Description Changes the vendor and product id to the given ids, overriding the currently set ones (if any). ### Function Signature ```c void libwacom_builder_set_usbid(WacomBuilder *builder, int vendor_id, int product_id) ``` ### Parameters - **builder** (WacomBuilder *) - Required - The builder to modify. - **vendor_id** (int) - Required - The vendor ID. - **product_id** (int) - Required - The product ID. ### Return Value - **void** - No return value. ``` -------------------------------- ### libwacom_get_layout_filename() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the full filename including path to the SVG layout of the device if available, or NULL otherwise. ```APIDOC ## libwacom_get_layout_filename() ### Description Returns the full filename including path to the SVG layout of the device if available, or NULL otherwise. ### Method Function ### Signature const char * libwacom_get_layout_filename(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **const char*** - The full filename including path to the SVG layout of the device if available, or NULL otherwise ``` -------------------------------- ### libwacom_get_match Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Retrieves the match string for the device. ```APIDOC ## libwacom_get_match ### Description Retrieves the match string for the device. ### Function Signature ```c const char * libwacom_get_match(const WacomDevice *device) ``` ### Parameters - **device** (const WacomDevice*) - The device to query. ### Returns - **const char*** - The match string. ``` -------------------------------- ### libwacom_get_name() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the human-readable name for the device. ```APIDOC ## libwacom_get_name() ### Description Returns the human-readable name for the device. ### Function Signature const char * libwacom_get_name(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns - The human-readable name for this device. ``` -------------------------------- ### libwacom_database_ref() Source: https://linuxwacom.github.io/libwacom/group__context.html Increases the refcount of the database by one. Returns the database passed in as argument. ```APIDOC ## libwacom_database_ref() ### Description Increase the refcount of the database by one. ### Function Signature WacomDeviceDatabase * libwacom_database_ref(WacomDeviceDatabase *db) ### Parameters - **db** (WacomDeviceDatabase*) - Required - A Tablet and Stylus database. ### Returns - **WacomDeviceDatabase*** - The database passed in as argument. ### Since 2.19 ``` -------------------------------- ### libwacom_match_get_match_string() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the match string of a WacomMatch object. ```APIDOC ## libwacom_match_get_match_string() ### Description Returns the match string of a WacomMatch object. ### Function Signature const char *libwacom_match_get_match_string(const WacomMatch *_match_) ### Parameters - **_match_** (const WacomMatch *) - Required - The match object. ### Returns const char * - The match string. ``` -------------------------------- ### libwacom_get_num_buttons() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the number of buttons on the tablet. Tablet buttons are numbered 'A' through to 'A' + number of buttons. ```APIDOC ## libwacom_get_num_buttons() ### Description Returns the number of buttons on the tablet. Tablet buttons are numbered 'A' through to 'A' + number of buttons. ### Function Signature int libwacom_get_num_buttons(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns - The number of buttons on the tablet. ``` -------------------------------- ### libwacom_get_num_keys() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the number of keys on the tablet. Tablet keys indices are numbered from zero. ```APIDOC ## libwacom_get_num_keys() ### Description Returns the number of keys on the tablet. Tablet keys indices are numbered from zero. ### Function Signature int libwacom_get_num_keys(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **int** - The number of keys on the tablet ``` -------------------------------- ### libwacom_get_num_strips() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the number of touch strips on the tablet. ```APIDOC ## libwacom_get_num_strips() ### Description Returns the number of touch strips on the tablet. ### Function Signature int libwacom_get_num_strips(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **int** - The number of touch strips on the tablet ``` -------------------------------- ### libwacom_get_matches() Source: https://linuxwacom.github.io/libwacom/globals_func.html Retrieves the list of matches for a libwacom device. ```APIDOC ## libwacom_get_matches() ### Description Retrieves the list of matches for a libwacom device. ### Function `const LibwacomMatch **libwacom_get_matches(const LibwacomDevice *device);` ### Parameters - **device** (const LibwacomDevice*) - Required - The device object. ### Returns An array of match objects. ``` -------------------------------- ### libwacom_match_get_match_string Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Returns the match string from a match. ```APIDOC ## libwacom_match_get_match_string ### Description Returns the match string from a match. ### Function Signature ```c const char *libwacom_match_get_match_string(const WacomMatch *match); ``` ### Parameters - **match** (const WacomMatch*) - Required - The match to query. ### Returns - **const char*** - Match string. ``` -------------------------------- ### libwacom_get_width() Source: https://linuxwacom.github.io/libwacom/group__devices.html Retrieves the width of the device in inches. The width is the usable area as advertised, not the total physical size. ```APIDOC ## libwacom_get_width() ### Description 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. ### Function Signature int libwacom_get_width(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns The width of this device in inches. ``` -------------------------------- ### libwacom_get_matches Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Retrieves the array of match strings for the device. ```APIDOC ## libwacom_get_matches ### Description Retrieves the array of match strings for the device. ### Function Signature const WacomMatch ** libwacom_get_matches (const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **const WacomMatch**** - A NULL-terminated array of match pointers. ``` -------------------------------- ### libwacom_get_button_flag Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns a WacomButtonFlags with information about the specified button. ```APIDOC ## libwacom_get_button_flag() ### Description Returns a WacomButtonFlags with information about the specified button. ### Function Signature WacomButtonFlags libwacom_get_button_flag(const WacomDevice *device, char button) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query - **button** (char) - Required - The ID of the button to check for, between 'A' and 'Z' ### Returns - **WacomButtonFlags** - A WacomButtonFlags with information about the button ``` -------------------------------- ### libwacom_get_height() Source: https://linuxwacom.github.io/libwacom/group__devices.html Retrieve the height of the device. This is the height of the usable area as advertised, not the total size of the physical tablet. ```APIDOC ## libwacom_get_height() ### Description 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. ### Method Function ### Signature int libwacom_get_height(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **int** - The height of this device in inches ``` -------------------------------- ### WacomBusType Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Enumeration of bus types for Wacom devices. ```APIDOC ## WacomBusType ### Description Enumeration of bus types for Wacom devices. ### Values - `WBUSTYPE_UNKNOWN` - Unknown bus type. - `WBUSTYPE_USB` - USB bus. - `WBUSTYPE_SERIAL` - Serial bus. - `WBUSTYPE_BLUETOOTH` - Bluetooth bus. - `WBUSTYPE_I2C` - I2C bus. ### Definition ```c typedef enum { WBUSTYPE_UNKNOWN, WBUSTYPE_USB, WBUSTYPE_SERIAL, WBUSTYPE_BLUETOOTH, WBUSTYPE_I2C, } WacomBusType; ``` ``` -------------------------------- ### libwacom_get_height_mm() Source: https://linuxwacom.github.io/libwacom/group__devices.html Retrieve the height of the device in mm. This is the height of the usable area as advertised, not the total size of the physical tablet. ```APIDOC ## libwacom_get_height_mm() ### Description Retrieve the height of the device in mm. This is the height of the usable area as advertised, not the total size of the physical tablet. ### Method Function ### Signature int libwacom_get_height_mm(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - Required - The tablet to query ### Returns - **int** - The height of this device in mm ### Since 2.19 ``` -------------------------------- ### libwacom_get_product_id Source: https://linuxwacom.github.io/libwacom/libwacom_8h.html Retrieves the product ID of the device. ```APIDOC ## libwacom_get_product_id ### Description Retrieves the product ID of the device. ### Function Signature int libwacom_get_product_id (const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The device. ### Returns - **int** - The product ID. ``` -------------------------------- ### libwacom_error_new Source: https://linuxwacom.github.io/libwacom/group__context.html Allocates a new structure for error reporting. ```APIDOC ## libwacom_error_new ### Description Allocates a new structure for error reporting. ### Returns A pointer to the newly allocated WacomError structure. ``` -------------------------------- ### libwacom_database_destroy Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Destroys a WacomDeviceDatabase and frees its resources. ```APIDOC ## libwacom_database_destroy ### Description Destroys a WacomDeviceDatabase and releases all associated memory. ### Signature ```c void libwacom_database_destroy(WacomDeviceDatabase *db); ``` ### Parameters - **db** (WacomDeviceDatabase*) - The database to destroy. ``` -------------------------------- ### libwacom_destroy Source: https://linuxwacom.github.io/libwacom/group__devices.html Removes the device and frees all memory and references to it. ```APIDOC ## libwacom_destroy() ### Description Removes the device and frees all memory and references to it. ### Function Signature void libwacom_destroy(WacomDevice *device) ### Parameters - **device** (WacomDevice*) - Required - The device to delete ### Returns - **void** - No return value ``` -------------------------------- ### libwacom_get_width_mm() Source: https://linuxwacom.github.io/libwacom/group__devices.html Retrieves the width of the device in millimeters. The width is the usable area as advertised, not the total physical size. ```APIDOC ## libwacom_get_width_mm() ### Description Retrieve the width of the device in mm. This is the width of the usable area as advertised, not the total size of the physical tablet. ### Function Signature int libwacom_get_width_mm(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns The width of this device in mm. ### Since 2.19 ``` -------------------------------- ### WacomIntegrationFlags Source: https://linuxwacom.github.io/libwacom/libwacom_8h_source.html Enumeration of integration flags for Wacom devices. ```APIDOC ## WacomIntegrationFlags ### Description Enumeration of integration flags for Wacom devices. ### Values - `WACOM_DEVICE_INTEGRATED_NONE` (0) - No integration. - `WACOM_DEVICE_INTEGRATED_DISPLAY` (1 << 0) - Integrated display. - `WACOM_DEVICE_INTEGRATED_SYSTEM` (1 << 1) - Integrated system. - `WACOM_DEVICE_INTEGRATED_REMOTE` (1 << 2) - Integrated remote. ### Definition ```c typedef enum { WACOM_DEVICE_INTEGRATED_NONE = 0, WACOM_DEVICE_INTEGRATED_DISPLAY = (1 << 0), WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1), WACOM_DEVICE_INTEGRATED_REMOTE = (1 << 2), } WacomIntegrationFlags; ``` ``` -------------------------------- ### libwacom_match_get_product_id() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the product ID of a WacomMatch object. ```APIDOC ## libwacom_match_get_product_id() ### Description Returns the product ID of a WacomMatch object. ### Function Signature uint32_t libwacom_match_get_product_id(const WacomMatch *_match_) ### Parameters - **_match_** (const WacomMatch *) - Required - The match object. ### Returns uint32_t - The product ID of the match. ``` -------------------------------- ### libwacom_get_strips_num_modes() Source: https://linuxwacom.github.io/libwacom/group__devices.html Returns the number of modes for each of the touchstrips if any. ```APIDOC ## libwacom_get_strips_num_modes() ### Description Returns the number of modes for each of the touchstrips if any. ### Function Signature int libwacom_get_strips_num_modes(const WacomDevice *device) ### Parameters - **device** (const WacomDevice*) - The tablet to query. ### Returns - **int** - The number of modes for each of the touchstrips if any. ``` -------------------------------- ### libwacom_get_supported_styli Source: https://linuxwacom.github.io/libwacom/deprecated.html Deprecated function that retrieves the supported styli for a device. Use libwacom_get_styli() instead. ```APIDOC ## libwacom_get_supported_styli ### Description Deprecated function that retrieves the supported styli for a device. Use libwacom_get_styli() instead. ### Signature ```c Global libwacom_get_supported_styli (const WacomDevice *device, int *num_styli) ``` ### Parameters - **device** (const WacomDevice*) - The device to query. - **num_styli** (int*) - Output parameter for the number of styli. ### Deprecation Deprecated since 2.14. Use libwacom_get_styli() instead. ```