Class XButtonEvent

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

    public class XButtonEvent
    extends Struct
    implements NativeResource
    Button event.

    Member documentation

    • type – the event type. One of:
      X11.ButtonPressX11.ButtonRelease
    • serial – # of last request processed by server
    • send_event – true if this came from an X11.XSendEvent(long, long, boolean, long, org.lwjgl.system.linux.XEvent) request
    • displayDisplay the event was read from
    • window – window it reported relative to
    • root – root window that the event occurred on
    • subwindow – child window
    • time – milliseconds
    • x – pointer x coordinate in event window
    • y – pointer y coordinate in event window
    • x_root – x coordinate relative to root
    • y_root – y coordinate relative to root
    • state – button mask
    • button – detail
    • same_screen – same screen flag

    Layout

    
     struct XButtonEvent {
         int type;
         unsigned long serial;
         Bool send_event;
         Display * display;
         Window window;
         Window root;
         Window subwindow;
         Time time;
         int x;
         int y;
         int x_root;
         int y_root;
         unsigned int state;
         unsigned int button;
         Bool same_screen;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • TYPE, SERIAL, SEND_EVENT, DISPLAY, WINDOW, ROOT, SUBWINDOW, TIME, X, Y, X_ROOT, Y_ROOT, STATE, BUTTON, SAME_SCREEN

        The struct member offsets.
    • Constructor Detail

      • XButtonEvent

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

        public long root()
        Returns the value of the root field.
      • subwindow

        public long subwindow()
        Returns the value of the subwindow field.
      • time

        public long time()
        Returns the value of the time field.
      • x

        public int x()
        Returns the value of the x field.
      • y

        public int y()
        Returns the value of the y field.
      • x_root

        public int x_root()
        Returns the value of the x_root field.
      • y_root

        public int y_root()
        Returns the value of the y_root field.
      • state

        public int state()
        Returns the value of the state field.
      • button

        public int button()
        Returns the value of the button field.
      • same_screen

        public boolean same_screen()
        Returns the value of the same_screen field.
      • type

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

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

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

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

        public XButtonEvent window​(long value)
        Sets the specified value to the window field.
      • root

        public XButtonEvent root​(long value)
        Sets the specified value to the root field.
      • subwindow

        public XButtonEvent subwindow​(long value)
        Sets the specified value to the subwindow field.
      • time

        public XButtonEvent time​(long value)
        Sets the specified value to the time field.
      • x

        public XButtonEvent x​(int value)
        Sets the specified value to the x field.
      • y

        public XButtonEvent y​(int value)
        Sets the specified value to the y field.
      • x_root

        public XButtonEvent x_root​(int value)
        Sets the specified value to the x_root field.
      • y_root

        public XButtonEvent y_root​(int value)
        Sets the specified value to the y_root field.
      • state

        public XButtonEvent state​(int value)
        Sets the specified value to the state field.
      • button

        public XButtonEvent button​(int value)
        Sets the specified value to the button field.
      • same_screen

        public XButtonEvent same_screen​(boolean value)
        Sets the specified value to the same_screen field.
      • set

        public XButtonEvent set​(int type,
                                long serial,
                                boolean send_event,
                                long display,
                                long window,
                                long root,
                                long subwindow,
                                long time,
                                int x,
                                int y,
                                int x_root,
                                int y_root,
                                int state,
                                int button,
                                boolean same_screen)
        Initializes this struct with the specified values.
      • set

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

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

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

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

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

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

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

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

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

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

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

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

        public static XButtonEvent.Buffer callocStack​(int capacity,
                                                      MemoryStack stack)
        Returns a new XButtonEvent.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().
      • 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().
      • nroot

        public static long nroot​(long struct)
        Unsafe version of root().
      • nsubwindow

        public static long nsubwindow​(long struct)
        Unsafe version of subwindow().
      • ntime

        public static long ntime​(long struct)
        Unsafe version of time().
      • nx

        public static int nx​(long struct)
        Unsafe version of x().
      • ny

        public static int ny​(long struct)
        Unsafe version of y().
      • nx_root

        public static int nx_root​(long struct)
        Unsafe version of x_root().
      • ny_root

        public static int ny_root​(long struct)
        Unsafe version of y_root().
      • nstate

        public static int nstate​(long struct)
        Unsafe version of state().
      • nbutton

        public static int nbutton​(long struct)
        Unsafe version of button().
      • nsame_screen

        public static int nsame_screen​(long struct)
        Unsafe version of same_screen().
      • 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.
      • nroot

        public static void nroot​(long struct,
                                 long value)
        Unsafe version of root.
      • nsubwindow

        public static void nsubwindow​(long struct,
                                      long value)
        Unsafe version of subwindow.
      • ntime

        public static void ntime​(long struct,
                                 long value)
        Unsafe version of time.
      • nx

        public static void nx​(long struct,
                              int value)
        Unsafe version of x.
      • ny

        public static void ny​(long struct,
                              int value)
        Unsafe version of y.
      • nx_root

        public static void nx_root​(long struct,
                                   int value)
        Unsafe version of x_root.
      • ny_root

        public static void ny_root​(long struct,
                                   int value)
        Unsafe version of y_root.
      • nstate

        public static void nstate​(long struct,
                                  int value)
        Unsafe version of state.
      • nbutton

        public static void nbutton​(long struct,
                                   int value)
        Unsafe version of button.
      • nsame_screen

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