mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2024-11-21 22:52:20 +00:00
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:
parent
889150f866
commit
b821be5749
@ -220,7 +220,7 @@ struct libinput_device *wlr_libinput_get_device_handle(
|
|||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
dev = device_from_touch(wlr_touch_from_input_device(wlr_dev));
|
dev = device_from_touch(wlr_touch_from_input_device(wlr_dev));
|
||||||
break;
|
break;
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
case WLR_INPUT_DEVICE_TABLET:
|
||||||
dev = device_from_tablet(wlr_tablet_from_input_device(wlr_dev));
|
dev = device_from_tablet(wlr_tablet_from_input_device(wlr_dev));
|
||||||
break;
|
break;
|
||||||
case WLR_INPUT_DEVICE_TABLET_PAD:
|
case WLR_INPUT_DEVICE_TABLET_PAD:
|
||||||
|
@ -47,7 +47,7 @@ bool wlr_input_device_is_libinput(struct wlr_input_device *wlr_dev) {
|
|||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
return wlr_touch_from_input_device(wlr_dev)->impl ==
|
return wlr_touch_from_input_device(wlr_dev)->impl ==
|
||||||
&libinput_touch_impl;
|
&libinput_touch_impl;
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
case WLR_INPUT_DEVICE_TABLET:
|
||||||
return wlr_tablet_from_input_device(wlr_dev)-> impl ==
|
return wlr_tablet_from_input_device(wlr_dev)-> impl ==
|
||||||
&libinput_tablet_impl;
|
&libinput_tablet_impl;
|
||||||
case WLR_INPUT_DEVICE_TABLET_PAD:
|
case WLR_INPUT_DEVICE_TABLET_PAD:
|
||||||
|
@ -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;
|
return wlr_pointer_from_input_device(dev)->impl == &wl_pointer_impl;
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
return wlr_touch_from_input_device(dev)->impl == &touch_impl;
|
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;
|
return wlr_tablet_from_input_device(dev)-> impl == &wl_tablet_impl;
|
||||||
case WLR_INPUT_DEVICE_TABLET_PAD:
|
case WLR_INPUT_DEVICE_TABLET_PAD:
|
||||||
return wlr_tablet_pad_from_input_device(dev)->impl == &wl_tablet_pad_impl;
|
return wlr_tablet_pad_from_input_device(dev)->impl == &wl_tablet_pad_impl;
|
||||||
|
@ -298,7 +298,7 @@ static void new_input_notify(struct wl_listener *listener, void *data) {
|
|||||||
switch (device->type) {
|
switch (device->type) {
|
||||||
case WLR_INPUT_DEVICE_POINTER:
|
case WLR_INPUT_DEVICE_POINTER:
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
case WLR_INPUT_DEVICE_TABLET:
|
||||||
wlr_cursor_attach_input_device(state->cursor, device);
|
wlr_cursor_attach_input_device(state->cursor, device);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -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_signal_add(&pstate->wlr_tablet_pad->events.ring, &pstate->ring);
|
||||||
wl_list_insert(&sample->tablet_pads, &pstate->link);
|
wl_list_insert(&sample->tablet_pads, &pstate->link);
|
||||||
break;
|
break;
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:;
|
case WLR_INPUT_DEVICE_TABLET:;
|
||||||
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
|
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
|
||||||
sample->width_mm = tablet->width_mm == 0 ?
|
sample->width_mm = tablet->width_mm == 0 ?
|
||||||
20 : tablet->width_mm;
|
20 : tablet->width_mm;
|
||||||
|
@ -171,7 +171,7 @@ void wlr_cursor_set_surface(struct wlr_cursor *cur, struct wlr_surface *surface,
|
|||||||
*
|
*
|
||||||
* - WLR_INPUT_DEVICE_POINTER
|
* - WLR_INPUT_DEVICE_POINTER
|
||||||
* - WLR_INPUT_DEVICE_TOUCH
|
* - WLR_INPUT_DEVICE_TOUCH
|
||||||
* - WLR_INPUT_DEVICE_TABLET_TOOL
|
* - WLR_INPUT_DEVICE_TABLET
|
||||||
*/
|
*/
|
||||||
void wlr_cursor_attach_input_device(struct wlr_cursor *cur,
|
void wlr_cursor_attach_input_device(struct wlr_cursor *cur,
|
||||||
struct wlr_input_device *dev);
|
struct wlr_input_device *dev);
|
||||||
|
@ -23,7 +23,7 @@ enum wlr_input_device_type {
|
|||||||
WLR_INPUT_DEVICE_KEYBOARD, // struct wlr_keyboard
|
WLR_INPUT_DEVICE_KEYBOARD, // struct wlr_keyboard
|
||||||
WLR_INPUT_DEVICE_POINTER, // struct wlr_pointer
|
WLR_INPUT_DEVICE_POINTER, // struct wlr_pointer
|
||||||
WLR_INPUT_DEVICE_TOUCH, // struct wlr_touch
|
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_TABLET_PAD, // struct wlr_tablet_pad
|
||||||
WLR_INPUT_DEVICE_SWITCH, // struct wlr_switch
|
WLR_INPUT_DEVICE_SWITCH, // struct wlr_switch
|
||||||
};
|
};
|
||||||
|
@ -51,7 +51,7 @@ struct wlr_tablet_v2_tablet *wlr_tablet_create(
|
|||||||
struct wlr_tablet_manager_v2 *manager,
|
struct wlr_tablet_manager_v2 *manager,
|
||||||
struct wlr_seat *wlr_seat,
|
struct wlr_seat *wlr_seat,
|
||||||
struct wlr_input_device *wlr_device) {
|
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);
|
struct wlr_tablet_seat_v2 *seat = get_or_create_tablet_seat(manager, wlr_seat);
|
||||||
if (!seat) {
|
if (!seat) {
|
||||||
return NULL;
|
return NULL;
|
||||||
|
@ -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_cancel.link);
|
||||||
wl_list_remove(&c_device->touch_frame.link);
|
wl_list_remove(&c_device->touch_frame.link);
|
||||||
break;
|
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_axis.link);
|
||||||
wl_list_remove(&c_device->tablet_tool_proximity.link);
|
wl_list_remove(&c_device->tablet_tool_proximity.link);
|
||||||
wl_list_remove(&c_device->tablet_tool_tip.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;
|
c_device->touch_frame.notify = handle_touch_frame;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:;
|
case WLR_INPUT_DEVICE_TABLET:;
|
||||||
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
|
struct wlr_tablet *tablet = wlr_tablet_from_input_device(device);
|
||||||
|
|
||||||
wl_signal_add(&tablet->events.tip, &c_device->tablet_tool_tip);
|
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) {
|
switch (dev->type) {
|
||||||
case WLR_INPUT_DEVICE_POINTER:
|
case WLR_INPUT_DEVICE_POINTER:
|
||||||
case WLR_INPUT_DEVICE_TOUCH:
|
case WLR_INPUT_DEVICE_TOUCH:
|
||||||
case WLR_INPUT_DEVICE_TABLET_TOOL:
|
case WLR_INPUT_DEVICE_TABLET:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
wlr_log(WLR_ERROR, "only device types of pointer, touch or tablet tool"
|
wlr_log(WLR_ERROR, "only device types of pointer, touch or tablet tool"
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
struct wlr_tablet *wlr_tablet_from_input_device(
|
struct wlr_tablet *wlr_tablet_from_input_device(
|
||||||
struct wlr_input_device *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);
|
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){
|
*tablet = (struct wlr_tablet){
|
||||||
.impl = impl,
|
.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.axis);
|
||||||
wl_signal_init(&tablet->events.proximity);
|
wl_signal_init(&tablet->events.proximity);
|
||||||
|
Loading…
Reference in New Issue
Block a user