cosmetic
[awesome.git] / config.h
blob63b2c85c433e085965dddcd52d97c24ad4985b36
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;
192 typedef struct FocusList FocusList;
193 struct FocusList
195 Client *client;
196 FocusList *prev;
199 /** Tag type */
200 typedef struct Tag Tag;
201 struct Tag
203 /** Tag name */
204 char *name;
205 /** True if selected */
206 Bool selected;
207 /** True if was selected before selecting others tags */
208 Bool was_selected;
209 /** Current tag layout */
210 Layout *layout;
211 /** Master width factor */
212 double mwfact;
213 /** Number of master windows */
214 int nmaster;
215 /** Number of columns in tile layout */
216 int ncol;
217 /** Next tag */
218 Tag *next;
221 /** TagClientLink type */
222 typedef struct TagClientLink TagClientLink;
223 struct TagClientLink
225 Tag *tag;
226 Client *client;
227 TagClientLink *next;
230 /** Padding type */
231 typedef struct
233 /** Padding at top */
234 int top;
235 /** Padding at bottom */
236 int bottom;
237 /** Padding at left */
238 int left;
239 /** Padding at right */
240 int right;
241 } Padding;
243 typedef struct
245 /** Number of pixels to snap windows */
246 int snap;
247 /** Border size */
248 int borderpx;
249 /** Transparency of unfocused clients */
250 int opacity_unfocused;
251 /** Focus move pointer */
252 Bool focus_move_pointer;
253 /** Allow floats to be lowered on focus change */
254 Bool allow_lower_floats;
255 /** Respect resize hints */
256 Bool resize_hints;
257 /** Sloppy focus: focus follow mouse */
258 Bool sloppy_focus;
259 /** Focus new clients */
260 Bool new_get_focus;
261 /** True if new clients should become master */
262 Bool new_become_master;
263 /** Normal colors */
264 XColor colors_normal[ColLast];
265 /** Selected colors */
266 XColor colors_selected[ColLast];
267 /** Urgency colors */
268 XColor colors_urgent[ColLast];
269 /** Tag list */
270 Tag *tags;
271 /** Layout list */
272 Layout *layouts;
273 /** Status bar */
274 Statusbar *statusbar;
275 /** Padding */
276 Padding padding;
277 /** Font */
278 XftFont *font;
279 } VirtScreen;
281 /** Main configuration structure */
282 struct AwesomeConf
284 /** Display ref */
285 Display *display;
286 /** Logical screens */
287 VirtScreen *screens;
288 /** Rules list */
289 Rule *rules;
290 /** Keys bindings list */
291 Key *keys;
292 /** Mouse bindings list */
293 struct
295 Button *root;
296 Button *client;
297 } buttons;
298 /** Numlock mask */
299 unsigned int numlockmask;
300 /** Check for XShape extension */
301 Bool have_shape;
302 /** Check for XRandR extension */
303 Bool have_randr;
304 /** Cursors */
305 Cursor cursor[CurLast];
306 /** Clients list */
307 Client *clients;
308 /** Path to config file */
309 char *configpath;
310 /** Selected clients on this tag */
311 FocusList *focus;
312 /** Link between tags and clients */
313 TagClientLink *tclink;
316 void config_parse(const char *);
318 #endif
319 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80