diff options
author | emersion <contact@emersion.fr> | 2018-12-15 19:54:25 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-15 19:54:25 +0100 |
commit | 6d4bfa3226123e958ff2bdc4f226489cba49f84d (patch) | |
tree | 256c7c3ded68d4b95ed09f7a2fbfd5bc67dbcee9 /include/rootston | |
parent | 8a56b96c5516ee089b7561949aac4f83e5b94808 (diff) | |
parent | f8129ecbc5147a62d93d6bac5e61e5ce79d89667 (diff) |
Merge pull request #1377 from tokyovigilante/switch-events
Add support for libinput_switch input devices
Diffstat (limited to 'include/rootston')
-rw-r--r-- | include/rootston/bindings.h | 9 | ||||
-rw-r--r-- | include/rootston/config.h | 10 | ||||
-rw-r--r-- | include/rootston/seat.h | 2 | ||||
-rw-r--r-- | include/rootston/switch.h | 18 |
4 files changed, 39 insertions, 0 deletions
diff --git a/include/rootston/bindings.h b/include/rootston/bindings.h new file mode 100644 index 00000000..db38130b --- /dev/null +++ b/include/rootston/bindings.h @@ -0,0 +1,9 @@ +#ifndef ROOTSTON_BINDINGS_H +#define ROOTSTON_BINDINGS_H + +#include "rootston/seat.h" +#include "rootston/input.h" + +void execute_binding_command(struct roots_seat *seat, struct roots_input *input, const char *command); + +#endif //ROOTSTON_BINDINGS_H diff --git a/include/rootston/config.h b/include/rootston/config.h index 86699c6a..f8132269 100644 --- a/include/rootston/config.h +++ b/include/rootston/config.h @@ -3,6 +3,7 @@ #include <xf86drmMode.h> #include <wlr/types/wlr_input_device.h> +#include <wlr/types/wlr_switch.h> #include <wlr/types/wlr_output_layout.h> #define ROOTS_CONFIG_DEFAULT_SEAT_NAME "seat0" @@ -65,6 +66,14 @@ struct roots_cursor_config { struct wl_list link; }; +struct roots_switch_config { + char *name; + enum wlr_switch_type switch_type; + enum wlr_switch_state switch_state; + char *command; + struct wl_list link; +}; + struct roots_config { bool xwayland; bool xwayland_lazy; @@ -74,6 +83,7 @@ struct roots_config { struct wl_list bindings; struct wl_list keyboards; struct wl_list cursors; + struct wl_list switches; char *config_path; char *startup_cmd; diff --git a/include/rootston/seat.h b/include/rootston/seat.h index 0187c6cc..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 { @@ -32,6 +33,7 @@ struct roots_seat { struct wl_list keyboards; struct wl_list pointers; + struct wl_list switches; struct wl_list touch; struct wl_list tablets; struct wl_list tablet_pads; 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 |