Mercurial > dwm-meillo
annotate dwm.h @ 46:58307ad56ec1
added xlock command (I need it regularly)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Thu, 13 Jul 2006 12:19:10 +0200 |
parents | 989178822938 |
children | 466591c2f967 |
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 |
32 | 10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*" |
43 | 11 #define BGCOLOR "DarkSlateGrey" |
12 #define FGCOLOR "LightSteelBlue" | |
13 #define BORDERCOLOR "SlateGray" | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
14 #define WM_PROTOCOL_DELWIN 1 |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
15 |
32 | 16 /* tags */ |
17 enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast }; | |
18 | |
19 /********** CUSTOMIZE **********/ | |
20 | |
34 | 21 typedef struct DC DC; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
22 typedef struct Client Client; |
32 | 23 typedef struct Fnt Fnt; |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
24 typedef struct Key Key; |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
25 |
5 | 26 /* atoms */ |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
27 enum { WMProtocols, WMDelete, WMLast }; |
0 | 28 enum { NetSupported, NetWMName, NetLast }; |
29 | |
5 | 30 /* cursor */ |
0 | 31 enum { CurNormal, CurResize, CurMove, CurInput, CurLast }; |
32 | |
32 | 33 struct Fnt { |
34 XFontStruct *xfont; | |
35 XFontSet set; | |
36 int ascent; | |
37 int descent; | |
38 int height; | |
39 }; | |
40 | |
34 | 41 struct DC { /* draw context */ |
32 | 42 GC gc; |
43 Drawable drawable; | |
44 int x, y, w, h; | |
45 Fnt font; | |
46 unsigned long bg; | |
47 unsigned long fg; | |
48 unsigned long border; | |
49 }; | |
50 | |
0 | 51 struct Client { |
31 | 52 char name[256]; |
53 char *tags[TLast]; | |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
54 int proto; |
20 | 55 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
|
56 int tx, ty, tw, th; |
20 | 57 int basew, baseh, incw, inch, maxw, maxh, minw, minh; |
29 | 58 int grav; |
59 unsigned int border; | |
20 | 60 long flags; |
0 | 61 Window win; |
62 Window trans; | |
63 Window title; | |
64 Client *next; | |
5 | 65 Client *snext; |
0 | 66 }; |
67 | |
8 | 68 struct Key { |
69 unsigned long mod; | |
70 KeySym keysym; | |
14 | 71 void (*func)(void *aux); |
72 void *aux; | |
8 | 73 }; |
74 | |
0 | 75 extern Display *dpy; |
32 | 76 extern Window root; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
77 extern Atom wm_atom[WMLast], net_atom[NetLast]; |
0 | 78 extern Cursor cursor[CurLast]; |
31 | 79 extern Bool running, issel; |
5 | 80 extern void (*handler[LASTEvent]) (XEvent *); |
0 | 81 |
32 | 82 extern int tsel, screen, sx, sy, sw, sh, th; |
31 | 83 extern char stext[1024], *tags[TLast]; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
84 |
34 | 85 extern DC dc; |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
86 extern Client *clients, *stack; |
3
e969f3575b7a
several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents:
2
diff
changeset
|
87 |
5 | 88 /* client.c */ |
10
703255003abb
changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents:
9
diff
changeset
|
89 extern void manage(Window w, XWindowAttributes *wa); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
90 extern void unmanage(Client *c); |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
91 extern Client *getclient(Window w); |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
92 extern void focus(Client *c); |
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
93 extern void update_name(Client *c); |
16
359b6e563b95
several changes, new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
14
diff
changeset
|
94 extern void draw_client(Client *c); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
95 extern void resize(Client *c); |
20 | 96 extern void update_size(Client *c); |
23 | 97 extern Client *gettitle(Window w); |
32 | 98 extern void craise(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
|
99 extern void lower(Client *c); |
32 | 100 extern void ckill(void *aux); |
27
f96fb3fd8203
added grid mode on Mod1Mask g
Anselm R. Garbe <garbeam@wmii.de>
parents:
26
diff
changeset
|
101 extern void sel(void *aux); |
28 | 102 extern void max(void *aux); |
46
58307ad56ec1
added xlock command (I need it regularly)
Anselm R. Garbe <garbeam@wmii.de>
parents:
43
diff
changeset
|
103 extern void floating(void *aux); |
58307ad56ec1
added xlock command (I need it regularly)
Anselm R. Garbe <garbeam@wmii.de>
parents:
43
diff
changeset
|
104 extern void tiling(void *aux); |
29 | 105 extern void gravitate(Client *c, Bool invert); |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
106 |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
107 /* draw.c */ |
34 | 108 extern void draw(Bool border, const char *text); |
43 | 109 extern unsigned long initcolor(const char *colstr); |
110 extern void initfont(const char *fontstr); | |
111 extern unsigned int textnw(char *text, unsigned int len); | |
112 extern unsigned int textw(char *text); | |
113 extern unsigned int texth(void); | |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
114 |
13
5cc5e55a132d
added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents:
10
diff
changeset
|
115 /* event.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
|
116 extern void discard_events(long even_mask); |
5 | 117 |
42
040a7074d23c
added dev.c instead of kb.c
Anselm R. Garbe <garbeam@wmii.de>
parents:
34
diff
changeset
|
118 /* dev.c */ |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
119 extern void update_keys(void); |
9
d567f430a81d
fixed several stuff (gridwm gets better and better)
Anselm R. Garbe <garbeam@wmii.de>
parents:
8
diff
changeset
|
120 extern void keypress(XEvent *e); |
18
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
121 extern void mresize(Client *c); |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
122 extern void mmove(Client *c); |
1efa34c6e1b6
added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents:
16
diff
changeset
|
123 |
43 | 124 /* main.c */ |
125 extern int error_handler(Display *dsply, XErrorEvent *e); | |
126 extern void send_message(Window w, Atom a, long value); | |
127 extern int win_proto(Window w); | |
128 extern void quit(void *aux); | |
129 | |
32 | 130 /* util.c */ |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
131 extern void error(const char *errstr, ...); |
32 | 132 extern void *emallocz(unsigned int size); |
133 extern void *emalloc(unsigned int size); | |
134 extern void *erealloc(void *ptr, unsigned int size); | |
135 extern char *estrdup(const char *str); | |
33
e90449e03167
new stuff (some warning elimination)
Anselm R. Garbe <garbeam@wmii.de>
parents:
32
diff
changeset
|
136 extern void spawn(char *argv[]); |
32 | 137 extern void swap(void **p1, void **p2); |