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

Public Member Functions

 LevelShowThWidgetFactory (StdTheme *p1Owner, const Frame &oFrame, double fMinTop, double fMinBottom, double fMinLeft, double fMinRight) noexcept
 Constructor. More...
 
shared_ptr< ThemeWidgetcreate (const shared_ptr< GameWidget > &refGameWidget, double fTileWHRatio, const Glib::RefPtr< Pango::Context > &refFontContext) noexcept override
 Creates a theme widget for a game widget. More...
 
- Public Member Functions inherited from stmg::StdThemeWidgetFactory
virtual ~StdThemeWidgetFactory () noexcept=default
 
 StdThemeWidgetFactory (StdTheme *p1Owner) noexcept
 Constructor. More...
 
virtual void clearOwner () noexcept
 Clears the owner passed in the constructor. More...
 

Additional Inherited Members

- Protected Member Functions inherited from stmg::StdThemeWidgetFactory
StdThemeowner () noexcept
 The owner. More...
 
const StdThemeowner () const noexcept
 The owner. More...
 

Constructor & Destructor Documentation

◆ LevelShowThWidgetFactory()

stmg::LevelShowThWidgetFactory::LevelShowThWidgetFactory ( StdTheme p1Owner,
const Frame oFrame,
double  fMinTop,
double  fMinBottom,
double  fMinLeft,
double  fMinRight 
)
noexcept

Constructor.

For each frame's side the maximum of the minimal size in pixels and the size in tiles is chosen. Ex. nTopPixel = max(nTileW * fMinTop, oFrame.m_nPixMinTop).

Parameters
p1OwnerThe theme to which this factory will be added.
oFrameThe frame.
fMinTopThe minimum size of the frame top border in tiles.
fMinBottomThe minimum size of the frame bottom border in tiles.
fMinLeftThe minimum size of the frame left border in tiles.
fMinRightThe minimum size of the frame right border in tiles.

Member Function Documentation

◆ create()

shared_ptr<ThemeWidget> stmg::LevelShowThWidgetFactory::create ( const shared_ptr< GameWidget > &  refGameWidget,
double  fTileWHRatio,
const Glib::RefPtr< Pango::Context > &  refFontContext 
)
overridevirtualnoexcept

Creates a theme widget for a game widget.

Parameters
refGameWidgetThe model. Cannot be null.
fTileWHRatioThe tile weight to height ratio.
refFontContextThe pango font context. Cannot be null.
Returns
The created theme widget instance or null if can't create.

Implements stmg::StdThemeWidgetFactory.