aewl

annotate bar.c @ 31:386649deb651

before leaning things up
author Anselm R. Garbe <garbeam@wmii.de>
date Thu, 13 Jul 2006 01:04:38 +0200
parents e8f627998d6f
children
rev   line source
garbeam@5 1 /*
garbeam@5 2 * (C)opyright MMVI Anselm R. Garbe <garbeam at gmail dot com>
garbeam@5 3 * See LICENSE file for license details.
garbeam@5 4 */
garbeam@5 5
garbeam@5 6 #include "wm.h"
garbeam@5 7
garbeam@5 8 void
garbeam@5 9 draw_bar()
garbeam@5 10 {
garbeam@31 11 int i;
garbeam@26 12 brush.x = brush.y = 0;
garbeam@26 13 brush.w = bw;
garbeam@26 14 brush.h = bh;
garbeam@16 15 draw(dpy, &brush, False, NULL);
garbeam@16 16
garbeam@31 17 brush.w = 0;
garbeam@31 18 for(i = 0; i < TLast; i++) {
garbeam@31 19 brush.x += brush.w;
garbeam@31 20 brush.w = textw(&brush.font, tags[i]) + bh;
garbeam@31 21 if(i == tsel) {
garbeam@31 22 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@31 23 draw(dpy, &brush, True, tags[i]);
garbeam@31 24 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@31 25 }
garbeam@31 26 else
garbeam@31 27 draw(dpy, &brush, True, tags[i]);
garbeam@31 28 }
garbeam@16 29 if(stack) {
garbeam@31 30 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@31 31 brush.x += brush.w;
garbeam@26 32 brush.w = textw(&brush.font, stack->name) + bh;
garbeam@22 33 draw(dpy, &brush, True, stack->name);
garbeam@16 34 swap((void **)&brush.fg, (void **)&brush.bg);
garbeam@16 35 }
garbeam@31 36 brush.w = textw(&brush.font, stext) + bh;
garbeam@26 37 brush.x = bx + bw - brush.w;
garbeam@31 38 draw(dpy, &brush, False, stext);
garbeam@26 39 XCopyArea(dpy, brush.drawable, barwin, brush.gc, 0, 0, bw, bh, 0, 0);
garbeam@5 40 XFlush(dpy);
garbeam@5 41 }