Declaration of the WindowRectangle structure and its support functions, WindowRectangle_Initialize(), WindowRectangle_PointInside(), and WindowRectangle_ToString(), as used in the HandlerChain Pattern. More...
Go to the source code of this file.
Classes | |
struct | WindowRectangle |
Represents a rectangular region, with upper left and lower right coordinates. More... | |
Macros | |
#define | __HANDLERCHAIN_WINDOWRECTANGLE_H__ |
Functions | |
void | WindowRectangle_Initialize (WindowRectangle *rectangle, int x, int y, int width, int height) |
Initialize the specified WindowRectangle based on the given position and size in some arbitrary space. Ensures a minimum size. | |
bool | WindowRectangle_PointInside (WindowRectangle *rectangle, MessagePosition *point) |
Determine if the given WindowRectangle object contains the given MessagePosition. | |
bool | WindowRectangle_ToString (WindowRectangle *rectangle, DynamicString *output) |
Convert the given WindowRectangle to a string representation. | |
Declaration of the WindowRectangle structure and its support functions, WindowRectangle_Initialize(), WindowRectangle_PointInside(), and WindowRectangle_ToString(), as used in the HandlerChain Pattern.
Definition in file HandlerChain_WindowRectangle.h.
#define __HANDLERCHAIN_WINDOWRECTANGLE_H__ |
Definition at line 10 of file HandlerChain_WindowRectangle.h.
void WindowRectangle_Initialize | ( | WindowRectangle * | rectangle, |
int | x, | ||
int | y, | ||
int | width, | ||
int | height | ||
) |
Initialize the specified WindowRectangle based on the given position and size in some arbitrary space. Ensures a minimum size.
rectangle | A WindowRectangle object to initialize. |
x | Horizontal position of the upper left corner. |
y | Vertical position of the upper left corner. |
width | Width of the rectangle. |
height | Height of the rectangle. |
Definition at line 29 of file HandlerChain_WindowRectangle.c.
References WindowRectangle::Bottom, WindowRectangle::Left, MINIMUM_HEIGHT, MINIMUM_WIDTH, WindowRectangle::Right, and WindowRectangle::Top.
Referenced by MessageWindow_Create().
bool WindowRectangle_PointInside | ( | WindowRectangle * | rectangle, |
MessagePosition * | point | ||
) |
Determine if the given WindowRectangle object contains the given MessagePosition.
rectangle | A WindowRectangle object to examine. |
point | A MessagePosition object specifying a point in the same space as the rectangle value. |
Definition at line 51 of file HandlerChain_WindowRectangle.c.
References WindowRectangle::Bottom, WindowRectangle::Left, WindowRectangle::Right, WindowRectangle::Top, MessagePosition::X, and MessagePosition::Y.
Referenced by _HandleButtonDownMessage(), and _HandleButtonUpMessage().
bool WindowRectangle_ToString | ( | WindowRectangle * | rectangle, |
DynamicString * | output | ||
) |
Convert the given WindowRectangle to a string representation.
rectangle | A WindowRectangle to convert. |
output | A DynamicString that returns the string version of the rectangle. Call DynamicString_Initialize() on this object before passing as an argument. |
Definition at line 70 of file HandlerChain_WindowRectangle.c.
References WindowRectangle::Bottom, DynamicString_Append(), formatstring(), WindowRectangle::Left, WindowRectangle::Right, and WindowRectangle::Top.
Referenced by MessageWindow_ToString().