109
109
FILE *tracefile = NULL;
113
/***********************************************************************
116
* MoveOutline - move a window outline
119
* root - the window we are outlining
120
* x - upper left x coordinate
121
* y - upper left y coordinate
122
* width - the width of the rectangle
123
* height - the height of the rectangle
124
* bw - the border width of the frame
127
***********************************************************************
131
void MoveOutline(Window root,
132
int x, int y, int width, int height, int bw, int th)
134
static int lastx = 0;
135
static int lasty = 0;
136
static int lastWidth = 0;
137
static int lastHeight = 0;
138
static int lastBW = 0;
139
static int lastTH = 0;
140
int xl, xr, yt, yb, xinnerl, xinnerr, yinnert, yinnerb;
142
XSegment outline[18];
145
if(x == lastx && y == lasty && width == lastWidth && height == lastHeight
146
&& lastBW == bw && th == lastTH) {
153
if (lastWidth || lastHeight) \
156
xr = lastx + lastWidth - 1; \
158
yb = lasty + lastHeight - 1; \
159
xinnerl = xl + lastBW; \
160
xinnerr = xr - lastBW; \
161
yinnert = yt + lastTH + lastBW; \
162
yinnerb = yb - lastBW; \
163
xthird = (xinnerr - xinnerl) / 3; \
164
ythird = (yinnerb - yinnert) / 3; \
190
r->x1 = xinnerl + xthird; \
196
r->x1 = xinnerl + (2 * xthird); \
203
r->y1 = yinnert + ythird; \
209
r->y1 = yinnert + (2 * ythird); \
216
r->y1 = yt + lastTH; \
223
/* undraw the old one, if any */
233
/* draw the new one, if any */
240
XDrawSegments(dpy, root, Scr->DrawGC, outline, r - outline);
246
113
* Rewrite this, possibly in terms of replace_substr(). Alternately, the
247
114
* places it's being used might be better served by being preprocessed