JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
8cc87f07c0392d08cfb5c0abeac062c3a6002ec1
[dwm.git] / wm.h
1 /*
2  * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3  * See LICENSE file for license details.
4  */
5
6 #include "config.h"
7 #include "draw.h"
8 #include "util.h"
9
10 #include <X11/Xutil.h>
11
12 #define WM_PROTOCOL_DELWIN 1
13
14 typedef struct Client Client;
15 typedef struct Key Key;
16
17 /* atoms */
18 enum { WMProtocols, WMDelete, WMLast };
19 enum { NetSupported, NetWMName, NetLast };
20
21 /* cursor */
22 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
23
24 struct Client {
25         char name[256];
26         char *tags[TLast];
27         int proto;
28         int x, y, w, h;
29         int tx, ty, tw, th;
30         int basew, baseh, incw, inch, maxw, maxh, minw, minh;
31         int grav;
32         unsigned int border;
33         long flags; 
34         Window win;
35         Window trans;
36         Window title;
37         Client *next;
38         Client *snext;
39 };
40
41 struct Key {
42         unsigned long mod;
43         KeySym keysym;
44         void (*func)(void *aux);
45         void *aux;
46 };
47
48 extern Display *dpy;
49 extern Window root, barwin;
50 extern Atom wm_atom[WMLast], net_atom[NetLast];
51 extern Cursor cursor[CurLast];
52 extern Bool running, issel;
53 extern void (*handler[LASTEvent]) (XEvent *);
54 extern void (*arrange)(void *aux);
55
56 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh;
57 extern char stext[1024], *tags[TLast];
58
59 extern Brush brush;
60 extern Client *clients, *stack;
61
62 /* bar.c */
63 extern void draw_bar();
64
65 /* client.c */
66 extern void manage(Window w, XWindowAttributes *wa);
67 extern void unmanage(Client *c);
68 extern Client *getclient(Window w);
69 extern void focus(Client *c);
70 extern void update_name(Client *c);
71 extern void draw_client(Client *c);
72 extern void resize(Client *c);
73 extern void update_size(Client *c);
74 extern Client *gettitle(Window w);
75 extern void raise(Client *c);
76 extern void lower(Client *c);
77 extern void kill(void *aux);
78 extern void sel(void *aux);
79 extern void max(void *aux);
80 extern void floating(void *aux);
81 extern void grid(void *aux);
82 extern void gravitate(Client *c, Bool invert);
83
84 /* event.c */
85 extern void discard_events(long even_mask);
86
87 /* key.c */
88 extern void update_keys();
89 extern void keypress(XEvent *e);
90
91 /* mouse.c */
92 extern void mresize(Client *c);
93 extern void mmove(Client *c);
94
95 /* wm.c */
96 extern int error_handler(Display *dpy, XErrorEvent *error);
97 extern void send_message(Window w, Atom a, long value);
98 extern int win_proto(Window w);
99 extern void run(void *aux);
100 extern void quit(void *aux);