all repos — dwm @ c0705eeb65733e8c5091e47d5bdc701a0779a949

my dwm build

sanitized names
Anselm R. Garbe garbeam@wmii.de
Fri, 14 Jul 2006 22:54:09 +0200
commit

c0705eeb65733e8c5091e47d5bdc701a0779a949

parent

29355bd38284ed9aec8d3ffabde61db73947c9f9

7 files changed, 72 insertions(+), 72 deletions(-)

jump to
M client.cclient.c

@@ -17,14 +17,14 @@ { "Firefox-bin", "Gecko", { [Twww] = "www" }, False },

}; Client * -next(Client *c) +getnext(Client *c) { for(; c && !c->tags[tsel]; c = c->next); return c; } void -ban_client(Client *c) +ban(Client *c) { XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); XMoveWindow(dpy, c->title, c->tx + 2 * sw, c->ty);

@@ -48,7 +48,7 @@ XMoveResizeWindow(dpy, c->title, c->tx, c->ty, c->tw, c->th);

} void -update_name(Client *c) +settitle(Client *c) { XTextProperty name; int n;

@@ -76,7 +76,7 @@ resize_title(c);

} void -update_size(Client *c) +setsize(Client *c) { XSizeHints size; long msize;

@@ -114,7 +114,7 @@ c->grav = NorthWestGravity;

} void -craise(Client *c) +higher(Client *c) { XRaiseWindow(dpy, c->win); XRaiseWindow(dpy, c->title);

@@ -136,8 +136,8 @@

XFlush(dpy); sel = c; if(old && old != c) - draw_client(old); - draw_client(c); + drawtitle(old); + drawtitle(c); XSetInputFocus(dpy, c->win, RevertToPointerRoot, CurrentTime); XFlush(dpy); while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));

@@ -196,8 +196,8 @@ c->tw = c->w = wa->width;

c->h = wa->height; c->th = bh; c->border = 1; - c->proto = win_proto(c->win); - update_size(c); + c->proto = proto(c->win); + setsize(c); XSelectInput(dpy, c->win, StructureNotifyMask | PropertyChangeMask | EnterWindowMask); XGetTransientForHint(dpy, c->win, &trans);

@@ -210,7 +210,7 @@ 0, DefaultDepth(dpy, screen), CopyFromParent,

DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &twa); - update_name(c); + settitle(c); init_tags(c); for(l = &clients; *l; l = &(*l)->next);

@@ -236,7 +236,7 @@ XMapRaised(dpy, c->title);

focus(c); } else { - ban_client(c); + ban(c); XMapRaised(dpy, c->win); XMapRaised(dpy, c->title); }

@@ -339,7 +339,7 @@ XFlush(dpy);

} static int -dummy_error_handler(Display *dsply, XErrorEvent *err) +dummy_xerror(Display *dsply, XErrorEvent *err) { return 0; }

