dwm-meillo

view dwm.h @ 113:b2445fd41f5e

applied Jukka's patch with s/ModKeyMask/MODKEY/g
author arg@10ksloc.org
date Wed, 19 Jul 2006 16:38:39 +0200
parents 3e74cc981e9b
children dfa5cd0969a6
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 #define MODKEY Mod1Mask /* Mod4Mask */
15 /*
16 #define BGCOLOR "#666699"
17 #define FGCOLOR "#eeeeee"
18 #define BORDERCOLOR "#9999CC"
19 */
20 #define MASTERW 52 /* percent */
21 #define WM_PROTOCOL_DELWIN 1
23 /* tags */
24 enum { Tscratch, Tdev, Twww, Twork, TLast };
26 /********** CUSTOMIZE **********/
28 typedef union Arg Arg;
29 typedef struct Client Client;
30 typedef enum Corner Corner;
31 typedef struct DC DC;
32 typedef struct Fnt Fnt;
33 typedef struct Key Key;
34 typedef struct Rule Rule;
36 union Arg {
37 const char **argv;
38 int i;
39 };
41 /* atoms */
42 enum { NetSupported, NetWMName, NetLast };
43 enum { WMProtocols, WMDelete, WMLast };
45 /* cursor */
46 enum { CurNormal, CurResize, CurMove, CurLast };
48 enum Corner { TopLeft, TopRight, BotLeft, BotRight };
50 struct Fnt {
51 int ascent;
52 int descent;
53 int height;
54 XFontSet set;
55 XFontStruct *xfont;
56 };
58 struct DC { /* draw context */
59 int x, y, w, h;
60 unsigned long bg;
61 unsigned long fg;
62 unsigned long border;
63 Drawable drawable;
64 Fnt font;
65 GC gc;
66 };
68 struct Client {
69 char name[256];
70 char *tags[TLast];
71 int proto;
72 int *x, *y, *w, *h; /* current geom */
73 int bx, by, bw, bh; /* title bar */
74 int fx, fy, fw, fh; /* floating geom */
75 int tx, ty, tw, th; /* tiled geom */
76 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
77 int grav;
78 unsigned int border;
79 long flags;
80 Bool isfloat;
81 Client *next;
82 Client *revert;
83 Window win;
84 Window title;
85 };
87 struct Rule {
88 const char *class;
89 const char *instance;
90 char *tags[TLast];
91 Bool isfloat;
92 };
94 struct Key {
95 unsigned long mod;
96 KeySym keysym;
97 void (*func)(Arg *arg);
98 Arg arg;
99 };
101 extern char *tags[TLast], stext[1024];
102 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
103 extern void (*handler[LASTEvent])(XEvent *);
104 extern void (*arrange)(Arg *);
105 extern Atom wmatom[WMLast], netatom[NetLast];
106 extern Bool running, issel;
107 extern Client *clients, *sel;
108 extern Cursor cursor[CurLast];
109 extern DC dc;
110 extern Display *dpy;
111 extern Key key[];
112 extern Window root, barwin;
114 /* client.c */
115 extern void ban(Client *c);
116 extern void focus(Client *c);
117 extern void focusnext(Arg *arg);
118 extern void focusprev(Arg *arg);
119 extern Client *getclient(Window w);
120 extern Client *getctitle(Window w);
121 extern void gravitate(Client *c, Bool invert);
122 extern void higher(Client *c);
123 extern void killclient(Arg *arg);
124 extern void lower(Client *c);
125 extern void manage(Window w, XWindowAttributes *wa);
126 extern void maximize(Arg *arg);
127 extern void pop(Client *c);
128 extern void resize(Client *c, Bool inc, Corner sticky);
129 extern void setgeom(Client *c);
130 extern void setsize(Client *c);
131 extern void settitle(Client *c);
132 extern void unmanage(Client *c);
133 extern void zoom(Arg *arg);
135 /* draw.c */
136 extern void drawall();
137 extern void drawstatus();
138 extern void drawtitle(Client *c);
139 extern unsigned long getcolor(const char *colstr);
140 extern void setfont(const char *fontstr);
141 extern unsigned int textw(char *text);
143 /* event.c */
144 extern void grabkeys();
146 /* main.c */
147 extern int getproto(Window w);
148 extern void quit(Arg *arg);
149 extern void sendevent(Window w, Atom a, long value);
150 extern int xerror(Display *dsply, XErrorEvent *ee);
152 /* tag.c */
153 extern void appendtag(Arg *arg);
154 extern void dofloat(Arg *arg);
155 extern void dotile(Arg *arg);
156 extern Client *getnext(Client *c, unsigned int t);
157 extern void heretag(Arg *arg);
158 extern void replacetag(Arg *arg);
159 extern void settags(Client *c);
160 extern void view(Arg *arg);
162 /* util.c */
163 extern void *emallocz(unsigned int size);
164 extern void eprint(const char *errstr, ...);
165 extern void spawn(Arg *arg);