-drawstatus(void) {
- int i, x;
-
- dc.x = dc.y = 0;
- for(i = 0; i < ntags; i++) {
- dc.w = textw(tags[i]);
- if(seltags[i]) {
- drawtext(tags[i], dc.sel);
- drawsquare(sel && sel->tags[i], isoccupied(i), dc.sel);
- }
- else {
- drawtext(tags[i], dc.norm);
- drawsquare(sel && sel->tags[i], isoccupied(i), dc.norm);
- }
- dc.x += dc.w;
- }
- dc.w = blw;
- drawtext(getsymbol(), dc.norm);
- x = dc.x + dc.w;
- dc.w = textw(stext);
- dc.x = sw - dc.w;
- if(dc.x < x) {
- dc.x = x;
- dc.w = sw - x;
- }
- drawtext(stext, dc.norm);
- if((dc.w = dc.x - x) > bh) {
- dc.x = x;
- if(sel) {
- drawtext(sel->name, dc.sel);
- drawsquare(sel->ismax, sel->isfloating, dc.sel);
- }
- else
- drawtext(NULL, dc.norm);
- }
- XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
- XSync(dpy, False);
+dc_setfg(DDC *dc, Col *col) {
+ if(!dc || !col)
+ return;
+ dc->fg = col;
+}
+
+void
+dc_setbg(DDC *dc, Col *col) {
+ if(!dc || !col)
+ return;
+ dc->bg = col;
+}
+
+void
+dc_setfill(DDC *dc, Bool fill) {
+ if(!dc)
+ return;
+ dc->fill = fill;
+}
+
+void
+dc_drawrect(DDC *dc, int x, int y, unsigned int w, unsigned int h) {
+ if(!dc)
+ return;
+ /* TODO: draw the rectangle */
+}
+
+void
+dc_drawtext(DDC *dc, int x, int y, const char *text) {
+ if(!dc)
+ return;
+ /* TODO: draw the text */
+}
+
+void
+dc_map(DDC *dc, int x, int y, unsigned int w, unsigned int h) {
+ if(!dc)
+ return;
+ /* TODO: map the dc contents in the region */