added logo+description

This commit is contained in:
Anselm R. Garbe 2006-07-13 09:32:22 +02:00
parent d7e17087ed
commit 650a1fb4e1
12 changed files with 194 additions and 115 deletions

View file

@ -1,18 +1,18 @@
# gridwm - grid window manager # dwm - dynamic window manager
# (C)opyright MMVI Anselm R. Garbe # (C)opyright MMVI Anselm R. Garbe
include config.mk include config.mk
SRC = client.c draw.c event.c kb.c mouse.c util.c wm.c SRC = client.c draw.c event.c kb.c mouse.c util.c wm.c
OBJ = ${SRC:.c=.o} OBJ = ${SRC:.c=.o}
MAN1 = gridwm.1 MAN1 = dwm.1
BIN = gridwm BIN = dwm
all: config gridwm all: config dwm
@echo finished @echo finished
config: config:
@echo gridwm build options: @echo dwm build options:
@echo "LIBS = ${LIBS}" @echo "LIBS = ${LIBS}"
@echo "CFLAGS = ${CFLAGS}" @echo "CFLAGS = ${CFLAGS}"
@echo "LDFLAGS = ${LDFLAGS}" @echo "LDFLAGS = ${LDFLAGS}"
@ -24,19 +24,19 @@ config:
${OBJ}: wm.h ${OBJ}: wm.h
gridwm: ${OBJ} dwm: ${OBJ}
@echo LD $@ @echo LD $@
@${CC} -o $@ ${OBJ} ${LDFLAGS} @${CC} -o $@ ${OBJ} ${LDFLAGS}
clean: clean:
rm -f gridwm *.o core rm -f dwm *.o core
dist: clean dist: clean
mkdir -p gridwm-${VERSION} mkdir -p dwm-${VERSION}
cp -R Makefile README LICENSE config.mk *.h *.c ${MAN} gridwm-${VERSION} cp -R Makefile README LICENSE config.mk *.h *.c ${MAN} dwm-${VERSION}
tar -cf gridwm-${VERSION}.tar gridwm-${VERSION} tar -cf dwm-${VERSION}.tar dwm-${VERSION}
gzip gridwm-${VERSION}.tar gzip dwm-${VERSION}.tar
rm -rf gridwm-${VERSION} rm -rf dwm-${VERSION}
install: all install: all
@mkdir -p ${DESTDIR}${PREFIX}/bin @mkdir -p ${DESTDIR}${PREFIX}/bin

25
README
View file

@ -1,41 +1,40 @@
gridwm dwm
------ ------
gridwm is an extremly fast, small, and automatic X11 window manager. It dwm is an extremly fast, small, and dynamic X11 window manager.
arranges all windows in a grid.
Requirements Requirements
------------ ------------
In order to build gridwm you need the Xlib header files. In order to build dwm you need the Xlib header files.
Installation Installation
------------ ------------
Edit config.mk to match your local setup. gridwm is installed into Edit config.mk to match your local setup. dwm is installed into
the /usr/local namespace by default. the /usr/local namespace by default.
Afterwards enter the following command to build and install gridwm (if Afterwards enter the following command to build and install dwm (if
necessary as root): necessary as root):
make clean install make clean install
Running gridwm Running dwm
-------------- --------------
Add the following line to your .xinitrc to start gridwm using startx: Add the following line to your .xinitrc to start dwm using startx:
exec gridwm exec dwm
In order to connect gridwm to a specific display, make sure that In order to connect dwm to a specific display, make sure that
the DISPLAY environment variable is set correctly, e.g.: the DISPLAY environment variable is set correctly, e.g.:
DISPLAY=foo.bar:1 exec gridwm DISPLAY=foo.bar:1 exec dwm
This will start gridwm on display :1 of the host foo.bar. This will start dwm on display :1 of the host foo.bar.
Configuration Configuration
------------- -------------
The configuration of gridwm is done by customizing the wm.h source file. To The configuration of dwm is done by customizing the wm.h source file. To
customize the key bindings edit kb.c. customize the key bindings edit kb.c.

View file

