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