From 081e03af089913453175c65b308f84d648b9cd5d Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 8 Oct 2024 11:53:59 +1000 Subject: [PATCH] Add a new IntegratedIn=Remote flag In commit 2dd3501fd3dd ("Deprecate the WacomClass in the API") libwacom_get_class() was deprecated. But that function remains the only way to reliably identify the ExpressKey Remote as remote. This didn't really matter since at least GNOME identifies that by PID/VID rather than class. Other vendors now make their own remotes (XP Pen ACK05, Huion Keypad mini) so let's add an integration flag for those. --- data/wacom-ek-remote.tablet | 1 + libwacom/libwacom-database.c | 3 ++- libwacom/libwacom.c | 2 ++ libwacom/libwacom.h | 18 +++++++++++++++++- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/data/wacom-ek-remote.tablet b/data/wacom-ek-remote.tablet index f74c0430..340ae6d4 100644 --- a/data/wacom-ek-remote.tablet +++ b/data/wacom-ek-remote.tablet @@ -17,6 +17,7 @@ ModelName=ACK-411050 DeviceMatch=usb|056a|0331 Layout=wacom-ek-remote.svg Class=Remote +IntegratedIn=Remote [Features] Stylus=false diff --git a/libwacom/libwacom-database.c b/libwacom/libwacom-database.c index f7c41fda..e107888a 100644 --- a/libwacom/libwacom-database.c +++ b/libwacom/libwacom-database.c @@ -448,7 +448,8 @@ static const struct { WacomIntegrationFlags value; } integration_flags[] = { { "Display", WACOM_DEVICE_INTEGRATED_DISPLAY }, - { "System", WACOM_DEVICE_INTEGRATED_SYSTEM } + { "System", WACOM_DEVICE_INTEGRATED_SYSTEM }, + { "Remote", WACOM_DEVICE_INTEGRATED_REMOTE } }; static void diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 287757e5..52755cc6 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -1009,6 +1009,8 @@ static void print_integrated_flags_for_device (int fd, const WacomDevice *device dprintf(fd, "Display;"); if (device->integration_flags & WACOM_DEVICE_INTEGRATED_SYSTEM) dprintf(fd, "System;"); + if (device->integration_flags & WACOM_DEVICE_INTEGRATED_REMOTE) + dprintf(fd, "Remote;"); dprintf(fd, "\n"); } diff --git a/libwacom/libwacom.h b/libwacom/libwacom.h index 98710658..f07ba5f7 100644 --- a/libwacom/libwacom.h +++ b/libwacom/libwacom.h @@ -163,8 +163,24 @@ typedef enum { */ typedef enum { WACOM_DEVICE_INTEGRATED_NONE = 0, + /** + * The device is integrated into a display + * like the Wacom Cintiq series. + */ WACOM_DEVICE_INTEGRATED_DISPLAY = (1 << 0), - WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1) + /** + * This flag is almost always used together + * with @ref WACOM_DEVICE_INTEGRATED_DISPLAY + * and indicates that the device is a built-in + * device such as a Wacom tablet in the screen + * of a laptop. + */ + WACOM_DEVICE_INTEGRATED_SYSTEM = (1 << 1), + /** + * The device is an external pad + * like the Wacom ExpressKey Remote. + */ + WACOM_DEVICE_INTEGRATED_REMOTE = (1 << 2), } WacomIntegrationFlags; /**