From 810c7b700cfb381457ad1e5a07f184f4efdcc5d1 Mon Sep 17 00:00:00 2001 From: Ryan Walklin Date: Wed, 28 Nov 2018 20:03:42 +0000 Subject: Working switches in rootston: Factor out switch handling to separate file Add formal enum for toggle action Implement binding actions --- include/rootston/seat.h | 10 +--------- include/rootston/switch.h | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-) create mode 100644 include/rootston/switch.h (limited to 'include/rootston') diff --git a/include/rootston/seat.h b/include/rootston/seat.h index 7e6b63bf..105ba3aa 100644 --- a/include/rootston/seat.h +++ b/include/rootston/seat.h @@ -5,6 +5,7 @@ #include "rootston/input.h" #include "rootston/keyboard.h" #include "rootston/layers.h" +#include "rootston/switch.h" #include "rootston/text_input.h" struct roots_seat { @@ -75,15 +76,6 @@ struct roots_pointer { struct wl_list link; }; -struct roots_switch { - struct roots_seat *seat; - struct wlr_input_device *device; - struct wl_listener device_destroy; - - struct wl_listener toggle; - struct wl_list link; -}; - struct roots_touch { struct roots_seat *seat; struct wlr_input_device *device; diff --git a/include/rootston/switch.h b/include/rootston/switch.h new file mode 100644 index 00000000..28197774 --- /dev/null +++ b/include/rootston/switch.h @@ -0,0 +1,18 @@ +#ifndef ROOTSTON_SWITCH_H +#define ROOTSTON_SWITCH_H + +#include "rootston/input.h" + +struct roots_switch { + struct roots_seat *seat; + struct wlr_input_device *device; + struct wl_listener device_destroy; + + struct wl_listener toggle; + struct wl_list link; +}; + +void roots_switch_handle_toggle(struct roots_switch *lid_switch, + struct wlr_event_switch_toggle *event); + +#endif // ROOTSTON_SWITCH_H -- cgit v1.2.3