Magnum::Ui::TextLayer::Shared::Configuration class

Configuration of a base layer shared state.

Constructors, destructors, conversion operators

Configuration(UnsignedInt styleUniformCount, UnsignedInt styleCount) explicit
Constructor.
Configuration(UnsignedInt styleCount) explicit
Construct with style uniform count being the same as style count.

Public functions

auto styleUniformCount() const -> UnsignedInt
Style uniform count.
auto styleCount() const -> UnsignedInt
Style count.
auto editingStyleUniformCount() const -> UnsignedInt
Editing style uniform count.
auto editingStyleCount() const -> UnsignedInt
Editing style count.
auto setEditingStyleCount(UnsignedInt uniformCount, UnsignedInt count) -> Configuration&
Set editing style count.
auto setEditingStyleCount(UnsignedInt count) -> Configuration&
Set editing style count with style uniform count being the same as style count.
auto dynamicStyleCount() const -> UnsignedInt
Dynamic style count.
auto hasEditingStyles() const -> bool
Whether any editing styles are enabled.
auto setDynamicStyleCount(UnsignedInt count) -> Configuration&
Set dynamic style count.
auto setDynamicStyleCount(UnsignedInt count, bool withEditingStyles) -> Configuration&
Set dynamic style count and explicitly enable dynamic editing styles.

Function documentation

Magnum::Ui::TextLayer::Shared::Configuration::Configuration(UnsignedInt styleUniformCount, UnsignedInt styleCount) explicit

Constructor.

The styleUniformCount parameter specifies the size of the uniform array, styleCount then the number of distinct styles to use for drawing. The sizes are independent in order to allow styles with different fonts or paddings share the same uniform data. Either both styleUniformCount and styleCount is expected to be non-zero, or both zero with a non-zero dynamic style count specified with setDynamicStyleCount(). Style data are then set with setStyle(), dynamic style data then with TextLayer::setDynamicStyle().

Magnum::Ui::TextLayer::Shared::Configuration::Configuration(UnsignedInt styleCount) explicit

Construct with style uniform count being the same as style count.

Equivalent to calling Configuration(UnsignedInt, UnsignedInt) with both parameters set to styleCount.

Configuration& Magnum::Ui::TextLayer::Shared::Configuration::setEditingStyleCount(UnsignedInt uniformCount, UnsignedInt count)

Set editing style count.

Returns Reference to self (for method chaining)

The uniformCount parameter specifies the size of the uniform array, count then the number of distinct styles to use for cursor and selection drawing. The sizes are independent in order to allow editing styles with different paddings share the same uniform data. Both uniformCount and count is expected to either be zero or both non-zero. Style data are then set with setEditingStyle(). Initial count is 0, which means neither cursor nor selection is drawn.

If the style count passed to the constructor is 0, the editing style count is expected to be 0 as well.

Configuration& Magnum::Ui::TextLayer::Shared::Configuration::setEditingStyleCount(UnsignedInt count)

Set editing style count with style uniform count being the same as style count.

Equivalent to calling setEditingStyleCount(UnsignedInt, UnsignedInt) with both parameters set to count.

bool Magnum::Ui::TextLayer::Shared::Configuration::hasEditingStyles() const

Whether any editing styles are enabled.

Returns true if either setEditingStyleCount() was called with a non-zero value or setDynamicStyleCount(UnsignedInt, bool) was called with a non-zero value and withEditingStyles explicitly enabled, false otherwise.

Configuration& Magnum::Ui::TextLayer::Shared::Configuration::setDynamicStyleCount(UnsignedInt count)

Set dynamic style count.

Returns Reference to self (for method chaining)

Initial count is 0. Dynamic editing styles are implicitly enabled only if editing style count is non-zero, use the setDynamicStyleCount(UnsignedInt, bool) overload to control their presence in case editing style count is zero.

Configuration& Magnum::Ui::TextLayer::Shared::Configuration::setDynamicStyleCount(UnsignedInt count, bool withEditingStyles)

Set dynamic style count and explicitly enable dynamic editing styles.

Returns Reference to self (for method chaining)

If editing style count is zero, setting withEditingStyles to true will include them for dynamic styles. Otherwise, if editing style count is zero, they're not included, meaning it's not possible to call TextLayer::setDynamicStyleWithCursor(), TextLayer::setDynamicStyleWithSelection() or TextLayer::setDynamicStyleWithCursorSelection(), only TextLayer::setDynamicStyle(). If editing style count is non-zero, dynamic editing styles are included always and withEditingStyles is ignored.