@@ -350,7 +350,7 @@ {

Client **l; XGrabServer(dpy); - XSetErrorHandler(dummy_error_handler); + XSetErrorHandler(dummy_xerror); XUngrabButton(dpy, AnyButton, AnyModifier, c->win); XDestroyWindow(dpy, c->title);

@@ -366,7 +366,7 @@

free(c); XFlush(dpy); - XSetErrorHandler(error_handler); + XSetErrorHandler(xerror); XUngrabServer(dpy); arrange(NULL); if(sel)
M draw.cdraw.c

@@ -11,7 +11,7 @@

#include "dwm.h" void -draw_bar() +drawstatus() { int i;

@@ -44,11 +44,11 @@ XFlush(dpy);

} void -draw_client(Client *c) +drawtitle(Client *c) { int i; if(c == sel) { - draw_bar(); + drawstatus(); XUnmapWindow(dpy, c->title); XSetWindowBorder(dpy, c->win, dc.fg); return;

@@ -145,7 +145,7 @@ }

} unsigned long -initcolor(const char *colstr) +getcolor(const char *colstr) { XColor color; Colormap cmap = DefaultColormap(dpy, screen);

@@ -172,7 +172,7 @@ return textnw(text, strlen(text)) + dc.font.height;

} void -initfont(const char *fontstr) +setfont(const char *fontstr) { char **missing, *def; int i, n;
M dwm.hdwm.h

@@ -107,22 +107,22 @@ extern void manage(Window w, XWindowAttributes *wa);

extern void unmanage(Client *c); extern Client *getclient(Window w); extern void focus(Client *c); -extern void update_name(Client *c); +extern void settitle(Client *c); extern void resize(Client *c, Bool inc); -extern void update_size(Client *c); +extern void setsize(Client *c); extern Client *gettitle(Window w); -extern void craise(Client *c); +extern void higher(Client *c); extern void lower(Client *c); extern void gravitate(Client *c, Bool invert); -extern void ban_client(Client *c); -extern Client *next(Client *c); +extern void ban(Client *c); +extern Client *getnext(Client *c); /* draw.c */ -extern void draw_bar(); -extern void draw_client(Client *c); +extern void drawstatus(); +extern void drawtitle(Client *c); extern void drawtext(const char *text, Bool invert, Bool border); -extern unsigned long initcolor(const char *colstr); -extern void initfont(const char *fontstr); +extern unsigned long getcolor(const char *colstr); +extern void setfont(const char *fontstr); extern unsigned int textnw(char *text, unsigned int len); extern unsigned int textw(char *text); extern unsigned int texth(void);

@@ -132,9 +132,9 @@ extern void grabkeys();

extern void keypress(XEvent *e); /* main.c */ -extern int error_handler(Display *dsply, XErrorEvent *e); -extern void send_message(Window w, Atom a, long value); -extern int win_proto(Window w); +extern int xerror(Display *dsply, XErrorEvent *e); +extern void sendevent(Window w, Atom a, long value); +extern int proto(Window w); extern void quit(Arg *arg); /* screen.c */
M event.cevent.c

@@ -129,7 +129,7 @@ }

else if((c = getclient(ev->window))) { if(arrange == tiling && !c->floating) return; - craise(c); + higher(c); switch(ev->button) { default: break;

@@ -225,9 +225,9 @@ Client *c;

if(ev->count == 0) { if(barwin == ev->window) - draw_bar(); + drawstatus(); else if((c = gettitle(ev->window))) - draw_client(c); + drawtitle(c); } }

@@ -262,7 +262,7 @@ return; /* ignore */

if((c = getclient(ev->window))) { if(ev->atom == wm_atom[WMProtocols]) { - c->proto = win_proto(c->win); + c->proto = proto(c->win); return; } switch (ev->atom) {

@@ -273,12 +273,12 @@ if(!c->floating && (c->floating = (trans != 0)))

arrange(NULL); break; case XA_WM_NORMAL_HINTS: - update_size(c); + setsize(c); break; } if(ev->atom == XA_WM_NAME || ev->atom == net_atom[NetWMName]) { - update_name(c); - draw_client(c); + settitle(c); + drawtitle(c); } } }
M key.ckey.c

@@ -99,8 +99,8 @@

if(!sel) return; - if(sel == next(clients) && sel->next) { - if((c = next(sel->next))) + if(sel == getnext(clients) && sel->next) { + if((c = getnext(sel->next))) sel = c; }

@@ -122,7 +122,7 @@ sel->x = sx;

sel->y = sy + bh; sel->w = sw - 2 * sel->border; sel->h = sh - 2 * sel->border - bh; - craise(sel); + higher(sel); resize(sel, False); }

@@ -157,7 +157,7 @@ if(!sel)

return; if((c = sel->revert && sel->revert->tags[tsel] ? sel->revert : NULL)) { - craise(c); + higher(c); focus(c); } }

@@ -170,10 +170,10 @@

if(!sel) return; - if(!(c = next(sel->next))) - c = next(clients); + if(!(c = getnext(sel->next))) + c = getnext(clients); if(c) { - craise(c); + higher(c); c->revert = sel; focus(c); }

@@ -185,7 +185,7 @@ {

if(!sel) return; if(sel->proto & WM_PROTOCOL_DELWIN) - send_message(sel->win, wm_atom[WMProtocols], wm_atom[WMDelete]); + sendevent(sel->win, wm_atom[WMProtocols], wm_atom[WMDelete]); else XKillClient(dpy, sel->win); }
M main.cmain.c

@@ -46,7 +46,7 @@

