aewl
view dwm.h @ 94:6efe82c775c9
pop on heretag
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 18 Jul 2006 11:45:32 +0200 |
parents | c498da7520c7 |
children | 5d88952cbf96 |
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 <X11/Xlib.h>
8 /********** CUSTOMIZE **********/
10 #define FONT "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*"
11 #define BGCOLOR "#0a2c2d"
12 #define FGCOLOR "#ddeeee"
13 #define BORDERCOLOR "#176164"
14 /*
15 #define BGCOLOR "#666699"
16 #define FGCOLOR "#eeeeee"
17 #define BORDERCOLOR "#9999CC"
18 */
19 #define MASTERW 52 /* percent */
20 #define WM_PROTOCOL_DELWIN 1
22 /* tags */
23 enum { Tscratch, Tdev, Twww, Twork, TLast };
25 /********** CUSTOMIZE **********/
27 typedef union Arg Arg;
28 typedef struct DC DC;
29 typedef struct Client Client;
30 typedef struct Fnt Fnt;
31 typedef struct Key Key;
32 typedef struct Rule Rule;
34 union Arg {
35 const char **argv;
36 int i;
37 };
39 /* atoms */
40 enum { NetSupported, NetWMName, NetLast };
41 enum { WMProtocols, WMDelete, WMLast };
43 /* cursor */
44 enum { CurNormal, CurResize, CurMove, CurLast };
46 struct Fnt {
47 int ascent;
48 int descent;
49 int height;
50 XFontSet set;
51 XFontStruct *xfont;
52 };
54 struct DC { /* draw context */
55 int x, y, w, h;
56 unsigned long bg;
57 unsigned long fg;
58 unsigned long border;
59 Drawable drawable;
60 Fnt font;
61 GC gc;
62 };
64 struct Client {
65 char name[256];
66 char *tags[TLast];
67 int proto;
68 int x, y, w, h;
69 int tx, ty, tw, th;
70 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
71 int grav;
72 unsigned int border;
73 long flags;
74 Bool isfloat;
75 Client *next;
76 Client *revert;
77 Window win;
78 Window title;
79 };
81 struct Rule {
82 const char *class;
83 const char *instance;
84 char *tags[TLast];
85 Bool isfloat;
86 };
88 struct Key {
89 unsigned long mod;
90 KeySym keysym;
91 void (*func)(Arg *arg);
92 Arg arg;
93 };
95 extern char *tags[TLast], stext[1024];
96 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
97 extern void (*handler[LASTEvent])(XEvent *);
98 extern void (*arrange)(Arg *);
99 extern Atom wmatom[WMLast], netatom[NetLast];
100 extern Bool running, issel;
101 extern Client *clients, *sel;
102 extern Cursor cursor[CurLast];
103 extern DC dc;
104 extern Display *dpy;
105 extern Key key[];
106 extern Window root, barwin;
108 /* client.c */
109 extern void ban(Client *c);
110 extern void focus(Client *c);
111 extern void focusnext(Arg *arg);
112 extern void focusprev(Arg *arg);
113 extern Client *getclient(Window w);
114 extern Client *getctitle(Window w);
115 extern void gravitate(Client *c, Bool invert);
116 extern void higher(Client *c);
117 extern void killclient(Arg *arg);
118 extern void lower(Client *c);
119 extern void manage(Window w, XWindowAttributes *wa);
120 extern void maximize(Arg *arg);
121 extern void pop(Client *c);
122 extern void resize(Client *c, Bool inc);
123 extern void setsize(Client *c);
124 extern void settitle(Client *c);
125 extern void unmanage(Client *c);
126 extern void zoom(Arg *arg);
128 /* draw.c */
129 extern void drawall();
130 extern void drawstatus();
131 extern void drawtitle(Client *c);
132 extern unsigned long getcolor(const char *colstr);
133 extern void setfont(const char *fontstr);
134 extern unsigned int textw(char *text);
136 /* event.c */
137 extern void grabkeys();
139 /* main.c */
140 extern int getproto(Window w);
141 extern void quit(Arg *arg);
142 extern void sendevent(Window w, Atom a, long value);
143 extern int xerror(Display *dsply, XErrorEvent *ee);
145 /* tag.c */
146 extern void appendtag(Arg *arg);
147 extern void dofloat(Arg *arg);
148 extern void dotile(Arg *arg);
149 extern Client *getnext(Client *c, unsigned int t);
150 extern void heretag(Arg *arg);
151 extern void replacetag(Arg *arg);
152 extern void settags(Client *c);
153 extern void view(Arg *arg);
155 /* util.c */
156 extern void *emallocz(unsigned int size);
157 extern void eprint(const char *errstr, ...);
158 extern void spawn(Arg *arg);