@ -11,7 +11,9 @@
#include "wm.h" #include "wm.h"
void (*arrange)(void *aux); static void floating(void);
static void tiling(void);
static void (*arrange)(void) = tiling;
void void
max(void *aux) max(void *aux)
@ -26,25 +28,23 @@ max(void *aux)
discard_events(EnterWindowMask); discard_events(EnterWindowMask);
} }
void static void
floating(void *aux) floating(void)
{ {
Client *c; Client *c;
arrange = floating;
for(c = stack; c; c = c->snext) for(c = stack; c; c = c->snext)
resize(c); resize(c);
discard_events(EnterWindowMask); discard_events(EnterWindowMask);
} }
void static void
grid(void *aux) tiling(void)
{ {
Client *c; Client *c;
int n, cols, rows, gw, gh, i, j; int n, cols, rows, gw, gh, i, j;
float rt, fd; float rt, fd;
arrange = grid;
if(!clients) if(!clients)
return; return;
for(n = 0, c = clients; c; c = c->next, n++); for(n = 0, c = clients; c; c = c->next, n++);
@ -75,6 +75,17 @@ grid(void *aux)
discard_events(EnterWindowMask); discard_events(EnterWindowMask);
} }
void
toggle(void *aux)
{
if(arrange == floating)
arrange = tiling;
else
arrange = floating;
arrange();
}
void void
sel(void *aux) sel(void *aux)
{ {
@ -114,8 +125,8 @@ resize_title(Client *c)
c->tw = 0; c->tw = 0;
for(i = 0; i < TLast; i++) for(i = 0; i < TLast; i++)
if(c->tags[i]) if(c->tags[i])
c->tw += textw(&brush.font, c->tags[i]) + brush.font.height; c->tw += textw(&dc.font, c->tags[i]) + dc.font.height;
c->tw += textw(&brush.font, c->name) + brush.font.height; c->tw += textw(&dc.font, c->name) + dc.font.height;
if(c->tw > c->w) if(c->tw > c->w)
c->tw = c->w + 2; c->tw = c->w + 2;
c->tx = c->x + c->w - c->tw + 2; c->tx = c->x + c->w - c->tw + 2;
@ -240,7 +251,7 @@ manage(Window w, XWindowAttributes *wa)
c->border = 1; c->border = 1;
update_size(c); update_size(c);
XSetWindowBorderWidth(dpy, c->win, 1); XSetWindowBorderWidth(dpy, c->win, 1);
XSetWindowBorder(dpy, c->win, brush.border); XSetWindowBorder(dpy, c->win, dc.border);
XSelectInput(dpy, c->win, XSelectInput(dpy, c->win,
StructureNotifyMask | PropertyChangeMask | EnterWindowMask); StructureNotifyMask | PropertyChangeMask | EnterWindowMask);
XGetTransientForHint(dpy, c->win, &c->trans); XGetTransientForHint(dpy, c->win, &c->trans);
@ -266,7 +277,7 @@ manage(Window w, XWindowAttributes *wa)
GrabModeAsync, GrabModeSync, None, None); GrabModeAsync, GrabModeSync, None, None);
XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask, XGrabButton(dpy, Button3, Mod1Mask, c->win, False, ButtonPressMask,
GrabModeAsync, GrabModeSync, None, None); GrabModeAsync, GrabModeSync, None, None);
arrange(NULL); arrange();
focus(c); focus(c);
} }
@ -385,7 +396,7 @@ unmanage(Client *c)
XFlush(dpy); XFlush(dpy);
XSetErrorHandler(error_handler); XSetErrorHandler(error_handler);
XUngrabServer(dpy); XUngrabServer(dpy);
arrange(NULL); arrange();
if(stack) if(stack)
focus(stack); focus(stack);
} }
@ -417,21 +428,21 @@ draw_client(Client *c)
if(c == stack) if(c == stack)
return; return;
brush.x = brush.y = 0; dc.x = dc.y = 0;
brush.h = c->th; dc.h = c->th;
brush.w = 0; dc.w = 0;
for(i = 0; i < TLast; i++) { for(i = 0; i < TLast; i++) {
if(c->tags[i]) { if(c->tags[i]) {
brush.x += brush.w; dc.x += dc.w;
brush.w = textw(&brush.font, c->tags[i]) + brush.font.height; dc.w = textw(&dc.font, c->tags[i]) + dc.font.height;
draw(&brush, True, c->tags[i]); draw(True, c->tags[i]);
} }
} }
brush.x += brush.w; dc.x += dc.w;
brush.w = textw(&brush.font, c->name) + brush.font.height; dc.w = textw(&dc.font, c->name) + dc.font.height;
draw(&brush, True, c->name); draw(True, c->name);
XCopyArea(dpy, brush.drawable, c->title, brush.gc, XCopyArea(dpy, dc.drawable, c->title, dc.gc,
0, 0, c->tw, c->th, 0, 0); 0, 0, c->tw, c->th, 0, 0);
XFlush(dpy); XFlush(dpy);
} }

