aewl
view dwm.h @ 350:b10852dbbffe
3->4 colors
author | Anselm R. Garbe <arg@10kloc.org> |
---|---|
date | Thu, 24 Aug 2006 12:04:56 +0200 |
parents | a1901753deef |
children | 5a8bdc3b37cb |
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[2];
40 unsigned long fg[2];
41 Drawable drawable;
42 Fnt font;
43 GC gc;
44 } DC;
46 typedef struct Client Client;
47 struct Client {
48 char name[256];
49 int proto;
50 int x, y, w, h;
51 int tx, ty, tw, th; /* title */
52 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
53 int grav;
54 long flags;
55 unsigned int border;
56 Bool isfloat;
57 Bool ismax;
58 Bool *tags;
59 Client *next;
60 Client *prev;
61 Window win;
62 Window twin;
63 };
65 extern const char *tags[];
66 extern char stext[1024];
67 extern int screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
68 extern unsigned int ntags, numlockmask;
69 extern void (*handler[LASTEvent])(XEvent *);
70 extern void (*arrange)(Arg *);
71 extern Atom wmatom[WMLast], netatom[NetLast];
72 extern Bool running, issel, *seltag;
73 extern Client *clients, *sel;
74 extern Cursor cursor[CurLast];
75 extern DC dc;
76 extern Display *dpy;
77 extern Window root, barwin;
79 /* client.c */
80 extern void ban(Client *c);
81 extern void focus(Client *c);
82 extern Client *getclient(Window w);
83 extern Client *getctitle(Window w);
84 extern void gravitate(Client *c, Bool invert);
85 extern void killclient(Arg *arg);
86 extern void manage(Window w, XWindowAttributes *wa);
87 extern void resize(Client *c, Bool sizehints, Corner sticky);
88 extern void setsize(Client *c);
89 extern void settitle(Client *c);
90 extern void togglemax(Arg *arg);
91 extern void unmanage(Client *c);
93 /* draw.c */
94 extern void drawall();
95 extern void drawstatus();
96 extern void drawtitle(Client *c);
97 extern unsigned long getcolor(const char *colstr);
98 extern void setfont(const char *fontstr);
99 extern unsigned int textw(const char *text);
101 /* event.c */
102 extern void grabkeys();
103 extern void procevent();
105 /* main.c */
106 extern int getproto(Window w);
107 extern void quit(Arg *arg);
108 extern void sendevent(Window w, Atom a, long value);
109 extern int xerror(Display *dsply, XErrorEvent *ee);
111 /* tag.c */
112 extern void initrregs();
113 extern Client *getnext(Client *c);
114 extern Client *getprev(Client *c);
115 extern void settags(Client *c);
116 extern void tag(Arg *arg);
117 extern void toggletag(Arg *arg);
119 /* util.c */
120 extern void *emallocz(unsigned int size);
121 extern void eprint(const char *errstr, ...);
122 extern void *erealloc(void *ptr, unsigned int size);
123 extern void spawn(Arg *arg);
125 /* view.c */
126 extern void dofloat(Arg *arg);
127 extern void dotile(Arg *arg);
128 extern void focusnext(Arg *arg);
129 extern void focusprev(Arg *arg);
130 extern Bool isvisible(Client *c);
131 extern void restack();
132 extern void togglemode(Arg *arg);
133 extern void toggleview(Arg *arg);
134 extern void view(Arg *arg);
135 extern void zoom(Arg *arg);