Update wlr_seat and friends to new compositor

This commit is contained in:
Scott Anderson 2019-05-16 19:00:53 +12:00
parent 8630988eae
commit 841031031e
12 changed files with 159 additions and 142 deletions

View file

@ -12,6 +12,8 @@
#include <wayland-server.h>
#include <wlr/types/wlr_seat.h>
struct wlr_surface_2;
extern const struct wlr_pointer_grab_interface
wlr_data_device_pointer_drag_interface;
@ -93,7 +95,7 @@ struct wlr_drag;
struct wlr_drag_icon {
struct wlr_drag *drag;
struct wlr_surface *surface;
struct wlr_surface_2 *surface;
bool mapped;
struct {
@ -102,6 +104,7 @@ struct wlr_drag_icon {
struct wl_signal destroy;
} events;
struct wl_listener surface_commit;
struct wl_listener surface_destroy;
void *data;
@ -124,7 +127,7 @@ struct wlr_drag {
struct wlr_seat_client *focus_client;
struct wlr_drag_icon *icon; // can be NULL
struct wlr_surface *focus; // can be NULL
struct wlr_surface_2 *focus; // can be NULL
struct wlr_data_source *source; // can be NULL
bool started, dropped, cancelling;
@ -187,13 +190,13 @@ void wlr_seat_set_selection(struct wlr_seat *seat,
* `wlr_seat_request_start_drag`.
*/
struct wlr_drag *wlr_drag_create(struct wlr_seat_client *seat_client,
struct wlr_data_source *source, struct wlr_surface *icon_surface);
struct wlr_data_source *source, struct wlr_surface_2 *icon_surface);
/**
* Requests a drag to be started on the seat.
*/
void wlr_seat_request_start_drag(struct wlr_seat *seat, struct wlr_drag *drag,
struct wlr_surface *origin, uint32_t serial);
struct wlr_surface_2 *origin, uint32_t serial);
/**
* Starts a drag on the seat. This starts an implicit keyboard grab, but doesn't

View file

@ -13,7 +13,8 @@
#include <wayland-server.h>
#include <wlr/types/wlr_input_device.h>
#include <wlr/types/wlr_keyboard.h>
#include <wlr/types/wlr_surface.h>
struct wlr_surface_2;
/**
* Contains state for a single client's bound wl_seat resource and can be used
@ -39,10 +40,10 @@ struct wlr_seat_client {
struct wlr_touch_point {
int32_t touch_id;
struct wlr_surface *surface;
struct wlr_surface_2 *surface;
struct wlr_seat_client *client;
struct wlr_surface *focus_surface;
struct wlr_surface_2 *focus_surface;
struct wlr_seat_client *focus_client;
double sx, sy;
@ -60,7 +61,7 @@ struct wlr_seat_pointer_grab;
struct wlr_pointer_grab_interface {
void (*enter)(struct wlr_seat_pointer_grab *grab,
struct wlr_surface *surface, double sx, double sy);
struct wlr_surface_2 *surface, double sx, double sy);
void (*motion)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
double sx, double sy);
uint32_t (*button)(struct wlr_seat_pointer_grab *grab, uint32_t time_msec,
@ -76,7 +77,7 @@ struct wlr_seat_keyboard_grab;
struct wlr_keyboard_grab_interface {
void (*enter)(struct wlr_seat_keyboard_grab *grab,
struct wlr_surface *surface, uint32_t keycodes[],
struct wlr_surface_2 *surface, uint32_t keycodes[],
size_t num_keycodes, struct wlr_keyboard_modifiers *modifiers);
void (*key)(struct wlr_seat_keyboard_grab *grab, uint32_t time_msec,
uint32_t key, uint32_t state);
@ -134,7 +135,7 @@ struct wlr_seat_pointer_grab {
struct wlr_seat_pointer_state {
struct wlr_seat *seat;
struct wlr_seat_client *focused_client;
struct wlr_surface *focused_surface;
struct wlr_surface_2 *focused_surface;
double sx, sy;
struct wlr_seat_pointer_grab *grab;
@ -158,7 +159,7 @@ struct wlr_seat_keyboard_state {
struct wlr_keyboard *keyboard;
struct wlr_seat_client *focused_client;
struct wlr_surface *focused_surface;
struct wlr_surface_2 *focused_surface;
struct wl_listener keyboard_destroy;
struct wl_listener keyboard_keymap;
@ -250,7 +251,7 @@ struct wlr_seat {
struct wlr_seat_pointer_request_set_cursor_event {
struct wlr_seat_client *seat_client;
struct wlr_surface *surface;
struct wlr_surface_2 *surface;
uint32_t serial;
int32_t hotspot_x, hotspot_y;
};
@ -267,19 +268,19 @@ struct wlr_seat_request_set_primary_selection_event {
struct wlr_seat_request_start_drag_event {
struct wlr_drag *drag;
struct wlr_surface *origin;
struct wlr_surface_2 *origin;
uint32_t serial;
};
struct wlr_seat_pointer_focus_change_event {
struct wlr_seat *seat;
struct wlr_surface *old_surface, *new_surface;
struct wlr_surface_2 *old_surface, *new_surface;
double sx, sy;
};
struct wlr_seat_keyboard_focus_change_event {
struct wlr_seat *seat;
struct wlr_surface *old_surface, *new_surface;
struct wlr_surface_2 *old_surface, *new_surface;
};
/**
@ -312,7 +313,7 @@ void wlr_seat_set_name(struct wlr_seat *wlr_seat, const char *name);
* Whether or not the surface has pointer focus
*/
bool wlr_seat_pointer_surface_has_focus(struct wlr_seat *wlr_seat,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
/**
* Send a pointer enter event to the given surface and consider it to be the
@ -322,7 +323,7 @@ bool wlr_seat_pointer_surface_has_focus(struct wlr_seat *wlr_seat,
* focus to respect pointer grabs.
*/
void wlr_seat_pointer_enter(struct wlr_seat *wlr_seat,
struct wlr_surface *surface, double sx, double sy);
struct wlr_surface_2 *surface, double sx, double sy);
/**
* Clear the focused surface for the pointer and leave all entered surfaces.
@ -382,7 +383,7 @@ void wlr_seat_pointer_end_grab(struct wlr_seat *wlr_seat);
* where the enter occurred.
*/
void wlr_seat_pointer_notify_enter(struct wlr_seat *wlr_seat,
struct wlr_surface *surface, double sx, double sy);
struct wlr_surface_2 *surface, double sx, double sy);
/**
* Notify the seat of motion over the given surface. Pass surface-local
@ -474,7 +475,7 @@ void wlr_seat_keyboard_notify_modifiers(struct wlr_seat *seat,
* keyboard.
*/
void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
struct wlr_surface_2 *surface, uint32_t keycodes[], size_t num_keycodes,
struct wlr_keyboard_modifiers *modifiers);
/**
@ -485,7 +486,7 @@ void wlr_seat_keyboard_notify_enter(struct wlr_seat *seat,
* keyboard grabs.
*/
void wlr_seat_keyboard_enter(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t keycodes[], size_t num_keycodes,
struct wlr_surface_2 *surface, uint32_t keycodes[], size_t num_keycodes,
struct wlr_keyboard_modifiers *modifiers);
/**
@ -523,7 +524,7 @@ struct wlr_touch_point *wlr_seat_touch_get_point(struct wlr_seat *seat,
* the touch device.
*/
uint32_t wlr_seat_touch_notify_down(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t time_msec,
struct wlr_surface_2 *surface, uint32_t time_msec,
int32_t touch_id, double sx, double sy);
/**
@ -548,7 +549,7 @@ void wlr_seat_touch_notify_motion(struct wlr_seat *seat, uint32_t time_msec,
* `wlr_seat_touch_point_clear_focus()`.
*/
void wlr_seat_touch_point_focus(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t time_msec,
struct wlr_surface_2 *surface, uint32_t time_msec,
int32_t touch_id, double sx, double sy);
/**
@ -566,7 +567,7 @@ void wlr_seat_touch_point_clear_focus(struct wlr_seat *seat, uint32_t time_msec,
* `wlr_seat_touch_notify_down()` to respect any grabs of the touch device.
*/
uint32_t wlr_seat_touch_send_down(struct wlr_seat *seat,
struct wlr_surface *surface, uint32_t time_msec,
struct wlr_surface_2 *surface, uint32_t time_msec,
int32_t touch_id, double sx, double sy);
/**
@ -607,7 +608,7 @@ bool wlr_seat_validate_grab_serial(struct wlr_seat *seat, uint32_t serial);
* Check whether this serial is valid to start a pointer grab action.
*/
bool wlr_seat_validate_pointer_grab_serial(struct wlr_seat *seat,
struct wlr_surface *origin, uint32_t serial);
struct wlr_surface_2 *origin, uint32_t serial);
/**
* Check whether this serial is valid to start a touch grab action. If it's the
@ -615,7 +616,7 @@ bool wlr_seat_validate_pointer_grab_serial(struct wlr_seat *seat,
* the serial.
*/
bool wlr_seat_validate_touch_grab_serial(struct wlr_seat *seat,
struct wlr_surface *origin, uint32_t serial,
struct wlr_surface_2 *origin, uint32_t serial,
struct wlr_touch_point **point_ptr);
/**

View file

@ -19,6 +19,7 @@
#define WLR_TABLET_V2_TOOL_BUTTONS_CAP 16
struct wlr_tablet_pad_v2_grab_interface;
struct wlr_surface_2;
struct wlr_tablet_pad_v2_grab {
const struct wlr_tablet_pad_v2_grab_interface *interface;
@ -71,7 +72,7 @@ struct wlr_tablet_v2_tablet_tool {
struct wl_listener tool_destroy;
struct wlr_tablet_tool_client_v2 *current_client;
struct wlr_surface *focused_surface;
struct wlr_surface_2 *focused_surface;
struct wl_listener surface_destroy;
struct wlr_tablet_tool_v2_grab *grab;
@ -112,7 +113,7 @@ struct wlr_tablet_v2_tablet_pad {
};
struct wlr_tablet_v2_event_cursor {
struct wlr_surface *surface;
struct wlr_surface_2 *surface;
uint32_t serial;
int32_t hotspot_x;
int32_t hotspot_y;
@ -146,7 +147,7 @@ void wlr_tablet_v2_destroy(struct wlr_tablet_manager_v2 *manager);
void wlr_send_tablet_v2_tablet_tool_proximity_in(
struct wlr_tablet_v2_tablet_tool *tool,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void wlr_send_tablet_v2_tablet_tool_down(struct wlr_tablet_v2_tablet_tool *tool);
void wlr_send_tablet_v2_tablet_tool_up(struct wlr_tablet_v2_tablet_tool *tool);
@ -184,7 +185,7 @@ void wlr_send_tablet_v2_tablet_tool_button(
void wlr_tablet_v2_tablet_tool_notify_proximity_in(
struct wlr_tablet_v2_tablet_tool *tool,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void wlr_tablet_v2_tablet_tool_notify_down(struct wlr_tablet_v2_tablet_tool *tool);
void wlr_tablet_v2_tablet_tool_notify_up(struct wlr_tablet_v2_tablet_tool *tool);
@ -222,7 +223,7 @@ struct wlr_tablet_tool_v2_grab_interface {
void (*proximity_in)(
struct wlr_tablet_tool_v2_grab *grab,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void (*down)(struct wlr_tablet_tool_v2_grab *grab);
void (*up)(struct wlr_tablet_tool_v2_grab *grab);
@ -258,7 +259,7 @@ void wlr_tablet_tool_v2_start_implicit_grab(struct wlr_tablet_v2_tablet_tool *to
uint32_t wlr_send_tablet_v2_tablet_pad_enter(
struct wlr_tablet_v2_tablet_pad *pad,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void wlr_send_tablet_v2_tablet_pad_button(
struct wlr_tablet_v2_tablet_pad *pad, size_t button,
@ -270,7 +271,7 @@ void wlr_send_tablet_v2_tablet_pad_ring(struct wlr_tablet_v2_tablet_pad *pad,
uint32_t ring, double position, bool finger, uint32_t time);
uint32_t wlr_send_tablet_v2_tablet_pad_leave(struct wlr_tablet_v2_tablet_pad *pad,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
uint32_t wlr_send_tablet_v2_tablet_pad_mode(struct wlr_tablet_v2_tablet_pad *pad,
size_t group, uint32_t mode, uint32_t time);
@ -279,7 +280,7 @@ uint32_t wlr_send_tablet_v2_tablet_pad_mode(struct wlr_tablet_v2_tablet_pad *pad
uint32_t wlr_tablet_v2_tablet_pad_notify_enter(
struct wlr_tablet_v2_tablet_pad *pad,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void wlr_tablet_v2_tablet_pad_notify_button(
struct wlr_tablet_v2_tablet_pad *pad, size_t button,
@ -293,7 +294,7 @@ void wlr_tablet_v2_tablet_pad_notify_ring(
uint32_t ring, double position, bool finger, uint32_t time);
uint32_t wlr_tablet_v2_tablet_pad_notify_leave(
struct wlr_tablet_v2_tablet_pad *pad, struct wlr_surface *surface);
struct wlr_tablet_v2_tablet_pad *pad, struct wlr_surface_2 *surface);
uint32_t wlr_tablet_v2_tablet_pad_notify_mode(
struct wlr_tablet_v2_tablet_pad *pad,
@ -303,7 +304,7 @@ struct wlr_tablet_pad_v2_grab_interface {
uint32_t (*enter)(
struct wlr_tablet_pad_v2_grab *grab,
struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
void (*button)(struct wlr_tablet_pad_v2_grab *grab,size_t button,
uint32_t time, enum zwp_tablet_pad_v2_button_state state);
@ -314,7 +315,7 @@ struct wlr_tablet_pad_v2_grab_interface {
uint32_t ring, double position, bool finger, uint32_t time);
uint32_t (*leave)(struct wlr_tablet_pad_v2_grab *grab,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
uint32_t (*mode)(struct wlr_tablet_pad_v2_grab *grab,
size_t group, uint32_t mode, uint32_t time);
@ -326,5 +327,5 @@ void wlr_tablet_v2_end_grab(struct wlr_tablet_v2_tablet_pad *pad);
void wlr_tablet_v2_start_grab(struct wlr_tablet_v2_tablet_pad *pad, struct wlr_tablet_pad_v2_grab *grab);
bool wlr_surface_accepts_tablet_v2(struct wlr_tablet_v2_tablet *tablet,
struct wlr_surface *surface);
struct wlr_surface_2 *surface);
#endif /* WLR_TYPES_WLR_TABLET_V2_H */