aewl
view wm.h @ 18:1efa34c6e1b6
added mouse-based resizals
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 11 Jul 2006 21:24:10 +0200 |
parents | 359b6e563b95 |
children | b5510d0c6d43 |
line source
1 /*
2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
3 * See LICENSE file for license details.
4 */
6 #include "config.h"
7 #include "draw.h"
8 #include "util.h"
10 #include <X11/Xutil.h>
12 #define WM_PROTOCOL_DELWIN 1
14 typedef struct Client Client;
15 typedef struct Key Key;
16 typedef enum Align Align;
18 enum 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 };
30 /* atoms */
31 enum { WMProtocols, WMDelete, WMLast };
32 enum { NetSupported, NetWMName, NetLast };
34 /* cursor */
35 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
37 /* rects */
38 enum { RFloat, RGrid, RLast };
40 struct 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 };
55 struct Key {
56 unsigned long mod;
57 KeySym keysym;
58 void (*func)(void *aux);
59 void *aux;
60 };
62 extern Display *dpy;
63 extern Window root, barwin;
64 extern Atom wm_atom[WMLast], net_atom[NetLast];
65 extern Cursor cursor[CurLast];
66 extern XRectangle rect, barrect;
67 extern Bool running, sel_screen, grid;
68 extern void (*handler[LASTEvent]) (XEvent *);
70 extern int screen;
71 extern char statustext[1024], tag[256];
73 extern Brush brush;
74 extern Client *clients, *stack;
76 /* bar.c */
77 extern void draw_bar();
79 /* cmd.c */
80 extern void run(void *aux);
81 extern void quit(void *aux);
82 extern void kill(void *aux);
84 /* client.c */
85 extern void manage(Window w, XWindowAttributes *wa);
86 extern void unmanage(Client *c);
87 extern Client *getclient(Window w);
88 extern void focus(Client *c);
89 extern void update_name(Client *c);
90 extern void draw_client(Client *c);
91 extern void resize(Client *c);
93 /* event.c */
94 extern unsigned int discard_events(long even_mask);
96 /* key.c */
97 extern void update_keys();
98 extern void keypress(XEvent *e);
100 /* mouse.c */
101 extern void mresize(Client *c);
102 extern void mmove(Client *c);
104 /* wm.c */
105 extern int error_handler(Display *dpy, XErrorEvent *error);
106 extern void send_message(Window w, Atom a, long value);
107 extern int win_proto(Window w);