mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-12 13:29:45 -05:00
Implement tablet pads
This commit is contained in:
parent
e9609e9adf
commit
ecb04afcad
11 changed files with 268 additions and 13 deletions
|
|
@ -10,6 +10,7 @@ add_library(wlr-types
|
|||
wlr_pointer.c
|
||||
wlr_touch.c
|
||||
wlr_tablet_tool.c
|
||||
wlr_tablet_pad.c
|
||||
)
|
||||
|
||||
target_link_libraries(wlr-types
|
||||
|
|
|
|||
25
types/wlr_tablet_pad.c
Normal file
25
types/wlr_tablet_pad.c
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#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_pad *wlr_tablet_pad_create(struct wlr_tablet_pad_impl *impl,
|
||||
struct wlr_tablet_pad_state *state) {
|
||||
struct wlr_tablet_pad *pad = calloc(1, sizeof(struct wlr_tablet_pad));
|
||||
pad->impl = impl;
|
||||
pad->state = state;
|
||||
wl_signal_init(&pad->events.button);
|
||||
wl_signal_init(&pad->events.ring);
|
||||
wl_signal_init(&pad->events.strip);
|
||||
return pad;
|
||||
}
|
||||
|
||||
void wlr_tablet_pad_destroy(struct wlr_tablet_pad *pad) {
|
||||
if (!pad) return;
|
||||
if (pad->impl) {
|
||||
pad->impl->destroy(pad->state);
|
||||
}
|
||||
free(pad);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue