wlroots-hyprland/types/wlr_input_device.c

27 lines
574 B
C
Raw Permalink Normal View History

2017-06-09 23:31:21 +02:00
#include <stdlib.h>
#include <string.h>
#include "interfaces/wlr_input_device.h"
2017-06-09 23:31:21 +02:00
2017-08-14 14:54:53 +02:00
void wlr_input_device_init(struct wlr_input_device *dev,
enum wlr_input_device_type type, const char *name) {
*dev = (struct wlr_input_device){
.type = type,
.name = strdup(name),
};
2017-08-28 16:29:53 +02:00
wl_signal_init(&dev->events.destroy);
2017-06-09 23:31:21 +02:00
}
void wlr_input_device_finish(struct wlr_input_device *wlr_device) {
if (!wlr_device) {
return;
}
2022-08-18 13:16:16 +02:00
wl_signal_emit_mutable(&wlr_device->events.destroy, wlr_device);
wl_list_remove(&wlr_device->events.destroy.listener_list);
free(wlr_device->name);
}