SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
|
#include <SDOM_Stage.hpp>
Classes | |
struct | InitStruct |
Public Types | |
enum class | OrphanRetentionPolicy : int { RetainUntilManual , AutoDestroy , GracePeriod } |
Public Member Functions | |
virtual | ~Stage ()=default |
virtual bool | onInit () override |
virtual void | onQuit () override |
virtual void | onUpdate (float fElapsedTime) override |
virtual void | onEvent (const Event &event) override |
virtual void | onRender () override |
virtual bool | onUnitTest () override |
Runs unit tests for this object. | |
int | getMouseX_lua () const |
int | getMouseY_lua () const |
void | setMouseX_lua (int x) |
void | setMouseY_lua (int y) |
OrphanRetentionPolicy | getOrphanRetentionPolicy () const |
IDisplayObject & | setOrphanRetentionPolicy (OrphanRetentionPolicy policy) |
std::chrono::milliseconds | getOrphanGrace () const |
IDisplayObject & | setOrphanGrace (std::chrono::milliseconds grace) |
bool | operator== (const IDisplayObject &other) const |
bool | operator< (const IDisplayObject &other) const |
bool | operator!= (const IDisplayObject &other) const |
bool | operator> (const IDisplayObject &other) const |
bool | operator<= (const IDisplayObject &other) const |
bool | operator>= (const IDisplayObject &other) const |
void | cleanAll () |
bool | getDirty () const |
IDisplayObject & | setDirty () |
IDisplayObject & | setDirty (bool grime) |
bool | isDirty () const |
void | printTree (int depth=0, bool isLast=true, const std::vector< bool > &hasMoreSiblings={}) const |
void | addEventListener (EventType &type, std::function< void(Event &)> listener, bool useCapture=false, int priority=0) |
void | removeEventListener (EventType &type, std::function< void(Event &)> listener, bool useCapture=false) |
void | triggerEventListeners (Event &event, bool useCapture) |
bool | hasEventListeners (const EventType &type, bool useCapture) const |
void | queue_event (const EventType &type, std::function< void(Event &)> init_payload) |
void | addChild (DisplayHandle child, bool useWorld=false, int worldX=0, int worldY=0) |
DisplayHandle | getChild (std::string name) const |
bool | removeChild (DisplayHandle child) |
bool | removeChild (const std::string &name) |
const std::vector< DisplayHandle > & | getChildren () const |
DisplayHandle | getParent () const |
IDisplayObject & | setParent (const DisplayHandle &parent) |
bool | hasChild (DisplayHandle child) const |
bool | isAncestorOf (DisplayHandle descendant) const |
bool | isAncestorOf (const std::string &name) const |
bool | isDescendantOf (DisplayHandle ancestor) const |
bool | isDescendantOf (const std::string &name) const |
bool | removeFromParent () |
bool | removeDescendant (DisplayHandle descendant) |
bool | removeDescendant (const std::string &descendantName) |
std::string | getType () const |
IDisplayObject & | setType (const std::string &newType) |
Bounds | getBounds () const |
IDisplayObject & | setBounds (const Bounds &b) |
SDL_Color | getColor () const |
IDisplayObject & | setColor (const SDL_Color &color) |
int | getMaxPriority () const |
int | getMinPriority () const |
int | getPriority () const |
IDisplayObject & | setToHighestPriority () |
IDisplayObject & | setToLowestPriority () |
IDisplayObject & | sortChildrenByPriority () |
IDisplayObject & | setPriority (int priority) |
std::vector< int > | getChildrenPriorities () const |
IDisplayObject & | moveToTop () |
int | getZOrder () const |
IDisplayObject & | setZOrder (int z_order) |
void | setKeyboardFocus () |
bool | isKeyboardFocused () const |
bool | isMouseHovered () const |
bool | isClickable () const |
IDisplayObject & | setClickable (bool clickable) |
bool | isEnabled () const |
IDisplayObject & | setEnabled (bool enabled) |
bool | isHidden () const |
IDisplayObject & | setHidden (bool hidden) |
bool | isVisible () const |
IDisplayObject & | setVisible (bool visible) |
int | getTabPriority () const |
IDisplayObject & | setTabPriority (int index) |
bool | isTabEnabled () const |
IDisplayObject & | setTabEnabled (bool enabled) |
int | getX () const |
int | getY () const |
int | getWidth () const |
int | getHeight () const |
IDisplayObject & | setX (int p_x) |
IDisplayObject & | setY (int p_y) |
IDisplayObject & | setWidth (int width) |
IDisplayObject & | setHeight (int height) |
AnchorPoint | getAnchorTop () const |
AnchorPoint | getAnchorLeft () const |
AnchorPoint | getAnchorBottom () const |
AnchorPoint | getAnchorRight () const |
void | setAnchorTop (AnchorPoint ap) |
void | setAnchorLeft (AnchorPoint ap) |
void | setAnchorBottom (AnchorPoint ap) |
void | setAnchorRight (AnchorPoint ap) |
float | getLeft () const |
float | getRight () const |
float | getTop () const |
float | getBottom () const |
IDisplayObject & | setLeft (float p_left) |
IDisplayObject & | setRight (float p_right) |
IDisplayObject & | setTop (float p_top) |
IDisplayObject & | setBottom (float p_bottom) |
float | getLocalX () const |
float | getLocalY () const |
float | getLocalWidth () const |
float | getLocalHeight () const |
float | getLocalLeft () const |
float | getLocalRight () const |
float | getLocalTop () const |
float | getLocalBottom () const |
IDisplayObject & | setLocalLeft (float value) |
IDisplayObject & | setLocalRight (float value) |
IDisplayObject & | setLocalTop (float value) |
IDisplayObject & | setLocalBottom (float value) |
std::string | getName () const |
void | setName (const std::string &newName) |
void | registerLuaBindings (const std::string &typeName, sol::state_view lua) |
Static Public Member Functions | |
static std::unique_ptr< IDisplayObject > | CreateFromLua (const sol::table &config) |
static std::unique_ptr< IDisplayObject > | CreateFromInitStruct (const IDisplayObject::InitStruct &baseInit) |
static int | getMouseX () |
static void | setMouseX (int x) |
static int | getMouseY () |
static void | setMouseY (int y) |
template<typename T > | |
static T | lua_value_case_insensitive (const sol::table &tbl, const std::string &key, const T &default_value) |
Static Public Attributes | |
static constexpr const char * | TypeName = "Stage" |
static int | mouseX = 0 |
static int | mouseY = 0 |
Protected Member Functions | |
Stage (const InitStruct &init) | |
Stage (const sol::table &config) | |
virtual void | _registerLuaBindings (const std::string &typeName, sol::state_view lua) |
void | attachChild_ (DisplayHandle child, DisplayHandle parent, bool useWorld=false, int worldX=0, int worldY=0) |
void | removeOrphan_ (const DisplayHandle &orphan) |
Protected Attributes | |
sol::usertype< Stage > | objHandleType_ |
float | left_ = 0.0f |
float | top_ = 0.0f |
float | right_ = 0.0f |
float | bottom_ = 0.0f |
std::string | type_ |
bool | bIsDirty_ = false |
SDL_Color | color_ = {255, 255, 255, 255} |
SDL_Color | foregroundColor_ = {255, 255, 255, 255} |
SDL_Color | backgroundColor_ = {255, 255, 255, 128} |
SDL_Color | borderColor_ = {0, 0, 0, 128} |
SDL_Color | outlineColor_ = {0, 0, 0, 255} |
SDL_Color | dropshadowColor_ = {0, 0, 0, 128} |
AnchorPoint | anchorTop_ = AnchorPoint::TOP_LEFT |
AnchorPoint | anchorLeft_ = AnchorPoint::TOP_LEFT |
AnchorPoint | anchorBottom_ = AnchorPoint::TOP_LEFT |
AnchorPoint | anchorRight_ = AnchorPoint::TOP_LEFT |
int | z_order_ = 0 |
int | priority_ = 0 |
bool | isClickable_ = false |
bool | isEnabled_ = true |
bool | isHidden_ = false |
int | tabPriority_ = -1 |
bool | tabEnabled_ = false |
DisplayHandle | parent_ |
std::vector< DisplayHandle > | children_ |
std::unordered_map< EventType, std::vector< ListenerEntry >, EventTypeHash > | captureEventListeners |
std::unordered_map< EventType, std::vector< ListenerEntry >, EventTypeHash > | bubblingEventListeners |
std::string | name_ = "IDataObject" |
Friends | |
class | Factory |
class | Core |
|
stronginherited |
|
protected |
|
protected |
|
virtualdefault |
|
protectedvirtual |
Reimplemented from SDOM::IDisplayObject.
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inlinestatic |
|
inlinestatic |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inherited |
|
overridevirtual |
Reimplemented from SDOM::IDisplayObject.
|
overridevirtual |
Reimplemented from SDOM::IDisplayObject.
|
overridevirtual |
Reimplemented from SDOM::IDisplayObject.
|
overridevirtual |
Implements SDOM::IDisplayObject.
|
overridevirtual |
Runs unit tests for this object.
Reimplemented from SDOM::IDisplayObject.
|
overridevirtual |
Reimplemented from SDOM::IDisplayObject.
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
protectedinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlinestatic |
|
inline |
|
inlinestatic |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
inherited |
|
inlineinherited |
|
inherited |
|
inherited |
|
friend |
|
friend |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
inlinestatic |
|
inlinestatic |
|
protectedinherited |
|
protected |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
staticconstexpr |
|
protectedinherited |