View file

@ -14,14 +14,10 @@ VERSION = 0.0
LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11 LIBS = -L${PREFIX}/lib -L/usr/lib -lc -lm -L${X11LIB} -lX11
# Linux/BSD # Linux/BSD
CFLAGS = -Os -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \ CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
-DVERSION=\"${VERSION}\" -DVERSION=\"${VERSION}\"
LDFLAGS = ${LIBS} LDFLAGS = -g ${LIBS}
#CFLAGS += -W -Wstrict-prototypes -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Waggregate-return -Wnested-externs -Winline -Wwrite-strings -Wundef -Wsign-compare -Wmissing-prototypes -Wredundant-decls
#CFLAGS = -g -Wall -O2 -I. -I${PREFIX}/include -I/usr/include -I${X11INC} \
# -DVERSION=\"${VERSION}\"
#LDFLAGS = -g ${LIBS}
# Solaris # Solaris
#CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\" #CFLAGS = -fast -xtarget=ultra ${INCLUDES} -DVERSION=\"${VERSION}\"

73
draw.c
View file

@ -11,39 +11,39 @@
#include "wm.h" #include "wm.h"
static void static void
drawborder(Brush *b) drawborder(void)
{ {
XPoint points[5]; XPoint points[5];
XSetLineAttributes(dpy, b->gc, 1, LineSolid, CapButt, JoinMiter); XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
XSetForeground(dpy, b->gc, b->border); XSetForeground(dpy, dc.gc, dc.border);
points[0].x = b->x; points[0].x = dc.x;
points[0].y = b->y; points[0].y = dc.y;
points[1].x = b->w - 1; points[1].x = dc.w - 1;
points[1].y = 0; points[1].y = 0;
points[2].x = 0; points[2].x = 0;
points[2].y = b->h - 1; points[2].y = dc.h - 1;
points[3].x = -(b->w - 1); points[3].x = -(dc.w - 1);
points[3].y = 0; points[3].y = 0;
points[4].x = 0; points[4].x = 0;
points[4].y = -(b->h - 1); points[4].y = -(dc.h - 1);
XDrawLines(dpy, b->drawable, b->gc, points, 5, CoordModePrevious); XDrawLines(dpy, dc.drawable, dc.gc, points, 5, CoordModePrevious);
} }
void void
draw(Brush *b, Bool border, const char *text) draw(Bool border, const char *text)
{ {
int x, y, w, h; int x, y, w, h;
unsigned int len; unsigned int len;
static char buf[256]; static char buf[256];
XGCValues gcv; XGCValues gcv;
XRectangle r = { b->x, b->y, b->w, b->h }; XRectangle r = { dc.x, dc.y, dc.w, dc.h };
XSetForeground(dpy, b->gc, b->bg); XSetForeground(dpy, dc.gc, dc.bg);
XFillRectangles(dpy, b->drawable, b->gc, &r, 1); XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
w = 0; w = 0;
if(border) if(border)
drawborder(b); drawborder();
if(!text) if(!text)
return; return;
@ -54,33 +54,33 @@ draw(Brush *b, Bool border, const char *text)
memcpy(buf, text, len); memcpy(buf, text, len);
buf[len] = 0; buf[len] = 0;
h = b->font.ascent + b->font.descent; h = dc.font.ascent + dc.font.descent;
y = b->y + (b->h / 2) - (h / 2) + b->font.ascent; y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
x = b->x + (h / 2); x = dc.x + (h / 2);
/* shorten text if necessary */ /* shorten text if necessary */
while(len && (w = textnw(&b->font, buf, len)) > b->w - h) while(len && (w = textnw(&dc.font, buf, len)) > dc.w - h)
buf[--len] = 0; buf[--len] = 0;
if(w > b->w) if(w > dc.w)
return; /* too long */ return; /* too long */
gcv.foreground = b->fg; gcv.foreground = dc.fg;
gcv.background = b->bg; gcv.background = dc.bg;
if(b->font.set) { if(dc.font.set) {
XChangeGC(dpy, b->gc, GCForeground | GCBackground, &gcv); XChangeGC(dpy, dc.gc, GCForeground | GCBackground, &gcv);
XmbDrawImageString(dpy, b->drawable, b->font.set, b->gc, XmbDrawImageString(dpy, dc.drawable, dc.font.set, dc.gc,
x, y, buf, len); x, y, buf, len);
} }
else { else {
gcv.font = b->font.xfont->fid; gcv.font = dc.font.xfont->fid;
XChangeGC(dpy, b->gc, GCForeground | GCBackground | GCFont, &gcv); XChangeGC(dpy, dc.gc, GCForeground | GCBackground | GCFont, &gcv);
XDrawImageString(dpy, b->drawable, b->gc, x, y, buf, len); XDrawImageString(dpy, dc.drawable, dc.gc, x, y, buf, len);
} }
} }
static unsigned long static unsigned long
xloadcolors(Colormap cmap, const char *colstr) xinitcolors(Colormap cmap, const char *colstr)
{ {
XColor color; XColor color;
XAllocNamedColor(dpy, cmap, colstr, &color, &color); XAllocNamedColor(dpy, cmap, colstr, &color, &color);
@ -88,13 +88,12 @@ xloadcolors(Colormap cmap, const char *colstr)
} }
void void
loadcolors(int scr, Brush *b, initcolors(const char *bg, const char *fg, const char *border)
const char *bg, const char *fg, const char *border)
{ {
Colormap cmap = DefaultColormap(dpy, scr); Colormap cmap = DefaultColormap(dpy, screen);
b->bg = xloadcolors(cmap, bg); dc.bg = xinitcolors(cmap, bg);
b->fg = xloadcolors(cmap, fg); dc.fg = xinitcolors(cmap, fg);
b->border = xloadcolors(cmap, border); dc.border = xinitcolors(cmap, border);
} }
unsigned int unsigned int
@ -121,7 +120,7 @@ texth(Fnt *font)
} }
void void
loadfont(Fnt *font, const char *fontstr) initfont(Fnt *font, const char *fontstr)
{ {
char **missing, *def; char **missing, *def;
int i, n; int i, n;
@ -164,7 +163,7 @@ loadfont(Fnt *font, const char *fontstr)
if (!font->xfont) if (!font->xfont)
font->xfont = XLoadQueryFont(dpy, "fixed"); font->xfont = XLoadQueryFont(dpy, "fixed");
if (!font->xfont) if (!font->xfont)
error("error, cannot load 'fixed' font\n"); error("error, cannot init 'fixed' font\n");
font->ascent = font->xfont->ascent; font->ascent = font->xfont->ascent;
font->descent = font->xfont->descent; font->descent = font->xfont->descent;
} }

