40 #ifndef EVENTGAMEWINDOW_CPP
41 #define EVENTGAMEWINDOW_CPP
43 #include "eventgamewindow.h"
44 #include "stringtool.h"
76 {
Data=0; construct(Raw_); }
79 {
Data=0; construct(GWEventID, First, Second); }
119 return "GAME_WINDOW_NONE";
121 return "GAME_WINDOW_SHOWN";
123 return "GAME_WINDOW_HIDDEN";
125 return "GAME_WINDOW_EXPOSED";
127 return "GAME_WINDOW_MOVED";
129 return "GAME_WINDOW_RESIZED";
131 return "GAME_WINDOW_SIZE_CHANGED";
133 return "GAME_WINDOW_MINIMIZED";
135 return "GAME_WINDOW_MAXIMIZED";
137 return "GAME_WINDOW_RESTORED";
139 return "GAME_WINDOW_ENTER";
141 return "GAME_WINDOW_LEAVE";
143 return "GAME_WINDOW_FOCUS_GAINED";
145 return "GAME_WINDOW_FOCUS_LOST";
147 return "GAME_WINDOW_CLOSE";
149 throw(
"Unhandled EventGameWindow::GameWindowEventID reached during eventid to String conversion.");
174 void EventGameWindow::construct(
RawEvent Raw_)
179 switch (Raw_.window.event)
181 case SDL_WINDOWEVENT_NONE:
183 case SDL_WINDOWEVENT_SHOWN:
185 case SDL_WINDOWEVENT_HIDDEN:
187 case SDL_WINDOWEVENT_EXPOSED:
189 case SDL_WINDOWEVENT_MOVED:
191 case SDL_WINDOWEVENT_RESIZED:
193 case SDL_WINDOWEVENT_SIZE_CHANGED:
195 case SDL_WINDOWEVENT_MINIMIZED:
197 case SDL_WINDOWEVENT_MAXIMIZED:
199 case SDL_WINDOWEVENT_RESTORED:
201 case SDL_WINDOWEVENT_ENTER:
203 case SDL_WINDOWEVENT_LEAVE:
205 case SDL_WINDOWEVENT_FOCUS_GAINED:
207 case SDL_WINDOWEVENT_FOCUS_LOST:
209 case SDL_WINDOWEVENT_CLOSE:
212 throw(
"Unhandled EventGameWindow::GameWindowEventID reached during event creation.");
214 construct(GWEventID, Raw_.window.data1, Raw_.window.data2);
219 this->
Data=
new EventGameWindowData(GWEventID,First, Second);
236 Doc->GetFirstChild() >> Ev;
String GetOneTag(std::istream &stream)
Gets the first tag out of the Stream and returns it as a String.
std::ostream & operator<<(std::ostream &stream, const Mezzanine::LinearInterpolator< T > &Lint)
Used to Serialize an Mezzanine::LinearInterpolator to a human readable stream.
virtual ~EventGameWindow()
Deconstructs this EventGameWindow.
int GetSecondEventData() const
Where or how much happened, Get the second event dependent data.
used to keep private in one place that is actually private.
bool Boole
Generally acts a single bit, true or false.
EventGameWindow::GameWindowEventID EventID
What kind of change happened to this game window.
Document * PreParseClassFromSingleTag(const String &NameSpace, const String &ClassName, const String &OneTag)
Perform a basic series of checks for extracting meaning from a single xml tag.
#define MEZZ_EXCEPTION(num, desc)
An easy way to throw exceptions with rich information.
int GetFirstEventData() const
Where or how much happened, Get the first event dependent data.
void operator=(const EventGameWindow &Other)
Assignment of a this EventGameWindowData.
A simple reference counting pointer.
Thrown when a version is accessed/parsed/required and it cannot work correctly or is missing...
Boole IsEventIDValid() const
Used to help determine if this Event is valid by checking the contents of the GameWindowEventID.
EventGameWindow(RawEvent Raw_)
Creates an EventGameWindow from a Rawevent.
GameWindowEventID GetEventID() const
What just happened, what kind of event was it.
virtual EventType GetType() const
This returns EventType::GameWindow.
SDL_Event RawEvent
This is an internal datatype use to communicate with the User input Subsystem.
This implements the exception hiearchy for Mezzanine.
int Second
store another piece of information about the event.
EventType
A listing of values that can be used to identify Events.
A light-weight handle for manipulating nodes in DOM tree.
int AsInt(int def=0) const
Attempts to convert the value of the attribute to an int and returns the results. ...
int First
store a piece of information about the event.
GameWindowEventID
Used to identify the kind of change that has happened to the game window.
Thrown when the identity string wasn't valid at all.
The bulk of the engine components go in this namspace.
std::istream & operator>>(std::istream &stream, Mezzanine::LinearInterpolator< T > &Lint)
Used to de-serialize an Mezzanine::LinearInterpolator from a stream.
Boole operator==(const EventGameWindow &Other) const
Equality comparison of two EventGameWindowData.
Convey the message that Something happened to a game window.
EventGameWindowData * Data
Holds all internal data.
const Char8 * Name() const
ptrdiff_tGet the name of this Node.
static String GameWindowEventIDToString(EventGameWindow::GameWindowEventID GWEventID)
Converts GameWindowEventID To Strings.
std::string String
A datatype used to a series of characters.
Attribute GetAttribute(const Char8 *Name) const
Attempt to get an Attribute on this Node with a given name.