Xinqi Bao's Git

added protocol killing 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)(char *arg);
46 char *arg;
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 *bartext, 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(char *arg);
68 extern void quit(char *arg);
69
70 /* client.c */
71 extern void manage(Window w, XWindowAttributes *wa);
72 extern void unmanage(Client *c);
73 extern Client *getclient(Window w);
74 extern void focus(Client *c);
75 extern void update_name(Client *c);
76
77 /* event.c */
78 extern unsigned int flush_events(long even_mask);
79
80 /* key.c */
81 extern void update_keys();
82 extern void keypress(XEvent *e);
83
84 /* wm.c */
85 extern int error_handler(Display *dpy, XErrorEvent *error);
86 extern void send_message(Window w, Atom a, long value);
87 extern int win_proto(Window w);