aewl

view dwm.h @ 146:f328ce9c558c

centralized/externalized configuration to config.h
author arg@10ksloc.org
date Tue, 01 Aug 2006 13:59:13 +0200
parents e61447a7f249
children 5267e1204367
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>
7 #include CONFIG
9 /* mask shorthands, used in event.c and client.c */
10 #define ButtonMask (ButtonPressMask | ButtonReleaseMask)
11 #define MouseMask (ButtonMask | PointerMotionMask)
13 typedef union Arg Arg;
14 typedef struct Client Client;
15 typedef struct DC DC;
16 typedef struct Fnt Fnt;
18 union Arg {
19 const char **argv;
20 int i;
21 };
23 /* atoms */
24 enum { NetSupported, NetWMName, NetLast };
25 enum { WMProtocols, WMDelete, WMLast };
27 /* cursor */
28 enum { CurNormal, CurResize, CurMove, CurLast };
30 /* windowcorners */
31 typedef enum { TopLeft, TopRight, BotLeft, BotRight } Corner;
33 struct Fnt {
34 int ascent;
35 int descent;
36 int height;
37 XFontSet set;
38 XFontStruct *xfont;
39 };
41 struct DC { /* draw context */
42 int x, y, w, h;
43 unsigned long bg;
44 unsigned long fg;
45 unsigned long border;
46 Drawable drawable;
47 Fnt font;
48 GC gc;
49 };
51 struct Client {
52 char name[256];
53 char *tags[TLast];
54 int proto;
55 int x, y, w, h;
56 int tx, ty, tw, th; /* title */
57 int basew, baseh, incw, inch, maxw, maxh, minw, minh;
58 int grav;
59 unsigned int border;
60 long flags;
61 Bool isfloat;
62 Bool ismax;
63 Client *next;
64 Client *prev;
65 Window win;
66 Window title;
67 };
69 extern char *tags[TLast], stext[1024];
70 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
71 extern void (*handler[LASTEvent])(XEvent *);
72 extern void (*arrange)(Arg *);
73 extern Atom wmatom[WMLast], netatom[NetLast];
74 extern Bool running, issel;
75 extern Client *clients, *sel;
76 extern Cursor cursor[CurLast];
77 extern DC dc;
78 extern Display *dpy;
79 extern Window root, barwin;
81 /* client.c */
82 extern void ban(Client *c);
83 extern void focus(Client *c);
84 extern void focusnext(Arg *arg);
85 extern void focusprev(Arg *arg);
86 extern Client *getclient(Window w);
87 extern Client *getctitle(Window w);
88 extern void gravitate(Client *c, Bool invert);
89 extern void higher(Client *c);
90 extern void killclient(Arg *arg);
91 extern void lower(Client *c);
92 extern void manage(Window w, XWindowAttributes *wa);
93 extern void resize(Client *c, Bool sizehints, Corner sticky);
94 extern void setsize(Client *c);
95 extern void settitle(Client *c);
96 extern void togglemax(Arg *arg);
97 extern void unmanage(Client *c);
98 extern void zoom(Arg *arg);
100 /* draw.c */
101 extern void drawall();
102 extern void drawstatus();
103 extern void drawtitle(Client *c);
104 extern unsigned long getcolor(const char *colstr);
105 extern void setfont(const char *fontstr);
106 extern unsigned int textw(char *text);
108 /* event.c */
109 extern void grabkeys();
111 /* main.c */
112 extern int getproto(Window w);
113 extern void quit(Arg *arg);
114 extern void sendevent(Window w, Atom a, long value);
115 extern int xerror(Display *dsply, XErrorEvent *ee);
117 /* tag.c */
118 extern void appendtag(Arg *arg);
119 extern void dofloat(Arg *arg);
120 extern void dotile(Arg *arg);
121 extern Client *getnext(Client *c);
122 extern Client *getprev(Client *c);
123 extern void replacetag(Arg *arg);
124 extern void settags(Client *c);
125 extern void togglemode(Arg *arg);
126 extern void view(Arg *arg);
127 extern void viewnext(Arg *arg);
128 extern void viewprev(Arg *arg);
130 /* util.c */
131 extern void *emallocz(unsigned int size);
132 extern void eprint(const char *errstr, ...);
133 extern void spawn(Arg *arg);