diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-06-14 14:50:09 -0400 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-06-14 14:50:09 -0400 |
commit | 3f24f8a1bee10fb3aadf8c57ca107fe5aaa7cffa (patch) | |
tree | 923093315e92cc5351644b145dbad74b4317d9dd /example/shared.h | |
parent | d6905f86cb9d430e0ba05c6a066ed350761116d1 (diff) |
Flesh out touch events and add demo
Diffstat (limited to 'example/shared.h')
-rw-r--r-- | example/shared.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/example/shared.h b/example/shared.h index 7f0dade5..d09bcd0e 100644 --- a/example/shared.h +++ b/example/shared.h @@ -39,6 +39,17 @@ struct pointer_state { void *data; }; +struct touch_state { + struct compositor_state *compositor; + struct wlr_input_device *device; + struct wl_listener down; + struct wl_listener up; + struct wl_listener motion; + struct wl_listener cancel; + struct wl_list link; + void *data; +}; + struct compositor_state { void (*output_add_cb)(struct output_state *s); void (*keyboard_add_cb)(struct keyboard_state *s); @@ -55,6 +66,12 @@ struct compositor_state { enum wlr_axis_source source, enum wlr_axis_orientation orientation, double delta); + void (*touch_down_cb)(struct touch_state *s, int32_t slot, + double x, double y, double width, double height); + void (*touch_motion_cb)(struct touch_state *s, int32_t slot, + double x, double y, double width, double height); + void (*touch_up_cb)(struct touch_state *s, int32_t slot); + void (*touch_cancel_cb)(struct touch_state *s, int32_t slot); struct wl_display *display; struct wl_event_loop *event_loop; @@ -63,6 +80,7 @@ struct compositor_state { struct wl_list keyboards; struct wl_list pointers; + struct wl_list touch; struct wl_listener input_add; struct wl_listener input_remove; |