aewl
view wm.h @ 26:e8f627998d6f
simplified several portions of code through replacing rect structs with x,y,h,w counterparts (much more readable)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Wed, 12 Jul 2006 15:17:22 +0200 |
parents | 95ffdfd0a819 |
children | f96fb3fd8203 |
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;
17 /* atoms */
18 enum { WMProtocols, WMDelete, WMLast };
19 enum { NetSupported, NetWMName, NetLast };
21 /* cursor */
22 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
24 struct 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 };
38 struct Key {
39 unsigned long mod;
40 KeySym keysym;
41 void (*func)(void *aux);
42 void *aux;
43 };
45 extern Display *dpy;
46 extern Window root, barwin;
47 extern Atom wm_atom[WMLast], net_atom[NetLast];
48 extern Cursor cursor[CurLast];
49 extern Bool running, sel_screen, grid;
50 extern void (*handler[LASTEvent]) (XEvent *);
52 extern int screen, sx, sy, sw, sh, bx, by, bw, bh;
53 extern char statustext[1024], tag[256];
55 extern Brush brush;
56 extern Client *clients, *stack;
58 /* bar.c */
59 extern void draw_bar();
61 /* cmd.c */
62 extern void run(void *aux);
63 extern void quit(void *aux);
64 extern void kill(void *aux);
65 extern void sel(void *aux);
67 /* client.c */
68 extern void manage(Window w, XWindowAttributes *wa);
69 extern void unmanage(Client *c);
70 extern Client *getclient(Window w);
71 extern void focus(Client *c);
72 extern void update_name(Client *c);
73 extern void draw_client(Client *c);
74 extern void resize(Client *c);
75 extern void update_size(Client *c);
76 extern Client *gettitle(Window w);
77 extern void raise(Client *c);
78 extern void lower(Client *c);
80 /* event.c */
81 extern void discard_events(long even_mask);
83 /* key.c */
84 extern void update_keys();
85 extern void keypress(XEvent *e);
87 /* mouse.c */
88 extern void mresize(Client *c);
89 extern void mmove(Client *c);
91 /* wm.c */
92 extern int error_handler(Display *dpy, XErrorEvent *error);
93 extern void send_message(Window w, Atom a, long value);
94 extern int win_proto(Window w);