MiniGUI API Reference (MiniGUI-Processes)
v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
|
Macros | |
#define | RECTWP(prc) ((prc)->right - (prc)->left) |
Get the width of a RECT object by using the pointer to it. More... | |
#define | RECTHP(prc) ((prc)->bottom - (prc)->top) |
Get the height of a RECT object by using the pointer to it. More... | |
#define | RECTW(rc) ((rc).right - (rc).left) |
Get the width of a RECT object. More... | |
#define | RECTH(rc) ((rc).bottom - (rc).top) |
Get the height of a RECT object. More... | |
Functions | |
static void | SetRect (RECT *prc, int left, int top, int right, int bottom) |
Set a rectangle. More... | |
static void | SetRectEmpty (RECT *prc) |
Empties a rectangle. More... | |
static void | CopyRect (RECT *pdrc, const RECT *psrc) |
Copies one rectangle to another. More... | |
static void | OffsetRect (RECT *prc, int x, int y) |
Moves a rectangle by offsets. More... | |
static void | InflateRect (RECT *prc, int cx, int cy) |
Increases or decreases the width and height of an rectangle. More... | |
static void | InflateRectToPt (RECT *prc, int x, int y) |
Inflates a rectangle to contain a point. More... | |
static BOOL | PtInRect (const RECT *prc, int x, int y) |
Determine whether a point lies within an rectangle. More... | |
MG_EXPORT BOOL GUIAPI | IsRectEmpty (const RECT *prc) |
Determine whether an rectangle is empty. More... | |
MG_EXPORT BOOL GUIAPI | EqualRect (const RECT *prc1, const RECT *prc2) |
Determine whether two rectangles are equal. More... | |
MG_EXPORT void GUIAPI | NormalizeRect (RECT *pRect) |
Normalizes a rectangle. More... | |
MG_EXPORT BOOL GUIAPI | IntersectRect (RECT *pdrc, const RECT *psrc1, const RECT *psrc2) |
Calculates the intersection of two rectangles. More... | |
MG_EXPORT BOOL GUIAPI | IsCovered (const RECT *prc1, const RECT *prc2) |
Determine whether one rectangle is covered by another. More... | |
MG_EXPORT BOOL GUIAPI | DoesIntersect (const RECT *psrc1, const RECT *psrc2) |
Determine whether two rectangles intersect. More... | |
MG_EXPORT BOOL GUIAPI | UnionRect (RECT *pdrc, const RECT *psrc1, const RECT *psrc2) |
Unions two source rectangles. More... | |
MG_EXPORT void GUIAPI | GetBoundRect (PRECT pdrc, const RECT *psrc1, const RECT *psrc2) |
Get the bound rectangle of two source rectangles. More... | |
MG_EXPORT int GUIAPI | SubtractRect (RECT *rc, const RECT *psrc1, const RECT *psrc2) |
Obtains the rectangles when substracting one rectangle from another. More... | |
#define RECTH | ( | rc | ) | ((rc).bottom - (rc).top) |
#define RECTHP | ( | prc | ) | ((prc)->bottom - (prc)->top) |
#define RECTW | ( | rc | ) | ((rc).right - (rc).left) |
#define RECTWP | ( | prc | ) | ((prc)->right - (prc)->left) |
Copies one rectangle to another.
This function copies the coordinates of the source rectangle pointed to by psrc to the destination rectangle pointed to by pdrc.
pdrc | The pointer to the destination rectangle. |
psrc | The pointer to the source rectangle. |
Determine whether two rectangles intersect.
This function determines whether two rectangles (psrc1 and psrc2) intersect.
psrc1 | The first source rectangles. |
psrc2 | The second source rectangles. |
Determine whether two rectangles are equal.
This function determines whether the two specified rectangles (prc1 and prc2) are equal by comparing the coordinates of the upper-left and lower-right corners.
prc1 | The pointers to the first rectangles. |
prc2 | The pointers to the second rectangles. |
Get the bound rectangle of two source rectangles.
This function creates the bound rect (pdrc) of two rectangles (psrc1 and prsrc2). The bound rect is the smallest rectangle that contains both source rectangles.
pdrc | The destination rectangle. |
psrc1 | The first source rectangle. |
psrc2 | The second source rectangle. |
|
inlinestatic |
Increases or decreases the width and height of an rectangle.
This function increases or decreases the width and height of the specified rectangle prc. This function adds cx units to the left and right ends of the rectangle and cy units to the top and bottom. the cx and cy are signed values; positive values increases the width and height, and negative values decreases them.
prc | The pointer to the rectangle. |
cx | The inflating x value. |
cy | The inflating y value. |
|
inlinestatic |
Inflates a rectangle to contain a point.
This function inflates the rectangle prc to contain the specified point (x,y).
prc | The pointer to the rectangle. |
x | x,y: The point. |
y | x,y: The point. |
Calculates the intersection of two rectangles.
This function calculates the intersection of two source rectangles (psrc1 and psrc2) and places the coordinates of the intersection rectangle into the destination rectangle pointed to by pdrc. If the source rectangles do not intersect, and empty rectangle (in which all coordinates are set to zero) is placed into the destination rectangle.
pdrc | The pointer to the destination rectangle. |
psrc1 | The first source rectangles. |
psrc2 | The second source rectangles. |
Determine whether one rectangle is covered by another.
This function determines whether one rectangle (prc1) is covered by another rectangle (prc2).
prc1 | The first rectangles. |
prc2 | The second rectangles. |
Determine whether an rectangle is empty.
This function determines whether the specified rectangle prc is empty. An empty rectangle is one that has no area; that is, the coordinates of the right side is equal to the coordinate of the left side, or the coordinates of the bottom side is equal to the coordinate of the top side.
prc | The pointer to the rectangle. |
void GUIAPI NormalizeRect | ( | RECT * | pRect | ) |
Normalizes a rectangle.
This function normalizes the rectangle pointed to by prc so that both the height and width are positive.
pRect | The pointer to the rectangle. |
|
inlinestatic |
Moves a rectangle by offsets.
This function moves the specified rectangle by the specified offsets. x and y specify the amount to move the rectangle left/right or up/down respectively. x must be a negative value to move the rectangle to the left, and y must be a negative value to move the rectangle up.
prc | The pointer to the rectangle. |
x | The x offset. |
y | The y offset. |
Determine whether a point lies within an rectangle.
This function determines whether the specified point (x,y) lies within the specified rectangle prc.
A point is within a rectangle if it lies on the left or top side or is within all four sides. A point on the right or bottom side is considered outside the rectangle.
prc | The pointer to the rectangle. |
x | x,y: The point. |
y | x,y: The point. |
Definition at line 5993 of file gdi.h.
References FALSE, _RECT::left, _RECT::top, and TRUE.
|
inlinestatic |
Set a rectangle.
This function sets the rectangle with specified values.
prc | The pointer to the rectangle. |
left | The x coordinate of the upper-left corner of the rectangle. |
top | The y coordinate of the upper-left corner of the rectangle. |
right | The x coordinate of the lower-right corner of the rectangle. |
bottom | The y coordinate of the lower-right corner of the rectangle. |
|
inlinestatic |
Empties a rectangle.
This function empties the rectangle pointed to by prc. An empty rectangle in MiniGUI is a rectangle whose width and height both are zero. This function will sets all coordinates of the rectangle to be zero.
prc | The pointer to the rectangle. |
Obtains the rectangles when substracting one rectangle from another.
This function obtains the rectangles substracting the rectangle psrc1 from the other psrc2. rc should be an array of RECT struct, and may contain at most four rectangles. This function returns the number of result rectangles.
rc | The pointer to the resule rectangle array. |
psrc1 | The pointer to the minuend rectangle. |
psrc2 | The pointer to the subtrahend rectangle. |
Unions two source rectangles.
This function creates the union (pdrc) of two rectangles (psrc1 and psrc2), if the source rectangles are border upon and not stagger.
pdrc | The unioned rectangle. |
psrc1 | The first source rectangles. |
psrc2 | The second source rectangles. |