SDOM - Simple SDL Document Object Model
A lightweight, extensible Document Object Model for SDL-based applications.
Loading...
Searching...
No Matches
SDOM::TTFAsset Class Reference

#include <SDOM_TTFAsset.hpp>

Inheritance diagram for SDOM::TTFAsset:
SDOM::IAssetObject SDOM::IDataObject SDOM::IUnitTest

Classes

struct  InitStruct
 

Public Member Functions

 TTFAsset ()=default
 
virtual ~TTFAsset ()
 
virtual bool onInit () override
 
virtual void onQuit () override
 
virtual void onLoad () override
 
virtual void onUnload () override
 
virtual bool onUnitTest () override
 Runs unit tests for this object.
 
TTF_Font * _getTTFFontPtr () const
 
int getFontSize () const
 
const std::string & getType () const
 
const std::string & getName () const
 
const std::string & getFilename () const
 
bool isInternal () const
 
bool isLoaded () const
 
void setType (const std::string &type)
 
void setName (const std::string &name)
 
void setFilename (const std::string &filename)
 
template<typename T >
T * as ()
 
void registerLuaBindings (const std::string &typeName, sol::state_view lua)
 

Static Public Member Functions

static std::unique_ptr< IAssetObjectCreateFromLua (const sol::table &config)
 
static std::unique_ptr< IAssetObjectCreateFromInitStruct (const IAssetObject::InitStruct &baseInit)
 
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 = "TTFAsset"
 

Protected Member Functions

 TTFAsset (const InitStruct &init)
 
 TTFAsset (const sol::table &config)
 
virtual void _registerLuaBindings (const std::string &typeName, sol::state_view lua)
 

Protected Attributes

friend Factory
 
friend Core
 
int internalFontSize_ = 10
 
TTF_Font * ttf_font_ = nullptr
 
std::string name_
 
std::string type_
 
std::string filename_
 
bool isInternal_
 
bool isLoaded_ = false
 
sol::usertype< IAssetObjectobjHandleType_
 

Constructor & Destructor Documentation

◆ TTFAsset() [1/3]

SDOM::TTFAsset::TTFAsset ( const InitStruct init)
protected

◆ TTFAsset() [2/3]

SDOM::TTFAsset::TTFAsset ( const sol::table &  config)
protected

◆ TTFAsset() [3/3]

SDOM::TTFAsset::TTFAsset ( )
default

◆ ~TTFAsset()

SDOM::TTFAsset::~TTFAsset ( )
virtual

Member Function Documentation

◆ _getTTFFontPtr()

TTF_Font * SDOM::TTFAsset::_getTTFFontPtr ( ) const
inline

◆ _registerLuaBindings()

void SDOM::TTFAsset::_registerLuaBindings ( const std::string &  typeName,
sol::state_view  lua 
)
protectedvirtual

Reimplemented from SDOM::IAssetObject.

◆ as()

template<typename T >
T * SDOM::IAssetObject::as ( )
inlineinherited

◆ CreateFromInitStruct()

static std::unique_ptr< IAssetObject > SDOM::TTFAsset::CreateFromInitStruct ( const IAssetObject::InitStruct baseInit)
inlinestatic

◆ CreateFromLua()

static std::unique_ptr< IAssetObject > SDOM::TTFAsset::CreateFromLua ( const sol::table &  config)
inlinestatic

◆ getFilename()

const std::string & SDOM::IAssetObject::getFilename ( ) const
inlineinherited

◆ getFontSize()

int SDOM::TTFAsset::getFontSize ( ) const
inline

◆ getName()

const std::string & SDOM::IAssetObject::getName ( ) const
inlineinherited

◆ getType()

const std::string & SDOM::IAssetObject::getType ( ) const
inlineinherited

◆ isInternal()

bool SDOM::IAssetObject::isInternal ( ) const
inlineinherited

◆ isLoaded()

bool SDOM::IAssetObject::isLoaded ( ) const
inlineinherited

◆ lua_value_case_insensitive()

template<typename T >
static T SDOM::IDataObject::lua_value_case_insensitive ( const sol::table &  tbl,
const std::string &  key,
const T &  default_value 
)
inlinestaticinherited

◆ onInit()

bool SDOM::TTFAsset::onInit ( )
overridevirtual

Implements SDOM::IAssetObject.

◆ onLoad()

void SDOM::TTFAsset::onLoad ( )
overridevirtual

Implements SDOM::IAssetObject.

◆ onQuit()

void SDOM::TTFAsset::onQuit ( )
overridevirtual

Implements SDOM::IAssetObject.

◆ onUnitTest()

bool SDOM::TTFAsset::onUnitTest ( )
overridevirtual

Runs unit tests for this object.

Returns
true if all tests pass, false otherwise.

Reimplemented from SDOM::IAssetObject.

◆ onUnload()

void SDOM::TTFAsset::onUnload ( )
overridevirtual

Implements SDOM::IAssetObject.

◆ registerLuaBindings()

void SDOM::IDataObject::registerLuaBindings ( const std::string &  typeName,
sol::state_view  lua 
)
inlineinherited

◆ setFilename()

void SDOM::IAssetObject::setFilename ( const std::string &  filename)
inlineinherited

◆ setName()

void SDOM::IAssetObject::setName ( const std::string &  name)
inlineinherited

◆ setType()

void SDOM::IAssetObject::setType ( const std::string &  type)
inlineinherited

Member Data Documentation

◆ Core

friend SDOM::TTFAsset::Core
protected

◆ Factory

friend SDOM::TTFAsset::Factory
protected

◆ filename_

std::string SDOM::IAssetObject::filename_
protectedinherited

◆ internalFontSize_

int SDOM::TTFAsset::internalFontSize_ = 10
protected

◆ isInternal_

bool SDOM::IAssetObject::isInternal_
protectedinherited

◆ isLoaded_

bool SDOM::IAssetObject::isLoaded_ = false
protectedinherited

◆ name_

std::string SDOM::IAssetObject::name_
protectedinherited

◆ objHandleType_

sol::usertype<IAssetObject> SDOM::IAssetObject::objHandleType_
protectedinherited

◆ ttf_font_

TTF_Font* SDOM::TTFAsset::ttf_font_ = nullptr
protected

◆ type_

std::string SDOM::IAssetObject::type_
protectedinherited

◆ TypeName

constexpr const char* SDOM::TTFAsset::TypeName = "TTFAsset"
staticconstexpr

The documentation for this class was generated from the following files: