45e9809aff7304721fddb95654901b32195c9c7avboxsync * Copyright © 2009 Red Hat, Inc.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Permission is hereby granted, free of charge, to any person obtaining a
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copy of this software and associated documentation files (the "Software"),
45e9809aff7304721fddb95654901b32195c9c7avboxsync * to deal in the Software without restriction, including without limitation
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the rights to use, copy, modify, merge, publish, distribute, sublicense,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * and/or sell copies of the Software, and to permit persons to whom the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Software is furnished to do so, subject to the following conditions:
45e9809aff7304721fddb95654901b32195c9c7avboxsync * The above copyright notice and this permission notice (including the next
45e9809aff7304721fddb95654901b32195c9c7avboxsync * paragraph) shall be included in all copies or substantial portions of the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Software.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
45e9809aff7304721fddb95654901b32195c9c7avboxsync * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
45e9809aff7304721fddb95654901b32195c9c7avboxsync * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
45e9809aff7304721fddb95654901b32195c9c7avboxsync * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
45e9809aff7304721fddb95654901b32195c9c7avboxsync * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DEALINGS IN THE SOFTWARE.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * This file describes the event structures used internally by the X
45e9809aff7304721fddb95654901b32195c9c7avboxsync * server during event generation and event processing.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * When are internal events used?
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Events from input devices are stored as internal events in the EQ and
45e9809aff7304721fddb95654901b32195c9c7avboxsync * processed as internal events until late in the processing cycle. Only then
45e9809aff7304721fddb95654901b32195c9c7avboxsync * do they switch to their respective wire events.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Event types. Used exclusively internal to the server, not visible on the
45e9809aff7304721fddb95654901b32195c9c7avboxsync * protocol.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Note: Keep KeyPress to Motion aligned with the core events.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Keep ET_Raw* in the same order as KeyPress - Motion
45e9809aff7304721fddb95654901b32195c9c7avboxsync#define CHECKEVENT(ev) if (ev && ((InternalEvent*)(ev))->any.header != 0xFF) \
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Used for ALL input device events internal in the server until
45e9809aff7304721fddb95654901b32195c9c7avboxsync * copied into the matching protocol event.
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Note: We only use the device id because the DeviceIntPtr may become invalid while
45e9809aff7304721fddb95654901b32195c9c7avboxsync * the event is in the EQ.
45e9809aff7304721fddb95654901b32195c9c7avboxsync int deviceid; /**< Device to post this event for */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint16_t root_x; /**< Pos relative to root window in integral data */
45e9809aff7304721fddb95654901b32195c9c7avboxsync float root_x_frac; /**< Pos relative to root window in frac part */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint16_t root_y; /**< Pos relative to root window in integral part */
45e9809aff7304721fddb95654901b32195c9c7avboxsync float root_y_frac; /**< Pos relative to root window in frac part */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint8_t buttons[(MAX_BUTTONS + 7)/8]; /**< Button mask */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint8_t mode[(MAX_VALUATORS + 7)/8]; /**< Valuator mode (Abs or Rel)*/
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint32_t data[MAX_VALUATORS]; /**< Valuator data */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int corestate; /**< Core key/button state BEFORE the event */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int key_repeat; /**< Internally-generated key repeat event */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Flags used in DeviceChangedEvent to signal if the slave has changed */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* Flags used in DeviceChangedEvent to signal whether the event was a
45e9809aff7304721fddb95654901b32195c9c7avboxsync * pointer event or a keyboard event */
45e9809aff7304721fddb95654901b32195c9c7avboxsync/* device capabilities changed */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Sent whenever a device's capabilities have changed.
45e9809aff7304721fddb95654901b32195c9c7avboxsync int deviceid; /**< Device whose capabilities have changed */
45e9809aff7304721fddb95654901b32195c9c7avboxsync ::POINTER_EVENT, ::KEYBOARD_EVENT */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int sourceid; /**< The device that caused the change */
45e9809aff7304721fddb95654901b32195c9c7avboxsync /* FIXME: frac parts of min/max */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * DGAEvent, used by DGA to intercept and emulate input events.
45e9809aff7304721fddb95654901b32195c9c7avboxsync int subtype; /**< KeyPress, KeyRelease, ButtonPress,
45e9809aff7304721fddb95654901b32195c9c7avboxsync ButtonRelease, MotionNotify */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int screen; /**< Screen number this event applies to */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Raw event, contains the data as posted by the device.
45e9809aff7304721fddb95654901b32195c9c7avboxsync int deviceid; /**< Device to post this event for */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint8_t mask[(MAX_VALUATORS + 7)/8]; /**< Valuator mask */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int32_t data_frac[MAX_VALUATORS]; /**< Fractional part for data */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int32_t data_raw[MAX_VALUATORS]; /**< Valuator data as posted */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int32_t data_raw_frac[MAX_VALUATORS];/**< Fractional part for data_raw */
45e9809aff7304721fddb95654901b32195c9c7avboxsync int subtype; /**< Subtype defined by XQuartz DDX */
45e9809aff7304721fddb95654901b32195c9c7avboxsync uint32_t data[XQUARTZ_EVENT_MAXARGS]; /**< Up to 5 32bit values passed to handler */
45e9809aff7304721fddb95654901b32195c9c7avboxsync * Event type used inside the X server for input event
45e9809aff7304721fddb95654901b32195c9c7avboxsync * processing.