all repos — dwm @ 4641aa2925731ac180b08c80f57db176391ea4a9

fork of suckless dynamic window manager

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;
16
17/* atoms */
18enum { WMProtocols, WMDelete, WMLast };
19enum { NetSupported, NetWMName, NetLast };
20
21/* cursor */
22enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
23
24struct Client {
25	char name[256], tag[256];
26	int proto;
27	int x, y, w, h;
28	int tx, ty, tw, th;
29	int basew, baseh, incw, inch, maxw, maxh, minw, minh;
30	long flags; 
31	Window win;
32	Window trans;
33	Window title;
34	Client *next;
35	Client *snext;
36};
37
38struct Key {
39	unsigned long mod;
40	KeySym keysym;
41	void (*func)(void *aux);
42	void *aux;
43};
44
45extern Display *dpy;
46extern Window root, barwin;
47extern Atom wm_atom[WMLast], net_atom[NetLast];
48extern Cursor cursor[CurLast];
49extern Bool running, sel_screen, grid;
50extern void (*handler[LASTEvent]) (XEvent *);
51
52extern int screen, sx, sy, sw, sh, bx, by, bw, bh;
53extern char statustext[1024], tag[256];
54
55extern Brush brush;
56extern Client *clients, *stack;
57
58/* bar.c */
59extern void draw_bar();
60
61/* client.c */
62extern void manage(Window w, XWindowAttributes *wa);
63extern void unmanage(Client *c);
64extern Client *getclient(Window w);
65extern void focus(Client *c);
66extern void update_name(Client *c);
67extern void draw_client(Client *c);
68extern void resize(Client *c);
69extern void update_size(Client *c);
70extern Client *gettitle(Window w);
71extern void raise(Client *c);
72extern void lower(Client *c);
73extern void kill(void *aux);
74extern void sel(void *aux);
75
76/* event.c */
77extern void discard_events(long even_mask);
78
79/* grid.c */
80extern void arrange();
81
82/* key.c */
83extern void update_keys();
84extern void keypress(XEvent *e);
85
86/* mouse.c */
87extern void mresize(Client *c);
88extern void mmove(Client *c);
89
90/* wm.c */
91extern int error_handler(Display *dpy, XErrorEvent *error);
92extern void send_message(Window w, Atom a, long value);
93extern int win_proto(Window w);
94extern void run(void *aux);
95extern void quit(void *aux);