40#ifndef __SDOM_EVENTTYPE_HPP__
41#define __SDOM_EVENTTYPE_HPP__
43#include <unordered_set>
121 : name(name), captures_(true), bubbles_(true), targetOnly_(false), global_(false)
124 explicit EventType(
const std::string& name,
bool captures,
bool bubbles,
bool targetOnly,
bool global)
125 : name(name), captures_(captures), bubbles_(bubbles), targetOnly_(targetOnly), global_(global)
130 const std::string&
getName()
const {
return name; }
137 if (registry.find(name) == registry.end()) {
138 registry.insert({name, ptr});
143 return registry.find(name) != registry.end();
147 static const std::unordered_map<std::string, EventType*>&
getRegistry() {
return registry; }
180 static inline std::unordered_map<std::string, EventType*> registry;
182 bool captures_ =
true;
183 bool bubbles_ =
true;
184 bool targetOnly_ =
false;
185 bool global_ =
false;
Definition SDOM_EventType.hpp:49
bool getCaptures() const
Definition SDOM_EventType.cpp:189
static EventType Dragging
Definition SDOM_EventType.hpp:95
bool operator<(const EventType &other) const
Definition SDOM_EventType.hpp:134
bool operator==(const EventType &other) const
Definition SDOM_EventType.hpp:132
static EventType Timer
Definition SDOM_EventType.hpp:71
static EventType RemovedFromStage
Definition SDOM_EventType.hpp:107
static EventType ClipboardPaste
Definition SDOM_EventType.hpp:99
static EventType OnQuit
Definition SDOM_EventType.hpp:110
static EventType MouseDoubleClick
Definition SDOM_EventType.hpp:62
static EventType FocusGained
Definition SDOM_EventType.hpp:75
static EventType Timeout
Definition SDOM_EventType.hpp:73
static EventType MouseButtonDown
Definition SDOM_EventType.hpp:58
static EventType OnEvent
Definition SDOM_EventType.hpp:111
EventType & setGlobal(bool global)
Definition SDOM_EventType.cpp:224
static bool isRegistered(const std::string &name)
Definition SDOM_EventType.hpp:142
static const std::unordered_map< std::string, EventType * > & getRegistry()
Definition SDOM_EventType.hpp:147
static EventType EnterFullscreen
Definition SDOM_EventType.hpp:81
static EventType Active
Definition SDOM_EventType.hpp:89
static EventType MouseEnter
Definition SDOM_EventType.hpp:63
EventType & setBubbles(bool bubbles)
Definition SDOM_EventType.cpp:214
static EventType MouseClick
Definition SDOM_EventType.hpp:61
static EventType AddedToStage
Definition SDOM_EventType.hpp:106
static EventType StateChanged
Definition SDOM_EventType.hpp:85
static EventType Visible
Definition SDOM_EventType.hpp:91
static EventType StageClosed
Definition SDOM_EventType.hpp:66
static EventType SelectionChanged
Definition SDOM_EventType.hpp:86
EventType & setCaptures(bool captures)
Definition SDOM_EventType.cpp:209
static EventType KeyUp
Definition SDOM_EventType.hpp:69
static EventType Drag
Definition SDOM_EventType.hpp:94
EventType(const std::string &name, bool captures, bool bubbles, bool targetOnly, bool global)
Definition SDOM_EventType.hpp:124
bool getBubbles() const
Definition SDOM_EventType.cpp:193
static EventType Enabled
Definition SDOM_EventType.hpp:87
static EventType Removed
Definition SDOM_EventType.hpp:105
static EventType MouseWheel
Definition SDOM_EventType.hpp:59
static EventType FocusLost
Definition SDOM_EventType.hpp:76
static EventType None
Definition SDOM_EventType.hpp:52
static EventType MouseLeave
Definition SDOM_EventType.hpp:64
bool operator!=(const EventType &other) const
Definition SDOM_EventType.hpp:133
static EventType Resize
Definition SDOM_EventType.hpp:77
static EventType Hidden
Definition SDOM_EventType.hpp:92
static EventType OnInit
Definition SDOM_EventType.hpp:109
static EventType Move
Definition SDOM_EventType.hpp:78
static void registerEventType(const std::string &name, EventType *ptr)
Definition SDOM_EventType.hpp:136
static EventType Disabled
Definition SDOM_EventType.hpp:88
static EventType Hide
Definition SDOM_EventType.hpp:80
static EventType MouseButtonUp
Definition SDOM_EventType.hpp:57
static EventType Quit
Definition SDOM_EventType.hpp:54
static EventType OnUpdate
Definition SDOM_EventType.hpp:112
const std::string & getName() const
Definition SDOM_EventType.hpp:130
static EventType Added
Definition SDOM_EventType.hpp:104
bool getTargetOnly() const
Definition SDOM_EventType.cpp:197
static EventType Drop
Definition SDOM_EventType.hpp:96
EventType(const std::string &name)
Definition SDOM_EventType.hpp:120
static EventType OnPreRender
Definition SDOM_EventType.hpp:114
static EventType OnRender
Definition SDOM_EventType.hpp:113
EventType & setTargetOnly(bool targetOnly)
Definition SDOM_EventType.cpp:219
static EventType MouseMove
Definition SDOM_EventType.hpp:60
static EventType ClipboardCopy
Definition SDOM_EventType.hpp:98
static EventType Show
Definition SDOM_EventType.hpp:79
static EventType EnterFrame
Definition SDOM_EventType.hpp:55
static EventType SDL_Event
Definition SDOM_EventType.hpp:53
static EventType ValueChanged
Definition SDOM_EventType.hpp:84
static EventType Tick
Definition SDOM_EventType.hpp:72
static EventType KeyDown
Definition SDOM_EventType.hpp:68
static EventType User
Definition SDOM_EventType.hpp:118
static EventType LeaveFullscreen
Definition SDOM_EventType.hpp:82
static EventType Inactive
Definition SDOM_EventType.hpp:90
bool getGlobal() const
Definition SDOM_EventType.cpp:201
static void registerLua(sol::state_view lua)
Definition SDOM_EventType.cpp:113
Contains all core classes and utilities for the SDOM library.
Definition lua_BindHelpers.hpp:7