simplify manage(), remove screen arg
[awesome.git] / config.h
blobce2c1571db0c09c4f41daa383f28eedb13b2043e
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 GC gc;
45 Cursor cursor[CurLast];
46 struct
48 int ascent;
49 int descent;
50 int height;
51 XFontSet set;
52 XFontStruct *xfont;
53 } font;
54 } DC;
56 typedef struct
58 char *prop;
59 char *tags;
60 Bool isfloating;
61 } Rule;
63 typedef struct awesome_config awesome_config;
65 typedef struct
67 char *symbol;
68 void (*arrange) (Display *, int, awesome_config *);
69 } Layout;
71 typedef struct
73 unsigned long mod;
74 KeySym keysym;
75 void (*func) (Display *, int, DC *, awesome_config *, char *);
76 char *arg;
77 } Key;
79 /** Status bar */
80 typedef struct
82 /** Bar width */
83 int width;
84 /** Bar height */
85 int height;
86 /** Bar position */
87 int position;
88 /** Window */
89 Window window;
90 /** Drawable object */
91 Drawable drawable;
92 /** Screen */
93 int screen;
94 } Statusbar;
96 /** Main configuration structure */
97 struct awesome_config
99 /** Config screen number */
100 int screen;
101 /** Tag list */
102 char **tags;
103 /** Selected tags */
104 Bool *selected_tags;
105 /* Previously selected tags */
106 Bool *prev_selected_tags;
107 /** Number of tags in **tags */
108 int ntags;
109 /** Layout list */
110 Layout *layouts;
111 /** Number of layouts in *layouts */
112 int nlayouts;
113 /** Store layout for eatch tag */
114 Layout **tag_layouts;
115 /** Rules list */
116 Rule *rules;
117 /** Number of rules in *rules */
118 int nrules;
119 /** Keys binding list */
120 Key *keys;
121 /** Number of keys binding in *keys */
122 int nkeys;
123 /** Default modkey */
124 KeySym modkey;
125 /** Numlock mask */
126 unsigned int numlockmask;
127 /** Default status bar position */
128 int statusbar_default_position;
129 /** Border size */
130 int borderpx;
131 /** Master width factor */
132 double mwfact;
133 /** Number of pixels to snap windows */
134 int snap;
135 /** Number of master windows */
136 int nmaster;
137 /** Number of columns in tile layout */
138 int ncols;
139 /** Transparency of unfocused clients */
140 int opacity_unfocused;
141 /** Respect resize hints */
142 Bool resize_hints;
143 /** Text displayed in bar */
144 char statustext[256];
145 /** Current layout */
146 Layout * current_layout;
147 /** Status bar */
148 Statusbar statusbar;
149 /** Check for XShape extension */
150 Bool have_shape;
151 /** Check for XRandR extension */
152 Bool have_randr;
155 void parse_config(Display *, int, DC *, awesome_config *); /* parse configuration file */
157 #endif