Mercurial > aewl
annotate dwm.h @ 373:44a55e6e46bf 1.1
added a comment to spawn
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Mon, 28 Aug 2006 08:17:27 +0200 |
parents | ba6c55e1b9b2 |
children | 83576f5f0a90 |
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 | |
166
e0535db04dfe
removed the CONFIG variable from config.mk, renamed config.h into config.default.h, after first clone/extract one needs to copy config.default.h to config.h, that is easier than always heavy typing make CONFIG=blafasel
arg@10ksloc.org
parents:
164
diff
changeset
|
6 #include "config.h" |
32 | 7 #include <X11/Xlib.h> |
8 | |
143 | 9 /* mask shorthands, used in event.c and client.c */ |
150
a26b32ff8911
cleaned config.*h to prevent some confusion
arg@10ksloc.org
parents:
148
diff
changeset
|
10 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask) |
a26b32ff8911
cleaned config.*h to prevent some confusion
arg@10ksloc.org
parents:
148
diff
changeset
|
11 #define MOUSEMASK (BUTTONMASK | PointerMotionMask) |
157
93012e947eae
renamed WM_PROTOCOL_DELWIN into PROTODELWIN
arg@10ksloc.org
parents:
150
diff
changeset
|
12 #define PROTODELWIN 1 |
143 | 13 |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
14 typedef union { |
189
523df4a3c1c4
using execl now, argv changed, using cmd and const char defs directly in the KEYS struct
arg@10ksloc.org
parents:
178
diff
changeset
|
15 const char *cmd; |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
16 int i; |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
17 } Arg; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
18 |
5 | 19 /* atoms */ |
230
b92bbc2487c9
removed NET_ACTIVE_WINDOW handling
Anselm R.Garbe <arg@10ksloc.org>
parents:
229
diff
changeset
|
20 enum { NetSupported, NetWMName, NetLast }; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
21 enum { WMProtocols, WMDelete, WMLast }; |
0 | 22 |
5 | 23 /* cursor */ |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
24 enum { CurNormal, CurResize, CurMove, CurLast }; |
0 | 25 |
353
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
26 /* color */ |
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
27 enum { ColFG, ColBG, ColLast }; |
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
28 |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
29 /* window corners */ |
143 | 30 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner; |
99
a19556fe83b5
applied Sanders resize patch, fixed lower bug
arg@10ksloc.org
parents:
95
diff
changeset
|
31 |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
32 typedef struct { |
32 | 33 int ascent; |
34 int descent; | |
35 int height; | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
36 XFontSet set; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
37 XFontStruct *xfont; |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
38 } Fnt; |
32 | 39 |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
40 typedef struct { /* draw context */ |
32 | 41 int x, y, w, h; |
353
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
42 unsigned long norm[ColLast]; |
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
43 unsigned long sel[ColLast]; |
8a06efe5b563
new color stuff/new rendering stuff
Anselm R. Garbe <arg@10kloc.org>
parents:
352
diff
changeset
|
44 unsigned long status[ColLast]; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
45 Drawable drawable; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
46 Fnt font; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
47 GC gc; |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
48 } DC; |
32 | 49 |
333
827f8f6c9e97
separated setup stuff into main.c:setup() - this makes main() more readable
Anselm R. Garbe <arg@10kloc.org>
parents:
327
diff
changeset
|
50 typedef struct Client Client; |
0 | 51 struct Client { |
31 | 52 char name[256]; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
53 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
|
54 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
|
55 int tx, ty, tw, th; /* title */ |
20 | 56 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 57 int grav; |
164
21071ae1fe68
made fullscreen apps working fine in floating mode (there is no sane way to make them work in tiled mode, thus I switch to floating mode if I run such kind of app), also fixed the xterm issue reported by Sander
arg@10ksloc.org
parents:
157
diff
changeset
|
58 long flags; |
29 | 59 unsigned int border; |
80
8125f908c80c
several additions in mouse handling ;)
Anselm R. Garbe <garbeam@wmii.de>
parents:
78
diff
changeset
|
60 Bool isfloat; |
124
75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents:
115
diff
changeset
|
61 Bool ismax; |
178
e848966a1ac6
removed TLast tag enum, now tags is simple defined as char *[] array, the rest is calculated correctly, rules take an int array for the tags
arg@10ksloc.org
parents:
173
diff
changeset
|
62 Bool *tags; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
63 Client *next; |
127
1480e19f6377
using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents:
125
diff
changeset
|
64 Client *prev; |
0 | 65 Window win; |
342 | 66 Window twin; |
0 | 67 }; |
68 | |
178
e848966a1ac6
removed TLast tag enum, now tags is simple defined as char *[] array, the rest is calculated correctly, rules take an int array for the tags
arg@10ksloc.org
parents:
173
diff
changeset
|
69 extern const char *tags[]; |
173
1db04019684e
changed Client->tags and Rule->tags to be Bool (I'll also try to remove the TLast enum)
arg@10ksloc.org
parents:
166
diff
changeset
|
70 extern char stext[1024]; |
362
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
353
diff
changeset
|
71 extern int bx, by, bw, bh, bmw, mw, screen, sx, sy, sw, sh; |
ba6c55e1b9b2
trying a different configuration
Anselm R. Garbe <arg@10kloc.org>
parents:
353
diff
changeset
|
72 extern unsigned int ntags, numlockmask; |
53 | 73 extern void (*handler[LASTEvent])(XEvent *); |
74 extern void (*arrange)(Arg *); | |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
75 extern Atom wmatom[WMLast], netatom[NetLast]; |
262
d659a2dce2b5
implemented viewextend and added M-S-C-n shortcuts for extending the current view... updated man page (works great!) nice feature
Anselm R.Garbe <arg@10ksloc.org>
parents:
261
diff
changeset
|
76 extern Bool running, issel, *seltag; |
84
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
77 extern Client *clients, *sel; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
78 extern Cursor cursor[CurLast]; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
79 extern DC dc; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
80 extern Display *dpy; |
052fe7498930
ordered variables in structs and source files alphabetically
Anselm R. Garbe <garbeam@wmii.de>
parents:
80
diff
changeset
|
81 extern Window root, barwin; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
82 |
5 | 83 /* client.c */ |
75 | 84 extern void ban(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
85 extern void focus(Client *c); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
86 extern Client *getclient(Window w); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
87 extern Client *getctitle(Window w); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
88 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
|
89 extern void killclient(Arg *arg); |
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
90 extern void manage(Window w, XWindowAttributes *wa); |
129
c478383db7c9
applied sanders no_sizehints for tiled mode patch (thx!)
arg@10ksloc.org
parents:
127
diff
changeset
|
91 extern void resize(Client *c, Bool sizehints, Corner sticky); |
74 | 92 extern void setsize(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
93 extern void settitle(Client *c); |
124
75576e44c1d8
made status bar drawing more robust, implemented togglemax and togglemode, works quite well
arg@10ksloc.org
parents:
115
diff
changeset
|
94 extern void togglemax(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
95 extern void unmanage(Client *c); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
96 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
97 /* draw.c */ |
75 | 98 extern void drawall(); |
74 | 99 extern void drawstatus(); |
100 extern void drawtitle(Client *c); | |
101 extern unsigned long getcolor(const char *colstr); | |
102 extern void setfont(const char *fontstr); | |
173
1db04019684e
changed Client->tags and Rule->tags to be Bool (I'll also try to remove the TLast enum)
arg@10ksloc.org
parents:
166
diff
changeset
|
103 extern unsigned int textw(const char *text); |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
104 |
75 | 105 /* event.c */ |
73 | 106 extern void grabkeys(); |
292 | 107 extern void procevent(); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
108 |
43 | 109 /* main.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
110 extern int getproto(Window w); |
75 | 111 extern void quit(Arg *arg); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
112 extern void sendevent(Window w, Atom a, long value); |
75 | 113 extern int xerror(Display *dsply, XErrorEvent *ee); |
43 | 114 |
75 | 115 /* tag.c */ |
191 | 116 extern void initrregs(); |
142
9b9deafa0508
committed a patch which fixes the hints of Jukka
arg@10ksloc.org
parents:
130
diff
changeset
|
117 extern Client *getnext(Client *c); |
127
1480e19f6377
using double-linked list in order to get correct prev focus handling
arg@10ksloc.org
parents:
125
diff
changeset
|
118 extern Client *getprev(Client *c); |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
119 extern void settags(Client *c); |
284
5f5c56e104de
changed replacetag into toggletag
Anselm R.Garbe <arg@10ksloc.org>
parents:
274
diff
changeset
|
120 extern void tag(Arg *arg); |
5f5c56e104de
changed replacetag into toggletag
Anselm R.Garbe <arg@10ksloc.org>
parents:
274
diff
changeset
|
121 extern void toggletag(Arg *arg); |
73 | 122 |
32 | 123 /* util.c */ |
76
4bd49f404f10
proceeded with cleaning up, sorting functions, etc
Anselm R. Garbe <garbeam@wmii.de>
parents:
75
diff
changeset
|
124 extern void *emallocz(unsigned int size); |
75 | 125 extern void eprint(const char *errstr, ...); |
270
dacd3f3c5823
implemented restack behavior (floats are on top in tiled mode)
Anselm R.Garbe <arg@10ksloc.org>
parents:
267
diff
changeset
|
126 extern void *erealloc(void *ptr, unsigned int size); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
127 extern void spawn(Arg *arg); |
327
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
128 |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
129 /* view.c */ |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
130 extern void dofloat(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
131 extern void dotile(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
132 extern void focusnext(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
133 extern void focusprev(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
134 extern Bool isvisible(Client *c); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
135 extern void restack(); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
136 extern void togglemode(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
137 extern void toggleview(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
138 extern void view(Arg *arg); |
96d09fd98e89
separated several functions into view.c
Anselm R. Garbe <arg@10kloc.org>
parents:
292
diff
changeset
|
139 extern void zoom(Arg *arg); |