Class YGNode

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class YGNode
    extends Struct
    implements NativeResource
    Unstable/private API.

    Layout

    
     struct YGNodeLWJGL {
         void * context;
         bool hasNewLayout : 1;
         bool isReferenceBaseline : 1;
         bool isDirty : 1;
         YGNodeType nodeType : 1;
         bool measureUsesContext : 1;
         bool baselineUsesContext : 1;
         bool printUsesContext : 1;
         bool useWebDefaults : 1;
         char[1];
         union {
             YGMeasureFunc noContext;
             MeasureWithContextFn withContext;
         } measure;
         union {
             YGBaselineFunc noContext;
             BaselineWithContextFn withContext;
         } baseline;
         union {
             YGPrintFunc noContext;
             PrintWithContextFn withContext;
         } print;
         YGDirtiedFunc dirtied;
         YGStyle style;
         YGLayout layout;
         uint32_t lineIndex;
         YGNodeRef owner;
         YGVector children;
         YGConfigRef config;
         YGValue resolvedDimensions[2];
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • CONTEXT, BITFIELD, MEASURE, MEASURE_NOCONTEXT, MEASURE_WITHCONTEXT, BASELINE, BASELINE_NOCONTEXT, BASELINE_WITHCONTEXT, PRINT, PRINT_NOCONTEXT, PRINT_WITHCONTEXT, DIRTIED, STYLE, LAYOUT, LINEINDEX, OWNER, CHILDREN, CONFIG, RESOLVEDDIMENSIONS

        The struct member offsets.
    • Constructor Detail

      • YGNode

        public YGNode​(java.nio.ByteBuffer container)
        Creates a YGNode instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • context

        public long context()
        Returns the value of the context field.
      • hasNewLayout

        public boolean hasNewLayout()
        Returns the value of the hasNewLayout field.
      • isReferenceBaseline

        public boolean isReferenceBaseline()
        Returns the value of the isReferenceBaseline field.
      • isDirty

        public boolean isDirty()
        Returns the value of the isDirty field.
      • nodeType

        public int nodeType()
        Returns the value of the nodeType field.
      • measureUsesContext

        public boolean measureUsesContext()
        Returns the value of the measureUsesContext field.
      • baselineUsesContext

        public boolean baselineUsesContext()
        Returns the value of the baselineUsesContext field.
      • printUsesContext

        public boolean printUsesContext()
        Returns the value of the printUsesContext field.
      • useWebDefaults

        public boolean useWebDefaults()
        Returns the value of the useWebDefaults field.
      • measure_noContext

        @Nullable
        public YGMeasureFunc measure_noContext()
        Returns the value of the measure.noContext field.
      • measure_withContext

        public long measure_withContext()
        Returns the value of the measure.withContext field.
      • baseline_noContext

        @Nullable
        public YGBaselineFunc baseline_noContext()
        Returns the value of the baseline.noContext field.
      • baseline_withContext

        public long baseline_withContext()
        Returns the value of the baseline.withContext field.
      • print_noContext

        @Nullable
        public YGPrintFunc print_noContext()
        Returns the value of the print.noContext field.
      • print_withContext

        public long print_withContext()
        Returns the value of the print.withContext field.
      • dirtied

        @Nullable
        public YGDirtiedFunc dirtied()
        Returns the value of the dirtied field.
      • style

        public YGStyle style()
        Returns a YGStyle view of the style field.
      • layout

        public YGLayout layout()
        Returns a YGLayout view of the layout field.
      • lineIndex

        public int lineIndex()
        Returns the value of the lineIndex field.
      • owner

        public long owner()
        Returns the value of the owner field.
      • config

        public long config()
        Returns the value of the config field.
      • resolvedDimensions

        public YGValue.Buffer resolvedDimensions()
        Returns a YGValue.Buffer view of the resolvedDimensions field.
      • resolvedDimensions

        public YGValue resolvedDimensions​(int index)
        Returns a YGValue view of the struct at the specified index of the resolvedDimensions field.
      • context

        public YGNode context​(long value)
        Sets the specified value to the context field.
      • hasNewLayout

        public YGNode hasNewLayout​(boolean value)
        Sets the specified value to the hasNewLayout field.
      • isReferenceBaseline

        public YGNode isReferenceBaseline​(boolean value)
        Sets the specified value to the isReferenceBaseline field.
      • isDirty

        public YGNode isDirty​(boolean value)
        Sets the specified value to the isDirty field.
      • nodeType

        public YGNode nodeType​(int value)
        Sets the specified value to the nodeType field.
      • measureUsesContext

        public YGNode measureUsesContext​(boolean value)
        Sets the specified value to the measureUsesContext field.
      • baselineUsesContext

        public YGNode baselineUsesContext​(boolean value)
        Sets the specified value to the baselineUsesContext field.
      • printUsesContext

        public YGNode printUsesContext​(boolean value)
        Sets the specified value to the printUsesContext field.
      • useWebDefaults

        public YGNode useWebDefaults​(boolean value)
        Sets the specified value to the useWebDefaults field.
      • measure_noContext

        public YGNode measure_noContext​(@Nullable
                                        YGMeasureFuncI value)
        Sets the specified value to the measure.noContext field.
      • measure_withContext

        public YGNode measure_withContext​(long value)
        Sets the specified value to the measure.withContext field.
      • baseline_noContext

        public YGNode baseline_noContext​(@Nullable
                                         YGBaselineFuncI value)
        Sets the specified value to the baseline.noContext field.
      • baseline_withContext

        public YGNode baseline_withContext​(long value)
        Sets the specified value to the baseline.withContext field.
      • print_noContext

        public YGNode print_noContext​(@Nullable
                                      YGPrintFuncI value)
        Sets the specified value to the print.noContext field.
      • print_withContext

        public YGNode print_withContext​(long value)
        Sets the specified value to the print.withContext field.
      • dirtied

        public YGNode dirtied​(@Nullable
                              YGDirtiedFuncI value)
        Sets the specified value to the dirtied field.
      • lineIndex

        public YGNode lineIndex​(int value)
        Sets the specified value to the lineIndex field.
      • owner

        public YGNode owner​(long value)
        Sets the specified value to the owner field.
      • config

        public YGNode config​(long value)
        Sets the specified value to the config field.
      • resolvedDimensions

        public YGNode resolvedDimensions​(int index,
                                         YGValue value)
        Copies the specified YGValue at the specified index of the resolvedDimensions field.
      • resolvedDimensions

        public YGNode resolvedDimensions​(java.util.function.Consumer<YGValue.Buffer> consumer)
        Passes the resolvedDimensions field to the specified Consumer.
      • resolvedDimensions

        public YGNode resolvedDimensions​(int index,
                                         java.util.function.Consumer<YGValue> consumer)
        Passes the element at index of the resolvedDimensions field to the specified Consumer.
      • set

        public YGNode set​(YGNode src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static YGNode malloc()
        Returns a new YGNode instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static YGNode calloc()
        Returns a new YGNode instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static YGNode create()
        Returns a new YGNode instance allocated with BufferUtils.
      • create

        public static YGNode create​(long address)
        Returns a new YGNode instance for the specified memory address.
      • createSafe

        @Nullable
        public static YGNode createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static YGNode.Buffer malloc​(int capacity)
        Returns a new YGNode.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static YGNode.Buffer calloc​(int capacity)
        Returns a new YGNode.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static YGNode.Buffer create​(long address,
                                           int capacity)
        Create a YGNode.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static YGNode.Buffer createSafe​(long address,
                                               int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        public static YGNode mallocStack()
        Returns a new YGNode instance allocated on the thread-local MemoryStack.
      • callocStack

        public static YGNode callocStack()
        Returns a new YGNode instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static YGNode mallocStack​(MemoryStack stack)
        Returns a new YGNode instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

        public static YGNode callocStack​(MemoryStack stack)
        Returns a new YGNode instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • mallocStack

        public static YGNode.Buffer mallocStack​(int capacity)
        Returns a new YGNode.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static YGNode.Buffer callocStack​(int capacity)
        Returns a new YGNode.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • mallocStack

        public static YGNode.Buffer mallocStack​(int capacity,
                                                MemoryStack stack)
        Returns a new YGNode.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • callocStack

        public static YGNode.Buffer callocStack​(int capacity,
                                                MemoryStack stack)
        Returns a new YGNode.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ncontext

        public static long ncontext​(long struct)
        Unsafe version of context().
      • nbitfield

        public static byte nbitfield​(long struct)
      • nhasNewLayout

        public static boolean nhasNewLayout​(long struct)
        Unsafe version of hasNewLayout().
      • nisReferenceBaseline

        public static boolean nisReferenceBaseline​(long struct)
        Unsafe version of isReferenceBaseline().
      • nisDirty

        public static boolean nisDirty​(long struct)
        Unsafe version of isDirty().
      • nnodeType

        public static int nnodeType​(long struct)
        Unsafe version of nodeType().
      • nmeasureUsesContext

        public static boolean nmeasureUsesContext​(long struct)
        Unsafe version of measureUsesContext().
      • nbaselineUsesContext

        public static boolean nbaselineUsesContext​(long struct)
        Unsafe version of baselineUsesContext().
      • nprintUsesContext

        public static boolean nprintUsesContext​(long struct)
        Unsafe version of printUsesContext().
      • nuseWebDefaults

        public static boolean nuseWebDefaults​(long struct)
        Unsafe version of useWebDefaults().
      • nmeasure_withContext

        public static long nmeasure_withContext​(long struct)
        Unsafe version of measure_withContext().
      • nbaseline_withContext

        public static long nbaseline_withContext​(long struct)
        Unsafe version of baseline_withContext().
      • nprint_withContext

        public static long nprint_withContext​(long struct)
        Unsafe version of print_withContext().
      • nstyle

        public static YGStyle nstyle​(long struct)
        Unsafe version of style().
      • nlayout

        public static YGLayout nlayout​(long struct)
        Unsafe version of layout().
      • nlineIndex

        public static int nlineIndex​(long struct)
        Unsafe version of lineIndex().
      • nowner

        public static long nowner​(long struct)
        Unsafe version of owner().
      • nchildren

        public static long nchildren​(long struct)
      • nconfig

        public static long nconfig​(long struct)
        Unsafe version of config().
      • nresolvedDimensions

        public static YGValue nresolvedDimensions​(long struct,
                                                  int index)
        Unsafe version of resolvedDimensions.
      • ncontext

        public static void ncontext​(long struct,
                                    long value)
        Unsafe version of context.
      • nbitfield

        public static void nbitfield​(long struct,
                                     byte value)
      • nhasNewLayout

        public static void nhasNewLayout​(long struct,
                                         boolean value)
        Unsafe version of hasNewLayout.
      • nisReferenceBaseline

        public static void nisReferenceBaseline​(long struct,
                                                boolean value)
        Unsafe version of isReferenceBaseline.
      • nisDirty

        public static void nisDirty​(long struct,
                                    boolean value)
        Unsafe version of isDirty.
      • nnodeType

        public static void nnodeType​(long struct,
                                     int value)
        Unsafe version of nodeType.
      • nmeasureUsesContext

        public static void nmeasureUsesContext​(long struct,
                                               boolean value)
        Unsafe version of measureUsesContext.
      • nbaselineUsesContext

        public static void nbaselineUsesContext​(long struct,
                                                boolean value)
        Unsafe version of baselineUsesContext.
      • nprintUsesContext

        public static void nprintUsesContext​(long struct,
                                             boolean value)
        Unsafe version of printUsesContext.
      • nuseWebDefaults

        public static void nuseWebDefaults​(long struct,
                                           boolean value)
        Unsafe version of useWebDefaults.
      • nmeasure_withContext

        public static void nmeasure_withContext​(long struct,
                                                long value)
        Unsafe version of measure_withContext.
      • nbaseline_withContext

        public static void nbaseline_withContext​(long struct,
                                                 long value)
        Unsafe version of baseline_withContext.
      • nprint_noContext

        public static void nprint_noContext​(long struct,
                                            @Nullable
                                            YGPrintFuncI value)
        Unsafe version of print_noContext.
      • nprint_withContext

        public static void nprint_withContext​(long struct,
                                              long value)
        Unsafe version of print_withContext.
      • ndirtied

        public static void ndirtied​(long struct,
                                    @Nullable
                                    YGDirtiedFuncI value)
        Unsafe version of dirtied.
      • nstyle

        public static void nstyle​(long struct,
                                  YGStyle value)
        Unsafe version of style.
      • nlayout

        public static void nlayout​(long struct,
                                   YGLayout value)
        Unsafe version of layout.
      • nlineIndex

        public static void nlineIndex​(long struct,
                                      int value)
        Unsafe version of lineIndex.
      • nowner

        public static void nowner​(long struct,
                                  long value)
        Unsafe version of owner.
      • nchildren

        public static void nchildren​(long struct,
                                     long value)
      • nconfig

        public static void nconfig​(long struct,
                                   long value)
        Unsafe version of config.
      • nresolvedDimensions

        public static void nresolvedDimensions​(long struct,
                                               int index,
                                               YGValue value)
        Unsafe version of resolvedDimensions.