rev |
line source |
garbeam@0
|
1 /*
|
garbeam@0
|
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
|
garbeam@0
|
3 * See LICENSE file for license details.
|
garbeam@0
|
4 */
|
garbeam@0
|
5
|
garbeam@3
|
6 #include "config.h"
|
garbeam@2
|
7 #include "draw.h"
|
garbeam@2
|
8 #include "util.h"
|
garbeam@2
|
9
|
garbeam@0
|
10 #include <X11/Xutil.h>
|
garbeam@0
|
11
|
garbeam@13
|
12 #define WM_PROTOCOL_DELWIN 1
|
garbeam@13
|
13
|
garbeam@18
|
14 typedef struct Client Client;
|
garbeam@18
|
15 typedef struct Key Key;
|
garbeam@18
|
16
|
garbeam@5
|
17 /* atoms */
|
garbeam@13
|
18 enum { WMProtocols, WMDelete, WMLast };
|
garbeam@0
|
19 enum { NetSupported, NetWMName, NetLast };
|
garbeam@0
|
20
|
garbeam@5
|
21 /* cursor */
|
garbeam@0
|
22 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
|
garbeam@0
|
23
|
garbeam@5
|
24 /* rects */
|
garbeam@0
|
25 enum { RFloat, RGrid, RLast };
|
garbeam@0
|
26
|
garbeam@0
|
27 struct Client {
|
garbeam@0
|
28 char name[256];
|
garbeam@7
|
29 char tag[256];
|
garbeam@13
|
30 int proto;
|
garbeam@5
|
31 Bool fixedsize;
|
garbeam@0
|
32 Window win;
|
garbeam@0
|
33 Window trans;
|
garbeam@0
|
34 Window title;
|
garbeam@0
|
35 XSizeHints size;
|
garbeam@0
|
36 XRectangle r[RLast];
|
garbeam@0
|
37 Client *next;
|
garbeam@5
|
38 Client *snext;
|
garbeam@0
|
39 };
|
garbeam@0
|
40
|
garbeam@8
|
41 struct Key {
|
garbeam@8
|
42 unsigned long mod;
|
garbeam@8
|
43 KeySym keysym;
|
garbeam@14
|
44 void (*func)(void *aux);
|
garbeam@14
|
45 void *aux;
|
garbeam@8
|
46 };
|
garbeam@8
|
47
|
garbeam@0
|
48 extern Display *dpy;
|
garbeam@5
|
49 extern Window root, barwin;
|
garbeam@13
|
50 extern Atom wm_atom[WMLast], net_atom[NetLast];
|
garbeam@0
|
51 extern Cursor cursor[CurLast];
|
garbeam@5
|
52 extern XRectangle rect, barrect;
|
garbeam@13
|
53 extern Bool running, sel_screen, grid;
|
garbeam@5
|
54 extern void (*handler[LASTEvent]) (XEvent *);
|
garbeam@0
|
55
|
garbeam@13
|
56 extern int screen;
|
garbeam@16
|
57 extern char statustext[1024], tag[256];
|
garbeam@3
|
58
|
garbeam@3
|
59 extern Brush brush;
|
garbeam@13
|
60 extern Client *clients, *stack;
|
garbeam@3
|
61
|
garbeam@5
|
62 /* bar.c */
|
garbeam@5
|
63 extern void draw_bar();
|
garbeam@5
|
64
|
garbeam@8
|
65 /* cmd.c */
|
garbeam@14
|
66 extern void run(void *aux);
|
garbeam@14
|
67 extern void quit(void *aux);
|
garbeam@14
|
68 extern void kill(void *aux);
|
garbeam@8
|
69
|
garbeam@5
|
70 /* client.c */
|
garbeam@10
|
71 extern void manage(Window w, XWindowAttributes *wa);
|
garbeam@13
|
72 extern void unmanage(Client *c);
|
garbeam@13
|
73 extern Client *getclient(Window w);
|
garbeam@13
|
74 extern void focus(Client *c);
|
garbeam@13
|
75 extern void update_name(Client *c);
|
garbeam@16
|
76 extern void draw_client(Client *c);
|
garbeam@18
|
77 extern void resize(Client *c);
|
garbeam@13
|
78
|
garbeam@13
|
79 /* event.c */
|
garbeam@18
|
80 extern unsigned int discard_events(long even_mask);
|
garbeam@5
|
81
|
garbeam@8
|
82 /* key.c */
|
garbeam@8
|
83 extern void update_keys();
|
garbeam@9
|
84 extern void keypress(XEvent *e);
|
garbeam@8
|
85
|
garbeam@18
|
86 /* mouse.c */
|
garbeam@18
|
87 extern void mresize(Client *c);
|
garbeam@18
|
88 extern void mmove(Client *c);
|
garbeam@18
|
89
|
garbeam@0
|
90 /* wm.c */
|
garbeam@10
|
91 extern int error_handler(Display *dpy, XErrorEvent *error);
|
garbeam@13
|
92 extern void send_message(Window w, Atom a, long value);
|
garbeam@13
|
93 extern int win_proto(Window w);
|