summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLibravatar Cole Mickens <cole.mickens@gmail.com>2016-01-17 02:53:37 -0800
committerLibravatar Cole Mickens <cole.mickens@gmail.com>2016-01-19 06:51:36 -0800
commit28081b76891ddbbb825dee6c202037d78aa8f164 (patch)
tree6b7412f626f5d9f10dba8920a2543dfd3c5a662e /include
parentAdd ffmpeg/imagemagick to depenency list (diff)
downloadsway-28081b76891ddbbb825dee6c202037d78aa8f164.tar.gz
sway-28081b76891ddbbb825dee6c202037d78aa8f164.tar.zst
sway-28081b76891ddbbb825dee6c202037d78aa8f164.zip
libinput
Diffstat (limited to 'include')
-rw-r--r--include/commands.h3
-rw-r--r--include/config.h28
-rw-r--r--include/input.h23
-rw-r--r--include/ipc.h6
4 files changed, 57 insertions, 3 deletions
diff --git a/include/commands.h b/include/commands.h
index 52d56e4a..5fa66bb6 100644
--- a/include/commands.h
+++ b/include/commands.h
@@ -17,7 +17,8 @@ enum cmd_status {
17 CMD_BLOCK_END, 17 CMD_BLOCK_END,
18 CMD_BLOCK_MODE, 18 CMD_BLOCK_MODE,
19 CMD_BLOCK_BAR, 19 CMD_BLOCK_BAR,
20 CMD_BLOCK_BAR_COLORS 20 CMD_BLOCK_BAR_COLORS,
21 CMD_BLOCK_INPUT
21}; 22};
22 23
23/** 24/**
diff --git a/include/config.h b/include/config.h
index e6a85b29..c2b67aa6 100644
--- a/include/config.h
+++ b/include/config.h
@@ -1,7 +1,9 @@
1#ifndef _SWAY_CONFIG_H 1#ifndef _SWAY_CONFIG_H
2#define _SWAY_CONFIG_H 2#define _SWAY_CONFIG_H
3 3
4#include <libinput.h>
4#include <stdint.h> 5#include <stdint.h>
6#include <wlc/geometry.h>
5#include <wlc/wlc.h> 7#include <wlc/wlc.h>
6#include <xkbcommon/xkbcommon.h> 8#include <xkbcommon/xkbcommon.h>
7#include "wayland-desktop-shell-server-protocol.h" 9#include "wayland-desktop-shell-server-protocol.h"
@@ -46,6 +48,25 @@ struct sway_mode {
46}; 48};
47 49
48/** 50/**
51 * libinput options for input devices
52 */
53struct input_config {
54 char *identifier;
55 int click_method;
56 int drag_lock;
57 int dwt;
58 int middle_emulation;
59 int natural_scroll;
60 float pointer_accel;
61 int scroll_method;
62 int send_events;
63 int tap;
64
65 bool capturable;
66 struct wlc_geometry region;
67};
68
69/**
49 * Size and position configuration for a particular output. 70 * Size and position configuration for a particular output.
50 * 71 *
51 * This is set via the `output` command. 72 * This is set via the `output` command.
@@ -136,6 +157,7 @@ struct sway_config {
136 list_t *cmd_queue; 157 list_t *cmd_queue;
137 list_t *workspace_outputs; 158 list_t *workspace_outputs;
138 list_t *output_configs; 159 list_t *output_configs;
160 list_t *input_configs;
139 list_t *criteria; 161 list_t *criteria;
140 list_t *active_bar_modifiers; 162 list_t *active_bar_modifiers;
141 struct sway_mode *current_mode; 163 struct sway_mode *current_mode;
@@ -172,6 +194,12 @@ bool read_config(FILE *file, bool is_active);
172 * Does variable replacement for a string based on the config's currently loaded variables. 194 * Does variable replacement for a string based on the config's currently loaded variables.
173 */ 195 */
174char *do_var_replacement(char *str); 196char *do_var_replacement(char *str);
197
198int input_identifier_cmp(const void *item, const void *data);
199void merge_input_config(struct input_config *dst, struct input_config *src);
200void apply_input_config(struct input_config *ic, struct libinput_device *dev);
201void free_input_config(struct input_config *ic);
202
175int output_name_cmp(const void *item, const void *data); 203int output_name_cmp(const void *item, const void *data);
176void merge_output_config(struct output_config *dst, struct output_config *src); 204void merge_output_config(struct output_config *dst, struct output_config *src);
177/** Sets up a WLC output handle based on a given output_config. 205/** Sets up a WLC output handle based on a given output_config.
diff --git a/include/input.h b/include/input.h
new file mode 100644
index 00000000..4ed9bffe
--- /dev/null
+++ b/include/input.h
@@ -0,0 +1,23 @@
1#ifndef _SWAY_INPUT_H
2#define _SWAY_INPUT_H
3
4#include <libinput.h>
5#include "config.h"
6#include "list.h"
7
8struct input_config *new_input_config(const char* identifier);
9
10char* libinput_dev_unique_id(struct libinput_device *dev);
11
12/**
13 * Global input device list.
14 */
15extern list_t *input_devices;
16
17/**
18 * Pointer used when reading input blocked.
19 * Shared so that it can be cleared from commands.c when closing the block
20 */
21extern struct input_config *current_input_config;
22
23#endif
diff --git a/include/ipc.h b/include/ipc.h
index 56593529..934049c2 100644
--- a/include/ipc.h
+++ b/include/ipc.h
@@ -5,11 +5,12 @@ enum ipc_command_type {
5 IPC_COMMAND = 0, 5 IPC_COMMAND = 0,
6 IPC_GET_WORKSPACES = 1, 6 IPC_GET_WORKSPACES = 1,
7 IPC_SUBSCRIBE = 2, 7 IPC_SUBSCRIBE = 2,
8 IPC_GET_OUTPUTS = 3, 8 IPC_GET_OUTPUTS = 3,
9 IPC_GET_TREE = 4, 9 IPC_GET_TREE = 4,
10 IPC_GET_MARKS = 5, 10 IPC_GET_MARKS = 5,
11 IPC_GET_BAR_CONFIG = 6, 11 IPC_GET_BAR_CONFIG = 6,
12 IPC_GET_VERSION = 7, 12 IPC_GET_VERSION = 7,
13 IPC_GET_INPUTS = 8,
13 // Events send from sway to clients. Events have the higest bit set. 14 // Events send from sway to clients. Events have the higest bit set.
14 IPC_EVENT_WORKSPACE = (1 << 31 | 0), 15 IPC_EVENT_WORKSPACE = (1 << 31 | 0),
15 IPC_EVENT_OUTPUT = (1 << 31 | 1), 16 IPC_EVENT_OUTPUT = (1 << 31 | 1),
@@ -18,6 +19,7 @@ enum ipc_command_type {
18 IPC_EVENT_BARCONFIG_UPDATE = (1 << 31 | 4), 19 IPC_EVENT_BARCONFIG_UPDATE = (1 << 31 | 4),
19 IPC_EVENT_BINDING = (1 << 31 | 5), 20 IPC_EVENT_BINDING = (1 << 31 | 5),
20 IPC_EVENT_MODIFIER = (1 << 31 | 6), 21 IPC_EVENT_MODIFIER = (1 << 31 | 6),
22 IPC_EVENT_INPUT = (1 << 31 | 7),
21 IPC_SWAY_GET_PIXELS = 0x81 23 IPC_SWAY_GET_PIXELS = 0x81
22}; 24};
23 25