static Bool other_wm_running; static const char version[] = "dwm-" VERSION ", (C)opyright MMVI Anselm R. Garbe\n"; -static int (*x_error_handler) (Display *, XErrorEvent *); +static int (*x_xerror) (Display *, XErrorEvent *); static void usage() { error("usage: dwm [-v]\n"); }

@@ -94,7 +94,7 @@ return res;

} int -win_proto(Window w) +proto(Window w) { unsigned char *protocols; long res;

@@ -114,7 +114,7 @@ return protos;

} void -send_message(Window w, Atom a, long value) +sendevent(Window w, Atom a, long value) { XEvent e;

@@ -135,7 +135,7 @@ * Other types of errors call Xlib's default error handler, which

* calls exit(). */ int -error_handler(Display *dpy, XErrorEvent *error) +xerror(Display *dpy, XErrorEvent *error) { if(error->error_code == BadWindow || (error->request_code == X_SetInputFocus

@@ -153,7 +153,7 @@ && error->error_code == BadAccess))

return 0; fprintf(stderr, "dwm: fatal error: request code=%d, error code=%d\n", error->request_code, error->error_code); - return x_error_handler(dpy, error); /* may call exit() */ + return x_xerror(dpy, error); /* may call exit() */ } /*

@@ -161,7 +161,7 @@ * Startup Error handler to check if another window manager

* is already running. */ static int -startup_error_handler(Display *dpy, XErrorEvent *error) +startup_xerror(Display *dpy, XErrorEvent *error) { other_wm_running = True; return -1;

@@ -215,7 +215,7 @@ root = RootWindow(dpy, screen);

/* check if another WM is already running */ other_wm_running = False; - XSetErrorHandler(startup_error_handler); + XSetErrorHandler(startup_xerror); /* this causes an error if some other WM is running */ XSelectInput(dpy, root, SubstructureRedirectMask); XFlush(dpy);

@@ -224,7 +224,7 @@ if(other_wm_running)

error("dwm: another window manager is already running\n"); XSetErrorHandler(0); - x_error_handler = XSetErrorHandler(error_handler); + x_xerror = XSetErrorHandler(xerror); /* init atoms */ wm_atom[WMProtocols] = XInternAtom(dpy, "WM_PROTOCOLS", False);

@@ -242,10 +242,10 @@

grabkeys(); /* style */ - dc.bg = initcolor(BGCOLOR); - dc.fg = initcolor(FGCOLOR); - dc.border = initcolor(BORDERCOLOR); - initfont(FONT); + dc.bg = getcolor(BGCOLOR); + dc.fg = getcolor(FGCOLOR); + dc.border = getcolor(BORDERCOLOR); + setfont(FONT); sx = sy = 0; sw = DisplayWidth(dpy, screen);

@@ -267,7 +267,7 @@ XMapRaised(dpy, barwin);

dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen)); dc.gc = XCreateGC(dpy, root, 0, 0); - draw_bar(); + drawstatus(); issel = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);

@@ -315,7 +315,7 @@ break;

stext[n++] = i; } stext[n] = 0; - draw_bar(); + drawstatus(); } } }
M screen.cscreen.c

@@ -15,9 +15,9 @@

tsel = arg->i; arrange(NULL); - for(c = clients; c; c = next(c->next)) - draw_client(c); - draw_bar(); + for(c = clients; c; c = getnext(c->next)) + drawtitle(c); + drawstatus(); } void

@@ -30,15 +30,15 @@ for(c = clients; c; c = c->next) {

if(c->tags[tsel]) resize(c, True); else - ban_client(c); + ban(c); } if(sel && !sel->tags[tsel]) { - if((sel = next(clients))) { - craise(sel); + if((sel = getnext(clients))) { + higher(sel); focus(sel); } } - draw_bar(); + drawstatus(); } void

@@ -61,7 +61,7 @@

for(i = 0, c = clients; c; c = c->next) { if(c->tags[tsel]) { if(c->floating) { - craise(c); + higher(c); resize(c, True); continue; }

@@ -87,14 +87,14 @@ resize(c, False);

i++; } else - ban_client(c); + ban(c); } if(!sel || (sel && !sel->tags[tsel])) { - if((sel = next(clients))) { - craise(sel); + if((sel = getnext(clients))) { + higher(sel); focus(sel); } } - draw_bar(); + drawstatus(); }