aewl

view dwm.h @ 78:0d71fb80b592

changing XFlush into XSync
author Anselm R. Garbe <garbeam@wmii.de>
date Sat, 15 Jul 2006 18:11:14 +0200
parents 38c8f7f7d401
children 8125f908c80c
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 { WMProtocols, WMDelete, WMLast };
41 enum { NetSupported, NetWMName, NetLast };
43 /* cursor */
44 enum { CurNormal, CurResize, CurMove, CurInput, CurLast };
46 struct Fnt {
47 XFontStruct *xfont;
48 XFontSet set;
49 int ascent;
50 int descent;
51 int height;
52 };
54 struct DC { /* draw context */
55 GC gc;
56 Drawable drawable;
57 int x, y, w, h;
58 Fnt font;
59 unsigned long bg;
60 unsigned long fg;
61 unsigned long border;
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 dofloat;
75 Window win;
76 Window title;
77 Client *next;
78 Client *revert;
79 };
81 struct Rule {
82 const char *class;
83 const char *instance;
84 char *tags[TLast];
85 Bool dofloat;
86 };
88 struct Key {
89 unsigned long mod;
90 KeySym keysym;
91 void (*func)(Arg *arg);
92 Arg arg;
93 };
95 extern Display *dpy;
96 extern Window root, barwin;
97 extern Atom wmatom[WMLast], netatom[NetLast];
98 extern Cursor cursor[CurLast];
99 extern Bool running, issel;
100 extern void (*handler[LASTEvent])(XEvent *);
101 extern void (*arrange)(Arg *);
102 extern Key key[];
104 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
105 extern char *tags[TLast], stext[1024];
107 extern DC dc;
108 extern Client *clients, *sel;
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 resize(Client *c, Bool inc);
124 extern void setsize(Client *c);
125 extern void settitle(Client *c);
126 extern void unmanage(Client *c);
127 extern void zoom(Arg *arg);
129 /* draw.c */
130 extern void drawall();
131 extern void drawstatus();
132 extern void drawtitle(Client *c);
133 extern unsigned long getcolor(const char *colstr);
134 extern void setfont(const char *fontstr);
135 extern unsigned int textw(char *text);
137 /* event.c */
138 extern void grabkeys();
140 /* main.c */
141 extern int getproto(Window w);
142 extern void quit(Arg *arg);
143 extern void sendevent(Window w, Atom a, long value);
144 extern int xerror(Display *dsply, XErrorEvent *ee);
146 /* tag.c */
147 extern void appendtag(Arg *arg);
148 extern void dofloat(Arg *arg);
149 extern void dotile(Arg *arg);
150 extern Client *getnext(Client *c);
151 extern void replacetag(Arg *arg);
152 extern void settags(Client *c);
153 extern void view(Arg *arg);
155 /* util.c */
156 extern void *emallocz(unsigned int size);
157 extern void eprint(const char *errstr, ...);
158 extern void spawn(Arg *arg);