Class XErrorEvent

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class XErrorEvent
    extends Struct
    implements NativeResource
    Error event.

    Member documentation

    • display – display the event was read from
    • resourceid – resource id
    • serial – serial number of failed request
    • error_code – error code of failed request
    • request_code – major op-code of failed request
    • minor_code – minor op-code of failed request

    Layout

    
     struct XErrorEvent {
         int type;
         Display * display;
         XID resourceid;
         unsigned long serial;
         unsigned char error_code;
         unsigned char request_code;
         unsigned char minor_code;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, DISPLAY, RESOURCEID, SERIAL, ERROR_CODE, REQUEST_CODE, MINOR_CODE

        The struct member offsets.
    • Constructor Detail

      • XErrorEvent

        public XErrorEvent​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • 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​(long address)
        Returns a new XErrorEvent instance for the specified memory address.
      • createSafe

        @Nullable
        public static XErrorEvent createSafe​(long address)
        Like create, but returns null if address is NULL.
      • 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

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

        public static XErrorEvent mallocStack()
        Returns a new XErrorEvent instance allocated on the thread-local MemoryStack.
      • callocStack

        public static XErrorEvent callocStack()
        Returns a new XErrorEvent instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

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

        public static XErrorEvent callocStack​(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
      • callocStack

        public static XErrorEvent.Buffer callocStack​(int capacity)
        Returns a new XErrorEvent.Buffer instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
        Parameters:
        capacity - the buffer capacity
      • callocStack

        public static XErrorEvent.Buffer callocStack​(int capacity,
                                                     MemoryStack stack)
        Returns a new XErrorEvent.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • 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
      • validate

        public static void validate​(long array,
                                    int count)
        Calls validate(long) for each struct contained in the specified struct array.
        Parameters:
        array - the struct array to validate
        count - the number of structs in array