aewl

diff draw.c @ 123:61490330e90a

cleaned up code
author arg@10ksloc.org
date Thu, 20 Jul 2006 12:18:06 +0200
parents c498da7520c7
children 75576e44c1d8
line diff
     1.1 --- a/draw.c	Thu Jul 20 10:48:22 2006 +0200
     1.2 +++ b/draw.c	Thu Jul 20 12:18:06 2006 +0200
     1.3 @@ -14,6 +14,7 @@
     1.4  drawborder(void)
     1.5  {
     1.6  	XPoint points[5];
     1.7 +
     1.8  	XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
     1.9  	XSetForeground(dpy, dc.gc, dc.border);
    1.10  	points[0].x = dc.x;
    1.11 @@ -33,6 +34,7 @@
    1.12  textnw(char *text, unsigned int len)
    1.13  {
    1.14  	XRectangle r;
    1.15 +
    1.16  	if(dc.font.set) {
    1.17  		XmbTextExtents(dc.font.set, text, len, NULL, &r);
    1.18  		return r.width;
    1.19 @@ -44,8 +46,8 @@
    1.20  drawtext(const char *text, Bool invert, Bool border)
    1.21  {
    1.22  	int x, y, w, h;
    1.23 +	static char buf[256];
    1.24  	unsigned int len;
    1.25 -	static char buf[256];
    1.26  	XGCValues gcv;
    1.27  	XRectangle r = { dc.x, dc.y, dc.w, dc.h };
    1.28  
    1.29 @@ -170,8 +172,8 @@
    1.30  unsigned long
    1.31  getcolor(const char *colstr)
    1.32  {
    1.33 +	Colormap cmap = DefaultColormap(dpy, screen);
    1.34  	XColor color;
    1.35 -	Colormap cmap = DefaultColormap(dpy, screen);
    1.36  
    1.37  	XAllocNamedColor(dpy, cmap, colstr, &color, &color);
    1.38  	return color.pixel;