mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-02 09:01:38 -05:00
Implement wlr_tablet_tool
This commit is contained in:
parent
e65f83d7f2
commit
4a9966b1a4
8 changed files with 295 additions and 5 deletions
|
|
@ -5,10 +5,11 @@ include_directories(
|
|||
|
||||
add_library(wlr-types
|
||||
wlr_output.c
|
||||
wlr_input_device.c
|
||||
wlr_keyboard.c
|
||||
wlr_pointer.c
|
||||
wlr_touch.c
|
||||
wlr_input_device.c
|
||||
wlr_tablet_tool.c
|
||||
)
|
||||
|
||||
target_link_libraries(wlr-types
|
||||
|
|
|
|||
26
types/wlr_tablet_tool.c
Normal file
26
types/wlr_tablet_tool.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <wayland-server.h>
|
||||
#include <wlr/types.h>
|
||||
#include <wlr/common/list.h>
|
||||
#include "types.h"
|
||||
|
||||
struct wlr_tablet_tool *wlr_tablet_tool_create(struct wlr_tablet_tool_impl *impl,
|
||||
struct wlr_tablet_tool_state *state) {
|
||||
struct wlr_tablet_tool *tool = calloc(1, sizeof(struct wlr_tablet_tool));
|
||||
tool->impl = impl;
|
||||
tool->state = state;
|
||||
wl_signal_init(&tool->events.axis);
|
||||
wl_signal_init(&tool->events.proximity);
|
||||
wl_signal_init(&tool->events.tip);
|
||||
wl_signal_init(&tool->events.button);
|
||||
return tool;
|
||||
}
|
||||
|
||||
void wlr_tablet_tool_destroy(struct wlr_tablet_tool *tool) {
|
||||
if (!tool) return;
|
||||
if (tool->impl) {
|
||||
tool->impl->destroy(tool->state);
|
||||
}
|
||||
free(tool);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue