rename uicb_toggletag to uicb_client_toggletag
[awesome.git] / config.h
blob70c6d58497e90f899d79d71ed3fd34057464dbd4
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 Rule Rule;
40 struct Rule
42 char *prop;
43 char *tags;
44 int screen;
45 Bool isfloating;
46 regex_t *propregex;
47 regex_t *tagregex;
48 Rule *next;
51 typedef struct awesome_config awesome_config;
53 typedef struct
55 char *symbol;
56 void (*arrange) (awesome_config *);
57 } Layout;
59 typedef struct Key Key;
60 struct Key
62 unsigned long mod;
63 KeySym keysym;
64 void (*func) (awesome_config *, char *);
65 char *arg;
66 Key *next;
69 typedef struct Button Button;
70 struct Button
72 unsigned long mod;
73 unsigned int button;
74 void (*func) (awesome_config *, char *);
75 char *arg;
76 Button *next;
79 /** Status bar */
80 typedef struct
82 /** Bar width */
83 int width;
84 /** Bar height */
85 int height;
86 /** Layout txt width */
87 int txtlayoutwidth;
88 /** Default position */
89 int dposition;
90 /** Bar position */
91 int position;
92 /** Window */
93 Window window;
94 /** Screen */
95 int screen;
96 } Statusbar;
98 typedef struct Client Client;
99 struct Client
101 /** Client name */
102 char name[256];
103 /** Window geometry */
104 int x, y, w, h;
105 /** Real window geometry for floating */
106 int rx, ry, rw, rh;
107 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
108 int minax, maxax, minay, maxay;
109 long flags;
110 int border, oldborder;
111 /** Store previous floating state before maximizing */
112 Bool wasfloating;
113 /** True if the window is floating */
114 Bool isfloating;
115 /** True if the window is fixed */
116 Bool isfixed;
117 /** True if the window is maximized */
118 Bool ismax;
119 /** Tags for the client */
120 Bool *tags;
121 /** Next client */
122 Client *next;
123 /** Previous client */
124 Client *prev;
125 /** Window of the client */
126 Window win;
127 /** Client display */
128 Display *display;
129 /** Client logical screen */
130 int screen;
131 /** Client physical screen */
132 int phys_screen;
135 /** Tag type */
136 typedef struct
138 /** Tag name */
139 char *name;
140 /** True if selected */
141 Bool selected;
142 /** True if was selected before selecting others tags */
143 Bool was_selected;
144 /** Current tag layout */
145 Layout *layout;
146 /** Selected client on this tag */
147 Client *client_sel;
148 /** Master width factor */
149 double mwfact;
150 /** Number of master windows */
151 int nmaster;
152 /** Number of columns in tile layout */
153 int ncol;
154 } Tag;
156 /** Main configuration structure */
157 struct awesome_config
159 /** Display ref */
160 Display *display;
161 /** Config virtual screen number */
162 int screen;
163 /** Config physical screen */
164 int phys_screen;
165 /** Tag list */
166 Tag *tags;
167 /** Number of tags in **tags */
168 int ntags;
169 /** Layout list */
170 Layout *layouts;
171 int nlayouts;
172 /** Rules list */
173 Rule *rules;
174 /** Keys bindings list */
175 Key *keys;
176 /** Mouse bindings list */
177 struct
179 Button *tag;
180 Button *title;
181 Button *layout;
182 Button *root;
183 Button *client;
184 } buttons;
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