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
|
|
|
|
|
2017-09-23 10:26:01 +02:00
|
|
|
#ifndef WLR_TYPES_WLR_INPUT_DEVICE_H
|
|
|
|
#define WLR_TYPES_WLR_INPUT_DEVICE_H
|
2017-06-20 00:41:02 +02:00
|
|
|
|
2020-11-11 14:16:41 +01:00
|
|
|
#include <wayland-server-core.h>
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
enum wlr_button_state {
|
|
|
|
WLR_BUTTON_RELEASED,
|
|
|
|
WLR_BUTTON_PRESSED,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum wlr_input_device_type {
|
|
|
|
WLR_INPUT_DEVICE_KEYBOARD,
|
|
|
|
WLR_INPUT_DEVICE_POINTER,
|
|
|
|
WLR_INPUT_DEVICE_TOUCH,
|
|
|
|
WLR_INPUT_DEVICE_TABLET_TOOL,
|
2018-04-29 13:15:54 +02:00
|
|
|
WLR_INPUT_DEVICE_TABLET_PAD,
|
2018-11-15 00:24:55 +01:00
|
|
|
WLR_INPUT_DEVICE_SWITCH,
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_input_device {
|
|
|
|
enum wlr_input_device_type type;
|
2018-04-29 13:15:54 +02:00
|
|
|
unsigned int vendor, product;
|
2017-06-20 00:41:02 +02:00
|
|
|
char *name;
|
2018-03-28 17:40:35 +02:00
|
|
|
// Or 0 if not applicable to this device
|
|
|
|
double width_mm, height_mm;
|
2017-06-20 00:41:02 +02:00
|
|
|
|
|
|
|
/* wlr_input_device.type determines which of these is valid */
|
|
|
|
union {
|
|
|
|
void *_device;
|
|
|
|
struct wlr_keyboard *keyboard;
|
|
|
|
struct wlr_pointer *pointer;
|
2019-03-19 23:41:20 +01:00
|
|
|
struct wlr_switch *switch_device;
|
2017-06-20 00:41:02 +02:00
|
|
|
struct wlr_touch *touch;
|
2018-06-16 11:19:48 +02:00
|
|
|
struct wlr_tablet *tablet;
|
2017-06-20 00:41:02 +02:00
|
|
|
struct wlr_tablet_pad *tablet_pad;
|
|
|
|
};
|
2017-08-11 20:23:53 +02:00
|
|
|
|
2017-08-28 16:29:53 +02:00
|
|
|
struct {
|
|
|
|
struct wl_signal destroy;
|
|
|
|
} events;
|
|
|
|
|
2017-08-11 20:23:53 +02:00
|
|
|
void *data;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|