#include "art.h" /* * Code for manipulating the selection */ Item *selection; Image *color, *sel, *background; void setselection(Item *p){ if(selection==p) return; /* * This should be done differently in the brave new non-xor world * but it appears to involve redrawing everything when the selection changes */ drawsel(); selection=p; drawsel(); redraw(); /*redundant?? */ } /* * It would be nice if this were faster */ void drawselprim(Item *ip, Item *op){ (*ip->fn->artdraw)(ip, sel, color); } void drawsel(void){ if(selection==0) return; rectf(sel, sel->r, background); /* set color to paint background */ walk(selection, scoffs, drawselprim); draw(sel, Rpt(subpt(screen->r.min, Pt(1, 0)), screen->r.max), sel, 0, ZP); }