typedef enum Alignment
[awesome.git] / config.h
blobc1429ff12253d609dc607070efab3549e1944fbb
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 /** Location on status bar */
110 int location;
111 /** Widget width */
112 int width;
113 /** Buttons bindings */
114 Button *buttons;
115 /** Font */
116 XftFont *font;
117 /** Next widget */
118 Widget *next;
121 /** Status bar */
122 struct Statusbar
124 /** Statusbar name */
125 char *name;
126 /** Bar width */
127 int width;
128 /** Bar height */
129 int height;
130 /** Layout txt width */
131 int txtlayoutwidth;
132 /** Default position */
133 Position dposition;
134 /** Bar position */
135 Position position;
136 /** Window */
137 Window window;
138 /** Screen */
139 int screen;
140 /** Widget list */
141 Widget *widgets;
142 /** Drawable */
143 Drawable drawable;
144 /** Next statusbar */
145 Statusbar *next;
148 typedef struct Client Client;
149 struct Client
151 /** Client name */
152 char name[256];
153 /** Window geometry */
154 int x, y, w, h;
155 /** Real window geometry for floating */
156 int rx, ry, rw, rh;
157 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
158 int minax, maxax, minay, maxay;
159 long flags;
160 int border, oldborder;
161 /** Has urgency hint */
162 Bool isurgent;
163 /** Store previous floating state before maximizing */
164 Bool wasfloating;
165 /** True if the window is floating */
166 Bool isfloating;
167 /** True if the window is fixed */
168 Bool isfixed;
169 /** True if the window is maximized */
170 Bool ismax;
171 /** True if the client must be skipped from client list */
172 Bool skip;
173 /** True if the client must be skipped from task bar client list */
174 Bool skiptb;
175 /** Next client */
176 Client *next;
177 /** Previous client */
178 Client *prev;
179 /** Window of the client */
180 Window win;
181 /** Client logical screen */
182 int screen;
185 typedef struct FocusList FocusList;
186 struct FocusList
188 Client *client;
189 FocusList *prev;
192 /** Tag type */
193 typedef struct Tag Tag;
194 struct Tag
196 /** Tag name */
197 char *name;
198 /** True if selected */
199 Bool selected;
200 /** True if was selected before selecting others tags */
201 Bool was_selected;
202 /** Current tag layout */
203 Layout *layout;
204 /** Master width factor */
205 double mwfact;
206 /** Number of master windows */
207 int nmaster;
208 /** Number of columns in tile layout */
209 int ncol;
210 /** Next tag */
211 Tag *next;
214 /** TagClientLink type */
215 typedef struct TagClientLink TagClientLink;
216 struct TagClientLink
218 Tag *tag;
219 Client *client;
220 TagClientLink *next;
223 /** Padding type */
224 typedef struct
226 /** Padding at top */
227 int top;
228 /** Padding at bottom */
229 int bottom;
230 /** Padding at left */
231 int left;
232 /** Padding at right */
233 int right;
234 } Padding;
236 typedef struct
238 /** Number of pixels to snap windows */
239 int snap;
240 /** Border size */
241 int borderpx;
242 /** Transparency of unfocused clients */
243 int opacity_unfocused;
244 /** Focus move pointer */
245 Bool focus_move_pointer;
246 /** Allow floats to be lowered on focus change */
247 Bool allow_lower_floats;
248 /** Respect resize hints */
249 Bool resize_hints;
250 /** Sloppy focus: focus follow mouse */
251 Bool sloppy_focus;
252 /** True if new clients should become master */
253 Bool new_become_master;
254 /** Normal colors */
255 XColor colors_normal[ColLast];
256 /** Selected colors */
257 XColor colors_selected[ColLast];
258 /** Urgency colors */
259 XColor colors_urgent[ColLast];
260 /** Tag list */
261 Tag *tags;
262 /** Layout list */
263 Layout *layouts;
264 /** Status bar */
265 Statusbar *statusbar;
266 /** Padding */
267 Padding padding;
268 /** Font */
269 XftFont *font;
270 } VirtScreen;
272 /** Main configuration structure */
273 struct AwesomeConf
275 /** Display ref */
276 Display *display;
277 /** Logical screens */
278 VirtScreen *screens;
279 /** Rules list */
280 Rule *rules;
281 /** Keys bindings list */
282 Key *keys;
283 /** Mouse bindings list */
284 struct
286 Button *root;
287 Button *client;
288 } buttons;
289 /** Numlock mask */
290 unsigned int numlockmask;
291 /** Check for XShape extension */
292 Bool have_shape;
293 /** Check for XRandR extension */
294 Bool have_randr;
295 /** Cursors */
296 Cursor cursor[CurLast];
297 /** Clients list */
298 Client *clients;
299 /** Path to config file */
300 char *configpath;
301 /** Selected clients on this tag */
302 FocusList *focus;
303 /** Link between tags and clients */
304 TagClientLink *tclink;
307 void config_parse(const char *);
309 #endif
310 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80