Class NkClipboard

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkClipboard extends Struct<NkClipboard> implements NativeResource

 struct nk_clipboard {
     nk_handle userdata;
     nk_plugin_paste paste;
     nk_plugin_copy copy;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int USERDATA
      The struct member offsets.
    • PASTE

      public static final int PASTE
      The struct member offsets.
    • COPY

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

    • NkClipboard

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

      public NkHandle userdata()
      Returns:
      a NkHandle view of the userdata field.
    • paste

      public @Nullable NkPluginPaste paste()
      Returns:
      the value of the paste field.
    • copy

      public @Nullable NkPluginCopy copy()
      Returns:
      the value of the copy field.
    • userdata

      public NkClipboard userdata(NkHandle value)
      Copies the specified NkHandle to the userdata field.
    • userdata

      public NkClipboard userdata(Consumer<NkHandle> consumer)
      Passes the userdata field to the specified Consumer.
    • paste

      public NkClipboard paste(@Nullable NkPluginPasteI value)
      Sets the specified value to the paste field.
    • copy

      public NkClipboard copy(@Nullable NkPluginCopyI value)
      Sets the specified value to the copy field.
    • set

      public NkClipboard set(NkHandle userdata, NkPluginPasteI paste, NkPluginCopyI copy)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static NkHandle nuserdata(long struct)
      Unsafe version of userdata().
    • npaste

      public static @Nullable NkPluginPaste npaste(long struct)
      Unsafe version of paste().
    • ncopy

      public static @Nullable NkPluginCopy ncopy(long struct)
      Unsafe version of copy().
    • nuserdata

      public static void nuserdata(long struct, NkHandle value)
      Unsafe version of userdata.
    • npaste

      public static void npaste(long struct, @Nullable NkPluginPasteI value)
      Unsafe version of paste.
    • ncopy

      public static void ncopy(long struct, @Nullable NkPluginCopyI value)
      Unsafe version of copy.