several changes, new stuff
[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 /* atoms */
15 enum { WMProtocols, WMDelete, WMLast };
16 enum { NetSupported, NetWMName, NetLast };
17
18 /* cursor */
19 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
20
21 /* rects */
22 enum { RFloat, RGrid, RLast };
23
24 typedef struct Client Client;
25 typedef struct Key Key;
26
27 struct Client {
28 char name[256];
29 char tag[256];
30 unsigned int border;
31 int proto;
32 Bool fixedsize;
33 Window win;
34 Window trans;
35 Window title;
36 XSizeHints size;
37 XRectangle r[RLast];
38 Client *next;
39 Client *snext;
40 };
41
42 struct Key {
43 unsigned long mod;
44 KeySym keysym;
45 void (*func)(void *aux);
46 void *aux;
47 };
48
49 extern Display *dpy;
50 extern Window root, barwin;
51 extern Atom wm_atom[WMLast], net_atom[NetLast];
52 extern Cursor cursor[CurLast];
53 extern XRectangle rect, barrect;
54 extern Bool running, sel_screen, grid;
55 extern void (*handler[LASTEvent]) (XEvent *);
56
57 extern int screen;
58 extern char statustext[1024], tag[256];
59
60 extern Brush brush;
61 extern Client *clients, *stack;
62
63 /* bar.c */
64 extern void draw_bar();
65
66 /* cmd.c */
67 extern void run(void *aux);
68 extern void quit(void *aux);
69 extern void kill(void *aux);
70
71 /* client.c */
72 extern void manage(Window w, XWindowAttributes *wa);
73 extern void unmanage(Client *c);
74 extern Client *getclient(Window w);
75 extern void focus(Client *c);
76 extern void update_name(Client *c);
77 extern void draw_client(Client *c);
78
79 /* event.c */
80 extern unsigned int flush_events(long even_mask);
81
82 /* key.c */
83 extern void update_keys();
84 extern void keypress(XEvent *e);
85
86 /* wm.c */
87 extern int error_handler(Display *dpy, XErrorEvent *error);
88 extern void send_message(Window w, Atom a, long value);
89 extern int win_proto(Window w);