diff options
author | Drew DeVault <sir@cmpwn.com> | 2017-11-18 11:22:02 -0500 |
---|---|---|
committer | Drew DeVault <sir@cmpwn.com> | 2017-11-18 11:22:02 -0500 |
commit | 733993a651c71f7e2198d505960d6bbd31e0e107 (patch) | |
tree | e51732c5872b624e73355f9e5b3f762101f3cd0d /include/sway/commands.h | |
parent | Initial (awful) pass on xdg shell support (diff) | |
download | sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.gz sway-733993a651c71f7e2198d505960d6bbd31e0e107.tar.zst sway-733993a651c71f7e2198d505960d6bbd31e0e107.zip |
Move everything to sway/old/
Diffstat (limited to 'include/sway/commands.h')
-rw-r--r-- | include/sway/commands.h | 214 |
1 files changed, 0 insertions, 214 deletions
diff --git a/include/sway/commands.h b/include/sway/commands.h deleted file mode 100644 index 660da2c2..00000000 --- a/include/sway/commands.h +++ /dev/null | |||
@@ -1,214 +0,0 @@ | |||
1 | #ifndef _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 | |||
8 | // Container that a called command should act upon. Only valid in command functions. | ||
9 | extern swayc_t *current_container; | ||
10 | |||
11 | /** | ||
12 | * Indicates the result of a command's execution. | ||
13 | */ | ||
14 | enum cmd_status { | ||
15 | CMD_SUCCESS, /**< The command was successful */ | ||
16 | CMD_FAILURE, /**< The command resulted in an error */ | ||
17 | CMD_INVALID, /**< Unknown command or parser error */ | ||
18 | CMD_DEFER, /**< Command execution deferred */ | ||
19 | // Config Blocks | ||
20 | CMD_BLOCK_END, | ||
21 | CMD_BLOCK_MODE, | ||
22 | CMD_BLOCK_BAR, | ||
23 | CMD_BLOCK_BAR_COLORS, | ||
24 | CMD_BLOCK_INPUT, | ||
25 | CMD_BLOCK_COMMANDS, | ||
26 | CMD_BLOCK_IPC, | ||
27 | CMD_BLOCK_IPC_EVENTS, | ||
28 | }; | ||
29 | |||
30 | /** | ||
31 | * Stores the result of executing a command. | ||
32 | */ | ||
33 | struct cmd_results { | ||
34 | enum cmd_status status; | ||
35 | char *input; | ||
36 | /** | ||
37 | * Human friendly error message, or NULL on success | ||
38 | */ | ||
39 | char *error; | ||
40 | }; | ||
41 | |||
42 | enum expected_args { | ||
43 | EXPECTED_MORE_THAN, | ||
44 | EXPECTED_AT_LEAST, | ||
45 | EXPECTED_LESS_THAN, | ||
46 | EXPECTED_EQUAL_TO | ||
47 | }; | ||
48 | |||
49 | struct cmd_results *checkarg(int argc, const char *name, enum expected_args type, int val); | ||
50 | struct cmd_results *add_color(const char*, char*, const char*); | ||
51 | void input_cmd_apply(struct input_config *input); | ||
52 | void hide_view_in_scratchpad(swayc_t *sp_view); | ||
53 | |||
54 | swayc_t *sp_view; | ||
55 | int sp_index; | ||
56 | |||
57 | /** | ||
58 | * Parse and handles a command. | ||
59 | */ | ||
60 | struct cmd_results *handle_command(char *command, enum command_context context); | ||
61 | /** | ||
62 | * Parse and handles a command during config file loading. | ||
63 | * | ||
64 | * Do not use this under normal conditions. | ||
65 | */ | ||
66 | struct cmd_results *config_command(char *command, enum cmd_status block); | ||
67 | /* | ||
68 | * Parses a command policy rule. | ||
69 | */ | ||
70 | struct cmd_results *config_commands_command(char *exec); | ||
71 | |||
72 | /** | ||
73 | * Allocates a cmd_results object. | ||
74 | */ | ||
75 | struct cmd_results *cmd_results_new(enum cmd_status status, const char* input, const char *error, ...); | ||
76 | /** | ||
77 | * Frees a cmd_results object. | ||
78 | */ | ||
79 | void free_cmd_results(struct cmd_results *results); | ||
80 | /** | ||
81 | * Serializes cmd_results to a JSON string. | ||
82 | * | ||
83 | * Free the JSON string later on. | ||
84 | */ | ||
85 | const char *cmd_results_to_json(struct cmd_results *results); | ||
86 | |||
87 | void remove_view_from_scratchpad(swayc_t *); | ||
88 | |||
89 | /** | ||
90 | * Actual command function signatures for individual .c files in commands/ directory. | ||
91 | */ | ||
92 | |||
93 | typedef struct cmd_results *sway_cmd(int argc, char **argv); | ||
94 | |||
95 | sway_cmd cmd_assign; | ||
96 | sway_cmd cmd_bar; | ||
97 | sway_cmd cmd_bindcode; | ||
98 | sway_cmd cmd_bindsym; | ||
99 | sway_cmd cmd_border; | ||
100 | sway_cmd cmd_client_focused; | ||
101 | sway_cmd cmd_client_focused_inactive; | ||
102 | sway_cmd cmd_client_unfocused; | ||
103 | sway_cmd cmd_client_urgent; | ||
104 | sway_cmd cmd_client_placeholder; | ||
105 | sway_cmd cmd_client_background; | ||
106 | sway_cmd cmd_clipboard; | ||
107 | sway_cmd cmd_commands; | ||
108 | sway_cmd cmd_debuglog; | ||
109 | sway_cmd cmd_default_border; | ||
110 | sway_cmd cmd_default_floating_border; | ||
111 | sway_cmd cmd_exec; | ||
112 | sway_cmd cmd_exec_always; | ||
113 | sway_cmd cmd_exit; | ||
114 | sway_cmd cmd_floating; | ||
115 | sway_cmd cmd_floating_maximum_size; | ||
116 | sway_cmd cmd_floating_minimum_size; | ||
117 | sway_cmd cmd_floating_mod; | ||
118 | sway_cmd cmd_floating_scroll; | ||
119 | sway_cmd cmd_focus; | ||
120 | sway_cmd cmd_focus_follows_mouse; | ||
121 | sway_cmd cmd_font; | ||
122 | sway_cmd cmd_for_window; | ||
123 | sway_cmd cmd_force_focus_wrapping; | ||
124 | sway_cmd cmd_fullscreen; | ||
125 | sway_cmd cmd_gaps; | ||
126 | sway_cmd cmd_hide_edge_borders; | ||
127 | sway_cmd cmd_include; | ||
128 | sway_cmd cmd_input; | ||
129 | sway_cmd cmd_ipc; | ||
130 | sway_cmd cmd_kill; | ||
131 | sway_cmd cmd_layout; | ||
132 | sway_cmd cmd_log_colors; | ||
133 | sway_cmd cmd_mark; | ||
134 | sway_cmd cmd_mode; | ||
135 | sway_cmd cmd_mouse_warping; | ||
136 | sway_cmd cmd_move; | ||
137 | sway_cmd cmd_new_float; | ||
138 | sway_cmd cmd_new_window; | ||
139 | sway_cmd cmd_no_focus; | ||
140 | sway_cmd cmd_orientation; | ||
141 | sway_cmd cmd_output; | ||
142 | sway_cmd cmd_permit; | ||
143 | sway_cmd cmd_reject; | ||
144 | sway_cmd cmd_reload; | ||
145 | sway_cmd cmd_resize; | ||
146 | sway_cmd cmd_scratchpad; | ||
147 | sway_cmd cmd_seamless_mouse; | ||
148 | sway_cmd cmd_set; | ||
149 | sway_cmd cmd_show_marks; | ||
150 | sway_cmd cmd_smart_gaps; | ||
151 | sway_cmd cmd_split; | ||
152 | sway_cmd cmd_splith; | ||
153 | sway_cmd cmd_splitt; | ||
154 | sway_cmd cmd_splitv; | ||
155 | sway_cmd cmd_sticky; | ||
156 | sway_cmd cmd_unmark; | ||
157 | sway_cmd cmd_workspace; | ||
158 | sway_cmd cmd_ws_auto_back_and_forth; | ||
159 | sway_cmd cmd_workspace_layout; | ||
160 | |||
161 | sway_cmd bar_cmd_activate_button; | ||
162 | sway_cmd bar_cmd_binding_mode_indicator; | ||
163 | sway_cmd bar_cmd_bindsym; | ||
164 | sway_cmd bar_cmd_colors; | ||
165 | sway_cmd bar_cmd_context_button; | ||
166 | sway_cmd bar_cmd_font; | ||
167 | sway_cmd bar_cmd_mode; | ||
168 | sway_cmd bar_cmd_modifier; | ||
169 | sway_cmd bar_cmd_output; | ||
170 | sway_cmd bar_cmd_height; | ||
171 | sway_cmd bar_cmd_hidden_state; | ||
172 | sway_cmd bar_cmd_icon_theme; | ||
173 | sway_cmd bar_cmd_id; | ||
174 | sway_cmd bar_cmd_position; | ||
175 | sway_cmd bar_cmd_secondary_button; | ||
176 | sway_cmd bar_cmd_separator_symbol; | ||
177 | sway_cmd bar_cmd_status_command; | ||
178 | sway_cmd bar_cmd_pango_markup; | ||
179 | sway_cmd bar_cmd_strip_workspace_numbers; | ||
180 | sway_cmd bar_cmd_swaybar_command; | ||
181 | sway_cmd bar_cmd_tray_output; | ||
182 | sway_cmd bar_cmd_tray_padding; | ||
183 | sway_cmd bar_cmd_wrap_scroll; | ||
184 | sway_cmd bar_cmd_workspace_buttons; | ||
185 | |||
186 | sway_cmd bar_colors_cmd_active_workspace; | ||
187 | sway_cmd bar_colors_cmd_background; | ||
188 | sway_cmd bar_colors_cmd_focused_background; | ||
189 | sway_cmd bar_colors_cmd_binding_mode; | ||
190 | sway_cmd bar_colors_cmd_focused_workspace; | ||
191 | sway_cmd bar_colors_cmd_inactive_workspace; | ||
192 | sway_cmd bar_colors_cmd_separator; | ||
193 | sway_cmd bar_colors_cmd_focused_separator; | ||
194 | sway_cmd bar_colors_cmd_statusline; | ||
195 | sway_cmd bar_colors_cmd_focused_statusline; | ||
196 | sway_cmd bar_colors_cmd_urgent_workspace; | ||
197 | |||
198 | sway_cmd input_cmd_accel_profile; | ||
199 | sway_cmd input_cmd_click_method; | ||
200 | sway_cmd input_cmd_drag_lock; | ||
201 | sway_cmd input_cmd_dwt; | ||
202 | sway_cmd input_cmd_events; | ||
203 | sway_cmd input_cmd_left_handed; | ||
204 | sway_cmd input_cmd_middle_emulation; | ||
205 | sway_cmd input_cmd_natural_scroll; | ||
206 | sway_cmd input_cmd_pointer_accel; | ||
207 | sway_cmd input_cmd_scroll_method; | ||
208 | sway_cmd input_cmd_tap; | ||
209 | |||
210 | sway_cmd cmd_ipc_cmd; | ||
211 | sway_cmd cmd_ipc_events; | ||
212 | sway_cmd cmd_ipc_event_cmd; | ||
213 | |||
214 | #endif | ||