2 * vim:ts=4:sw=4:expandtab
4 * i3 - an improved dynamic tiling window manager
5 * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
7 * commands.c: all command functions (see commands_parser.c)
13 #include "commands_parser.h"
15 /** The beginning of the prototype for every cmd_ function. */
16 #define I3_CMD Match *current_match, struct CommandResult *cmd_output
19 * Helper data structure for an operation window (window on which the operation
20 * will be performed). Used to build the TAILQ owindows.
23 typedef struct owindow {
25 TAILQ_ENTRY(owindow) owindows;
28 typedef TAILQ_HEAD(owindows_head, owindow) owindows_head;
31 * Initializes the specified 'Match' data structure and the initial state of
32 * commands.c for matching target windows of a command.
35 void cmd_criteria_init(I3_CMD);
38 * A match specification just finished (the closing square bracket was found),
39 * so we filter the list of owindows.
42 void cmd_criteria_match_windows(I3_CMD);
45 * Interprets a ctype=cvalue pair and adds it to the current match
49 void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue);
52 * Implementation of 'move [window|container] [to] workspace
53 * next|prev|next_on_output|prev_on_output'.
56 void cmd_move_con_to_workspace(I3_CMD, char *which);
59 * Implementation of 'move [window|container] [to] workspace <name>'.
62 void cmd_move_con_to_workspace_name(I3_CMD, char *name);
65 * Implementation of 'resize grow|shrink <direction> [<px> px] [or <ppt> ppt]'.
68 void cmd_resize(I3_CMD, char *way, char *direction, char *resize_px, char *resize_ppt);
71 * Implementation of 'border normal|none|1pixel|toggle'.
74 void cmd_border(I3_CMD, char *border_style_str);
77 * Implementation of 'nop <comment>'.
80 void cmd_nop(I3_CMD, char *comment);
83 * Implementation of 'append_layout <path>'.
86 void cmd_append_layout(I3_CMD, char *path);
89 * Implementation of 'workspace next|prev|next_on_output|prev_on_output'.
92 void cmd_workspace(I3_CMD, char *which);
95 * Implementation of 'workspace number <number>'
98 void cmd_workspace_number(I3_CMD, char *which);
101 * Implementation of 'workspace back_and_forth'.
104 void cmd_workspace_back_and_forth(I3_CMD);
107 * Implementation of 'workspace <name>'
110 void cmd_workspace_name(I3_CMD, char *name);
113 * Implementation of 'mark <mark>'
116 void cmd_mark(I3_CMD, char *mark);
119 * Implementation of 'mode <string>'.
122 void cmd_mode(I3_CMD, char *mode);
125 * Implementation of 'move [window|container] [to] output <str>'.
128 void cmd_move_con_to_output(I3_CMD, char *name);
131 * Implementation of 'floating enable|disable|toggle'
134 void cmd_floating(I3_CMD, char *floating_mode);
137 * Implementation of 'move workspace to [output] <str>'.
140 void cmd_move_workspace_to_output(I3_CMD, char *name);
143 * Implementation of 'split v|h|vertical|horizontal'.
146 void cmd_split(I3_CMD, char *direction);
149 * Implementaiton of 'kill [window|client]'.
152 void cmd_kill(I3_CMD, char *kill_mode_str);
155 * Implementation of 'exec [--no-startup-id] <command>'.
158 void cmd_exec(I3_CMD, char *nosn, char *command);
161 * Implementation of 'focus left|right|up|down'.
164 void cmd_focus_direction(I3_CMD, char *direction);
167 * Implementation of 'focus tiling|floating|mode_toggle'.
170 void cmd_focus_window_mode(I3_CMD, char *window_mode);
173 * Implementation of 'focus parent|child'.
176 void cmd_focus_level(I3_CMD, char *level);
179 * Implementation of 'focus'.
182 void cmd_focus(I3_CMD);
185 * Implementation of 'fullscreen [global]'.
188 void cmd_fullscreen(I3_CMD, char *fullscreen_mode);
191 * Implementation of 'move <direction> [<pixels> [px]]'.
194 void cmd_move_direction(I3_CMD, char *direction, char *move_px);
197 * Implementation of 'layout default|stacked|stacking|tabbed'.
200 void cmd_layout(I3_CMD, char *layout_str);
203 * Implementaiton of 'exit'.
206 void cmd_exit(I3_CMD);
209 * Implementaiton of 'reload'.
212 void cmd_reload(I3_CMD);
215 * Implementaiton of 'restart'.
218 void cmd_restart(I3_CMD);
221 * Implementaiton of 'open'.
224 void cmd_open(I3_CMD);
227 * Implementation of 'focus output <output>'.
230 void cmd_focus_output(I3_CMD, char *name);
233 * Implementation of 'move [window|container] [to] [absolute] position <px> [px] <px> [px]
236 void cmd_move_window_to_position(I3_CMD, char *method, char *x, char *y);
239 * Implementation of 'move [window|container] [to] [absolute] position center
242 void cmd_move_window_to_center(I3_CMD, char *method);
245 * Implementation of 'move scratchpad'.
248 void cmd_move_scratchpad(I3_CMD);
251 * Implementation of 'scratchpad show'.
254 void cmd_scratchpad_show(I3_CMD);