wlroots/types/wlr_tablet_tool.c

26 lines
612 B
C
Raw Normal View History

2017-06-15 18:32:28 +00:00
#include <stdlib.h>
#include <string.h>
#include <wayland-server.h>
2017-06-21 14:27:45 +00:00
#include <wlr/interfaces/wlr_tablet_tool.h>
2018-02-12 20:29:23 +00:00
#include <wlr/types/wlr_tablet_tool.h>
2017-06-15 18:32:28 +00:00
2017-08-14 14:03:05 +00:00
void wlr_tablet_tool_init(struct wlr_tablet_tool *tool,
struct wlr_tablet_tool_impl *impl) {
2017-06-15 18:32:28 +00:00
tool->impl = impl;
wl_signal_init(&tool->events.axis);
wl_signal_init(&tool->events.proximity);
wl_signal_init(&tool->events.tip);
wl_signal_init(&tool->events.button);
}
void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool) {
if (!tool) {
return;
}
2017-08-14 14:03:05 +00:00
if (tool->impl && tool->impl->destroy) {
tool->impl->destroy(tool);
} else {
free(tool);
2017-06-15 18:32:28 +00:00
}
}