use Area as arg for client_resize
[awesome.git] / config.h
blob9164903cab1d8534d6612903d5600069150bc044
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 Area geometry;
156 /** Floating window geometry */
157 Area f_geometry;
158 /** Max window geometry */
159 Area m_geometry;
160 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
161 int minax, maxax, minay, maxay;
162 int border, oldborder;
163 /** Has urgency hint */
164 Bool isurgent;
165 /** Store previous floating state before maximizing */
166 Bool wasfloating;
167 /** True if the window is floating */
168 Bool isfloating;
169 /** True if the window is fixed */
170 Bool isfixed;
171 /** True if the window is maximized */
172 Bool ismax;
173 /** True if the client must be skipped from client list */
174 Bool skip;
175 /** True if the client must be skipped from task bar client list */
176 Bool skiptb;
177 /** Next client */
178 Client *next;
179 /** Previous client */
180 Client *prev;
181 /** Window of the client */
182 Window win;
183 /** Client logical screen */
184 int screen;
187 typedef struct FocusList FocusList;
188 struct FocusList
190 Client *client;
191 FocusList *prev;
194 /** Tag type */
195 typedef struct Tag Tag;
196 struct Tag
198 /** Tag name */
199 char *name;
200 /** True if selected */
201 Bool selected;
202 /** True if was selected before selecting others tags */
203 Bool was_selected;
204 /** Current tag layout */
205 Layout *layout;
206 /** Master width factor */
207 double mwfact;
208 /** Number of master windows */
209 int nmaster;
210 /** Number of columns in tile layout */
211 int ncol;
212 /** Next tag */
213 Tag *next;
216 /** TagClientLink type */
217 typedef struct TagClientLink TagClientLink;
218 struct TagClientLink
220 Tag *tag;
221 Client *client;
222 TagClientLink *next;
225 /** Padding type */
226 typedef struct
228 /** Padding at top */
229 int top;
230 /** Padding at bottom */
231 int bottom;
232 /** Padding at left */
233 int left;
234 /** Padding at right */
235 int right;
236 } Padding;
238 typedef struct
240 /** Number of pixels to snap windows */
241 int snap;
242 /** Border size */
243 int borderpx;
244 /** Transparency of unfocused clients */
245 int opacity_unfocused;
246 /** Focus move pointer */
247 Bool focus_move_pointer;
248 /** Allow floats to be lowered on focus change */
249 Bool allow_lower_floats;
250 /** Respect resize hints */
251 Bool resize_hints;
252 /** Sloppy focus: focus follow mouse */
253 Bool sloppy_focus;
254 /** True if new clients should become master */
255 Bool new_become_master;
256 /** Normal colors */
257 XColor colors_normal[ColLast];
258 /** Selected colors */
259 XColor colors_selected[ColLast];
260 /** Urgency colors */
261 XColor colors_urgent[ColLast];
262 /** Tag list */
263 Tag *tags;
264 /** Layout list */
265 Layout *layouts;
266 /** Status bar */
267 Statusbar *statusbar;
268 /** Padding */
269 Padding padding;
270 /** Font */
271 XftFont *font;
272 } VirtScreen;
274 /** Main configuration structure */
275 struct AwesomeConf
277 /** Display ref */
278 Display *display;
279 /** Logical screens */
280 VirtScreen *screens;
281 /** Rules list */
282 Rule *rules;
283 /** Keys bindings list */
284 Key *keys;
285 /** Mouse bindings list */
286 struct
288 Button *root;
289 Button *client;
290 } buttons;
291 /** Numlock mask */
292 unsigned int numlockmask;
293 /** Check for XShape extension */
294 Bool have_shape;
295 /** Check for XRandR extension */
296 Bool have_randr;
297 /** Cursors */
298 Cursor cursor[CurLast];
299 /** Clients list */
300 Client *clients;
301 /** Path to config file */
302 char *configpath;
303 /** Selected clients on this tag */
304 FocusList *focus;
305 /** Link between tags and clients */
306 TagClientLink *tclink;
309 void config_parse(const char *);
311 #endif
312 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80