Class NkStyleItem

    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, DATA

        The struct member offsets.
    • Constructor Detail

      • NkStyleItem

        public NkStyleItem​(java.nio.ByteBuffer container)
        Creates a NkStyleItem 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
      • type

        public int type()
        Returns the value of the type field.
      • type

        public NkStyleItem type​(int value)
        Sets the specified value to the type field.
      • data

        public NkStyleItem data​(java.util.function.Consumer<NkStyleItemData> consumer)
        Passes the data field to the specified Consumer.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

        public static NkStyleItem.Buffer callocStack​(int capacity,
                                                     MemoryStack stack)
        Returns a new NkStyleItem.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
      • ntype

        public static int ntype​(long struct)
        Unsafe version of type().
      • ntype

        public static void ntype​(long struct,
                                 int value)
        Unsafe version of type.
      • ndata

        public static void ndata​(long struct,
                                 NkStyleItemData value)
        Unsafe version of data.