Magnum::Ui::UserInterface class new in Git master

Main user interface.

Owns the whole user interface, providing everything from input event handling to animation and drawing. Compared to AbstractUserInterface provides acccess to everything that's needed by builtin widgets, however a concrete setup is handled by the UserInterfaceGL subclass. See documentation of either of the classes for more information.

Builtin widgets, deriving from the Widget class, have access to this instance through BasicWidget::ui() and depending on style setup generally assume that most of dataLayer(), backgroundLayer(), baseLayer(), textLayer(), eventLayer(), layoutLayer(), snapLayouter(), genericLayouter(), nodeAnimator(), backgroundLayerStyleAnimator(), baseLayerStyleAnimator() and textLayerStyleAnimator() is available for use.

Base classes

class AbstractUserInterface new in Git master
Base implementation of the main user interface.

Derived classes

class UserInterfaceGL new in Git master
OpenGL implementation of the main user interface.

Constructors, destructors, conversion operators

UserInterface(const UserInterface&) deleted
Copying is not allowed.
UserInterface(UserInterface&&) noexcept
Move constructor.

Public functions

auto operator=(const UserInterface&) -> UserInterface& deleted
Copying is not allowed.
auto operator=(UserInterface&&) -> UserInterface& noexcept
Move assignment.
auto hasDataLayer() const -> bool
Whether a data layer instance has been set.
auto dataLayer() -> DataLayer&
Data layer instance.
auto dataLayer() const -> const DataLayer&
auto setDataLayerInstance(Containers::Pointer<DataLayer>&& instance) -> UserInterface&
Set a data layer instance.
auto hasBackgroundLayer() const -> bool
Whether a background layer instance has been set.
auto backgroundLayer() -> BaseLayer&
Background layer instance.
auto backgroundLayer() const -> const BaseLayer&
auto setBackgroundLayerInstance(Containers::Pointer<BaseLayer>&& instance) -> UserInterface&
Set a background layer instance.
auto hasBackgroundLayerStyleAnimator() const -> bool
Whether a background layer style animator instance has been set.
auto backgroundLayerStyleAnimator() -> BaseLayerStyleAnimator&
Background layer style animator instance.
auto backgroundLayerStyleAnimator() const -> const BaseLayerStyleAnimator&
auto setBackgroundLayerStyleAnimatorInstance(Containers::Pointer<BaseLayerStyleAnimator>&& instance) -> UserInterface&
Set a background layer style animator instance.
auto hasBaseLayer() const -> bool
Whether a base layer instance has been set.
auto baseLayer() -> BaseLayer&
Base layer instance.
auto baseLayer() const -> const BaseLayer&
auto setBaseLayerInstance(Containers::Pointer<BaseLayer>&& instance) -> UserInterface&
Set a base layer instance.
auto hasBaseLayerStyleAnimator() const -> bool
Whether a base layer style animator instance has been set.
auto baseLayerStyleAnimator() -> BaseLayerStyleAnimator&
Base layer style animator instance.
auto baseLayerStyleAnimator() const -> const BaseLayerStyleAnimator&
auto setBaseLayerStyleAnimatorInstance(Containers::Pointer<BaseLayerStyleAnimator>&& instance) -> UserInterface&
Set a base layer style animator instance.
auto hasTextLayer() const -> bool
Whether a text layer instance has been set.
auto textLayer() -> TextLayer&
Text layer instance.
auto textLayer() const -> const TextLayer&
auto setTextLayerInstance(Containers::Pointer<TextLayer>&& instance) -> UserInterface&
Set a text layer instance.
auto hasTextLayerStyleAnimator() const -> bool
Whether a text layer style animator instance has been set.
auto textLayerStyleAnimator() -> TextLayerStyleAnimator&
Text layer style animator instance.
auto textLayerStyleAnimator() const -> const TextLayerStyleAnimator&
auto setTextLayerStyleAnimatorInstance(Containers::Pointer<TextLayerStyleAnimator>&& instance) -> UserInterface&
Set a text layer style animator instance.
auto hasEventLayer() const -> bool
Whether an event layer instance has been set.
auto eventLayer() -> EventLayer&
Event layer instance.
auto eventLayer() const -> const EventLayer&
auto setEventLayerInstance(Containers::Pointer<EventLayer>&& instance) -> UserInterface&
Set an event layer instance.
auto hasLayoutLayer() const -> bool
Whether a layout layer instance has been set.
auto layoutLayer() -> LayoutLayer&
Layout layer instance.
auto layoutLayer() const -> const LayoutLayer&
auto setLayoutLayerInstance(Containers::Pointer<LayoutLayer>&& instance) -> UserInterface&
Set a layout layer instance.
auto hasSnapLayouter() const -> bool
Whether a snap layouter instance has been set.
auto snapLayouter() -> SnapLayouter&
Snap layouter instance.
auto snapLayouter() const -> const SnapLayouter&
auto setSnapLayouterInstance(Containers::Pointer<SnapLayouter>&& instance) -> UserInterface&
Set a snap layouter instance.
auto hasGenericLayouter() const -> bool
Whether a generic layouter instance has been set.
auto genericLayouter() -> GenericLayouter&
Generic layouter instance.
auto genericLayouter() const -> const GenericLayouter&
auto setGenericLayouterInstance(Containers::Pointer<GenericLayouter>&& instance) -> UserInterface&
Set a generic layouter instance.
auto hasNodeAnimator() const -> bool
Whether a node animator instance has been set.
auto nodeAnimator() -> NodeAnimator&
Node animator instance.
auto nodeAnimator() const -> const NodeAnimator&
auto setNodeAnimatorInstance(Containers::Pointer<NodeAnimator>&& instance) -> UserInterface&
Set a node animator instance.

