fix a bug in the tasklist loop that made clicking on tasklist focusing a wrong client
[awesome.git] / config.h
blob759612489b07c6085afe4df31067102bf1deaa98
1 /*
2 * config.h - configuration management header
4 * Copyright © 2007-2008 Julien Danjou <julien@danjou.info>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 #ifndef AWESOME_CONFIG_H
23 #define AWESOME_CONFIG_H
25 #include <regex.h>
26 #include "draw.h"
27 #include "layout.h"
29 /** Bar possible position */
30 typedef enum
32 Top,
33 Bottom,
34 Left,
35 Right,
36 Off
37 } Position;
39 typedef enum
41 Float,
42 Tile,
43 Auto,
44 } RuleFloat;
46 /** Common colors */
47 enum
48 { ColBorder, ColFG, ColBG, ColLast };
50 enum
51 { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
53 typedef struct Rule Rule;
54 struct Rule
56 char *icon;
57 char *xprop;
58 int screen;
59 RuleFloat isfloating;
60 Bool not_master;
61 regex_t *prop_r;
62 regex_t *tags_r;
63 regex_t *xpropval_r;
64 Rule *next;
67 typedef struct AwesomeConf AwesomeConf;
69 typedef struct Key Key;
70 struct Key
72 unsigned long mod;
73 KeySym keysym;
74 Uicb *func;
75 char *arg;
76 Key *next;
79 typedef struct Button Button;
80 struct Button
82 unsigned long mod;
83 unsigned int button;
84 Uicb *func;
85 char *arg;
86 Button *next;
89 /** Widget */
90 typedef struct Widget Widget;
91 typedef struct Statusbar Statusbar;
92 struct Widget
94 /** Widget name */
95 char *name;
96 /** Draw function */
97 int (*draw)(Widget *, DrawCtx *, int, int);
98 /** Update function */
99 void (*tell)(Widget *, char *);
100 /** ButtonPressedEvent handler */
101 void (*button_press)(Widget *, XButtonPressedEvent *);
102 /** Statusbar */
103 Statusbar *statusbar;
104 /** Alignement */
105 Alignment alignment;
106 /** Misc private data */
107 void *data;
108 /** True if user supplied coords */
109 Bool user_supplied_x;
110 Bool user_supplied_y;
111 /** Area */
112 Area area;
113 /** Buttons bindings */
114 Button *buttons;
115 /** Font */
116 XftFont *font;
117 /** Cache */
118 struct
120 Bool needs_update;
121 int flags;
122 } cache;
123 /** Next widget */
124 Widget *next;
127 /** Status bar */
128 struct Statusbar
130 /** Statusbar name */
131 char *name;
132 /** Bar width */
133 int width;
134 /** Bar height */
135 int height;
136 /** Layout txt width */
137 int txtlayoutwidth;
138 /** Default position */
139 Position dposition;
140 /** Bar position */
141 Position position;
142 /** Window */
143 Window window;
144 /** Screen */
145 int screen;
146 /** Widget list */
147 Widget *widgets;
148 /** Drawable */
149 Drawable drawable;
150 /** Next statusbar */
151 Statusbar *next;
154 typedef struct Client Client;
155 struct Client
157 /** Client name */
158 char name[256];
159 /** Window geometry */
160 Area geometry;
161 /** Floating window geometry */
162 Area f_geometry;
163 /** Max window geometry */
164 Area m_geometry;
165 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
166 int minax, maxax, minay, maxay;
167 int border, oldborder;
168 /** Has urgency hint */
169 Bool isurgent;
170 /** Store previous floating state before maximizing */
171 Bool wasfloating;
172 /** True if the window is floating */
173 Bool isfloating;
174 /** True if the window is fixed */
175 Bool isfixed;
176 /** True if the window is maximized */
177 Bool ismax;
178 /** True if the client must be skipped from client list */
179 Bool skip;
180 /** True if the client must be skipped from task bar client list */
181 Bool skiptb;
182 /** Next client */
183 Client *next;
184 /** Previous client */
185 Client *prev;
186 /** Window of the client */
187 Window win;
188 /** Client logical screen */
189 int screen;
190 /** True if the client is a new one */
191 Bool newcomer;
194 typedef struct FocusList FocusList;
195 struct FocusList
197 Client *client;
198 FocusList *prev;
201 /** Tag type */
202 typedef struct Tag Tag;
203 struct Tag
205 /** Tag name */
206 char *name;
207 /** True if selected */
208 Bool selected;
209 /** True if was selected before selecting others tags */
210 Bool was_selected;
211 /** Current tag layout */
212 Layout *layout;
213 /** Master width factor */
214 double mwfact;
215 /** Number of master windows */
216 int nmaster;
217 /** Number of columns in tile layout */
218 int ncol;
219 /** Next tag */
220 Tag *next;
223 /** TagClientLink type */
224 typedef struct TagClientLink TagClientLink;
225 struct TagClientLink
227 Tag *tag;
228 Client *client;
229 TagClientLink *next;
232 /** Padding type */
233 typedef struct
235 /** Padding at top */
236 int top;
237 /** Padding at bottom */
238 int bottom;
239 /** Padding at left */
240 int left;
241 /** Padding at right */
242 int right;
243 } Padding;
245 typedef struct
247 /** Number of pixels to snap windows */
248 int snap;
249 /** Border size */
250 int borderpx;
251 /** Transparency of unfocused clients */
252 int opacity_unfocused;
253 /** Focus move pointer */
254 Bool focus_move_pointer;
255 /** Allow floats to be lowered on focus change */
256 Bool allow_lower_floats;
257 /** Respect resize hints */
258 Bool resize_hints;
259 /** Sloppy focus: focus follow mouse */
260 Bool sloppy_focus;
261 /** Focus new clients */
262 Bool new_get_focus;
263 /** True if new clients should become master */
264 Bool new_become_master;
265 /** Normal colors */
266 XColor colors_normal[ColLast];
267 /** Selected colors */
268 XColor colors_selected[ColLast];
269 /** Urgency colors */
270 XColor colors_urgent[ColLast];
271 /** Tag list */
272 Tag *tags;
273 /** Layout list */
274 Layout *layouts;
275 /** Status bar */
276 Statusbar *statusbar;
277 /** Padding */
278 Padding padding;
279 /** Font */
280 XftFont *font;
281 } VirtScreen;
283 /** Main configuration structure */
284 struct AwesomeConf
286 /** Display ref */
287 Display *display;
288 /** Logical screens */
289 VirtScreen *screens;
290 /** Number of logical screens */
291 int nscreens;
292 /** Rules list */
293 Rule *rules;
294 /** Keys bindings list */
295 Key *keys;
296 /** Mouse bindings list */
297 struct
299 Button *root;
300 Button *client;
301 } buttons;
302 /** Numlock mask */
303 unsigned int numlockmask;
304 /** Check for XShape extension */
305 Bool have_shape;
306 /** Check for XRandR extension */
307 Bool have_randr;
308 /** Cursors */
309 Cursor cursor[CurLast];
310 /** Clients list */
311 Client *clients;
312 /** Path to config file */
313 char *configpath;
314 /** Selected clients on this tag */
315 FocusList *focus;
316 /** Link between tags and clients */
317 TagClientLink *tclink;
318 /** Command line passed to awesome */
319 char *argv;
322 void config_parse(const char *);
324 #endif
325 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80