2017-06-19 20:49:07 +02:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <wayland-server.h>
|
2017-06-21 16:27:45 +02:00
|
|
|
#include <wlr/interfaces/wlr_tablet_pad.h>
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <wlr/types/wlr_tablet_pad.h>
|
2017-06-19 20:49:07 +02:00
|
|
|
|
2017-08-14 15:59:59 +02:00
|
|
|
void wlr_tablet_pad_init(struct wlr_tablet_pad *pad,
|
|
|
|
struct wlr_tablet_pad_impl *impl) {
|
2017-06-19 20:49:07 +02:00
|
|
|
pad->impl = impl;
|
|
|
|
wl_signal_init(&pad->events.button);
|
|
|
|
wl_signal_init(&pad->events.ring);
|
|
|
|
wl_signal_init(&pad->events.strip);
|
2018-04-26 12:31:25 +02:00
|
|
|
wl_signal_init(&pad->events.attach_tablet);
|
2017-06-19 20:49:07 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad) {
|
2018-05-15 16:16:19 +02:00
|
|
|
if (!pad) {
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
wlr_list_for_each(&pad->paths, free);
|
|
|
|
wlr_list_finish(&pad->paths);
|
|
|
|
|
|
|
|
if (pad->impl && pad->impl->destroy) {
|
2017-08-14 15:59:59 +02:00
|
|
|
pad->impl->destroy(pad);
|
|
|
|
} else {
|
|
|
|
free(pad);
|
2017-06-19 20:49:07 +02:00
|
|
|
}
|
|
|
|
}
|