Function documentation

Magnum::Ui::UserInterface::UserInterface(UserInterface&&) noexcept

Move constructor.

Performs a destructive move, i.e. the original object isn't usable afterwards anymore.

bool Magnum::Ui::UserInterface::hasDataLayer() const

Whether a data layer instance has been set.

DataLayer& Magnum::Ui::UserInterface::dataLayer()

Data layer instance.

Expects that an instance has been set, either by setDataLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const DataLayer& Magnum::Ui::UserInterface::dataLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setDataLayerInstance(Containers::Pointer<DataLayer>&& instance)

Set a data layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through dataLayer().

bool Magnum::Ui::UserInterface::hasBackgroundLayer() const

Whether a background layer instance has been set.

BaseLayer& Magnum::Ui::UserInterface::backgroundLayer()

Background layer instance.

Expects that an instance of either the background or base layer has been set, either by setBackgroundLayerInstance() / setBaseLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

If an instance of a background layer isn't present but base layer is, hasBackgroundLayer() returns false and this function returns the same layer as baseLayer(), so widget implementations don't need to special-case styles that don't provide a dedicated background layer instance (which is the case for example when background blur isn't used).

const BaseLayer& Magnum::Ui::UserInterface::backgroundLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setBackgroundLayerInstance(Containers::Pointer<BaseLayer>&& instance)

Set a background layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through backgroundLayer().

Note that because backgroundLayer() may alias baseLayer() if a background layer instance isn't present, it's not recommended to call this function after any widgets have been already created, as it could lead to internal state inconsistencies.

bool Magnum::Ui::UserInterface::hasBackgroundLayerStyleAnimator() const

Whether a background layer style animator instance has been set.

BaseLayerStyleAnimator& Magnum::Ui::UserInterface::backgroundLayerStyleAnimator()

Background layer style animator instance.

Expects that either a background layer style animator instance has been set, either by setBackgroundLayerStyleAnimatorInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance, or that background layer isn't present at all, and a base layer style animator has been set.

Similarly as with backgroundLayer(), if an instance of a background layer isn't present but base layer along with its style animator is, hasBackgroundLayerStyleAnimator() returns false and this function returns the same animator as baseLayerStyleAnimator(), so widget implementations don't need to special-case styles that don't provide a dedicated background layer instance (which is the case for example when background blur isn't used).

const BaseLayerStyleAnimator& Magnum::Ui::UserInterface::backgroundLayerStyleAnimator() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setBackgroundLayerStyleAnimatorInstance(Containers::Pointer<BaseLayerStyleAnimator>&& instance)

Set a background layer style animator instance.

Returns Reference to self (for method chaining)

Expects that a background layer instance is present but the animator instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

The instance is internally passed to BaseLayer::assignAnimator(BaseLayerStyleAnimator&) and made default with BaseLayer::setDefaultStyleAnimator(). It's subsequently available through backgroundLayerStyleAnimator(), and also BaseLayer::defaultStyleAnimator() unless some other animator becomes set as default.

Note that because backgroundLayerStyleAnimator() may alias baseLayerStyleAnimator() if a background layer instance isn't present, it's not recommended to call this function after any widgets have been already created, as it could lead to internal state inconsistencies.

bool Magnum::Ui::UserInterface::hasBaseLayer() const

Whether a base layer instance has been set.

BaseLayer& Magnum::Ui::UserInterface::baseLayer()

Base layer instance.

Expects that an instance has been set, either by setBaseLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const BaseLayer& Magnum::Ui::UserInterface::baseLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setBaseLayerInstance(Containers::Pointer<BaseLayer>&& instance)

Set a base layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through baseLayer().

bool Magnum::Ui::UserInterface::hasBaseLayerStyleAnimator() const

Whether a base layer style animator instance has been set.

BaseLayerStyleAnimator& Magnum::Ui::UserInterface::baseLayerStyleAnimator()

Base layer style animator instance.

