diff options
-rw-r--r-- | include/wlr/types/wlr_relative_pointer_v1.h | 12 | ||||
-rw-r--r-- | include/wlr/types/wlr_seat.h | 7 | ||||
-rw-r--r-- | rootston/cursor.c | 8 | ||||
-rw-r--r-- | types/seat/wlr_seat_pointer.c | 3 | ||||
-rw-r--r-- | types/wlr_relative_pointer_v1.c | 62 |
5 files changed, 44 insertions, 48 deletions
diff --git a/include/wlr/types/wlr_relative_pointer_v1.h b/include/wlr/types/wlr_relative_pointer_v1.h index c74766b9..b2eb7241 100644 --- a/include/wlr/types/wlr_relative_pointer_v1.h +++ b/include/wlr/types/wlr_relative_pointer_v1.h @@ -12,13 +12,15 @@ #include <wayland-server.h> -/* This protocol specifies a set of interfaces used for making clients able to +/** + * This protocol specifies a set of interfaces used for making clients able to * receive relative pointer events not obstructed by barriers (such as the * monitor edge or other pointer barriers). */ -/* A global interface used for getting the relative pointer object for a given +/** + * A global interface used for getting the relative pointer object for a given * pointer. * * Signals: @@ -41,7 +43,8 @@ struct wlr_relative_pointer_manager_v1 { }; -/* A wp_relative_pointer object is an extension to the wl_pointer interface +/** + * A wp_relative_pointer object is an extension to the wl_pointer interface * used for emitting relative pointer events. It shares the same focus as * wl_pointer objects of the same seat and will only emit events when it has * focus. @@ -67,7 +70,6 @@ struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager); void wlr_relative_pointer_v1_send_relative_motion(struct wl_resource *resource, - uint64_t time, double dx, double dy, double dx_unaccel, double - dy_unaccel); + uint64_t time, double dx, double dy, double dx_unaccel, double dy_unaccel); #endif diff --git a/include/wlr/types/wlr_seat.h b/include/wlr/types/wlr_seat.h index 54e04e24..4c0edcd8 100644 --- a/include/wlr/types/wlr_seat.h +++ b/include/wlr/types/wlr_seat.h @@ -314,7 +314,8 @@ void wlr_seat_pointer_clear_focus(struct wlr_seat *wlr_seat); void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time, double sx, double sy); -/** Send relative motion events to the surface with pointer focus. Coordinates +/** + * Send relative motion events to the surface with pointer focus. Coordinates * for the motion event are relative to current pointer location, both * accelerated and unaccelerated. Compositors should use * `wlr_seat_pointer_notify_relative_motion()` to send relative motion events @@ -323,8 +324,8 @@ void wlr_seat_pointer_send_motion(struct wlr_seat *wlr_seat, uint32_t time, * Note that the timestamp is 64 bit, split into high 32 bits and low 32 bits. */ void wlr_seat_pointer_notify_relative_motion(struct wlr_seat *wlr_seat, - uint64_t time, double dx, double dy, double dx_unaccel, - double dy_unaccel); + uint64_t time, double dx, double dy, + double dx_unaccel, double dy_unaccel); /** * Send a button event to the surface with pointer focus. Coordinates for the diff --git a/rootston/cursor.c b/rootston/cursor.c index b03b934e..45d7b40e 100644 --- a/rootston/cursor.c +++ b/rootston/cursor.c @@ -310,8 +310,8 @@ void roots_cursor_handle_motion(struct roots_cursor *cursor, double dx = event->delta_x; double dy = event->delta_y; - wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, (uint64_t) - event->time_msec, dx, dy, dx, dy); + wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, + (uint64_t)event->time_msec, dx, dy, dx, dy); if (cursor->active_constraint) { struct roots_view *view = cursor->pointer_view->view; @@ -354,8 +354,8 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor, double dx = lx - cursor->cursor->x; double dy = ly - cursor->cursor->y; - wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, (uint64_t) - event->time_msec, dx, dy, dx, dy); + wlr_seat_pointer_notify_relative_motion(cursor->seat->seat, + (uint64_t)event->time_msec, dx, dy, dx, dy); if (cursor->pointer_view) { struct roots_view *view = cursor->pointer_view->view; diff --git a/types/seat/wlr_seat_pointer.c b/types/seat/wlr_seat_pointer.c index 12c4fab5..3c7e98e9 100644 --- a/types/seat/wlr_seat_pointer.c +++ b/types/seat/wlr_seat_pointer.c @@ -306,7 +306,8 @@ void wlr_seat_pointer_notify_motion(struct wlr_seat *wlr_seat, uint32_t time, } void wlr_seat_pointer_notify_relative_motion(struct wlr_seat *wlr_seat, - uint64_t time, double dx, double dy, double dx_unaccel, double dy_unaccel) { + uint64_t time, double dx, double dy, + double dx_unaccel, double dy_unaccel) { struct wlr_seat_client *client = wlr_seat->pointer_state.focused_client; if (client == NULL) { return; diff --git a/types/wlr_relative_pointer_v1.c b/types/wlr_relative_pointer_v1.c index c8ec8190..93d96fa4 100644 --- a/types/wlr_relative_pointer_v1.c +++ b/types/wlr_relative_pointer_v1.c @@ -13,17 +13,16 @@ static const struct zwp_relative_pointer_manager_v1_interface relative_pointer_m static const struct zwp_relative_pointer_v1_interface relative_pointer_v1_impl; -/* Callback functions +/** + * Callback functions */ -static void relative_pointer_manager_v1_handle_resource_destroy(struct wl_resource *resource) -{ +static void relative_pointer_manager_v1_handle_resource_destroy(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); } -static void relative_pointer_v1_handle_resource_destroy(struct wl_resource *resource) -{ +static void relative_pointer_v1_handle_resource_destroy(struct wl_resource *resource) { wl_list_remove(wl_resource_get_link(resource)); struct wlr_relative_pointer_v1 *relative_pointer = wl_resource_get_user_data(resource); @@ -32,18 +31,16 @@ static void relative_pointer_v1_handle_resource_destroy(struct wl_resource *reso static void relative_pointer_manager_v1_handle_destroy(struct wl_client *client, - struct wl_resource *resource) -{ + struct wl_resource *resource) { wl_resource_destroy(resource); - wlr_log(WLR_DEBUG, "relative_pointer_v1 manager unbound from client 0x%" PRIXPTR, - (uintptr_t) client); + wlr_log(WLR_DEBUG, "relative_pointer_v1 manager unbound from client %p", + client); } static void relative_pointer_manager_v1_handle_get_relative_pointer(struct wl_client *client, - struct wl_resource *resource, uint32_t id, struct wl_resource *pointer) -{ + struct wl_resource *resource, uint32_t id, struct wl_resource *pointer) { struct wlr_seat_client *seat_client = wlr_seat_client_from_pointer_resource(pointer); assert(seat_client->client == client); @@ -80,28 +77,24 @@ static void relative_pointer_manager_v1_handle_get_relative_pointer(struct wl_cl wlr_signal_emit_safe(&relative_pointer_manager->events.new_relative_pointer, relative_pointer); - wlr_log(WLR_DEBUG, - "relative_pointer_v1 0x%" PRIXPTR " created for client 0x%" PRIXPTR, - (uintptr_t) relative_pointer, (uintptr_t) client); + wlr_log(WLR_DEBUG, "relative_pointer_v1 %p created for client %p", + relative_pointer, client); } static void relative_pointer_v1_handle_destroy(struct wl_client *client, - struct wl_resource *resource) -{ + struct wl_resource *resource) { struct wlr_relative_pointer_v1 *relative_pointer = wl_resource_get_user_data(resource); - wlr_log(WLR_DEBUG, - "relative_pointer_v1 0x%" PRIXPTR " released by client 0x%" PRIXPTR, - (uintptr_t) relative_pointer, (uintptr_t) client); + wlr_log(WLR_DEBUG, "relative_pointer_v1 %p released by client %p", + relative_pointer, client); wl_resource_destroy(resource); } static void relative_pointer_manager_v1_bind(struct wl_client *wl_client, void *data, - uint32_t version, uint32_t id) -{ + uint32_t version, uint32_t id) { struct wlr_relative_pointer_manager_v1 *relative_pointer_manager = data; struct wl_resource *manager_resource = wl_resource_create(wl_client, @@ -117,12 +110,13 @@ static void relative_pointer_manager_v1_bind(struct wl_client *wl_client, void * wl_resource_set_implementation(manager_resource, &relative_pointer_manager_v1_impl, relative_pointer_manager, relative_pointer_manager_v1_handle_resource_destroy); - wlr_log(WLR_DEBUG, "relative_pointer_v1 manager bound to client 0x%" PRIXPTR, - (uintptr_t) wl_client); + wlr_log(WLR_DEBUG, "relative_pointer_v1 manager bound to client %p", + wl_client); } -/* Implementations +/** + * Implementations */ static const struct zwp_relative_pointer_manager_v1_interface relative_pointer_manager_v1_impl = { @@ -136,11 +130,11 @@ static const struct zwp_relative_pointer_v1_interface relative_pointer_v1_impl = }; -/* Public functions +/** + * Public functions */ -struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl_display *display) -{ +struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl_display *display) { struct wlr_relative_pointer_manager_v1 *relative_pointer_manager = calloc(1, sizeof(struct wlr_relative_pointer_manager_v1)); @@ -168,8 +162,7 @@ struct wlr_relative_pointer_manager_v1 *wlr_relative_pointer_v1_create(struct wl } -void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager) -{ +void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *relative_pointer_manager) { if (relative_pointer_manager == NULL) { return; } @@ -190,13 +183,12 @@ void wlr_relative_pointer_v1_destroy(struct wlr_relative_pointer_manager_v1 *rel void wlr_relative_pointer_v1_send_relative_motion(struct wl_resource *resource, - uint64_t time, double dx, double dy, double dx_unaccel, double - dy_unaccel) -{ + uint64_t time, double dx, double dy, + double dx_unaccel, double dy_unaccel) { assert(wl_resource_instance_of(resource, &zwp_relative_pointer_v1_interface, &relative_pointer_v1_impl)); zwp_relative_pointer_v1_send_relative_motion(resource, - (uint32_t) (time >> 32), (uint32_t) time, wl_fixed_from_double(dx), - wl_fixed_from_double(dy), wl_fixed_from_double(dx_unaccel), - wl_fixed_from_double(dy_unaccel)); + (uint32_t)(time >> 32), (uint32_t)time, + wl_fixed_from_double(dx), wl_fixed_from_double(dy), + wl_fixed_from_double(dx_unaccel), wl_fixed_from_double(dy_unaccel)); } |