Class NkStyleItem

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

    public class NkStyleItem
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Member documentation

    Layout

    
     struct nk_style_item {
         enum nk_style_item_type type;
         union nk_style_item_data data;
     }
    • 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()
        Specified by:
        sizeof in class org.lwjgl.system.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()
        Returns a new NkStyleItem instance allocated with BufferUtils.
      • 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.
      • malloc

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

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

        public static NkStyleItem.Buffer create​(int capacity)
        Returns a new NkStyleItem.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • 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​(org.lwjgl.system.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​(org.lwjgl.system.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
      • mallocStack

        public static NkStyleItem.Buffer mallocStack​(int capacity)
        Returns a new NkStyleItem.Buffer instance allocated on the thread-local MemoryStack.
        Parameters:
        capacity - the buffer capacity
      • 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
      • mallocStack

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

        public static NkStyleItem.Buffer callocStack​(int capacity,
                                                     org.lwjgl.system.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.