aewl

diff draw.c @ 33:e90449e03167

new stuff (some warning elimination)
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:55:54 +0200
parents 082c75b937b5
children cd30cce52b78
line diff
     1.1 --- a/draw.c	Thu Jul 13 01:30:55 2006 +0200
     1.2 +++ b/draw.c	Thu Jul 13 01:55:54 2006 +0200
     1.3 @@ -11,7 +11,7 @@
     1.4  #include "wm.h"
     1.5  
     1.6  static void
     1.7 -drawborder(Display *dpy, Brush *b)
     1.8 +drawborder(Brush *b)
     1.9  {
    1.10  	XPoint points[5];
    1.11  	XSetLineAttributes(dpy, b->gc, 1, LineSolid, CapButt, JoinMiter);
    1.12 @@ -30,9 +30,10 @@
    1.13  }
    1.14  
    1.15  void
    1.16 -draw(Display *dpy, Brush *b, Bool border, const char *text)
    1.17 +draw(Brush *b, Bool border, const char *text)
    1.18  {
    1.19 -	unsigned int x, y, w, h, len;
    1.20 +	int x, y, w, h;
    1.21 +	unsigned int len;
    1.22  	static char buf[256];
    1.23  	XGCValues gcv;
    1.24  	XRectangle r = { b->x, b->y, b->w, b->h };
    1.25 @@ -42,7 +43,7 @@
    1.26  
    1.27  	w = 0;
    1.28  	if(border)
    1.29 -		drawborder(dpy, b);
    1.30 +		drawborder(b);
    1.31  
    1.32  	if(!text)
    1.33  		return;
    1.34 @@ -79,7 +80,7 @@
    1.35  }
    1.36  
    1.37  static unsigned long
    1.38 -xloadcolors(Display *dpy, Colormap cmap, const char *colstr)
    1.39 +xloadcolors(Colormap cmap, const char *colstr)
    1.40  {
    1.41  	XColor color;
    1.42  	XAllocNamedColor(dpy, cmap, colstr, &color, &color);
    1.43 @@ -87,13 +88,13 @@
    1.44  }
    1.45  
    1.46  void
    1.47 -loadcolors(Display *dpy, int screen, Brush *b,
    1.48 +loadcolors(int scr, Brush *b,
    1.49  		const char *bg, const char *fg, const char *border)
    1.50  {
    1.51 -	Colormap cmap = DefaultColormap(dpy, screen);
    1.52 -	b->bg = xloadcolors(dpy, cmap, bg);
    1.53 -	b->fg = xloadcolors(dpy, cmap, fg);
    1.54 -	b->border = xloadcolors(dpy, cmap, border);
    1.55 +	Colormap cmap = DefaultColormap(dpy, scr);
    1.56 +	b->bg = xloadcolors(cmap, bg);
    1.57 +	b->fg = xloadcolors(cmap, fg);
    1.58 +	b->border = xloadcolors(cmap, border);
    1.59  }
    1.60  
    1.61  unsigned int
    1.62 @@ -120,13 +121,12 @@
    1.63  }
    1.64  
    1.65  void
    1.66 -loadfont(Display *dpy, Fnt *font, const char *fontstr)
    1.67 +loadfont(Fnt *font, const char *fontstr)
    1.68  {
    1.69  	char **missing, *def;
    1.70 -	int n;
    1.71 +	int i, n;
    1.72  
    1.73  	missing = NULL;
    1.74 -	def = "?";
    1.75  	setlocale(LC_ALL, "");
    1.76  	if(font->set)
    1.77  		XFreeFontSet(dpy, font->set);
    1.78 @@ -144,7 +144,6 @@
    1.79  		XFontSetExtents *font_extents;
    1.80  		XFontStruct **xfonts;
    1.81  		char **font_names;
    1.82 -		unsigned int i;
    1.83  
    1.84  		font->ascent = font->descent = 0;
    1.85  		font_extents = XExtentsOfFontSet(font->set);