JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
implemented draw_client 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 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], tag[256];
26         int proto;
27         int x, y, w, h;
28         int basew, baseh, incw, inch, maxw, maxh, minw, minh;
29         long flags; 
30         Window win;
31         Window trans;
32         Window title;
33         Client *next;
34         Client *snext;
35 };
36
37 struct Key {
38         unsigned long mod;
39         KeySym keysym;
40         void (*func)(void *aux);
41         void *aux;
42 };
43
44 extern Display *dpy;
45 extern Window root, barwin;
46 extern Atom wm_atom[WMLast], net_atom[NetLast];
47 extern Cursor cursor[CurLast];
48 extern XRectangle rect, barrect;
49 extern Bool running, sel_screen, grid;
50 extern void (*handler[LASTEvent]) (XEvent *);
51
52 extern int screen;
53 extern char statustext[1024], tag[256];
54
55 extern Brush brush;
56 extern Client *clients, *stack;
57
58 /* bar.c */
59 extern void draw_bar();
60
61 /* cmd.c */
62 extern void run(void *aux);
63 extern void quit(void *aux);
64 extern void kill(void *aux);
65
66 /* client.c */
67 extern void manage(Window w, XWindowAttributes *wa);
68 extern void unmanage(Client *c);
69 extern Client *getclient(Window w);
70 extern void focus(Client *c);
71 extern void update_name(Client *c);
72 extern void draw_client(Client *c);
73 extern void resize(Client *c);
74 extern void update_size(Client *c);
75
76 /* event.c */
77 extern unsigned int discard_events(long even_mask);
78
79 /* key.c */
80 extern void update_keys();
81 extern void keypress(XEvent *e);
82
83 /* mouse.c */
84 extern void mresize(Client *c);
85 extern void mmove(Client *c);
86
87 /* wm.c */
88 extern int error_handler(Display *dpy, XErrorEvent *error);
89 extern void send_message(Window w, Atom a, long value);
90 extern int win_proto(Window w);