Class NkStyleItemData

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

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

    Layout

    
     union nk_style_item_data {
         struct nk_image image;
         struct nk_color color;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • IMAGE, COLOR

        The struct member offsets.
    • Constructor Detail

      • NkStyleItemData

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

        public NkImage image()
        Returns a NkImage view of the image field.
      • color

        public NkColor color()
        Returns a NkColor view of the color field.
      • image

        public NkStyleItemData image​(java.util.function.Consumer<NkImage> consumer)
        Passes the image field to the specified Consumer.
      • color

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        public static NkStyleItemData.Buffer callocStack​(int capacity,
                                                         org.lwjgl.system.MemoryStack stack)
        Returns a new NkStyleItemData.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
      • nimage

        public static NkImage nimage​(long struct)
        Unsafe version of image().
      • ncolor

        public static NkColor ncolor​(long struct)
        Unsafe version of color().
      • nimage

        public static void nimage​(long struct,
                                  NkImage value)
        Unsafe version of image.
      • ncolor

        public static void ncolor​(long struct,
                                  NkColor value)
        Unsafe version of color.