summaryrefslogtreecommitdiffstats
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
parentremoved unnecessary crap (diff)
downloaddwm-d7e17087ed2fc5eed57efa03e81460e3e41f7238.tar.gz
dwm-d7e17087ed2fc5eed57efa03e81460e3e41f7238.zip
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 @@
11#include "wm.h" 11#include "wm.h"
12 12
13static void 13static void
14drawborder(Display *dpy, Brush *b) 14drawborder(Brush *b)
15{ 15{
16 XPoint points[5]; 16 XPoint points[5];
17 XSetLineAttributes(dpy, b->gc, 1, LineSolid, CapButt, JoinMiter); 17 XSetLineAttributes(dpy, b->gc, 1, LineSolid, CapButt, JoinMiter);
@@ -30,9 +30,10 @@ drawborder(Display *dpy, Brush *b)
30} 30}
31 31
32void 32void
33draw(Display *dpy, Brush *b, Bool border, const char *text) 33draw(Brush *b, Bool border, const char *text)
34{ 34{
35 unsigned int x, y, w, h, len; 35 int x, y, w, h;
36 unsigned int len;
36 static char buf[256]; 37 static char buf[256];
37 XGCValues gcv; 38 XGCValues gcv;
38 XRectangle r = { b->x, b->y, b->w, b->h }; 39 XRectangle r = { b->x, b->y, b->w, b->h };
@@ -42,7 +43,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
42 43
43 w = 0; 44 w = 0;
44 if(border) 45 if(border)
45 drawborder(dpy, b); 46 drawborder(b);
46 47
47 if(!text) 48 if(!text)
48 return; 49 return;
@@ -79,7 +80,7 @@ draw(Display *dpy, Brush *b, Bool border, const char *text)
79} 80}
80 81
81static unsigned long 82static unsigned long
82xloadcolors(Display *dpy, Colormap cmap, const char *colstr) 83xloadcolors(Colormap cmap, const char *colstr)
83{ 84{
84 XColor color; 85 XColor color;
85 XAllocNamedColor(dpy, cmap, colstr, &color, &color); 86 XAllocNamedColor(dpy, cmap, colstr, &color, &color);
@@ -87,13 +88,13 @@ xloadcolors(Display *dpy, Colormap cmap, const char *colstr)
87} 88}
88 89
89void 90void
90loadcolors(Display *dpy, int screen, Brush *b, 91loadcolors(int scr, Brush *b,
91 const char *bg, const char *fg, const char *border) 92 const char *bg, const char *fg, const char *border)
92{ 93{
93 Colormap cmap = DefaultColormap(dpy, screen); 94 Colormap cmap = DefaultColormap(dpy, scr);
94 b->bg = xloadcolors(dpy, cmap, bg); 95 b->bg = xloadcolors(cmap, bg);
95 b->fg = xloadcolors(dpy, cmap, fg); 96 b->fg = xloadcolors(cmap, fg);
96 b->border = xloadcolors(dpy, cmap, border); 97 b->border = xloadcolors(cmap, border);
97} 98}
98 99
99unsigned int 100unsigned int
@@ -120,13 +121,12 @@ texth(Fnt *font)
120} 121}
121 122
122void 123void
123loadfont(Display *dpy, Fnt *font, const char *fontstr) 124loadfont(Fnt *font, const char *fontstr)
124{ 125{
125 char **missing, *def; 126 char **missing, *def;
126 int n; 127 int i, n;
127 128
128 missing = NULL; 129 missing = NULL;
129 def = "?";
130 setlocale(LC_ALL, ""); 130 setlocale(LC_ALL, "");
131 if(font->set) 131 if(font->set)
132 XFreeFontSet(dpy, font->set); 132 XFreeFontSet(dpy, font->set);
@@ -144,7 +144,6 @@ loadfont(Display *dpy, Fnt *font, const char *fontstr)
144 XFontSetExtents *font_extents; 144 XFontSetExtents *font_extents;
145 XFontStruct **xfonts; 145 XFontStruct **xfonts;
146 char **font_names; 146 char **font_names;
147 unsigned int i;
148 147
149 font->ascent = font->descent = 0; 148 font->ascent = font->descent = 0;
150 font_extents = XExtentsOfFontSet(font->set); 149 font_extents = XExtentsOfFontSet(font->set);