29 lines
651 B
C
29 lines
651 B
C
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <wayland-server.h>
|
|
#include <wlr/interfaces/wlr_tablet_tool.h>
|
|
#include <wlr/types/wlr_tablet_tool.h>
|
|
#include "util/defs.h"
|
|
|
|
WLR_API
|
|
void wlr_tablet_tool_init(struct wlr_tablet_tool *tool,
|
|
struct wlr_tablet_tool_impl *impl) {
|
|
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);
|
|
}
|
|
|
|
WLR_API
|
|
void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool) {
|
|
if (!tool) {
|
|
return;
|
|
}
|
|
if (tool->impl && tool->impl->destroy) {
|
|
tool->impl->destroy(tool);
|
|
} else {
|
|
free(tool);
|
|
}
|
|
}
|