From 2280928bb2859b8a5e71e81b99a396ff7a3f9efa Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Sun, 5 Nov 2017 09:20:11 -0500 Subject: rootston: roots_cursor --- include/rootston/cursor.h | 54 +++++++++++++++++++++++++++++++++++++++++++++++ include/rootston/seat.h | 14 +----------- 2 files changed, 55 insertions(+), 13 deletions(-) create mode 100644 include/rootston/cursor.h (limited to 'include') diff --git a/include/rootston/cursor.h b/include/rootston/cursor.h new file mode 100644 index 00000000..8a8d33f2 --- /dev/null +++ b/include/rootston/cursor.h @@ -0,0 +1,54 @@ +#ifndef _ROOTSTON_CURSOR_H +#define _ROOTSTON_CURSOR_H + +#include "rootston/seat.h" + +struct roots_cursor { + struct roots_seat *seat; + struct wlr_cursor *cursor; + + struct wl_listener motion; + struct wl_listener motion_absolute; + struct wl_listener button; + struct wl_listener axis; + + struct wl_listener touch_down; + struct wl_listener touch_up; + struct wl_listener touch_motion; + + struct wl_listener tool_axis; + struct wl_listener tool_tip; +}; + +struct roots_cursor *roots_cursor_create(struct roots_seat *seat); + +void roots_cursor_destroy(struct roots_cursor *cursor); + +void roots_cursor_handle_motion(struct roots_cursor *cursor, + struct wlr_event_pointer_motion *event); + +void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor, + struct wlr_event_pointer_motion_absolute *event); + +void roots_cursor_handle_button(struct roots_cursor *cursor, + struct wlr_event_pointer_button *event); + +void roots_cursor_handle_axis(struct roots_cursor *cursor, + struct wlr_event_pointer_axis *event); + +void roots_cursor_handle_touch_down(struct roots_cursor *cursor, + struct wlr_event_touch_down *event); + +void roots_cursor_handle_touch_up(struct roots_cursor *cursor, + struct wlr_event_touch_up *event); + +void roots_cursor_handle_touch_motion(struct roots_cursor *cursor, + struct wlr_event_touch_motion *event); + +void roots_cursor_handle_tool_axis(struct roots_cursor *cursor, + struct wlr_event_tablet_tool_axis *event); + +void roots_cursor_handle_tool_tip(struct roots_cursor *cursor, + struct wlr_event_tablet_tool_tip *event); + +#endif diff --git a/include/rootston/seat.h b/include/rootston/seat.h index e4130e5a..b7c8b477 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -9,25 +9,13 @@ struct roots_seat { struct roots_input *input; struct wlr_seat *seat; - struct wlr_cursor *cursor; + struct roots_cursor *cursor; struct wl_list link; struct wl_list keyboards; struct wl_list pointers; struct wl_list touch; struct wl_list tablet_tools; - - struct wl_listener cursor_motion; - struct wl_listener cursor_motion_absolute; - struct wl_listener cursor_button; - struct wl_listener cursor_axis; - - struct wl_listener cursor_touch_down; - struct wl_listener cursor_touch_up; - struct wl_listener cursor_touch_motion; - - struct wl_listener cursor_tool_axis; - struct wl_listener cursor_tool_tip; }; struct roots_pointer { -- cgit v1.2.3