dwm-meillo
view dwm.h @ 95:5d88952cbf96
implemened distinguishing float/managed geometries of clients (works quite well)
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Tue, 18 Jul 2006 12:36:57 +0200 |
parents | 6efe82c775c9 |
children | a19556fe83b5 |
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; /* current geom */
69 int bx, by, bw, bh; /* title bar */
70 int fx, fy, fw, fh; /* floating geom */
71 int tx, ty, tw, th; /* tiled geom */
72 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
73 int grav;
74 unsigned int border;
75 long flags;
76 Bool isfloat;
77 Client *next;
78 Client *revert;
79 Window win;
80 Window title;
81 };
83 struct Rule {
84 const char *class;
85 const char *instance;
86 char *tags[TLast];
87 Bool isfloat;
88 };
90 struct Key {
91 unsigned long mod;
92 KeySym keysym;
93 void (*func)(Arg *arg);
94 Arg arg;
95 };
97 extern char *tags[TLast], stext[1024];
98 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
99 extern void (*handler[LASTEvent])(XEvent *);
100 extern void (*arrange)(Arg *);
101 extern Atom wmatom[WMLast], netatom[NetLast];
102 extern Bool running, issel;
103 extern Client *clients, *sel;
104 extern Cursor cursor[CurLast];
105 extern DC dc;
106 extern Display *dpy;
107 extern Key key[];
108 extern Window root, barwin;
110 /* client.c */
111 extern void ban(Client *c);
112 extern void focus(Client *c);
113 extern void focusnext(Arg *arg);
114 extern void focusprev(Arg *arg);
115 extern Client *getclient(Window w);
116 extern Client *getctitle(Window w);
117 extern void gravitate(Client *c, Bool invert);
118 extern void higher(Client *c);
119 extern void killclient(Arg *arg);
120 extern void lower(Client *c);
121 extern void manage(Window w, XWindowAttributes *wa);
122 extern void maximize(Arg *arg);
123 extern void pop(Client *c);
124 extern void resize(Client *c, Bool inc);
125 extern void setgeom(Client *c);
126 extern void setsize(Client *c);
127 extern void settitle(Client *c);
128 extern void unmanage(Client *c);
129 extern void zoom(Arg *arg);
131 /* draw.c */
132 extern void drawall();
133 extern void drawstatus();
134 extern void drawtitle(Client *c);
135 extern unsigned long getcolor(const char *colstr);
136 extern void setfont(const char *fontstr);
137 extern unsigned int textw(char *text);
139 /* event.c */
140 extern void grabkeys();
142 /* main.c */
143 extern int getproto(Window w);
144 extern void quit(Arg *arg);
145 extern void sendevent(Window w, Atom a, long value);
146 extern int xerror(Display *dsply, XErrorEvent *ee);
148 /* tag.c */
149 extern void appendtag(Arg *arg);
150 extern void dofloat(Arg *arg);
151 extern void dotile(Arg *arg);
152 extern Client *getnext(Client *c, unsigned int t);
153 extern void heretag(Arg *arg);
154 extern void replacetag(Arg *arg);
155 extern void settags(Client *c);
156 extern void view(Arg *arg);
158 /* util.c */
159 extern void *emallocz(unsigned int size);
160 extern void eprint(const char *errstr, ...);
161 extern void spawn(Arg *arg);