add uicb_setncols(), clean config, really use config in tile.c
[awesome.git] / config.h
blob865b433d4ce7ab01bbc49d76c9ed70190a03b765
1 /*
2 * config.h - configuration management header
3 *
4 * Copyright © 2007 Julien Danjou <julien@danjou.info>
5 *
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 #define AWESOME_CONFIG_FILE ".awesomerc"
27 #include <X11/Xlib.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 int x, y, w, h;
42 unsigned long norm[ColLast];
43 unsigned long sel[ColLast];
44 Drawable drawable;
45 GC gc;
46 Cursor cursor[CurLast];
47 struct
49 int ascent;
50 int descent;
51 int height;
52 XFontSet set;
53 XFontStruct *xfont;
54 } font;
55 } DC;
57 typedef struct
59 const char *prop;
60 const char *tags;
61 Bool isfloating;
62 } Rule;
64 typedef struct awesome_config awesome_config;
66 typedef struct
68 const char *symbol;
69 void (*arrange) (Display *, awesome_config *);
70 } Layout;
72 typedef struct
74 unsigned long mod;
75 KeySym keysym;
76 void (*func) (Display *, DC *, awesome_config *, const char *);
77 const char *arg;
78 } Key;
80 /** Status bar */
81 typedef struct
83 /** Bar width */
84 int width;
85 /** Bar height */
86 int height;
87 /** Bar position */
88 int position;
89 /** Window */
90 Window window;
91 } Statusbar;
93 /** Main configuration structure */
94 struct awesome_config
96 /** Tag list */
97 const char **tags;
98 /** Selected tags */
99 Bool *selected_tags;
100 /* Previously selected tags */
101 Bool *prev_selected_tags;
102 /** Number of tags in **tags */
103 int ntags;
104 /** Layout list */
105 Layout *layouts;
106 /** Number of layouts in *layouts */
107 int nlayouts;
108 /** Store layout for eatch tag */
109 Layout **tag_layouts;
110 /** Rules list */
111 Rule *rules;
112 /** Number of rules in *rules */
113 int nrules;
114 /** Keys binding list */
115 Key *keys;
116 /** Number of keys binding in *keys */
117 int nkeys;
118 /** Default modkey */
119 KeySym modkey;
120 /** Numlock mask */
121 unsigned int numlockmask;
122 /** Default status bar position */
123 int statusbar_default_position;
124 /** Border size */
125 int borderpx;
126 /** Master width factor */
127 double mwfact;
128 /** Number of pixels to snap windows */
129 int snap;
130 /** Number of master windows */
131 int nmaster;
132 /** Number of columns in tile layout */
133 int ncols;
134 /** Transparency of unfocused clients */
135 int opacity_unfocused;
136 /** Respect resize hints */
137 Bool resize_hints;
138 /** Text displayed in bar */
139 char statustext[256];
140 /** Current layout */
141 Layout * current_layout;
142 /** Status bar */
143 Statusbar statusbar;
144 /** Check for XShape extension */
145 Bool have_shape;
146 /** Check for XRandR extension */
147 Bool have_randr;
150 void parse_config(Display *, int, DC *, awesome_config *); /* parse configuration file */
152 #endif