manpage update (scale, max and awesomerc(1))
[awesome.git] / config.h
blob2b065c540468ea823be8634b05996e32e0bf731c
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 /** 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 Area geometry;
155 /** Floating window geometry */
156 Area f_geometry;
157 /** Max window geometry */
158 Area m_geometry;
159 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
160 int minax, maxax, minay, maxay;
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