Magnum::YogaIntegration namespace

Integration with Yoga Layout.

Implements a layouter for the Ui library using Yoga Layout.

This library depends on the Yoga Layout library and is built if MAGNUM_WITH_YOGAINTEGRATION is enabled when building Magnum Integration. To use this library with CMake, request the Yoga component of the MagnumIntegration package and link to the MagnumIntegration::Yoga target:

find_package(MagnumIntegration REQUIRED Yoga)

# ...
target_link_libraries(your-app PRIVATE MagnumIntegration::Yoga)

Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-integration repository and do the following before calling find_package(). Using Yoga Layout itself as a CMake subproject isn't tested at the moment, so you need to provide it as a system dependency and point CMAKE_PREFIX_PATH to its installation dir if necessary.

set(MAGNUM_WITH_YOGAINTEGRATION ON CACHE BOOL "" FORCE)
add_subdirectory(magnum-integration EXCLUDE_FROM_ALL)

See Downloading and building integration libraries and Integration library usage with CMake for more information.

Classes

class Layouter new in Git master
Yoga layouter.

Enums

enum class Flag: UnsignedShort { PercentageNodeOffsetX = 1 << 0, PercentageNodeOffsetY = 1 << 1, PercentageNodeOffset = PercentageNodeOffsetX|PercentageNodeOffsetY, NodeOffsetFromRight = 1 << 2, NodeOffsetFromBottom = 1 << 3, NodeOffsetFromRightBottom = NodeOffsetFromRight|NodeOffsetFromBottom, IgnoreNodeOffsetX = PercentageNodeOffsetX|NodeOffsetFromRight|(1 << 4), IgnoreNodeOffsetY = PercentageNodeOffsetY|NodeOffsetFromBottom|(1 << 5), IgnoreNodeOffset = IgnoreNodeOffsetX|IgnoreNodeOffsetY, PercentageNodeSizeX = 1 << 6, PercentageNodeSizeY = 1 << 7, PercentageNodeSize = PercentageNodeSizeX|PercentageNodeSizeY, IgnoreNodeSizeX = PercentageNodeSizeX|(1 << 8), IgnoreNodeSizeY = PercentageNodeSizeY|(1 << 9), IgnoreNodeSize = IgnoreNodeSizeX|IgnoreNodeSizeY } new in Git master
Layout flag.
enum class FlexDirection: UnsignedInt { Column = 0, ColumnReverse = 1, Row = 2, RowReverse = 3 } new in Git master
Layout flex direction.
enum class NodeOffsetType: UnsignedInt { Relative = 1, Absolute = 2 } new in Git master
Layout node offset type.

Typedefs

using Flags = Containers::EnumSet<Flag> new in Git master
Layout flags.

Functions

auto operator<<(Debug& debug, Flag value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, Flags value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, FlexDirection value) -> Debug& new in Git master
Debug output operator.
auto operator<<(Debug& debug, NodeOffsetType value) -> Debug& new in Git master
Debug output operator.

Enum documentation

enum class Magnum::YogaIntegration::Flag: UnsignedShort new in Git master

Layout flag.

Enumerators
PercentageNodeOffsetX

Interpret X node offset coming from Ui::AbstractUserInterface::nodeOffset() as a percentage value instead of UI units. If enabled together with Flag::IgnoreNodeOffsetX, IgnoreNodeOffsetX gets a precedence.

PercentageNodeOffsetY

Interpret Y node offset coming from Ui::AbstractUserInterface::nodeOffset() as a percentage value instead of UI units. If enabled together with Flag::IgnoreNodeOffsetY, IgnoreNodeOffsetY gets a precedence.

PercentageNodeOffset

Interpret X and Y node offset coming from Ui::AbstractUserInterface::nodeOffset() as a percentage value instead of UI units. Shorthand for a combination of Flag::PercentageNodeOffsetX and PercentageNodeOffsetY. If enabled together with Flag::IgnoreNodeOffset, IgnoreNodeOffset gets a precedence.

NodeOffsetFromRight

Interpret X node offset coming from Ui::AbstractUserInterface::nodeOffset() as being from the right, with positive values in a right-to-left direction, instead of from the left with positive values in a left-to-right direction. If enabled together with Flag::IgnoreNodeOffsetX, IgnoreNodeOffsetX gets a precedence.

NodeOffsetFromBottom

Interpret Y node offset coming from Ui::AbstractUserInterface::nodeOffset() as being from the bottom, with positive values in a bottom-to-top direction, instead of from the top with positive values in a top-to-bottom direction. If enabled together with Flag::IgnoreNodeOffsetY, IgnoreNodeOffsetY gets a precedence.

NodeOffsetFromRightBottom

