mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-12-15 08:56:26 -05:00
types/wlr_touch: uniformize events name
This commit is contained in:
parent
e732c5c895
commit
aaf787ee56
7 changed files with 48 additions and 45 deletions
|
|
@ -32,8 +32,8 @@ void handle_touch_down(struct libinput_event *event,
|
|||
struct wlr_touch *touch) {
|
||||
struct libinput_event_touch *tevent =
|
||||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_down wlr_event = { 0 };
|
||||
wlr_event.device = &touch->base;
|
||||
struct wlr_touch_down_event wlr_event = { 0 };
|
||||
wlr_event.touch = touch;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
|
|
@ -46,8 +46,8 @@ void handle_touch_up(struct libinput_event *event,
|
|||
struct wlr_touch *touch) {
|
||||
struct libinput_event_touch *tevent =
|
||||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_up wlr_event = { 0 };
|
||||
wlr_event.device = &touch->base;
|
||||
struct wlr_touch_up_event wlr_event = { 0 };
|
||||
wlr_event.touch = touch;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
|
|
@ -58,8 +58,8 @@ void handle_touch_motion(struct libinput_event *event,
|
|||
struct wlr_touch *touch) {
|
||||
struct libinput_event_touch *tevent =
|
||||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_motion wlr_event = { 0 };
|
||||
wlr_event.device = &touch->base;
|
||||
struct wlr_touch_motion_event wlr_event = { 0 };
|
||||
wlr_event.touch = touch;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
|
|
@ -72,8 +72,8 @@ void handle_touch_cancel(struct libinput_event *event,
|
|||
struct wlr_touch *touch) {
|
||||
struct libinput_event_touch *tevent =
|
||||
libinput_event_get_touch_event(event);
|
||||
struct wlr_event_touch_cancel wlr_event = { 0 };
|
||||
wlr_event.device = &touch->base;
|
||||
struct wlr_touch_cancel_event wlr_event = { 0 };
|
||||
wlr_event.touch = touch;
|
||||
wlr_event.time_msec =
|
||||
usec_to_msec(libinput_event_touch_get_time_usec(tevent));
|
||||
wlr_event.touch_id = libinput_event_touch_get_seat_slot(tevent);
|
||||
|
|
|
|||
|
|
@ -140,40 +140,43 @@ static void touch_handle_down(void *data, struct wl_touch *wl_touch,
|
|||
uint32_t serial, uint32_t time, struct wl_surface *surface,
|
||||
int32_t id, wl_fixed_t x, wl_fixed_t y) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
struct wlr_touch *touch = &seat->wlr_touch;
|
||||
|
||||
struct wlr_event_touch_down event = {
|
||||
.device = &seat->wlr_touch.base,
|
||||
struct wlr_touch_down_event event = {
|
||||
.touch = touch,
|
||||
.time_msec = time,
|
||||
.touch_id = id,
|
||||
};
|
||||
touch_coordinates_to_absolute(seat, x, y, &event.x, &event.y);
|
||||
wlr_signal_emit_safe(&seat->wlr_touch.events.down, &event);
|
||||
wlr_signal_emit_safe(&touch->events.down, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_up(void *data, struct wl_touch *wl_touch,
|
||||
uint32_t serial, uint32_t time, int32_t id) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
struct wlr_touch *touch = &seat->wlr_touch;
|
||||
|
||||
struct wlr_event_touch_up event = {
|
||||
.device = &seat->wlr_touch.base,
|
||||
struct wlr_touch_up_event event = {
|
||||
.touch = touch,
|
||||
.time_msec = time,
|
||||
.touch_id = id,
|
||||
};
|
||||
wlr_signal_emit_safe(&seat->wlr_touch.events.up, &event);
|
||||
wlr_signal_emit_safe(&touch->events.up, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_motion(void *data, struct wl_touch *wl_touch,
|
||||
uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y) {
|
||||
struct wlr_wl_seat *seat = data;
|
||||
struct wlr_input_device *device = &seat->wlr_touch.base;
|
||||
struct wlr_touch *touch = &seat->wlr_touch;
|
||||
|
||||
struct wlr_event_touch_motion event = {
|
||||
.device = device,
|
||||
struct wlr_touch_motion_event event = {
|
||||
.touch = touch,
|
||||
.time_msec = time,
|
||||
.touch_id = id,
|
||||
};
|
||||
|
||||
touch_coordinates_to_absolute(seat, x, y, &event.x, &event.y);
|
||||
wlr_signal_emit_safe(&seat->wlr_touch.events.motion, &event);
|
||||
wlr_signal_emit_safe(&touch->events.motion, &event);
|
||||
}
|
||||
|
||||
static void touch_handle_frame(void *data, struct wl_touch *wl_touch) {
|
||||
|
|
|
|||
|
|
@ -70,8 +70,8 @@ static void send_pointer_position_event(struct wlr_x11_output *output,
|
|||
|
||||
static void send_touch_down_event(struct wlr_x11_output *output,
|
||||
int16_t x, int16_t y, int32_t touch_id, xcb_timestamp_t time) {
|
||||
struct wlr_event_touch_down ev = {
|
||||
.device = &output->touch.base,
|
||||
struct wlr_touch_down_event ev = {
|
||||
.touch = &output->touch,
|
||||
.time_msec = time,
|
||||
.x = (double)x / output->wlr_output.width,
|
||||
.y = (double)y / output->wlr_output.height,
|
||||
|
|
@ -83,8 +83,8 @@ static void send_touch_down_event(struct wlr_x11_output *output,
|
|||
|
||||
static void send_touch_motion_event(struct wlr_x11_output *output,
|
||||
int16_t x, int16_t y, int32_t touch_id, xcb_timestamp_t time) {
|
||||
struct wlr_event_touch_motion ev = {
|
||||
.device = &output->touch.base,
|
||||
struct wlr_touch_motion_event ev = {
|
||||
.touch = &output->touch,
|
||||
.time_msec = time,
|
||||
.x = (double)x / output->wlr_output.width,
|
||||
.y = (double)y / output->wlr_output.height,
|
||||
|
|
@ -96,8 +96,8 @@ static void send_touch_motion_event(struct wlr_x11_output *output,
|
|||
|
||||
static void send_touch_up_event(struct wlr_x11_output *output,
|
||||
int32_t touch_id, xcb_timestamp_t time) {
|
||||
struct wlr_event_touch_up ev = {
|
||||
.device = &output->touch.base,
|
||||
struct wlr_touch_up_event ev = {
|
||||
.touch = &output->touch,
|
||||
.time_msec = time,
|
||||
.touch_id = touch_id,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue