dwm-meillo
view dwm.h @ 77:38c8f7f7d401
sanitized other stuff
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Sat, 15 Jul 2006 17:19:19 +0200 |
parents | 4bd49f404f10 |
children | 0d71fb80b592 |
line source
1 /*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
6 #include <X11/Xlib.h>
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
17 /* tags */
18 enum { Tscratch, Tdev, Twww, Twork, TLast };
20 /********** CUSTOMIZE **********/
22 typedef union Arg Arg;
23 typedef struct DC DC;
24 typedef struct Client Client;
25 typedef struct Fnt Fnt;
26 typedef struct Key Key;
27 typedef struct Rule Rule;
29 union Arg {
30 const char **argv;
31 int i;
32 };
34 /* atoms */
35 enum { WMProtocols, WMDelete, WMLast };
36 enum { NetSupported, NetWMName, NetLast };
38 /* cursor */
39 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
41 struct Fnt {
42 XFontStruct *xfont;
43 XFontSet set;
44 int ascent;
45 int descent;
46 int height;
47 };
49 struct DC { /* draw context */
50 GC gc;
51 Drawable drawable;
52 int x, y, w, h;
53 Fnt font;
54 unsigned long bg;
55 unsigned long fg;
56 unsigned long border;
57 };
59 struct Client {
60 char name[256];
61 char *tags[TLast];
62 int proto;
63 int x, y, w, h;
64 int tx, ty, tw, th;
65 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
66 int grav;
67 unsigned int border;
68 long flags;
69 Bool dofloat;
70 Window win;
71 Window title;
72 Client *next;
73 Client *revert;
74 };
76 struct Rule {
77 const char *class;
78 const char *instance;
79 char *tags[TLast];
80 Bool dofloat;
81 };
83 struct Key {
84 unsigned long mod;
85 KeySym keysym;
86 void (*func)(Arg *arg);
87 Arg arg;
88 };
90 extern Display *dpy;
91 extern Window root, barwin;
92 extern Atom wmatom[WMLast], netatom[NetLast];
93 extern Cursor cursor[CurLast];
94 extern Bool running, issel;
95 extern void (*handler[LASTEvent])(XEvent *);
96 extern void (*arrange)(Arg *);
97 extern Key key[];
99 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
100 extern char *tags[TLast], stext[1024];
102 extern DC dc;
103 extern Client *clients, *sel;
105 /* client.c */
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);
124 /* draw.c */
125 extern void drawall();
126 extern void drawstatus();
127 extern void drawtitle(Client *c);
128 extern unsigned long getcolor(const char *colstr);
129 extern void setfont(const char *fontstr);
130 extern unsigned int textw(char *text);
132 /* event.c */
133 extern void grabkeys();
135 /* main.c */
136 extern int getproto(Window w);
137 extern void quit(Arg *arg);
138 extern void sendevent(Window w, Atom a, long value);
139 extern int xerror(Display *dsply, XErrorEvent *ee);
141 /* tag.c */
142 extern void appendtag(Arg *arg);
143 extern void dofloat(Arg *arg);
144 extern void dotile(Arg *arg);
145 extern Client *getnext(Client *c);
146 extern void replacetag(Arg *arg);
147 extern void settags(Client *c);
148 extern void view(Arg *arg);
150 /* util.c */
151 extern void *emallocz(unsigned int size);
152 extern void eprint(const char *errstr, ...);
153 extern void spawn(Arg *arg);