aewl
view dwm.h @ 115:329fd7dae530
removed c->f{x,y,w,h} and c->t{x,y,w,h} in favor for the new rule handling remembering two kinds of geometries is unnecessary, removed the randomized (x,y) setting on dofloat startup, was kind too random und unpredictable
author | arg@10ksloc.org |
---|---|
date | Thu, 20 Jul 2006 07:26:23 +0200 |
parents | dfa5cd0969a6 |
children | 75576e44c1d8 |
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;
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 enum Corner { TopLeft, TopRight, BotLeft, BotRight };
48 struct Fnt {
49 int ascent;
50 int descent;
51 int height;
52 XFontSet set;
53 XFontStruct *xfont;
54 };
56 struct DC { /* draw context */
57 int x, y, w, h;
58 unsigned long bg;
59 unsigned long fg;
60 unsigned long border;
61 Drawable drawable;
62 Fnt font;
63 GC gc;
64 };
66 struct Client {
67 char name[256];
68 char *tags[TLast];
69 int proto;
70 int x, y, w, h;
71 int tx, ty, tw, th; /* title */
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 extern char *tags[TLast], stext[1024];
84 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
85 extern void (*handler[LASTEvent])(XEvent *);
86 extern void (*arrange)(Arg *);
87 extern Atom wmatom[WMLast], netatom[NetLast];
88 extern Bool running, issel;
89 extern Client *clients, *sel;
90 extern Cursor cursor[CurLast];
91 extern DC dc;
92 extern Display *dpy;
93 extern Window root, barwin;
95 /* client.c */
96 extern void ban(Client *c);
97 extern void focus(Client *c);
98 extern void focusnext(Arg *arg);
99 extern void focusprev(Arg *arg);
100 extern Client *getclient(Window w);
101 extern Client *getctitle(Window w);
102 extern void gravitate(Client *c, Bool invert);
103 extern void higher(Client *c);
104 extern void killclient(Arg *arg);
105 extern void lower(Client *c);
106 extern void manage(Window w, XWindowAttributes *wa);
107 extern void maximize(Arg *arg);
108 extern void pop(Client *c);
109 extern void resize(Client *c, Bool inc, Corner sticky);
110 extern void setsize(Client *c);
111 extern void settitle(Client *c);
112 extern void unmanage(Client *c);
113 extern void zoom(Arg *arg);
115 /* draw.c */
116 extern void drawall();
117 extern void drawstatus();
118 extern void drawtitle(Client *c);
119 extern unsigned long getcolor(const char *colstr);
120 extern void setfont(const char *fontstr);
121 extern unsigned int textw(char *text);
123 /* event.c */
124 extern void grabkeys();
126 /* main.c */
127 extern int getproto(Window w);
128 extern void quit(Arg *arg);
129 extern void sendevent(Window w, Atom a, long value);
130 extern int xerror(Display *dsply, XErrorEvent *ee);
132 /* tag.c */
133 extern void appendtag(Arg *arg);
134 extern void dofloat(Arg *arg);
135 extern void dotile(Arg *arg);
136 extern Client *getnext(Client *c, unsigned int t);
137 extern void heretag(Arg *arg);
138 extern void replacetag(Arg *arg);
139 extern void settags(Client *c);
140 extern void view(Arg *arg);
142 /* util.c */
143 extern void *emallocz(unsigned int size);
144 extern void eprint(const char *errstr, ...);
145 extern void spawn(Arg *arg);