diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/backend/libinput.h | 1 | ||||
-rw-r--r-- | include/wlr/types/wlr_tablet_tool.h | 40 |
2 files changed, 41 insertions, 0 deletions
diff --git a/include/backend/libinput.h b/include/backend/libinput.h index f0928133..6ecdf44f 100644 --- a/include/backend/libinput.h +++ b/include/backend/libinput.h @@ -67,6 +67,7 @@ void handle_touch_cancel(struct libinput_event *event, struct wlr_tablet_tool *create_libinput_tablet_tool( struct libinput_device *device); +void wlr_libinput_tablet_tool_destroy(struct wlr_input_device *device); void handle_tablet_tool_axis(struct libinput_event *event, struct libinput_device *device); void handle_tablet_tool_proximity(struct libinput_event *event, diff --git a/include/wlr/types/wlr_tablet_tool.h b/include/wlr/types/wlr_tablet_tool.h index 22bf2649..08d37f68 100644 --- a/include/wlr/types/wlr_tablet_tool.h +++ b/include/wlr/types/wlr_tablet_tool.h @@ -5,6 +5,41 @@ #include <wayland-server.h> #include <wlr/types/wlr_input_device.h> +/* + * Copy+Paste from libinput, but this should neither use libinput, nor + * tablet-unstable-v2 headers, so we can't include them + */ +enum wlr_tablet_tool_type { + WLR_TABLET_TOOL_TYPE_PEN = 1, /**< A generic pen */ + WLR_TABLET_TOOL_TYPE_ERASER, /**< Eraser */ + WLR_TABLET_TOOL_TYPE_BRUSH, /**< A paintbrush-like tool */ + WLR_TABLET_TOOL_TYPE_PENCIL, /**< Physical drawing tool, e.g. + Wacom Inking Pen */ + WLR_TABLET_TOOL_TYPE_AIRBRUSH, /**< An airbrush-like tool */ + WLR_TABLET_TOOL_TYPE_MOUSE, /**< A mouse bound to the tablet */ + WLR_TABLET_TOOL_TYPE_LENS, /**< A mouse tool with a lens */ +}; + +struct wlr_tablet_tool_tool { + enum wlr_tablet_tool_type type; + uint64_t hardware_serial; + uint64_t hardware_wacom; + + // Capabilities + bool tilt; + bool pressure; + bool distance; + bool rotation; + bool slider; + bool wheel; + + struct { + struct wl_signal destroy; + } events; + + void *data; +}; + struct wlr_tablet_tool_impl; struct wlr_tablet_tool { @@ -34,6 +69,8 @@ enum wlr_tablet_tool_axes { struct wlr_event_tablet_tool_axis { struct wlr_input_device *device; + struct wlr_tablet_tool_tool *tool; + uint32_t time_msec; uint32_t updated_axes; // From 0..1 @@ -53,6 +90,7 @@ enum wlr_tablet_tool_proximity_state { struct wlr_event_tablet_tool_proximity { struct wlr_input_device *device; + struct wlr_tablet_tool_tool *tool; uint32_t time_msec; // From 0..1 double x, y; @@ -66,6 +104,7 @@ enum wlr_tablet_tool_tip_state { struct wlr_event_tablet_tool_tip { struct wlr_input_device *device; + struct wlr_tablet_tool_tool *tool; uint32_t time_msec; // From 0..1 double x, y; @@ -74,6 +113,7 @@ struct wlr_event_tablet_tool_tip { struct wlr_event_tablet_tool_button { struct wlr_input_device *device; + struct wlr_tablet_tool_tool *tool; uint32_t time_msec; uint32_t button; enum wlr_button_state state; |