drw style improvements
03cb1ec5
this makes the code-style more consistent aswell.
2 file(s) · +106 −93
this makes the code-style more consistent aswell.
| 9 | 9 | #include "util.h" |
|
| 10 | 10 | ||
| 11 | 11 | #define UTF_INVALID 0xFFFD |
|
| 12 | - | #define UTF_SIZ 4 |
|
| 12 | + | #define UTF_SIZ 4 |
|
| 13 | 13 | ||
| 14 | 14 | static const unsigned char utfbyte[UTF_SIZ + 1] = {0x80, 0, 0xC0, 0xE0, 0xF0}; |
|
| 15 | 15 | static const unsigned char utfmask[UTF_SIZ + 1] = {0xC0, 0x80, 0xE0, 0xF0, 0xF8}; |
|
| 17 | 17 | static const long utfmax[UTF_SIZ + 1] = {0x10FFFF, 0x7F, 0x7FF, 0xFFFF, 0x10FFFF}; |
|
| 18 | 18 | ||
| 19 | 19 | static long |
|
| 20 | - | utf8decodebyte(const char c, size_t *i) { |
|
| 21 | - | for(*i = 0; *i < (UTF_SIZ + 1); ++(*i)) |
|
| 22 | - | if(((unsigned char)c & utfmask[*i]) == utfbyte[*i]) |
|
| 20 | + | utf8decodebyte(const char c, size_t *i) |
|
| 21 | + | { |
|
| 22 | + | for (*i = 0; *i < (UTF_SIZ + 1); ++(*i)) |
|
| 23 | + | if (((unsigned char)c & utfmask[*i]) == utfbyte[*i]) |
|
| 23 | 24 | return (unsigned char)c & ~utfmask[*i]; |
|
| 24 | 25 | return 0; |
|
| 25 | 26 | } |
|
| 26 | 27 | ||
| 27 | 28 | static size_t |
|
| 28 | - | utf8validate(long *u, size_t i) { |
|
| 29 | - | if(!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) |
|
| 29 | + | utf8validate(long *u, size_t i) |
|
| 30 | + | { |
|
| 31 | + | if (!BETWEEN(*u, utfmin[i], utfmax[i]) || BETWEEN(*u, 0xD800, 0xDFFF)) |
|
| 30 | 32 | *u = UTF_INVALID; |
|
| 31 | - | for(i = 1; *u > utfmax[i]; ++i) |
|
| 33 | + | for (i = 1; *u > utfmax[i]; ++i) |
|
| 32 | 34 | ; |
|
| 33 | 35 | return i; |
|
| 34 | 36 | } |
|
| 35 | 37 | ||
| 36 | 38 | static size_t |
|
| 37 | - | utf8decode(const char *c, long *u, size_t clen) { |
|
| 39 | + | utf8decode(const char *c, long *u, size_t clen) |
|
| 40 | + | { |
|
| 38 | 41 | size_t i, j, len, type; |
|
| 39 | 42 | long udecoded; |
|
| 40 | 43 | ||
| 41 | 44 | *u = UTF_INVALID; |
|
| 42 | - | if(!clen) |
|
| 45 | + | if (!clen) |
|
| 43 | 46 | return 0; |
|
| 44 | 47 | udecoded = utf8decodebyte(c[0], &len); |
|
| 45 | - | if(!BETWEEN(len, 1, UTF_SIZ)) |
|
| 48 | + | if (!BETWEEN(len, 1, UTF_SIZ)) |
|
| 46 | 49 | return 1; |
|
| 47 | - | for(i = 1, j = 1; i < clen && j < len; ++i, ++j) { |
|
| 50 | + | for (i = 1, j = 1; i < clen && j < len; ++i, ++j) { |
|
| 48 | 51 | udecoded = (udecoded << 6) | utf8decodebyte(c[i], &type); |
|
| 49 | - | if(type != 0) |
|
| 52 | + | if (type) |
|
| 50 | 53 | return j; |
|
| 51 | 54 | } |
|
| 52 | - | if(j < len) |
|
| 55 | + | if (j < len) |
|
| 53 | 56 | return 0; |
|
| 54 | 57 | *u = udecoded; |
|
| 55 | 58 | utf8validate(u, len); |
|
| 59 | + | ||
| 56 | 60 | return len; |
|
| 57 | 61 | } |
|
| 58 | 62 | ||
| 59 | 63 | Drw * |
|
| 60 | - | drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) { |
|
| 61 | - | Drw *drw = (Drw *)calloc(1, sizeof(Drw)); |
|
| 62 | - | if(!drw) |
|
| 64 | + | drw_create(Display *dpy, int screen, Window root, unsigned int w, unsigned int h) |
|
| 65 | + | { |
|
| 66 | + | Drw *drw; |
|
| 67 | + | ||
| 68 | + | if (!(drw = calloc(1, sizeof(Drw)))) |
|
| 63 | 69 | return NULL; |
|
| 64 | 70 | drw->dpy = dpy; |
|
| 65 | 71 | drw->screen = screen; |
|
| 70 | 76 | drw->gc = XCreateGC(dpy, root, 0, NULL); |
|
| 71 | 77 | drw->fontcount = 0; |
|
| 72 | 78 | XSetLineAttributes(dpy, drw->gc, 1, LineSolid, CapButt, JoinMiter); |
|
| 79 | + | ||
| 73 | 80 | return drw; |
|
| 74 | 81 | } |
|
| 75 | 82 | ||
| 76 | 83 | void |
|
| 77 | - | drw_resize(Drw *drw, unsigned int w, unsigned int h) { |
|
| 78 | - | if(!drw) |
|
| 84 | + | drw_resize(Drw *drw, unsigned int w, unsigned int h) |
|
| 85 | + | { |
|
| 86 | + | if (!drw) |
|
| 79 | 87 | return; |
|
| 80 | 88 | drw->w = w; |
|
| 81 | 89 | drw->h = h; |
|
| 82 | - | if(drw->drawable != 0) |
|
| 90 | + | if (drw->drawable) |
|
| 83 | 91 | XFreePixmap(drw->dpy, drw->drawable); |
|
| 84 | 92 | drw->drawable = XCreatePixmap(drw->dpy, drw->root, w, h, DefaultDepth(drw->dpy, drw->screen)); |
|
| 85 | 93 | } |
|
| 86 | 94 | ||
| 87 | 95 | void |
|
| 88 | - | drw_free(Drw *drw) { |
|
| 96 | + | drw_free(Drw *drw) |
|
| 97 | + | { |
|
| 89 | 98 | size_t i; |
|
| 90 | 99 | ||
| 91 | - | for (i = 0; i < drw->fontcount; i++) { |
|
| 100 | + | for (i = 0; i < drw->fontcount; i++) |
|
| 92 | 101 | drw_font_free(drw->fonts[i]); |
|
| 93 | - | } |
|
| 94 | 102 | XFreePixmap(drw->dpy, drw->drawable); |
|
| 95 | 103 | XFreeGC(drw->dpy, drw->gc); |
|
| 96 | 104 | free(drw); |
|
| 100 | 108 | * drw_font_create instead. |
|
| 101 | 109 | */ |
|
| 102 | 110 | static Fnt * |
|
| 103 | - | drw_font_xcreate(Drw *drw, const char *fontname, FcPattern *fontpattern) { |
|
| 111 | + | drw_font_xcreate(Drw *drw, const char *fontname, FcPattern *fontpattern) |
|
| 112 | + | { |
|
| 104 | 113 | Fnt *font; |
|
| 105 | 114 | ||
| 106 | 115 | if (!(fontname || fontpattern)) |
|
| 107 | 116 | die("No font specified.\n"); |
|
| 108 | 117 | ||
| 109 | - | if (!(font = (Fnt *)calloc(1, sizeof(Fnt)))) |
|
| 118 | + | if (!(font = calloc(1, sizeof(Fnt)))) |
|
| 110 | 119 | return NULL; |
|
| 111 | 120 | ||
| 112 | 121 | if (fontname) { |
|
| 125 | 134 | fprintf(stderr, "error, cannot load font: '%s'\n", fontname); |
|
| 126 | 135 | } |
|
| 127 | 136 | } else if (fontpattern) { |
|
| 128 | - | if (!(font->xfont = XftFontOpenPattern(drw->dpy, fontpattern))) { |
|
| 137 | + | if (!(font->xfont = XftFontOpenPattern(drw->dpy, fontpattern))) |
|
| 129 | 138 | fprintf(stderr, "error, cannot load font pattern.\n"); |
|
| 130 | - | } else { |
|
| 139 | + | else |
|
| 131 | 140 | font->pattern = NULL; |
|
| 132 | - | } |
|
| 133 | 141 | } |
|
| 134 | 142 | ||
| 135 | 143 | if (!font->xfont) { |
|
| 141 | 149 | font->descent = font->xfont->descent; |
|
| 142 | 150 | font->h = font->ascent + font->descent; |
|
| 143 | 151 | font->dpy = drw->dpy; |
|
| 152 | + | ||
| 144 | 153 | return font; |
|
| 145 | 154 | } |
|
| 146 | 155 | ||
| 147 | 156 | Fnt* |
|
| 148 | - | drw_font_create(Drw *drw, const char *fontname) { |
|
| 157 | + | drw_font_create(Drw *drw, const char *fontname) |
|
| 158 | + | { |
|
| 149 | 159 | return drw_font_xcreate(drw, fontname, NULL); |
|
| 150 | 160 | } |
|
| 151 | 161 | ||
| 152 | 162 | void |
|
| 153 | - | drw_load_fonts(Drw* drw, const char *fonts[], size_t fontcount) { |
|
| 163 | + | drw_load_fonts(Drw* drw, const char *fonts[], size_t fontcount) |
|
| 164 | + | { |
|
| 154 | 165 | size_t i; |
|
| 155 | 166 | Fnt *font; |
|
| 156 | 167 | ||
| 164 | 175 | } |
|
| 165 | 176 | ||
| 166 | 177 | void |
|
| 167 | - | drw_font_free(Fnt *font) { |
|
| 168 | - | if(!font) |
|
| 178 | + | drw_font_free(Fnt *font) |
|
| 179 | + | { |
|
| 180 | + | if (!font) |
|
| 169 | 181 | return; |
|
| 170 | - | if(font->pattern) |
|
| 182 | + | if (font->pattern) |
|
| 171 | 183 | FcPatternDestroy(font->pattern); |
|
| 172 | 184 | XftFontClose(font->dpy, font->xfont); |
|
| 173 | 185 | free(font); |
|
| 174 | 186 | } |
|
| 175 | 187 | ||
| 176 | 188 | Clr * |
|
| 177 | - | drw_clr_create(Drw *drw, const char *clrname) { |
|
| 189 | + | drw_clr_create(Drw *drw, const char *clrname) |
|
| 190 | + | { |
|
| 178 | 191 | Clr *clr; |
|
| 179 | 192 | Colormap cmap; |
|
| 180 | 193 | Visual *vis; |
|
| 181 | 194 | ||
| 182 | - | if(!drw) |
|
| 195 | + | if (!drw) |
|
| 183 | 196 | return NULL; |
|
| 184 | - | clr = (Clr *)calloc(1, sizeof(Clr)); |
|
| 185 | - | if(!clr) |
|
| 197 | + | if (!(clr = calloc(1, sizeof(Clr)))) |
|
| 186 | 198 | return NULL; |
|
| 187 | 199 | cmap = DefaultColormap(drw->dpy, drw->screen); |
|
| 188 | 200 | vis = DefaultVisual(drw->dpy, drw->screen); |
|
| 189 | - | if(!XftColorAllocName(drw->dpy, vis, cmap, clrname, &clr->rgb)) |
|
| 201 | + | if (!XftColorAllocName(drw->dpy, vis, cmap, clrname, &clr->rgb)) |
|
| 190 | 202 | die("error, cannot allocate color '%s'\n", clrname); |
|
| 191 | 203 | clr->pix = clr->rgb.pixel; |
|
| 204 | + | ||
| 192 | 205 | return clr; |
|
| 193 | 206 | } |
|
| 194 | 207 | ||
| 195 | 208 | void |
|
| 196 | - | drw_clr_free(Clr *clr) { |
|
| 209 | + | drw_clr_free(Clr *clr) |
|
| 210 | + | { |
|
| 197 | 211 | free(clr); |
|
| 198 | 212 | } |
|
| 199 | 213 | ||
| 200 | 214 | void |
|
| 201 | - | drw_setscheme(Drw *drw, ClrScheme *scheme) { |
|
| 202 | - | if(!drw) |
|
| 215 | + | drw_setscheme(Drw *drw, ClrScheme *scheme) |
|
| 216 | + | { |
|
| 217 | + | if (!drw) |
|
| 203 | 218 | return; |
|
| 204 | 219 | drw->scheme = scheme; |
|
| 205 | 220 | } |
|
| 206 | 221 | ||
| 207 | 222 | void |
|
| 208 | - | drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert) { |
|
| 209 | - | if(!drw || !drw->scheme) |
|
| 223 | + | drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert) |
|
| 224 | + | { |
|
| 225 | + | if (!drw || !drw->scheme) |
|
| 210 | 226 | return; |
|
| 211 | 227 | XSetForeground(drw->dpy, drw->gc, invert ? drw->scheme->bg->pix : drw->scheme->fg->pix); |
|
| 212 | - | if(filled) |
|
| 228 | + | if (filled) |
|
| 213 | 229 | XFillRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w + 1, h + 1); |
|
| 214 | - | else if(empty) |
|
| 230 | + | else if (empty) |
|
| 215 | 231 | XDrawRectangle(drw->dpy, drw->drawable, drw->gc, x, y, w, h); |
|
| 216 | 232 | } |
|
| 217 | 233 | ||
| 218 | 234 | int |
|
| 219 | - | drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert) { |
|
| 235 | + | drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert) |
|
| 236 | + | { |
|
| 220 | 237 | char buf[1024]; |
|
| 221 | 238 | int tx, ty, th; |
|
| 222 | 239 | Extnts tex; |
|
| 234 | 251 | XftResult result; |
|
| 235 | 252 | int charexists = 0; |
|
| 236 | 253 | ||
| 237 | - | if (!(render = x || y || w || h)) { |
|
| 254 | + | if (!(render = x || y || w || h)) |
|
| 238 | 255 | w = ~w; |
|
| 239 | - | } |
|
| 240 | 256 | ||
| 241 | 257 | if (!drw || !drw->scheme) { |
|
| 242 | 258 | return 0; |
|
| 273 | 289 | } |
|
| 274 | 290 | } |
|
| 275 | 291 | ||
| 276 | - | if (!charexists || (nextfont && nextfont != curfont)) { |
|
| 292 | + | if (!charexists || (nextfont && nextfont != curfont)) |
|
| 277 | 293 | break; |
|
| 278 | - | } else { |
|
| 294 | + | else |
|
| 279 | 295 | charexists = 0; |
|
| 280 | - | } |
|
| 281 | 296 | } |
|
| 282 | 297 | ||
| 283 | 298 | if (utf8strlen) { |
|
| 284 | 299 | drw_font_getexts(curfont, utf8str, utf8strlen, &tex); |
|
| 285 | 300 | /* shorten text if necessary */ |
|
| 286 | - | for(len = MIN(utf8strlen, (sizeof buf) - 1); len && (tex.w > w - drw->fonts[0]->h || w < drw->fonts[0]->h); len--) |
|
| 301 | + | for (len = MIN(utf8strlen, (sizeof buf) - 1); len && (tex.w > w - drw->fonts[0]->h || w < drw->fonts[0]->h); len--) |
|
| 287 | 302 | drw_font_getexts(curfont, utf8str, len, &tex); |
|
| 288 | 303 | ||
| 289 | 304 | if (len) { |
|
| 290 | 305 | memcpy(buf, utf8str, len); |
|
| 291 | 306 | buf[len] = '\0'; |
|
| 292 | - | if(len < utf8strlen) |
|
| 293 | - | for(i = len; i && i > len - 3; buf[--i] = '.'); |
|
| 307 | + | if (len < utf8strlen) |
|
| 308 | + | for (i = len; i && i > len - 3; buf[--i] = '.'); |
|
| 294 | 309 | ||
| 295 | 310 | if (render) { |
|
| 296 | 311 | th = curfont->ascent + curfont->descent; |
|
| 298 | 313 | tx = x + (h / 2); |
|
| 299 | 314 | XftDrawStringUtf8(d, invert ? &drw->scheme->bg->rgb : &drw->scheme->fg->rgb, curfont->xfont, tx, ty, (XftChar8 *)buf, len); |
|
| 300 | 315 | } |
|
| 301 | - | ||
| 302 | 316 | x += tex.w; |
|
| 303 | 317 | w -= tex.w; |
|
| 304 | 318 | } |
|
| 315 | 329 | */ |
|
| 316 | 330 | charexists = 1; |
|
| 317 | 331 | ||
| 318 | - | if (drw->fontcount >= DRW_FONT_CACHE_SIZE) { |
|
| 332 | + | if (drw->fontcount >= DRW_FONT_CACHE_SIZE) |
|
| 319 | 333 | continue; |
|
| 320 | - | } |
|
| 321 | 334 | ||
| 322 | 335 | fccharset = FcCharSetCreate(); |
|
| 323 | 336 | FcCharSetAddChar(fccharset, utf8codepoint); |
|
| 324 | 337 | ||
| 325 | 338 | if (!drw->fonts[0]->pattern) { |
|
| 326 | 339 | /* Refer to the comment in drw_font_xcreate for more |
|
| 327 | - | * information. |
|
| 328 | - | */ |
|
| 340 | + | * information. */ |
|
| 329 | 341 | die("The first font in the cache must be loaded from a font string.\n"); |
|
| 330 | 342 | } |
|
| 331 | 343 | ||
| 345 | 357 | if (curfont && XftCharExists(drw->dpy, curfont->xfont, utf8codepoint)) { |
|
| 346 | 358 | drw->fonts[drw->fontcount++] = curfont; |
|
| 347 | 359 | } else { |
|
| 348 | - | if (curfont) { |
|
| 360 | + | if (curfont) |
|
| 349 | 361 | drw_font_free(curfont); |
|
| 350 | - | } |
|
| 351 | 362 | curfont = drw->fonts[0]; |
|
| 352 | 363 | } |
|
| 353 | 364 | } |
|
| 354 | 365 | } |
|
| 355 | 366 | } |
|
| 356 | - | ||
| 357 | - | if (render) { |
|
| 367 | + | if (render) |
|
| 358 | 368 | XftDrawDestroy(d); |
|
| 359 | - | } |
|
| 360 | 369 | ||
| 361 | 370 | return x; |
|
| 362 | 371 | } |
|
| 363 | 372 | ||
| 364 | 373 | void |
|
| 365 | - | drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) { |
|
| 366 | - | if(!drw) |
|
| 374 | + | drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h) |
|
| 375 | + | { |
|
| 376 | + | if (!drw) |
|
| 367 | 377 | return; |
|
| 368 | 378 | XCopyArea(drw->dpy, drw->drawable, win, drw->gc, x, y, w, h, x, y); |
|
| 369 | 379 | XSync(drw->dpy, False); |
|
| 370 | 380 | } |
|
| 371 | 381 | ||
| 372 | - | ||
| 373 | 382 | void |
|
| 374 | - | drw_font_getexts(Fnt *font, const char *text, unsigned int len, Extnts *tex) { |
|
| 383 | + | drw_font_getexts(Fnt *font, const char *text, unsigned int len, Extnts *tex) |
|
| 384 | + | { |
|
| 375 | 385 | XGlyphInfo ext; |
|
| 376 | 386 | ||
| 377 | - | if(!font || !text) |
|
| 387 | + | if (!font || !text) |
|
| 378 | 388 | return; |
|
| 379 | 389 | XftTextExtentsUtf8(font->dpy, font->xfont, (XftChar8 *)text, len, &ext); |
|
| 380 | 390 | tex->h = font->h; |
|
| 382 | 392 | } |
|
| 383 | 393 | ||
| 384 | 394 | unsigned int |
|
| 385 | - | drw_font_getexts_width(Fnt *font, const char *text, unsigned int len) { |
|
| 395 | + | drw_font_getexts_width(Fnt *font, const char *text, unsigned int len) |
|
| 396 | + | { |
|
| 386 | 397 | Extnts tex; |
|
| 387 | 398 | ||
| 388 | - | if(!font) |
|
| 399 | + | if (!font) |
|
| 389 | 400 | return -1; |
|
| 390 | 401 | drw_font_getexts(font, text, len, &tex); |
|
| 391 | 402 | return tex.w; |
|
| 392 | 403 | } |
|
| 393 | 404 | ||
| 394 | 405 | Cur * |
|
| 395 | - | drw_cur_create(Drw *drw, int shape) { |
|
| 406 | + | drw_cur_create(Drw *drw, int shape) |
|
| 407 | + | { |
|
| 396 | 408 | Cur *cur; |
|
| 397 | 409 | ||
| 398 | - | if(!drw) |
|
| 410 | + | if (!drw) |
|
| 399 | 411 | return NULL; |
|
| 400 | - | cur = (Cur *)calloc(1, sizeof(Cur)); |
|
| 401 | - | if (!cur) |
|
| 412 | + | if (!(cur = calloc(1, sizeof(Cur)))) |
|
| 402 | 413 | return NULL; |
|
| 403 | 414 | cur->cursor = XCreateFontCursor(drw->dpy, shape); |
|
| 415 | + | ||
| 404 | 416 | return cur; |
|
| 405 | 417 | } |
|
| 406 | 418 | ||
| 407 | 419 | void |
|
| 408 | - | drw_cur_free(Drw *drw, Cur *cursor) { |
|
| 409 | - | if(!drw || !cursor) |
|
| 420 | + | drw_cur_free(Drw *drw, Cur *cursor) |
|
| 421 | + | { |
|
| 422 | + | if (!drw || !cursor) |
|
| 410 | 423 | return; |
|
| 411 | 424 | XFreeCursor(drw->dpy, cursor->cursor); |
|
| 412 | 425 | free(cursor); |
|
| 43 | 43 | } Extnts; |
|
| 44 | 44 | ||
| 45 | 45 | /* Drawable abstraction */ |
|
| 46 | - | Drw *drw_create(Display *dpy, int screen, Window win, unsigned int w, unsigned int h); |
|
| 47 | - | void drw_resize(Drw *drw, unsigned int w, unsigned int h); |
|
| 48 | - | void drw_free(Drw *drw); |
|
| 46 | + | Drw *drw_create(Display *, int, Window, unsigned int, unsigned int); |
|
| 47 | + | void drw_resize(Drw *, unsigned int, unsigned int); |
|
| 48 | + | void drw_free(Drw *); |
|
| 49 | 49 | ||
| 50 | 50 | /* Fnt abstraction */ |
|
| 51 | - | Fnt *drw_font_create(Drw *drw, const char *fontname); |
|
| 52 | - | void drw_load_fonts(Drw* drw, const char *fonts[], size_t fontcount); |
|
| 53 | - | void drw_font_free(Fnt *font); |
|
| 54 | - | void drw_font_getexts(Fnt *font, const char *text, unsigned int len, Extnts *extnts); |
|
| 55 | - | unsigned int drw_font_getexts_width(Fnt *font, const char *text, unsigned int len); |
|
| 51 | + | Fnt *drw_font_create(Drw *, const char *); |
|
| 52 | + | void drw_load_fonts(Drw *, const char *[], size_t); |
|
| 53 | + | void drw_font_free(Fnt *); |
|
| 54 | + | void drw_font_getexts(Fnt *, const char *, unsigned int, Extnts *); |
|
| 55 | + | unsigned int drw_font_getexts_width(Fnt *, const char *, unsigned int); |
|
| 56 | 56 | ||
| 57 | 57 | /* Colour abstraction */ |
|
| 58 | - | Clr *drw_clr_create(Drw *drw, const char *clrname); |
|
| 59 | - | void drw_clr_free(Clr *clr); |
|
| 58 | + | Clr *drw_clr_create(Drw *, const char *); |
|
| 59 | + | void drw_clr_free(Clr *); |
|
| 60 | 60 | ||
| 61 | 61 | /* Cursor abstraction */ |
|
| 62 | - | Cur *drw_cur_create(Drw *drw, int shape); |
|
| 63 | - | void drw_cur_free(Drw *drw, Cur *cursor); |
|
| 62 | + | Cur *drw_cur_create(Drw *, int); |
|
| 63 | + | void drw_cur_free(Drw *, Cur *); |
|
| 64 | 64 | ||
| 65 | 65 | /* Drawing context manipulation */ |
|
| 66 | - | void drw_setfont(Drw *drw, Fnt *font); |
|
| 67 | - | void drw_setscheme(Drw *drw, ClrScheme *scheme); |
|
| 66 | + | void drw_setfont(Drw *, Fnt *); |
|
| 67 | + | void drw_setscheme(Drw *, ClrScheme *); |
|
| 68 | 68 | ||
| 69 | 69 | /* Drawing functions */ |
|
| 70 | - | void drw_rect(Drw *drw, int x, int y, unsigned int w, unsigned int h, int filled, int empty, int invert); |
|
| 71 | - | int drw_text(Drw *drw, int x, int y, unsigned int w, unsigned int h, const char *text, int invert); |
|
| 70 | + | void drw_rect(Drw *, int, int, unsigned int, unsigned int, int, int, int); |
|
| 71 | + | int drw_text(Drw *, int, int, unsigned int, unsigned int, const char *, int); |
|
| 72 | 72 | ||
| 73 | 73 | /* Map functions */ |
|
| 74 | - | void drw_map(Drw *drw, Window win, int x, int y, unsigned int w, unsigned int h); |
|
| 74 | + | void drw_map(Drw *, Window, int, int, unsigned int, unsigned int); |