annotate wm.h @ 31:386649deb651

before leaning things up
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:04:38 +0200
parents 8ad86d0a6a53
children 082c75b937b5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
1 /*
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
3 * See LICENSE file for license details.
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
4 */
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
5
3
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
6 #include "config.h"
2
a79188fe4a40 added new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 0
diff changeset
7 #include "draw.h"
a79188fe4a40 added new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 0
diff changeset
8 #include "util.h"
a79188fe4a40 added new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 0
diff changeset
9
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
10 #include <X11/Xutil.h>
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
11
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
12 #define WM_PROTOCOL_DELWIN 1
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
13
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
14 typedef struct Client Client;
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
15 typedef struct Key Key;
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
16
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
17 /* atoms */
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
18 enum { WMProtocols, WMDelete, WMLast };
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
19 enum { NetSupported, NetWMName, NetLast };
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
20
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
21 /* cursor */
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
22 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
23
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
24 struct Client {
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
25 char name[256];
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
26 char *tags[TLast];
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
27 int proto;
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
28 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
29 int tx, ty, tw, th;
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
30 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
29
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
31 int grav;
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
32 unsigned int border;
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
33 long flags;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
34 Window win;
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
35 Window trans;
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
36 Window title;
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
37 Client *next;
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
38 Client *snext;
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
39 };
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
40
8
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
41 struct Key {
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
42 unsigned long mod;
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
43 KeySym keysym;
14
5c078b66347b added bar event timer
Anselm R. Garbe <garbeam@wmii.de>
parents: 13
diff changeset
44 void (*func)(void *aux);
5c078b66347b added bar event timer
Anselm R. Garbe <garbeam@wmii.de>
parents: 13
diff changeset
45 void *aux;
8
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
46 };
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
47
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
48 extern Display *dpy;
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
49 extern Window root, barwin;
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
50 extern Atom wm_atom[WMLast], net_atom[NetLast];
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
51 extern Cursor cursor[CurLast];
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
52 extern Bool running, issel;
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
53 extern void (*handler[LASTEvent]) (XEvent *);
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
54 extern void (*arrange)(void *aux);
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
55
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
56 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh;
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
57 extern char stext[1024], *tags[TLast];
3
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
58
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
59 extern Brush brush;
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
60 extern Client *clients, *stack;
3
e969f3575b7a several new changes, made gridmenu working
Anselm R. Garbe <garbeam@wmii.de>
parents: 2
diff changeset
61
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
62 /* bar.c */
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
63 extern void draw_bar();
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
64
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
65 /* client.c */
10
703255003abb changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents: 9
diff changeset
66 extern void manage(Window w, XWindowAttributes *wa);
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
67 extern void unmanage(Client *c);
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
68 extern Client *getclient(Window w);
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
69 extern void focus(Client *c);
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
70 extern void update_name(Client *c);
16
359b6e563b95 several changes, new stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 14
diff changeset
71 extern void draw_client(Client *c);
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
72 extern void resize(Client *c);
20
4560e0882c1d made code more readable
Anselm R. Garbe <garbeam@wmii.de>
parents: 19
diff changeset
73 extern void update_size(Client *c);
23
95ffdfd0a819 some more additions/fixes
Anselm R. Garbe <garbeam@wmii.de>
parents: 22
diff changeset
74 extern Client *gettitle(Window w);
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
75 extern void raise(Client *c);
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
76 extern void lower(Client *c);
27
f96fb3fd8203 added grid mode on Mod1Mask g
Anselm R. Garbe <garbeam@wmii.de>
parents: 26
diff changeset
77 extern void kill(void *aux);
f96fb3fd8203 added grid mode on Mod1Mask g
Anselm R. Garbe <garbeam@wmii.de>
parents: 26
diff changeset
78 extern void sel(void *aux);
28
3dceb132082d added max
Anselm R. Garbe <garbeam@wmii.de>
parents: 27
diff changeset
79 extern void max(void *aux);
31
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
80 extern void floating(void *aux);
386649deb651 before leaning things up
Anselm R. Garbe <garbeam@wmii.de>
parents: 29
diff changeset
81 extern void grid(void *aux);
29
8ad86d0a6a53 added gravity stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 28
diff changeset
82 extern void gravitate(Client *c, Bool invert);
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
83
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
84 /* 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
85 extern void discard_events(long even_mask);
5
e5018cae273f added several other stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 3
diff changeset
86
8
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
87 /* key.c */
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
88 extern void update_keys();
9
d567f430a81d fixed several stuff (gridwm gets better and better)
Anselm R. Garbe <garbeam@wmii.de>
parents: 8
diff changeset
89 extern void keypress(XEvent *e);
8
7066ff2fe8bc added key handling
Anselm R. Garbe <garbeam@wmii.de>
parents: 7
diff changeset
90
18
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
91 /* mouse.c */
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
92 extern void mresize(Client *c);
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
93 extern void mmove(Client *c);
1efa34c6e1b6 added mouse-based resizals
Anselm R. Garbe <garbeam@wmii.de>
parents: 16
diff changeset
94
0
491f34c11291 initial import
Anselm R. Garbe <garbeam@wmii.de>
parents:
diff changeset
95 /* wm.c */
10
703255003abb changed how manage client works
Anselm R. Garbe <garbeam@wmii.de>
parents: 9
diff changeset
96 extern int error_handler(Display *dpy, XErrorEvent *error);
13
5cc5e55a132d added protocol killing stuff
Anselm R. Garbe <garbeam@wmii.de>
parents: 10
diff changeset
97 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
98 extern int win_proto(Window w);
27
f96fb3fd8203 added grid mode on Mod1Mask g
Anselm R. Garbe <garbeam@wmii.de>
parents: 26
diff changeset
99 extern void run(void *aux);
f96fb3fd8203 added grid mode on Mod1Mask g
Anselm R. Garbe <garbeam@wmii.de>
parents: 26
diff changeset
100 extern void quit(void *aux);