input-device: unconfuse tablet naming

WLR_INPUT_DEVICE_TABLET_TOOL is renamed to WLR_INPUT_DEVICE_TABLET

The input device corresponds to wlr_tablet, not wlr_tablet_tool.
This commit is contained in:
Isaac Freund 2024-02-29 13:31:00 +01:00
parent 889150f866
commit b821be5749
No known key found for this signature in database
GPG key ID: 86DED400DDFD7A11
10 changed files with 13 additions and 13 deletions

View file

@ -220,7 +220,7 @@ struct libinput_device *wlr_libinput_get_device_handle(
case WLR_INPUT_DEVICE_TOUCH:
dev = device_from_touch(wlr_touch_from_input_device(wlr_dev));
break;
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
dev = device_from_tablet(wlr_tablet_from_input_device(wlr_dev));
break;
case WLR_INPUT_DEVICE_TABLET_PAD:

View file

@ -47,7 +47,7 @@ bool wlr_input_device_is_libinput(struct wlr_input_device *wlr_dev) {
case WLR_INPUT_DEVICE_TOUCH:
return wlr_touch_from_input_device(wlr_dev)->impl ==
&libinput_touch_impl;
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
return wlr_tablet_from_input_device(wlr_dev)-> impl ==
&libinput_tablet_impl;
case WLR_INPUT_DEVICE_TABLET_PAD:

View file

@ -313,7 +313,7 @@ bool wlr_input_device_is_wl(struct wlr_input_device *dev) {
return wlr_pointer_from_input_device(dev)->impl == &wl_pointer_impl;
case WLR_INPUT_DEVICE_TOUCH:
return wlr_touch_from_input_device(dev)->impl == &touch_impl;
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
return wlr_tablet_from_input_device(dev)-> impl == &wl_tablet_impl;
case WLR_INPUT_DEVICE_TABLET_PAD:
return wlr_tablet_pad_from_input_device(dev)->impl == &wl_tablet_pad_impl;

View file

@ -298,7 +298,7 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
switch (device->type) {
case WLR_INPUT_DEVICE_POINTER:
case WLR_INPUT_DEVICE_TOUCH:
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
wlr_cursor_attach_input_device(state->cursor, device);
break;

View file

@ -351,7 +351,7 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
wl_signal_add(&pstate->wlr_tablet_pad->events.ring, &pstate->ring);
wl_list_insert(&sample->tablet_pads, &pstate->link);
break;
case WLR_INPUT_DEVICE_TABLET_TOOL:;
case WLR_INPUT_DEVICE_TABLET:;
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
sample->width_mm = tablet->width_mm == 0 ?
20 : tablet->width_mm;

View file

@ -171,7 +171,7 @@ void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface,
*
* - WLR_INPUT_DEVICE_POINTER
* - WLR_INPUT_DEVICE_TOUCH
* - WLR_INPUT_DEVICE_TABLET_TOOL
* - WLR_INPUT_DEVICE_TABLET
*/
void wlr_cursor_attach_input_device(struct wlr_cursor *cur,
struct wlr_input_device *dev);

View file

@ -23,7 +23,7 @@ enum wlr_input_device_type {
WLR_INPUT_DEVICE_KEYBOARD, // struct wlr_keyboard
WLR_INPUT_DEVICE_POINTER, // struct wlr_pointer
WLR_INPUT_DEVICE_TOUCH, // struct wlr_touch
WLR_INPUT_DEVICE_TABLET_TOOL, // struct wlr_tablet
WLR_INPUT_DEVICE_TABLET, // struct wlr_tablet
WLR_INPUT_DEVICE_TABLET_PAD, // struct wlr_tablet_pad
WLR_INPUT_DEVICE_SWITCH, // struct wlr_switch
};

View file

@ -51,7 +51,7 @@ struct wlr_tablet_v2_tablet *wlr_tablet_create(
struct wlr_tablet_manager_v2 *manager,
struct wlr_seat *wlr_seat,
struct wlr_input_device *wlr_device) {
assert(wlr_device->type == WLR_INPUT_DEVICE_TABLET_TOOL);
assert(wlr_device->type == WLR_INPUT_DEVICE_TABLET);
struct wlr_tablet_seat_v2 *seat = get_or_create_tablet_seat(manager, wlr_seat);
if (!seat) {
return NULL;

View file

@ -207,7 +207,7 @@ static void cursor_device_destroy(struct wlr_cursor_device *c_device) {
wl_list_remove(&c_device->touch_cancel.link);
wl_list_remove(&c_device->touch_frame.link);
break;
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
wl_list_remove(&c_device->tablet_tool_axis.link);
wl_list_remove(&c_device->tablet_tool_proximity.link);
wl_list_remove(&c_device->tablet_tool_tip.link);
@ -1020,7 +1020,7 @@ static struct wlr_cursor_device *cursor_device_create(
c_device->touch_frame.notify = handle_touch_frame;
break;
case WLR_INPUT_DEVICE_TABLET_TOOL:;
case WLR_INPUT_DEVICE_TABLET:;
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
wl_signal_add(&tablet->events.tip, &c_device->tablet_tool_tip);
@ -1052,7 +1052,7 @@ void wlr_cursor_attach_input_device(struct wlr_cursor *cur,
switch (dev->type) {
case WLR_INPUT_DEVICE_POINTER:
case WLR_INPUT_DEVICE_TOUCH:
case WLR_INPUT_DEVICE_TABLET_TOOL:
case WLR_INPUT_DEVICE_TABLET:
break;
default:
wlr_log(WLR_ERROR, "only device types of pointer, touch or tablet tool"

View file

@ -9,7 +9,7 @@
struct wlr_tablet *wlr_tablet_from_input_device(
struct wlr_input_device *input_device) {
assert(input_device->type == WLR_INPUT_DEVICE_TABLET_TOOL);
assert(input_device->type == WLR_INPUT_DEVICE_TABLET);
return wl_container_of(input_device, (struct wlr_tablet *)NULL, base);
}
@ -18,7 +18,7 @@ void wlr_tablet_init(struct wlr_tablet *tablet,
*tablet = (struct wlr_tablet){
.impl = impl,
};
wlr_input_device_init(&tablet->base, WLR_INPUT_DEVICE_TABLET_TOOL, name);
wlr_input_device_init(&tablet->base, WLR_INPUT_DEVICE_TABLET, name);
wl_signal_init(&tablet->events.axis);
wl_signal_init(&tablet->events.proximity);