Class XClientMessageEvent

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

    public class XClientMessageEvent
    extends Struct
    implements NativeResource
    Client message event.

    The message_type member is set to an atom that indicates how the data should be interpreted by the receiving client. The format member is set to 8, 16, or 32 and specifies whether the data should be viewed as a list of bytes, shorts, or longs. The data member is a union that contains the members b, s, and l. The b, s, and l members represent data of twenty 8-bit values, ten 16-bit values, and five 32-bit values. Particular message types might not make use of all these values. The X server places no interpretation on the values in the window, message_type, or data members.

    Member documentation

    Layout

    
     struct XClientMessageEvent {
         int type;
         unsigned long serial;
         Bool send_event;
         Display * display;
         Window window;
         Atom message_type;
         int format;
         struct {
             char b[20];
             short s[10];
             long l[5];
         } data;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, SERIAL, SEND_EVENT, DISPLAY, WINDOW, MESSAGE_TYPE, FORMAT, DATA, DATA_B, DATA_S, DATA_L

        The struct member offsets.
    • Constructor Detail

      • XClientMessageEvent

        public XClientMessageEvent​(java.nio.ByteBuffer container)
        Creates a XClientMessageEvent 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.
      • serial

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

        public boolean send_event()
        Returns the value of the send_event field.
      • display

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

        public long window()
        Returns the value of the window field.
      • message_type

        public long message_type()
        Returns the value of the message_type field.
      • format

        public int format()
        Returns the value of the format field.
      • data_b

        public java.nio.ByteBuffer data_b()
        Returns a ByteBuffer view of the data.b field.
      • data_b

        public byte data_b​(int index)
        Returns the value at the specified index of the data.b field.
      • data_s

        public java.nio.ShortBuffer data_s()
        Returns a ShortBuffer view of the data.s field.
      • data_s

        public short data_s​(int index)
        Returns the value at the specified index of the data.s field.
      • data_l

        public long data_l​(int index)
        Returns the value at the specified index of the data.l field.
      • type

        public XClientMessageEvent type​(int value)
        Sets the specified value to the type field.
      • serial

        public XClientMessageEvent serial​(long value)
        Sets the specified value to the serial field.
      • send_event

        public XClientMessageEvent send_event​(boolean value)
        Sets the specified value to the send_event field.
      • display

        public XClientMessageEvent display​(long value)
        Sets the specified value to the display field.
      • window

        public XClientMessageEvent window​(long value)
        Sets the specified value to the window field.
      • message_type

        public XClientMessageEvent message_type​(long value)
        Sets the specified value to the message_type field.
      • format

        public XClientMessageEvent format​(int value)
        Sets the specified value to the format field.
      • data_b

        public XClientMessageEvent data_b​(java.nio.ByteBuffer value)
        Copies the specified ByteBuffer to the data.b field.
      • data_b

        public XClientMessageEvent data_b​(int index,
                                          byte value)
        Sets the specified value at the specified index of the data.b field.
      • data_s

        public XClientMessageEvent data_s​(java.nio.ShortBuffer value)
        Copies the specified ShortBuffer to the data.s field.
      • data_s

        public XClientMessageEvent data_s​(int index,
                                          short value)
        Sets the specified value at the specified index of the data.s field.
      • data_l

        public XClientMessageEvent data_l​(int index,
                                          long value)
        Sets the specified value at the specified index of the data.l field.
      • set

        public XClientMessageEvent set​(int type,
                                       long serial,
                                       boolean send_event,
                                       long display,
                                       long window,
                                       long message_type,
                                       int format,
                                       java.nio.ByteBuffer data_b,
                                       java.nio.ShortBuffer data_s,
                                       CLongBuffer data_l)
        Initializes this struct with the specified values.
      • malloc

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

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

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

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

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

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

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

        public static int ntype​(long struct)
        Unsafe version of type().
      • nserial

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

        public static int nsend_event​(long struct)
        Unsafe version of send_event().
      • ndisplay

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

        public static long nwindow​(long struct)
        Unsafe version of window().
      • nmessage_type

        public static long nmessage_type​(long struct)
        Unsafe version of message_type().
      • nformat

        public static int nformat​(long struct)
        Unsafe version of format().
      • ndata_b

        public static java.nio.ByteBuffer ndata_b​(long struct)
        Unsafe version of data_b().
      • ndata_b

        public static byte ndata_b​(long struct,
                                   int index)
        Unsafe version of data_b.
      • ndata_s

        public static java.nio.ShortBuffer ndata_s​(long struct)
        Unsafe version of data_s().
      • ndata_s

        public static short ndata_s​(long struct,
                                    int index)
        Unsafe version of data_s.
      • ndata_l

        public static long ndata_l​(long struct,
                                   int index)
        Unsafe version of data_l.
      • ntype

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

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

        public static void nsend_event​(long struct,
                                       int value)
        Unsafe version of send_event.
      • ndisplay

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

        public static void nwindow​(long struct,
                                   long value)
        Unsafe version of window.
      • nmessage_type

        public static void nmessage_type​(long struct,
                                         long value)
        Unsafe version of message_type.
      • nformat

        public static void nformat​(long struct,
                                   int value)
        Unsafe version of format.
      • ndata_b

        public static void ndata_b​(long struct,
                                   java.nio.ByteBuffer value)
        Unsafe version of data_b.
      • ndata_b

        public static void ndata_b​(long struct,
                                   int index,
                                   byte value)
        Unsafe version of data_b.
      • ndata_s

        public static void ndata_s​(long struct,
                                   java.nio.ShortBuffer value)
        Unsafe version of data_s.
      • ndata_s

        public static void ndata_s​(long struct,
                                   int index,
                                   short value)
        Unsafe version of data_s.
      • ndata_l

        public static void ndata_l​(long struct,
                                   CLongBuffer value)
        Unsafe version of data_l.
      • ndata_l

        public static void ndata_l​(long struct,
                                   int index,
                                   long value)
        Unsafe version of data_l.
      • 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