Class XErrorEvent

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class XErrorEvent extends Struct<XErrorEvent> implements NativeResource

 struct XErrorEvent {
     int type;
     Display * display;
     XID resourceid;
     unsigned long serial;
     unsigned char error_code;
     unsigned char request_code;
     unsigned char minor_code;
 }
  • 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.
    • DISPLAY

      public static final int DISPLAY
      The struct member offsets.
    • RESOURCEID

      public static final int RESOURCEID
      The struct member offsets.
    • SERIAL

      public static final int SERIAL
      The struct member offsets.
    • ERROR_CODE

      public static final int ERROR_CODE
      The struct member offsets.
    • REQUEST_CODE

      public static final int REQUEST_CODE
      The struct member offsets.
    • MINOR_CODE

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

    • XErrorEvent

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

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

      public long display()
      Returns:
      the value of the display field.
    • resourceid

      public long resourceid()
      Returns:
      the value of the resourceid field.
    • serial

      public long serial()
      Returns:
      the value of the serial field.
    • error_code

      public byte error_code()
      Returns:
      the value of the error_code field.
    • request_code

      public byte request_code()
      Returns:
      the value of the request_code field.
    • minor_code

      public byte minor_code()
      Returns:
      the value of the minor_code field.
    • type

      public XErrorEvent type(int value)
      Sets the specified value to the type field.
    • display

      public XErrorEvent display(long value)
      Sets the specified value to the display field.
    • resourceid

      public XErrorEvent resourceid(long value)
      Sets the specified value to the resourceid field.
    • serial

      public XErrorEvent serial(long value)
      Sets the specified value to the serial field.
    • error_code

      public XErrorEvent error_code(byte value)
      Sets the specified value to the error_code field.
    • request_code

      public XErrorEvent request_code(byte value)
      Sets the specified value to the request_code field.
    • minor_code

      public XErrorEvent minor_code(byte value)
      Sets the specified value to the minor_code field.
    • set

      public XErrorEvent set(int type, long display, long resourceid, long serial, byte error_code, byte request_code, byte minor_code)
      Initializes this struct with the specified values.
    • set

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      public static long ndisplay(long struct)
      Unsafe version of display().
    • nresourceid

      public static long nresourceid(long struct)
      Unsafe version of resourceid().
    • nserial

      public static long nserial(long struct)
      Unsafe version of serial().
    • nerror_code

      public static byte nerror_code(long struct)
      Unsafe version of error_code().
    • nrequest_code

      public static byte nrequest_code(long struct)
      Unsafe version of request_code().
    • nminor_code

      public static byte nminor_code(long struct)
      Unsafe version of minor_code().
    • ntype

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

      public static void ndisplay(long struct, long value)
      Unsafe version of display.
    • nresourceid

      public static void nresourceid(long struct, long value)
      Unsafe version of resourceid.
    • nserial

      public static void nserial(long struct, long value)
      Unsafe version of serial.
    • nerror_code

      public static void nerror_code(long struct, byte value)
      Unsafe version of error_code.
    • nrequest_code

      public static void nrequest_code(long struct, byte value)
      Unsafe version of request_code.
    • nminor_code

      public static void nminor_code(long struct, byte value)
      Unsafe version of minor_code.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate