stmm-games-doc  0.32.0
Classes | Public Member Functions | List of all members
stmg::Theme Class Referenceabstract
Inheritance diagram for stmg::Theme:
Inheritance graph
[legend]

Classes

class  RuntimeVariablesEnv
 

Public Member Functions

virtual ~Theme () noexcept=default
 
virtual NSize getBestTileSize (int32_t nHintTileW) const noexcept=0
 Get best tile size given a requested width. More...
 
virtual double getTileWHRatio () const noexcept=0
 The tile width to height ratio. More...
 
virtual const NamedgetNamed () const noexcept=0
 The named values. More...
 
virtual shared_ptr< ThemeWidgetcreateWidget (const shared_ptr< GameWidget > &refGameWidget, double fTileWHRatio, const Glib::RefPtr< Pango::Context > &refFontContext) noexcept=0
 Create a theme widget from a game widget (the model). More...
 
virtual shared_ptr< ThemeContextcreateContext (NSize oTileWH, bool bRegister, double fSoundScaleX, double fSoundScaleY, double fSoundScaleZ, const Glib::RefPtr< Pango::Context > &refFontContext, RuntimeVariablesEnv *p0RuntimeVariablesEnv) noexcept=0
 Create a theme context. More...
 

Constructor & Destructor Documentation

◆ ~Theme()

virtual stmg::Theme::~Theme ( )
virtualdefaultnoexcept

Member Function Documentation

◆ createContext()

virtual shared_ptr<ThemeContext> stmg::Theme::createContext ( NSize  oTileWH,
bool  bRegister,
double  fSoundScaleX,
double  fSoundScaleY,
double  fSoundScaleZ,
const Glib::RefPtr< Pango::Context > &  refFontContext,
RuntimeVariablesEnv p0RuntimeVariablesEnv 
)
pure virtualnoexcept

Create a theme context.

The bRegister value tells to the theme whether the tile size of the context is stable and will be used often. If true images and possibly other data structures might be cached.

Parameters
oTileWHThe initial tile width and height in pixels.
bRegisterWhether the tile size of the context should be registered.
fSoundScaleXThe tile to sound reference system scale for the x axis.
fSoundScaleYThe tile to sound reference system scale for the y axis.
fSoundScaleZThe tile to sound reference system scale for the z axis.
refFontContextThe font context. Cannot be null.
p0RuntimeVariablesEnvCannot be null.
Returns
The theme context.

Implemented in stmg::StdTheme.

◆ createWidget()

virtual shared_ptr<ThemeWidget> stmg::Theme::createWidget ( const shared_ptr< GameWidget > &  refGameWidget,
double  fTileWHRatio,
const Glib::RefPtr< Pango::Context > &  refFontContext 
)
pure virtualnoexcept

Create a theme widget from a game widget (the model).

Parameters
refGameWidgetThe game widget. Cannot be null.
fTileWHRatioThe tile wh ratio. Must be positive.
refFontContextThe font context. Cannot be null.
Returns
The created theme widget or null if model not supported.

Implemented in stmg::StdTheme.

◆ getBestTileSize()

virtual NSize stmg::Theme::getBestTileSize ( int32_t  nHintTileW) const
pure virtualnoexcept

Get best tile size given a requested width.

Parameters
nHintTileWThe requested width. If 0 the minimum size is returned.
Returns
The best size.

Implemented in stmg::StdTheme.

◆ getNamed()

virtual const Named& stmg::Theme::getNamed ( ) const
pure virtualnoexcept

The named values.

Contains the strings relevant to the game.

Returns
The named values.

Implemented in stmg::StdTheme.

◆ getTileWHRatio()

virtual double stmg::Theme::getTileWHRatio ( ) const
pure virtualnoexcept

The tile width to height ratio.

According to nTileW ~= fTileWHRatio * nTileH.

Returns
The ratio.

Implemented in stmg::StdTheme.