Package org.lwjgl.sdl

Class SDL_TextInputEvent

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class SDL_TextInputEvent extends Struct<SDL_TextInputEvent> implements NativeResource

 struct SDL_TextInputEvent {
     SDL_EventType type;
     Uint32 reserved;
     Uint64 timestamp;
     SDL_WindowID windowID;
     char const * text;
 }
  • 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.
    • RESERVED

      public static final int RESERVED
      The struct member offsets.
    • TIMESTAMP

      public static final int TIMESTAMP
      The struct member offsets.
    • WINDOWID

      public static final int WINDOWID
      The struct member offsets.
    • TEXT

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

    • SDL_TextInputEvent

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

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

      public long timestamp()
      Returns:
      the value of the timestamp field.
    • windowID

      public int windowID()
      Returns:
      the value of the windowID field.
    • text

      public @Nullable ByteBuffer text()
      Returns:
      a ByteBuffer view of the null-terminated string pointed to by the text field.
    • textString

      public @Nullable String textString()
      Returns:
      the null-terminated string pointed to by the text field.
    • type

      public SDL_TextInputEvent type(int value)
      Sets the specified value to the type field.
    • timestamp

      public SDL_TextInputEvent timestamp(long value)
      Sets the specified value to the timestamp field.
    • windowID

      public SDL_TextInputEvent windowID(int value)
      Sets the specified value to the windowID field.
    • text

      public SDL_TextInputEvent text(@Nullable ByteBuffer value)
      Sets the address of the specified encoded string to the text field.
    • set

      public SDL_TextInputEvent set(int type, long timestamp, int windowID, @Nullable ByteBuffer text)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static int nreserved(long struct)
    • ntimestamp

      public static long ntimestamp(long struct)
      Unsafe version of timestamp().
    • nwindowID

      public static int nwindowID(long struct)
      Unsafe version of windowID().
    • ntext

      public static @Nullable ByteBuffer ntext(long struct)
      Unsafe version of text().
    • ntextString

      public static @Nullable String ntextString(long struct)
      Unsafe version of textString().
    • ntype

      public static void ntype(long struct, int value)
      Unsafe version of type.
    • nreserved

      public static void nreserved(long struct, int value)
    • ntimestamp

      public static void ntimestamp(long struct, long value)
      Unsafe version of timestamp.
    • nwindowID

      public static void nwindowID(long struct, int value)
      Unsafe version of windowID.
    • ntext

      public static void ntext(long struct, @Nullable ByteBuffer value)
      Unsafe version of text.