/*
|
/*
|
* Copyright (c) 2000 Greg Haerr <greg@censoft.com>
|
* Copyright (c) 2000 Greg Haerr <greg@censoft.com>
|
* Copyright (c) 1991 David I. Bell
|
* Copyright (c) 1991 David I. Bell
|
* Permission is granted to use, distribute, or modify this source,
|
* Permission is granted to use, distribute, or modify this source,
|
* provided that this copyright notice remains intact.
|
* provided that this copyright notice remains intact.
|
*/
|
*/
|
#include <stdio.h>
|
#include <stdio.h>
|
#include <stdlib.h>
|
#include <stdlib.h>
|
#include "serv.h"
|
#include "serv.h"
|
|
|
/*
|
/*
|
* Macro to distinguish cases of clipping.
|
* Macro to distinguish cases of clipping.
|
*/
|
*/
|
#define GAPVAL(leftgap, rightgap, topgap, bottomgap) \
|
#define GAPVAL(leftgap, rightgap, topgap, bottomgap) \
|
(((leftgap) << 3) + ((rightgap) << 2) + ((topgap) << 1) + (bottomgap))
|
(((leftgap) << 3) + ((rightgap) << 2) + ((topgap) << 1) + (bottomgap))
|
|
|
static GR_COUNT GsSplitClipRect(MWCLIPRECT *srcrect, MWCLIPRECT *destrect,
|
static GR_COUNT GsSplitClipRect(MWCLIPRECT *srcrect, MWCLIPRECT *destrect,
|
GR_COORD minx, GR_COORD miny, GR_COORD maxx,
|
GR_COORD minx, GR_COORD miny, GR_COORD maxx,
|
GR_COORD maxy);
|
GR_COORD maxy);
|
/*
|
/*
|
* Set the clip rectangles for a window taking into account other
|
* Set the clip rectangles for a window taking into account other
|
* windows that may be obscuring it. The windows that may be obscuring
|
* windows that may be obscuring it. The windows that may be obscuring
|
* this one are the siblings of each direct ancestor which are higher
|
* this one are the siblings of each direct ancestor which are higher
|
* in priority than those ancestors. Also, each parent limits the visible
|
* in priority than those ancestors. Also, each parent limits the visible
|
* area of the window. The clipping is not done if it is already up to
|
* area of the window. The clipping is not done if it is already up to
|
* date of if the window is not outputtable.
|
* date of if the window is not outputtable.
|
*/
|
*/
|
void
|
void
|
GsSetClipWindow(GR_WINDOW *wp, MWCLIPREGION *userregion, int flags)
|
GsSetClipWindow(GR_WINDOW *wp, MWCLIPREGION *userregion, int flags)
|
{
|
{
|
GR_WINDOW *pwp; /* parent window */
|
GR_WINDOW *pwp; /* parent window */
|
GR_WINDOW *sibwp; /* sibling windows */
|
GR_WINDOW *sibwp; /* sibling windows */
|
MWCLIPRECT *clip; /* first clip rectangle */
|
MWCLIPRECT *clip; /* first clip rectangle */
|
GR_COUNT count; /* number of clip rectangles */
|
GR_COUNT count; /* number of clip rectangles */
|
GR_COUNT newcount; /* number of new rectangles */
|
GR_COUNT newcount; /* number of new rectangles */
|
GR_COUNT i; /* current index */
|
GR_COUNT i; /* current index */
|
GR_COORD minx; /* minimum clip x coordinate */
|
GR_COORD minx; /* minimum clip x coordinate */
|
GR_COORD miny; /* minimum clip y coordinate */
|
GR_COORD miny; /* minimum clip y coordinate */
|
GR_COORD maxx; /* maximum clip x coordinate */
|
GR_COORD maxx; /* maximum clip x coordinate */
|
GR_COORD maxy; /* maximum clip y coordinate */
|
GR_COORD maxy; /* maximum clip y coordinate */
|
GR_COORD diff; /* difference in coordinates */
|
GR_COORD diff; /* difference in coordinates */
|
GR_SIZE bs; /* border size */
|
GR_SIZE bs; /* border size */
|
GR_BOOL toomany; /* TRUE if too many clip rects */
|
GR_BOOL toomany; /* TRUE if too many clip rects */
|
MWCLIPRECT cliprects[MAX_CLIPRECTS]; /* clip rectangles */
|
MWCLIPRECT cliprects[MAX_CLIPRECTS]; /* clip rectangles */
|
|
|
if (wp->unmapcount || !wp->output || (wp == clipwp))
|
if (wp->unmapcount || !wp->output || (wp == clipwp))
|
return;
|
return;
|
|
|
clipwp = wp;
|
clipwp = wp;
|
|
|
/*
|
/*
|
* Start with the rectangle for the complete window.
|
* Start with the rectangle for the complete window.
|
* We will then cut pieces out of it as needed.
|
* We will then cut pieces out of it as needed.
|
*/
|
*/
|
count = 1;
|
count = 1;
|
clip = cliprects;
|
clip = cliprects;
|
clip->x = wp->x;
|
clip->x = wp->x;
|
clip->y = wp->y;
|
clip->y = wp->y;
|
clip->width = wp->width;
|
clip->width = wp->width;
|
clip->height = wp->height;
|
clip->height = wp->height;
|
|
|
/*
|
/*
|
* First walk upwards through all parent windows,
|
* First walk upwards through all parent windows,
|
* and restrict the visible part of this window to the part
|
* and restrict the visible part of this window to the part
|
* that shows through all of those parent windows.
|
* that shows through all of those parent windows.
|
*/
|
*/
|
pwp = wp;
|
pwp = wp;
|
while (pwp != rootwp) {
|
while (pwp != rootwp) {
|
pwp = pwp->parent;
|
pwp = pwp->parent;
|
|
|
diff = pwp->x - clip->x;
|
diff = pwp->x - clip->x;
|
if (diff > 0) {
|
if (diff > 0) {
|
clip->width -= diff;
|
clip->width -= diff;
|
clip->x = pwp->x;
|
clip->x = pwp->x;
|
}
|
}
|
|
|
diff = (pwp->x + pwp->width) - (clip->x + clip->width);
|
diff = (pwp->x + pwp->width) - (clip->x + clip->width);
|
if (diff < 0)
|
if (diff < 0)
|
clip->width += diff;
|
clip->width += diff;
|
|
|
diff = pwp->y - clip->y;
|
diff = pwp->y - clip->y;
|
if (diff > 0) {
|
if (diff > 0) {
|
clip->height -= diff;
|
clip->height -= diff;
|
clip->y = pwp->y;
|
clip->y = pwp->y;
|
}
|
}
|
|
|
diff = (pwp->y + pwp->height) - (clip->y + clip->height);
|
diff = (pwp->y + pwp->height) - (clip->y + clip->height);
|
if (diff < 0)
|
if (diff < 0)
|
clip->height += diff;
|
clip->height += diff;
|
}
|
}
|
|
|
/*
|
/*
|
* If the window is completely clipped out of view, then
|
* If the window is completely clipped out of view, then
|
* set the clipping region to indicate that.
|
* set the clipping region to indicate that.
|
*/
|
*/
|
if ((clip->width <= 0) || (clip->height <= 0)) {
|
if ((clip->width <= 0) || (clip->height <= 0)) {
|
GdSetClipRects(clipwp->psd, 1, cliprects);
|
GdSetClipRects(clipwp->psd, 1, cliprects);
|
return;
|
return;
|
}
|
}
|
|
|
/*
|
/*
|
* Now examine all windows that obscure this window, and
|
* Now examine all windows that obscure this window, and
|
* for each obscuration, break up the clip rectangles into
|
* for each obscuration, break up the clip rectangles into
|
* the smaller pieces that are still visible. The windows
|
* the smaller pieces that are still visible. The windows
|
* that can obscure us are the earlier siblings of all of
|
* that can obscure us are the earlier siblings of all of
|
* our parents.
|
* our parents.
|
*/
|
*/
|
toomany = GR_FALSE;
|
toomany = GR_FALSE;
|
pwp = wp;
|
pwp = wp;
|
/*while (pwp != rootwp) {*/
|
/*while (pwp != rootwp) {*/
|
while (pwp != NULL) {
|
while (pwp != NULL) {
|
wp = pwp;
|
wp = pwp;
|
pwp = wp->parent;
|
pwp = wp->parent;
|
|
|
if(!pwp) {
|
if(!pwp) {
|
/* We're clipping the root window*/
|
/* We're clipping the root window*/
|
sibwp = rootwp->children;
|
sibwp = rootwp->children;
|
wp = NULL;
|
wp = NULL;
|
} else
|
} else
|
sibwp = pwp->children;
|
sibwp = pwp->children;
|
|
|
for (; sibwp != wp; sibwp = sibwp->siblings) {
|
for (; sibwp != wp; sibwp = sibwp->siblings) {
|
if (sibwp->unmapcount || !sibwp->output)
|
if (sibwp->unmapcount || !sibwp->output)
|
continue;
|
continue;
|
|
|
bs = sibwp->bordersize;
|
bs = sibwp->bordersize;
|
minx = sibwp->x - bs;
|
minx = sibwp->x - bs;
|
miny = sibwp->y - bs;
|
miny = sibwp->y - bs;
|
maxx = sibwp->x + sibwp->width + bs - 1;
|
maxx = sibwp->x + sibwp->width + bs - 1;
|
maxy = sibwp->y + sibwp->height + bs - 1;
|
maxy = sibwp->y + sibwp->height + bs - 1;
|
|
|
newcount = count;
|
newcount = count;
|
for (i = 0; i < count; i++) {
|
for (i = 0; i < count; i++) {
|
if (newcount > MAX_CLIPRECTS - 3) {
|
if (newcount > MAX_CLIPRECTS - 3) {
|
toomany = GR_TRUE;
|
toomany = GR_TRUE;
|
break;
|
break;
|
}
|
}
|
newcount += GsSplitClipRect(&cliprects[i],
|
newcount += GsSplitClipRect(&cliprects[i],
|
&cliprects[newcount],
|
&cliprects[newcount],
|
minx, miny, maxx, maxy);
|
minx, miny, maxx, maxy);
|
}
|
}
|
count = newcount;
|
count = newcount;
|
}
|
}
|
if(pwp == rootwp)
|
if(pwp == rootwp)
|
break;
|
break;
|
}
|
}
|
|
|
if (toomany) {
|
if (toomany) {
|
GsError(GR_ERROR_TOO_MUCH_CLIPPING, wp->id);
|
GsError(GR_ERROR_TOO_MUCH_CLIPPING, wp->id);
|
clip->x = 0;
|
clip->x = 0;
|
clip->y = 0;
|
clip->y = 0;
|
clip->width = -1;
|
clip->width = -1;
|
clip->height = -1;
|
clip->height = -1;
|
count = 1;
|
count = 1;
|
}
|
}
|
|
|
/*
|
/*
|
* Set the clip rectangles.
|
* Set the clip rectangles.
|
*/
|
*/
|
GdSetClipRects(clipwp->psd, count, cliprects);
|
GdSetClipRects(clipwp->psd, count, cliprects);
|
}
|
}
|
|
|
/*
|
/*
|
* Check the specified clip rectangle against the specified rectangular
|
* Check the specified clip rectangle against the specified rectangular
|
* region, and reduce it or split it up into multiple clip rectangles
|
* region, and reduce it or split it up into multiple clip rectangles
|
* such that the specified region is not contained in any of the clip
|
* such that the specified region is not contained in any of the clip
|
* rectangles. The source clip rectangle can be modified in place, and
|
* rectangles. The source clip rectangle can be modified in place, and
|
* in addition more clip rectangles can be generated, which are placed in
|
* in addition more clip rectangles can be generated, which are placed in
|
* the indicated destination location. The maximum number of new clip
|
* the indicated destination location. The maximum number of new clip
|
* rectangles needed is 3. Returns the number of clip rectangles added.
|
* rectangles needed is 3. Returns the number of clip rectangles added.
|
* If the source clip rectangle is totally obliterated, it is set to an
|
* If the source clip rectangle is totally obliterated, it is set to an
|
* impossible region and 0 is returned. When splits are done, we prefer
|
* impossible region and 0 is returned. When splits are done, we prefer
|
* to create wide regions instead of high regions.
|
* to create wide regions instead of high regions.
|
*/
|
*/
|
static GR_COUNT
|
static GR_COUNT
|
GsSplitClipRect(MWCLIPRECT *srcrect, MWCLIPRECT *destrect, GR_COORD minx,
|
GsSplitClipRect(MWCLIPRECT *srcrect, MWCLIPRECT *destrect, GR_COORD minx,
|
GR_COORD miny, GR_COORD maxx, GR_COORD maxy)
|
GR_COORD miny, GR_COORD maxx, GR_COORD maxy)
|
{
|
{
|
GR_COORD x;
|
GR_COORD x;
|
GR_COORD y;
|
GR_COORD y;
|
GR_SIZE width;
|
GR_SIZE width;
|
GR_SIZE height;
|
GR_SIZE height;
|
GR_COORD dx;
|
GR_COORD dx;
|
GR_COORD dy;
|
GR_COORD dy;
|
int gaps;
|
int gaps;
|
|
|
/*
|
/*
|
* First see if there is any overlap at all.
|
* First see if there is any overlap at all.
|
* If not, then nothing to do.
|
* If not, then nothing to do.
|
*/
|
*/
|
x = srcrect->x;
|
x = srcrect->x;
|
y = srcrect->y;
|
y = srcrect->y;
|
width = srcrect->width;
|
width = srcrect->width;
|
height = srcrect->height;
|
height = srcrect->height;
|
|
|
if ((minx > maxx) || (miny > maxy) || (maxx < x) || (maxy < y) ||
|
if ((minx > maxx) || (miny > maxy) || (maxx < x) || (maxy < y) ||
|
(x + width <= minx) || (y + height <= miny))
|
(x + width <= minx) || (y + height <= miny))
|
return 0;
|
return 0;
|
|
|
/*
|
/*
|
* There is an overlap. Calculate a value to differentiate
|
* There is an overlap. Calculate a value to differentiate
|
* various cases, and then handle each case separately. The
|
* various cases, and then handle each case separately. The
|
* cases are classified on whether there are gaps on the left,
|
* cases are classified on whether there are gaps on the left,
|
* right, top, and bottom sides of the clip rectangle.
|
* right, top, and bottom sides of the clip rectangle.
|
*/
|
*/
|
gaps = 0;
|
gaps = 0;
|
if (x < minx)
|
if (x < minx)
|
gaps |= GAPVAL(1, 0, 0, 0);
|
gaps |= GAPVAL(1, 0, 0, 0);
|
if (x + width - 1 > maxx)
|
if (x + width - 1 > maxx)
|
gaps |= GAPVAL(0, 1, 0, 0);
|
gaps |= GAPVAL(0, 1, 0, 0);
|
if (y < miny)
|
if (y < miny)
|
gaps |= GAPVAL(0, 0, 1, 0);
|
gaps |= GAPVAL(0, 0, 1, 0);
|
if (y + height - 1 > maxy)
|
if (y + height - 1 > maxy)
|
gaps |= GAPVAL(0, 0, 0, 1);
|
gaps |= GAPVAL(0, 0, 0, 1);
|
|
|
switch (gaps) {
|
switch (gaps) {
|
case GAPVAL(0, 0, 0, 0): /* no gaps at all */
|
case GAPVAL(0, 0, 0, 0): /* no gaps at all */
|
srcrect->x = 0;
|
srcrect->x = 0;
|
srcrect->y = 0;
|
srcrect->y = 0;
|
srcrect->width = 0;
|
srcrect->width = 0;
|
srcrect->height = 0;
|
srcrect->height = 0;
|
return 0;
|
return 0;
|
|
|
case GAPVAL(0, 0, 0, 1): /* gap on bottom */
|
case GAPVAL(0, 0, 0, 1): /* gap on bottom */
|
dy = maxy - y + 1;
|
dy = maxy - y + 1;
|
srcrect->y += dy;
|
srcrect->y += dy;
|
srcrect->height -= dy;
|
srcrect->height -= dy;
|
return 0;
|
return 0;
|
|
|
case GAPVAL(0, 0, 1, 0): /* gap on top */
|
case GAPVAL(0, 0, 1, 0): /* gap on top */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
return 0;
|
return 0;
|
|
|
case GAPVAL(0, 0, 1, 1): /* gap on top, bottom */
|
case GAPVAL(0, 0, 1, 1): /* gap on top, bottom */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(0, 1, 0, 0): /* gap on right */
|
case GAPVAL(0, 1, 0, 0): /* gap on right */
|
dx = maxx - x + 1;
|
dx = maxx - x + 1;
|
srcrect->x += dx;
|
srcrect->x += dx;
|
srcrect->width -= dx;
|
srcrect->width -= dx;
|
return 0;
|
return 0;
|
|
|
case GAPVAL(0, 1, 0, 1): /* gap on right, bottom */
|
case GAPVAL(0, 1, 0, 1): /* gap on right, bottom */
|
dx = maxx - x + 1;
|
dx = maxx - x + 1;
|
srcrect->x += dx;
|
srcrect->x += dx;
|
srcrect->width -= dx;
|
srcrect->width -= dx;
|
srcrect->height = maxy - y + 1;
|
srcrect->height = maxy - y + 1;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(0, 1, 1, 0): /* gap on right, top */
|
case GAPVAL(0, 1, 1, 0): /* gap on right, top */
|
dx = maxx - x + 1;
|
dx = maxx - x + 1;
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x + dx;
|
destrect->x = x + dx;
|
destrect->width = width - dx;
|
destrect->width = width - dx;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = y + height - miny;
|
destrect->height = y + height - miny;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(0, 1, 1, 1): /* gap on right, top, bottom */
|
case GAPVAL(0, 1, 1, 1): /* gap on right, top, bottom */
|
dx = maxx - x + 1;
|
dx = maxx - x + 1;
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
destrect++;
|
destrect++;
|
destrect->x = x + dx;
|
destrect->x = x + dx;
|
destrect->width = width - dx;
|
destrect->width = width - dx;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = maxy - miny + 1;
|
destrect->height = maxy - miny + 1;
|
return 2;
|
return 2;
|
|
|
case GAPVAL(1, 0, 0, 0): /* gap on left */
|
case GAPVAL(1, 0, 0, 0): /* gap on left */
|
srcrect->width = minx - x;
|
srcrect->width = minx - x;
|
return 0;
|
return 0;
|
|
|
case GAPVAL(1, 0, 0, 1): /* gap on left, bottom */
|
case GAPVAL(1, 0, 0, 1): /* gap on left, bottom */
|
srcrect->width = minx - x;
|
srcrect->width = minx - x;
|
srcrect->height = maxy - y + 1;
|
srcrect->height = maxy - y + 1;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(1, 0, 1, 0): /* gap on left, top */
|
case GAPVAL(1, 0, 1, 0): /* gap on left, top */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = minx - x;
|
destrect->width = minx - x;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = y + height - miny;
|
destrect->height = y + height - miny;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(1, 0, 1, 1): /* gap on left, top, bottom */
|
case GAPVAL(1, 0, 1, 1): /* gap on left, top, bottom */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = minx - x;
|
destrect->width = minx - x;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = maxy - miny + 1;
|
destrect->height = maxy - miny + 1;
|
destrect++;
|
destrect++;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
return 2;
|
return 2;
|
|
|
case GAPVAL(1, 1, 0, 0): /* gap on left, right */
|
case GAPVAL(1, 1, 0, 0): /* gap on left, right */
|
destrect->x = maxx + 1;
|
destrect->x = maxx + 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->y = y;
|
destrect->y = y;
|
destrect->height = height;
|
destrect->height = height;
|
srcrect->width = minx - x;
|
srcrect->width = minx - x;
|
return 1;
|
return 1;
|
|
|
case GAPVAL(1, 1, 0, 1): /* gap on left, right, bottom */
|
case GAPVAL(1, 1, 0, 1): /* gap on left, right, bottom */
|
dy = maxy - y + 1;
|
dy = maxy - y + 1;
|
srcrect->y += dy;
|
srcrect->y += dy;
|
srcrect->height -= dy;
|
srcrect->height -= dy;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = minx - x;
|
destrect->width = minx - x;
|
destrect->y = y;
|
destrect->y = y;
|
destrect->height = dy;
|
destrect->height = dy;
|
destrect++;
|
destrect++;
|
destrect->x = maxx + 1;
|
destrect->x = maxx + 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->y = y;
|
destrect->y = y;
|
destrect->height = dy;
|
destrect->height = dy;
|
return 2;
|
return 2;
|
|
|
case GAPVAL(1, 1, 1, 0): /* gap on left, right, top */
|
case GAPVAL(1, 1, 1, 0): /* gap on left, right, top */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = minx - x;
|
destrect->width = minx - x;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = y + height - miny;
|
destrect->height = y + height - miny;
|
destrect++;
|
destrect++;
|
destrect->x = maxx + 1;
|
destrect->x = maxx + 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = y + height - miny;
|
destrect->height = y + height - miny;
|
return 2;
|
return 2;
|
|
|
case GAPVAL(1, 1, 1, 1): /* gap on all sides */
|
case GAPVAL(1, 1, 1, 1): /* gap on all sides */
|
srcrect->height = miny - y;
|
srcrect->height = miny - y;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = minx - x;
|
destrect->width = minx - x;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = maxy - miny + 1;
|
destrect->height = maxy - miny + 1;
|
destrect++;
|
destrect++;
|
destrect->x = maxx + 1;
|
destrect->x = maxx + 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->width = x + width - maxx - 1;
|
destrect->y = miny;
|
destrect->y = miny;
|
destrect->height = maxy - miny + 1;
|
destrect->height = maxy - miny + 1;
|
destrect++;
|
destrect++;
|
destrect->x = x;
|
destrect->x = x;
|
destrect->width = width;
|
destrect->width = width;
|
destrect->y = maxy + 1;
|
destrect->y = maxy + 1;
|
destrect->height = y + height - maxy - 1;
|
destrect->height = y + height - maxy - 1;
|
return 3;
|
return 3;
|
}
|
}
|
return 0; /* NOTREACHED */
|
return 0; /* NOTREACHED */
|
}
|
}
|
|
|