class new in Git master
#include <Magnum/Ui/AbstractVisualLayer.h>
AbstractVisualLayer Base for visual data layers.
Provides style management and style changing depending on primary & non-fallthrough input events for builtin visual layers like BaseLayer or TextLayer.
Base classes
- class AbstractLayer new in Git master
- Base for data layers.
Derived classes
- class BaseLayer new in Git master
- Base layer.
- class TextLayer new in Git master
- Text layer.
Public types
- class Shared
- Base shared state for visual data layers.
Constructors, destructors, conversion operators
- AbstractVisualLayer(const AbstractVisualLayer&) deleted
- Copying is not allowed.
- AbstractVisualLayer(AbstractVisualLayer&&) noexcept
- Move constructor.
Public functions
- auto operator=(const AbstractVisualLayer&) -> AbstractVisualLayer& deleted
- Copying is not allowed.
- auto operator=(AbstractVisualLayer&&) -> AbstractVisualLayer& noexcept
- Move assignment.
- auto shared() -> Shared&
- Shared state used by this layer.
- auto shared() const -> const Shared&
- auto style(DataHandle handle) const -> UnsignedInt
- Type-erased data style index.
-
template<class StyleIndex>auto style(DataHandle handle) const -> StyleIndex
- Data style index in a concrete enum type.
- auto style(LayerDataHandle handle) const -> UnsignedInt
- Type-erased data style index assuming it belongs to this layer.
-
template<class StyleIndex>auto style(LayerDataHandle handle) const -> StyleIndex
- Data style index in a concrete enum type assuming it belongs to this layer.
- void setStyle(DataHandle handle, UnsignedInt style)
- Set data style index.
-
template<class StyleIndex>void setStyle(DataHandle handle, StyleIndex style)
- Set data style index in a concrete enum type.
- void setStyle(LayerDataHandle handle, UnsignedInt style)
- Set data style index assuming it belongs to this layer.
-
template<class StyleIndex>void setStyle(LayerDataHandle handle, StyleIndex style)
- Set data style index in a concrete enum type assuming it belongs to this layer.
- void setTransitionedStyle(const AbstractUserInterface& ui, DataHandle handle, UnsignedInt style)
- Set data style index, potentially transitioning it based on user interface state.
-
template<class StyleIndex>void setTransitionedStyle(const AbstractUserInterface& ui, DataHandle handle, StyleIndex style)
- Set data style index in a concrete enum type, potentially transitioning it based on user interface state.
- void setTransitionedStyle(const AbstractUserInterface& ui, LayerDataHandle handle, UnsignedInt style)
- Set data style index assuming it belongs to this layer, potentially transitioning it based on user interface state.
-
template<class StyleIndex>void setTransitionedStyle(const AbstractUserInterface& ui, LayerDataHandle handle, StyleIndex style)
- Set data style index in a concrete enum type assuming it belongs to this layer, potentially transitioning it based on user interface state.
- auto dynamicStyleUsedCount() const -> UnsignedInt
- Count of used dynamic styles.
-
auto allocateDynamicStyle(AnimationHandle animation = AnimationHandle::
Null) -> Containers:: Optional<UnsignedInt> - Allocate a dynamic style index.
- auto dynamicStyleAnimation(UnsignedInt id) const -> AnimationHandle
- Animation associated with a dynamic style.
- void recycleDynamicStyle(UnsignedInt id)
- Recycle a dynamic style index.
Function documentation
Magnum:: Ui:: AbstractVisualLayer:: AbstractVisualLayer(AbstractVisualLayer&&) noexcept
Move constructor.
Performs a destructive move, i.e. the original object isn't usable afterwards anymore.
Shared& Magnum:: Ui:: AbstractVisualLayer:: shared()
Shared state used by this layer.
Reference to the instance passed to BaseLayerGL::
UnsignedInt Magnum:: Ui:: AbstractVisualLayer:: style(DataHandle handle) const
Type-erased data style index.
Expects that handle
is valid. The index is guaranteed to be less than Shared::
template<class StyleIndex>
StyleIndex Magnum:: Ui:: AbstractVisualLayer:: style(DataHandle handle) const
Data style index in a concrete enum type.
Expects that handle
is valid. The index is guaranteed to be less than Shared::
UnsignedInt Magnum:: Ui:: AbstractVisualLayer:: style(LayerDataHandle handle) const
Type-erased data style index assuming it belongs to this layer.
Like style(DataHandle) const but without checking that handle
indeed belongs to this layer. See its documentation for more information.
template<class StyleIndex>
StyleIndex Magnum:: Ui:: AbstractVisualLayer:: style(LayerDataHandle handle) const
Data style index in a concrete enum type assuming it belongs to this layer.
Like style(DataHandle) const but without checking that handle
indeed belongs to this layer. See its documentation for more information.
void Magnum:: Ui:: AbstractVisualLayer:: setStyle(DataHandle handle,
UnsignedInt style)
Set data style index.
Expects that handle
is valid and style
is less than Shared::
Calling this function causes LayerState::
template<class StyleIndex>
void Magnum:: Ui:: AbstractVisualLayer:: setStyle(DataHandle handle,
StyleIndex style)
Set data style index in a concrete enum type.
Casts style
to UnsignedInt and delegates to setStyle(DataHandle, UnsignedInt).
void Magnum:: Ui:: AbstractVisualLayer:: setStyle(LayerDataHandle handle,
UnsignedInt style)
Set data style index assuming it belongs to this layer.
Like setStyle(DataHandle, UnsignedInt) but without checking that handle
indeed belongs to this layer. See its documentation for more information.
template<class StyleIndex>
void Magnum:: Ui:: AbstractVisualLayer:: setStyle(LayerDataHandle handle,
StyleIndex style)
Set data style index in a concrete enum type assuming it belongs to this layer.
Casts style
to UnsignedInt and delegates to setStyle(LayerDataHandle, UnsignedInt).
void Magnum:: Ui:: AbstractVisualLayer:: setTransitionedStyle(const AbstractUserInterface& ui,
DataHandle handle,
UnsignedInt style)
Set data style index, potentially transitioning it based on user interface state.
Like setStyle(), but if handle
is assigned to a node that's referenced from AbstractUserInterface::handle
is valid and style
is less than Shared::
Calling this function causes LayerState::
template<class StyleIndex>
void Magnum:: Ui:: AbstractVisualLayer:: setTransitionedStyle(const AbstractUserInterface& ui,
DataHandle handle,
StyleIndex style)
Set data style index in a concrete enum type, potentially transitioning it based on user interface state.
Casts style
to UnsignedInt and delegates to setTransitionedStyle(const AbstractUserInterface&, DataHandle, UnsignedInt).
void Magnum:: Ui:: AbstractVisualLayer:: setTransitionedStyle(const AbstractUserInterface& ui,
LayerDataHandle handle,
UnsignedInt style)
Set data style index assuming it belongs to this layer, potentially transitioning it based on user interface state.
Like setTransitionedStyle(const AbstractUserInterface&, DataHandle, UnsignedInt) but without checking that handle
indeed belongs to this layer. See its documentation for more information.
template<class StyleIndex>
void Magnum:: Ui:: AbstractVisualLayer:: setTransitionedStyle(const AbstractUserInterface& ui,
LayerDataHandle handle,
StyleIndex style)
Set data style index in a concrete enum type assuming it belongs to this layer, potentially transitioning it based on user interface state.
Casts style
to UnsignedInt and delegates to setTransitionedStyle(const AbstractUserInterface&, LayerDataHandle, UnsignedInt).
UnsignedInt Magnum:: Ui:: AbstractVisualLayer:: dynamicStyleUsedCount() const
Count of used dynamic styles.
Always at most Shared::
Containers:: Optional<UnsignedInt> Magnum:: Ui:: AbstractVisualLayer:: allocateDynamicStyle(AnimationHandle animation = AnimationHandle:: Null)
Allocate a dynamic style index.
The returned index can be used to set properties of a dynamic style using BaseLayer::
When not used anymore, the index should be passed to recycleDynamicStyle() to make it available for allocation again. If there are no free dynamic styles left, returns Containers::
If the dynamic style is driven by an animation, its handle can be passed to the animation
argument to retrieve later with dynamicStyleAnimation(). No validation is performed on the handle, it can be arbitrary. However, if the animation
belongs to an animator that's set with BaseLayer::
AnimationHandle Magnum:: Ui:: AbstractVisualLayer:: dynamicStyleAnimation(UnsignedInt id) const
Animation associated with a dynamic style.
Expects that id
is less than Shared::id
yet or recycleDynamicStyle() was called for id
since, returns AnimationHandle::
void Magnum:: Ui:: AbstractVisualLayer:: recycleDynamicStyle(UnsignedInt id)
Recycle a dynamic style index.
Expects that id
is less than Shared::id
yet. Animation handle associated with id
is reset to AnimationHandle::