aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/config.h
diff options
context:
space:
mode:
authorLibravatar Florian Franzen <Florian.Franzen@gmail.com>2022-04-23 10:27:47 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2022-05-30 12:20:43 +0200
commitcab2189aa64d04ba79dc2cbf19400435b47cdbd2 (patch)
tree450ac51fbc75c73ed1dc6728bc05b08366ace785 /include/sway/config.h
parentAdd a Hindi (हिन्दी) translation to the README (diff)
downloadsway-cab2189aa64d04ba79dc2cbf19400435b47cdbd2.tar.gz
sway-cab2189aa64d04ba79dc2cbf19400435b47cdbd2.tar.zst
sway-cab2189aa64d04ba79dc2cbf19400435b47cdbd2.zip
sway: add bindgesture command
Co-authored-by: Michael Weiser <michael.weiser@gmx.de>
Diffstat (limited to 'include/sway/config.h')
-rw-r--r--include/sway/config.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/sway/config.h b/include/sway/config.h
index 2e24c3ae..05678c33 100644
--- a/include/sway/config.h
+++ b/include/sway/config.h
@@ -10,6 +10,7 @@
10#include <xkbcommon/xkbcommon.h> 10#include <xkbcommon/xkbcommon.h>
11#include <xf86drmMode.h> 11#include <xf86drmMode.h>
12#include "../include/config.h" 12#include "../include/config.h"
13#include "gesture.h"
13#include "list.h" 14#include "list.h"
14#include "swaynag.h" 15#include "swaynag.h"
15#include "tree/container.h" 16#include "tree/container.h"
@@ -32,7 +33,8 @@ enum binding_input_type {
32 BINDING_KEYSYM, 33 BINDING_KEYSYM,
33 BINDING_MOUSECODE, 34 BINDING_MOUSECODE,
34 BINDING_MOUSESYM, 35 BINDING_MOUSESYM,
35 BINDING_SWITCH 36 BINDING_SWITCH, // dummy, only used to call seat_execute_command
37 BINDING_GESTURE // dummy, only used to call seat_execute_command
36}; 38};
37 39
38enum binding_flags { 40enum binding_flags {
@@ -45,6 +47,7 @@ enum binding_flags {
45 BINDING_RELOAD = 1 << 6, // switch only; (re)trigger binding on reload 47 BINDING_RELOAD = 1 << 6, // switch only; (re)trigger binding on reload
46 BINDING_INHIBITED = 1 << 7, // keyboard only: ignore shortcut inhibitor 48 BINDING_INHIBITED = 1 << 7, // keyboard only: ignore shortcut inhibitor
47 BINDING_NOREPEAT = 1 << 8, // keyboard only; do not trigger when repeating a held key 49 BINDING_NOREPEAT = 1 << 8, // keyboard only; do not trigger when repeating a held key
50 BINDING_EXACT = 1 << 9, // gesture only; only trigger on exact match
48}; 51};
49 52
50/** 53/**
@@ -79,6 +82,16 @@ struct sway_switch_binding {
79}; 82};
80 83
81/** 84/**
85 * A gesture binding and an associated command.
86 */
87struct sway_gesture_binding {
88 char *input;
89 uint32_t flags;
90 struct gesture gesture;
91 char *command;
92};
93
94/**
82 * Focus on window activation. 95 * Focus on window activation.
83 */ 96 */
84enum sway_fowa { 97enum sway_fowa {
@@ -97,6 +110,7 @@ struct sway_mode {
97 list_t *keycode_bindings; 110 list_t *keycode_bindings;
98 list_t *mouse_bindings; 111 list_t *mouse_bindings;
99 list_t *switch_bindings; 112 list_t *switch_bindings;
113 list_t *gesture_bindings;
100 bool pango; 114 bool pango;
101}; 115};
102 116
@@ -689,6 +703,8 @@ void free_sway_binding(struct sway_binding *sb);
689 703
690void free_switch_binding(struct sway_switch_binding *binding); 704void free_switch_binding(struct sway_switch_binding *binding);
691 705
706void free_gesture_binding(struct sway_gesture_binding *binding);
707
692void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding); 708void seat_execute_command(struct sway_seat *seat, struct sway_binding *binding);
693 709
694void load_swaybar(struct bar_config *bar); 710void load_swaybar(struct bar_config *bar);