dwm-meillo
view dwm.h @ 130:30d1302dbe3b
sanitization of several clunky stuff, removed heretag (rarely of use), simplified pop(), changed shortcuts to always contain MODKEY
author | arg@10ksloc.org |
---|---|
date | Fri, 21 Jul 2006 07:37:52 +0200 |
parents | c478383db7c9 |
children | 9b9deafa0508 |
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 { Tfnord, Tdev, Tnet, Twork, Tmisc, TLast };
26 /* END 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 Bool ismax;
78 Client *next;
79 Client *prev;
80 Window win;
81 Window title;
82 };
84 extern char *tags[TLast], stext[1024];
85 extern int tsel, screen, sx, sy, sw, sh, bx, by, bw, bh, mw;
86 extern void (*handler[LASTEvent])(XEvent *);
87 extern void (*arrange)(Arg *);
88 extern Atom wmatom[WMLast], netatom[NetLast];
89 extern Bool running, issel;
90 extern Client *clients, *sel;
91 extern Cursor cursor[CurLast];
92 extern DC dc;
93 extern Display *dpy;
94 extern Window root, barwin;
96 /* client.c */
97 extern void ban(Client *c);
98 extern void focus(Client *c);
99 extern void focusnext(Arg *arg);
100 extern void focusprev(Arg *arg);
101 extern Client *getclient(Window w);
102 extern Client *getctitle(Window w);
103 extern void gravitate(Client *c, Bool invert);
104 extern void higher(Client *c);
105 extern void killclient(Arg *arg);
106 extern void lower(Client *c);
107 extern void manage(Window w, XWindowAttributes *wa);
108 extern void resize(Client *c, Bool sizehints, Corner sticky);
109 extern void setsize(Client *c);
110 extern void settitle(Client *c);
111 extern void togglemax(Arg *arg);
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 Client *getprev(Client *c);
138 extern void replacetag(Arg *arg);
139 extern void settags(Client *c);
140 extern void togglemode(Arg *arg);
141 extern void view(Arg *arg);
143 /* util.c */
144 extern void *emallocz(unsigned int size);
145 extern void eprint(const char *errstr, ...);
146 extern void spawn(Arg *arg);