2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
7 * commands.c: all command functions (see commands_parser.c)
14 #include "commands_parser.h"
16 /** The beginning of the prototype for every cmd_ function. */
17 #define I3_CMD Match *current_match, struct CommandResultIR *cmd_output
20 * Initializes the specified 'Match' data structure and the initial state of
21 * commands.c for matching target windows of a command.
24 void cmd_criteria_init(I3_CMD);
27 * A match specification just finished (the closing square bracket was found),
28 * so we filter the list of owindows.
31 void cmd_criteria_match_windows(I3_CMD);
34 * Interprets a ctype=cvalue pair and adds it to the current match
38 void cmd_criteria_add(I3_CMD, const char *ctype, const char *cvalue);
41 * Implementation of 'move [window|container] [to] workspace
42 * next|prev|next_on_output|prev_on_output'.
45 void cmd_move_con_to_workspace(I3_CMD, const char *which);
48 * Implementation of 'move [window|container] [to] workspace back_and_forth'.
51 void cmd_move_con_to_workspace_back_and_forth(I3_CMD);
54 * Implementation of 'move [--no-auto-back-and-forth] [window|container] [to] workspace <name>'.
57 void cmd_move_con_to_workspace_name(I3_CMD, const char *name, const char *no_auto_back_and_forth);
60 * Implementation of 'move [--no-auto-back-and-forth] [window|container] [to] workspace number <number>'.
63 void cmd_move_con_to_workspace_number(I3_CMD, const char *which, const char *no_auto_back_and_forth);
66 * Implementation of 'resize set <width> [px | ppt] <height> [px | ppt]'.
69 void cmd_resize_set(I3_CMD, long cwidth, const char *mode_width, long cheight, const char *mode_height);
72 * Implementation of 'resize grow|shrink <direction> [<px> px] [or <ppt> ppt]'.
75 void cmd_resize(I3_CMD, const char *way, const char *direction, long resize_px, long resize_ppt);
78 * Implementation of 'border normal|pixel [<n>]', 'border none|1pixel|toggle'.
81 void cmd_border(I3_CMD, const char *border_style_str, long border_width);
84 * Implementation of 'nop <comment>'.
87 void cmd_nop(I3_CMD, const char *comment);
90 * Implementation of 'append_layout <path>'.
93 void cmd_append_layout(I3_CMD, const char *path);
96 * Implementation of 'workspace next|prev|next_on_output|prev_on_output'.
99 void cmd_workspace(I3_CMD, const char *which);
102 * Implementation of 'workspace [--no-auto-back-and-forth] number <number>'
105 void cmd_workspace_number(I3_CMD, const char *which, const char *no_auto_back_and_forth);
108 * Implementation of 'workspace back_and_forth'.
111 void cmd_workspace_back_and_forth(I3_CMD);
114 * Implementation of 'workspace [--no-auto-back-and-forth] <name>'
117 void cmd_workspace_name(I3_CMD, const char *name, const char *no_auto_back_and_forth);
120 * Implementation of 'mark [--add|--replace] [--toggle] <mark>'
123 void cmd_mark(I3_CMD, const char *mark, const char *mode, const char *toggle);
126 * Implementation of 'unmark [mark]'
129 void cmd_unmark(I3_CMD, const char *mark);
132 * Implementation of 'mode <string>'.
135 void cmd_mode(I3_CMD, const char *mode);
138 * Implementation of 'move [window|container] [to] output <str>'.
141 void cmd_move_con_to_output(I3_CMD, const char *name);
144 * Implementation of 'move [window|container] [to] mark <str>'.
147 void cmd_move_con_to_mark(I3_CMD, const char *mark);
150 * Implementation of 'floating enable|disable|toggle'
153 void cmd_floating(I3_CMD, const char *floating_mode);
156 * Implementation of 'move workspace to [output] <str>'.
159 void cmd_move_workspace_to_output(I3_CMD, const char *name);
162 * Implementation of 'split v|h|t|vertical|horizontal|toggle'.
165 void cmd_split(I3_CMD, const char *direction);
168 * Implementation of 'kill [window|client]'.
171 void cmd_kill(I3_CMD, const char *kill_mode_str);
174 * Implementation of 'exec [--no-startup-id] <command>'.
177 void cmd_exec(I3_CMD, const char *nosn, const char *command);
180 * Implementation of 'focus left|right|up|down'.
183 void cmd_focus_direction(I3_CMD, const char *direction);
186 * Implementation of 'focus tiling|floating|mode_toggle'.
189 void cmd_focus_window_mode(I3_CMD, const char *window_mode);
192 * Implementation of 'focus parent|child'.
195 void cmd_focus_level(I3_CMD, const char *level);
198 * Implementation of 'focus'.
201 void cmd_focus(I3_CMD);
204 * Implementation of 'fullscreen [enable|disable|toggle] [global]'.
207 void cmd_fullscreen(I3_CMD, const char *action, const char *fullscreen_mode);
210 * Implementation of 'sticky enable|disable|toggle'.
213 void cmd_sticky(I3_CMD, const char *action);
216 * Implementation of 'move <direction> [<pixels> [px]]'.
219 void cmd_move_direction(I3_CMD, const char *direction, long move_px);
222 * Implementation of 'layout default|stacked|stacking|tabbed|splitv|splith'.
225 void cmd_layout(I3_CMD, const char *layout_str);
228 * Implementation of 'layout toggle [all|split]'.
231 void cmd_layout_toggle(I3_CMD, const char *toggle_mode);
234 * Implementation of 'exit'.
237 void cmd_exit(I3_CMD);
240 * Implementation of 'reload'.
243 void cmd_reload(I3_CMD);
246 * Implementation of 'restart'.
249 void cmd_restart(I3_CMD);
252 * Implementation of 'open'.
255 void cmd_open(I3_CMD);
258 * Implementation of 'focus output <output>'.
261 void cmd_focus_output(I3_CMD, const char *name);
264 * Implementation of 'move [window|container] [to] [absolute] position <px> [px] <px> [px]
267 void cmd_move_window_to_position(I3_CMD, long x, long y);
270 * Implementation of 'move [window|container] [to] [absolute] position center
273 void cmd_move_window_to_center(I3_CMD, const char *method);
276 * Implementation of 'move [window|container] [to] position mouse'
279 void cmd_move_window_to_mouse(I3_CMD);
282 * Implementation of 'move scratchpad'.
285 void cmd_move_scratchpad(I3_CMD);
288 * Implementation of 'scratchpad show'.
291 void cmd_scratchpad_show(I3_CMD);
294 * Implementation of 'swap [container] [with] id|con_id|mark <arg>'.
297 void cmd_swap(I3_CMD, const char *mode, const char *arg);
300 * Implementation of 'title_format <format>'
303 void cmd_title_format(I3_CMD, const char *format);
306 * Implementation of 'rename workspace <name> to <name>'
309 void cmd_rename_workspace(I3_CMD, const char *old_name, const char *new_name);
312 * Implementation of 'bar (hidden_state hide|show|toggle)|(mode dock|hide|invisible|toggle) [<bar_id>]'
315 void cmd_bar(I3_CMD, const char *bar_type, const char *bar_value, const char *bar_id);
318 * Implementation of 'shmlog <size>|toggle|on|off'
321 void cmd_shmlog(I3_CMD, const char *argument);
324 * Implementation of 'debuglog toggle|on|off'
327 void cmd_debuglog(I3_CMD, const char *argument);