aboutsummaryrefslogtreecommitdiffstats
path: root/draw.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <garbeam@wmii.de>2006-07-13 01:55:54 +0200
committerAnselm R. Garbe <garbeam@wmii.de>2006-07-13 01:55:54 +0200
commitd7e17087ed2fc5eed57efa03e81460e3e41f7238 (patch)
treeefaa34fdd54e485be21c5e98f617678a61e4a9e1 /draw.c
parent8b59083eb13c0712e04d9a5b6d7bf4af5913c442 (diff)
downloaddwm-d7e17087ed2fc5eed57efa03e81460e3e41f7238.tar.gz
new stuff (some warning elimination)
Diffstat (limited to 'draw.c')
-rw-r--r--draw.c27
1 files changed, 13 insertions, 14 deletions
diff --git a/draw.c b/draw.c
index 53af1cd..1046322 100644
--- a/draw.c
+++ b/draw.c
@@ -11,7 +11,7 @@
#include "wm.h"
static void
-drawborder(Display *dpy, Brush *b)
+drawborder(Brush *b)
{
XPoint points[5];
XSetLineAttributes(dpy, b->gc, 1, LineSolid, CapButt, JoinMiter);
@@ -30,9 +30,10 @@ drawborder(Display *dpy, Brush *b)
}
void
-draw(Display *dpy, Brush *b, Bool border, const char *text)
+draw(Brush *b, Bool border, const char *text)
{
- unsigned int x, y, w, h, len;
+ int x, y, w, h;
+ unsigned int len;
static char buf[256];
XGCValues gcv;
XRectangle r = { b->x, b->y, b->w, b->h };
@@ -42,7 +43,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
w = 0;
if(border)
- drawborder(dpy, b);
+ drawborder(b);
if(!text)
return;
@@ -79,7 +80,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
}
static unsigned long
-xloadcolors(Display *dpy, Colormap cmap, const char *colstr)
+xloadcolors(Colormap cmap, const char *colstr)
{
XColor color;
XAllocNamedColor(dpy, cmap, colstr, &color, &color);
@@ -87,13 +88,13 @@ xloadcolors(Display *dpy, Colormap cmap, const char *colstr)
}
void
-loadcolors(Display *dpy, int screen, Brush *b,
+loadcolors(int scr, Brush *b,
const char *bg, const char *fg, const char *border)
{
- Colormap cmap = DefaultColormap(dpy, screen);
- b->bg = xloadcolors(dpy, cmap, bg);
- b->fg = xloadcolors(dpy, cmap, fg);
- b->border = xloadcolors(dpy, cmap, border);
+ Colormap cmap = DefaultColormap(dpy, scr);
+ b->bg = xloadcolors(cmap, bg);
+ b->fg = xloadcolors(cmap, fg);
+ b->border = xloadcolors(cmap, border);
}
unsigned int
@@ -120,13 +121,12 @@ texth(Fnt *font)
}
void
-loadfont(Display *dpy, Fnt *font, const char *fontstr)
+loadfont(Fnt *font, const char *fontstr)
{
char **missing, *def;
- int n;
+ int i, n;
missing = NULL;
- def = "?";
setlocale(LC_ALL, "");
if(font->set)
XFreeFontSet(dpy, font->set);
@@ -144,7 +144,6 @@ loadfont(Display *dpy, Fnt *font, const char *fontstr)
XFontSetExtents *font_extents;
XFontStruct **xfonts;
char **font_names;
- unsigned int i;
font->ascent = font->descent = 0;
font_extents = XExtentsOfFontSet(font->set);