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_TOUCH_H
|
|
|
|
#define WLR_TYPES_WLR_TOUCH_H
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#include <stdint.h>
|
2022-02-01 17:51:50 +01:00
|
|
|
#include <wlr/types/wlr_input_device.h>
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2017-06-20 00:41:02 +02:00
|
|
|
|
|
|
|
struct wlr_touch_impl;
|
|
|
|
|
|
|
|
struct wlr_touch {
|
2022-02-01 17:51:50 +01:00
|
|
|
struct wlr_input_device base;
|
|
|
|
|
2019-07-15 22:54:39 +02:00
|
|
|
const struct wlr_touch_impl *impl;
|
2017-06-20 00:41:02 +02:00
|
|
|
|
2022-03-08 22:45:03 +01:00
|
|
|
char *output_name;
|
2022-03-08 22:54:28 +01:00
|
|
|
double width_mm, height_mm;
|
2022-03-08 22:45:03 +01:00
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
struct {
|
2022-06-27 22:56:02 +02:00
|
|
|
struct wl_signal down; // struct wlr_touch_down_event
|
|
|
|
struct wl_signal up; // struct wlr_touch_up_event
|
|
|
|
struct wl_signal motion; // struct wlr_touch_motion_event
|
|
|
|
struct wl_signal cancel; // struct wlr_touch_cancel_event
|
2021-06-30 11:38:57 +02:00
|
|
|
struct wl_signal frame;
|
2017-06-20 00:41:02 +02:00
|
|
|
} events;
|
2017-08-11 20:23:53 +02:00
|
|
|
|
|
|
|
void *data;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2022-03-09 22:01:14 +01:00
|
|
|
struct wlr_touch_down_event {
|
|
|
|
struct wlr_touch *touch;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-11-16 23:53:52 +01:00
|
|
|
int32_t touch_id;
|
2018-03-28 17:04:40 +02:00
|
|
|
// From 0..1
|
|
|
|
double x, y;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2022-03-09 22:01:14 +01:00
|
|
|
struct wlr_touch_up_event {
|
|
|
|
struct wlr_touch *touch;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-11-16 23:53:52 +01:00
|
|
|
int32_t touch_id;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2022-03-09 22:01:14 +01:00
|
|
|
struct wlr_touch_motion_event {
|
|
|
|
struct wlr_touch *touch;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-11-16 23:53:52 +01:00
|
|
|
int32_t touch_id;
|
2018-03-28 17:04:40 +02:00
|
|
|
// From 0..1
|
|
|
|
double x, y;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2022-03-09 22:01:14 +01:00
|
|
|
struct wlr_touch_cancel_event {
|
|
|
|
struct wlr_touch *touch;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-11-16 23:53:52 +01:00
|
|
|
int32_t touch_id;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2022-06-20 16:57:29 +02:00
|
|
|
/**
|
|
|
|
* Get a struct wlr_touch from a struct wlr_input_device.
|
|
|
|
*
|
|
|
|
* Asserts that the input device is a touch device.
|
|
|
|
*/
|
|
|
|
struct wlr_touch *wlr_touch_from_input_device(
|
|
|
|
struct wlr_input_device *input_device);
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#endif
|