|
stmm-games-doc
0.32.0
|

Public Member Functions | |
| virtual | ~ThemeWidget () noexcept=default |
| virtual NSize | getSize () const noexcept=0 |
| The size of the widget. More... | |
| virtual NPoint | getPos () const noexcept=0 |
| The position of the widget. More... | |
| virtual bool | canChange () const noexcept=0 |
| Whether the widget's appearance (or one of its parents) can change. More... | |
| virtual bool | drawIfChanged (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept=0 |
| Deep draws a widget if it changed. More... | |
| virtual void | draw (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept=0 |
| Draws a widget. More... | |
| virtual void | drawDeep (const Cairo::RefPtr< Cairo::Context > &refCc) noexcept |
| Deep draws a widget. More... | |
| bool | isContainer () const noexcept |
| Tells Whether the widget is a container. More... | |
| const shared_ptr< GameWidget > & | getModel () const noexcept |
| The game widget used to generate the theme widget. More... | |
| ThemeContainerWidget * | getParent () const noexcept |
| The parent container of the widget. More... | |
| virtual const std::pair< SegmentedFunction, SegmentedFunction > & | getSizeFunctions (int32_t nLayoutConfig) const noexcept=0 |
| Gets the width and height functions that take the tile width as parameter. More... | |
| virtual void | placeAndMaybeResizeIn (const NRect &oRect) noexcept=0 |
| Places and possibly resizes the widget within the given area. More... | |
| virtual void | dump (int32_t nIndentSpaces, bool bHeader) const noexcept |
| Writes object contents to std::cout. More... | |
| void | dump (int32_t nIndentSpaces) const noexcept |
| Writes object contents to std::cout (header included). More... | |
| void | dump () const noexcept |
| Writes contents to std::cout without indentation. More... | |
Protected Member Functions | |
| ThemeLayout & | themeLayout () noexcept |
| The theme layout. More... | |
| const ThemeLayout & | themeLayout () const noexcept |
| The constant theme layout. More... | |
| virtual void | onAssignedToLayout () noexcept |
| Signal that widget was added to a layout. More... | |
| virtual void | onRecalcSizeFunctions (ThemeWidget *p0ReferenceThemeWidget) noexcept |
| Signal the widget should define its size functions. More... | |
| virtual void | sizeAndConfig (int32_t nTileW, int32_t nLayoutConfig) noexcept=0 |
| Sets the tile size of the widget and its configuration. More... | |
| ThemeWidget (const shared_ptr< GameWidget > &refModel) noexcept | |
| Constructs the theme widget. More... | |
| void | reInit (const shared_ptr< GameWidget > &refModel) noexcept |
| Reinitializes the theme widget. More... | |
|
virtualdefaultnoexcept |
|
inlineexplicitprotectednoexcept |
Constructs the theme widget.
| refModel | The model. Cannot be null. |
|
pure virtualnoexcept |
Whether the widget's appearance (or one of its parents) can change.
This is a static property of the widget calculated when it is already inserted in its final layout and shouldn't change during its lifetime. If a call to drawIfChanged() might return true this function returns true, false otherwise.
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
pure virtualnoexcept |
Draws a widget.
The draw is shallow, so it can assume that the parent was already drawn to the context.
When this function is called this instance can assume that the parent was modified. For mutable widgets this could for example mean they should invalidate their cache if they have one.
If a widget has no parents it must draw completely opaquely.
| refCc | The context to draw to. Cannot be null. |
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
virtualnoexcept |
Deep draws a widget.
The default implementation calls drawDeep of the parent (if it has one) clipped to this widget boundaries and then draw() for this instance.
This should be overridden for example if a widget knows it is completely opaque and drawing all the ancestors first is unnecessary.
| refCc | The context to draw to. Cannot be null. |
|
pure virtualnoexcept |
Deep draws a widget if it changed.
If this is a ThemeContainerWidget it doesn't draw the children, just itself possibly on top of its parent (clipped to this widget).
| refCc | The context to conditionally draw to. Cannot be null. |
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
virtualnoexcept |
Writes object contents to std::cout.
Should only do it in debug mode. The function is also exposed in release mode because it is virtual.
| nIndentSpaces | Number of spaces put in front of each output line. |
| bHeader | Whether the header of the object should be displayed. |
Reimplemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >, stmg::InputBoxThWidget, stmg::LevelShowThemeWidget, stmg::ActionsBoxThWidget, and stmg::ThemeContainerWidget.
|
inlinenoexcept |
Writes object contents to std::cout (header included).
| nIndentSpaces | Number of spaces put in front of each output line. |
|
inlinenoexcept |
Writes contents to std::cout without indentation.
|
inlinenoexcept |
The game widget used to generate the theme widget.
|
inlinenoexcept |
The parent container of the widget.
|
pure virtualnoexcept |
The position of the widget.
Should only be called after the widget has been positioned.
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
pure virtualnoexcept |
The size of the widget.
Should only be called after the widget has been positioned.
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
pure virtualnoexcept |
Gets the width and height functions that take the tile width as parameter.
| nLayoutConfig | The layout config. |
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
inlinenoexcept |
Tells Whether the widget is a container.
|
inlineprotectedvirtualnoexcept |
Signal that widget was added to a layout.
When the theme widget tree is added to the theme layout this function is called for all its widgets. Container widgets don't need to call their children's onAssignedToLayout().
The default implementation does nothing.
Reimplemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >, and stmg::InputBoxThWidget.
|
protectedvirtualnoexcept |
Signal the widget should define its size functions.
The reference widget can be used to determine this widget's size functions.
Container widgets don't need to call their children's onRecalcSizeFunctions(), since it is done by the layout itself.
| p0ReferenceThemeWidget | The reference theme widget. Cannot be null. |
Reimplemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
pure virtualnoexcept |
Places and possibly resizes the widget within the given area.
The placement and resizing depends on align value returned by the model's functions GameWidget::getWidgetAxisFitHoriz() and GameWidget::getWidgetAxisFitVert().
The width and height should be bigger or equal the size of the widget as defined by its size functions with the parameters passed to sizeAndConfig().
Container widgets must recursively call the placeAndMaybeResizeIn() of their children (they are responsible for their positioning).
| oRect | The rectangle where the widget should be placed. |
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, and stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >.
|
inlineprotectednoexcept |
Reinitializes the theme widget.
| refModel | The model. Cannot be null. |
|
protectedpure virtualnoexcept |
Sets the tile size of the widget and its configuration.
The widget should evaluate and set the actual size of the widget through its size functions.
This function is called when the layout has determined the best tile size and layout config in order to maximize the tile size itself.
| nTileW | The tile width. Must be >0. |
| nLayoutConfig | The layout config. |
Implemented in stmg::BoxThemeWidget< TOwnerFactory, TBoxThemeWidget, TBoxWidget >, stmg::BoxThemeWidget< InputBoxThWidgetFactory, InputBoxThWidget, InputBoxWidget >, stmg::BoxThemeWidget< ActionsBoxThWidgetFactory, ActionsBoxThWidget, ActionsBoxWidget >, stmg::BoxThemeWidget< BoxThWidgetFactory, BoxThWidget, BoxWidget >, and stmg::ActionsBoxThWidget.
|
protectednoexcept |
The theme layout.
This function can only be called if the widget is already added to a layout.
Subclasses that call this function must include themelayout.h header file.
|
protectednoexcept |
The constant theme layout.
This function can only be called if the widget is already added to a layout.
Subclasses that call this function must include themelayout.h header file.
1.8.13