parent
7dfc2c28f1
commit
d6905f86cb
@ -0,0 +1,15 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <assert.h>
|
||||||
|
#include <libinput.h>
|
||||||
|
#include <wlr/session.h>
|
||||||
|
#include <wlr/types.h>
|
||||||
|
#include <wlr/common/list.h>
|
||||||
|
#include "backend/libinput.h"
|
||||||
|
#include "common/log.h"
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
struct wlr_touch *wlr_libinput_touch_create(
|
||||||
|
struct libinput_device *device) {
|
||||||
|
assert(device);
|
||||||
|
return wlr_touch_create(NULL, NULL);
|
||||||
|
}
|
@ -0,0 +1,27 @@
|
|||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <wayland-server.h>
|
||||||
|
#include <wlr/types.h>
|
||||||
|
#include <wlr/common/list.h>
|
||||||
|
#include "types.h"
|
||||||
|
|
||||||
|
struct wlr_touch *wlr_touch_create(struct wlr_touch_impl *impl,
|
||||||
|
struct wlr_touch_state *state) {
|
||||||
|
struct wlr_touch *touch = calloc(1, sizeof(struct wlr_touch));
|
||||||
|
touch->impl = impl;
|
||||||
|
touch->state = state;
|
||||||
|
wl_signal_init(&touch->events.down);
|
||||||
|
wl_signal_init(&touch->events.up);
|
||||||
|
wl_signal_init(&touch->events.motion);
|
||||||
|
wl_signal_init(&touch->events.frame);
|
||||||
|
wl_signal_init(&touch->events.cancel);
|
||||||
|
return touch;
|
||||||
|
}
|
||||||
|
|
||||||
|
void wlr_touch_destroy(struct wlr_touch *touch) {
|
||||||
|
if (!touch) return;
|
||||||
|
if (touch->impl) {
|
||||||
|
touch->impl->destroy(touch->state);
|
||||||
|
}
|
||||||
|
free(touch);
|
||||||
|
}
|
Loading…
Reference in new issue