don't stick textbox size to the first textsize sent via widget_tell
[awesome.git] / config.h
blobcfb500f73df60e4e5bbe4aa4a36fca0b9713f65a
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 /** Common colors */
35 enum
36 { ColBorder, ColFG, ColBG, ColLast };
38 enum
39 { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
41 typedef struct Rule Rule;
42 struct Rule
44 char *prop;
45 char *tags;
46 char *icon;
47 int screen;
48 Bool isfloating;
49 regex_t *propregex;
50 regex_t *tagregex;
51 Rule *next;
54 typedef struct AwesomeConf AwesomeConf;
56 typedef struct Layout Layout;
57 struct Layout
59 char *image;
60 void (*arrange) (int);
61 Layout *next;
64 typedef struct Key Key;
65 struct Key
67 unsigned long mod;
68 KeySym keysym;
69 void (*func) (int, char *);
70 char *arg;
71 Key *next;
74 typedef struct Button Button;
75 struct Button
77 unsigned long mod;
78 unsigned int button;
79 void (*func) (int, char *);
80 char *arg;
81 Button *next;
84 /** Widget */
85 typedef struct Widget Widget;
86 typedef struct Statusbar Statusbar;
87 struct Widget
89 /** Widget name */
90 char *name;
91 /** Draw function */
92 int (*draw)(Widget *, DrawCtx *, int, int);
93 /** Update function */
94 void (*tell)(Widget *, char *);
95 /** ButtonPressedEvent handler */
96 void (*button_press)(Widget *, XButtonPressedEvent *);
97 /** Statusbar */
98 Statusbar *statusbar;
99 /** Alignement */
100 int alignment;
101 /** Misc private data */
102 void *data;
103 /** Location on status bar */
104 int location;
105 /** Widget width */
106 int width;
107 /** Buttons bindings */
108 Button *buttons;
109 /** Font */
110 XftFont *font;
111 /** Next widget */
112 Widget *next;
115 /** Status bar */
116 struct Statusbar
118 /** Statusbar name */
119 char *name;
120 /** Bar width */
121 int width;
122 /** Bar height */
123 int height;
124 /** Layout txt width */
125 int txtlayoutwidth;
126 /** Default position */
127 int dposition;
128 /** Bar position */
129 int position;
130 /** Window */
131 Window window;
132 /** Screen */
133 int screen;
134 /** Widget list */
135 Widget *widgets;
136 /** Drawable */
137 Drawable drawable;
138 /** Next statusbar */
139 Statusbar *next;
142 typedef struct Client Client;
143 struct Client
145 /** Client name */
146 char name[256];
147 /** Window geometry */
148 int x, y, w, h;
149 /** Real window geometry for floating */
150 int rx, ry, rw, rh;
151 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
152 int minax, maxax, minay, maxay;
153 long flags;
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 /** Next client */
168 Client *next;
169 /** Previous client */
170 Client *prev;
171 /** Window of the client */
172 Window win;
173 /** Client logical screen */
174 int screen;
175 /** Client physical screen */
176 int phys_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 /** Normal colors */
245 XColor colors_normal[ColLast];
246 /** Selected colors */
247 XColor colors_selected[ColLast];
248 /** Urgency colors */
249 XColor colors_urgent[ColLast];
250 /** Tag list */
251 Tag *tags;
252 /** Layout list */
253 Layout *layouts;
254 /** Status bar */
255 Statusbar *statusbar;
256 /** Padding */
257 Padding padding;
258 /** Font */
259 XftFont *font;
260 } VirtScreen;
262 /** Main configuration structure */
263 struct AwesomeConf
265 /** Display ref */
266 Display *display;
267 /** Logical screens */
268 VirtScreen *screens;
269 /** Rules list */
270 Rule *rules;
271 /** Keys bindings list */
272 Key *keys;
273 /** Mouse bindings list */
274 struct
276 Button *root;
277 Button *client;
278 } buttons;
279 /** Numlock mask */
280 unsigned int numlockmask;
281 /** Check for XShape extension */
282 Bool have_shape;
283 /** Check for XRandR extension */
284 Bool have_randr;
285 /** Cursors */
286 Cursor cursor[CurLast];
287 /** Clients list */
288 Client *clients;
289 /** Path to config file */
290 char *configpath;
291 /** Selected clients on this tag */
292 FocusList *focus;
293 /** Link between tags and clients */
294 TagClientLink *tclink;
297 void config_parse(const char *);
299 #endif
300 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=80