aboutsummaryrefslogtreecommitdiffstats
path: root/include/sway/commands.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sway/commands.h')
-rw-r--r--include/sway/commands.h45
1 files changed, 23 insertions, 22 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h
index 660da2c2..dbebaa49 100644
--- a/include/sway/commands.h
+++ b/include/sway/commands.h
@@ -1,12 +1,7 @@
1#ifndef _SWAY_COMMANDS_H 1#ifndef _SWAY_COMMANDS_H
2#define _SWAY_COMMANDS_H 2#define _SWAY_COMMANDS_H
3#include <stdbool.h>
4#include <json-c/json.h>
5#include <wlc/wlc.h>
6#include "config.h"
7 3
8// Container that a called command should act upon. Only valid in command functions. 4#include "config.h"
9extern swayc_t *current_container;
10 5
11/** 6/**
12 * Indicates the result of a command's execution. 7 * Indicates the result of a command's execution.
@@ -22,6 +17,7 @@ enum cmd_status {
22 CMD_BLOCK_BAR, 17 CMD_BLOCK_BAR,
23 CMD_BLOCK_BAR_COLORS, 18 CMD_BLOCK_BAR_COLORS,
24 CMD_BLOCK_INPUT, 19 CMD_BLOCK_INPUT,
20 CMD_BLOCK_SEAT,
25 CMD_BLOCK_COMMANDS, 21 CMD_BLOCK_COMMANDS,
26 CMD_BLOCK_IPC, 22 CMD_BLOCK_IPC,
27 CMD_BLOCK_IPC_EVENTS, 23 CMD_BLOCK_IPC_EVENTS,
@@ -46,18 +42,13 @@ enum expected_args {
46 EXPECTED_EQUAL_TO 42 EXPECTED_EQUAL_TO
47}; 43};
48 44
49struct cmd_results *checkarg(int argc, const char *name, enum expected_args type, int val); 45struct cmd_results *checkarg(int argc, const char *name,
50struct cmd_results *add_color(const char*, char*, const char*); 46 enum expected_args type, int val);
51void input_cmd_apply(struct input_config *input);
52void hide_view_in_scratchpad(swayc_t *sp_view);
53
54swayc_t *sp_view;
55int sp_index;
56 47
57/** 48/**
58 * Parse and handles a command. 49 * Parse and executes a command.
59 */ 50 */
60struct cmd_results *handle_command(char *command, enum command_context context); 51struct cmd_results *execute_command(char *command, struct sway_seat *seat);
61/** 52/**
62 * Parse and handles a command during config file loading. 53 * Parse and handles a command during config file loading.
63 * 54 *
@@ -68,7 +59,6 @@ struct cmd_results *config_command(char *command, enum cmd_status block);
68 * Parses a command policy rule. 59 * Parses a command policy rule.
69 */ 60 */
70struct cmd_results *config_commands_command(char *exec); 61struct cmd_results *config_commands_command(char *exec);
71
72/** 62/**
73 * Allocates a cmd_results object. 63 * Allocates a cmd_results object.
74 */ 64 */
@@ -84,11 +74,8 @@ void free_cmd_results(struct cmd_results *results);
84 */ 74 */
85const char *cmd_results_to_json(struct cmd_results *results); 75const char *cmd_results_to_json(struct cmd_results *results);
86 76
87void remove_view_from_scratchpad(swayc_t *); 77struct cmd_results *add_color(const char *name,
88 78 char *buffer, const char *color);
89/**
90 * Actual command function signatures for individual .c files in commands/ directory.
91 */
92 79
93typedef struct cmd_results *sway_cmd(int argc, char **argv); 80typedef struct cmd_results *sway_cmd(int argc, char **argv);
94 81
@@ -108,6 +95,7 @@ sway_cmd cmd_commands;
108sway_cmd cmd_debuglog; 95sway_cmd cmd_debuglog;
109sway_cmd cmd_default_border; 96sway_cmd cmd_default_border;
110sway_cmd cmd_default_floating_border; 97sway_cmd cmd_default_floating_border;
98sway_cmd cmd_default_orientation;
111sway_cmd cmd_exec; 99sway_cmd cmd_exec;
112sway_cmd cmd_exec_always; 100sway_cmd cmd_exec_always;
113sway_cmd cmd_exit; 101sway_cmd cmd_exit;
@@ -126,6 +114,7 @@ sway_cmd cmd_gaps;
126sway_cmd cmd_hide_edge_borders; 114sway_cmd cmd_hide_edge_borders;
127sway_cmd cmd_include; 115sway_cmd cmd_include;
128sway_cmd cmd_input; 116sway_cmd cmd_input;
117sway_cmd cmd_seat;
129sway_cmd cmd_ipc; 118sway_cmd cmd_ipc;
130sway_cmd cmd_kill; 119sway_cmd cmd_kill;
131sway_cmd cmd_layout; 120sway_cmd cmd_layout;
@@ -134,10 +123,10 @@ sway_cmd cmd_mark;
134sway_cmd cmd_mode; 123sway_cmd cmd_mode;
135sway_cmd cmd_mouse_warping; 124sway_cmd cmd_mouse_warping;
136sway_cmd cmd_move; 125sway_cmd cmd_move;
126sway_cmd cmd_opacity;
137sway_cmd cmd_new_float; 127sway_cmd cmd_new_float;
138sway_cmd cmd_new_window; 128sway_cmd cmd_new_window;
139sway_cmd cmd_no_focus; 129sway_cmd cmd_no_focus;
140sway_cmd cmd_orientation;
141sway_cmd cmd_output; 130sway_cmd cmd_output;
142sway_cmd cmd_permit; 131sway_cmd cmd_permit;
143sway_cmd cmd_reject; 132sway_cmd cmd_reject;
@@ -153,6 +142,7 @@ sway_cmd cmd_splith;
153sway_cmd cmd_splitt; 142sway_cmd cmd_splitt;
154sway_cmd cmd_splitv; 143sway_cmd cmd_splitv;
155sway_cmd cmd_sticky; 144sway_cmd cmd_sticky;
145sway_cmd cmd_swaybg_command;
156sway_cmd cmd_unmark; 146sway_cmd cmd_unmark;
157sway_cmd cmd_workspace; 147sway_cmd cmd_workspace;
158sway_cmd cmd_ws_auto_back_and_forth; 148sway_cmd cmd_ws_auto_back_and_forth;
@@ -195,17 +185,28 @@ sway_cmd bar_colors_cmd_statusline;
195sway_cmd bar_colors_cmd_focused_statusline; 185sway_cmd bar_colors_cmd_focused_statusline;
196sway_cmd bar_colors_cmd_urgent_workspace; 186sway_cmd bar_colors_cmd_urgent_workspace;
197 187
188sway_cmd input_cmd_seat;
198sway_cmd input_cmd_accel_profile; 189sway_cmd input_cmd_accel_profile;
199sway_cmd input_cmd_click_method; 190sway_cmd input_cmd_click_method;
200sway_cmd input_cmd_drag_lock; 191sway_cmd input_cmd_drag_lock;
201sway_cmd input_cmd_dwt; 192sway_cmd input_cmd_dwt;
202sway_cmd input_cmd_events; 193sway_cmd input_cmd_events;
203sway_cmd input_cmd_left_handed; 194sway_cmd input_cmd_left_handed;
195sway_cmd input_cmd_map_to_output;
204sway_cmd input_cmd_middle_emulation; 196sway_cmd input_cmd_middle_emulation;
205sway_cmd input_cmd_natural_scroll; 197sway_cmd input_cmd_natural_scroll;
206sway_cmd input_cmd_pointer_accel; 198sway_cmd input_cmd_pointer_accel;
207sway_cmd input_cmd_scroll_method; 199sway_cmd input_cmd_scroll_method;
208sway_cmd input_cmd_tap; 200sway_cmd input_cmd_tap;
201sway_cmd input_cmd_xkb_layout;
202sway_cmd input_cmd_xkb_model;
203sway_cmd input_cmd_xkb_options;
204sway_cmd input_cmd_xkb_rules;
205sway_cmd input_cmd_xkb_variant;
206
207sway_cmd seat_cmd_attach;
208sway_cmd seat_cmd_fallback;
209sway_cmd seat_cmd_cursor;
209 210
210sway_cmd cmd_ipc_cmd; 211sway_cmd cmd_ipc_cmd;
211sway_cmd cmd_ipc_events; 212sway_cmd cmd_ipc_events;