View file

77
dwm.html Normal file
View file

@ -0,0 +1,77 @@
<html>
<head>
<title>dwm - dynamic window manager</title>
<meta name="author" content="Anselm R. Garbe">
<meta name="generator" content="ed">
<meta name="copyright" content="(C)opyright 2006 by Anselm R. Garbe">
<style type="text/css">
body {
color: #000000;
font-family: sans-serif;
}
</style>
</head>
<body>
<center>
<img src="logo.png"/><br />
<h3>dynamic window manager</h3>
<center>
<h2>Description</h3>
<p>
dwm is a dynamic window manager for X11.
</p>
<h2>Differences to wmii</h2
<p>
In contrast to wmii, dwm is only a window manager, and nothing else.
Hence, it is much smaller, faster and simpler. dwm does
<b>not</b> include following features wmii provides:
</p>
<ul>
<li>9P support</li>
<li>status bar</li>
<li>menu</li>
<li>editable tagbars</li>
<li>shell-based config/control file</li>
<li>small tools (selection printer, mouse warper)</li>
</ul>
<p>
dwm is only a single binary, it's source code is intended to never
exceed 2000 SLOC.
</p>
<p>
dwm is customized through editing its source code, that makes it
extremely fast and secure - it does not process any input data which
hasn't been known at compile time, except window title names.
</p>
<p>
dwm is based on tagging and dynamic window management (however simpler
than wmii or larswm).
</p>
<p>
dwm don't distinguishes between layers, there is no floating or managed
layer. Wether the clients of currently selected tag are managed or not
managed, you can re-arrange all clients on the fly. Popup- and
fixed-size windows are treated unmanaged.
</p>
<p>
dwm uses 1-pixel borders to provide the maximum of screen real
estate to clients. Small titlebars are only drawn in front of unfocused
clients.
</p>
<p>
garbeam <b>don't</b> wants any feedback to dwm. If you ask for support,
feature requests or if you report bugs, they will be <b>ignored</b>
with a high chance. dwm is only intended to fit garbeam's needs,
however you are free to download and distribute/relicense it, with the
conditions of the <a href="http://wmii.de/cgi-bin/hgwebdir.cgi/dwm?f=f10eb1139362;file=LICENSE;style=raw">MIT/X Consortium license</a>.
</p>
<h2>Development</h2>
<p>
dwm is actively developed in parallel to wmii. You can <a href="http://wmii.de/cgi-bin/hgwebdir.cgi/dwm">browse</a> its source code repository or get a copy using <a href="http://www.selenic.com/mercurial/">Mercurial</a> with following command:
</p>
<p>
<em>hg clone http://wmii.de/cgi-bin/hgwebdir.cgi/dwm</em>
</p>
<p>--Anselm</p>
</body>
</html>

