Design Pattern Examples
Overview of object-oriented design patterns
HandlerChain_Message.h
Go to the documentation of this file.
1
6
7#pragma once
8#ifndef __HANDLERCHAIN_MESSAGE_H__
9#define __HANDLERCHAIN_MESSAGE_H__
10
12
16typedef enum
17{
23 Close = 0,
24
29
34
40
42
43
44//========================================================================
45//========================================================================
46//========================================================================
47
48
54typedef struct
55{
59 int X;
60
64 int Y;
66
67
79
80
81//========================================================================
82//========================================================================
83//========================================================================
84
85
90typedef struct
91{
96
103} Message;
104
105
114void Message_Initialize(Message* message, MessageType type, int x, int y);
115
125bool Message_ToString(Message* message, DynamicString* output);
126
127#endif // __HANDLERCHAIN_MESSAGE_H__
128
bool Message_ToString(Message *message, DynamicString *output)
Convert a Message object to a string representation.
void Message_Initialize(Message *message, MessageType type, int x, int y)
Initialize a Message structure.
MessageType
Type of message handled by MessageWindow.
@ ButtonUp
Take an action on the currently selected window.
@ ButtonDown
Selects a window based on position.
@ Destroy
Window is being told to destroy itself. This is sent in response to seeing the Close message.
@ Close
Window is asked to close itself, generally sent by the window itself in response to a button up in a ...
bool MessagePosition_ToString(MessagePosition *position, DynamicString *output)
Convert a MessagePosition object to a string representation.
Declaration of the DynamicString structure and supporting functions to work with dynamic strings.
Represents a string that can be grown dynamically.
Definition: dynamicstring.h:16
Represents a message sent to the windows. A message contains a type and a position.
MessagePosition Position
Position of message when the message was sent. In a real system, this would generally represent the p...
MessageType MessageType
Value from the MessageType enumeration indicating the type of this message.
Position of the message in global coordinates (same scope of coordinates as windows)....