compute correctly status bar position for left
[awesome.git] / config.h
blob836b63be3ec91ac7ef9db6591421cf11b293a290
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, BarLeft, BarRight, 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 typedef struct Button Button;
65 struct Button
67 unsigned long mod;
68 unsigned int button;
69 void (*func) (awesome_config *, char *);
70 char *arg;
73 /** Status bar */
74 typedef struct
76 /** Bar width */
77 int width;
78 /** Bar height */
79 int height;
80 /** Layout txt width */
81 int txtlayoutwidth;
82 /** Default position */
83 int dposition;
84 /** Bar position */
85 int position;
86 /** Window */
87 Window window;
88 /** Screen */
89 int screen;
90 } Statusbar;
92 typedef struct Client Client;
93 struct Client
95 /** Client name */
96 char name[256];
97 /** Window geometry */
98 int x, y, w, h;
99 /** Real window geometry for floating */
100 int rx, ry, rw, rh;
101 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
102 int minax, maxax, minay, maxay;
103 long flags;
104 int border, oldborder;
105 /** Store previous floating state before maximizing */
106 Bool wasfloating;
107 /** True if the window is floating */
108 Bool isfloating;
109 /** True if the window is fixed */
110 Bool isfixed;
111 /** True if the window is maximized */
112 Bool ismax;
113 /** Tags for the client */
114 Bool *tags;
115 /** Next client */
116 Client *next;
117 /** Previous client */
118 Client *prev;
119 /** Window of the client */
120 Window win;
121 /** Client display */
122 Display *display;
123 /** Client logical screen */
124 int screen;
125 /** Client physical screen */
126 int phys_screen;
129 /** Tag type */
130 typedef struct
132 /** Tag name */
133 char *name;
134 /** True if selected */
135 Bool selected;
136 /** True if was selected before selecting others tags */
137 Bool was_selected;
138 /** Current tag layout */
139 Layout *layout;
140 /** Selected client on this tag */
141 Client *client_sel;
142 /** Master width factor */
143 double mwfact;
144 /** Number of master windows */
145 int nmaster;
146 /** Number of columns in tile layout */
147 int ncol;
148 } Tag;
150 /** Main configuration structure */
151 struct awesome_config
153 /** Display ref */
154 Display *display;
155 /** Config virtual screen number */
156 int screen;
157 /** Config physical screen */
158 int phys_screen;
159 /** Tag list */
160 Tag *tags;
161 /** Number of tags in **tags */
162 int ntags;
163 /** Layout list */
164 Layout *layouts;
165 /** Number of layouts in *layouts */
166 int nlayouts;
167 /** Rules list */
168 Rule *rules;
169 /** Number of rules in *rules */
170 int nrules;
171 /** Keys bindings list */
172 Key *keys;
173 /** Mouse bindings list */
174 struct
176 Button *tag;
177 int ntag;
178 Button *title;
179 int ntitle;
180 Button *layout;
181 int nlayout;
182 } buttons;
183 /** Number of keys binding in *keys */
184 int nkeys;
185 /** Default modkey */
186 KeySym modkey;
187 /** Numlock mask */
188 unsigned int numlockmask;
189 /** Border size */
190 int borderpx;
191 /** Number of pixels to snap windows */
192 int snap;
193 /** Transparency of unfocused clients */
194 int opacity_unfocused;
195 /** Focus move pointer */
196 Bool focus_move_pointer;
197 /** Allow floats to be lowered on focus change */
198 Bool allow_lower_floats;
199 /** Respect resize hints */
200 Bool resize_hints;
201 /** Text displayed in bar */
202 char statustext[256];
203 /** Status bar */
204 Statusbar statusbar;
205 /** Check for XShape extension */
206 Bool have_shape;
207 /** Check for XRandR extension */
208 Bool have_randr;
209 /** Normal colors */
210 XColor colors_normal[ColLast];
211 /** Selected colors */
212 XColor colors_selected[ColLast];
213 /** Cursors */
214 Cursor cursor[CurLast];
215 /** Font */
216 XftFont *font;
217 /** Clients list */
218 Client **clients;
219 /** Path to config file */
220 char *configpath;
223 void parse_config(const char *, awesome_config *);
225 void uicb_reloadconfig(awesome_config *, const char *);
227 #endif
228 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99