]> git.sur5r.net Git - i3/i3/blob - include/commands.h
Refactor the interface of commands.c
[i3/i3] / include / commands.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  * © 2009-2012 Michael Stapelberg and contributors (see also: LICENSE)
6  *
7  * commands.c: all command functions (see commands_parser.c)
8  *
9  */
10 #ifndef _COMMANDS_H
11 #define _COMMANDS_H
12
13 #include "commands_parser.h"
14
15 /** The beginning of the prototype for every cmd_ function. */
16 #define I3_CMD Match *current_match, struct CommandResult *cmd_output
17
18 /*
19  * Helper data structure for an operation window (window on which the operation
20  * will be performed). Used to build the TAILQ owindows.
21  *
22  */
23 typedef struct owindow {
24     Con *con;
25     TAILQ_ENTRY(owindow) owindows;
26 } owindow;
27
28 typedef TAILQ_HEAD(owindows_head, owindow) owindows_head;
29
30 /**
31  * Initializes the specified 'Match' data structure and the initial state of
32  * commands.c for matching target windows of a command.
33  *
34  */
35 void cmd_criteria_init(I3_CMD);
36
37 /**
38  * A match specification just finished (the closing square bracket was found),
39  * so we filter the list of owindows.
40  *
41  */
42 void cmd_criteria_match_windows(I3_CMD);
43
44 /**
45  * Interprets a ctype=cvalue pair and adds it to the current match
46  * specification.
47  *
48  */
49 void cmd_criteria_add(I3_CMD, char *ctype, char *cvalue);
50
51 /**
52  * Implementation of 'move [window|container] [to] workspace
53  * next|prev|next_on_output|prev_on_output'.
54  *
55  */
56 void cmd_move_con_to_workspace(I3_CMD, char *which);
57
58 /**
59  * Implementation of 'move [window|container] [to] workspace <name>'.
60  *
61  */
62 void cmd_move_con_to_workspace_name(I3_CMD, char *name);
63
64 /**
65  * Implementation of 'resize grow|shrink <direction> [<px> px] [or <ppt> ppt]'.
66  *
67  */
68 void cmd_resize(I3_CMD, char *way, char *direction, char *resize_px, char *resize_ppt);
69
70 /**
71  * Implementation of 'border normal|none|1pixel|toggle'.
72  *
73  */
74 void cmd_border(I3_CMD, char *border_style_str);
75
76 /**
77  * Implementation of 'nop <comment>'.
78  *
79  */
80 void cmd_nop(I3_CMD, char *comment);
81
82 /**
83  * Implementation of 'append_layout <path>'.
84  *
85  */
86 void cmd_append_layout(I3_CMD, char *path);
87
88 /**
89  * Implementation of 'workspace next|prev|next_on_output|prev_on_output'.
90  *
91  */
92 void cmd_workspace(I3_CMD, char *which);
93
94 /**
95  * Implementation of 'workspace back_and_forth'.
96  *
97  */
98 void cmd_workspace_back_and_forth(I3_CMD);
99
100 /**
101  * Implementation of 'workspace <name>'
102  *
103  */
104 void cmd_workspace_name(I3_CMD, char *name);
105
106 /**
107  * Implementation of 'mark <mark>'
108  *
109  */
110 void cmd_mark(I3_CMD, char *mark);
111
112 /**
113  * Implementation of 'mode <string>'.
114  *
115  */
116 void cmd_mode(I3_CMD, char *mode);
117
118 /**
119  * Implementation of 'move [window|container] [to] output <str>'.
120  *
121  */
122 void cmd_move_con_to_output(I3_CMD, char *name);
123
124 /**
125  * Implementation of 'floating enable|disable|toggle'
126  *
127  */
128 void cmd_floating(I3_CMD, char *floating_mode);
129
130 /**
131  * Implementation of 'move workspace to [output] <str>'.
132  *
133  */
134 void cmd_move_workspace_to_output(I3_CMD, char *name);
135
136 /**
137  * Implementation of 'split v|h|vertical|horizontal'.
138  *
139  */
140 void cmd_split(I3_CMD, char *direction);
141
142 /**
143  * Implementaiton of 'kill [window|client]'.
144  *
145  */
146 void cmd_kill(I3_CMD, char *kill_mode_str);
147
148 /**
149  * Implementation of 'exec [--no-startup-id] <command>'.
150  *
151  */
152 void cmd_exec(I3_CMD, char *nosn, char *command);
153
154 /**
155  * Implementation of 'focus left|right|up|down'.
156  *
157  */
158 void cmd_focus_direction(I3_CMD, char *direction);
159
160 /**
161  * Implementation of 'focus tiling|floating|mode_toggle'.
162  *
163  */
164 void cmd_focus_window_mode(I3_CMD, char *window_mode);
165
166 /**
167  * Implementation of 'focus parent|child'.
168  *
169  */
170 void cmd_focus_level(I3_CMD, char *level);
171
172 /**
173  * Implementation of 'focus'.
174  *
175  */
176 void cmd_focus(I3_CMD);
177
178 /**
179  * Implementation of 'fullscreen [global]'.
180  *
181  */
182 void cmd_fullscreen(I3_CMD, char *fullscreen_mode);
183
184 /**
185  * Implementation of 'move <direction> [<pixels> [px]]'.
186  *
187  */
188 void cmd_move_direction(I3_CMD, char *direction, char *move_px);
189
190 /**
191  * Implementation of 'layout default|stacked|stacking|tabbed'.
192  *
193  */
194 void cmd_layout(I3_CMD, char *layout_str);
195
196 /**
197  * Implementaiton of 'exit'.
198  *
199  */
200 void cmd_exit(I3_CMD);
201
202 /**
203  * Implementaiton of 'reload'.
204  *
205  */
206 void cmd_reload(I3_CMD);
207
208 /**
209  * Implementaiton of 'restart'.
210  *
211  */
212 void cmd_restart(I3_CMD);
213
214 /**
215  * Implementaiton of 'open'.
216  *
217  */
218 void cmd_open(I3_CMD);
219
220 /**
221  * Implementation of 'focus output <output>'.
222  *
223  */
224 void cmd_focus_output(I3_CMD, char *name);
225
226 /**
227  * Implementation of 'move scratchpad'.
228  *
229  */
230 void cmd_move_scratchpad(I3_CMD);
231
232 /**
233  * Implementation of 'scratchpad show'.
234  *
235  */
236 void cmd_scratchpad_show(I3_CMD);
237
238 #endif