Class NkStyleItem

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkStyleItem extends Struct<NkStyleItem> implements NativeResource

 struct nk_style_item {
     enum nk_style_item_type type;
     union nk_style_item_data data;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • TYPE

      public static final int TYPE
      The struct member offsets.
    • DATA

      public static final int DATA
      The struct member offsets.
  • Constructor Details

    • NkStyleItem

      public NkStyleItem(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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<NkStyleItem>
    • type

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

      public NkStyleItemData data()
      Returns:
      a NkStyleItemData view of the data field.
    • type

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

      public NkStyleItem data(NkStyleItemData value)
      Copies the specified NkStyleItemData to the data field.
    • data

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

      public NkStyleItem set(int type, NkStyleItemData data)
      Initializes this struct with the specified values.
    • 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

      public static @Nullable 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

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

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

      public static NkStyleItem calloc(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
    • malloc

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

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

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

      public static NkStyleItemData ndata(long struct)
      Unsafe version of data().
    • 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.