Class NkNineSlice

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkNineSlice extends Struct<NkNineSlice> implements NativeResource

 struct nk_nine_slice {
     {@link NkImage struct nk_image} img;
     nk_ushort l;
     nk_ushort t;
     nk_ushort r;
     nk_ushort b;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int IMG
      The struct member offsets.
    • L

      public static final int L
      The struct member offsets.
    • T

      public static final int T
      The struct member offsets.
    • R

      public static final int R
      The struct member offsets.
    • B

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

    • NkNineSlice

      public NkNineSlice(ByteBuffer container)
      Creates a NkNineSlice 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<NkNineSlice>
    • img

      public NkImage img()
      Returns:
      a NkImage view of the img field.
    • l

      public short l()
      Returns:
      the value of the l field.
    • t

      public short t()
      Returns:
      the value of the t field.
    • r

      public short r()
      Returns:
      the value of the r field.
    • b

      public short b()
      Returns:
      the value of the b field.
    • img

      public NkNineSlice img(NkImage value)
      Copies the specified NkImage to the img field.
    • img

      public NkNineSlice img(Consumer<NkImage> consumer)
      Passes the img field to the specified Consumer.
    • l

      public NkNineSlice l(short value)
      Sets the specified value to the l field.
    • t

      public NkNineSlice t(short value)
      Sets the specified value to the t field.
    • r

      public NkNineSlice r(short value)
      Sets the specified value to the r field.
    • b

      public NkNineSlice b(short value)
      Sets the specified value to the b field.
    • set

      public NkNineSlice set(NkImage img, short l, short t, short r, short b)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

      public static NkNineSlice.Buffer create(int capacity)
      Returns a new NkNineSlice.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

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

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

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

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

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

      public static NkNineSlice.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new NkNineSlice.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
    • nimg

      public static NkImage nimg(long struct)
      Unsafe version of img().
    • nl

      public static short nl(long struct)
      Unsafe version of l().
    • nt

      public static short nt(long struct)
      Unsafe version of t().
    • nr

      public static short nr(long struct)
      Unsafe version of r().
    • nb

      public static short nb(long struct)
      Unsafe version of b().
    • nimg

      public static void nimg(long struct, NkImage value)
      Unsafe version of img.
    • nl

      public static void nl(long struct, short value)
      Unsafe version of l.
    • nt

      public static void nt(long struct, short value)
      Unsafe version of t.
    • nr

      public static void nr(long struct, short value)
      Unsafe version of r.
    • nb

      public static void nb(long struct, short value)
      Unsafe version of b.