Mercurial > aewl
annotate dwm.h @ 74:5370ef170cc9
sanitized names
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Fri, 14 Jul 2006 22:54:09 +0200 |
parents | c2ddb9dbbd10 |
children | f08271b7cb20 |
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-*" |
11 #define BGCOLOR "#666699" | |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
12 #define FGCOLOR "#eeeeee" |
51 | 13 #define BORDERCOLOR "#9999CC" |
14 #define MASTERW 52 /* percent */ | |
15 #define WM_PROTOCOL_DELWIN 1 | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
16 |
32 | 17 /* tags */ |
59
5d4653de9a1c
implemented dwm reading status text from stdin
Anselm R. Garbe <garbeam@wmii.de>
parents:
58
diff
changeset
|
18 enum { Tscratch, Tdev, Twww, Twork, TLast }; |
32 | 19 |
20 /********** CUSTOMIZE **********/ | |
21 | |
51 | 22 typedef union Arg Arg; |
34 | 23 typedef struct DC DC; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
24 typedef struct Client Client; |
32 | 25 typedef struct Fnt Fnt; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
26 typedef struct Key Key; |
51 | 27 typedef struct Rule Rule; |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
28 |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
29 union Arg { |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
30 const char **argv; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
31 int i; |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
32 }; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
33 |
5 | 34 /* atoms */ |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
35 enum { WMProtocols, WMDelete, WMLast }; |
0 | 36 enum { NetSupported, NetWMName, NetLast }; |
37 | |
5 | 38 /* cursor */ |
0 | 39 enum { CurNormal, CurResize, CurMove, CurInput, CurLast }; |
40 | |
32 | 41 struct Fnt { |
42 XFontStruct *xfont; | |
43 XFontSet set; | |
44 int ascent; | |
45 int descent; | |
46 int height; | |
47 }; | |
48 | |
34 | 49 struct DC { /* draw context */ |
32 | 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 }; | |
58 | |
0 | 59 struct Client { |
31 | 60 char name[256]; |
61 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
62 int proto; |
20 | 63 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
|
64 int tx, ty, tw, th; |
20 | 65 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 66 int grav; |
67 unsigned int border; | |
20 | 68 long flags; |
53 | 69 Bool floating; |
0 | 70 Window win; |
71 Window title; | |
72 Client *next; | |
50
148f25ed0ad7
several other additions/fixes, dwm is quite usable already
Anselm R. Garbe <garbeam@wmii.de>
parents:
49
diff
changeset
|
73 Client *revert; |
0 | 74 }; |
75 | |
51 | 76 struct Rule { |
77 const char *class; | |
78 const char *instance; | |
79 char *tags[TLast]; | |
53 | 80 Bool floating; |
51 | 81 }; |
82 | |
8 | 83 struct Key { |
84 unsigned long mod; | |
85 KeySym keysym; | |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
86 void (*func)(Arg *arg); |
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
87 Arg arg; |
8 | 88 }; |
89 | |
0 | 90 extern Display *dpy; |
57
f005d46462e8
implemented bar for dwm (I miss status text), I plan that status text is read from stdin in dwm
Anselm R. Garbe <garbeam@wmii.de>
parents:
53
diff
changeset
|
91 extern Window root, barwin; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
92 extern Atom wm_atom[WMLast], net_atom[NetLast]; |
0 | 93 extern Cursor cursor[CurLast]; |
31 | 94 extern Bool running, issel; |
53 | 95 extern void (*handler[LASTEvent])(XEvent *); |
96 extern void (*arrange)(Arg *); | |
73 | 97 extern Key key[]; |
0 | 98 |
57
f005d46462e8
implemented bar for dwm (I miss status text), I plan that status text is read from stdin in dwm
Anselm R. Garbe <garbeam@wmii.de>
parents:
53
diff
changeset
|
99 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw; |
f005d46462e8
implemented bar for dwm (I miss status text), I plan that status text is read from stdin in dwm
Anselm R. Garbe <garbeam@wmii.de>
parents:
53
diff
changeset
|
100 extern char *tags[TLast], stext[1024]; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
101 |
34 | 102 extern DC dc; |
50
148f25ed0ad7
several other additions/fixes, dwm is quite usable already
Anselm R. Garbe <garbeam@wmii.de>
parents:
49
diff
changeset
|
103 extern Client *clients, *sel; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
104 |
5 | 105 /* client.c */ |
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
106 extern void manage(Window w, XWindowAttributes *wa); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
107 extern void unmanage(Client *c); |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
108 extern Client *getclient(Window w); |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
109 extern void focus(Client *c); |
74 | 110 extern void settitle(Client *c); |
52
d18f6dd0cf23
fixed several things, nearly feature complete
Anselm R. Garbe <garbeam@wmii.de>
parents:
51
diff
changeset
|
111 extern void resize(Client *c, Bool inc); |
74 | 112 extern void setsize(Client *c); |
23 | 113 extern Client *gettitle(Window w); |
74 | 114 extern void higher(Client *c); |
26
e8f627998d6f
simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
Anselm R. Garbe <garbeam@wmii.de>
parents:
23
diff
changeset
|
115 extern void lower(Client *c); |
29 | 116 extern void gravitate(Client *c, Bool invert); |
74 | 117 extern void ban(Client *c); |
118 extern Client *getnext(Client *c); | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
119 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
120 /* draw.c */ |
74 | 121 extern void drawstatus(); |
122 extern void drawtitle(Client *c); | |
66
50450aa24a46
removed a bunch of lines through swap removal
Anselm R. Garbe <garbeam@wmii.de>
parents:
63
diff
changeset
|
123 extern void drawtext(const char *text, Bool invert, Bool border); |
74 | 124 extern unsigned long getcolor(const char *colstr); |
125 extern void setfont(const char *fontstr); | |
43 | 126 extern unsigned int textnw(char *text, unsigned int len); |
127 extern unsigned int textw(char *text); | |
128 extern unsigned int texth(void); | |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
129 |
73 | 130 /* key.c */ |
131 extern void grabkeys(); | |
9
d567f430a81d
fixed several stuff (gridwm gets better and better)
Anselm R. Garbe <garbeam@wmii.de>
parents:
8
diff
changeset
|
132 extern void keypress(XEvent *e); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
133 |
43 | 134 /* main.c */ |
74 | 135 extern int xerror(Display *dsply, XErrorEvent *e); |
136 extern void sendevent(Window w, Atom a, long value); | |
137 extern int proto(Window w); | |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
138 extern void quit(Arg *arg); |
43 | 139 |
73 | 140 /* screen.c */ |
141 extern void floating(Arg *arg); | |
142 extern void tiling(Arg *arg); | |
143 extern void view(Arg *arg); | |
144 | |
32 | 145 /* util.c */ |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
146 extern void error(const char *errstr, ...); |
32 | 147 extern void *emallocz(unsigned int size); |
49
466591c2f967
implemented tagging a client
Anselm R. Garbe <garbeam@wmii.de>
parents:
46
diff
changeset
|
148 extern void spawn(Arg *arg); |