adding option 'x' and 'y' and general cleanup
[awesome.git] / config.h
blob15cf022ea09d4947f456d2e9e081de9554602f36
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 /** Common colors */
40 enum
41 { ColBorder, ColFG, ColBG, ColLast };
43 enum
44 { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
46 typedef struct Rule Rule;
47 struct Rule
49 char *icon;
50 char *xprop;
51 int screen;
52 Bool isfloating;
53 Bool not_master;
54 regex_t *prop_r;
55 regex_t *tags_r;
56 regex_t *xpropval_r;
57 Rule *next;
60 typedef struct AwesomeConf AwesomeConf;
62 typedef struct Layout Layout;
63 struct Layout
65 char *image;
66 LayoutArrange *arrange;
67 Layout *next;
70 typedef struct Key Key;
71 struct Key
73 unsigned long mod;
74 KeySym keysym;
75 Uicb *func;
76 char *arg;
77 Key *next;
80 typedef struct Button Button;
81 struct Button
83 unsigned long mod;
84 unsigned int button;
85 Uicb *func;
86 char *arg;
87 Button *next;
90 /** Widget */
91 typedef struct Widget Widget;
92 typedef struct Statusbar Statusbar;
93 struct Widget
95 /** Widget name */
96 char *name;
97 /** Draw function */
98 int (*draw)(Widget *, DrawCtx *, int, int);
99 /** Update function */
100 void (*tell)(Widget *, char *);
101 /** ButtonPressedEvent handler */
102 void (*button_press)(Widget *, XButtonPressedEvent *);
103 /** Statusbar */
104 Statusbar *statusbar;
105 /** Alignement */
106 Alignment alignment;
107 /** Misc private data */
108 void *data;
109 /** True if user supplied coords */
110 Bool user_supplied_x;
111 Bool user_supplied_y;
112 /** Area */
113 Area area;
114 /** Buttons bindings */
115 Button *buttons;
116 /** Font */
117 XftFont *font;
118 /** Next widget */
119 Widget *next;
122 /** Status bar */
123 struct Statusbar
125 /** Statusbar name */
126 char *name;
127 /** Bar width */
128 int width;
129 /** Bar height */
130 int height;
131 /** Layout txt width */
132 int txtlayoutwidth;
133 /** Default position */
134 Position dposition;
135 /** Bar position */
136 Position position;
137 /** Window */
138 Window window;
139 /** Screen */
140 int screen;
141 /** Widget list */
142 Widget *widgets;
143 /** Drawable */
144 Drawable drawable;
145 /** Next statusbar */
146 Statusbar *next;
149 typedef struct Client Client;
150 struct Client
152 /** Client name */
153 char name[256];
154 /** Window geometry */
155 int x, y, w, h;
156 /** Real window geometry for floating */
157 int rx, ry, rw, rh;
158 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
159 int minax, maxax, minay, maxay;
160 long flags;
161 int border, oldborder;
162 /** Has urgency hint */
163 Bool isurgent;
164 /** Store previous floating state before maximizing */
165 Bool wasfloating;
166 /** True if the window is floating */
167 Bool isfloating;
168 /** True if the window is fixed */
169 Bool isfixed;
170 /** True if the window is maximized */
171 Bool ismax;
172 /** True if the client must be skipped from client list */
173 Bool skip;
174 /** True if the client must be skipped from task bar client list */
175 Bool skiptb;
176 /** Next client */
177 Client *next;
178 /** Previous client */
179 Client *prev;
180 /** Window of the client */
181 Window win;
182 /** Client logical screen */
183 int screen;
186 typedef struct FocusList FocusList;
187 struct FocusList
189 Client *client;
190 FocusList *prev;
193 /** Tag type */
194 typedef struct Tag Tag;
195 struct Tag
197 /** Tag name */
198 char *name;
199 /** True if selected */
200 Bool selected;
201 /** True if was selected before selecting others tags */
202 Bool was_selected;
203 /** Current tag layout */
204 Layout *layout;
205 /** Master width factor */
206 double mwfact;
207 /** Number of master windows */
208 int nmaster;
209 /** Number of columns in tile layout */
210 int ncol;
211 /** Next tag */
212 Tag *next;
215 /** TagClientLink type */
216 typedef struct TagClientLink TagClientLink;
217 struct TagClientLink
219 Tag *tag;
220 Client *client;
221 TagClientLink *next;
224 /** Padding type */
225 typedef struct
227 /** Padding at top */
228 int top;
229 /** Padding at bottom */
230 int bottom;
231 /** Padding at left */
232 int left;
233 /** Padding at right */
234 int right;
235 } Padding;
237 typedef struct
239 /** Number of pixels to snap windows */
240 int snap;
241 /** Border size */
242 int borderpx;
243 /** Transparency of unfocused clients */
244 int opacity_unfocused;
245 /** Focus move pointer */
246 Bool focus_move_pointer;
247 /** Allow floats to be lowered on focus change */
248 Bool allow_lower_floats;
249 /** Respect resize hints */
250 Bool resize_hints;
251 /** Sloppy focus: focus follow mouse */
252 Bool sloppy_focus;
253 /** True if new clients should become master */
254 Bool new_become_master;
255 /** Normal colors */
256 XColor colors_normal[ColLast];
257 /** Selected colors */
258 XColor colors_selected[ColLast];
259 /** Urgency colors */
260 XColor colors_urgent[ColLast];
261 /** Tag list */
262 Tag *tags;
263 /** Layout list */
264 Layout *layouts;
265 /** Status bar */
266 Statusbar *statusbar;
267 /** Padding */
268 Padding padding;
269 /** Font */
270 XftFont *font;
271 } VirtScreen;
273 /** Main configuration structure */
274 struct AwesomeConf
276 /** Display ref */
277 Display *display;
278 /** Logical screens */
279 VirtScreen *screens;
280 /** Rules list */
281 Rule *rules;
282 /** Keys bindings list */
283 Key *keys;
284 /** Mouse bindings list */
285 struct
287 Button *root;
288 Button *client;
289 } buttons;
290 /** Numlock mask */
291 unsigned int numlockmask;
292 /** Check for XShape extension */
293 Bool have_shape;
294 /** Check for XRandR extension */
295 Bool have_randr;
296 /** Cursors */
297 Cursor cursor[CurLast];
298 /** Clients list */
299 Client *clients;
300 /** Path to config file */
301 char *configpath;
302 /** Selected clients on this tag */
303 FocusList *focus;
304 /** Link between tags and clients */
305 TagClientLink *tclink;
308 void config_parse(const char *);
310 #endif
311 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80