Top Description Interfaces Classes
module lwjgl.yoga

Package org.lwjgl.util.yoga

Annotations
@NonnullDefault

Contains bindings to Yoga.

Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API familiar to many designers and opening it up to developers across different platforms.

LWJGL implementation

Unlike the official Yoga Java bindings, the LWJGL bindings directly expose the native C API. YGNodeRef handles do not need to be wrapped in Java instances, so there is no memory overhead. The internal Yoga structs are also exposed, which makes it very efficient to read the current tree layout after a call to NodeCalculateLayout:


// Public API, 4x JNI call overhead
float l = YGNodeLayoutGetLeft(node);
float t = YGNodeLayoutGetTop(node);
float w = YGNodeLayoutGetWidth(node);
float h = YGNodeLayoutGetHeight(node);

// Internal API without overhead (plain memory accesses, assuming allocations are eliminated via EA)
YGLayout layout = YGNode.create(node).layout();

float l = layout.positions(YGEdgeLeft);
float t = layout.positions(YGEdgeTop);
float w = layout.dimensions(YGDimensionWidth);
float h = layout.dimensions(YGDimensionHeight);

Interface Summary

Modifier and TypeInterface and Description
public interface
YGBaselineFuncI

Type


float (*invoke) (
    YGNodeRef node,
    float width,
    float height
)
public interface
YGCloneNodeFuncI

Type


YGNodeRef (*invoke) (
    YGNodeRef oldNode,
    YGNodeRef owner,
    int childIndex
)
public interface
YGDirtiedFuncI

Type


void (*invoke) (
    YGNodeRef node
)
public interface
YGLoggerI

Type


int (*invoke) (
    YGConfigRef config,
    YGNodeRef node,
    YGLogLevel level,
    char const *format,
    va_list args
)
public interface
YGMeasureFuncI

Type


YGSize (*invoke) (
    YGNodeRef node,
    float width,
    YGMeasureMode widthMode,
    float height,
    YGMeasureMode heightMode
)
public interface
YGNodeCleanupFuncI

Type


void (*invoke) (
    YGNodeRef node
)
public interface
YGPrintFuncI

Type


void (*invoke) (
    YGNodeRef node
)

Class Summary

Modifier and TypeClass and Description
public class
CompactValue

Unstable/private API.

pack-priv class
LibYoga

Initializes the yoga shared library.

public abstract class
YGBaselineFunc

Type


float (*invoke) (
    YGNodeRef node,
    float width,
    float height
)
public class
YGCachedMeasurement

Unstable/private API.

public abstract class
YGCloneNodeFunc

Type


YGNodeRef (*invoke) (
    YGNodeRef oldNode,
    YGNodeRef owner,
    int childIndex
)
public abstract class
YGDirtiedFunc

Type


void (*invoke) (
    YGNodeRef node
)
public class
YGFloatOptional

Layout


struct YGFloatOptional {
    float value;
}
public class
YGLayout

Unstable/private API.

public abstract class
YGLogger

Type


int (*invoke) (
    YGConfigRef config,
    YGNodeRef node,
    YGLogLevel level,
    char const *format,
    va_list args
)
public abstract class
YGMeasureFunc

Type


YGSize (*invoke) (
    YGNodeRef node,
    float width,
    YGMeasureMode widthMode,
    float height,
    YGMeasureMode heightMode
)
public class
YGNode

Unstable/private API.

public abstract class
YGNodeCleanupFunc

Type


void (*invoke) (
    YGNodeRef node
)
public class
YGNodeFlags

Layout


struct YGNodeFlags {
    bool hasNewLayout : 1;
    bool isReferenceBaseline : 1;
    bool isDirty : 1;
    YGNodeType nodeType : 1;
    bool measureUsesContext : 1;
    bool baselineUsesContext : 1;
    bool printUsesContext : 1;
}
public abstract class
YGPrintFunc

Type


void (*invoke) (
    YGNodeRef node
)
public class
YGSize

Layout


struct YGSize {
    float width;
    float height;
}
public class
YGStyle

Unstable/private API.

public class
YGValue

Layout


struct YGValue {
    float value;
    YGUnit unit;
}
public class
Yoga

Native bindings to Yoga.