add Aldo as AUTHORS
[awesome.git] / config.h
blob2b326f086ac90fc70c985825fe3b57c1ceb5d365
1 /*
2 * config.h - configuration management header
4 * Copyright © 2007 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 <X11/Xlib.h>
26 #include <X11/Xft/Xft.h>
27 #include <regex.h>
28 #include <draw.h>
30 /** Bar possible position */
31 enum
32 { BarTop, BarBot, BarLeft, BarRight, BarOff };
34 enum
35 { ColBorder, ColFG, ColBG, ColLast }; /* color */
37 enum
38 { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
40 typedef struct Rule Rule;
41 struct Rule
43 char *prop;
44 char *tags;
45 int screen;
46 Bool isfloating;
47 regex_t *propregex;
48 regex_t *tagregex;
49 Rule *next;
52 typedef struct AwesomeConf AwesomeConf;
54 typedef struct Layout Layout;
55 struct Layout
57 char *symbol;
58 void (*arrange) (int);
59 Layout *next;
62 typedef struct Key Key;
63 struct Key
65 unsigned long mod;
66 KeySym keysym;
67 void (*func) (int, char *);
68 char *arg;
69 Key *next;
72 typedef struct Button Button;
73 struct Button
75 unsigned long mod;
76 unsigned int button;
77 void (*func) (int, char *);
78 char *arg;
79 Button *next;
82 /** Status bar */
83 typedef struct Widget Widget;
84 typedef struct
86 /** Bar width */
87 int width;
88 /** Bar height */
89 int height;
90 /** Layout txt width */
91 int txtlayoutwidth;
92 /** Default position */
93 int dposition;
94 /** Bar position */
95 int position;
96 /** Window */
97 Window window;
98 /** Screen */
99 int screen;
100 /** Screen */
101 Widget *widgets;
102 } Statusbar;
104 typedef struct Client Client;
105 struct Client
107 /** Client name */
108 char name[256];
109 /** Window geometry */
110 int x, y, w, h;
111 /** Real window geometry for floating */
112 int rx, ry, rw, rh;
113 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
114 int minax, maxax, minay, maxay;
115 long flags;
116 int border, oldborder;
117 /** Store previous floating state before maximizing */
118 Bool wasfloating;
119 /** True if the window is floating */
120 Bool isfloating;
121 /** True if the window is fixed */
122 Bool isfixed;
123 /** True if the window is maximized */
124 Bool ismax;
125 /** Next client */
126 Client *next;
127 /** Previous client */
128 Client *prev;
129 /** Window of the client */
130 Window win;
131 /** Client display */
132 Display *display;
133 /** Client logical screen */
134 int screen;
135 /** Client physical screen */
136 int phys_screen;
139 typedef struct FocusList FocusList;
140 struct FocusList
142 Client *client;
143 FocusList *prev;
146 /** Tag type */
147 typedef struct Tag Tag;
148 struct Tag
150 /** Tag name */
151 char *name;
152 /** True if selected */
153 Bool selected;
154 /** True if was selected before selecting others tags */
155 Bool was_selected;
156 /** Current tag layout */
157 Layout *layout;
158 /** Master width factor */
159 double mwfact;
160 /** Number of master windows */
161 int nmaster;
162 /** Number of columns in tile layout */
163 int ncol;
164 /** Next tag */
165 Tag *next;
168 /** TagClientLink type */
169 typedef struct TagClientLink TagClientLink;
170 struct TagClientLink
172 Tag *tag;
173 Client *client;
174 TagClientLink *next;
177 /** Padding type */
178 typedef struct
180 /** Padding at top */
181 int top;
182 /** Padding at bottom */
183 int bottom;
184 /** Padding at left */
185 int left;
186 /** Padding at right */
187 int right;
188 } Padding;
190 typedef struct
192 /** Number of pixels to snap windows */
193 int snap;
194 /** Border size */
195 int borderpx;
196 /** Transparency of unfocused clients */
197 int opacity_unfocused;
198 /** Focus move pointer */
199 Bool focus_move_pointer;
200 /** Allow floats to be lowered on focus change */
201 Bool allow_lower_floats;
202 /** Respect resize hints */
203 Bool resize_hints;
204 /** Normal colors */
205 XColor colors_normal[ColLast];
206 /** Selected colors */
207 XColor colors_selected[ColLast];
208 /** Tag list */
209 Tag *tags;
210 TagClientLink *tclink;
211 /** Layout list */
212 Layout *layouts;
213 /** Status bar */
214 Statusbar *statusbar;
215 /** Padding */
216 Padding padding;
217 /** Font */
218 XftFont *font;
219 } VirtScreen;
222 struct Widget
224 char *name;
225 int (*draw)(Widget *, DrawCtx *, int, int);
226 void (*tell)(Widget *, char *);
227 Statusbar *statusbar;
228 int alignment;
229 void *data;
230 Widget *next;
234 /** Main configuration structure */
235 struct AwesomeConf
237 /** Display ref */
238 Display *display;
239 /** Logical screens */
240 VirtScreen *screens;
241 /** Rules list */
242 Rule *rules;
243 /** Keys bindings list */
244 Key *keys;
245 /** Mouse bindings list */
246 struct
248 Button *tag;
249 Button *title;
250 Button *layout;
251 Button *root;
252 Button *client;
253 } buttons;
254 /** Numlock mask */
255 unsigned int numlockmask;
256 /** Check for XShape extension */
257 Bool have_shape;
258 /** Check for XRandR extension */
259 Bool have_randr;
260 /** Cursors */
261 Cursor cursor[CurLast];
262 /** Clients list */
263 Client *clients;
264 /** Path to config file */
265 char *configpath;
266 /** Selected clients on this tag */
267 FocusList *focus;
270 void config_parse(const char *);
272 #endif
273 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80