Mercurial > dwm-meillo
annotate dwm.h @ 109:00309fb2b4d8
Added tag 0.3 for changeset 7e66082e5092fb0bccd18a3695a0bec52c80fdb2
author | arg@10ksloc.org |
---|---|
date | Wed, 19 Jul 2006 14:44:44 +0200 |
parents | 3e74cc981e9b |
children | b2445fd41f5e |
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; |
105 | 28 typedef struct Client Client; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
29 typedef enum Corner Corner; |
34 | 30 typedef struct DC DC; |
32 | 31 typedef struct Fnt Fnt; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
32 typedef struct Key Key; |
51 | 33 typedef struct Rule Rule; |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
34 |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
35 union Arg { |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
36 const char **argv; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
37 int i; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
38 }; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
39 |
5 | 40 /* atoms */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
41 enum { NetSupported, NetWMName, NetLast }; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
42 enum { WMProtocols, WMDelete, WMLast }; |
0 | 43 |
5 | 44 /* cursor */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
45 enum { CurNormal, CurResize, CurMove, CurLast }; |
0 | 46 |
105 | 47 enum Corner { TopLeft, TopRight, BotLeft, BotRight }; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
48 |
32 | 49 struct Fnt { |
50 int ascent; | |
51 int descent; | |
52 int height; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
53 XFontSet set; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
54 XFontStruct *xfont; |
32 | 55 }; |
56 | |
34 | 57 struct DC { /* draw context */ |
32 | 58 int x, y, w, h; |
59 unsigned long bg; | |
60 unsigned long fg; | |
61 unsigned long border; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
62 Drawable drawable; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
63 Fnt font; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
64 GC gc; |
32 | 65 }; |
66 | |
0 | 67 struct Client { |
31 | 68 char name[256]; |
69 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
70 int proto; |
95
5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
Anselm R. Garbe <garbeam@wmii.de>
parents:
94
diff
changeset
|
71 int *x, *y, *w, *h; /* current geom */ |
5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
Anselm R. Garbe <garbeam@wmii.de>
parents:
94
diff
changeset
|
72 int bx, by, bw, bh; /* title bar */ |
5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
Anselm R. Garbe <garbeam@wmii.de>
parents:
94
diff
changeset
|
73 int fx, fy, fw, fh; /* floating geom */ |
5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
Anselm R. Garbe <garbeam@wmii.de>
parents:
94
diff
changeset
|
74 int tx, ty, tw, th; /* tiled geom */ |
20 | 75 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 76 int grav; |
77 unsigned int border; | |
20 | 78 long flags; |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
79 Bool isfloat; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
80 Client *next; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
81 Client *revert; |
0 | 82 Window win; |
83 Window title; | |
84 }; | |
85 | |
51 | 86 struct Rule { |
87 const char *class; | |
88 const char *instance; | |
89 char *tags[TLast]; | |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
90 Bool isfloat; |
51 | 91 }; |
92 | |
8 | 93 struct Key { |
94 unsigned long mod; | |
95 KeySym keysym; | |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
96 void (*func)(Arg *arg); |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
97 Arg arg; |
8 | 98 }; |
99 | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
100 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
|
101 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
53 | 102 extern void (*handler[LASTEvent])(XEvent *); |
103 extern void (*arrange)(Arg *); | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
104 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
|
105 extern Bool running, issel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
106 extern Client *clients, *sel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
107 extern Cursor cursor[CurLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
108 extern DC dc; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
109 extern Display *dpy; |
73 | 110 extern Key key[]; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
111 extern Window root, barwin; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
112 |
5 | 113 /* client.c */ |
75 | 114 extern void ban(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
115 extern void focus(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
116 extern void focusnext(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
117 extern void focusprev(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
118 extern Client *getclient(Window w); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
119 extern Client *getctitle(Window w); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
120 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
|
121 extern void higher(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
122 extern void killclient(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
123 extern void lower(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
124 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
|
125 extern void maximize(Arg *arg); |
94 | 126 extern void pop(Client *c); |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
127 extern void resize(Client *c, Bool inc, Corner sticky); |
95
5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
Anselm R. Garbe <garbeam@wmii.de>
parents:
94
diff
changeset
|
128 extern void setgeom(Client *c); |
74 | 129 extern void setsize(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
130 extern void settitle(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
131 extern void unmanage(Client *c); |
75 | 132 extern void zoom(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
133 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
134 /* draw.c */ |
75 | 135 extern void drawall(); |
74 | 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); | |
43 | 140 extern unsigned int textw(char *text); |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
141 |
75 | 142 /* event.c */ |
73 | 143 extern void grabkeys(); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
144 |
43 | 145 /* main.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
146 extern int getproto(Window w); |
75 | 147 extern void quit(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
148 extern void sendevent(Window w, Atom a, long value); |
75 | 149 extern int xerror(Display *dsply, XErrorEvent *ee); |
43 | 150 |
75 | 151 /* tag.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
152 extern void appendtag(Arg *arg); |
75 | 153 extern void dofloat(Arg *arg); |
154 extern void dotile(Arg *arg); | |
93
c498da7520c7
added heretag command which allows to tag a client of a foreign tag with current tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
84
diff
changeset
|
155 extern Client *getnext(Client *c, unsigned int t); |
c498da7520c7
added heretag command which allows to tag a client of a foreign tag with current tag
Anselm R. Garbe <garbeam@wmii.de>
parents:
84
diff
changeset
|
156 extern void heretag(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
157 extern void replacetag(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
158 extern void settags(Client *c); |
73 | 159 extern void view(Arg *arg); |
160 | |
32 | 161 /* util.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
162 extern void *emallocz(unsigned int size); |
75 | 163 extern void eprint(const char *errstr, ...); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
164 extern void spawn(Arg *arg); |