diff options
| author | Anselm R. Garbe <garbeam@gmail.com> | 2007-09-16 10:23:53 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <garbeam@gmail.com> | 2007-09-16 10:23:53 +0200 |
| commit | a026617c657bea56d93b586b50a016477d52cc85 (patch) | |
| tree | 3c178ac7bf79ec7e0c5323716c61bfc5f4d49a3a | |
| parent | ordered function forward definitions (diff) | |
| download | dwm-a026617c657bea56d93b586b50a016477d52cc85.tar.gz dwm-a026617c657bea56d93b586b50a016477d52cc85.zip | |
macros which have been defined in config.h can only be used at function level, however you can nest code into config.h now for implementing a different layout (just for example), eg. #include "supertile.c"
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 16 |
1 files changed, 10 insertions, 6 deletions
| @@ -194,20 +194,16 @@ static int xerrordummy(Display *dsply, XErrorEvent *ee); | |||
| 194 | static int xerrorstart(Display *dsply, XErrorEvent *ee); | 194 | static int xerrorstart(Display *dsply, XErrorEvent *ee); |
| 195 | static void zoom(const char *arg); | 195 | static void zoom(const char *arg); |
| 196 | 196 | ||
| 197 | #include "config.h" | ||
| 198 | |||
| 199 | /* variables */ | 197 | /* variables */ |
| 200 | static char stext[256]; | 198 | static char stext[256]; |
| 201 | static double mwfact = MWFACT; | 199 | static double mwfact; |
| 202 | static int screen, sx, sy, sw, sh, wax, way, waw, wah; | 200 | static int screen, sx, sy, sw, sh, wax, way, waw, wah; |
| 203 | static int (*xerrorxlib)(Display *, XErrorEvent *); | 201 | static int (*xerrorxlib)(Display *, XErrorEvent *); |
| 204 | static unsigned int bh; | 202 | static unsigned int bh, bpos, ntags; |
| 205 | static unsigned int blw = 0; | 203 | static unsigned int blw = 0; |
| 206 | static unsigned int bpos = BARPOS; | ||
| 207 | static unsigned int ltidx = 0; /* default */ | 204 | static unsigned int ltidx = 0; /* default */ |
| 208 | static unsigned int nlayouts = 0; | 205 | static unsigned int nlayouts = 0; |
| 209 | static unsigned int nrules = 0; | 206 | static unsigned int nrules = 0; |
| 210 | static unsigned int ntags; | ||
| 211 | static unsigned int numlockmask = 0; | 207 | static unsigned int numlockmask = 0; |
| 212 | static void (*handler[LASTEvent]) (XEvent *) = { | 208 | static void (*handler[LASTEvent]) (XEvent *) = { |
| 213 | [ButtonPress] = buttonpress, | 209 | [ButtonPress] = buttonpress, |
| @@ -237,6 +233,9 @@ static DC dc = {0}; | |||
| 237 | static Window barwin, root; | 233 | static Window barwin, root; |
| 238 | static Regs *regs = NULL; | 234 | static Regs *regs = NULL; |
| 239 | 235 | ||
| 236 | /* configuration, allows nested code to work on above variables */ | ||
| 237 | #include "config.h" | ||
| 238 | |||
| 240 | static void | 239 | static void |
| 241 | eprint(const char *errstr, ...) { | 240 | eprint(const char *errstr, ...) { |
| 242 | va_list ap; | 241 | va_list ap; |
| @@ -1806,6 +1805,11 @@ main(int argc, char *argv[]) { | |||
| 1806 | eprint("dwm-"VERSION", © 2006-2007 A. R. Garbe, S. van Dijk, J. Salmi, P. Hruby, S. Nagy\n"); | 1805 | eprint("dwm-"VERSION", © 2006-2007 A. R. Garbe, S. van Dijk, J. Salmi, P. Hruby, S. Nagy\n"); |
| 1807 | else if(argc != 1) | 1806 | else if(argc != 1) |
| 1808 | eprint("usage: dwm [-v]\n"); | 1807 | eprint("usage: dwm [-v]\n"); |
| 1808 | |||
| 1809 | /* macros from config.h can be used beginning within main() */ | ||
| 1810 | mwfact = MWFACT; | ||
| 1811 | bpos = BARPOS; | ||
| 1812 | |||
| 1809 | setlocale(LC_CTYPE, ""); | 1813 | setlocale(LC_CTYPE, ""); |
| 1810 | if(!(dpy = XOpenDisplay(0))) | 1814 | if(!(dpy = XOpenDisplay(0))) |
| 1811 | eprint("dwm: cannot open display\n"); | 1815 | eprint("dwm: cannot open display\n"); |
