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 {
|
2022-01-31 16:20:01 +01:00
|
|
|
struct wlr_input_device base;
|
|
|
|
|
2018-04-28 13:55:36 +02:00
|
|
|
const struct wlr_pointer_impl *impl;
|
2017-06-20 00:41:02 +02:00
|
|
|
|
2022-03-08 22:45:03 +01:00
|
|
|
char *output_name;
|
|
|
|
|
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
|
pointer: add hold pointer event definition
As touchpad touches are generally fully abstracted, a client cannot
currently know when a user is interacting with the touchpad without
moving. This is solved by hold gestures.
Hold gestures are notifications about one or more fingers being held
down on the touchpad without significant movement.
Hold gestures are primarily designed for two interactions:
- Hold to interact: where a hold gesture is active for some time a
menu could pop up, some object could be selected, etc.
- Hold to cancel: where e.g. kinetic scrolling is currently active,
the start of a hold gesture can be used to stop the scroll.
Unlike swipe and pinch, hold gestures, by definition, do not have
movement, so there is no need for an "update" stage in the gesture.
Create two structs, wlr_event_pointer_hold_begin and
wlr_event_pointer_hold_end, to represent hold gesture events and the
signals to emit them: wlr_pointer->pointer.hold_begin/hold_end.
2021-07-12 19:50:09 +02:00
|
|
|
|
|
|
|
struct wl_signal hold_begin; // struct wlr_event_pointer_hold_begin
|
|
|
|
struct wl_signal hold_end; // struct wlr_event_pointer_hold_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
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_motion_event {
|
|
|
|
struct wlr_pointer *pointer;
|
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
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_motion_absolute_event {
|
|
|
|
struct wlr_pointer *pointer;
|
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
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_button_event {
|
|
|
|
struct wlr_pointer *pointer;
|
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,
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_axis_event {
|
|
|
|
struct wlr_pointer *pointer;
|
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
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_swipe_begin_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_swipe_update_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
// Relative coordinates of the logical center of the gesture
|
|
|
|
// compared to the previous event.
|
|
|
|
double dx, dy;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_swipe_end_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
uint32_t time_msec;
|
|
|
|
bool cancelled;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_pinch_begin_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_pinch_update_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_pinch_end_event {
|
|
|
|
struct wlr_pointer *pointer;
|
2019-01-25 23:51:38 +01:00
|
|
|
uint32_t time_msec;
|
|
|
|
bool cancelled;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_hold_begin_event {
|
|
|
|
struct wlr_pointer *pointer;
|
pointer: add hold pointer event definition
As touchpad touches are generally fully abstracted, a client cannot
currently know when a user is interacting with the touchpad without
moving. This is solved by hold gestures.
Hold gestures are notifications about one or more fingers being held
down on the touchpad without significant movement.
Hold gestures are primarily designed for two interactions:
- Hold to interact: where a hold gesture is active for some time a
menu could pop up, some object could be selected, etc.
- Hold to cancel: where e.g. kinetic scrolling is currently active,
the start of a hold gesture can be used to stop the scroll.
Unlike swipe and pinch, hold gestures, by definition, do not have
movement, so there is no need for an "update" stage in the gesture.
Create two structs, wlr_event_pointer_hold_begin and
wlr_event_pointer_hold_end, to represent hold gesture events and the
signals to emit them: wlr_pointer->pointer.hold_begin/hold_end.
2021-07-12 19:50:09 +02:00
|
|
|
uint32_t time_msec;
|
|
|
|
uint32_t fingers;
|
|
|
|
};
|
|
|
|
|
2022-03-09 20:52:27 +01:00
|
|
|
struct wlr_pointer_hold_end_event {
|
|
|
|
struct wlr_pointer *pointer;
|
pointer: add hold pointer event definition
As touchpad touches are generally fully abstracted, a client cannot
currently know when a user is interacting with the touchpad without
moving. This is solved by hold gestures.
Hold gestures are notifications about one or more fingers being held
down on the touchpad without significant movement.
Hold gestures are primarily designed for two interactions:
- Hold to interact: where a hold gesture is active for some time a
menu could pop up, some object could be selected, etc.
- Hold to cancel: where e.g. kinetic scrolling is currently active,
the start of a hold gesture can be used to stop the scroll.
Unlike swipe and pinch, hold gestures, by definition, do not have
movement, so there is no need for an "update" stage in the gesture.
Create two structs, wlr_event_pointer_hold_begin and
wlr_event_pointer_hold_end, to represent hold gesture events and the
signals to emit them: wlr_pointer->pointer.hold_begin/hold_end.
2021-07-12 19:50:09 +02:00
|
|
|
uint32_t time_msec;
|
|
|
|
bool cancelled;
|
|
|
|
};
|
|
|
|
|
2017-06-20 00:41:02 +02:00
|
|
|
#endif
|