Class YGNode

    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • CONTEXT, PRINT, HASNEWLAYOUT, NODETYPE, MEASURE, BASELINE, DIRTIED, STYLE, LAYOUT, LINEINDEX, OWNER, CHILDREN, NEXTCHILD, CONFIG, ISDIRTY, 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.
      • print

        @Nullable
        public YGPrintFunc print()
        Returns the value of the print field.
      • hasNewLayout

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

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

        @Nullable
        public YGMeasureFunc measure()
        Returns the value of the measure field.
      • baseline

        @Nullable
        public YGBaselineFunc baseline()
        Returns the value of the baseline 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.
      • children

        public long children()
        Returns the value of the children field.
      • nextChild

        @Nullable
        public YGNode nextChild()
        Returns a YGNode view of the struct pointed to by the nextChild field.
      • config

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

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

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

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

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

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

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

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

        public YGNode baseline​(@Nullable
                               YGBaselineFuncI value)
        Sets the specified value to the baseline 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.
      • children

        public YGNode children​(long value)
        Sets the specified value to the children field.
      • nextChild

        public YGNode nextChild​(@Nullable
                                YGNode value)
        Sets the address of the specified YGNode to the nextChild field.
      • config

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

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

        public YGNode resolvedDimensions​(int index,
                                         YGValue value)
        Copies the address of the specified YGValue at the specified index of the resolvedDimensions field.
      • 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​(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().
      • nprint

        @Nullable
        public static YGPrintFunc nprint​(long struct)
        Unsafe version of print().
      • nhasNewLayout

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

        public static int nnodeType​(long struct)
        Unsafe version of nodeType().
      • 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)
        Unsafe version of children().
      • nnextChild

        @Nullable
        public static YGNode nnextChild​(long struct)
        Unsafe version of nextChild().
      • nconfig

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

        public static boolean nisDirty​(long struct)
        Unsafe version of isDirty().
      • 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.
      • nprint

        public static void nprint​(long struct,
                                  @Nullable
                                  YGPrintFuncI value)
        Unsafe version of print.
      • nhasNewLayout

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

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

        public static void nmeasure​(long struct,
                                    @Nullable
                                    YGMeasureFuncI value)
        Unsafe version of measure.
      • nbaseline

        public static void nbaseline​(long struct,
                                     @Nullable
                                     YGBaselineFuncI value)
        Unsafe version of baseline.
      • 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)
        Unsafe version of children.
      • nnextChild

        public static void nnextChild​(long struct,
                                      @Nullable
                                      YGNode value)
        Unsafe version of nextChild.
      • nconfig

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

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

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

        public static void validate​(long struct)
        Validates pointer members that should not be NULL.
        Parameters:
        struct - the struct to validate
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array