diff options
Diffstat (limited to 'trapproto')
-rw-r--r-- | trapproto/.gitignore | 14 | ||||
-rw-r--r-- | trapproto/COPYING | 18 | ||||
-rw-r--r-- | trapproto/Makefile.am | 24 | ||||
-rw-r--r-- | trapproto/README | 6 | ||||
-rwxr-xr-x | trapproto/autogen.sh | 12 | ||||
-rw-r--r-- | trapproto/configure.ac | 12 | ||||
-rw-r--r-- | trapproto/trapproto.pc.in | 10 | ||||
-rw-r--r-- | trapproto/xtrapbits.h | 83 | ||||
-rw-r--r-- | trapproto/xtrapddmi.h | 115 | ||||
-rw-r--r-- | trapproto/xtrapdi.h | 501 | ||||
-rw-r--r-- | trapproto/xtrapemacros.h | 387 | ||||
-rw-r--r-- | trapproto/xtraplib.h | 133 | ||||
-rw-r--r-- | trapproto/xtraplibp.h | 151 | ||||
-rw-r--r-- | trapproto/xtrapproto.h | 168 |
14 files changed, 1634 insertions, 0 deletions
diff --git a/trapproto/.gitignore b/trapproto/.gitignore new file mode 100644 index 0000000..5335631 --- /dev/null +++ b/trapproto/.gitignore @@ -0,0 +1,14 @@ +Makefile +Makefile.in +aclocal.m4 +autom4te.cache +config.log +config.status +configure +install-sh +missing +trapproto.pc +*~ +trapproto-*.tar.* +ChangeLog +tags diff --git a/trapproto/COPYING b/trapproto/COPYING new file mode 100644 index 0000000..3ebeac6 --- /dev/null +++ b/trapproto/COPYING @@ -0,0 +1,18 @@ +Copyright 1987, 1988, 1989, 1990, 1994 by Digital Equipment Corporation, +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. diff --git a/trapproto/Makefile.am b/trapproto/Makefile.am new file mode 100644 index 0000000..dbd2c38 --- /dev/null +++ b/trapproto/Makefile.am @@ -0,0 +1,24 @@ +trapdir = $(includedir)/X11/extensions +trap_HEADERS = \ + xtrapbits.h \ + xtrapddmi.h \ + xtrapdi.h \ + xtrapemacros.h \ + xtraplib.h \ + xtraplibp.h \ + xtrapproto.h + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = trapproto.pc + +EXTRA_DIST = trapproto.pc.in + +EXTRA_DIST += ChangeLog +MAINTAINERCLEANFILES = ChangeLog + +.PHONY: ChangeLog + +ChangeLog: + $(CHANGELOG_CMD) + +dist-hook: ChangeLog diff --git a/trapproto/README b/trapproto/README new file mode 100644 index 0000000..73cf134 --- /dev/null +++ b/trapproto/README @@ -0,0 +1,6 @@ +This extension is considered obsolete and is no longer being maintained, +supported, or updated. + +Equivalent functionality is provided in the XTest & RECORD extensions, +as noted in: +http://lists.freedesktop.org/archives/xorg/2008-June/036131.html diff --git a/trapproto/autogen.sh b/trapproto/autogen.sh new file mode 100755 index 0000000..904cd67 --- /dev/null +++ b/trapproto/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" diff --git a/trapproto/configure.ac b/trapproto/configure.ac new file mode 100644 index 0000000..6b9b582 --- /dev/null +++ b/trapproto/configure.ac @@ -0,0 +1,12 @@ +AC_PREREQ([2.57]) +AC_INIT([TrapProto], [3.4.3], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) +AM_INIT_AUTOMAKE([foreign dist-bzip2]) + +# Require xorg-macros: XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) +XORG_RELEASE_VERSION +XORG_CHANGELOG + +AC_OUTPUT([Makefile + trapproto.pc]) diff --git a/trapproto/trapproto.pc.in b/trapproto/trapproto.pc.in new file mode 100644 index 0000000..563d720 --- /dev/null +++ b/trapproto/trapproto.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: TrapProto +Description: Trap extension headers +Version: @PACKAGE_VERSION@ +Requires: xt +Cflags: -I${includedir} diff --git a/trapproto/xtrapbits.h b/trapproto/xtrapbits.h new file mode 100644 index 0000000..1189dc7 --- /dev/null +++ b/trapproto/xtrapbits.h @@ -0,0 +1,83 @@ +/* $XFree86$ */ +/* + * This include file is designed to be a portable way for systems to define + * bit field manipulation of arrays of bits. + */ +#ifndef __XTRAPBITS__ +#define __XTRAPBITS__ "@(#)xtrapbits.h 1.6 - 90/09/18 " + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1994 by Digital Equipment Corporation, +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + */ +typedef unsigned char *UByteP; /* Pointer to an unsigned byte array */ +#define BitsInByte 8L /* The number of bits in a byte */ + +#define BitInByte(bit) /* Returns the bit mask of a byte */ \ + (1L << (((bit) % BitsInByte))) + +#define BitInWord(bit) /* Returns the bit mask of a word */ \ + (1L << (((bit) % (BitsInByte * 2L)))) + +#define BitInLong(bit) /* Returns the bit mask of a long */ \ + (1L << (((bit) % (BitsInByte * 4L)))) + +#define ByteInArray(array,bit) /* Returns the byte offset to get to a bit */ \ + (((UByteP)(array))[(bit) / BitsInByte]) + +#define BitIsTrue(array,bit) /* Test to see if a specific bit is True */ \ + (ByteInArray(array,bit) & BitInByte(bit)) + +#define BitIsFalse(array,bit) /* Test to see if a specific bit is False */ \ + (!(BitIsTrue(array,bit))) + +#define BitTrue(array,bit) /* Set a specific bit to be True */ \ + (ByteInArray(array,bit) |= BitInByte(bit)) + +#define BitFalse(array,bit) /* Set a specific bit to be False */ \ + (ByteInArray(array,bit) &= ~BitInByte(bit)) + +#define BitToggle(array,bit) /* Toggle a specific bit */ \ + (ByteInArray(array,bit) ^= BitInByte(bit)) + +#define BitCopy(dest,src,bit) /* Copy a specific bit */ \ + BitIsTrue((src),(bit)) ? BitTrue((dest),(bit)) : BitFalse((dest),(bit)) + +#define BitValue(array,bit) /* Return True or False depending on bit */ \ + (BitIsTrue((array),(bit)) ? True : False) + +#define BitSet(array,bit,value) /* Set bit to given value in array */ \ + (value) ? BitTrue((array),(bit)) : BitFalse((array),(bit)) + +#endif /* __XTRAPBITS__ */ diff --git a/trapproto/xtrapddmi.h b/trapproto/xtrapddmi.h new file mode 100644 index 0000000..c187a3a --- /dev/null +++ b/trapproto/xtrapddmi.h @@ -0,0 +1,115 @@ +/* $XFree86$ */ + +#ifndef __XTRAPDDMI__ +#define __XTRAPDDMI__ + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This header file is used by the XTrap server extension only + * (not used by clients or the XTrap Toolkit). Information + * contained herein should *not* be visible to clients (xtrapdi.h + * is used for this). The name is historical. + */ +#include <X11/X.h> +#include <X11/extensions/xtrapbits.h> +#include "dix.h" + +#ifndef MIN +# define MIN(a,b) ((a) < (b) ? (a) : (b)) +#endif +#ifndef MAX +# define MAX(a,b) ((a) > (b) ? (a) : (b)) +#endif + +#define XETrapNumEvents 1L /* constants used for AddExtension */ + +/* Other constants used within the extension code */ +#define XETrapMinRepSize 32L /* Minimum number of longs */ + +/* This structure will be globally declared to provide storage to hold + * the various extension wide configuration information. Allocated on + * a per-client basis. + */ +typedef struct +{ + ClientPtr client; /* Multi-client support and error handling */ + xXTrapGetCurReply cur; /* Struct of Miscellaneous state info */ + xXTrapGetStatsReply *stats; /* Pointer to stat's, malloc'd if requested */ + CARD32 last_input_time B32; /* last timestamp from input event */ + CARD16 protocol B16; /* current communication protocol */ +} XETrapEnv; + +#define XETrapSetHeaderEvent(phdr) ((phdr)->type = 0x1L) +#define XETrapSetHeaderRequest(phdr) ((phdr)->type = 0x2L) +#define XETrapSetHeaderSpecial(phdr) ((phdr)->type = 0x3L) +#define XETrapSetHeaderCursor(phdr) ((phdr)->type = 0x4L) +#define XETrapSetHeaderReply(phdr) ((phdr)->type = 0x5L) + +#ifndef vaxc +#define globaldef +#define globalref extern +#endif + +/* Extension platform identifier (conditionally defined) */ +#if ( defined (__osf__) && defined(__alpha) ) +# define XETrapPlatform PF_DECOSF1 +#endif +#ifdef ultrix +# define XETrapPlatform PF_DECUltrix +#endif +#ifdef vms +#ifdef VAXELN +# define XETrapPlatform PF_DECELN +#else +# define XETrapPlatform PF_DECVMS +#endif +#endif +#ifdef VT1000 +# define XETrapPlatform PF_DECVT1000 +#endif +#ifdef VXT +# define XETrapPlatform PF_DECXTerm +#endif +#ifdef PC +# define XETrapPlatform PF_IBMAT +#endif +#ifdef sun +# define XETrapPlatform PF_SunSparc +#endif +#ifndef XETrapPlatform +# define XETrapPlatform PF_Other +#endif /* XETrapPlatform */ + +#endif /* __XTRAPDDMI__ */ diff --git a/trapproto/xtrapdi.h b/trapproto/xtrapdi.h new file mode 100644 index 0000000..34aa94c --- /dev/null +++ b/trapproto/xtrapdi.h @@ -0,0 +1,501 @@ +/* $XFree86$ */ +#ifndef __XTRAPDI__ +#define __XTRAPDI__ + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991, 1992, 1994 by Digital Equipment Corp., +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This header file defines the common structures/constants + * between the XTrap extension and clients. All protocol + * definitions between XTrap extension/clients can be found + * here. + */ + +#define NEED_REPLIES +#define NEED_EVENTS +#include <X11/X.h> +#include <X11/Xmd.h> +#ifdef SMT +#define NEED_EVENTS +#define NEED_REPLIES +#endif +#include <X11/Xproto.h> +#include <X11/extensions/xtrapbits.h> +#define XTrapExtName "DEC-XTRAP" +/* Current Release, Version, and Revision of the XTrap Extension */ +#define XETrapRelease 3L +#define XETrapVersion 4L +#ifndef XETrapRevision /* Changed from the Makefile by users */ +# define XETrapRevision 0L +#endif /* XETrapRevision */ +#define XETrapProtocol 32L + +#ifndef SIZEOF +# ifdef __STDC__ +# define SIZEOF(x) sz_##x +# else +# define SIZEOF(x) sz_/**/x +# endif /* if ANSI C compiler else not */ +#endif +#ifndef sz_CARD32 +#define sz_CARD32 4L +#endif +#ifndef sz_CARD8 +#define sz_CARD8 1L +#endif +#ifndef True +# define True 1L +# define False 0L +#endif + +/* This is used as flags to indicate desired request traps + * Note: This has been padded to a CARD32 to keep structure aligned + */ +#define XETrapMaxRequest (((SIZEOF(CARD32)+((256L-1L) / \ + (BitsInByte*SIZEOF(CARD8))))/SIZEOF(CARD32))*SIZEOF(CARD32)) +typedef CARD8 ReqFlags[XETrapMaxRequest]; + +/* This is used as flags to indicate desired event traps + * Until events become *fully vectored*, we'll have to fake it + * by defining an array of 5 events (KeyPress, KeyRelease, + * ButtonPress, ButtonRelease, and MotionNotify. The extra 2 + * are required as the event types start with "2" (errors and + * replies are 0 & 1). The event type is the index into the + * bits. + * Note: This has been padded to a longword to keep structure aligned + */ +#ifndef VECTORED_EVENTS +#define XETrapCoreEvents (2L+5L) +#else +#define XETrapCoreEvents 128L +#endif +#define XETrapMaxEvent (((SIZEOF(CARD32)+((XETrapCoreEvents-1L) / \ + (BitsInByte*SIZEOF(CARD8))))/SIZEOF(CARD32))*SIZEOF(CARD32)) +typedef CARD8 EventFlags[XETrapMaxEvent]; + +/* This structure is used in a request to specify the types of + * configuration information that should be changed or updated. + */ +typedef struct +{ + CARD8 valid[4L]; /* Bits TRUE indicates data field is used */ + CARD8 data[4L]; /* Bits looked at if corresponding valid bit set */ + ReqFlags req; /* Bits coorespond to core requests */ + EventFlags event; /* Bits correspond to core events */ +} XETrapFlags; + +/* Bit definitions for the above XETrapFlags structure. */ +#define XETrapTimestamp 0L /* hdr timestamps desired */ +#define XETrapCmd 1L /* command key specified */ +#define XETrapCmdKeyMod 2L /* cmd key is a modifier */ +#define XETrapRequest 3L /* output requests array */ +#define XETrapEvent 4L /* future output events array */ +#define XETrapMaxPacket 5L /* Maximum packet length set */ +#define XETrapTransOut 6L /* obsolete */ +#define XETrapStatistics 7L /* collect counts on requests */ +#define XETrapWinXY 8L /* Fill in Window (X,Y) in hdr */ +#define XETrapTransIn 9L /* obsolete */ +#define XETrapCursor 10L /* Trap cursor state changes */ +#define XETrapXInput 11L /* Use XInput extension */ +#define XETrapVectorEvents 12L /* Use Vectored Events (128) */ +#define XETrapColorReplies 13L /* Return replies with Color Req's */ +#define XETrapGrabServer 14L /* Disables client GrabServers */ + +typedef struct /* used by XEConfigRequest */ +{ + XETrapFlags flags; /* Flags to specify what should be chg'd */ + CARD16 max_pkt_size B16; /* Maximum number of bytes in a packet */ + CARD8 cmd_key; /* Keyboard command_key (KeyCode) */ +/* + * cmd_key is intentionally *not* defined KeyCode since it's definition is + * ambiguous (int in Intrinsic.h and unsigned char in X.h. + */ + CARD8 pad[1L]; /* pad out to a quadword */ +} XETrapCfg; + +/* These structures are used within the Xtrap request structure for + * the various types of xtrap request + */ +#ifndef _XINPUT +/* (see the definition of XEvent as a reference) */ +typedef struct /* used by XESimulateXEventRequest for synthesizing core evts */ +{ + CARD8 type; /* (must be first) as in XEvent */ + CARD8 detail; /* Detail keycode/button as in XEvent */ + CARD8 screen; /* screen number (0 to n) */ + CARD8 pad; /* pad to longword */ + INT16 x B16; /* X & Y coord as in XEvent */ + INT16 y B16; +} XETrapInputReq; +#endif + +/* These are constants that refer to the extension request vector table. + * A request will use these values as minor opcodes. + */ +#define XETrap_Reset 0L /* set to steady state */ +#define XETrap_GetAvailable 1L /* get available funct from ext */ +#define XETrap_Config 2L /* configure extension */ +#define XETrap_StartTrap 3L /* use Trapping */ +#define XETrap_StopTrap 4L /* stop using Trapping */ +#define XETrap_GetCurrent 5L /* get current info from ext */ +#define XETrap_GetStatistics 6L /* get count statistics from ext */ +#ifndef _XINPUT +#define XETrap_SimulateXEvent 7L /* async input simulation */ +#endif +#define XETrap_GetVersion 8L /* Get (Just) Version */ +#define XETrap_GetLastInpTime 9L /* Get Timestamp of last client input */ + +/* The following are formats of a request to the XTRAP + * extension. The data-less XTrap requests all use xXTrapReq + */ +typedef struct +{ + CARD8 reqType; + CARD8 minor_opcode; + CARD16 length B16; + CARD32 pad B32; /* Maintain quadword alignment */ +} xXTrapReq; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapReq (sizeof(xXTrapReq)) +/* For retrieving version/available info (passes lib-side protocol number) */ +typedef struct +{ + CARD8 reqType; + CARD8 minor_opcode; + CARD16 length B16; + CARD16 protocol B16; /* The xtrap extension protocol number */ + CARD16 pad B16; /* Maintain quadword alignment */ +} xXTrapGetReq; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapGetReq (sizeof(xXTrapGetReq)) + +typedef struct +{ + CARD8 reqType; + CARD8 minor_opcode; + CARD16 length B16; + /* + * The follwing is done so that structure padding wont be + * a problem. The request structure contains a shadow for + * the XETrapCfg structure. Since the XETrapCfg also has a + * substructure (XETrapFlags) this structure is also shadowed. + * + * The following are a shadow of the XETrapFlags + * structure. + */ + CARD8 config_flags_valid[4L]; + CARD8 config_flags_data[4L]; + ReqFlags config_flags_req; + EventFlags config_flags_event; + /* End Shadow (XETrapFlags)*/ + CARD16 config_max_pkt_size B16; /* Max number of bytes in a packet */ + CARD8 config_cmd_key; /* Keyboard command_key (KeyCode) */ +/* + * cmd_key is intentionally *not* defined KeyCode since it's definition is + * ambiguous (int in Intrinsic.h and unsigned char in X.h. + */ + CARD8 config_pad[1L]; /* pad out to a quadword */ + /* End Shadow (XETrapCfg) */ + CARD32 pad B32; /* Maintain quadword alignment */ +} xXTrapConfigReq; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapConfigReq (sizeof(xXTrapConfigReq)) + +#ifndef _XINPUT +typedef struct +{ + CARD8 reqType; + CARD8 minor_opcode; + CARD16 length B16; + CARD32 pad B32; /* Maintain quadword alignment */ + XETrapInputReq input; +} xXTrapInputReq; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapInputReq (sizeof(xXTrapInputReq)) +#endif + + +/* The following structures are used by the server extension to send + * information and replies to the client. + */ + +/* header for all X replies */ +typedef struct +{ + CARD8 type; + CARD8 detail; + CARD16 sequenceNumber B16; + CARD32 length B32; +} XETrapRepHdr; + +/* Structure of Get Available Functionality reply */ +typedef struct +{ + CARD32 pf_ident B32; /* Contains constant identifying the platform */ + CARD16 xtrap_release B16; /* The xtrap extension release number */ + CARD16 xtrap_version B16; /* The xtrap extension version number */ + CARD16 xtrap_revision B16; /* The xtrap extension revision number */ + CARD16 max_pkt_size B16; /* Maximum number of bytes in a packet */ + CARD8 valid[4]; /* What specific configuration flags are valid */ + CARD32 major_opcode B32; /* The major opcode identifying xtrap */ + CARD32 event_base B32; /* The event value we start at */ + CARD32 pad0 B32; /* obsolete field */ + CARD16 pad1 B16, pad2 B16, pad3 B16; /* obsolete field */ + CARD16 xtrap_protocol B16; /* The xtrap extension protocol number */ + INT16 cur_x B16; /* Current X & Y coord for relative motion */ + INT16 cur_y B16; +} XETrapGetAvailRep; + +typedef struct +{ + CARD16 xtrap_release B16; /* The xtrap extension release number */ + CARD16 xtrap_version B16; /* The xtrap extension version number */ + CARD16 xtrap_revision B16; /* The xtrap extension revision number */ + CARD16 xtrap_protocol B16; /* The xtrap extension protocol number */ +} XETrapGetVersRep; + +typedef struct +{ + CARD32 last_time B32; /* Timestamp of last input time */ +} XETrapGetLastInpTimeRep; + +/* Structure of Get Current Configuration Information reply */ +typedef struct +{ + CARD8 state_flags[2]; /* Miscelaneous flags, see below #define's */ + CARD16 pad0 B16; /* Assure quadword alignment */ + XETrapCfg config; /* Current Config information */ + CARD32 pad1 B32; +} XETrapGetCurRep; + +/* Mask definitions for the above flags. */ +#define XETrapTrapActive 0L /* If sending/receiving between client/ext */ + +/* Structure of Get Statistics Information reply */ +typedef struct +{ + CARD32 requests[256L]; /* Array containing request counts if trapped */ + CARD32 events[XETrapCoreEvents]; /* Array containing event stats */ +#ifndef VECTORED_EVENTS + CARD32 pad B32; /* Pad out to a quadword */ +#endif +} XETrapGetStatsRep; + +#define PF_Other 0L /* server not one of the below */ +#define PF_Apollo 10L /* server on Apollo system */ +#define PF_ATT 20L /* server on AT&T system */ +#define PF_Cray1 30L /* server on Cray 1 system */ +#define PF_Cray2 31L /* server on Cray 2 system */ +#define PF_DECUltrix 40L /* server on DEC ULTRIX system */ +#define PF_DECVMS 41L /* server on DEC VMS system */ +#define PF_DECVT1000 42L /* server on DEC-VT1000-terminal */ +#define PF_DECXTerm 43L /* server on DEC-X-terminal */ +#define PF_DECELN 44L /* server on DEC VAXELN X terminal */ +#define PF_DECOSF1 45L /* server on DEC's OSF/1 system */ +#define PF_HP9000s800 50L /* server on HP 9000/800 system */ +#define PF_HP9000s300 51L /* server on HP 9000/300 system */ +#define PF_IBMAT 60L /* server on IBM/AT system */ +#define PF_IBMRT 61L /* server on IBM/RT system */ +#define PF_IBMPS2 62L /* server on IBM/PS2 system */ +#define PF_IBMRS 63L /* server on IBM/RS system */ +#define PF_MacII 70L /* server on Mac II system */ +#define PF_Pegasus 80L /* server on Tektronix Pegasus system */ +#define PF_SGI 90L /* server on Silicon Graphcis system */ +#define PF_Sony 100L /* server on Sony system */ +#define PF_Sun3 110L /* server on Sun 3 system */ +#define PF_Sun386i 111L /* server on Sun 386i system */ +#define PF_SunSparc 112L /* server on Sun Sparc system */ + +/* reply sent back by XETrapGetAvailable request */ +typedef struct +{ + XETrapRepHdr hdr; + XETrapGetAvailRep data; +} xXTrapGetAvailReply; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapGetAvailReply sizeof(xXTrapGetAvailReply) + +/* reply sent back by XETrapGetVersion request */ +typedef struct +{ + XETrapRepHdr hdr; + XETrapGetVersRep data; + CARD32 pad0 B32; /* pad out to 32 bytes */ + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; +} xXTrapGetVersReply; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapGetVersReply sizeof(xXTrapGetVersReply) + +/* reply sent back by XETrapGetLastInpTime request */ +typedef struct +{ + XETrapRepHdr hdr; + /* + * The following is a shadow of the XETrapGetLastInpTimeRep + * structure. This is done to avoid structure padding. + */ + CARD32 data_last_time B32; /* Timestamp of last input time */ + CARD32 pad0 B32; /* pad out to 32 bytes */ + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; +} xXTrapGetLITimReply; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapGetLITimReply sizeof(xXTrapGetLITimReply) + +/* reply sent back by XETrapGetCurrent request */ +typedef struct +{ + XETrapRepHdr hdr; + /* + * The following is a shadow of the XETrapGetCurRep + * structure. This is done to avoid structure padding. + * Since the XETrapGetCurRep structure contains a sub-structure + * (XETrapCfg) there is a shadow for that as well.*/ + CARD8 data_state_flags[2]; /* Misc flags, see below #define's */ + CARD16 data_pad0 B16; /* Assure quadword alignment */ + /* XETrapCfg Shadow Starts */ + CARD8 data_config_flags_valid[4L]; + CARD8 data_config_flags_data[4L]; + ReqFlags data_config_flags_req; + EventFlags data_config_flags_event; + CARD16 data_config_max_pkt_size B16; /* Max num of bytes in a pkt */ + CARD8 data_config_cmd_key; /* Keyboard cmd_key (KeyCode) */ +/* + * cmd_key is intentionally *not* defined KeyCode since it's definition is + * ambiguous (int in Intrinsic.h and unsigned char in X.h. + */ + CARD8 data_config_pad[1L]; /* pad out to a quadword */ + /* End Shadow (XETrapCfg) */ + CARD32 pad1 B32; +} xXTrapGetCurReply; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_xXTrapGetCurReply sizeof(xXTrapGetCurReply) + +/* reply sent back by XETrapGetStatistics request */ +/* Note: + * The following does *not* use the standard XETrapRepHdr, but instead + * one which is padded out to 32-bytes. This is because Cray's have a problem + * reading arrays of CARD32s without using the _Read32 macro (see XERqsts.c). + * This requires that none of the data be in the _Reply area. + */ +typedef struct +{ + CARD8 type; + CARD8 detail; + CARD16 sequenceNumber B16; + CARD32 length B32; + CARD32 pad0 B32; + CARD32 pad1 B32; + CARD32 pad2 B32; + CARD32 pad3 B32; + CARD32 pad4 B32; + CARD32 pad5 B32; + XETrapGetStatsRep data; +} xXTrapGetStatsReply; +#define sz_xXTrapGetStatsReply 1088 + +typedef struct /* the XTrap Output header (for output from ext to client) */ +{ /* this must be quadword aligned for portability */ + CARD32 count B32; /* Length including this header */ + CARD32 timestamp B32; /* timestamp if desired */ + CARD8 type; /* event id, request id, special id */ + CARD8 screen; /* screen number (0 to n) */ + INT16 win_x B16; /* X coord of drawable, if any */ + INT16 win_y B16; /* X coord of drawable, if any */ + CARD16 client B16; /* to distinguish requests */ +} XETrapHeader; +/* the following works because all fields are defined as bit (Bnn) fields */ +#define sz_XETrapHeader sizeof(XETrapHeader) + +#define XETrapHeaderIsEvent(phdr) (XETrapGetHeaderType(phdr) == 0x1L) +#define XETrapHeaderIsRequest(phdr) (XETrapGetHeaderType(phdr) == 0x2L) +#define XETrapHeaderIsSpecial(phdr) (XETrapGetHeaderType(phdr) == 0x3L) +#define XETrapHeaderIsCursor(phdr) (XETrapGetHeaderType(phdr) == 0x4L) +#define XETrapHeaderIsReply(phdr) (XETrapGetHeaderType(phdr) == 0x5L) + +/* Define a structure used for reading/writing datum of type XTrap */ +typedef struct +{ + XETrapHeader hdr; + union + { + xEvent event; + xResourceReq req; + xGenericReply reply; + /* special? */ + } u; +} XETrapDatum; + +/* this doesn't get picked up for VMS server builds (different Xproto.h) */ +#ifndef sz_xEvent +#define sz_xEvent 32 +#endif +/* Minimum size of a packet from the server extension */ +#define XETrapMinPktSize (SIZEOF(XETrapHeader) + SIZEOF(xEvent)) + +/* Constants used with the XLIB transport */ +#define XETrapDataStart 0L /* Used in the detail field */ +#define XETrapDataContinued 1L /* Used in the detail field */ +#define XETrapDataLast 2L /* Used in the detail field */ +#define XETrapData 0L /* Used in the type field */ +#define XETrapNumberEvents 1L +/* This is the representation on the wire(see also XLib.h) */ +#define sz_EventData 24L /* 32 bytes - type, detail, seq, index */ +typedef struct { + CARD8 type; + CARD8 detail; + CARD16 sequenceNumber B16; + CARD32 idx B32; + CARD8 data[sz_EventData]; +} xETrapDataEvent; + +/* Error message indexes added to X for extension */ +#define BadIO 2L /* Can't read/write */ +#define BadStatistics 4L /* Stat's not avail. */ +#define BadDevices 5L /* Devices not vectored */ +#define BadScreen 7L /* Can't send event to given screen */ +#define BadSwapReq 8L /* Can't send swapped extension requests */ +#define XETrapNumErrors (BadSwapReq + 1) + + +#define XEKeyIsClear 0 +#define XEKeyIsEcho 1 +#define XEKeyIsOther 2 + +#endif /* __XTRAPDI__ */ diff --git a/trapproto/xtrapemacros.h b/trapproto/xtrapemacros.h new file mode 100644 index 0000000..f59ea33 --- /dev/null +++ b/trapproto/xtrapemacros.h @@ -0,0 +1,387 @@ +/* $XFree86: xc/include/extensions/xtrapemacros.h,v 1.1 2001/11/02 23:29:26 dawes Exp $ */ +#ifndef __XTRAPEMACROS__ +#define __XTRAPEMACROS__ "@(#)xtrapemacros.h 1.9 - 90/09/18 " + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This include file is designed to provide the *visible* + * interface to XTrap data structures. Fields can be set + * using these macros by client programs unless otherwise + * specified; however, use of Trap Context convenience + * routines is strongly encouraged (XETrapContext.c) + */ +#include <X11/extensions/xtrapbits.h> +#include <signal.h> + +/* msleep macro to replace msleep() for portability reasons */ +#define msleep(m) usleep((m)*1000) + +/* Copying TC's assumes that the new TC must be created */ +#define XECopyTC(src,mask,dest) \ + (dest = XECreateTC(((src)->dpy), (mask), (&((src)->values)))) + +/* Expands to SET each element of the TCValues structure + * Returns the TCValues Mask so that the Set can be entered + * as an argument to the XEChangeTC() routine call + */ +/* Note: req_cb & evt_cb would only be used if you wanted to + * *share* callbacks between Trap Contexts. Normally, + * XEAddRequestCB() and XEAddEventCB() would be used. + */ +#define XETrapSetCfgReqCB(tcv,x) ((tcv)->req_cb = (x)) +#define XETrapSetCfgEvtCB(tcv,x) ((tcv)->evt_cb = (x)) +#define XETrapSetCfgMaxPktSize(tcv,x) ((tcv)->v.max_pkt_size = (x)) +#define XETrapSetCfgCmdKey(tcv,x) ((tcv)->v.cmd_key = (x)) +/* Note: e is only pertinent for "valid" or "data" */ +#define XETrapSetCfgFlags(tcv,e,a) \ + memcpy((tcv)->v.flags.e, (a), sizeof((tcv)->v.flags.e)) +#define XETrapSetCfgFlagTimestamp(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapTimestamp, (x)) +#define XETrapSetCfgFlagCmd(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapCmd, (x)) +#define XETrapSetCfgFlagCmdKeyMod(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapCmdKeyMod, (x)) +#define XETrapSetCfgFlagRequest(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapRequest, (x)) +#define XETrapSetCfgFlagEvent(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapEvent, (x)) +#define XETrapSetCfgFlagMaxPacket(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapMaxPacket, (x)) +#define XETrapSetCfgFlagStatistics(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapStatistics, (x)) +#define XETrapSetCfgFlagWinXY(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapWinXY, (x)) +#define XETrapSetCfgFlagCursor(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapCursor, (x)) +#define XETrapSetCfgFlagReq(tcv,request,x) \ + BitSet((tcv)->v.flags.req, (request), (x)) +#define XETrapSetCfgFlagXInput(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapXInput, (x)) +#define XETrapSetCfgFlagColorReplies(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapColorReplies, (x)) +#define XETrapSetCfgFlagGrabServer(tcv,e,x) \ + BitSet((tcv)->v.flags.e, XETrapGrabServer, (x)) +#define XETrapSetCfgFlagEvt(tcv,evt,x) \ + BitSet((tcv)->v.flags.event, (evt), (x)) + +#define XETrapSetValFlagDeltaTimes(tcv,x) \ + BitSet((tcv)->tc_flags, XETCDeltaTimes, (x)) + +/* Fields returned in the "GetAvailable" request */ +#define XETrapGetAvailPFIdent(avail) ((avail)->pf_ident) +#define XETrapGetAvailRelease(avail) ((avail)->xtrap_release) +#define XETrapGetAvailVersion(avail) ((avail)->xtrap_version) +#define XETrapGetAvailRevision(avail) ((avail)->xtrap_revision) +#define XETrapGetAvailMaxPktSize(avail) ((avail)->max_pkt_size) +#define XETrapGetAvailFlags(avail,a) \ + memcpy((a), (avail)->valid, sizeof((avail)->valid)) +#define XETrapGetAvailFlagTimestamp(avail) \ + (BitValue((avail)->valid, XETrapTimestamp)) +#define XETrapGetAvailFlagCmd(avail) \ + (BitValue((avail)->valid, XETrapCmd)) +#define XETrapGetAvailFlagCmdKeyMod(avail) \ + (BitValue((avail)->valid, XETrapCmdKeyMod)) +#define XETrapGetAvailFlagRequest(avail) \ + (BitValue((avail)->valid, XETrapRequest)) +#define XETrapGetAvailFlagEvent(avail) \ + (BitValue((avail)->valid, XETrapEvent)) +#define XETrapGetAvailFlagMaxPacket(avail) \ + (BitValue((avail)->valid, XETrapMaxPacket)) +#define XETrapGetAvailFlagStatistics(avail) \ + (BitValue((avail)->valid, XETrapStatistics)) +#define XETrapGetAvailFlagWinXY(avail) \ + (BitValue((avail)->valid, XETrapWinXY)) +#define XETrapGetAvailFlagCursor(avail) \ + (BitValue((avail)->valid, XETrapCursor)) +#define XETrapGetAvailFlagXInput(avail) \ + (BitValue((avail)->valid, XETrapXInput)) +#define XETrapGetAvailFlagVecEvt(avail) \ + (BitValue((avail)->valid, XETrapVectorEvents)) +#define XETrapGetAvailFlagColorReplies(avail) \ + (BitValue((avail)->valid, XETrapColorReplies)) +#define XETrapGetAvailFlagGrabServer(avail) \ + (BitValue((avail)->valid, XETrapGrabServer)) +#define XETrapGetAvailOpCode(avail) ((avail)->major_opcode) +/* Macro's for creating current request and trap context macros */ +#define XETrapGetCfgMaxPktSize(cfg) ((cfg)->max_pkt_size) +#define XETrapGetCfgCmdKey(cfg) ((cfg)->cmd_key) +#define XETrapGetCfgFlags(cfg,e,a) \ + memcpy((a), (cfg)->flags.e, sizeof((cfg)->flags.e)) +#define XETrapGetCfgFlagTimestamp(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapTimestamp)) +#define XETrapGetCfgFlagCmd(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapCmd)) +#define XETrapGetCfgFlagCmdKeyMod(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapCmdKeyMod)) +#define XETrapGetCfgFlagRequest(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapRequest)) +#define XETrapGetCfgFlagEvent(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapEvent)) +#define XETrapGetCfgFlagMaxPacket(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapMaxPacket)) +#define XETrapGetCfgFlagStatistics(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapStatistics)) +#define XETrapGetCfgFlagWinXY(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapWinXY)) +#define XETrapGetCfgFlagCursor(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapCursor)) +#define XETrapGetCfgFlagXInput(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapXInput)) +#define XETrapGetCfgFlagColorReplies(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapColorReplies)) +#define XETrapGetCfgFlagGrabServer(cfg,e) \ + (BitValue((cfg)->flags.e, XETrapGrabServer)) +/* Request values are in "Xproto.h" of the flavor X_RequestType */ +#define XETrapGetCfgFlagReq(cfg,request) \ + (BitValue((cfg)->flags.req, (request))) +/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */ +#define XETrapGetCfgFlagEvt(cfg,evt) \ + (BitValue((cfg)->flags.event, (evt))) + +/* Fields returned int the "GetCurrent" Request */ +#define XETrapGetCurX(avail) ((avail)->cur_x) +#define XETrapGetCurY(avail) ((avail)->cur_y) +#define XETrapGetCurSFlags(cur,a) \ + memcpy((a), (cur)->state_flags, sizeof((cur)->state_flags)) +#define XETrapGetCurMaxPktSize(cur) (XETrapGetCfgMaxPktSize(&((cur)->config))) +#define XETrapGetCurCmdKey(cur) (XETrapGetCfgCmdKey(&((cur)->config))) +/* Note: e is only pertinent for "valid" or "data" */ +#define XETrapGetCurCFlags(cur,e,a) (XETrapGetCfgFlags(&((cur)->config),e,a)) +#define XETrapGetCurFlagTimestamp(cur,e) \ + (XETrapGetCfgFlagTimestamp(&((cur)->config),e)) +#define XETrapGetCurFlagCmd(cur,e) (XETrapGetCfgFlagCmd(&((cur)->config),e)) +#define XETrapGetCurFlagCmdKeyMod(cur,e) \ + (XETrapGetCfgFlagCmdKeyMod(&((cur)->config),e)) +#define XETrapGetCurFlagRequest(cur,r) \ + (XETrapGetCfgFlagRequest(&((cur)->config),r)) +#define XETrapGetCurFlagEvent(cur,e) \ + (XETrapGetCfgFlagEvent(&((cur)->config),e)) +#define XETrapGetCurFlagMaxPacket(cur,e) \ + (XETrapGetCfgFlagMaxPacket(&((cur)->config),e)) +#define XETrapGetCurFlagStatistics(cur,e) \ + (XETrapGetCfgFlagStatistics(&((cur)->config),e)) +#define XETrapGetCurFlagWinXY(cur,e) \ + (XETrapGetCfgFlagWinXY(&((cur)->config),e)) +#define XETrapGetCurFlagCursor(cur,e) \ + (XETrapGetCfgFlagCursor(&((cur)->config),e)) +#define XETrapGetCurFlagXInput(cur,e) \ + (XETrapGetCfgFlagXInput(&((cur)->config),e)) +#define XETrapGetCurFlagColorReplies(cur,e) \ + (XETrapGetCfgFlagColorReplies(&((cur)->config),e)) +#define XETrapGetCurFlagGrabServer(cur,e) \ + (XETrapGetCfgFlagGrabServer(&((cur)->config),e)) +/* Request values are in "Xproto.h" of the flavor X_RequestType */ +#define XETrapGetCurFlagReq(cur,r) (XETrapGetCfgFlagReq(&((cur)->config),r)) +/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */ +#define XETrapGetCurFlagEvt(cur,e) (XETrapGetCfgFlagEvt(&((cur)->config),e)) + +/* Fields returned int the "GetStatistics" Request */ +#define XETrapGetStatsReq(stat,e) ((stat)->requests[(e)]) +#define XETrapGetStatsEvt(stat,e) ((stat)->events[(e)]) + +/* Fields returned in the "GetVersion" request */ +#define XETrapGetVersRelease(vers) ((vers)->xtrap_release) +#define XETrapGetVersVersion(vers) ((vers)->xtrap_version) +#define XETrapGetVersRevision(vers) ((vers)->xtrap_revision) + +/* Fields returned in the "GetLastInpTime" request */ +#define XETrapGetLastInpTime(time_rep) ((time_rep)->last_time) + +/* Expands to GET each element of the TCValues structure */ +#define XETrapGetTCReqCB(tc) ((tc)->values.req_cb) +#define XETrapGetTCEvtCB(tc) ((tc)->values.evt_cb) +#define XETrapGetTCTime(tc) ((tc)->values.last_time) +/* TC specific flags */ +#define XETrapGetTCLFlags(tc,a) \ + memcpy((a), (tc)->values.tc_flags, sizeof((tc)->values.tc_flags)) +#define XETrapGetTCFlagDeltaTimes(tc) \ + (BitValue((tc)->values.tc_flags, XETCDeltaTimes)) +#define XETrapGetTCFlagTrapActive(tc) \ + (BitValue((tc)->values.tc_flags, XETCTrapActive)) +#define XETrapGetTCMaxPktSize(tc) (XETrapGetCfgMaxPktSize(&((tc)->values.v))) +#define XETrapGetTCCmdKey(tc) (XETrapGetCfgCmdKey(&((tc)->values.v))) +/* Note: e is only pertinent for "valid" or "data" */ +#define XETrapGetTCFlags(tc,e,a) (XETrapGetCfgFlags(&((tc)->values.v),e,a)) +#define XETrapGetTCFlagTimestamp(tc,e) \ + (XETrapGetCfgFlagTimestamp(&((tc)->values.v),e)) +#define XETrapGetTCFlagCmd(tc,e) \ + (XETrapGetCfgFlagCmd(&((tc)->values.v),e)) +#define XETrapGetTCFlagCmdKeyMod(tc,e) \ + (XETrapGetCfgFlagCmdKeyMod(&((tc)->values.v),e)) +#define XETrapGetTCFlagRequest(tc,r) \ + (XETrapGetCfgFlagRequest(&((tc)->values.v),r)) +#define XETrapGetTCFlagEvent(tc,e) \ + (XETrapGetCfgFlagEvent(&((tc)->values.v),e)) +#define XETrapGetTCFlagMaxPacket(tc,e) \ + (XETrapGetCfgFlagMaxPacket(&((tc)->values.v),e)) +#define XETrapGetTCFlagStatistics(tc,e) \ + (XETrapGetCfgFlagStatistics(&((tc)->values.v),e)) +#define XETrapGetTCFlagWinXY(tc,e) \ + (XETrapGetCfgFlagWinXY(&((tc)->values.v),e)) +#define XETrapGetTCFlagCursor(tc,e) \ + (XETrapGetCfgFlagCursor(&((tc)->values.v),e)) +#define XETrapGetTCFlagXInput(tc,e) \ + (XETrapGetCfgFlagXInput(&((tc)->values.v),e)) +#define XETrapGetTCFlagColorReplies(tc,e) \ + (XETrapGetCfgFlagColorReplies(&((tc)->values.v),e)) +#define XETrapGetTCFlagGrabServer(tc,e) \ + (XETrapGetCfgFlagGrabServer(&((tc)->values.v),e)) +/* Request values are in "Xproto.h" of the flavor X_RequestType */ +#define XETrapGetTCFlagReq(tc,r) \ + (XETrapGetCfgFlagReq(&((tc)->values.v),r)) +/* Event types are in "X.h" of the flavor EventType (e.g. KeyPress) */ +#define XETrapGetTCFlagEvt(tc,e) \ + (XETrapGetCfgFlagEvt(&((tc)->values.v),e)) +/* The following can/should *not* be set directly! */ +#define XETrapGetNext(tc) ((tc)->next) +#define XETrapGetDpy(tc) ((tc)->dpy) +#define XETrapGetEventBase(tc) ((tc)->eventBase) +#define XETrapGetErrorBase(tc) ((tc)->errorBase) +#define XETrapGetExtOpcode(tc) ((tc)->extOpcode) +#define XETrapGetXBuff(tc) ((tc)->xbuff) +#define XETrapGetXMaxSize(tc) ((tc)->xmax_size) +#define XETrapGetExt(tc) ((tc)->ext_data) +#define XETrapGetDirty(tc) ((tc)->dirty) +#define XETrapGetValues(tc) memcpy((x),(tc)->values,sizeof((tc)->values)) +#define XETrapGetEventFunc(tc) ((tc)->eventFunc) + +#define XETrapGetHeaderCount(phdr) ((phdr)->count) +#define XETrapGetHeaderTimestamp(phdr) ((phdr)->timestamp) +#define XETrapGetHeaderType(phdr) ((phdr)->type) +#define XETrapGetHeaderScreen(phdr) ((phdr)->screen) +#define XETrapGetHeaderWindowX(phdr) ((phdr)->win_x) +#define XETrapGetHeaderWindowY(phdr) ((phdr)->win_y) +#define XETrapGetHeaderClient(phdr) ((phdr)->client) + +#define XEGetRelease(tc) ((tc)->release) +#define XEGetVersion(tc) ((tc)->version) +#define XEGetRevision(tc) ((tc)->revision) + +/* Condition handling macros */ +#if !defined(vms) && \ + (!defined(_InitExceptionHandling) || !defined(_ClearExceptionHandling)) +# ifndef _SetSIGBUSHandling +# ifdef SIGBUS +# define _SetSIGBUSHandling(rtn) (void)signal(SIGBUS, rtn) +# else +# define _SetSIGBUSHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGSEGVHandling +# ifdef SIGSEGV +# define _SetSIGSEGVHandling(rtn) (void)signal(SIGSEGV, rtn) +# else +# define _SetSIGSEGVHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGFPEHandling +# ifdef SIGFPE +# define _SetSIGFPEHandling(rtn) (void)signal(SIGFPE, rtn) +# else +# define _SetSIGFPEHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGILLHandling +# ifdef SIGILL +# define _SetSIGILLHandling(rtn) (void)signal(SIGILL, rtn) +# else +# define _SetSIGILLHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGSYSHandling +# ifdef SIGSYS +# define _SetSIGSYSHandling(rtn) (void)signal(SIGSYS, rtn) +# else +# define _SetSIGSYSHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGHUPHandling +# ifdef SIGHUP +# define _SetSIGHUPHandling(rtn) (void)signal(SIGHUP, rtn) +# else +# define _SetSIGHUPHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGPIPEHandling +# ifdef SIGPIPE +# define _SetSIGPIPEHandling(rtn) (void)signal(SIGPIPE, rtn) +# else +# define _SetSIGPIPEHandling(rtn) /* */ +# endif +# endif +# ifndef _SetSIGTERMHandling +# ifdef SIGTERM +# define _SetSIGTERMHandling(rtn) (void)signal(SIGTERM, rtn) +# else +# define _SetSIGTERMHandling(rtn) /* */ +# endif +# endif +#endif +#ifndef _InitExceptionHandling +#ifdef vms +#define _InitExceptionHandling(rtn) \ + VAXC$ESTABLISH(rtn) /* VMS exception handler */ +#else /* vms */ +#define _InitExceptionHandling(rtn) \ + _SetSIGBUSHandling(rtn); /* Bus error */ \ + _SetSIGSEGVHandling(rtn); /* Accvio/Segment error */ \ + _SetSIGFPEHandling(rtn); /* Floating point exception */ \ + _SetSIGILLHandling(rtn); /* Illegal instruction */ \ + _SetSIGSYSHandling(rtn); /* Param error in sys call */ \ + _SetSIGHUPHandling(rtn); \ + _SetSIGPIPEHandling(rtn); \ + _SetSIGTERMHandling(rtn) +#endif /* vms */ +#endif /* _InitExceptionHandling */ + +#ifndef _ClearExceptionHandling +#ifdef vms +#define _ClearExceptionHandling() \ + LIB$REVERT() +#else +#define _ClearExceptionHandling() \ + _SetSIGBUSHandling(SIG_DFL); /* Bus error */ \ + _SetSIGSEGVHandling(SIG_DFL); /* Accvio/Segment error */ \ + _SetSIGFPEHandling(SIG_DFL); /* Floating point exception */ \ + _SetSIGILLHandling(SIG_DFL); /* Illegal instruction */ \ + _SetSIGSYSHandling(SIG_DFL); /* Param error in sys call */ \ + _SetSIGHUPHandling(SIG_DFL); \ + _SetSIGPIPEHandling(SIG_DFL); \ + _SetSIGTERMHandling(SIG_DFL) +#endif /* vms */ +#endif /* _ClearExceptionHandling */ + +#endif /* __XTRAPEMACROS__ */ diff --git a/trapproto/xtraplib.h b/trapproto/xtraplib.h new file mode 100644 index 0000000..db0289f --- /dev/null +++ b/trapproto/xtraplib.h @@ -0,0 +1,133 @@ +/* $XFree86$ */ +#ifndef __XTRAPLIB__ +#define __XTRAPLIB__ + + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This header file describes all the structures/constants required + * for interfacing with the client toolkit *except* the common + * client/extension definitions in xtrapdi.h. Namely, *no* extension- + * only information or client/extension information can be found here. + */ +#ifdef SMT +#define NEED_EVENTS +#define NEED_REPLIES +#endif +#include <X11/Xlib.h> +#include <X11/Intrinsic.h> +#include <X11/extensions/xtrapdi.h> +#include <X11/extensions/xtrapemacros.h> + +typedef struct _XETC XETC; + +typedef int (*int_function)(XETC *tc, XETrapDatum *pdatum, BYTE *userp); +typedef void (*void_function)(XETC *tc, XETrapDatum *pdatum, BYTE *userp); + +typedef struct /* Callback structure */ +{ + void_function func; + BYTE *data; +} XETrapCB; + +/* Data structure for setting trap context */ +typedef struct +{ + CARD8 tc_flags[2L]; /* Toolkit-side specific flags */ + XETrapCfg v; /* XTrap configuration values */ + XETrapCB *req_cb; /* Pointer to Request Callbacks */ + XETrapCB *evt_cb; /* Pointer to Event Callbacks (starting at 2) */ + CARD32 last_time B32; /* Last (delta) timestamp */ +} XETCValues; + + /* bits 0 thru 6 are formerly "families" (now obsolete) */ +#define XETCDeltaTimes 7 +#define XETCTrapActive 8 + /* bits 9 thru 15 are reserved for future expansion */ + +/* Values bit masks (used when determining what's dirty */ +#define TCStatistics (1L<<0L) +#define TCRequests (1L<<1L) +#define TCEvents (1L<<2L) +#define TCMaxPacket (1L<<3L) +#define TCCmdKey (1L<<4L) +#define TCTimeStamps (1L<<5L) +#define TCWinXY (1L<<6L) +#define TCXInput (1L<<7L) +#define TCReqCBs (1L<<8L) +#define TCEvtCBs (1L<<9L) +#define TCCursor (1L<<10L) +#define TCColorReplies (1L<<11L) +#define TCGrabServer (1L<<12L) + +/* This is the representation we use in the library code for XLib transport */ +typedef struct { + int type; + unsigned long serial; + Bool synthetic; + Display *display; + int detail; + unsigned long idx; + unsigned char data[sz_EventData]; +} XETrapDataEvent; + +/* Trap Context structure for maintaining XTrap State for client */ +struct _XETC +{ + struct _XETC *next; /* Ptr to next linked-listed TC */ + Display *dpy; /* Display ptr of current TC */ + INT32 eventBase /*B32*/; /* First event value */ + INT32 errorBase /*B32*/; /* First error value */ + INT32 extOpcode /*B32*/; /* Major opcode of the extension */ + BYTE *xbuff; /* Pointer to buffer for XLib Communications */ + CARD16 xmax_size /*B16*/; /* Max Size of a request */ + XExtData *ext_data; /* hook for extension to hang data */ + /* + * The following are initialized with the client-side version number + * However, when either a GetAvailable or GetVersion reply is received, + * these values are updated with the *oldest* version numbers. + */ + CARD16 release /*B16*/; /* The extension release number */ + CARD16 version /*B16*/; /* The xtrap extension version number */ + CARD16 revision /*B16*/; /* The xtrap extension revision number */ + CARD16 protocol /*B16*/; /* The xtrap extension protocol number */ + unsigned dirty /*B32*/; /* cache dirty bits */ + XETCValues values; /* shadow structure of values */ + Boolean (*eventFunc[XETrapNumberEvents])(XETrapDataEvent *event, struct _XETC *tc); +}; + + +#endif /* __XTRAPLIB__ */ diff --git a/trapproto/xtraplibp.h b/trapproto/xtraplibp.h new file mode 100644 index 0000000..0c6ced2 --- /dev/null +++ b/trapproto/xtraplibp.h @@ -0,0 +1,151 @@ +/* $XFree86$ */ +#ifndef __XTRAPLIBP__ +#define __XTRAPLIBP__ + + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991, 1994 by Digital Equipment Corp., +Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This header file contains the function prototypes for client/toolkit + * routines sorted by module (globally defined routines *only*). + */ + +#include <X11/Xfuncproto.h> + +#include <stdio.h> + +_XFUNCPROTOBEGIN + +/* XEConTxt.c */ +XETC *XECreateTC (Display *dpy , CARD32 valuemask , XETCValues *value ); +int XEChangeTC (XETC *tc , CARD32 mask , XETCValues *values ); +void XEFreeTC (XETC *tc ); +int XETrapSetMaxPacket (XETC *tc , Bool set_flag , CARD16 size ); +int XETrapSetCommandKey (XETC *tc , Bool set_flag , KeySym cmd_key , + Bool mod_flag ); +int XETrapSetTimestamps (XETC *tc , Bool set_flag , Bool delta_flag ); +int XETrapSetWinXY (XETC *tc , Bool set_flag ); +int XETrapSetCursor (XETC *tc , Bool set_flag ); +int XETrapSetXInput (XETC *tc , Bool set_flag ); +int XETrapSetColorReplies (XETC *tc , Bool set_flag ); +int XETrapSetGrabServer (XETC *tc , Bool set_flag ); +int XETrapSetStatistics (XETC *tc , Bool set_flag ); +int XETrapSetRequests (XETC *tc , Bool set_flag , ReqFlags requests ); +int XETrapSetEvents (XETC *tc , Bool set_flag , EventFlags events ); +Bool XESetCmdGateState (XETC *tc , CARD8 type, Bool *gate_closed , + CARD8 *next_key , Bool *key_ignore ); + +/* XERqsts.c */ +int XEFlushConfig (XETC *tc ); +int XEResetRequest (XETC *tc ); +int XEGetVersionRequest (XETC *tc , XETrapGetVersRep *ret ); +int XEGetLastInpTimeRequest (XETC *tc , XETrapGetLastInpTimeRep *ret ); +int XEGetAvailableRequest (XETC *tc , XETrapGetAvailRep *ret ); +int XEStartTrapRequest (XETC *tc ); +int XEStopTrapRequest (XETC *tc ); +int XESimulateXEventRequest (XETC *tc , CARD8 type , CARD8 detail , + CARD16 x , CARD16 y , CARD8 screen ); +int XEGetCurrentRequest (XETC *tc , XETrapGetCurRep *ret ); +int XEGetStatisticsRequest (XETC *tc , XETrapGetStatsRep *ret ); + +/* XECallBcks.c */ +int XEAddRequestCB (XETC *tc , CARD8 req , void_function func , BYTE *data ); +int XEAddRequestCBs (XETC *tc , ReqFlags req_flags , void_function func , + BYTE *data ); +int XEAddEventCB (XETC *tc , CARD8 evt , void_function func , BYTE *data ); +int XEAddEventCBs (XETC *tc , EventFlags evt_flags , void_function func , + BYTE *data ); + +/* The following seem to never be used. Perhaps they should be removed */ +void XERemoveRequestCB (XETC *tc, CARD8 req); +void XERemoveRequestCBs (XETC *tc, ReqFlags req_flags); +void XERemoveAllRequestCBs (XETC *tc); +void XERemoveEventCB (XETC *tc, CARD8 evt); +void XERemoveEventCBs (XETC *tc, EventFlags evt_flags); +void XERemoveAllEventCBs (XETC *tc); + + +/* XEDsptch.c */ +Boolean XETrapDispatchXLib (XETrapDataEvent *event , XETC *tc); + +/* XEWrappers.c */ +Boolean XETrapDispatchEvent (XEvent *pevent , XETC *tc ); +XtInputMask XETrapAppPending (XtAppContext app); +void XETrapAppMainLoop (XtAppContext app , XETC *tc ); +int XETrapAppWhileLoop (XtAppContext app , XETC *tc , Bool *done ); +int XETrapWaitForSomething (XtAppContext app ); +Boolean (*XETrapGetEventHandler(XETC *tc, CARD32 id))(XETrapDataEvent *event, XETC *tc); +Boolean (*XETrapSetEventHandler(XETC *tc, CARD32 id, Boolean (*pfunc)(XETrapDataEvent *event, XETC *tc))) (XETrapDataEvent *event, XETC *tc); + +/* XEPrInfo.c */ +void XEPrintRelease (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintTkRelease ( FILE *ofp, XETC *tc); +void XEPrintPlatform (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintAvailFlags (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintAvailPktSz (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintStateFlags (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintMajOpcode (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintCurXY (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintTkFlags (FILE *ofp , XETC *tc ); +void XEPrintLastTime (FILE *ofp , XETC *tc ); +void XEPrintCfgFlags (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintRequests (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintEvents (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintCurPktSz (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintCmdKey (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintEvtStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc); +void XEPrintReqStats (FILE *ofp , XETrapGetStatsRep *pstats , XETC *tc); +void XEPrintAvail (FILE *ofp , XETrapGetAvailRep *pavail ); +void XEPrintTkState (FILE *ofp , XETC *tc ); +void XEPrintCurrent (FILE *ofp , XETrapGetCurRep *pcur ); +void XEPrintStatistics (FILE *ofp , XETrapGetStatsRep *pstats, XETC *tc ); + +/* XEStrMap.c */ +INT16 XEEventStringToID (char *string ); +INT16 XERequestStringToID (char *string ); +CARD32 XEPlatformStringToID (char *string ); +char *XEEventIDToString (CARD8 id , XETC *tc); +char *XERequestIDToExtString (register CARD8 id , XETC *tc); +char *XERequestIDToString (CARD8 id , XETC *tc); +char *XEPlatformIDToString (CARD32 id ); + +/* XETrapInit.c */ +Bool XETrapQueryExtension (Display *dpy,INT32 *event_base_return, + INT32 *error_base_return, INT32 *opcode_return); + + +_XFUNCPROTOEND + +#endif /* __XTRAPLIBP__ */ diff --git a/trapproto/xtrapproto.h b/trapproto/xtrapproto.h new file mode 100644 index 0000000..b3e29cf --- /dev/null +++ b/trapproto/xtrapproto.h @@ -0,0 +1,168 @@ +/* $XFree86: xc/include/extensions/xtrapproto.h,v 1.1 2001/11/02 23:29:26 dawes Exp $ */ + +#ifndef __XTRAPPROTO__ +#define __XTRAPPROTO__ + +/***************************************************************************** +Copyright 1987, 1988, 1989, 1990, 1991 by Digital Equipment Corp., Maynard, MA + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +*****************************************************************************/ +/* + * + * CONTRIBUTORS: + * + * Dick Annicchiarico + * Robert Chesler + * Dan Coutu + * Gene Durso + * Marc Evans + * Alan Jamison + * Mark Henry + * Ken Miller + * + * DESCRIPTION: + * This header file contains the function prototypes for extension + * routines sorted by module (globally defined routines *only*). + */ +#ifndef Bool +# define Bool int +#endif +/* xtrapdi.c */ +int XETrapDestroyEnv (pointer value , XID id ); +void XETrapCloseDown ( ExtensionEntry *extEntry ); +Bool XETrapRedirectDevices (void ); +void DEC_XTRAPInit (void ); +int XETrapCreateEnv (ClientPtr client ); +int XETrapDispatch (ClientPtr client ); +int sXETrapDispatch (ClientPtr client ); +int XETrapReset (xXTrapReq *request , ClientPtr client ); +int XETrapGetAvailable (xXTrapGetReq *request , ClientPtr client ); +int XETrapGetCurrent (xXTrapReq *request , ClientPtr client ); +int XETrapGetStatistics (xXTrapReq *request , ClientPtr client ); +int XETrapConfig (xXTrapConfigReq *request , ClientPtr client ); +int XETrapStartTrap (xXTrapReq *request , ClientPtr client ); +int XETrapStopTrap (xXTrapReq *request , ClientPtr client ); +int XETrapGetVersion (xXTrapGetReq *request , ClientPtr client ); +int XETrapGetLastInpTime (xXTrapReq *request , ClientPtr client ); +int XETrapRequestVector (ClientPtr client ); +int XETrapKeyboard (xEvent *x_event , DevicePtr keybd , int count ); +#ifndef VECTORED_EVENTS +int XETrapPointer (xEvent *x_event , DevicePtr ptrdev , int count ); +#else +int XETrapEventVector (ClientPtr client , xEvent *x_event ); +#endif +void XETrapStampAndMail (xEvent *x_event ); +void sReplyXTrapDispatch (ClientPtr client , int size , char *reply ); +int XETrapWriteXLib (XETrapEnv *penv , BYTE *data , CARD32 nbytes ); + +/* xtrapddmi.c */ +void XETrapPlatformSetup (void ); +int XETrapSimulateXEvent (xXTrapInputReq *request , ClientPtr client ); + +/* xtrapdiswap.c */ +int sXETrapReset (xXTrapReq *request , ClientPtr client ); +int sXETrapGetAvailable (xXTrapGetReq *request , ClientPtr client ); +int sXETrapConfig (xXTrapConfigReq *request , ClientPtr client ); +int sXETrapStartTrap (xXTrapReq *request , ClientPtr client ); +int sXETrapStopTrap (xXTrapReq *request , ClientPtr client ); +int sXETrapGetCurrent (xXTrapReq *request , ClientPtr client ); +int sXETrapGetStatistics (xXTrapReq *request , ClientPtr client ); +int sXETrapSimulateXEvent (xXTrapInputReq *request , ClientPtr client ); +int sXETrapGetVersion (xXTrapGetReq *request , ClientPtr client ); +int sXETrapGetLastInpTime (xXTrapReq *request , ClientPtr client ); +void sReplyXETrapGetAvail (ClientPtr client , int size , char *reply ); +void sReplyXETrapGetVers (ClientPtr client , int size , char *reply ); +void sReplyXETrapGetLITim (ClientPtr client , int size , char *reply ); +void sReplyXETrapGetCur (ClientPtr client , int size , char *reply ); +void sReplyXETrapGetStats (ClientPtr client , int size , char *reply ); +void sXETrapHeader (XETrapHeader *hdr ); +void XETSwSimpleReq (xReq *data ); +void XETSwResourceReq (xResourceReq *data ); +void XETSwCreateWindow (xCreateWindowReq *data , ClientPtr client ); +void XETSwChangeWindowAttributes (xChangeWindowAttributesReq *data , ClientPtr client ); +void XETSwReparentWindow (xReparentWindowReq *data ); +void XETSwConfigureWindow (xConfigureWindowReq *data , ClientPtr client ); +void XETSwInternAtom (xInternAtomReq *data ); +void XETSwChangeProperty (xChangePropertyReq *data ); +void XETSwDeleteProperty (xDeletePropertyReq *data ); +void XETSwGetProperty (xGetPropertyReq *data ); +void XETSwSetSelectionOwner (xSetSelectionOwnerReq *data ); +void XETSwConvertSelection (xConvertSelectionReq *data ); +void XETSwSendEvent (xSendEventReq *data ); +void XETSwGrabPointer (xGrabPointerReq *data ); +void XETSwGrabButton (xGrabButtonReq *data ); +void XETSwUngrabButton (xUngrabButtonReq *data ); +void XETSwChangeActivePointerGrab (xChangeActivePointerGrabReq *data ); +void XETSwGrabKeyboard (xGrabKeyboardReq *data ); +void XETSwGrabKey (xGrabKeyReq *data ); +void XETSwUngrabKey (xUngrabKeyReq *data ); +void XETSwGetMotionEvents (xGetMotionEventsReq *data ); +void XETSwTranslateCoords (xTranslateCoordsReq *data ); +void XETSwWarpPointer (xWarpPointerReq *data ); +void XETSwSetInputFocus (xSetInputFocusReq *data ); +void XETSwOpenFont (xOpenFontReq *data ); +void XETSwListFonts (xListFontsReq *data ); +void XETSwListFontsWithInfo (xListFontsWithInfoReq *data ); +void XETSwSetFontPath (xSetFontPathReq *data ); +void XETSwCreatePixmap (xCreatePixmapReq *data ); +void XETSwCreateGC (xCreateGCReq *data , ClientPtr client ); +void XETSwChangeGC (xChangeGCReq *data , ClientPtr client ); +void XETSwCopyGC (xCopyGCReq *data ); +void XETSwSetDashes (xSetDashesReq *data ); +void XETSwSetClipRectangles (xSetClipRectanglesReq *data , ClientPtr client ); +void XETSwClearToBackground (xClearAreaReq *data ); +void XETSwCopyArea (xCopyAreaReq *data ); +void XETSwCopyPlane (xCopyPlaneReq *data ); +void XETSwPoly (xPolyPointReq *data , ClientPtr client ); +void XETSwFillPoly (xFillPolyReq *data , ClientPtr client ); +void XETSwPutImage (xPutImageReq *data ); +void XETSwGetImage (xGetImageReq *data ); +void XETSwPolyText (xPolyTextReq *data ); +void XETSwImageText (xImageTextReq *data ); +void XETSwCreateColormap (xCreateColormapReq *data ); +void XETSwCopyColormapAndFree (xCopyColormapAndFreeReq *data ); +void XETSwAllocColor (xAllocColorReq *data ); +void XETSwAllocNamedColor (xAllocNamedColorReq *data ); +void XETSwAllocColorCells (xAllocColorCellsReq *data ); +void XETSwAllocColorPlanes (xAllocColorPlanesReq *data ); +void XETSwFreeColors (xFreeColorsReq *data , ClientPtr client ); +void XETSwStoreColors (xStoreColorsReq *data , ClientPtr client ); +void XETSwStoreNamedColor (xStoreNamedColorReq *data ); +void XETSwQueryColors (xQueryColorsReq *data , ClientPtr client ); +void XETSwLookupColor (xLookupColorReq *data ); +void XETSwCreateCursor (xCreateCursorReq *data ); +void XETSwCreateGlyphCursor (xCreateGlyphCursorReq *data ); +void XETSwRecolorCursor (xRecolorCursorReq *data ); +void XETSwQueryBestSize (xQueryBestSizeReq *data ); +void XETSwQueryExtension (xQueryExtensionReq *data ); +void XETSwChangeKeyboardMapping (xChangeKeyboardMappingReq *data ); +void XETSwChangeKeyboardControl (xChangeKeyboardControlReq *data , ClientPtr client ); +void XETSwChangePointerControl (xChangePointerControlReq *data ); +void XETSwSetScreenSaver (xSetScreenSaverReq *data ); +void XETSwChangeHosts (xChangeHostsReq *data ); +void XETSwRotateProperties (xRotatePropertiesReq *data , ClientPtr client ); +void XETSwNoOperation (xReq *data ); +#ifdef vms +void SwapLongs (long *list , unsigned long count ); +void SwapShorts (short *list , unsigned long count ); +int SwapColorItem (xColorItem *pItem ); +#endif /* vms */ + + +#endif /* __XTRAPPROTO__ */ |