Make implementation function lists static const

This requires a change to the type of `struct wlr_tablet` and
`wlr_tablet_init` signature, both of which are part of the unstable API.
This commit is contained in:
Manuel Stoeckl 2021-02-04 08:57:18 -05:00 committed by Simon Ser
parent b6dea80907
commit a290d7a78d
15 changed files with 31 additions and 31 deletions

View file

@ -86,7 +86,7 @@ static void tablet_seat_handle_destroy(struct wl_client *client,
wl_resource_destroy(resource);
}
static struct zwp_tablet_seat_v2_interface seat_impl = {
static const struct zwp_tablet_seat_v2_interface seat_impl = {
.destroy = tablet_seat_handle_destroy,
};
@ -212,7 +212,7 @@ static void get_tablet_seat(struct wl_client *wl_client, struct wl_resource *res
}
}
static struct zwp_tablet_manager_v2_interface manager_impl = {
static const struct zwp_tablet_manager_v2_interface manager_impl = {
.get_tablet_seat = get_tablet_seat,
.destroy = tablet_manager_destroy,
};

View file

@ -12,7 +12,7 @@
#include <wlr/types/wlr_tablet_v2.h>
#include <wlr/util/log.h>
static struct wlr_tablet_pad_v2_grab_interface default_pad_grab_interface;
static const struct wlr_tablet_pad_v2_grab_interface default_pad_grab_interface;
struct tablet_pad_auxiliary_user_data {
struct wlr_tablet_pad_client_v2 *pad;
@ -58,7 +58,7 @@ static void handle_tablet_pad_ring_v2_destroy(struct wl_client *client,
wl_resource_destroy(resource);
}
static struct zwp_tablet_pad_ring_v2_interface tablet_pad_ring_impl = {
static const struct zwp_tablet_pad_ring_v2_interface tablet_pad_ring_impl = {
.set_feedback = handle_tablet_pad_ring_v2_set_feedback,
.destroy = handle_tablet_pad_ring_v2_destroy,
};
@ -96,7 +96,7 @@ static void handle_tablet_pad_strip_v2_destroy(struct wl_client *client,
wl_resource_destroy(resource);
}
static struct zwp_tablet_pad_strip_v2_interface tablet_pad_strip_impl = {
static const struct zwp_tablet_pad_strip_v2_interface tablet_pad_strip_impl = {
.set_feedback = handle_tablet_pad_strip_v2_set_feedback,
.destroy = handle_tablet_pad_strip_v2_destroy,
};
@ -118,7 +118,7 @@ static void handle_tablet_pad_v2_set_feedback( struct wl_client *client,
wl_signal_emit(&pad->pad->events.button_feedback, &evt);
}
static struct zwp_tablet_pad_v2_interface tablet_pad_impl = {
static const struct zwp_tablet_pad_v2_interface tablet_pad_impl = {
.set_feedback = handle_tablet_pad_v2_set_feedback,
.destroy = handle_tablet_pad_v2_destroy,
};
@ -184,7 +184,7 @@ static void handle_tablet_pad_group_v2_destroy(struct wl_client *client,
wl_resource_destroy(resource);
}
static struct zwp_tablet_pad_group_v2_interface tablet_pad_group_impl = {
static const struct zwp_tablet_pad_group_v2_interface tablet_pad_group_impl = {
.destroy = handle_tablet_pad_group_v2_destroy,
};
@ -696,7 +696,7 @@ static void default_pad_cancel(struct wlr_tablet_pad_v2_grab *grab) {
// Do nothing, the default cancel can be ignored.
}
static struct wlr_tablet_pad_v2_grab_interface default_pad_grab_interface = {
static const struct wlr_tablet_pad_v2_grab_interface default_pad_grab_interface = {
.enter = default_pad_enter,
.button = default_pad_button,
.strip = default_pad_strip,

View file

@ -30,7 +30,7 @@ static void handle_tablet_v2_destroy(struct wl_client *client,
wl_resource_destroy(resource);
}
static struct zwp_tablet_v2_interface tablet_impl = {
static const struct zwp_tablet_v2_interface tablet_impl = {
.destroy = handle_tablet_v2_destroy,
};

View file

@ -52,7 +52,7 @@ static void handle_tablet_tool_v2_destroy(struct wl_client *client,
struct wl_resource *resource) {
wl_resource_destroy(resource);
}
static struct zwp_tablet_tool_v2_interface tablet_tool_impl = {
static const struct zwp_tablet_tool_v2_interface tablet_tool_impl = {
.set_cursor = handle_tablet_tool_v2_set_cursor,
.destroy = handle_tablet_tool_v2_destroy,
};

View file

@ -7,7 +7,7 @@
#include "util/signal.h"
static const struct zwlr_input_inhibit_manager_v1_interface inhibit_manager_implementation;
static struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation;
static const struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation;
static struct wlr_input_inhibit_manager *input_inhibit_manager_from_resource(
struct wl_resource *resource) {
@ -44,7 +44,7 @@ static void input_inhibitor_resource_destroy(struct wl_resource *resource) {
input_inhibit_manager_deactivate(manager);
}
static struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation = {
static const struct zwlr_input_inhibitor_v1_interface input_inhibitor_implementation = {
.destroy = input_inhibitor_destroy,
};

View file

@ -5,7 +5,7 @@
#include <wlr/types/wlr_tablet_tool.h>
void wlr_tablet_init(struct wlr_tablet *tablet,
struct wlr_tablet_impl *impl) {
const struct wlr_tablet_impl *impl) {
tablet->impl = impl;
wl_signal_init(&tablet->events.axis);
wl_signal_init(&tablet->events.proximity);