Mercurial > dwm-meillo
annotate dwm.h @ 117:b819a4ac987e
updated html
author | arg@10ksloc.org |
---|---|
date | Thu, 20 Jul 2006 10:10:58 +0200 |
parents | 329fd7dae530 |
children | 75576e44c1d8 |
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" |
113
b2445fd41f5e
applied Jukka's patch with s/ModKeyMask/MODKEY/g
arg@10ksloc.org
parents:
105
diff
changeset
|
14 #define MODKEY Mod1Mask /* Mod4Mask */ |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
15 /* |
51 | 16 #define BGCOLOR "#666699" |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
17 #define FGCOLOR "#eeeeee" |
51 | 18 #define BORDERCOLOR "#9999CC" |
78
0d71fb80b592
changing XFlush into XSync
Anselm R. Garbe <garbeam@wmii.de>
parents:
77
diff
changeset
|
19 */ |
51 | 20 #define MASTERW 52 /* percent */ |
21 #define WM_PROTOCOL_DELWIN 1 | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
22 |
32 | 23 /* tags */ |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
24 enum { Tscratch, Tdev, Twww, Twork, TLast }; |
32 | 25 |
26 /********** CUSTOMIZE **********/ | |
27 | |
51 | 28 typedef union Arg Arg; |
105 | 29 typedef struct Client Client; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
30 typedef enum Corner Corner; |
34 | 31 typedef struct DC DC; |
32 | 32 typedef struct Fnt Fnt; |
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 |
105 | 46 enum Corner { TopLeft, TopRight, BotLeft, BotRight }; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
47 |
32 | 48 struct Fnt { |
49 int ascent; | |
50 int descent; | |
51 int height; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
52 XFontSet set; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
53 XFontStruct *xfont; |
32 | 54 }; |
55 | |
34 | 56 struct DC { /* draw context */ |
32 | 57 int x, y, w, h; |
58 unsigned long bg; | |
59 unsigned long fg; | |
60 unsigned long border; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
61 Drawable drawable; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
62 Fnt font; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
63 GC gc; |
32 | 64 }; |
65 | |
0 | 66 struct Client { |
31 | 67 char name[256]; |
68 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
69 int proto; |
115
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
70 int x, y, w, h; |
329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
arg@10ksloc.org
parents:
114
diff
changeset
|
71 int tx, ty, tw, th; /* title */ |
20 | 72 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 73 int grav; |
74 unsigned int border; | |
20 | 75 long flags; |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
76 Bool isfloat; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
77 Client *next; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
78 Client *revert; |
0 | 79 Window win; |
80 Window title; | |
81 }; | |
82 | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
83 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
|
84 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
53 | 85 extern void (*handler[LASTEvent])(XEvent *); |
86 extern void (*arrange)(Arg *); | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
87 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
|
88 extern Bool running, issel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
89 extern Client *clients, *sel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
90 extern Cursor cursor[CurLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
91 extern DC dc; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
92 extern Display *dpy; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
93 extern Window root, barwin; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
94 |
5 | 95 /* client.c */ |
75 | 96 extern void ban(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
97 extern void focus(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
98 extern void focusnext(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
99 extern void focusprev(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
100 extern Client *getclient(Window w); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
101 extern Client *getctitle(Window w); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
102 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
|
103 extern void higher(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
104 extern void killclient(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
105 extern void lower(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
106 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
|
107 extern void maximize(Arg *arg); |
94 | 108 extern void pop(Client *c); |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
109 extern void resize(Client *c, Bool inc, Corner sticky); |
74 | 110 extern void setsize(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
111 extern void settitle(Client *c); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
112 extern void unmanage(Client *c); |
75 | 113 extern void zoom(Arg *arg); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
114 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
115 /* draw.c */ |
75 | 116 extern void drawall(); |
74 | 117 extern void drawstatus(); |
118 extern void drawtitle(Client *c); | |
119 extern unsigned long getcolor(const char *colstr); | |
120 extern void setfont(const char *fontstr); | |
43 | 121 extern unsigned int textw(char *text); |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
122 |
75 | 123 /* event.c */ |
73 | 124 extern void grabkeys(); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
125 |
43 | 126 /* main.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
127 extern int getproto(Window w); |
75 | 128 extern void quit(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
129 extern void sendevent(Window w, Atom a, long value); |
75 | 130 extern int xerror(Display *dsply, XErrorEvent *ee); |
43 | 131 |
75 | 132 /* tag.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
133 extern void appendtag(Arg *arg); |
75 | 134 extern void dofloat(Arg *arg); |
135 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
|
136 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
|
137 extern void heretag(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
138 extern void replacetag(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
139 extern void settags(Client *c); |
73 | 140 extern void view(Arg *arg); |
141 | |
32 | 142 /* util.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
143 extern void *emallocz(unsigned int size); |
75 | 144 extern void eprint(const char *errstr, ...); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
145 extern void spawn(Arg *arg); |