]> git.sur5r.net Git - i3/i3/blob - include/commands.h
added "toggle" option to "split" command
[i3/i3] / include / commands.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * commands.c: all command functions (see commands_parser.c)
8  *
9  */
10 #pragma once
11
12 #include "commands_parser.h"
13
14 /** The beginning of the prototype for every cmd_ function. */
15 #define I3_CMD Match *current_match, struct CommandResultIR *cmd_output
16
17 /**
18  * Initializes the specified 'Match' data structure and the initial state of
19  * commands.c for matching target windows of a command.
20  *
21  */
22 void cmd_criteria_init(I3_CMD);
23
24 /**
25  * A match specification just finished (the closing square bracket was found),
26  * so we filter the list of owindows.
27  *
28  */
29 void cmd_criteria_match_windows(I3_CMD);
30
31 /**
32  * Interprets a ctype=cvalue pair and adds it to the current match
33  * specification.
34  *
35  */
36 void cmd_criteria_add(I3_CMD, const char *ctype, const char *cvalue);
37
38 /**
39  * Implementation of 'move [window|container] [to] workspace
40  * next|prev|next_on_output|prev_on_output'.
41  *
42  */
43 void cmd_move_con_to_workspace(I3_CMD, const char *which);
44
45 /**
46  * Implementation of 'move [window|container] [to] workspace back_and_forth'.
47  *
48  */
49 void cmd_move_con_to_workspace_back_and_forth(I3_CMD);
50
51 /**
52  * Implementation of 'move [--no-auto-back-and-forth] [window|container] [to] workspace <name>'.
53  *
54  */
55 void cmd_move_con_to_workspace_name(I3_CMD, const char *name, const char *no_auto_back_and_forth);
56
57 /**
58  * Implementation of 'move [--no-auto-back-and-forth] [window|container] [to] workspace number <number>'.
59  *
60  */
61 void cmd_move_con_to_workspace_number(I3_CMD, const char *which, const char *no_auto_back_and_forth);
62
63 /**
64  * Implementation of 'resize set <px> [px] <px> [px]'.
65  *
66  */
67 void cmd_resize_set(I3_CMD, long cwidth, long cheight);
68
69 /**
70  * Implementation of 'resize grow|shrink <direction> [<px> px] [or <ppt> ppt]'.
71  *
72  */
73 void cmd_resize(I3_CMD, const char *way, const char *direction, long resize_px, long resize_ppt);
74
75 /**
76  * Implementation of 'border normal|pixel [<n>]', 'border none|1pixel|toggle'.
77  *
78  */
79 void cmd_border(I3_CMD, const char *border_style_str, const char *border_width);
80
81 /**
82  * Implementation of 'nop <comment>'.
83  *
84  */
85 void cmd_nop(I3_CMD, const char *comment);
86
87 /**
88  * Implementation of 'append_layout <path>'.
89  *
90  */
91 void cmd_append_layout(I3_CMD, const char *path);
92
93 /**
94  * Implementation of 'workspace next|prev|next_on_output|prev_on_output'.
95  *
96  */
97 void cmd_workspace(I3_CMD, const char *which);
98
99 /**
100  * Implementation of 'workspace [--no-auto-back-and-forth] number <number>'
101  *
102  */
103 void cmd_workspace_number(I3_CMD, const char *which, const char *no_auto_back_and_forth);
104
105 /**
106  * Implementation of 'workspace back_and_forth'.
107  *
108  */
109 void cmd_workspace_back_and_forth(I3_CMD);
110
111 /**
112  * Implementation of 'workspace [--no-auto-back-and-forth] <name>'
113  *
114  */
115 void cmd_workspace_name(I3_CMD, const char *name, const char *no_auto_back_and_forth);
116
117 /**
118  * Implementation of 'mark [--add|--replace] [--toggle] <mark>'
119  *
120  */
121 void cmd_mark(I3_CMD, const char *mark, const char *mode, const char *toggle);
122
123 /**
124  * Implementation of 'unmark [mark]'
125  *
126  */
127 void cmd_unmark(I3_CMD, const char *mark);
128
129 /**
130  * Implementation of 'mode <string>'.
131  *
132  */
133 void cmd_mode(I3_CMD, const char *mode);
134
135 /**
136  * Implementation of 'move [window|container] [to] output <str>'.
137  *
138  */
139 void cmd_move_con_to_output(I3_CMD, const char *name);
140
141 /**
142  * Implementation of 'move [window|container] [to] mark <str>'.
143  *
144  */
145 void cmd_move_con_to_mark(I3_CMD, const char *mark);
146
147 /**
148  * Implementation of 'floating enable|disable|toggle'
149  *
150  */
151 void cmd_floating(I3_CMD, const char *floating_mode);
152
153 /**
154  * Implementation of 'move workspace to [output] <str>'.
155  *
156  */
157 void cmd_move_workspace_to_output(I3_CMD, const char *name);
158
159 /**
160  * Implementation of 'split v|h|t|vertical|horizontal|toggle'.
161  *
162  */
163 void cmd_split(I3_CMD, const char *direction);
164
165 /**
166  * Implementation of 'kill [window|client]'.
167  *
168  */
169 void cmd_kill(I3_CMD, const char *kill_mode_str);
170
171 /**
172  * Implementation of 'exec [--no-startup-id] <command>'.
173  *
174  */
175 void cmd_exec(I3_CMD, const char *nosn, const char *command);
176
177 /**
178  * Implementation of 'focus left|right|up|down'.
179  *
180  */
181 void cmd_focus_direction(I3_CMD, const char *direction);
182
183 /**
184  * Implementation of 'focus tiling|floating|mode_toggle'.
185  *
186  */
187 void cmd_focus_window_mode(I3_CMD, const char *window_mode);
188
189 /**
190  * Implementation of 'focus parent|child'.
191  *
192  */
193 void cmd_focus_level(I3_CMD, const char *level);
194
195 /**
196  * Implementation of 'focus'.
197  *
198  */
199 void cmd_focus(I3_CMD);
200
201 /**
202  * Implementation of 'fullscreen [enable|disable|toggle] [global]'.
203  *
204  */
205 void cmd_fullscreen(I3_CMD, const char *action, const char *fullscreen_mode);
206
207 /**
208  * Implementation of 'sticky enable|disable|toggle'.
209  *
210  */
211 void cmd_sticky(I3_CMD, const char *action);
212
213 /**
214  * Implementation of 'move <direction> [<pixels> [px]]'.
215  *
216  */
217 void cmd_move_direction(I3_CMD, const char *direction, long move_px);
218
219 /**
220  * Implementation of 'layout default|stacked|stacking|tabbed|splitv|splith'.
221  *
222  */
223 void cmd_layout(I3_CMD, const char *layout_str);
224
225 /**
226  * Implementation of 'layout toggle [all|split]'.
227  *
228  */
229 void cmd_layout_toggle(I3_CMD, const char *toggle_mode);
230
231 /**
232  * Implementation of 'exit'.
233  *
234  */
235 void cmd_exit(I3_CMD);
236
237 /**
238  * Implementation of 'reload'.
239  *
240  */
241 void cmd_reload(I3_CMD);
242
243 /**
244  * Implementation of 'restart'.
245  *
246  */
247 void cmd_restart(I3_CMD);
248
249 /**
250  * Implementation of 'open'.
251  *
252  */
253 void cmd_open(I3_CMD);
254
255 /**
256  * Implementation of 'focus output <output>'.
257  *
258  */
259 void cmd_focus_output(I3_CMD, const char *name);
260
261 /**
262  * Implementation of 'move [window|container] [to] [absolute] position <px> [px] <px> [px]
263  *
264  */
265 void cmd_move_window_to_position(I3_CMD, const char *method, long x, long y);
266
267 /**
268  * Implementation of 'move [window|container] [to] [absolute] position center
269  *
270  */
271 void cmd_move_window_to_center(I3_CMD, const char *method);
272
273 /**
274  * Implementation of 'move [window|container] [to] position mouse'
275  *
276  */
277 void cmd_move_window_to_mouse(I3_CMD);
278
279 /**
280  * Implementation of 'move scratchpad'.
281  *
282  */
283 void cmd_move_scratchpad(I3_CMD);
284
285 /**
286  * Implementation of 'scratchpad show'.
287  *
288  */
289 void cmd_scratchpad_show(I3_CMD);
290
291 /**
292  * Implementation of 'title_format <format>'
293  *
294  */
295 void cmd_title_format(I3_CMD, const char *format);
296
297 /**
298  * Implementation of 'rename workspace <name> to <name>'
299  *
300  */
301 void cmd_rename_workspace(I3_CMD, const char *old_name, const char *new_name);
302
303 /**
304  * Implementation of 'bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]'
305  *
306  */
307 void cmd_bar(I3_CMD, const char *bar_type, const char *bar_value, const char *bar_id);
308
309 /*
310  * Implementation of 'shmlog <size>|toggle|on|off'
311  *
312  */
313 void cmd_shmlog(I3_CMD, const char *argument);
314
315 /*
316  * Implementation of 'debuglog toggle|on|off'
317  *
318  */
319 void cmd_debuglog(I3_CMD, const char *argument);