From 163edc5a900fda58e006ed30e14ae10cc4aa13b3 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 12 Dec 2017 08:29:37 -0500 Subject: sway input device --- sway/config.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'sway/config.c') diff --git a/sway/config.c b/sway/config.c index ec8e89b4..7ae3c2a4 100644 --- a/sway/config.c +++ b/sway/config.c @@ -226,6 +226,34 @@ static int qstrcmp(const void* a, const void* b) { return strcmp(*((char**) a), *((char**) b)); } +struct input_config *new_input_config(const char* identifier) { + struct input_config *input = calloc(1, sizeof(struct input_config)); + if (!input) { + sway_log(L_DEBUG, "Unable to allocate input config"); + return NULL; + } + sway_log(L_DEBUG, "new_input_config(%s)", identifier); + if (!(input->identifier = strdup(identifier))) { + free(input); + sway_log(L_DEBUG, "Unable to allocate input config"); + return NULL; + } + + input->tap = INT_MIN; + input->drag_lock = INT_MIN; + input->dwt = INT_MIN; + input->send_events = INT_MIN; + input->click_method = INT_MIN; + input->middle_emulation = INT_MIN; + input->natural_scroll = INT_MIN; + input->accel_profile = INT_MIN; + input->pointer_accel = FLT_MIN; + input->scroll_method = INT_MIN; + input->left_handed = INT_MIN; + + return input; +} + void merge_input_config(struct input_config *dst, struct input_config *src) { if (src->identifier) { if (dst->identifier) { @@ -453,6 +481,7 @@ bool load_include_configs(const char *path, struct sway_config *config) { return true; } + bool read_config(FILE *file, struct sway_config *config) { bool success = true; enum cmd_status block = CMD_BLOCK_END; -- cgit v1.2.3-54-g00ecf