SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
|
The central singleton framework object for SDOM. More...
#include <SDOM_Core.hpp>
Classes | |
struct | CoreConfig |
Public Member Functions | |
virtual bool | onInit () override |
virtual void | onQuit () override |
virtual bool | onUnitTest () override |
Runs unit tests for this object. | |
bool | run () |
bool | run (const CoreConfig &config) |
bool | run (const sol::table &config) |
bool | run (const std::string &configFile) |
void | pumpEventsOnce () |
void | isRunning (bool bRunning) |
void | quit () |
void | shutdown () |
void | onRender () |
void | onEvent (Event &event) |
void | onUpdate (float fElapsedTime) |
void | onWindowResize (int newWidth, int newHeight) |
void | configure (const CoreConfig &config) |
void | configureFromLua (const sol::table &config) |
void | configureFromLuaFile (const std::string &filename) |
void | reconfigure (const CoreConfig &config) |
void | registerOnInit (std::function< bool()> fn) |
void | registerOnQuit (std::function< void()> fn) |
void | registerOnUpdate (std::function< void(float)> fn) |
void | registerOnEvent (std::function< void(const Event &)> fn) |
void | registerOnRender (std::function< void()> fn) |
void | registerOnUnitTest (std::function< bool()> fn) |
void | registerOnWindowResize (std::function< void(int, int)> fn) |
void | _fnOnInit (std::function< bool()> fn) |
void | _fnOnQuit (std::function< void()> fn) |
void | _fnOnUpdate (std::function< void(float)> fn) |
void | _fnOnEvent (std::function< void(const Event &)> fn) |
void | _fnOnRender (std::function< void()> fn) |
void | _fnOnUnitTest (std::function< bool()> fn) |
void | _fnOnWindowResize (std::function< void(int, int)> fn) |
std::function< bool()> | _fnGetOnInit () |
std::function< void()> | _fnGetOnQuit () |
std::function< void(float)> | _fnGetOnUpdate () |
std::function< void(const Event &)> | _fnGetOnEvent () |
std::function< void()> | _fnGetOnRender () |
std::function< bool()> | _fnGetOnUnitTest () |
std::function< void(int, int)> | _fnGetOnWindowResize () |
void | setRootNode (const std::string &name) |
void | setRootNode (const DisplayHandle &handle) |
void | setStage (const std::string &name) |
Stage * | getStage () const |
IDisplayObject * | getRootNodePtr () const |
DisplayHandle | getRootNode () const |
DisplayHandle | getStageHandle () const |
SDL_Window * | getWindow () const |
SDL_Renderer * | getRenderer () const |
SDL_Texture * | getTexture () const |
SDL_Color | getColor () const |
void | setColor (const SDL_Color &color) |
CoreConfig & | getConfig () |
float | getWindowWidth () const |
float | getWindowHeight () const |
float | getPixelWidth () const |
float | getPixelHeight () const |
bool | getPreserveAspectRatio () const |
bool | getAllowTextureResize () const |
SDL_RendererLogicalPresentation | getRendererLogicalPresentation () const |
SDL_WindowFlags | getWindowFlags () const |
SDL_PixelFormat | getPixelFormat () const |
void | setConfig (CoreConfig &config) |
void | setWindowWidth (float width) |
void | setWindowHeight (float height) |
void | setPixelWidth (float width) |
void | setPixelHeight (float height) |
void | setPreserveAspectRatio (bool preserve) |
void | setAllowTextureResize (bool allow) |
void | setRendererLogicalPresentation (SDL_RendererLogicalPresentation presentation) |
void | setWindowFlags (SDL_WindowFlags flags) |
void | setPixelFormat (SDL_PixelFormat format) |
Factory & | getFactory () const |
EventManager & | getEventManager () const |
bool | getIsTraversing () const |
void | setIsTraversing (bool traversing) |
void | handleTabKeyPress () |
void | handleTabKeyPressReverse () |
void | setKeyboardFocusedObject (DisplayHandle obj) |
DisplayHandle | getKeyboardFocusedObject () const |
void | clearKeyboardFocusedObject () |
void | setMouseHoveredObject (DisplayHandle obj) |
DisplayHandle | getMouseHoveredObject () const |
std::string | getWindowTitle () const |
void | setWindowTitle (const std::string &title) |
float | getElapsedTime () const |
sol::state & | getLua () |
DisplayHandle | createDisplayObject (const std::string &typeName, const sol::table &config) |
DisplayHandle | createDisplayObject (const std::string &typeName, const SDOM::IDisplayObject::InitStruct &init) |
DisplayHandle | createDisplayObjectFromScript (const std::string &typeName, const std::string &luaScript) |
AssetHandle | createAssetObject (const std::string &typeName, const sol::table &config) |
AssetHandle | createAssetObject (const std::string &typeName, const SDOM::IAssetObject::InitStruct &init) |
AssetHandle | createAssetObjectFromScript (const std::string &typeName, const std::string &luaScript) |
IDisplayObject * | getDisplayObjectPtr (const std::string &name) |
DisplayHandle | getDisplayObject (const std::string &name) |
DisplayHandle | getDisplayObjectHandle (const std::string &name) |
bool | hasDisplayObject (const std::string &name) const |
IAssetObject * | getAssetObjectPtr (const std::string &name) |
AssetHandle | getAssetObject (const std::string &name) |
bool | hasAssetObject (const std::string &name) const |
void | addDisplayObject (const std::string &name, std::unique_ptr< IDisplayObject > displayObject) |
void | destroyDisplayObject (const std::string &name) |
int | countOrphanedDisplayObjects () const |
std::vector< DisplayHandle > | getOrphanedDisplayObjects () |
void | destroyOrphanedDisplayObjects () |
void | detachOrphans () |
void | attachFutureChildren () |
void | addToOrphanList (const DisplayHandle &orphan) |
void | addToFutureChildrenList (const DisplayHandle &child, const DisplayHandle &parent, bool useWorld=false, int worldX=0, int worldY=0) |
std::vector< std::string > | listDisplayObjectNames () const |
void | clearFactory () |
void | printObjectRegistry () const |
std::vector< std::string > | getPropertyNamesForType (const std::string &typeName) const |
std::vector< std::string > | getCommandNamesForType (const std::string &typeName) const |
std::vector< std::string > | getFunctionNamesForType (const std::string &typeName) const |
void | setStopAfterUnitTests (bool stop) |
bool | getStopAfterUnitTests () |
void | setIgnoreRealInput (bool v) |
bool | getIgnoreRealInput () const |
float | getKeyfocusGray () const |
void | setKeyfocusGray (float gray) |
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 Core & | getInstance () |
template<typename T > | |
static T | lua_value_case_insensitive (const sol::table &tbl, const std::string &key, const T &default_value) |
Protected Member Functions | |
virtual void | _registerLuaBindings (const std::string &typeName, sol::state_view lua) override |
Protected Attributes | |
friend | Factory |
sol::usertype< Core > | objHandleType_ |
std::string | name_ = "IDataObject" |
The central singleton framework object for SDOM.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
overrideprotectedvirtual |
Reimplemented from SDOM::IDataObject.
void SDOM::Core::addDisplayObject | ( | const std::string & | name, |
std::unique_ptr< IDisplayObject > | displayObject | ||
) |
void SDOM::Core::addToFutureChildrenList | ( | const DisplayHandle & | child, |
const DisplayHandle & | parent, | ||
bool | useWorld = false , |
||
int | worldX = 0 , |
||
int | worldY = 0 |
||
) |
void SDOM::Core::addToOrphanList | ( | const DisplayHandle & | orphan | ) |
void SDOM::Core::attachFutureChildren | ( | ) |
void SDOM::Core::clearFactory | ( | ) |
void SDOM::Core::clearKeyboardFocusedObject | ( | ) |
void SDOM::Core::configure | ( | const CoreConfig & | config | ) |
void SDOM::Core::configureFromLua | ( | const sol::table & | config | ) |
void SDOM::Core::configureFromLuaFile | ( | const std::string & | filename | ) |
int SDOM::Core::countOrphanedDisplayObjects | ( | ) | const |
AssetHandle SDOM::Core::createAssetObject | ( | const std::string & | typeName, |
const SDOM::IAssetObject::InitStruct & | init | ||
) |
AssetHandle SDOM::Core::createAssetObject | ( | const std::string & | typeName, |
const sol::table & | config | ||
) |
AssetHandle SDOM::Core::createAssetObjectFromScript | ( | const std::string & | typeName, |
const std::string & | luaScript | ||
) |
DisplayHandle SDOM::Core::createDisplayObject | ( | const std::string & | typeName, |
const SDOM::IDisplayObject::InitStruct & | init | ||
) |
DisplayHandle SDOM::Core::createDisplayObject | ( | const std::string & | typeName, |
const sol::table & | config | ||
) |
DisplayHandle SDOM::Core::createDisplayObjectFromScript | ( | const std::string & | typeName, |
const std::string & | luaScript | ||
) |
void SDOM::Core::destroyDisplayObject | ( | const std::string & | name | ) |
void SDOM::Core::destroyOrphanedDisplayObjects | ( | ) |
void SDOM::Core::detachOrphans | ( | ) |
bool SDOM::Core::getAllowTextureResize | ( | ) | const |
AssetHandle SDOM::Core::getAssetObject | ( | const std::string & | name | ) |
IAssetObject * SDOM::Core::getAssetObjectPtr | ( | const std::string & | name | ) |
|
inline |
std::vector< std::string > SDOM::Core::getCommandNamesForType | ( | const std::string & | typeName | ) | const |
Core::CoreConfig & SDOM::Core::getConfig | ( | ) |
DisplayHandle SDOM::Core::getDisplayObject | ( | const std::string & | name | ) |
|
inline |
IDisplayObject * SDOM::Core::getDisplayObjectPtr | ( | const std::string & | name | ) |
|
inline |
|
inline |
|
inline |
std::vector< std::string > SDOM::Core::getFunctionNamesForType | ( | const std::string & | typeName | ) | const |
|
inline |
|
inlinestatic |
|
inline |
DisplayHandle SDOM::Core::getKeyboardFocusedObject | ( | ) | const |
|
inline |
|
inline |
DisplayHandle SDOM::Core::getMouseHoveredObject | ( | ) | const |
|
inlineinherited |
std::vector< DisplayHandle > SDOM::Core::getOrphanedDisplayObjects | ( | ) |
SDL_PixelFormat SDOM::Core::getPixelFormat | ( | ) | const |
float SDOM::Core::getPixelHeight | ( | ) | const |
float SDOM::Core::getPixelWidth | ( | ) | const |
bool SDOM::Core::getPreserveAspectRatio | ( | ) | const |
std::vector< std::string > SDOM::Core::getPropertyNamesForType | ( | const std::string & | typeName | ) | const |
|
inline |
SDL_RendererLogicalPresentation SDOM::Core::getRendererLogicalPresentation | ( | ) | const |
DisplayHandle SDOM::Core::getRootNode | ( | ) | const |
IDisplayObject * SDOM::Core::getRootNodePtr | ( | ) | const |
Stage * SDOM::Core::getStage | ( | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
SDL_WindowFlags SDOM::Core::getWindowFlags | ( | ) | const |
float SDOM::Core::getWindowHeight | ( | ) | const |
|
inline |
float SDOM::Core::getWindowWidth | ( | ) | const |
void SDOM::Core::handleTabKeyPress | ( | ) |
void SDOM::Core::handleTabKeyPressReverse | ( | ) |
bool SDOM::Core::hasAssetObject | ( | const std::string & | name | ) | const |
bool SDOM::Core::hasDisplayObject | ( | const std::string & | name | ) | const |
|
inline |
std::vector< std::string > SDOM::Core::listDisplayObjectNames | ( | ) | const |
|
inlinestaticinherited |
void SDOM::Core::onEvent | ( | Event & | event | ) |
|
overridevirtual |
Implements SDOM::IDataObject.
|
overridevirtual |
Implements SDOM::IDataObject.
void SDOM::Core::onRender | ( | ) |
|
overridevirtual |
Runs unit tests for this object.
Reimplemented from SDOM::IDataObject.
void SDOM::Core::onUpdate | ( | float | fElapsedTime | ) |
void SDOM::Core::onWindowResize | ( | int | newWidth, |
int | newHeight | ||
) |
void SDOM::Core::printObjectRegistry | ( | ) | const |
void SDOM::Core::pumpEventsOnce | ( | ) |
|
inline |
void SDOM::Core::reconfigure | ( | const CoreConfig & | config | ) |
|
inlineinherited |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool SDOM::Core::run | ( | ) |
bool SDOM::Core::run | ( | const CoreConfig & | config | ) |
bool SDOM::Core::run | ( | const sol::table & | config | ) |
bool SDOM::Core::run | ( | const std::string & | configFile | ) |
void SDOM::Core::setAllowTextureResize | ( | bool | allow | ) |
|
inline |
void SDOM::Core::setConfig | ( | CoreConfig & | config | ) |
|
inline |
|
inline |
void SDOM::Core::setKeyboardFocusedObject | ( | DisplayHandle | obj | ) |
|
inline |
void SDOM::Core::setMouseHoveredObject | ( | DisplayHandle | obj | ) |
|
inlineinherited |
void SDOM::Core::setPixelFormat | ( | SDL_PixelFormat | format | ) |
void SDOM::Core::setPixelHeight | ( | float | height | ) |
void SDOM::Core::setPixelWidth | ( | float | width | ) |
void SDOM::Core::setPreserveAspectRatio | ( | bool | preserve | ) |
void SDOM::Core::setRendererLogicalPresentation | ( | SDL_RendererLogicalPresentation | presentation | ) |
void SDOM::Core::setRootNode | ( | const DisplayHandle & | handle | ) |
void SDOM::Core::setRootNode | ( | const std::string & | name | ) |
void SDOM::Core::setStage | ( | const std::string & | name | ) |
|
inline |
void SDOM::Core::setWindowFlags | ( | SDL_WindowFlags | flags | ) |
void SDOM::Core::setWindowHeight | ( | float | height | ) |
|
inline |
void SDOM::Core::setWindowWidth | ( | float | width | ) |
|
inline |
|
protected |
|
protectedinherited |
|
protected |