From b374c35758777f98e5ddbe4b0dc43bd7c80f36d7 Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Thu, 1 Sep 2016 21:39:08 -0500 Subject: refactor commands.c --- sway/commands/bind.c | 146 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sway/commands/bind.c (limited to 'sway/commands/bind.c') diff --git a/sway/commands/bind.c b/sway/commands/bind.c new file mode 100644 index 00000000..b511f082 --- /dev/null +++ b/sway/commands/bind.c @@ -0,0 +1,146 @@ +#include +#include +#include "commands.h" +#include "config.h" +#include "list.h" +#include "log.h" +#include "stringop.h" +#include "util.h" + +int binding_order = 0; + +struct cmd_results *cmd_bindsym(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "bindsym", EXPECTED_MORE_THAN, 1))) { + return error; + } + + struct sway_binding *binding = malloc(sizeof(struct sway_binding)); + binding->keys = create_list(); + binding->modifiers = 0; + binding->release = false; + binding->bindcode = false; + + // Handle --release + if (strcmp("--release", argv[0]) == 0) { + if (argc >= 3) { + binding->release = true; + argv++; + argc--; + } else { + free_sway_binding(binding); + return cmd_results_new(CMD_FAILURE, "bindsym", + "Invalid bindsym command " + "(expected more than 2 arguments, got %d)", argc); + } + } + + binding->command = join_args(argv + 1, argc - 1); + + list_t *split = split_string(argv[0], "+"); + for (int i = 0; i < split->length; ++i) { + // Check for a modifier key + uint32_t mod; + if ((mod = get_modifier_mask_by_name(split->items[i])) > 0) { + binding->modifiers |= mod; + continue; + } + // Check for xkb key + xkb_keysym_t sym = xkb_keysym_from_name(split->items[i], XKB_KEYSYM_CASE_INSENSITIVE); + if (!sym) { + error = cmd_results_new(CMD_INVALID, "bindsym", "Unknown key '%s'", (char *)split->items[i]); + free_sway_binding(binding); + list_free(split); + return error; + } + xkb_keysym_t *key = malloc(sizeof(xkb_keysym_t)); + *key = sym; + list_add(binding->keys, key); + } + free_flat_list(split); + + struct sway_mode *mode = config->current_mode; + int i = list_seq_find(mode->bindings, sway_binding_cmp_keys, binding); + if (i > -1) { + sway_log(L_DEBUG, "bindsym - '%s' already exists, overwriting", argv[0]); + struct sway_binding *dup = mode->bindings->items[i]; + free_sway_binding(dup); + list_del(mode->bindings, i); + } + binding->order = binding_order++; + list_add(mode->bindings, binding); + list_qsort(mode->bindings, sway_binding_cmp_qsort); + + sway_log(L_DEBUG, "bindsym - Bound %s to command %s", argv[0], binding->command); + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} + +struct cmd_results *cmd_bindcode(int argc, char **argv) { + struct cmd_results *error = NULL; + if ((error = checkarg(argc, "bindcode", EXPECTED_MORE_THAN, 1))) { + return error; + } + + struct sway_binding *binding = malloc(sizeof(struct sway_binding)); + binding->keys = create_list(); + binding->modifiers = 0; + binding->release = false; + binding->bindcode = true; + + // Handle --release + if (strcmp("--release", argv[0]) == 0) { + if (argc >= 3) { + binding->release = true; + argv++; + argc--; + } else { + free_sway_binding(binding); + return cmd_results_new(CMD_FAILURE, "bindcode", + "Invalid bindcode command " + "(expected more than 2 arguments, got %d)", argc); + } + } + + binding->command = join_args(argv + 1, argc - 1); + + list_t *split = split_string(argv[0], "+"); + for (int i = 0; i < split->length; ++i) { + // Check for a modifier key + uint32_t mod; + if ((mod = get_modifier_mask_by_name(split->items[i])) > 0) { + binding->modifiers |= mod; + continue; + } + // parse keycode + xkb_keycode_t keycode = (int)strtol(split->items[i], NULL, 10); + if (!xkb_keycode_is_legal_ext(keycode)) { + error = cmd_results_new(CMD_INVALID, "bindcode", "Invalid keycode '%s'", (char *)split->items[i]); + free_sway_binding(binding); + list_free(split); + return error; + } + xkb_keycode_t *key = malloc(sizeof(xkb_keycode_t)); + *key = keycode - 8; + list_add(binding->keys, key); + } + free_flat_list(split); + + struct sway_mode *mode = config->current_mode; + int i = list_seq_find(mode->bindings, sway_binding_cmp_keys, binding); + if (i > -1) { + struct sway_binding *dup = mode->bindings->items[i]; + if (dup->bindcode) { + sway_log(L_DEBUG, "bindcode - '%s' already exists, overwriting", argv[0]); + } else { + sway_log(L_DEBUG, "bindcode - '%s' already exists as bindsym, overwriting", argv[0]); + } + free_sway_binding(dup); + list_del(mode->bindings, i); + } + binding->order = binding_order++; + list_add(mode->bindings, binding); + list_qsort(mode->bindings, sway_binding_cmp_qsort); + + sway_log(L_DEBUG, "bindcode - Bound %s to command %s", argv[0], binding->command); + return cmd_results_new(CMD_SUCCESS, NULL, NULL); +} -- cgit v1.2.3 From 65ace5dec5c24695501056376e227fb9b1f84a3a Mon Sep 17 00:00:00 2001 From: Zandr Martin Date: Fri, 2 Sep 2016 14:11:48 -0500 Subject: merge in latest commits --- sway/commands/assign.c | 4 ++-- sway/commands/bar.c | 4 ++-- sway/commands/bar/binding_mode_indicator.c | 2 +- sway/commands/bar/bindsym.c | 4 ++-- sway/commands/bar/colors.c | 2 +- sway/commands/bar/font.c | 2 +- sway/commands/bar/height.c | 2 +- sway/commands/bar/hidden_state.c | 6 +++--- sway/commands/bar/id.c | 2 +- sway/commands/bar/mode.c | 6 +++--- sway/commands/bar/modifier.c | 2 +- sway/commands/bar/output.c | 2 +- sway/commands/bar/pango_markup.c | 2 +- sway/commands/bar/position.c | 2 +- sway/commands/bar/separator_symbol.c | 2 +- sway/commands/bar/status_command.c | 2 +- sway/commands/bar/strip_workspace_numbers.c | 2 +- sway/commands/bar/swaybar_command.c | 2 +- sway/commands/bar/tray_output.c | 2 +- sway/commands/bar/tray_padding.c | 2 +- sway/commands/bar/workspace_buttons.c | 2 +- sway/commands/bar/wrap_scroll.c | 2 +- sway/commands/bind.c | 4 ++-- sway/commands/border.c | 6 +++--- sway/commands/client.c | 2 +- sway/commands/debuglog.c | 2 +- sway/commands/exec.c | 2 +- sway/commands/exec_always.c | 4 ++-- sway/commands/exit.c | 4 ++-- sway/commands/floating.c | 8 ++++---- sway/commands/floating_maximum_size.c | 2 +- sway/commands/floating_minimum_size.c | 2 +- sway/commands/floating_mod.c | 4 ++-- sway/commands/floating_scroll.c | 2 +- sway/commands/focus.c | 12 ++++++------ sway/commands/focus_follows_mouse.c | 2 +- sway/commands/font.c | 4 ++-- sway/commands/for_window.c | 4 ++-- sway/commands/fullscreen.c | 10 +++++----- sway/commands/gaps.c | 8 ++++---- sway/commands/hide_edge_borders.c | 2 +- sway/commands/include.c | 4 ++-- sway/commands/input.c | 4 ++-- sway/commands/input/accel_profile.c | 4 ++-- sway/commands/input/click_method.c | 4 ++-- sway/commands/input/drag_lock.c | 4 ++-- sway/commands/input/dwt.c | 4 ++-- sway/commands/input/events.c | 4 ++-- sway/commands/input/middle_emulation.c | 4 ++-- sway/commands/input/natural_scroll.c | 4 ++-- sway/commands/input/pointer_accel.c | 4 ++-- sway/commands/input/scroll_method.c | 4 ++-- sway/commands/input/tap.c | 4 ++-- sway/commands/kill.c | 6 +++--- sway/commands/layout.c | 6 +++--- sway/commands/log_colors.c | 2 +- sway/commands/mode.c | 6 +++--- sway/commands/mouse_warping.c | 2 +- sway/commands/move.c | 10 +++++----- sway/commands/new_float.c | 4 ++-- sway/commands/new_window.c | 4 ++-- sway/commands/orientation.c | 2 +- sway/commands/output.c | 4 ++-- sway/commands/reload.c | 6 +++--- sway/commands/resize.c | 4 ++-- sway/commands/scratchpad.c | 8 ++++---- sway/commands/seamless_mouse.c | 2 +- sway/commands/set.c | 4 ++-- sway/commands/smart_gaps.c | 2 +- sway/commands/split.c | 10 +++++----- sway/commands/sticky.c | 4 ++-- sway/commands/workspace.c | 8 ++++---- sway/commands/workspace_auto_back_and_forth.c | 2 +- sway/commands/workspace_layout.c | 2 +- 74 files changed, 144 insertions(+), 144 deletions(-) (limited to 'sway/commands/bind.c') diff --git a/sway/commands/assign.c b/sway/commands/assign.c index 31e949fb..53c599ca 100644 --- a/sway/commands/assign.c +++ b/sway/commands/assign.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "criteria.h" +#include "sway/commands.h" +#include "sway/criteria.h" #include "list.h" #include "log.h" diff --git a/sway/commands/bar.c b/sway/commands/bar.c index 9e7d6c5c..55cb0d9d 100644 --- a/sway/commands/bar.c +++ b/sway/commands/bar.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "log.h" #include "util.h" diff --git a/sway/commands/bar/binding_mode_indicator.c b/sway/commands/bar/binding_mode_indicator.c index be72cb9b..6f67e15d 100644 --- a/sway/commands/bar/binding_mode_indicator.c +++ b/sway/commands/bar/binding_mode_indicator.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_binding_mode_indicator(int argc, char **argv) { diff --git a/sway/commands/bar/bindsym.c b/sway/commands/bar/bindsym.c index 4f50e708..bb81b4a9 100644 --- a/sway/commands/bar/bindsym.c +++ b/sway/commands/bar/bindsym.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "list.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/bar/colors.c b/sway/commands/bar/colors.c index d33a323e..9e374d88 100644 --- a/sway/commands/bar/colors.c +++ b/sway/commands/bar/colors.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *bar_cmd_colors(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/bar/font.c b/sway/commands/bar/font.c index afc542d2..c586c5bc 100644 --- a/sway/commands/bar/font.c +++ b/sway/commands/bar/font.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/bar/height.c b/sway/commands/bar/height.c index 9ea0a81a..eb576ab3 100644 --- a/sway/commands/bar/height.c +++ b/sway/commands/bar/height.c @@ -1,6 +1,6 @@ #include #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_height(int argc, char **argv) { diff --git a/sway/commands/bar/hidden_state.c b/sway/commands/bar/hidden_state.c index 22035c98..e52a123f 100644 --- a/sway/commands/bar/hidden_state.c +++ b/sway/commands/bar/hidden_state.c @@ -1,7 +1,7 @@ #include -#include "commands.h" -#include "config.h" -#include "ipc-server.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/ipc-server.h" #include "log.h" static struct cmd_results *bar_set_hidden_state(struct bar_config *bar, const char *hidden_state) { diff --git a/sway/commands/bar/id.c b/sway/commands/bar/id.c index 6ca9f6b6..d62a0961 100644 --- a/sway/commands/bar/id.c +++ b/sway/commands/bar/id.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_id(int argc, char **argv) { diff --git a/sway/commands/bar/mode.c b/sway/commands/bar/mode.c index 321d5a29..3fd6587f 100644 --- a/sway/commands/bar/mode.c +++ b/sway/commands/bar/mode.c @@ -1,7 +1,7 @@ #include -#include "commands.h" -#include "config.h" -#include "ipc-server.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/ipc-server.h" #include "log.h" static struct cmd_results *bar_set_mode(struct bar_config *bar, const char *mode) { diff --git a/sway/commands/bar/modifier.c b/sway/commands/bar/modifier.c index 7d4501c7..153d87e6 100644 --- a/sway/commands/bar/modifier.c +++ b/sway/commands/bar/modifier.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" #include "util.h" diff --git a/sway/commands/bar/output.c b/sway/commands/bar/output.c index 9a0d7a73..01a23d9c 100644 --- a/sway/commands/bar/output.c +++ b/sway/commands/bar/output.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "list.h" #include "log.h" diff --git a/sway/commands/bar/pango_markup.c b/sway/commands/bar/pango_markup.c index fcc38d13..69213c7b 100644 --- a/sway/commands/bar/pango_markup.c +++ b/sway/commands/bar/pango_markup.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_pango_markup(int argc, char **argv) { diff --git a/sway/commands/bar/position.c b/sway/commands/bar/position.c index 6f97062f..4d0171ba 100644 --- a/sway/commands/bar/position.c +++ b/sway/commands/bar/position.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_position(int argc, char **argv) { diff --git a/sway/commands/bar/separator_symbol.c b/sway/commands/bar/separator_symbol.c index 16c455e7..2249da52 100644 --- a/sway/commands/bar/separator_symbol.c +++ b/sway/commands/bar/separator_symbol.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_separator_symbol(int argc, char **argv) { diff --git a/sway/commands/bar/status_command.c b/sway/commands/bar/status_command.c index ec91e9f7..b227ac47 100644 --- a/sway/commands/bar/status_command.c +++ b/sway/commands/bar/status_command.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/bar/strip_workspace_numbers.c b/sway/commands/bar/strip_workspace_numbers.c index 7a709e4b..7cd19d60 100644 --- a/sway/commands/bar/strip_workspace_numbers.c +++ b/sway/commands/bar/strip_workspace_numbers.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_strip_workspace_numbers(int argc, char **argv) { diff --git a/sway/commands/bar/swaybar_command.c b/sway/commands/bar/swaybar_command.c index 1f28184a..452e2df5 100644 --- a/sway/commands/bar/swaybar_command.c +++ b/sway/commands/bar/swaybar_command.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/bar/tray_output.c b/sway/commands/bar/tray_output.c index 39b571d0..8a1b5d35 100644 --- a/sway/commands/bar/tray_output.c +++ b/sway/commands/bar/tray_output.c @@ -1,4 +1,4 @@ -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_tray_output(int argc, char **argv) { diff --git a/sway/commands/bar/tray_padding.c b/sway/commands/bar/tray_padding.c index 978ce0b7..32f8eeba 100644 --- a/sway/commands/bar/tray_padding.c +++ b/sway/commands/bar/tray_padding.c @@ -1,6 +1,6 @@ #include #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_tray_padding(int argc, char **argv) { diff --git a/sway/commands/bar/workspace_buttons.c b/sway/commands/bar/workspace_buttons.c index ce37fde9..a0e0549d 100644 --- a/sway/commands/bar/workspace_buttons.c +++ b/sway/commands/bar/workspace_buttons.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_workspace_buttons(int argc, char **argv) { diff --git a/sway/commands/bar/wrap_scroll.c b/sway/commands/bar/wrap_scroll.c index 0a5fbf93..caa85660 100644 --- a/sway/commands/bar/wrap_scroll.c +++ b/sway/commands/bar/wrap_scroll.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *bar_cmd_wrap_scroll(int argc, char **argv) { diff --git a/sway/commands/bind.c b/sway/commands/bind.c index b511f082..e8bb3ee8 100644 --- a/sway/commands/bind.c +++ b/sway/commands/bind.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "list.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/border.c b/sway/commands/border.c index 30798c6d..68ae58a6 100644 --- a/sway/commands/border.c +++ b/sway/commands/border.c @@ -1,9 +1,9 @@ #include #include #include -#include "commands.h" -#include "container.h" -#include "focus.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" struct cmd_results *cmd_border(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/client.c b/sway/commands/client.c index 993fa2f8..7954f670 100644 --- a/sway/commands/client.c +++ b/sway/commands/client.c @@ -1,6 +1,6 @@ #include #include -#include "commands.h" +#include "sway/commands.h" static struct cmd_results *parse_border_color(struct border_colors *border_colors, const char *cmd_name, int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/debuglog.c b/sway/commands/debuglog.c index 55749797..76192fb0 100644 --- a/sway/commands/debuglog.c +++ b/sway/commands/debuglog.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *cmd_debuglog(int argc, char **argv) { diff --git a/sway/commands/exec.c b/sway/commands/exec.c index a84ad797..58ef5f94 100644 --- a/sway/commands/exec.c +++ b/sway/commands/exec.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/exec_always.c b/sway/commands/exec_always.c index dbac9f9a..157d4872 100644 --- a/sway/commands/exec_always.c +++ b/sway/commands/exec_always.c @@ -1,8 +1,8 @@ #include #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/exit.c b/sway/commands/exit.c index fe3212a4..f192f86a 100644 --- a/sway/commands/exit.c +++ b/sway/commands/exit.c @@ -1,5 +1,5 @@ -#include "commands.h" -#include "container.h" +#include "sway/commands.h" +#include "sway/container.h" void sway_terminate(int exit_code); diff --git a/sway/commands/floating.c b/sway/commands/floating.c index 2323902d..612b8641 100644 --- a/sway/commands/floating.c +++ b/sway/commands/floating.c @@ -1,8 +1,8 @@ #include -#include "commands.h" -#include "container.h" -#include "ipc-server.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/ipc-server.h" +#include "sway/layout.h" #include "list.h" #include "log.h" diff --git a/sway/commands/floating_maximum_size.c b/sway/commands/floating_maximum_size.c index 1728433f..5bca4d7c 100644 --- a/sway/commands/floating_maximum_size.c +++ b/sway/commands/floating_maximum_size.c @@ -1,6 +1,6 @@ #include #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *cmd_floating_maximum_size(int argc, char **argv) { diff --git a/sway/commands/floating_minimum_size.c b/sway/commands/floating_minimum_size.c index 743e9b8f..ba72454c 100644 --- a/sway/commands/floating_minimum_size.c +++ b/sway/commands/floating_minimum_size.c @@ -1,6 +1,6 @@ #include #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *cmd_floating_minimum_size(int argc, char **argv) { diff --git a/sway/commands/floating_mod.c b/sway/commands/floating_mod.c index ce463429..b6360d9a 100644 --- a/sway/commands/floating_mod.c +++ b/sway/commands/floating_mod.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input_state.h" +#include "sway/commands.h" +#include "sway/input_state.h" #include "list.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/floating_scroll.c b/sway/commands/floating_scroll.c index a9ef2c21..5705cfee 100644 --- a/sway/commands/floating_scroll.c +++ b/sway/commands/floating_scroll.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/focus.c b/sway/commands/focus.c index 18552292..8442305f 100644 --- a/sway/commands/focus.c +++ b/sway/commands/focus.c @@ -1,11 +1,11 @@ #include #include -#include "commands.h" -#include "container.h" -#include "focus.h" -#include "input_state.h" -#include "output.h" -#include "workspace.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" +#include "sway/input_state.h" +#include "sway/output.h" +#include "sway/workspace.h" struct cmd_results *cmd_focus(int argc, char **argv) { if (config->reading) return cmd_results_new(CMD_FAILURE, "focus", "Can't be used in config file."); diff --git a/sway/commands/focus_follows_mouse.c b/sway/commands/focus_follows_mouse.c index 25147b2a..8ccefa59 100644 --- a/sway/commands/focus_follows_mouse.c +++ b/sway/commands/focus_follows_mouse.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_focus_follows_mouse(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/font.c b/sway/commands/font.c index 52502a2d..1ee06396 100644 --- a/sway/commands/font.c +++ b/sway/commands/font.c @@ -1,6 +1,6 @@ #include -#include "border.h" -#include "commands.h" +#include "sway/border.h" +#include "sway/commands.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/for_window.c b/sway/commands/for_window.c index 49badd34..2ba0ea6c 100644 --- a/sway/commands/for_window.c +++ b/sway/commands/for_window.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "criteria.h" +#include "sway/commands.h" +#include "sway/criteria.h" #include "list.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/fullscreen.c b/sway/commands/fullscreen.c index 83bbc66f..321d6f59 100644 --- a/sway/commands/fullscreen.c +++ b/sway/commands/fullscreen.c @@ -1,11 +1,11 @@ #include #include #include -#include "commands.h" -#include "container.h" -#include "focus.h" -#include "ipc-server.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" +#include "sway/ipc-server.h" +#include "sway/layout.h" struct cmd_results *cmd_fullscreen(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/gaps.c b/sway/commands/gaps.c index 81ca14f4..fe06add4 100644 --- a/sway/commands/gaps.c +++ b/sway/commands/gaps.c @@ -2,10 +2,10 @@ #include #include #include -#include "commands.h" -#include "container.h" -#include "focus.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" +#include "sway/layout.h" struct cmd_results *cmd_gaps(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/hide_edge_borders.c b/sway/commands/hide_edge_borders.c index 7bb792dd..0be940c1 100644 --- a/sway/commands/hide_edge_borders.c +++ b/sway/commands/hide_edge_borders.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_hide_edge_borders(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/include.c b/sway/commands/include.c index e5f0a7ec..1ba9a10d 100644 --- a/sway/commands/include.c +++ b/sway/commands/include.c @@ -1,5 +1,5 @@ -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" struct cmd_results *cmd_include(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input.c b/sway/commands/input.c index 5df63b0d..9c9d7600 100644 --- a/sway/commands/input.c +++ b/sway/commands/input.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" #include "log.h" struct cmd_results *cmd_input(int argc, char **argv) { diff --git a/sway/commands/input/accel_profile.c b/sway/commands/input/accel_profile.c index bfc3c76d..290129f5 100644 --- a/sway/commands/input/accel_profile.c +++ b/sway/commands/input/accel_profile.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_accel_profile(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/click_method.c b/sway/commands/input/click_method.c index 2001acf2..0a7b7d23 100644 --- a/sway/commands/input/click_method.c +++ b/sway/commands/input/click_method.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" #include "log.h" struct cmd_results *input_cmd_click_method(int argc, char **argv) { diff --git a/sway/commands/input/drag_lock.c b/sway/commands/input/drag_lock.c index 7bb2e334..0d100dd0 100644 --- a/sway/commands/input/drag_lock.c +++ b/sway/commands/input/drag_lock.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_drag_lock(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/dwt.c b/sway/commands/input/dwt.c index 4010126d..82013730 100644 --- a/sway/commands/input/dwt.c +++ b/sway/commands/input/dwt.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_dwt(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/events.c b/sway/commands/input/events.c index 9bf9aa95..2f13e30a 100644 --- a/sway/commands/input/events.c +++ b/sway/commands/input/events.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" #include "log.h" struct cmd_results *input_cmd_events(int argc, char **argv) { diff --git a/sway/commands/input/middle_emulation.c b/sway/commands/input/middle_emulation.c index e3087f3a..b2e55468 100644 --- a/sway/commands/input/middle_emulation.c +++ b/sway/commands/input/middle_emulation.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_middle_emulation(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/natural_scroll.c b/sway/commands/input/natural_scroll.c index 393f26a0..ac8cec12 100644 --- a/sway/commands/input/natural_scroll.c +++ b/sway/commands/input/natural_scroll.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_natural_scroll(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/pointer_accel.c b/sway/commands/input/pointer_accel.c index e22c51c1..94f595d1 100644 --- a/sway/commands/input/pointer_accel.c +++ b/sway/commands/input/pointer_accel.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_pointer_accel(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/scroll_method.c b/sway/commands/input/scroll_method.c index 8e900a26..de032b64 100644 --- a/sway/commands/input/scroll_method.c +++ b/sway/commands/input/scroll_method.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" struct cmd_results *input_cmd_scroll_method(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/input/tap.c b/sway/commands/input/tap.c index 8180dcea..9b559447 100644 --- a/sway/commands/input/tap.c +++ b/sway/commands/input/tap.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "input.h" +#include "sway/commands.h" +#include "sway/input.h" #include "log.h" struct cmd_results *input_cmd_tap(int argc, char **argv) { diff --git a/sway/commands/kill.c b/sway/commands/kill.c index ce164e34..2e94fb10 100644 --- a/sway/commands/kill.c +++ b/sway/commands/kill.c @@ -1,6 +1,6 @@ -#include "commands.h" -#include "container.h" -#include "focus.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" struct cmd_results *cmd_kill(int argc, char **argv) { if (config->reading) return cmd_results_new(CMD_FAILURE, "kill", "Can't be used in config file."); diff --git a/sway/commands/layout.c b/sway/commands/layout.c index c4f5d2b5..e0af30aa 100644 --- a/sway/commands/layout.c +++ b/sway/commands/layout.c @@ -1,7 +1,7 @@ #include -#include "commands.h" -#include "container.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/layout.h" struct cmd_results *cmd_layout(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/log_colors.c b/sway/commands/log_colors.c index 8e6d01ca..6ef99da7 100644 --- a/sway/commands/log_colors.c +++ b/sway/commands/log_colors.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" #include "log.h" struct cmd_results *cmd_log_colors(int argc, char **argv) { diff --git a/sway/commands/mode.c b/sway/commands/mode.c index 05636c61..f9cb271e 100644 --- a/sway/commands/mode.c +++ b/sway/commands/mode.c @@ -1,8 +1,8 @@ #include #include -#include "commands.h" -#include "config.h" -#include "ipc-server.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/ipc-server.h" #include "list.h" #include "log.h" diff --git a/sway/commands/mouse_warping.c b/sway/commands/mouse_warping.c index 2d81febd..ef71d595 100644 --- a/sway/commands/mouse_warping.c +++ b/sway/commands/mouse_warping.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_mouse_warping(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/move.c b/sway/commands/move.c index 68f05b56..5b97897a 100644 --- a/sway/commands/move.c +++ b/sway/commands/move.c @@ -1,11 +1,11 @@ #include #include -#include "commands.h" -#include "container.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/layout.h" +#include "sway/output.h" +#include "sway/workspace.h" #include "list.h" -#include "output.h" -#include "workspace.h" struct cmd_results *cmd_move(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/new_float.c b/sway/commands/new_float.c index f847492a..8e4e354f 100644 --- a/sway/commands/new_float.c +++ b/sway/commands/new_float.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "container.h" +#include "sway/commands.h" +#include "sway/container.h" struct cmd_results *cmd_new_float(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/new_window.c b/sway/commands/new_window.c index e7d1b271..423b5af0 100644 --- a/sway/commands/new_window.c +++ b/sway/commands/new_window.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "container.h" +#include "sway/commands.h" +#include "sway/container.h" struct cmd_results *cmd_new_window(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/orientation.c b/sway/commands/orientation.c index b1fc328d..b6d7202e 100644 --- a/sway/commands/orientation.c +++ b/sway/commands/orientation.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_orientation(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/output.c b/sway/commands/output.c index a2f19f38..6c1c55b5 100644 --- a/sway/commands/output.c +++ b/sway/commands/output.c @@ -4,8 +4,8 @@ #include #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "list.h" #include "log.h" #include "stringop.h" diff --git a/sway/commands/reload.c b/sway/commands/reload.c index 571ae986..01fcc5ba 100644 --- a/sway/commands/reload.c +++ b/sway/commands/reload.c @@ -1,6 +1,6 @@ -#include "commands.h" -#include "config.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/layout.h" struct cmd_results *cmd_reload(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/resize.c b/sway/commands/resize.c index b5585920..90ab824f 100644 --- a/sway/commands/resize.c +++ b/sway/commands/resize.c @@ -2,9 +2,9 @@ #include #include #include -#include "commands.h" +#include "sway/commands.h" +#include "sway/resize.h" #include "log.h" -#include "resize.h" static struct cmd_results *cmd_resize_set(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/scratchpad.c b/sway/commands/scratchpad.c index 8cde85a0..d43ef82d 100644 --- a/sway/commands/scratchpad.c +++ b/sway/commands/scratchpad.c @@ -1,9 +1,9 @@ #include #include -#include "commands.h" -#include "container.h" -#include "focus.h" -#include "layout.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" +#include "sway/layout.h" static swayc_t *fetch_view_from_scratchpad() { if (sp_index >= scratchpad->length) { diff --git a/sway/commands/seamless_mouse.c b/sway/commands/seamless_mouse.c index 541c44b0..4d4bcc02 100644 --- a/sway/commands/seamless_mouse.c +++ b/sway/commands/seamless_mouse.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_seamless_mouse(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/set.c b/sway/commands/set.c index b82a30ac..1f324951 100644 --- a/sway/commands/set.c +++ b/sway/commands/set.c @@ -1,7 +1,7 @@ #include #include -#include "commands.h" -#include "config.h" +#include "sway/commands.h" +#include "sway/config.h" #include "list.h" #include "stringop.h" diff --git a/sway/commands/smart_gaps.c b/sway/commands/smart_gaps.c index d1266a13..bd50d6bc 100644 --- a/sway/commands/smart_gaps.c +++ b/sway/commands/smart_gaps.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_smart_gaps(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/split.c b/sway/commands/split.c index b13c9213..9ff1d638 100644 --- a/sway/commands/split.c +++ b/sway/commands/split.c @@ -1,10 +1,10 @@ #include #include -#include "border.h" -#include "commands.h" -#include "container.h" -#include "focus.h" -#include "layout.h" +#include "sway/border.h" +#include "sway/commands.h" +#include "sway/container.h" +#include "sway/focus.h" +#include "sway/layout.h" #include "log.h" static struct cmd_results *_do_split(int argc, char **argv, int layout) { diff --git a/sway/commands/sticky.c b/sway/commands/sticky.c index 00c47123..4899e061 100644 --- a/sway/commands/sticky.c +++ b/sway/commands/sticky.c @@ -1,6 +1,6 @@ #include -#include "commands.h" -#include "focus.h" +#include "sway/commands.h" +#include "sway/focus.h" struct cmd_results *cmd_sticky(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/workspace.c b/sway/commands/workspace.c index 5eaca423..5d4d3d65 100644 --- a/sway/commands/workspace.c +++ b/sway/commands/workspace.c @@ -1,10 +1,10 @@ #include -#include "commands.h" -#include "config.h" -#include "input_state.h" +#include "sway/commands.h" +#include "sway/config.h" +#include "sway/input_state.h" +#include "sway/workspace.h" #include "list.h" #include "log.h" -#include "workspace.h" struct cmd_results *cmd_workspace(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/workspace_auto_back_and_forth.c b/sway/commands/workspace_auto_back_and_forth.c index c099ad0e..22a66678 100644 --- a/sway/commands/workspace_auto_back_and_forth.c +++ b/sway/commands/workspace_auto_back_and_forth.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_ws_auto_back_and_forth(int argc, char **argv) { struct cmd_results *error = NULL; diff --git a/sway/commands/workspace_layout.c b/sway/commands/workspace_layout.c index 2b424916..b7b4b033 100644 --- a/sway/commands/workspace_layout.c +++ b/sway/commands/workspace_layout.c @@ -1,5 +1,5 @@ #include -#include "commands.h" +#include "sway/commands.h" struct cmd_results *cmd_workspace_layout(int argc, char **argv) { struct cmd_results *error = NULL; -- cgit v1.2.3