labwc/include/input/tablet.h
2024-07-09 19:13:33 +02:00

42 lines
973 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef LABWC_TABLET_H
#define LABWC_TABLET_H
#include <wayland-server-core.h>
#include <wlr/types/wlr_tablet_v2.h>
struct seat;
struct wlr_device;
struct wlr_input_device;
enum lab_tablet_motion_mode {
LAB_TABLET_MOTION_ABSOLUTE = 0,
LAB_TABLET_MOTION_RELATIVE,
};
struct drawing_tablet {
struct wlr_input_device *wlr_input_device;
struct seat *seat;
struct wlr_tablet *tablet;
struct wlr_tablet_v2_tablet *tablet_v2;
enum lab_tablet_motion_mode motion_mode;
double x, y, dx, dy;
double distance;
double pressure;
double tilt_x, tilt_y;
double rotation;
double slider;
double wheel_delta;
struct {
struct wl_listener proximity;
struct wl_listener axis;
struct wl_listener tip;
struct wl_listener button;
struct wl_listener destroy;
} handlers;
struct wl_list link; /* seat.tablets */
};
void tablet_init(struct seat *seat, struct wlr_input_device *wlr_input_device);
#endif /* LABWC_TABLET_H */