2018-07-13 14:40:56 +02:00
|
|
|
/*
|
|
|
|
* This an unstable interface of wlroots. No guarantees are made regarding the
|
|
|
|
* future consistency of this API.
|
|
|
|
*/
|
|
|
|
#ifndef WLR_USE_UNSTABLE
|
|
|
|
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features"
|
|
|
|
#endif
|
|
|
|
|
2018-04-24 08:10:45 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_TABLET_V2_H
|
|
|
|
#define WLR_TYPES_WLR_TABLET_V2_H
|
|
|
|
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2018-04-24 08:10:45 +02:00
|
|
|
#include <wlr/types/wlr_seat.h>
|
|
|
|
|
2018-04-26 12:31:25 +02:00
|
|
|
#include "tablet-unstable-v2-protocol.h"
|
|
|
|
|
2018-05-04 11:46:32 +02:00
|
|
|
/* This can probably be even lower,the tools don't have a lot of buttons */
|
2018-05-17 15:21:20 +02:00
|
|
|
#define WLR_TABLET_V2_TOOL_BUTTONS_CAP 16
|
2018-05-04 11:46:32 +02:00
|
|
|
|
2022-03-03 15:43:38 +01:00
|
|
|
struct wlr_input_device;
|
|
|
|
|
2018-07-19 11:35:00 +02:00
|
|
|
struct wlr_tablet_pad_v2_grab_interface;
|
|
|
|
|
|
|
|
struct wlr_tablet_pad_v2_grab {
|
|
|
|
const struct wlr_tablet_pad_v2_grab_interface *interface;
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2018-07-20 10:18:22 +02:00
|
|
|
struct wlr_tablet_tool_v2_grab_interface;
|
|
|
|
|
|
|
|
struct wlr_tablet_tool_v2_grab {
|
|
|
|
const struct wlr_tablet_tool_v2_grab_interface *interface;
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
2018-05-02 09:26:34 +02:00
|
|
|
struct wlr_tablet_client_v2;
|
2018-04-26 12:31:25 +02:00
|
|
|
struct wlr_tablet_tool_client_v2;
|
|
|
|
struct wlr_tablet_pad_client_v2;
|
|
|
|
|
2018-04-24 08:10:45 +02:00
|
|
|
struct wlr_tablet_manager_v2 {
|
|
|
|
struct wl_global *wl_global;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list clients; // wlr_tablet_manager_client_v2.link
|
|
|
|
struct wl_list seats; // wlr_tablet_seat_v2.link
|
2018-04-24 08:10:45 +02:00
|
|
|
|
|
|
|
struct wl_listener display_destroy;
|
|
|
|
|
2018-08-26 23:23:12 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
|
|
|
|
2018-04-24 08:10:45 +02:00
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_tablet_v2_tablet {
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_tablet_seat_v2.tablets
|
2018-06-16 11:19:48 +02:00
|
|
|
struct wlr_tablet *wlr_tablet;
|
2018-04-24 08:10:45 +02:00
|
|
|
struct wlr_input_device *wlr_device;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list clients; // wlr_tablet_client_v2.tablet_link
|
2018-04-24 08:10:45 +02:00
|
|
|
|
|
|
|
struct wl_listener tool_destroy;
|
2018-05-02 09:26:34 +02:00
|
|
|
|
|
|
|
struct wlr_tablet_client_v2 *current_client;
|
2018-04-24 08:10:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_tablet_v2_tablet_tool {
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_tablet_seat_v2.tablets
|
2018-06-16 11:19:48 +02:00
|
|
|
struct wlr_tablet_tool *wlr_tool;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list clients; // wlr_tablet_tool_client_v2.tool_link
|
2018-04-24 08:10:45 +02:00
|
|
|
|
|
|
|
struct wl_listener tool_destroy;
|
2018-04-26 12:31:25 +02:00
|
|
|
|
|
|
|
struct wlr_tablet_tool_client_v2 *current_client;
|
2018-05-02 09:26:34 +02:00
|
|
|
struct wlr_surface *focused_surface;
|
|
|
|
struct wl_listener surface_destroy;
|
2018-05-04 11:46:32 +02:00
|
|
|
|
2018-07-20 10:18:22 +02:00
|
|
|
struct wlr_tablet_tool_v2_grab *grab;
|
|
|
|
struct wlr_tablet_tool_v2_grab default_grab;
|
|
|
|
|
2018-05-17 14:23:17 +02:00
|
|
|
uint32_t proximity_serial;
|
2018-05-17 12:22:15 +02:00
|
|
|
bool is_down;
|
2018-05-17 14:23:17 +02:00
|
|
|
uint32_t down_serial;
|
2018-05-04 11:46:32 +02:00
|
|
|
size_t num_buttons;
|
2018-05-17 15:21:20 +02:00
|
|
|
uint32_t pressed_buttons[WLR_TABLET_V2_TOOL_BUTTONS_CAP];
|
|
|
|
uint32_t pressed_serials[WLR_TABLET_V2_TOOL_BUTTONS_CAP];
|
2018-05-15 15:41:32 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal set_cursor; // struct wlr_tablet_v2_event_cursor
|
|
|
|
} events;
|
2018-04-24 08:10:45 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_tablet_v2_tablet_pad {
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list link; // wlr_tablet_seat_v2.pads
|
2018-04-24 08:10:45 +02:00
|
|
|
struct wlr_tablet_pad *wlr_pad;
|
|
|
|
struct wlr_input_device *wlr_device;
|
2022-05-24 18:46:59 +02:00
|
|
|
struct wl_list clients; // wlr_tablet_pad_client_v2.pad_link
|
2018-04-24 08:10:45 +02:00
|
|
|
|
2018-04-26 12:31:25 +02:00
|
|
|
size_t group_count;
|
|
|
|
uint32_t *groups;
|
|
|
|
|
2018-04-24 08:10:45 +02:00
|
|
|
struct wl_listener pad_destroy;
|
2018-04-26 12:31:25 +02:00
|
|
|
|
|
|
|
struct wlr_tablet_pad_client_v2 *current_client;
|
2018-07-19 11:35:00 +02:00
|
|
|
struct wlr_tablet_pad_v2_grab *grab;
|
|
|
|
struct wlr_tablet_pad_v2_grab default_grab;
|
2018-05-15 15:41:32 +02:00
|
|
|
|
|
|
|
struct {
|
|
|
|
struct wl_signal button_feedback; // struct wlr_tablet_v2_event_feedback
|
|
|
|
struct wl_signal strip_feedback; // struct wlr_tablet_v2_event_feedback
|
|
|
|
struct wl_signal ring_feedback; // struct wlr_tablet_v2_event_feedback
|
|
|
|
} events;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_tablet_v2_event_cursor {
|
|
|
|
struct wlr_surface *surface;
|
|
|
|
uint32_t serial;
|
|
|
|
int32_t hotspot_x;
|
|
|
|
int32_t hotspot_y;
|
2018-05-17 09:59:37 +02:00
|
|
|
struct wlr_seat_client *seat_client;
|
2018-05-15 15:41:32 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_tablet_v2_event_feedback {
|
|
|
|
const char *description;
|
|
|
|
size_t index;
|
|
|
|
uint32_t serial;
|
2018-04-24 08:10:45 +02:00
|
|
|
};
|
|
|
|
|
2018-05-15 15:41:32 +02:00
|
|
|
struct wlr_tablet_v2_tablet *wlr_tablet_create(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_manager_v2 *manager,
|
|
|
|
struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_input_device *wlr_device);
|
2018-04-24 08:10:45 +02:00
|
|
|
|
2018-05-15 15:41:32 +02:00
|
|
|
struct wlr_tablet_v2_tablet_pad *wlr_tablet_pad_create(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_manager_v2 *manager,
|
|
|
|
struct wlr_seat *wlr_seat,
|
|
|
|
struct wlr_input_device *wlr_device);
|
2018-04-24 08:10:45 +02:00
|
|
|
|
2018-05-15 15:41:32 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *wlr_tablet_tool_create(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_manager_v2 *manager,
|
|
|
|
struct wlr_seat *wlr_seat,
|
2018-06-16 11:19:48 +02:00
|
|
|
struct wlr_tablet_tool *wlr_tool);
|
2018-04-24 08:10:45 +02:00
|
|
|
|
|
|
|
struct wlr_tablet_manager_v2 *wlr_tablet_v2_create(struct wl_display *display);
|
|
|
|
|
2018-05-17 14:23:17 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_proximity_in(
|
2018-04-26 12:31:25 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
2018-05-17 14:23:17 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_down(struct wlr_tablet_v2_tablet_tool *tool);
|
2018-05-17 12:22:15 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_up(struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
2018-04-26 12:31:25 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_motion(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
|
2018-04-26 12:31:25 +02:00
|
|
|
|
2018-05-17 12:22:15 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_pressure(
|
2018-05-19 12:16:11 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double pressure);
|
2018-05-17 12:22:15 +02:00
|
|
|
|
2018-05-02 09:26:34 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_distance(
|
2018-05-19 12:16:11 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double distance);
|
2018-05-02 09:26:34 +02:00
|
|
|
|
2018-05-17 12:22:15 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_tilt(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
|
2018-05-17 12:22:15 +02:00
|
|
|
|
|
|
|
void wlr_send_tablet_v2_tablet_tool_rotation(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double degrees);
|
|
|
|
|
|
|
|
void wlr_send_tablet_v2_tablet_tool_slider(
|
2018-05-19 12:16:11 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double position);
|
2018-05-17 12:22:15 +02:00
|
|
|
|
2018-05-02 09:26:34 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_wheel(
|
2018-06-24 20:56:39 +02:00
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double degrees, int32_t clicks);
|
2018-05-02 09:26:34 +02:00
|
|
|
|
2018-04-26 12:31:25 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_proximity_out(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
2018-05-17 14:23:17 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_tool_button(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, uint32_t button,
|
|
|
|
enum zwp_tablet_pad_v2_button_state state);
|
2018-05-04 11:46:32 +02:00
|
|
|
|
2018-07-20 10:18:22 +02:00
|
|
|
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_proximity_in(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_down(struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_up(struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_motion(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_pressure(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double pressure);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_distance(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double distance);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_tilt(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double x, double y);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_rotation(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double degrees);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_slider(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double position);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_wheel(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, double degrees, int32_t clicks);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_proximity_out(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_tool_notify_button(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool, uint32_t button,
|
|
|
|
enum zwp_tablet_pad_v2_button_state state);
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_tablet_tool_v2_grab_interface {
|
|
|
|
void (*proximity_in)(
|
|
|
|
struct wlr_tablet_tool_v2_grab *grab,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
void (*down)(struct wlr_tablet_tool_v2_grab *grab);
|
|
|
|
void (*up)(struct wlr_tablet_tool_v2_grab *grab);
|
|
|
|
|
|
|
|
void (*motion)(struct wlr_tablet_tool_v2_grab *grab, double x, double y);
|
|
|
|
|
|
|
|
void (*pressure)(struct wlr_tablet_tool_v2_grab *grab, double pressure);
|
|
|
|
|
|
|
|
void (*distance)(struct wlr_tablet_tool_v2_grab *grab, double distance);
|
|
|
|
|
|
|
|
void (*tilt)(struct wlr_tablet_tool_v2_grab *grab, double x, double y);
|
|
|
|
|
|
|
|
void (*rotation)(struct wlr_tablet_tool_v2_grab *grab, double degrees);
|
|
|
|
|
|
|
|
void (*slider)(struct wlr_tablet_tool_v2_grab *grab, double position);
|
|
|
|
|
|
|
|
void (*wheel)(struct wlr_tablet_tool_v2_grab *grab, double degrees, int32_t clicks);
|
|
|
|
|
|
|
|
void (*proximity_out)(struct wlr_tablet_tool_v2_grab *grab);
|
|
|
|
|
|
|
|
void (*button)(
|
|
|
|
struct wlr_tablet_tool_v2_grab *grab, uint32_t button,
|
|
|
|
enum zwp_tablet_pad_v2_button_state state);
|
|
|
|
void (*cancel)(struct wlr_tablet_tool_v2_grab *grab);
|
|
|
|
};
|
|
|
|
|
|
|
|
void wlr_tablet_tool_v2_start_grab(struct wlr_tablet_v2_tablet_tool *tool, struct wlr_tablet_tool_v2_grab *grab);
|
|
|
|
void wlr_tablet_tool_v2_end_grab(struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
2018-07-23 10:08:43 +02:00
|
|
|
void wlr_tablet_tool_v2_start_implicit_grab(struct wlr_tablet_v2_tablet_tool *tool);
|
|
|
|
|
2020-05-04 23:45:01 +02:00
|
|
|
bool wlr_tablet_tool_v2_has_implicit_grab(
|
|
|
|
struct wlr_tablet_v2_tablet_tool *tool);
|
2018-07-23 10:08:43 +02:00
|
|
|
|
2018-04-26 12:31:25 +02:00
|
|
|
uint32_t wlr_send_tablet_v2_tablet_pad_enter(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_v2_tablet_pad *pad,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
2018-04-26 12:31:25 +02:00
|
|
|
|
|
|
|
void wlr_send_tablet_v2_tablet_pad_button(
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_tablet_v2_tablet_pad *pad, size_t button,
|
|
|
|
uint32_t time, enum zwp_tablet_pad_v2_button_state state);
|
2018-04-26 12:31:25 +02:00
|
|
|
|
2018-07-19 11:35:00 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_pad_strip(struct wlr_tablet_v2_tablet_pad *pad,
|
2018-05-17 14:23:17 +02:00
|
|
|
uint32_t strip, double position, bool finger, uint32_t time);
|
2018-04-26 12:31:25 +02:00
|
|
|
void wlr_send_tablet_v2_tablet_pad_ring(struct wlr_tablet_v2_tablet_pad *pad,
|
2018-05-17 14:23:17 +02:00
|
|
|
uint32_t ring, double position, bool finger, uint32_t time);
|
2018-04-26 12:31:25 +02:00
|
|
|
|
|
|
|
uint32_t wlr_send_tablet_v2_tablet_pad_leave(struct wlr_tablet_v2_tablet_pad *pad,
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_surface *surface);
|
2018-04-26 12:31:25 +02:00
|
|
|
|
|
|
|
uint32_t wlr_send_tablet_v2_tablet_pad_mode(struct wlr_tablet_v2_tablet_pad *pad,
|
2018-05-17 14:23:17 +02:00
|
|
|
size_t group, uint32_t mode, uint32_t time);
|
2018-05-02 09:26:34 +02:00
|
|
|
|
2018-07-19 11:35:00 +02:00
|
|
|
|
|
|
|
uint32_t wlr_tablet_v2_tablet_pad_notify_enter(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_pad_notify_button(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad, size_t button,
|
|
|
|
uint32_t time, enum zwp_tablet_pad_v2_button_state state);
|
|
|
|
|
|
|
|
void wlr_tablet_v2_tablet_pad_notify_strip(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad,
|
|
|
|
uint32_t strip, double position, bool finger, uint32_t time);
|
|
|
|
void wlr_tablet_v2_tablet_pad_notify_ring(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad,
|
|
|
|
uint32_t ring, double position, bool finger, uint32_t time);
|
|
|
|
|
|
|
|
uint32_t wlr_tablet_v2_tablet_pad_notify_leave(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad, struct wlr_surface *surface);
|
|
|
|
|
|
|
|
uint32_t wlr_tablet_v2_tablet_pad_notify_mode(
|
|
|
|
struct wlr_tablet_v2_tablet_pad *pad,
|
|
|
|
size_t group, uint32_t mode, uint32_t time);
|
|
|
|
|
|
|
|
struct wlr_tablet_pad_v2_grab_interface {
|
|
|
|
uint32_t (*enter)(
|
|
|
|
struct wlr_tablet_pad_v2_grab *grab,
|
|
|
|
struct wlr_tablet_v2_tablet *tablet,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
void (*button)(struct wlr_tablet_pad_v2_grab *grab,size_t button,
|
|
|
|
uint32_t time, enum zwp_tablet_pad_v2_button_state state);
|
|
|
|
|
|
|
|
void (*strip)(struct wlr_tablet_pad_v2_grab *grab,
|
|
|
|
uint32_t strip, double position, bool finger, uint32_t time);
|
|
|
|
void (*ring)(struct wlr_tablet_pad_v2_grab *grab,
|
|
|
|
uint32_t ring, double position, bool finger, uint32_t time);
|
|
|
|
|
|
|
|
uint32_t (*leave)(struct wlr_tablet_pad_v2_grab *grab,
|
|
|
|
struct wlr_surface *surface);
|
|
|
|
|
|
|
|
uint32_t (*mode)(struct wlr_tablet_pad_v2_grab *grab,
|
|
|
|
size_t group, uint32_t mode, uint32_t time);
|
|
|
|
|
|
|
|
void (*cancel)(struct wlr_tablet_pad_v2_grab *grab);
|
|
|
|
};
|
|
|
|
|
|
|
|
void wlr_tablet_v2_end_grab(struct wlr_tablet_v2_tablet_pad *pad);
|
|
|
|
void wlr_tablet_v2_start_grab(struct wlr_tablet_v2_tablet_pad *pad, struct wlr_tablet_pad_v2_grab *grab);
|
|
|
|
|
2018-05-02 09:26:34 +02:00
|
|
|
bool wlr_surface_accepts_tablet_v2(struct wlr_tablet_v2_tablet *tablet,
|
2018-05-17 14:23:17 +02:00
|
|
|
struct wlr_surface *surface);
|
2018-04-24 08:10:45 +02:00
|
|
|
#endif /* WLR_TYPES_WLR_TABLET_V2_H */
|