2017-06-15 20:32:28 +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_tool.h>
|
2018-02-12 21:29:23 +01:00
|
|
|
#include <wlr/types/wlr_tablet_tool.h>
|
2017-06-15 20:32:28 +02:00
|
|
|
|
2017-08-14 16:03:05 +02:00
|
|
|
void wlr_tablet_tool_init(struct wlr_tablet_tool *tool,
|
|
|
|
struct wlr_tablet_tool_impl *impl) {
|
2017-06-15 20:32:28 +02: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) {
|
2017-10-31 11:58:39 +01:00
|
|
|
if (!tool) {
|
|
|
|
return;
|
|
|
|
}
|
2017-08-14 16:03:05 +02:00
|
|
|
if (tool->impl && tool->impl->destroy) {
|
|
|
|
tool->impl->destroy(tool);
|
|
|
|
} else {
|
|
|
|
free(tool);
|
2017-06-15 20:32:28 +02:00
|
|
|
}
|
|
|
|
}
|