Mercurial > aewl
annotate dwm.h @ 87:e8a23f20097e
updated README
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Mon, 17 Jul 2006 10:09:57 +0200 |
parents | 052fe7498930 |
children | c498da7520c7 |
rev | line source |
---|---|
0 | 1 /* |
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com> | |
3 * See LICENSE file for license details. | |
4 */ | |
5 | |
32 | 6 #include <X11/Xlib.h> |
7 | |
8 /********** CUSTOMIZE **********/ | |
2 | 9 |
51 | 10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*" |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
11 #define BGCOLOR "#0a2c2d" |
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
12 #define FGCOLOR "#ddeeee" |
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
13 #define BORDERCOLOR "#176164" |
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
14 /* |
51 | 15 #define BGCOLOR "#666699" |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
16 #define FGCOLOR "#eeeeee" |
51 | 17 #define BORDERCOLOR "#9999CC" |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
18 */ |
51 | 19 #define MASTERW 52 /* percent */ |
20 #define WM_PROTOCOL_DELWIN 1 | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
21 |
32 | 22 /* tags */ |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
23 enum { Tscratch, Tdev, Twww, Twork, TLast }; |
32 | 24 |
25 /********** CUSTOMIZE **********/ | |
26 | |
51 | 27 typedef union Arg Arg; |
34 | 28 typedef struct DC DC; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
29 typedef struct Client Client; |
32 | 30 typedef struct Fnt Fnt; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
31 typedef struct Key Key; |
51 | 32 typedef struct Rule Rule; |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
33 |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
34 union Arg { |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
35 const char **argv; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
36 int i; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
37 }; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
38 |
5 | 39 /* atoms */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
40 enum { NetSupported, NetWMName, NetLast }; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
41 enum { WMProtocols, WMDelete, WMLast }; |
0 | 42 |
5 | 43 /* cursor */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
44 enum { CurNormal, CurResize, CurMove, CurLast }; |
0 | 45 |
32 | 46 struct Fnt { |
47 int ascent; | |
48 int descent; | |
49 int height; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
50 XFontSet set; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
51 XFontStruct *xfont; |
32 | 52 }; |
53 | |
34 | 54 struct DC { /* draw context */ |
32 | 55 int x, y, w, h; |
56 unsigned long bg; | |
57 unsigned long fg; | |
58 unsigned long border; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
59 Drawable drawable; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
60 Fnt font; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
61 GC gc; |
32 | 62 }; |
63 | |
0 | 64 struct Client { |
31 | 65 char name[256]; |
66 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
67 int proto; |
20 | 68 int x, y, w, h; |
22
bd3a44353916
fixed several other stuff, coming closer to something useful
Anselm R. Garbe <garbeam@wmii.de>
parents:
20
diff
changeset
|
69 int tx, ty, tw, th; |
20 | 70 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 71 int grav; |
72 unsigned int border; | |
20 | 73 long flags; |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
74 Bool isfloat; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
75 Client *next; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
76 Client *revert; |
0 | 77 Window win; |
78 Window title; | |
79 }; | |
80 | |
51 | 81 struct Rule { |
82 const char *class; | |
83 const char *instance; | |
84 char *tags[TLast]; | |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
85 Bool isfloat; |
51 | 86 }; |
87 | |
8 | 88 struct Key { |
89 unsigned long mod; | |
90 KeySym keysym; | |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
91 void (*func)(Arg *arg); |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
92 Arg arg; |
8 | 93 }; |
94 | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
95 extern char *tags[TLast], stext[1024]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
96 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
53 | 97 extern void (*handler[LASTEvent])(XEvent *); |
98 extern void (*arrange)(Arg *); | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
99 extern Atom wmatom[WMLast], netatom[NetLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
100 extern Bool running, issel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
101 extern Client *clients, *sel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
102 extern Cursor cursor[CurLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
103 extern DC dc; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
104 extern Display *dpy; |
73 | 105 extern Key key[]; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
106 extern Window root, barwin; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
107 |
5 | 108 /* client.c */ |
75 | 109 extern void ban(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
110 extern void focus(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
111 extern void focusnext(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
112 extern void focusprev(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
113 extern Client *getclient(Window w); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
114 extern Client *getctitle(Window w); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
115 extern void gravitate(Client *c, Bool invert); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
116 extern void higher(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
117 extern void killclient(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
118 extern void lower(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
119 extern void manage(Window w, XWindowAttributes *wa); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
120 extern void maximize(Arg *arg); |
52
d18f6dd0cf23
fixed several things, nearly feature complete
Anselm R. Garbe <garbeam@wmii.de>
parents:
51
diff
changeset
|
121 extern void resize(Client *c, Bool inc); |
74 | 122 extern void setsize(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
123 extern void settitle(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
124 extern void unmanage(Client *c); |
75 | 125 extern void zoom(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
126 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
127 /* draw.c */ |
75 | 128 extern void drawall(); |
74 | 129 extern void drawstatus(); |
130 extern void drawtitle(Client *c); | |
131 extern unsigned long getcolor(const char *colstr); | |
132 extern void setfont(const char *fontstr); | |
43 | 133 extern unsigned int textw(char *text); |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
134 |
75 | 135 /* event.c */ |
73 | 136 extern void grabkeys(); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
137 |
43 | 138 /* main.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
139 extern int getproto(Window w); |
75 | 140 extern void quit(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
141 extern void sendevent(Window w, Atom a, long value); |
75 | 142 extern int xerror(Display *dsply, XErrorEvent *ee); |
43 | 143 |
75 | 144 /* tag.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
145 extern void appendtag(Arg *arg); |
75 | 146 extern void dofloat(Arg *arg); |
147 extern void dotile(Arg *arg); | |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
148 extern Client *getnext(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
149 extern void replacetag(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
150 extern void settags(Client *c); |
73 | 151 extern void view(Arg *arg); |
152 | |
32 | 153 /* util.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
154 extern void *emallocz(unsigned int size); |
75 | 155 extern void eprint(const char *errstr, ...); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
156 extern void spawn(Arg *arg); |