5
kb.c
View file

@ -13,13 +13,14 @@ const char *term[] = {
"aterm", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn", "aterm", "-tr", "+sb", "-bg", "black", "-fg", "white", "-fn",
"-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL "-*-terminus-medium-*-*-*-13-*-*-*-*-*-iso10646-*",NULL
}; };
const char *browse[] = { "firefox", NULL };
static Key key[] = { static Key key[] = {
{ Mod1Mask, XK_Return, (void (*)(void *))spawn, term }, { Mod1Mask, XK_Return, (void (*)(void *))spawn, term },
{ Mod1Mask, XK_w, (void (*)(void *))spawn, browse },
{ Mod1Mask, XK_k, sel, "prev" }, { Mod1Mask, XK_k, sel, "prev" },
{ Mod1Mask, XK_j, sel, "next" }, { Mod1Mask, XK_j, sel, "next" },
{ Mod1Mask, XK_g, grid, NULL }, { Mod1Mask, XK_space, toggle, NULL },
{ Mod1Mask, XK_f, floating, NULL },
{ Mod1Mask, XK_m, max, NULL }, { Mod1Mask, XK_m, max, NULL },
{ Mod1Mask | ShiftMask, XK_c, ckill, NULL }, { Mod1Mask | ShiftMask, XK_c, ckill, NULL },
{ Mod1Mask | ShiftMask, XK_q, quit, NULL }, { Mod1Mask | ShiftMask, XK_q, quit, NULL },

BIN
logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 387 B

2
util.c
View file

@ -85,7 +85,7 @@ spawn(char *argv[])
close(ConnectionNumber(dpy)); close(ConnectionNumber(dpy));
setsid(); setsid();
execvp(argv[0], argv); execvp(argv[0], argv);
fprintf(stderr, "gridwm: execvp %s", argv[0]); fprintf(stderr, "dwm: execvp %s", argv[0]);
perror(" failed"); perror(" failed");
} }
exit (0); exit (0);

23
wm.c
View file

