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