Class NkTextEdit

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class NkTextEdit extends Struct<NkTextEdit> implements NativeResource

Layout


 struct nk_text_edit {
     struct nk_clipboard clip;
     struct nk_str string;
     nk_plugin_filter filter;
     struct nk_vec2 scrollbar;
     int cursor;
     int select_start;
     int select_end;
     unsigned char mode;
     bool cursor_at_end_of_line;
     bool initialized;
     bool has_preferred_x;
     bool single_line;
     bool active;
     char[1];
     float preferred_x;
     struct nk_text_undo_state undo;
 }
  • Field Details

    • SIZEOF

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

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

      public static final int CLIP
      The struct member offsets.
    • STRING

      public static final int STRING
      The struct member offsets.
    • FILTER

      public static final int FILTER
      The struct member offsets.
    • SCROLLBAR

      public static final int SCROLLBAR
      The struct member offsets.
    • CURSOR

      public static final int CURSOR
      The struct member offsets.
    • SELECT_START

      public static final int SELECT_START
      The struct member offsets.
    • SELECT_END

      public static final int SELECT_END
      The struct member offsets.
    • MODE

      public static final int MODE
      The struct member offsets.
    • CURSOR_AT_END_OF_LINE

      public static final int CURSOR_AT_END_OF_LINE
      The struct member offsets.
    • INITIALIZED

      public static final int INITIALIZED
      The struct member offsets.
    • HAS_PREFERRED_X

      public static final int HAS_PREFERRED_X
      The struct member offsets.
    • SINGLE_LINE

      public static final int SINGLE_LINE
      The struct member offsets.
    • ACTIVE

      public static final int ACTIVE
      The struct member offsets.
    • PREFERRED_X

      public static final int PREFERRED_X
      The struct member offsets.
    • UNDO

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

    • NkTextEdit

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

      public NkClipboard clip()
      Returns:
      a NkClipboard view of the clip field.
    • string

      public NkStr string()
      Returns:
      a NkStr view of the string field.
    • filter

      @Nullable public NkPluginFilter filter()
      Returns:
      the value of the filter field.
    • scrollbar

      public NkVec2 scrollbar()
      Returns:
      a NkVec2 view of the scrollbar field.
    • cursor

      public int cursor()
      Returns:
      the value of the cursor field.
    • select_start

      public int select_start()
      Returns:
      the value of the select_start field.
    • select_end

      public int select_end()
      Returns:
      the value of the select_end field.
    • mode

      public byte mode()
      Returns:
      the value of the mode field.
    • cursor_at_end_of_line

      public boolean cursor_at_end_of_line()
      Returns:
      the value of the cursor_at_end_of_line field.
    • initialized

      public boolean initialized()
      Returns:
      the value of the initialized field.
    • has_preferred_x

      public boolean has_preferred_x()
      Returns:
      the value of the has_preferred_x field.
    • single_line

      public boolean single_line()
      Returns:
      the value of the single_line field.
    • active

      public boolean active()
      Returns:
      the value of the active field.
    • preferred_x

      public float preferred_x()
      Returns:
      the value of the preferred_x field.
    • undo

      public NkTextUndoState undo()
      Returns:
      a NkTextUndoState view of the undo field.
    • malloc

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static NkTextEdit mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NkTextEdit callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkTextEdit mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static NkTextEdit callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkTextEdit.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NkTextEdit.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static NkTextEdit.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static NkTextEdit.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

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

      public static NkClipboard nclip(long struct)
      Unsafe version of clip().
    • nstring

      public static NkStr nstring(long struct)
      Unsafe version of string().
    • nfilter

      @Nullable public static NkPluginFilter nfilter(long struct)
      Unsafe version of filter().
    • nscrollbar

      public static NkVec2 nscrollbar(long struct)
      Unsafe version of scrollbar().
    • ncursor

      public static int ncursor(long struct)
      Unsafe version of cursor().
    • nselect_start

      public static int nselect_start(long struct)
      Unsafe version of select_start().
    • nselect_end

      public static int nselect_end(long struct)
      Unsafe version of select_end().
    • nmode

      public static byte nmode(long struct)
      Unsafe version of mode().
    • ncursor_at_end_of_line

      public static boolean ncursor_at_end_of_line(long struct)
      Unsafe version of cursor_at_end_of_line().
    • ninitialized

      public static boolean ninitialized(long struct)
      Unsafe version of initialized().
    • nhas_preferred_x

      public static boolean nhas_preferred_x(long struct)
      Unsafe version of has_preferred_x().
    • nsingle_line

      public static boolean nsingle_line(long struct)
      Unsafe version of single_line().
    • nactive

      public static boolean nactive(long struct)
      Unsafe version of active().
    • npreferred_x

      public static float npreferred_x(long struct)
      Unsafe version of preferred_x().
    • nundo

      public static NkTextUndoState nundo(long struct)
      Unsafe version of undo().