fix statusbar display when on right
[awesome.git] / config.h
blobfe0577a687ba7f55d7999bf5c45350d954b73575
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 /** Drawable object */
89 Drawable drawable;
90 /** Screen */
91 int screen;
92 } Statusbar;
94 typedef struct Client Client;
95 struct Client
97 /** Client name */
98 char name[256];
99 /** Window geometry */
100 int x, y, w, h;
101 /** Real window geometry for floating */
102 int rx, ry, rw, rh;
103 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
104 int minax, maxax, minay, maxay;
105 long flags;
106 int border, oldborder;
107 /** Store previous floating state before maximizing */
108 Bool wasfloating;
109 /** True if the window is floating */
110 Bool isfloating;
111 /** True if the window is fixed */
112 Bool isfixed;
113 /** True if the window is maximized */
114 Bool ismax;
115 /** Tags for the client */
116 Bool *tags;
117 /** Next client */
118 Client *next;
119 /** Previous client */
120 Client *prev;
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 /** Master width factor */
145 double mwfact;
146 /** Number of master windows */
147 int nmaster;
148 /** Number of columns in tile layout */
149 int ncol;
150 } Tag;
152 /** Main configuration structure */
153 struct awesome_config
155 /** Display ref */
156 Display *display;
157 /** Config virtual screen number */
158 int screen;
159 /** Config physical screen */
160 int phys_screen;
161 /** Tag list */
162 Tag *tags;
163 /** Number of tags in **tags */
164 int ntags;
165 /** Layout list */
166 Layout *layouts;
167 /** Number of layouts in *layouts */
168 int nlayouts;
169 /** Rules list */
170 Rule *rules;
171 /** Number of rules in *rules */
172 int nrules;
173 /** Keys bindings list */
174 Key *keys;
175 /** Mouse bindings list */
176 struct
178 Button *tag;
179 int ntag;
180 Button *title;
181 int ntitle;
182 Button *layout;
183 int nlayout;
184 } buttons;
185 /** Number of keys binding in *keys */
186 int nkeys;
187 /** Default modkey */
188 KeySym modkey;
189 /** Numlock mask */
190 unsigned int numlockmask;
191 /** Border size */
192 int borderpx;
193 /** Number of pixels to snap windows */
194 int snap;
195 /** Transparency of unfocused clients */
196 int opacity_unfocused;
197 /** Focus move pointer */
198 Bool focus_move_pointer;
199 /** Allow floats to be lowered on focus change */
200 Bool allow_lower_floats;
201 /** Respect resize hints */
202 Bool resize_hints;
203 /** Text displayed in bar */
204 char statustext[256];
205 /** Status bar */
206 Statusbar statusbar;
207 /** Check for XShape extension */
208 Bool have_shape;
209 /** Check for XRandR extension */
210 Bool have_randr;
211 /** Normal colors */
212 XColor colors_normal[ColLast];
213 /** Selected colors */
214 XColor colors_selected[ColLast];
215 /** Cursors */
216 Cursor cursor[CurLast];
217 /** Font */
218 XftFont *font;
219 /** Clients list */
220 Client **clients;
221 /** Path to config file */
222 char *configpath;
225 void parse_config(const char *, awesome_config *);
227 void uicb_reloadconfig(awesome_config *, const char *);
229 #endif
230 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99