aewl

view dwm.h @ 114:dfa5cd0969a6

implemented regexp matching for rules
author arg@10ksloc.org
date Wed, 19 Jul 2006 17:42:08 +0200
parents b2445fd41f5e
children 329fd7dae530
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; /* current geom */
71 int bx, by, bw, bh; /* title bar */
72 int fx, fy, fw, fh; /* floating geom */
73 int tx, ty, tw, th; /* tiled geom */
74 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
75 int grav;
76 unsigned int border;
77 long flags;
78 Bool isfloat;
79 Client *next;
80 Client *revert;
81 Window win;
82 Window title;
83 };
85 extern char *tags[TLast], stext[1024];
86 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
87 extern void (*handler[LASTEvent])(XEvent *);
88 extern void (*arrange)(Arg *);
89 extern Atom wmatom[WMLast], netatom[NetLast];
90 extern Bool running, issel;
91 extern Client *clients, *sel;
92 extern Cursor cursor[CurLast];
93 extern DC dc;
94 extern Display *dpy;
95 extern Window root, barwin;
97 /* client.c */
98 extern void ban(Client *c);
99 extern void focus(Client *c);
100 extern void focusnext(Arg *arg);
101 extern void focusprev(Arg *arg);
102 extern Client *getclient(Window w);
103 extern Client *getctitle(Window w);
104 extern void gravitate(Client *c, Bool invert);
105 extern void higher(Client *c);
106 extern void killclient(Arg *arg);
107 extern void lower(Client *c);
108 extern void manage(Window w, XWindowAttributes *wa);
109 extern void maximize(Arg *arg);
110 extern void pop(Client *c);
111 extern void resize(Client *c, Bool inc, Corner sticky);
112 extern void setgeom(Client *c);
113 extern void setsize(Client *c);
114 extern void settitle(Client *c);
115 extern void unmanage(Client *c);
116 extern void zoom(Arg *arg);
118 /* draw.c */
119 extern void drawall();
120 extern void drawstatus();
121 extern void drawtitle(Client *c);
122 extern unsigned long getcolor(const char *colstr);
123 extern void setfont(const char *fontstr);
124 extern unsigned int textw(char *text);
126 /* event.c */
127 extern void grabkeys();
129 /* main.c */
130 extern int getproto(Window w);
131 extern void quit(Arg *arg);
132 extern void sendevent(Window w, Atom a, long value);
133 extern int xerror(Display *dsply, XErrorEvent *ee);
135 /* tag.c */
136 extern void appendtag(Arg *arg);
137 extern void dofloat(Arg *arg);
138 extern void dotile(Arg *arg);
139 extern Client *getnext(Client *c, unsigned int t);
140 extern void heretag(Arg *arg);
141 extern void replacetag(Arg *arg);
142 extern void settags(Client *c);
143 extern void view(Arg *arg);
145 /* util.c */
146 extern void *emallocz(unsigned int size);
147 extern void eprint(const char *errstr, ...);
148 extern void spawn(Arg *arg);