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_POINTER_H
|
|
|
|
#define WLR_TYPES_WLR_POINTER_H
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#include <stdint.h>
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2020-11-11 14:16:41 +01:00
|
|
|
#include <wayland-server-protocol.h>
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <wlr/types/wlr_input_device.h>
|
2017-06-20 00:41:02 +02:00
|
|
|
|
|
|
|
struct wlr_pointer_impl;
|
|
|
|
|
|
|
|
struct wlr_pointer {
|
2018-04-28 13:55:36 +02:00
|
|
|
const struct wlr_pointer_impl *impl;
|
2017-06-20 00:41:02 +02:00
|
|
|
|
|
|
|
struct {
|
2021-06-30 11:23:50 +02:00
|
|
|
struct wl_signal motion; // struct wlr_event_pointer_motion
|
|
|
|
struct wl_signal motion_absolute; // struct wlr_event_pointer_motion_absolute
|
|
|
|
struct wl_signal button; // struct wlr_event_pointer_button
|
|
|
|
struct wl_signal axis; // struct wlr_event_pointer_axis
|
2019-01-26 11:04:05 +01:00
|
|
|
struct wl_signal frame;
|
2021-06-30 11:23:50 +02:00
|
|
|
|
|
|
|
struct wl_signal swipe_begin; // struct wlr_event_pointer_swipe_begin
|
|
|
|
struct wl_signal swipe_update; // struct wlr_event_pointer_swipe_update
|
|
|
|
struct wl_signal swipe_end; // struct wlr_event_pointer_swipe_end
|
|
|
|
|
|
|
|
struct wl_signal pinch_begin; // struct wlr_event_pointer_pinch_begin
|
|
|
|
struct wl_signal pinch_update; // struct wlr_event_pointer_pinch_update
|
|
|
|
struct wl_signal pinch_end; // struct wlr_event_pointer_pinch_end
|
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
|
|
|
};
|
|
|
|
|
2017-06-21 20:07:09 +02:00
|
|
|
struct wlr_event_pointer_motion {
|
2017-08-24 20:35:55 +02:00
|
|
|
struct wlr_input_device *device;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-06-20 00:41:02 +02:00
|
|
|
double delta_x, delta_y;
|
2018-12-17 21:24:07 +01:00
|
|
|
double unaccel_dx, unaccel_dy;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2017-06-21 20:07:09 +02:00
|
|
|
struct wlr_event_pointer_motion_absolute {
|
2017-08-24 20:35:55 +02:00
|
|
|
struct wlr_input_device *device;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2018-03-28 16:46:50 +02:00
|
|
|
// From 0..1
|
|
|
|
double x, y;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2017-06-21 20:07:09 +02:00
|
|
|
struct wlr_event_pointer_button {
|
2017-08-24 20:35:55 +02:00
|
|
|
struct wlr_input_device *device;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-06-20 00:41:02 +02:00
|
|
|
uint32_t button;
|
|
|
|
enum wlr_button_state state;
|
|
|
|
};
|
|
|
|
|
|
|
|
enum wlr_axis_source {
|
|
|
|
WLR_AXIS_SOURCE_WHEEL,
|
|
|
|
WLR_AXIS_SOURCE_FINGER,
|
|
|
|
WLR_AXIS_SOURCE_CONTINUOUS,
|
|
|
|
WLR_AXIS_SOURCE_WHEEL_TILT,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum wlr_axis_orientation {
|
|
|
|
WLR_AXIS_ORIENTATION_VERTICAL,
|
|
|
|
WLR_AXIS_ORIENTATION_HORIZONTAL,
|
|
|
|
};
|
|
|
|
|
2017-06-21 20:07:09 +02:00
|
|
|
struct wlr_event_pointer_axis {
|
2017-08-24 20:35:55 +02:00
|
|
|
struct wlr_input_device *device;
|
2017-10-30 11:40:06 +01:00
|
|
|
uint32_t time_msec;
|
2017-06-20 00:41:02 +02:00
|
|
|
enum wlr_axis_source source;
|
|
|
|
enum wlr_axis_orientation orientation;
|
|
|
|
double delta;
|
2018-05-12 14:04:47 +02:00
|
|
|
int32_t delta_discrete;
|
2017-06-20 00:41:02 +02:00
|
|
|
};
|
|
|
|
|
2019-01-25 23:51:38 +01:00
|
|
|
struct wlr_event_pointer_swipe_begin {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_event_pointer_swipe_update {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
// Relative coordinates of the logical center of the gesture
|
|
|
|
// compared to the previous event.
|
|
|
|
double dx, dy;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_event_pointer_swipe_end {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
bool cancelled;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_event_pointer_pinch_begin {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_event_pointer_pinch_update {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
// Relative coordinates of the logical center of the gesture
|
|
|
|
// compared to the previous event.
|
|
|
|
double dx, dy;
|
|
|
|
// Absolute scale compared to the begin event
|
|
|
|
double scale;
|
|
|
|
// Relative angle in degrees clockwise compared to the previous event.
|
|
|
|
double rotation;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct wlr_event_pointer_pinch_end {
|
|
|
|
struct wlr_input_device *device;
|
|
|
|
uint32_t time_msec;
|
|
|
|
bool cancelled;
|
|
|
|
};
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#endif
|