+static void debrush_do_do_draw_border(DEBrush *brush, WRectangle geom,
+ DEColourGroup *cg)
+{
+ DEBorder *bd=&(brush->d->border);
+ GC gc=brush->d->normal_gc;
+ Window win=brush->win;
+
+ switch(bd->style){
+ case DEBORDER_RIDGE:
+ draw_border(win, gc, &geom, bd->hl, bd->sh, cg->hl, cg->sh);
+ case DEBORDER_INLAID:
+ draw_border(win, gc, &geom, bd->pad, bd->pad, cg->pad, cg->pad);
+ draw_border(win, gc, &geom, bd->sh, bd->hl, cg->sh, cg->hl);
+ break;
+ case DEBORDER_GROOVE:
+ draw_border(win, gc, &geom, bd->sh, bd->hl, cg->sh, cg->hl);
+ draw_border(win, gc, &geom, bd->pad, bd->pad, cg->pad, cg->pad);
+ draw_border(win, gc, &geom, bd->hl, bd->sh, cg->hl, cg->sh);
+ break;
+ case DEBORDER_ELEVATED:
+ default:
+ draw_border(win, gc, &geom, bd->hl, bd->sh, cg->hl, cg->sh);
+ draw_border(win, gc, &geom, bd->pad, bd->pad, cg->pad, cg->pad);
+ break;
+ }
+}
+
+
+void debrush_do_draw_border(DEBrush *brush, WRectangle geom,
+ DEColourGroup *cg)
+{
+ DEBorder *bd=&(brush->d->border);
+
+ switch(bd->sides){
+ case DEBORDER_ALL:
+ debrush_do_do_draw_border(brush, geom, cg);
+ break;
+ case DEBORDER_TB:
+ debrush_do_draw_padline(brush, geom, cg, GR_BORDERLINE_LEFT);
+ debrush_do_draw_padline(brush, geom, cg, GR_BORDERLINE_RIGHT);
+ debrush_do_draw_borderline(brush, geom, cg, GR_BORDERLINE_TOP);
+ debrush_do_draw_borderline(brush, geom, cg, GR_BORDERLINE_BOTTOM);
+ break;
+ case DEBORDER_LR:
+ debrush_do_draw_padline(brush, geom, cg, GR_BORDERLINE_TOP);
+ debrush_do_draw_padline(brush, geom, cg, GR_BORDERLINE_BOTTOM);
+ debrush_do_draw_borderline(brush, geom, cg, GR_BORDERLINE_LEFT);
+ debrush_do_draw_borderline(brush, geom, cg, GR_BORDERLINE_RIGHT);
+ break;
+ }
+}
+
+
+void debrush_draw_border(DEBrush *brush,
+ const WRectangle *geom)
+{
+ DEColourGroup *cg=debrush_get_current_colour_group(brush);
+ if(cg!=NULL)
+ debrush_do_draw_border(brush, *geom, cg);
+}
+
+