XRRECTANGLE(3X)

NAME
XrSetRect, XrSetPtRect, XrCopyRect, XrOffsetRect, XrInsetRect, XrSectRect, XrUnionRect, XrPtInRect, XrPt2Rect, XrEqualRect - calculations with rectangles.

SYNOPSIS
#include <X/Xlib.h>
#include <Xr/Xrlib.h>

XrSetRect (rect, x, y, width, height)
RECTANGLE * rect;
INT16 x;
INT16 y;
INT16 width;
INT16 height;

XrSetPtRect (rect, topLeft, botRight)
RECTANGLE * rect;
POINT * topLeft;
POINT * botRight;

XrCopyRect (srcRect, dstRect)
RECTANGLE * srcRect;
RECTANGLE * dstRect;

XrOffsetRect (rect, dx, dy)
RECTANGLE * rect;
INT16 dx;
INT16 dy;

XrInsetRect (rect, dx, dy)
RECTANGLE * rect;
INT16 dx;
INT16 dy;

XrSectRect (srcRectA, srcRectB, dstRect)
RECTANGLE * srcRectA;
RECTANGLE * srcRectB;
RECTANGLE * dstRect;

XrUnionRect (srcRectA, srcRectB, dstRect)
RECTANGLE * srcRectA;
RECTANGLE * srcRectB;
RECTANGLE * dstRect;

XrPtInRect (pt, rect)
POINT * pt;
RECTANGLE * rect;

XrPt2Rect (ptA, ptB, dstRect)
POINT * ptA;
POINT * ptB;
RECTANGLE * dstRect;

XrEqualRect (rectA, rectB)
RECTANGLE * rectA;
RECTANGLE * rectB;

XrEmptyRect (rect);
RECTANGLE * rect;

DESCRIPTION

XrSetRect
    Assign the four members of a rectangle. The result is a rectangle with values of x, y, width, height.

XrSetPtRect
    Assign the two boundary points to the rectangle. The result is a rectangle with the x and y fields set to the fields of the topLeft, parameter and the width and height fields set to the difference of the topLeft and botRight point parameters.

XrCopyRect
    Assign the coordinates of the source rectangle srcRect into the destination rectangle dstRect.

XrOffsetRect
    Move the rectangle rect by adding dx to each horizontal coordinate and dy to each vertical coordinate.

XrInsetRect
    Shrink or expand the rectangle rect. The left and right sides are moved in by the amount specified by dx; the top and bottom are moved towards the center by the amount specified by dy. If the resulting width or height becomes less than 1, the rectangle is set to the empty rectangle (0, 0, 0, 0).

XrSectRect
    Calculate the rectangle that is the intersection of the two source rectangles srcRectA and srcRectB, place the result into the rectangle dstRect and return TRUE if they intersect or FALSE if they do not.

XrUnionRect
    Calculate the smallest rectangle which encloses both input rectangles and return the resulting rectangle in dstRect.

XrPtInRect
    Determine whether the point is in the rectangle. Return TRUE if it is and FALSE if it isn't.

XrPt2Rect
    Return the smallest rectangle which encloses the two input points.

XrEqualRect
    Compare the two rectangles and return TRUE if they are equal or FALSE if not.

XrEmptyRect
    Return TRUE if the given rectangle is an empty rectangle or FALSE if not. A rectangle is considered empty if the width or height fields of the rectangle are less than or equal to 0.