[Home] [Prev] [Next] [Up]


Rect, Point, EmptyRect(), PtInRect(), SectRect()

Declarations to simplify point and rectangle manipulation in the YAAF environment. Windows specific routines.

Usage:

#include <XConfig.h>

typedef struct tagRECT Rect;
typedef struct Point { long h; long v; } Point;
bool EmptyRect(Rect *);
bool PtInRect(Point, Rect *);
bool SectRect(Rect *src1, Rect *src2, Rect *dest);

Description

These declarations help simplify using the basic Point and Rectangle declarations across the Macintosh and Microsoft Windows platform. Internally, points are manipulated as the Point structure (declaration shown above).

The routine EmptyRect returns true if the rectangle is empty, and false if it is not.

The routine PtInRect returns true if the specified point is inside the rectangle, and false if it is not.

The routine SectRect returns the rectangle which is the intersection of the two source rectangles. The destination rectangle can be either of the source rectangles. If the rectangles do not intersect, this returns the empty rectangle and false; othwerise, this returns true.

The functionality of the three routines mimic exactly the functionality on the MacOS environment.

Notes

The Point structure is not related to the MS Windows POINT structure; thus, to call Windows routines that require a POINT structure, you must first convert it.

The Rect and Point structures on MS Windows are not the same size as their MacOS counterparts.


[Home] [Prev] [Next] [Up]