aewl

view dwm.h @ 352:5a8bdc3b37cb

back to 3 colors
author Anselm R. Garbe <arg@10kloc.org>
date Fri, 25 Aug 2006 07:54:49 +0200
parents b10852dbbffe
children 8a06efe5b563
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 <X11/Xlib.h>
9 /* mask shorthands, used in event.c and client.c */
10 #define BUTTONMASK (ButtonPressMask | ButtonReleaseMask)
11 #define MOUSEMASK (BUTTONMASK | PointerMotionMask)
12 #define PROTODELWIN 1
14 typedef union {
15 const char *cmd;
16 int i;
17 } Arg;
19 /* atoms */
20 enum { NetSupported, NetWMName, NetLast };
21 enum { WMProtocols, WMDelete, WMLast };
23 /* cursor */
24 enum { CurNormal, CurResize, CurMove, CurLast };
26 /* window corners */
27 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
29 typedef struct {
30 int ascent;
31 int descent;
32 int height;
33 XFontSet set;
34 XFontStruct *xfont;
35 } Fnt;
37 typedef struct { /* draw context */
38 int x, y, w, h;
39 unsigned long bg;
40 unsigned long fg;
41 unsigned long border;
42 Drawable drawable;
43 Fnt font;
44 GC gc;
45 } DC;
47 typedef struct Client Client;
48 struct Client {
49 char name[256];
50 int proto;
51 int x, y, w, h;
52 int tx, ty, tw, th; /* title */
53 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
54 int grav;
55 long flags;
56 unsigned int border;
57 Bool isfloat;
58 Bool ismax;
59 Bool *tags;
60 Client *next;
61 Client *prev;
62 Window win;
63 Window twin;
64 };
66 extern const char *tags[];
67 extern char stext[1024];
68 extern int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
69 extern unsigned int ntags, numlockmask;
70 extern void (*handler[LASTEvent])(XEvent *);
71 extern void (*arrange)(Arg *);
72 extern Atom wmatom[WMLast], netatom[NetLast];
73 extern Bool running, issel, *seltag;
74 extern Client *clients, *sel;
75 extern Cursor cursor[CurLast];
76 extern DC dc;
77 extern Display *dpy;
78 extern Window root, barwin;
80 /* client.c */
81 extern void ban(Client *c);
82 extern void focus(Client *c);
83 extern Client *getclient(Window w);
84 extern Client *getctitle(Window w);
85 extern void gravitate(Client *c, Bool invert);
86 extern void killclient(Arg *arg);
87 extern void manage(Window w, XWindowAttributes *wa);
88 extern void resize(Client *c, Bool sizehints, Corner sticky);
89 extern void setsize(Client *c);
90 extern void settitle(Client *c);
91 extern void togglemax(Arg *arg);
92 extern void unmanage(Client *c);
94 /* draw.c */
95 extern void drawall();
96 extern void drawstatus();
97 extern void drawtitle(Client *c);
98 extern unsigned long getcolor(const char *colstr);
99 extern void setfont(const char *fontstr);
100 extern unsigned int textw(const char *text);
102 /* event.c */
103 extern void grabkeys();
104 extern void procevent();
106 /* main.c */
107 extern int getproto(Window w);
108 extern void quit(Arg *arg);
109 extern void sendevent(Window w, Atom a, long value);
110 extern int xerror(Display *dsply, XErrorEvent *ee);
112 /* tag.c */
113 extern void initrregs();
114 extern Client *getnext(Client *c);
115 extern Client *getprev(Client *c);
116 extern void settags(Client *c);
117 extern void tag(Arg *arg);
118 extern void toggletag(Arg *arg);
120 /* util.c */
121 extern void *emallocz(unsigned int size);
122 extern void eprint(const char *errstr, ...);
123 extern void *erealloc(void *ptr, unsigned int size);
124 extern void spawn(Arg *arg);
126 /* view.c */
127 extern void dofloat(Arg *arg);
128 extern void dotile(Arg *arg);
129 extern void focusnext(Arg *arg);
130 extern void focusprev(Arg *arg);
131 extern Bool isvisible(Client *c);
132 extern void restack();
133 extern void togglemode(Arg *arg);
134 extern void toggleview(Arg *arg);
135 extern void view(Arg *arg);
136 extern void zoom(Arg *arg);