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 typedef enum Align Align;
|
garbeam@18
|
17
|
garbeam@18
|
18 enum Align {
|
garbeam@18
|
19 NORTH = 0x01,
|
garbeam@18
|
20 EAST = 0x02,
|
garbeam@18
|
21 SOUTH = 0x04,
|
garbeam@18
|
22 WEST = 0x08,
|
garbeam@18
|
23 NEAST = NORTH | EAST,
|
garbeam@18
|
24 NWEST = NORTH | WEST,
|
garbeam@18
|
25 SEAST = SOUTH | EAST,
|
garbeam@18
|
26 SWEST = SOUTH | WEST,
|
garbeam@18
|
27 CENTER = NEAST | SWEST
|
garbeam@18
|
28 };
|
garbeam@18
|
29
|
garbeam@5
|
30 /* atoms */
|
garbeam@13
|
31 enum { WMProtocols, WMDelete, WMLast };
|
garbeam@0
|
32 enum { NetSupported, NetWMName, NetLast };
|
garbeam@0
|
33
|
garbeam@5
|
34 /* cursor */
|
garbeam@0
|
35 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
|
garbeam@0
|
36
|
garbeam@5
|
37 /* rects */
|
garbeam@0
|
38 enum { RFloat, RGrid, RLast };
|
garbeam@0
|
39
|
garbeam@0
|
40 struct Client {
|
garbeam@0
|
41 char name[256];
|
garbeam@7
|
42 char tag[256];
|
garbeam@5
|
43 unsigned int border;
|
garbeam@13
|
44 int proto;
|
garbeam@5
|
45 Bool fixedsize;
|
garbeam@0
|
46 Window win;
|
garbeam@0
|
47 Window trans;
|
garbeam@0
|
48 Window title;
|
garbeam@0
|
49 XSizeHints size;
|
garbeam@0
|
50 XRectangle r[RLast];
|
garbeam@0
|
51 Client *next;
|
garbeam@5
|
52 Client *snext;
|
garbeam@0
|
53 };
|
garbeam@0
|
54
|
garbeam@8
|
55 struct Key {
|
garbeam@8
|
56 unsigned long mod;
|
garbeam@8
|
57 KeySym keysym;
|
garbeam@14
|
58 void (*func)(void *aux);
|
garbeam@14
|
59 void *aux;
|
garbeam@8
|
60 };
|
garbeam@8
|
61
|
garbeam@0
|
62 extern Display *dpy;
|
garbeam@5
|
63 extern Window root, barwin;
|
garbeam@13
|
64 extern Atom wm_atom[WMLast], net_atom[NetLast];
|
garbeam@0
|
65 extern Cursor cursor[CurLast];
|
garbeam@5
|
66 extern XRectangle rect, barrect;
|
garbeam@13
|
67 extern Bool running, sel_screen, grid;
|
garbeam@5
|
68 extern void (*handler[LASTEvent]) (XEvent *);
|
garbeam@0
|
69
|
garbeam@13
|
70 extern int screen;
|
garbeam@16
|
71 extern char statustext[1024], tag[256];
|
garbeam@3
|
72
|
garbeam@3
|
73 extern Brush brush;
|
garbeam@13
|
74 extern Client *clients, *stack;
|
garbeam@3
|
75
|
garbeam@5
|
76 /* bar.c */
|
garbeam@5
|
77 extern void draw_bar();
|
garbeam@5
|
78
|
garbeam@8
|
79 /* cmd.c */
|
garbeam@14
|
80 extern void run(void *aux);
|
garbeam@14
|
81 extern void quit(void *aux);
|
garbeam@14
|
82 extern void kill(void *aux);
|
garbeam@8
|
83
|
garbeam@5
|
84 /* client.c */
|
garbeam@10
|
85 extern void manage(Window w, XWindowAttributes *wa);
|
garbeam@13
|
86 extern void unmanage(Client *c);
|
garbeam@13
|
87 extern Client *getclient(Window w);
|
garbeam@13
|
88 extern void focus(Client *c);
|
garbeam@13
|
89 extern void update_name(Client *c);
|
garbeam@16
|
90 extern void draw_client(Client *c);
|
garbeam@18
|
91 extern void resize(Client *c);
|
garbeam@13
|
92
|
garbeam@13
|
93 /* event.c */
|
garbeam@18
|
94 extern unsigned int discard_events(long even_mask);
|
garbeam@5
|
95
|
garbeam@8
|
96 /* key.c */
|
garbeam@8
|
97 extern void update_keys();
|
garbeam@9
|
98 extern void keypress(XEvent *e);
|
garbeam@8
|
99
|
garbeam@18
|
100 /* mouse.c */
|
garbeam@18
|
101 extern void mresize(Client *c);
|
garbeam@18
|
102 extern void mmove(Client *c);
|
garbeam@18
|
103
|
garbeam@0
|
104 /* wm.c */
|
garbeam@10
|
105 extern int error_handler(Display *dpy, XErrorEvent *error);
|
garbeam@13
|
106 extern void send_message(Window w, Atom a, long value);
|
garbeam@13
|
107 extern int win_proto(Window w);
|