2 #include <wayland-server.h>
3 #include "libds/interfaces/touch.h"
6 ds_touch_init(struct ds_touch *touch,
7 const struct ds_touch_interface *iface)
11 wl_signal_init(&touch->events.down);
12 wl_signal_init(&touch->events.up);
13 wl_signal_init(&touch->events.motion);
14 wl_signal_init(&touch->events.frame);
18 ds_touch_destroy(struct ds_touch *touch)
23 if (touch->iface && touch->iface->destroy)
24 touch->iface->destroy(touch);
30 ds_touch_add_down_listener(struct ds_touch *touch,
31 struct wl_listener *listener)
33 wl_signal_add(&touch->events.down, listener);
37 ds_touch_add_up_listener(struct ds_touch *touch,
38 struct wl_listener *listener)
40 wl_signal_add(&touch->events.up, listener);
44 ds_touch_add_motion_listener(struct ds_touch *touch,
45 struct wl_listener *listener)
47 wl_signal_add(&touch->events.motion, listener);
51 ds_touch_add_frame_listener(struct ds_touch *touch,
52 struct wl_listener *listener)
54 wl_signal_add(&touch->events.frame, listener);