Implementation of the WindowRectangle support functions, WindowRectangle_Initialize(), WindowRectangle_PointInside(), and WindowRectangle_ToString(), as used in the HandlerChain Pattern. More...
#include <stdbool.h>#include <stdlib.h>#include <stdio.h>#include "helpers/formatstring.h"#include "HandlerChain_WindowRectangle.h"
Go to the source code of this file.
| 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. | |
| Variables | |
| const int | MINIMUM_WIDTH = 4 | 
| Minimum width of a window (to accommodate a close box). | |
| const int | MINIMUM_HEIGHT = 4 | 
| Minimum height of a window (to accommodate a close box). | |
Implementation of the WindowRectangle support functions, WindowRectangle_Initialize(), WindowRectangle_PointInside(), and WindowRectangle_ToString(), as used in the HandlerChain Pattern.
Definition in file HandlerChain_WindowRectangle.c.
| 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 rectanglevalue. | 
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().
| const int MINIMUM_HEIGHT = 4 | 
Minimum height of a window (to accommodate a close box).
Definition at line 23 of file HandlerChain_WindowRectangle.c.
Referenced by WindowRectangle_Initialize().
| const int MINIMUM_WIDTH = 4 | 
Minimum width of a window (to accommodate a close box).
Definition at line 19 of file HandlerChain_WindowRectangle.c.
Referenced by WindowRectangle_Initialize().