really update coords on resize
[awesome.git] / config.h
blob7cc093adec1f244ef8dda86dbb71875800de6f9b
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>
29 /** Bar possible position */
30 enum
31 { BarTop, BarBot, BarOff };
33 enum
34 { ColBorder, ColFG, ColBG, ColLast }; /* color */
36 enum
37 { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
39 typedef struct
41 char *prop;
42 char *tags;
43 Bool isfloating;
44 regex_t *propregex;
45 regex_t *tagregex;
46 } Rule;
48 typedef struct awesome_config awesome_config;
50 typedef struct
52 char *symbol;
53 void (*arrange) (awesome_config *);
54 } Layout;
56 typedef struct
58 unsigned long mod;
59 KeySym keysym;
60 void (*func) (awesome_config *, char *);
61 char *arg;
62 } Key;
64 /** Status bar */
65 typedef struct
67 /** Bar width */
68 int width;
69 /** Bar height */
70 int height;
71 /** Layout txt width */
72 int txtlayoutwidth;
73 /** Bar position */
74 int position;
75 /** Window */
76 Window window;
77 /** Drawable object */
78 Drawable drawable;
79 /** Screen */
80 int screen;
81 } Statusbar;
83 typedef struct Client Client;
84 struct Client
86 /** Client name */
87 char name[256];
88 /** Window geometry */
89 int x, y, w, h;
90 /** Real window geometry for floating */
91 int rx, ry, rw, rh;
92 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
93 int minax, maxax, minay, maxay;
94 long flags;
95 int border, oldborder;
96 /** Store previous floating state before maximizing */
97 Bool wasfloating;
98 /** True if the window is floating */
99 Bool isfloating;
100 /** True if the window is fixed */
101 Bool isfixed;
102 /** True if the window is maximized */
103 Bool ismax;
104 /** Tags for the client */
105 Bool *tags;
106 /** Next client */
107 Client *next;
108 /** Previous client */
109 Client *prev;
110 /** Tabs support */
111 struct
113 /** Next client in tab */
114 Client *next;
115 /** Previous client in tab */
116 Client *prev;
117 /** True if client is the visible one */
118 Bool isvisible;
119 /** True if client is tabbed */
120 } tab;
121 /** Window of the client */
122 Window win;
123 /** Client display */
124 Display *display;
125 /** Client logical screen */
126 int screen;
127 /** Client physical screen */
128 int phys_screen;
131 /** Tag type */
132 typedef struct
134 /** Tag name */
135 char *name;
136 /** True if selected */
137 Bool selected;
138 /** True if was selected before selecting others tags */
139 Bool was_selected;
140 /** Current tag layout */
141 Layout *layout;
142 /** Selected client on this tag */
143 Client *client_sel;
144 } Tag;
146 /** Main configuration structure */
147 struct awesome_config
149 /** Display ref */
150 Display *display;
151 /** Config virtual screen number */
152 int screen;
153 /** Config physical screen */
154 int phys_screen;
155 /** Tag list */
156 Tag *tags;
157 /** Number of tags in **tags */
158 int ntags;
159 /** Layout list */
160 Layout *layouts;
161 /** Number of layouts in *layouts */
162 int nlayouts;
163 /** Rules list */
164 Rule *rules;
165 /** Number of rules in *rules */
166 int nrules;
167 /** Keys binding list */
168 Key *keys;
169 /** Number of keys binding in *keys */
170 int nkeys;
171 /** Default modkey */
172 KeySym modkey;
173 /** Numlock mask */
174 unsigned int numlockmask;
175 /** Default status bar position */
176 int statusbar_default_position;
177 /** Border size */
178 int borderpx;
179 /** Master width factor */
180 double mwfact;
181 /** Number of pixels to snap windows */
182 int snap;
183 /** Number of master windows */
184 int nmaster;
185 /** Number of columns in tile layout */
186 int ncol;
187 /** Transparency of unfocused clients */
188 int opacity_unfocused;
189 /** Focus move pointer */
190 Bool focus_move_pointer;
191 /** Allow floats to be lowered on focus change */
192 Bool allow_lower_floats;
193 /** Respect resize hints */
194 Bool resize_hints;
195 /** Text displayed in bar */
196 char statustext[256];
197 /** Status bar */
198 Statusbar statusbar;
199 /** Check for XShape extension */
200 Bool have_shape;
201 /** Check for XRandR extension */
202 Bool have_randr;
203 /** Normal colors */
204 XColor colors_normal[ColLast];
205 /** Selected colors */
206 XColor colors_selected[ColLast];
207 /** Tabbed colors */
208 XColor colors_tab[ColLast];
209 /** Cursors */
210 Cursor cursor[CurLast];
211 /** Font */
212 XftFont *font;
213 /** Clients list */
214 Client **clients;
215 /** Path to config file */
216 char *configpath;
219 void parse_config(const char *, awesome_config *);
221 void uicb_reloadconfig(awesome_config *, const char *);
223 #endif
224 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99