2018-11-15 00:24:55 +01:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
2019-07-27 10:53:54 +02:00
|
|
|
#include <wayland-server-core.h>
|
2018-11-15 00:24:55 +01:00
|
|
|
#include <wlr/interfaces/wlr_switch.h>
|
|
|
|
#include <wlr/types/wlr_switch.h>
|
|
|
|
|
2022-03-03 15:43:38 +01:00
|
|
|
#include "interfaces/wlr_input_device.h"
|
|
|
|
|
2019-03-19 23:41:20 +01:00
|
|
|
void wlr_switch_init(struct wlr_switch *switch_device,
|
2022-02-09 21:53:42 +01:00
|
|
|
const struct wlr_switch_impl *impl, const char *name) {
|
2022-02-09 22:14:56 +01:00
|
|
|
wlr_input_device_init(&switch_device->base, WLR_INPUT_DEVICE_SWITCH, name);
|
2022-01-31 16:53:58 +01:00
|
|
|
switch_device->base.switch_device = switch_device;
|
|
|
|
|
2019-03-19 23:41:20 +01:00
|
|
|
switch_device->impl = impl;
|
|
|
|
wl_signal_init(&switch_device->events.toggle);
|
2018-11-15 00:24:55 +01:00
|
|
|
}
|
|
|
|
|
2022-03-02 20:17:31 +01:00
|
|
|
void wlr_switch_finish(struct wlr_switch *switch_device) {
|
2022-01-31 16:53:58 +01:00
|
|
|
wlr_input_device_finish(&switch_device->base);
|
2018-11-15 00:24:55 +01:00
|
|
|
}
|