12#include "helpers/formatstring.h"
31 if (rectangle != NULL)
43 rectangle->
Right = x + width;
44 rectangle->
Bottom = y + height;
53 bool isInside =
false;
54 if (rectangle != NULL && point != NULL)
57 if (point->
X >= rectangle->
Left && point->
X < rectangle->
Right &&
58 point->
Y >= rectangle->
Top && point->
Y < rectangle->
Bottom)
74 if (rectangle != NULL && output != NULL)
76 char *buffer =
formatstring(
"x1=%2d, y1=%2d, x2=%2d, y2=%2d",
83 printf(
" Error! Out of memory condition formatting a window's rectangle as a string in WindowRectangle_ToString()!\n");
89 printf(
" Error! Out of memory formatting window rectangle in WindowRectangle_ToString()!\n");
bool WindowRectangle_ToString(WindowRectangle *rectangle, DynamicString *output)
Convert the given WindowRectangle to a string representation.
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...
const int MINIMUM_WIDTH
Minimum width of a window (to accommodate a close box).
bool WindowRectangle_PointInside(WindowRectangle *rectangle, MessagePosition *point)
Determine if the given WindowRectangle object contains the given MessagePosition.
const int MINIMUM_HEIGHT
Minimum height of a window (to accommodate a close box).
Declaration of the WindowRectangle structure and its support functions, WindowRectangle_Initialize(),...
bool DynamicString_Append(DynamicString *string, const char *s)
Append the specified string to the DynamicString object.
Represents a string that can be grown dynamically.
Position of the message in global coordinates (same scope of coordinates as windows)....
Represents a rectangular region, with upper left and lower right coordinates.