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 "#666699"
12 #define FGCOLOR "#eeeeee"
13 #define BORDERCOLOR "#9999CC"
14 #define MASTERW 52 /* percent */
15 #define WM_PROTOCOL_DELWIN 1
18 enum { Tscratch, Tdev, Twww, Twork, TLast };
20 /********** CUSTOMIZE **********/
22 typedef union Arg Arg;
24 typedef struct Client Client;
25 typedef struct Fnt Fnt;
26 typedef struct Key Key;
27 typedef struct Rule Rule;
35 enum { WMProtocols, WMDelete, WMLast };
36 enum { NetSupported, NetWMName, NetLast };
39 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
49 struct DC { /* draw context */
65 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
86 void (*func)(Arg *arg);
91 extern Window root, barwin;
92 extern Atom wm_atom[WMLast], net_atom[NetLast];
93 extern Cursor cursor[CurLast];
94 extern Bool running, issel;
95 extern void (*handler[LASTEvent])(XEvent *);
96 extern void (*arrange)(Arg *);
99 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
100 extern char *tags[TLast], stext[1024];
103 extern Client *clients, *sel;
106 extern void ban(Client *c);
107 extern void focus(Client *c);
108 extern void focusnext(Arg *arg);
109 extern void focusprev(Arg *arg);
110 extern Client *getclient(Window w);
111 extern Client *getctitle(Window w);
112 extern void gravitate(Client *c, Bool invert);
113 extern void higher(Client *c);
114 extern void killclient(Arg *arg);
115 extern void lower(Client *c);
116 extern void manage(Window w, XWindowAttributes *wa);
117 extern void maximize(Arg *arg);
118 extern void resize(Client *c, Bool inc);
119 extern void setsize(Client *c);
120 extern void settitle(Client *c);
121 extern void unmanage(Client *c);
122 extern void zoom(Arg *arg);
125 extern void drawall();
126 extern void drawstatus();
127 extern void drawtext(const char *text, Bool invert, Bool border);
128 extern void drawtitle(Client *c);
129 extern unsigned long getcolor(const char *colstr);
130 extern void setfont(const char *fontstr);
131 extern unsigned int textnw(char *text, unsigned int len);
132 extern unsigned int textw(char *text);
135 extern void grabkeys();
138 extern int getproto(Window w);
139 extern void quit(Arg *arg);
140 extern void sendevent(Window w, Atom a, long value);
141 extern int xerror(Display *dsply, XErrorEvent *ee);
144 extern void appendtag(Arg *arg);
145 extern void dofloat(Arg *arg);
146 extern void dotile(Arg *arg);
147 extern Client *getnext(Client *c);
148 extern void replacetag(Arg *arg);
149 extern void settags(Client *c);
150 extern void view(Arg *arg);
153 extern void *emallocz(unsigned int size);
154 extern void eprint(const char *errstr, ...);
155 extern void spawn(Arg *arg);