2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
8 /********** CUSTOMIZE **********/
10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
11 #define BGCOLOR "#0a2c2d"
12 #define FGCOLOR "#ddeeee"
13 #define BORDERCOLOR "#176164"
15 #define BGCOLOR "#666699"
16 #define FGCOLOR "#eeeeee"
17 #define BORDERCOLOR "#9999CC"
19 #define MASTERW 52 /* percent */
20 #define WM_PROTOCOL_DELWIN 1
23 enum { Tscratch, Tdev, Twww, Twork, TLast };
25 /********** CUSTOMIZE **********/
27 typedef union Arg Arg;
28 typedef enum Corner Corner;
30 typedef struct Client Client;
31 typedef struct Fnt Fnt;
32 typedef struct Key Key;
33 typedef struct Rule Rule;
41 enum { NetSupported, NetWMName, NetLast };
42 enum { WMProtocols, WMDelete, WMLast };
45 enum { CurNormal, CurResize, CurMove, CurLast };
47 enum Corner { TopLeft, TopRight, BottomLeft, BottomRight };
57 struct DC { /* draw context */
71 int *x, *y, *w, *h; /* current geom */
72 int bx, by, bw, bh; /* title bar */
73 int fx, fy, fw, fh; /* floating geom */
74 int tx, ty, tw, th; /* tiled geom */
75 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
96 void (*func)(Arg *arg);
100 extern char *tags[TLast], stext[1024];
101 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
102 extern void (*handler[LASTEvent])(XEvent *);
103 extern void (*arrange)(Arg *);
104 extern Atom wmatom[WMLast], netatom[NetLast];
105 extern Bool running, issel;
106 extern Client *clients, *sel;
107 extern Cursor cursor[CurLast];
111 extern Window root, barwin;
114 extern void ban(Client *c);
115 extern void focus(Client *c);
116 extern void focusnext(Arg *arg);
117 extern void focusprev(Arg *arg);
118 extern Client *getclient(Window w);
119 extern Client *getctitle(Window w);
120 extern void gravitate(Client *c, Bool invert);
121 extern void higher(Client *c);
122 extern void killclient(Arg *arg);
123 extern void lower(Client *c);
124 extern void manage(Window w, XWindowAttributes *wa);
125 extern void maximize(Arg *arg);
126 extern void pop(Client *c);
127 extern void resize(Client *c, Bool inc, Corner sticky);
128 extern void setgeom(Client *c);
129 extern void setsize(Client *c);
130 extern void settitle(Client *c);
131 extern void unmanage(Client *c);
132 extern void zoom(Arg *arg);
135 extern void drawall();
136 extern void drawstatus();
137 extern void drawtitle(Client *c);
138 extern unsigned long getcolor(const char *colstr);
139 extern void setfont(const char *fontstr);
140 extern unsigned int textw(char *text);
143 extern void grabkeys();
146 extern int getproto(Window w);
147 extern void quit(Arg *arg);
148 extern void sendevent(Window w, Atom a, long value);
149 extern int xerror(Display *dsply, XErrorEvent *ee);
152 extern void appendtag(Arg *arg);
153 extern void dofloat(Arg *arg);
154 extern void dotile(Arg *arg);
155 extern Client *getnext(Client *c, unsigned int t);
156 extern void heretag(Arg *arg);
157 extern void replacetag(Arg *arg);
158 extern void settags(Client *c);
159 extern void view(Arg *arg);
162 extern void *emallocz(unsigned int size);
163 extern void eprint(const char *errstr, ...);
164 extern void spawn(Arg *arg);