mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-21 06:59:44 -05:00
interfaces: remove wlr_input_device_impl
This commit is contained in:
parent
91ba28e020
commit
e279266f71
18 changed files with 27 additions and 72 deletions
|
|
@ -2,7 +2,6 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_keyboard.h>
|
||||
#include <wlr/interfaces/wlr_pointer.h>
|
||||
#include <wlr/interfaces/wlr_switch.h>
|
||||
|
|
@ -14,10 +13,8 @@
|
|||
#include "util/signal.h"
|
||||
|
||||
void wlr_input_device_init(struct wlr_input_device *dev,
|
||||
enum wlr_input_device_type type,
|
||||
const struct wlr_input_device_impl *impl, const char *name) {
|
||||
enum wlr_input_device_type type, const char *name) {
|
||||
dev->type = type;
|
||||
dev->impl = impl;
|
||||
dev->name = strdup(name);
|
||||
dev->vendor = 0;
|
||||
dev->product = 0;
|
||||
|
|
@ -64,10 +61,6 @@ void wlr_input_device_destroy(struct wlr_input_device *dev) {
|
|||
}
|
||||
} else {
|
||||
wlr_input_device_finish(dev);
|
||||
if (dev->impl && dev->impl->destroy) {
|
||||
dev->impl->destroy(dev);
|
||||
} else {
|
||||
free(dev);
|
||||
}
|
||||
free(dev);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,7 +4,6 @@
|
|||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_keyboard.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
@ -116,7 +115,7 @@ void wlr_keyboard_notify_key(struct wlr_keyboard *keyboard,
|
|||
|
||||
void wlr_keyboard_init(struct wlr_keyboard *kb,
|
||||
const struct wlr_keyboard_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&kb->base, WLR_INPUT_DEVICE_KEYBOARD, NULL, name);
|
||||
wlr_input_device_init(&kb->base, WLR_INPUT_DEVICE_KEYBOARD, name);
|
||||
kb->base.keyboard = kb;
|
||||
|
||||
kb->impl = impl;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_pointer.h>
|
||||
#include <wlr/types/wlr_pointer.h>
|
||||
|
||||
void wlr_pointer_init(struct wlr_pointer *pointer,
|
||||
const struct wlr_pointer_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&pointer->base, WLR_INPUT_DEVICE_POINTER, NULL, name);
|
||||
wlr_input_device_init(&pointer->base, WLR_INPUT_DEVICE_POINTER, name);
|
||||
pointer->base.pointer = pointer;
|
||||
|
||||
pointer->impl = impl;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_switch.h>
|
||||
#include <wlr/types/wlr_switch.h>
|
||||
|
||||
void wlr_switch_init(struct wlr_switch *switch_device,
|
||||
const struct wlr_switch_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&switch_device->base, WLR_INPUT_DEVICE_SWITCH, NULL,
|
||||
name);
|
||||
wlr_input_device_init(&switch_device->base, WLR_INPUT_DEVICE_SWITCH, name);
|
||||
switch_device->base.switch_device = switch_device;
|
||||
|
||||
switch_device->impl = impl;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_tablet_pad.h>
|
||||
#include <wlr/types/wlr_tablet_pad.h>
|
||||
|
||||
void wlr_tablet_pad_init(struct wlr_tablet_pad *pad,
|
||||
const struct wlr_tablet_pad_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&pad->base, WLR_INPUT_DEVICE_TABLET_PAD, NULL, name);
|
||||
wlr_input_device_init(&pad->base, WLR_INPUT_DEVICE_TABLET_PAD, name);
|
||||
pad->base.tablet_pad = pad;
|
||||
|
||||
pad->impl = impl;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_tablet_tool.h>
|
||||
#include <wlr/types/wlr_tablet_tool.h>
|
||||
|
||||
void wlr_tablet_init(struct wlr_tablet *tablet,
|
||||
const struct wlr_tablet_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&tablet->base, WLR_INPUT_DEVICE_TABLET_TOOL, NULL,
|
||||
name);
|
||||
wlr_input_device_init(&tablet->base, WLR_INPUT_DEVICE_TABLET_TOOL, name);
|
||||
tablet->base.tablet = tablet;
|
||||
|
||||
tablet->impl = impl;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server-core.h>
|
||||
#include <wlr/interfaces/wlr_input_device.h>
|
||||
#include <wlr/interfaces/wlr_touch.h>
|
||||
#include <wlr/types/wlr_touch.h>
|
||||
|
||||
void wlr_touch_init(struct wlr_touch *touch,
|
||||
const struct wlr_touch_impl *impl, const char *name) {
|
||||
wlr_input_device_init(&touch->base, WLR_INPUT_DEVICE_TOUCH, NULL, name);
|
||||
wlr_input_device_init(&touch->base, WLR_INPUT_DEVICE_TOUCH, name);
|
||||
touch->base.touch = touch;
|
||||
|
||||
touch->impl = impl;
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/mman.h>
|
||||
#include <wlr/interfaces/wlr_keyboard.h>
|
||||
#include <wlr/types/wlr_seat.h>
|
||||
#include <wlr/types/wlr_virtual_keyboard_v1.h>
|
||||
#include <wlr/util/log.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue