wlr-seat: default touch grab

This commit is contained in:
Tony Crisci 2017-11-12 17:04:56 -05:00
parent e5a31ae870
commit 4240096b83
3 changed files with 102 additions and 6 deletions

View file

@ -49,6 +49,29 @@ struct wlr_keyboard_grab_interface {
void (*cancel)(struct wlr_seat_keyboard_grab *grab);
};
struct wlr_seat_touch_grab;
struct wlr_touch_grab_interface {
void (*down)(struct wlr_seat_touch_grab *grab, struct wlr_surface *surface,
uint32_t time, int32_t touch_id, double sx, double sy);
void (*up)(struct wlr_seat_touch_grab *grab, uint32_t time, int32_t touch_id);
void (*motion)(struct wlr_seat_touch_grab *grab, uint32_t time, int32_t
touch_id, double sx, double sy);
// XXX this will conflict with the actual touch cancel which is different so
// we need to rename this
void (*cancel)(struct wlr_seat_touch_grab *grab);
};
/**
* Passed to `wlr_seat_touch_start_grab()` to start a grab of the touch device.
* The grabber is responsible for handling touch events for the seat.
*/
struct wlr_seat_touch_grab {
const struct wlr_touch_grab_interface *interface;
struct wlr_seat *seat;
void *data;
};
/**
* Passed to `wlr_seat_keyboard_start_grab()` to start a grab of the keyboard.
* The grabber is responsible for handling keyboard events for the seat.
@ -118,6 +141,9 @@ struct wlr_touch_point {
struct wlr_seat_touch_state {
struct wlr_seat *seat;
struct wl_list touch_points; // wlr_touch_point::link
struct wlr_seat_touch_grab *grab;
struct wlr_seat_touch_grab *default_grab;
};
struct wlr_seat {
@ -359,4 +385,14 @@ void wlr_seat_touch_notify_up(struct wlr_seat *seat, uint32_t time,
void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time,
int32_t touch_id, double sx, double sy);
void wlr_seat_touch_send_down(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t time, int32_t touch_id, double sx,
double sy);
void wlr_seat_touch_send_up(struct wlr_seat *seat, uint32_t time,
int32_t touch_id);
void wlr_seat_touch_send_motion(struct wlr_seat *seat, uint32_t time,
int32_t touch_id, double sx, double sy);
#endif