remove unused variable
[awesome.git] / config.h
blob75450716445361c0d406cafab2d4cfcc183b39cd
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 Key Key;
63 struct Key
65 unsigned long mod;
66 KeySym keysym;
67 Uicb *func;
68 char *arg;
69 Key *next;
72 typedef struct Button Button;
73 struct Button
75 unsigned long mod;
76 unsigned int button;
77 Uicb *func;
78 char *arg;
79 Button *next;
82 /** Widget */
83 typedef struct Widget Widget;
84 typedef struct Statusbar Statusbar;
85 struct Widget
87 /** Widget name */
88 char *name;
89 /** Draw function */
90 int (*draw)(Widget *, DrawCtx *, int, int);
91 /** Update function */
92 void (*tell)(Widget *, char *);
93 /** ButtonPressedEvent handler */
94 void (*button_press)(Widget *, XButtonPressedEvent *);
95 /** Statusbar */
96 Statusbar *statusbar;
97 /** Alignement */
98 Alignment alignment;
99 /** Misc private data */
100 void *data;
101 /** True if user supplied coords */
102 Bool user_supplied_x;
103 Bool user_supplied_y;
104 /** Area */
105 Area area;
106 /** Buttons bindings */
107 Button *buttons;
108 /** Font */
109 XftFont *font;
110 /** Next widget */
111 Widget *next;
114 /** Status bar */
115 struct Statusbar
117 /** Statusbar name */
118 char *name;
119 /** Bar width */
120 int width;
121 /** Bar height */
122 int height;
123 /** Layout txt width */
124 int txtlayoutwidth;
125 /** Default position */
126 Position dposition;
127 /** Bar position */
128 Position position;
129 /** Window */
130 Window window;
131 /** Screen */
132 int screen;
133 /** Widget list */
134 Widget *widgets;
135 /** Drawable */
136 Drawable drawable;
137 /** Next statusbar */
138 Statusbar *next;
141 typedef struct Client Client;
142 struct Client
144 /** Client name */
145 char name[256];
146 /** Window geometry */
147 Area geometry;
148 /** Floating window geometry */
149 Area f_geometry;
150 /** Max window geometry */
151 Area m_geometry;
152 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
153 int minax, maxax, minay, maxay;
154 int border, oldborder;
155 /** Has urgency hint */
156 Bool isurgent;
157 /** Store previous floating state before maximizing */
158 Bool wasfloating;
159 /** True if the window is floating */
160 Bool isfloating;
161 /** True if the window is fixed */
162 Bool isfixed;
163 /** True if the window is maximized */
164 Bool ismax;
165 /** True if the client must be skipped from client list */
166 Bool skip;
167 /** True if the client must be skipped from task bar client list */
168 Bool skiptb;
169 /** Next client */
170 Client *next;
171 /** Previous client */
172 Client *prev;
173 /** Window of the client */
174 Window win;
175 /** Client logical screen */
176 int screen;
179 typedef struct FocusList FocusList;
180 struct FocusList
182 Client *client;
183 FocusList *prev;
186 /** Tag type */
187 typedef struct Tag Tag;
188 struct Tag
190 /** Tag name */
191 char *name;
192 /** True if selected */
193 Bool selected;
194 /** True if was selected before selecting others tags */
195 Bool was_selected;
196 /** Current tag layout */
197 Layout *layout;
198 /** Master width factor */
199 double mwfact;
200 /** Number of master windows */
201 int nmaster;
202 /** Number of columns in tile layout */
203 int ncol;
204 /** Next tag */
205 Tag *next;
208 /** TagClientLink type */
209 typedef struct TagClientLink TagClientLink;
210 struct TagClientLink
212 Tag *tag;
213 Client *client;
214 TagClientLink *next;
217 /** Padding type */
218 typedef struct
220 /** Padding at top */
221 int top;
222 /** Padding at bottom */
223 int bottom;
224 /** Padding at left */
225 int left;
226 /** Padding at right */
227 int right;
228 } Padding;
230 typedef struct
232 /** Number of pixels to snap windows */
233 int snap;
234 /** Border size */
235 int borderpx;
236 /** Transparency of unfocused clients */
237 int opacity_unfocused;
238 /** Focus move pointer */
239 Bool focus_move_pointer;
240 /** Allow floats to be lowered on focus change */
241 Bool allow_lower_floats;
242 /** Respect resize hints */
243 Bool resize_hints;
244 /** Sloppy focus: focus follow mouse */
245 Bool sloppy_focus;
246 /** True if new clients should become master */
247 Bool new_become_master;
248 /** Normal colors */
249 XColor colors_normal[ColLast];
250 /** Selected colors */
251 XColor colors_selected[ColLast];
252 /** Urgency colors */
253 XColor colors_urgent[ColLast];
254 /** Tag list */
255 Tag *tags;
256 /** Layout list */
257 Layout *layouts;
258 /** Status bar */
259 Statusbar *statusbar;
260 /** Padding */
261 Padding padding;
262 /** Font */
263 XftFont *font;
264 } VirtScreen;
266 /** Main configuration structure */
267 struct AwesomeConf
269 /** Display ref */
270 Display *display;
271 /** Logical screens */
272 VirtScreen *screens;
273 /** Rules list */
274 Rule *rules;
275 /** Keys bindings list */
276 Key *keys;
277 /** Mouse bindings list */
278 struct
280 Button *root;
281 Button *client;
282 } buttons;
283 /** Numlock mask */
284 unsigned int numlockmask;
285 /** Check for XShape extension */
286 Bool have_shape;
287 /** Check for XRandR extension */
288 Bool have_randr;
289 /** Cursors */
290 Cursor cursor[CurLast];
291 /** Clients list */
292 Client *clients;
293 /** Path to config file */
294 char *configpath;
295 /** Selected clients on this tag */
296 FocusList *focus;
297 /** Link between tags and clients */
298 TagClientLink *tclink;
301 void config_parse(const char *);
303 #endif
304 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80