aewl
view dwm.h @ 84:052fe7498930
ordered variables in structs and source files alphabetically
author | Anselm R. Garbe <garbeam@wmii.de> |
---|---|
date | Mon, 17 Jul 2006 09:12:29 +0200 |
parents | 8125f908c80c |
children | c498da7520c7 |
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 resize(Client *c, Bool inc);
122 extern void setsize(Client *c);
123 extern void settitle(Client *c);
124 extern void unmanage(Client *c);
125 extern void zoom(Arg *arg);
127 /* draw.c */
128 extern void drawall();
129 extern void drawstatus();
130 extern void drawtitle(Client *c);
131 extern unsigned long getcolor(const char *colstr);
132 extern void setfont(const char *fontstr);
133 extern unsigned int textw(char *text);
135 /* event.c */
136 extern void grabkeys();
138 /* main.c */
139 extern int getproto(Window w);
140 extern void quit(Arg *arg);
141 extern void sendevent(Window w, Atom a, long value);
142 extern int xerror(Display *dsply, XErrorEvent *ee);
144 /* tag.c */
145 extern void appendtag(Arg *arg);
146 extern void dofloat(Arg *arg);
147 extern void dotile(Arg *arg);
148 extern Client *getnext(Client *c);
149 extern void replacetag(Arg *arg);
150 extern void settags(Client *c);
151 extern void view(Arg *arg);
153 /* util.c */
154 extern void *emallocz(unsigned int size);
155 extern void eprint(const char *errstr, ...);
156 extern void spawn(Arg *arg);