Implementation of the Message and MessagePosition structures, along with the functions, MessagePosition_ToString(), Message_Initialize(), and Message_ToString(), as used in the HandlerChain Pattern. More...
#include <stdlib.h>#include <stdio.h>#include "helpers/formatstring.h"#include "HandlerChain_Message.h"
Go to the source code of this file.
Functions | |
| bool | MessagePosition_ToString (MessagePosition *position, DynamicString *output) |
| Convert a MessagePosition object to a string representation. | |
| void | Message_Initialize (Message *message, MessageType type, int x, int y) |
| Initialize a Message structure. | |
| bool | Message_ToString (Message *message, DynamicString *output) |
| Convert a Message object to a string representation. | |
Implementation of the Message and MessagePosition structures, along with the functions, MessagePosition_ToString(), Message_Initialize(), and Message_ToString(), as used in the HandlerChain Pattern.
Definition in file HandlerChain_Message.c.
| void Message_Initialize | ( | Message * | message, |
| MessageType | type, | ||
| int | x, | ||
| int | y | ||
| ) |
Initialize a Message structure.
| message | The Message structure to initialize. |
| type | Value from the MessageType enumeration indicating the type of message being created. |
| x | Horizontal position of the message. |
| y | Vertical position of the message. |
Definition at line 51 of file HandlerChain_Message.c.
References Message::MessageType, Message::Position, MessagePosition::X, and MessagePosition::Y.
Referenced by _HandleButtonUpMessage(), _HandleChain_DestroyWindows(), _HandleCloseMessage(), and HandlerChain_Exercise().
| bool Message_ToString | ( | Message * | message, |
| DynamicString * | output | ||
| ) |
Convert a Message object to a string representation.
| message | The Message object to convert. |
| output | The string representation of the Message object. Call DynamicString_Initialize() on this object before passing as an argument. |
Definition at line 64 of file HandlerChain_Message.c.
References ButtonDown, ButtonUp, Close, Destroy, DynamicString_Append(), DynamicString_Clear(), DynamicString_Initialize(), formatstring(), MessagePosition_ToString(), Message::MessageType, Message::Position, and DynamicString::string.
| bool MessagePosition_ToString | ( | MessagePosition * | position, |
| DynamicString * | output | ||
| ) |
Convert a MessagePosition object to a string representation.
| position | The MessagePosition object to convert. |
| output | A DynamicString in which to store the string representation of the position argument. Call DynamicString_Initialize() on this object before passing as an argument. |
Definition at line 17 of file HandlerChain_Message.c.
References DynamicString_Append(), formatstring(), MessagePosition::X, and MessagePosition::Y.
Referenced by Message_ToString().