Interpret X and Y node offset coming from Ui::AbstractUserInterface::nodeOffset() as being from the right bottom instead of left top. Shorthand for a combination of Flag::NodeOffsetFromRight and NodeOffsetFromBottom. If enabled together with Flag::IgnoreNodeOffset, IgnoreNodeOffset gets a precedence.

IgnoreNodeOffsetX

Ignore X node offset coming from Ui::AbstractUserInterface::nodeOffset() and use the value specified directly using Yoga APIs instead. If specified together with Flag::PercentageNodeOffsetX or NodeOffsetFromRight, this flag gets a precedence.

IgnoreNodeOffsetY

Ignore Y node offset coming from Ui::AbstractUserInterface::nodeOffset() and use the value specified directly using Yoga APIs instead. If specified together with Flag::PercentageNodeOffsetY or NodeOffsetFromBottom, this flag gets a precedence.

IgnoreNodeOffset

Ignore X and Y node offset coming from Ui::AbstractUserInterface::nodeOffset() and use the value specified directly using Yoga APIs instead. Shorthand for a combination of Flag::IgnoreNodeOffsetX and IgnoreNodeOffsetY. If specified together with Flag::PercentageNodeOffset or NodeOffsetFromRightBottom, this flag gets a precedence.

PercentageNodeSizeX

Interpret X node size coming from Ui::AbstractUserInterface::nodeSize() as a percentage value instead of UI units. If enabled together with Flag::IgnoreNodeSizeX, IgnoreNodeSizeX gets a precedence.

PercentageNodeSizeY

Interpret Y node size coming from Ui::AbstractUserInterface::nodeSize() as a percentage value instead of UI units. If enabled together with Flag::IgnoreNodeSizeY, IgnoreNodeSizeY gets a precedence.

PercentageNodeSize

Interpret X and Y node size coming from Ui::AbstractUserInterface::nodeSize() as a percentage value instead of UI units. Shorthand for a combination of Flag::PercentageNodeOffsetX and PercentageNodeOffsetY. If enabled together with Flag::IgnoreNodeSize, IgnoreNodeSize gets a precedence.

IgnoreNodeSizeX

Ignore X node size coming from Ui::AbstractUserInterface::nodeSize() and use the value specified directly using Yoga APIs instead. If specified together with Flag::PercentageNodeSizeX, this flag gets a precedence.

IgnoreNodeSizeY

Ignore Y node size coming from Ui::AbstractUserInterface::nodeSize() and use the value specified directly using Yoga APIs instead. If specified together with Flag::PercentageNodeSizeY, this flag gets a precedence.

IgnoreNodeSize

Ignore X and Y node size coming from Ui::AbstractUserInterface::nodeSize() and use the value specified directly using Yoga APIs instead. Shorthand for a combination of Flag::IgnoreNodeSizeX and IgnoreNodeSizeY. If specified together with Flag::PercentageNodeSize, this flag gets a precedence.

enum class Magnum::YogaIntegration::FlexDirection: UnsignedInt new in Git master

Layout flex direction.

Corresponds to the CSS flex-direction property, see the linked documentation for detailed explanation.

Enumerators
Column

Orders child nodes in a column. Matches behavior of flex-direction: column; in CSS. This is the default in Yoga.

ColumnReverse

Orders child nodes in a column, in reverse order. Matches behavior of flex-direction: column-reverse; in CSS.

Row

Orders child nodes in a row. Matches behavior of flex-direction: row; in CSS.

RowReverse

Orders child nodes in a row, in reverse order. Matches behavior of flex-direction: row; in CSS.

enum class Magnum::YogaIntegration::NodeOffsetType: UnsignedInt new in Git master

Layout node offset type.

Corresponds to the CSS position property, see the linked documentation for detailed explanation.

Enumerators
Relative

The offset is applied as relative to the result of given node layout calculation and doesn't affect layout of other nodes. Matches behavior of position: relative; in CSS. This is the default in Yoga.

Absolute

The node is excluded from layout calculation and the offset is applied relatively to the parent node offset and size. Matches behavior of position: absolute; in CSS. By default the offset is interpreted relative to the top left corner of parent node, use Flag::NodeOffsetFromRight, NodeOffsetFromBottom or NodeOffsetFromRightBottom to make it relative to other edges.

Typedef documentation

Function documentation

Debug& Magnum::YogaIntegration::operator<<(Debug& debug, Flag value) new in Git master

Debug output operator.

Debug& Magnum::YogaIntegration::operator<<(Debug& debug, Flags value) new in Git master

Debug output operator.

Debug& Magnum::YogaIntegration::operator<<(Debug& debug, FlexDirection value) new in Git master

Debug output operator.

Debug& Magnum::YogaIntegration::operator<<(Debug& debug, NodeOffsetType value) new in Git master

Debug output operator.