fix initstatusbar()
[awesome.git] / config.h
blob4e688dda9bb5baa28beab2f182ac57c94f07075c
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 /** Tag type */
84 typedef struct
86 /** Tag name */
87 char *name;
88 /** True if selected */
89 Bool selected;
90 /** True if was selected before selecting others tags */
91 Bool was_selected;
92 /** Current tag layout */
93 Layout *layout;
94 } Tag;
96 typedef struct Client Client;
97 struct Client
99 /** Client name */
100 char name[256];
101 /** Window geometry */
102 int x, y, w, h;
103 /** Real window geometry for floating */
104 int rx, ry, rw, rh;
105 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
106 int minax, maxax, minay, maxay;
107 /** True if client is unmapped */
108 Bool unmapped;
109 long flags;
110 int border, oldborder;
111 Bool isbanned, isfixed, ismax, isfloating, wasfloating;
112 /** Tags for the client */
113 Bool *tags;
114 /** Next client */
115 Client *next;
116 /** Previous client */
117 Client *prev;
118 /** Tabs support */
119 struct
121 /** Next client in tab */
122 Client *next;
123 /** Previous client in tab */
124 Client *prev;
125 /** True if client is the visible one */
126 Bool isvisible;
127 /** True if client is tabbed */
128 } tab;
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;
137 /** First time viewed on new layout */
138 Bool ftview;
141 /** Main configuration structure */
142 struct awesome_config
144 /** Display ref */
145 Display *display;
146 /** Config virtual screen number */
147 int screen;
148 /** Config physical screen */
149 int phys_screen;
150 /** Tag list */
151 Tag *tags;
152 /** Number of tags in **tags */
153 int ntags;
154 /** Layout list */
155 Layout *layouts;
156 /** Number of layouts in *layouts */
157 int nlayouts;
158 /** Rules list */
159 Rule *rules;
160 /** Number of rules in *rules */
161 int nrules;
162 /** Keys binding list */
163 Key *keys;
164 /** Number of keys binding in *keys */
165 int nkeys;
166 /** Default modkey */
167 KeySym modkey;
168 /** Numlock mask */
169 unsigned int numlockmask;
170 /** Default status bar position */
171 int statusbar_default_position;
172 /** Border size */
173 int borderpx;
174 /** Master width factor */
175 double mwfact;
176 /** Number of pixels to snap windows */
177 int snap;
178 /** Number of master windows */
179 int nmaster;
180 /** Number of columns in tile layout */
181 int ncol;
182 /** Transparency of unfocused clients */
183 int opacity_unfocused;
184 /** Focus move pointer */
185 Bool focus_move_pointer;
186 /** Allow floats to be lowered on focus change */
187 Bool allow_lower_floats;
188 /** Respect resize hints */
189 Bool resize_hints;
190 /** Text displayed in bar */
191 char statustext[256];
192 /** Current layout */
193 Layout * current_layout;
194 /** Status bar */
195 Statusbar statusbar;
196 /** Check for XShape extension */
197 Bool have_shape;
198 /** Check for XRandR extension */
199 Bool have_randr;
200 /** Normal colors */
201 XColor colors_normal[ColLast];
202 /** Selected colors */
203 XColor colors_selected[ColLast];
204 /** Tabbed colors */
205 XColor colors_tab[ColLast];
206 /** Cursors */
207 Cursor cursor[CurLast];
208 /** Font */
209 XftFont *font;
210 /** Clients list */
211 Client **clients;
212 /** Focused client */
213 Client **client_sel;
216 void parse_config(Display *, int, const char *, awesome_config *); /* parse configuration file */
218 #endif
219 // vim: filetype=c:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99