Expects that an instance has been set, either by setBaseLayerStyleAnimatorInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const BaseLayerStyleAnimator& Magnum::Ui::UserInterface::baseLayerStyleAnimator() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setBaseLayerStyleAnimatorInstance(Containers::Pointer<BaseLayerStyleAnimator>&& instance)

Set a base layer style animator instance.

Returns Reference to self (for method chaining)

Expects that a base layer instance is present but the animator instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

The instance is internally passed to BaseLayer::assignAnimator(BaseLayerStyleAnimator&) and made default with BaseLayer::setDefaultStyleAnimator(). It's subsequently available through baseLayerStyleAnimator(), and also BaseLayer::defaultStyleAnimator() unless some other animator becomes set as default.

bool Magnum::Ui::UserInterface::hasTextLayer() const

Whether a text layer instance has been set.

TextLayer& Magnum::Ui::UserInterface::textLayer()

Text layer instance.

Expects that an instance has been set, either by setTextLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const TextLayer& Magnum::Ui::UserInterface::textLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setTextLayerInstance(Containers::Pointer<TextLayer>&& instance)

Set a text layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through textLayer().

bool Magnum::Ui::UserInterface::hasTextLayerStyleAnimator() const

Whether a text layer style animator instance has been set.

TextLayerStyleAnimator& Magnum::Ui::UserInterface::textLayerStyleAnimator()

Text layer style animator instance.

Expects that an instance has been set, either by setTextLayerStyleAnimatorInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const TextLayerStyleAnimator& Magnum::Ui::UserInterface::textLayerStyleAnimator() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setTextLayerStyleAnimatorInstance(Containers::Pointer<TextLayerStyleAnimator>&& instance)

Set a text layer style animator instance.

Returns Reference to self (for method chaining)

Expects that a text layer instance is present but the animator instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

The instance is internally passed to TextLayer::assignAnimator(TextLayerStyleAnimator&) and made default with BaseLayer::setDefaultStyleAnimator(). It's subsequently available through textLayerStyleAnimator(), and also TextLayer::defaultStyleAnimator() unless some other animator becomes set as default.

bool Magnum::Ui::UserInterface::hasEventLayer() const

Whether an event layer instance has been set.

EventLayer& Magnum::Ui::UserInterface::eventLayer()

Event layer instance.

Expects that an instance has been set, either by setEventLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const EventLayer& Magnum::Ui::UserInterface::eventLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setEventLayerInstance(Containers::Pointer<EventLayer>&& instance)

Set an event layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through eventLayer().

bool Magnum::Ui::UserInterface::hasLayoutLayer() const

Whether a layout layer instance has been set.

LayoutLayer& Magnum::Ui::UserInterface::layoutLayer()

Layout layer instance.

Expects that an instance has been set, either by setLayoutLayerInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const LayoutLayer& Magnum::Ui::UserInterface::layoutLayer() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setLayoutLayerInstance(Containers::Pointer<LayoutLayer>&& instance)

Set a layout layer instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through layoutLayer().

bool Magnum::Ui::UserInterface::hasSnapLayouter() const

Whether a snap layouter instance has been set.

SnapLayouter& Magnum::Ui::UserInterface::snapLayouter()

Snap layouter instance.

Expects that an instance has been set, either by setSnapLayouterInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const SnapLayouter& Magnum::Ui::UserInterface::snapLayouter() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setSnapLayouterInstance(Containers::Pointer<SnapLayouter>&& instance)

Set a snap layouter instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through snapLayouter().

bool Magnum::Ui::UserInterface::hasGenericLayouter() const

Whether a generic layouter instance has been set.

GenericLayouter& Magnum::Ui::UserInterface::genericLayouter()

Generic layouter instance.

Expects that an instance has been set, either by setGenericLayouterInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const GenericLayouter& Magnum::Ui::UserInterface::genericLayouter() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setGenericLayouterInstance(Containers::Pointer<GenericLayouter>&& instance)

Set a generic layouter instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through genericLayouter().

bool Magnum::Ui::UserInterface::hasNodeAnimator() const

Whether a node animator instance has been set.

NodeAnimator& Magnum::Ui::UserInterface::nodeAnimator()

Node animator instance.

Expects that an instance has been set, either by setNodeAnimatorInstance() or transitively by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance.

const NodeAnimator& Magnum::Ui::UserInterface::nodeAnimator() const

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

UserInterface& Magnum::Ui::UserInterface::setNodeAnimatorInstance(Containers::Pointer<NodeAnimator>&& instance)

Set a node animator instance.

Returns Reference to self (for method chaining)

Expects that the instance hasn't been set yet, either by this function or transitively either by UserInterfaceGL::setStyle(), create() or a UserInterfaceGL constructor taking a style instance. The instance is subsequently available through nodeAnimator().