@ -37,17 +37,17 @@ char stext[1024];
int tsel = Tdev; /* default tag */ int tsel = Tdev; /* default tag */
int screen, sx, sy, sw, sh, th; int screen, sx, sy, sw, sh, th;
Brush brush = {0}; DC dc = {0};
Client *clients = NULL; Client *clients = NULL;
Client *stack = NULL; Client *stack = NULL;
static Bool other_wm_running; static Bool other_wm_running;
static const char version[] = static const char version[] =
"gridwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; "dwm - " VERSION ", (C)opyright MMVI Anselm R. Garbe\n";
static int (*x_error_handler) (Display *, XErrorEvent *); static int (*x_error_handler) (Display *, XErrorEvent *);
static void static void
usage() { error("usage: gridwm [-v]\n"); } usage() { error("usage: dwm [-v]\n"); }
static void static void
scan_wins() scan_wins()
@ -149,7 +149,7 @@ error_handler(Display *dpy, XErrorEvent *error)
|| (error->request_code == X_GrabKey || (error->request_code == X_GrabKey
&& error->error_code == BadAccess)) && error->error_code == BadAccess))
return 0; return 0;
fprintf(stderr, "gridwm: fatal error: request code=%d, error code=%d\n", fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n",
error->request_code, error->error_code); error->request_code, error->error_code);
return x_error_handler(dpy, error); /* may call exit() */ return x_error_handler(dpy, error); /* may call exit() */
} }
@ -203,7 +203,7 @@ main(int argc, char *argv[])
dpy = XOpenDisplay(0); dpy = XOpenDisplay(0);
if(!dpy) if(!dpy)
error("gridwm: cannot connect X server\n"); error("dwm: cannot connect X server\n");
screen = DefaultScreen(dpy); screen = DefaultScreen(dpy);
root = RootWindow(dpy, screen); root = RootWindow(dpy, screen);
@ -216,7 +216,7 @@ main(int argc, char *argv[])
XFlush(dpy); XFlush(dpy);
if(other_wm_running) if(other_wm_running)
error("gridwm: another window manager is already running\n"); error("dwm: another window manager is already running\n");
sx = sy = 0; sx = sy = 0;
sw = DisplayWidth(dpy, screen); sw = DisplayWidth(dpy, screen);
@ -244,20 +244,19 @@ main(int argc, char *argv[])
update_keys(); update_keys();
/* style */ /* style */
loadcolors(screen, &brush, BGCOLOR, FGCOLOR, BORDERCOLOR); initcolors(BGCOLOR, FGCOLOR, BORDERCOLOR);
loadfont(&brush.font, FONT); initfont(&dc.font, FONT);
th = texth(&brush.font); th = texth(&dc.font);
brush.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen)); dc.drawable = XCreatePixmap(dpy, root, sw, th, DefaultDepth(dpy, screen));
brush.gc = XCreateGC(dpy, root, 0, 0); dc.gc = XCreateGC(dpy, root, 0, 0);
wa.event_mask = SubstructureRedirectMask | EnterWindowMask \ wa.event_mask = SubstructureRedirectMask | EnterWindowMask \
| LeaveWindowMask; | LeaveWindowMask;
wa.cursor = cursor[CurNormal]; wa.cursor = cursor[CurNormal];
XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa); XChangeWindowAttributes(dpy, root, CWEventMask | CWCursor, &wa);
arrange = grid;
scan_wins(); scan_wins();
while(running) { while(running) {

17
wm.h
View file

@ -19,7 +19,7 @@ enum { Tscratch, Tdev, Tirc, Twww, Twork, TLast };
/********** CUSTOMIZE **********/ /********** CUSTOMIZE **********/
typedef struct Brush Brush; typedef struct DC DC;
typedef struct Client Client; typedef struct Client Client;
typedef struct Fnt Fnt; typedef struct Fnt Fnt;
typedef struct Key Key; typedef struct Key Key;
@ -39,7 +39,7 @@ struct Fnt {
int height; int height;
}; };
struct Brush { struct DC { /* draw context */
GC gc; GC gc;
Drawable drawable; Drawable drawable;
int x, y, w, h; int x, y, w, h;
@ -79,12 +79,11 @@ extern Atom wm_atom[WMLast], net_atom[NetLast];
extern Cursor cursor[CurLast]; extern Cursor cursor[CurLast];
extern Bool running, issel; extern Bool running, issel;
extern void (*handler[LASTEvent]) (XEvent *); extern void (*handler[LASTEvent]) (XEvent *);
extern void (*arrange)(void *aux);
extern int tsel, screen, sx, sy, sw, sh, th; extern int tsel, screen, sx, sy, sw, sh, th;
extern char stext[1024], *tags[TLast]; extern char stext[1024], *tags[TLast];
extern Brush brush; extern DC dc;
extern Client *clients, *stack; extern Client *clients, *stack;
/* client.c */ /* client.c */
@ -102,15 +101,13 @@ extern void lower(Client *c);
extern void ckill(void *aux); extern void ckill(void *aux);
extern void sel(void *aux); extern void sel(void *aux);
extern void max(void *aux); extern void max(void *aux);
extern void floating(void *aux); extern void toggle(void *aux);
extern void grid(void *aux);
extern void gravitate(Client *c, Bool invert); extern void gravitate(Client *c, Bool invert);
/* draw.c */ /* draw.c */
extern void draw(Brush *b, Bool border, const char *text); extern void draw(Bool border, const char *text);
extern void loadcolors(int scr, Brush *b, extern void initcolors(const char *bg, const char *fg, const char *bo);
const char *bg, const char *fg, const char *bo); extern void initfont(Fnt *font, const char *fontstr);
extern void loadfont(Fnt *font, const char *fontstr);
extern unsigned int textnw(Fnt *font, char *text, unsigned int len); extern unsigned int textnw(Fnt *font, char *text, unsigned int len);
extern unsigned int textw(Fnt *font, char *text); extern unsigned int textw(Fnt *font, char *text);
extern unsigned int texth(Fnt *font); extern unsigned int texth(Fnt *font);