xtrapdi.h revision a2760a4d593af57a19ec32cdfd1723b68495df8c
/* $XFree86: xc/include/extensions/xtrapdi.h,v 1.1 2001/11/02 23:29:26 dawes Exp $ */
#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
* here.
*/
#define NEED_REPLIES
#define NEED_EVENTS
#ifndef IN_MODULE
#include <stdio.h>
#endif
#ifdef SMT
#define NEED_EVENTS
#define NEED_REPLIES
#endif
#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__
# else
# 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
typedef int (*int_function)();
typedef void (*void_function)();
/* This is used as flags to indicate desired request traps
* Note: This has been padded to a CARD32 to keep structure aligned
*/
/* 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
#else
#define XETrapCoreEvents 128L
#endif
/* This structure is used in a request to specify the types of
* configuration information that should be changed or updated.
*/
typedef struct
{
} XETrapFlags;
/* Bit definitions for the above XETrapFlags structure. */
#define XETrapTimestamp 0L /* hdr timestamps desired */
typedef struct /* used by XEConfigRequest */
{
/*
* cmd_key is intentionally *not* defined KeyCode since it's definition is
* ambiguous (int in Intrinsic.h and unsigned char in X.h.
*/
} 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 */
{
#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 */
#ifndef _XINPUT
#endif
/* The following are formats of a request to the XTRAP
* extension. The data-less XTrap requests all use xXTrapReq
*/
typedef struct
{
} xXTrapReq;
/* the following works because all fields are defined as bit (Bnn) fields */
#define sz_xXTrapReq (sizeof(xXTrapReq))
typedef struct
{
} xXTrapGetReq;
/* the following works because all fields are defined as bit (Bnn) fields */
#define sz_xXTrapGetReq (sizeof(xXTrapGetReq))
typedef struct
{
/*
* 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.
*/
/* End Shadow (XETrapFlags)*/
/*
* cmd_key is intentionally *not* defined KeyCode since it's definition is
* ambiguous (int in Intrinsic.h and unsigned char in X.h.
*/
/* End Shadow (XETrapCfg) */
/* the following works because all fields are defined as bit (Bnn) fields */
#define sz_xXTrapConfigReq (sizeof(xXTrapConfigReq))
#ifndef _XINPUT
typedef struct
{
/* 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
{
} XETrapRepHdr;
/* Structure of Get Available Functionality reply */
typedef struct
{
typedef struct
{
typedef struct
{
/* Structure of Get Current Configuration Information reply */
typedef struct
{
/* Mask definitions for the above flags. */
#define XETrapTrapActive 0L /* If sending/receiving between client/ext */
/* Structure of Get Statistics Information reply */
typedef struct
{
#ifndef VECTORED_EVENTS
#endif
#define PF_Other 0L /* server not one of the below */
/* reply sent back by XETrapGetAvailable request */
typedef struct
{
/* 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
{
/* 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
{
/*
* The following is a shadow of the XETrapGetLastInpTimeRep
* structure. This is done to avoid structure padding.
*/
/* 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
{
/*
* 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.*/
/* XETrapCfg Shadow Starts */
/*
* cmd_key is intentionally *not* defined KeyCode since it's definition is
* ambiguous (int in Intrinsic.h and unsigned char in X.h.
*/
/* End Shadow (XETrapCfg) */
/* 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
{
#define sz_xXTrapGetStatsReply 1088
typedef struct /* the XTrap Output header (for output from ext to client) */
{ /* this must be quadword aligned for portability */
} XETrapHeader;
/* the following works because all fields are defined as bit (Bnn) fields */
#define sz_XETrapHeader sizeof(XETrapHeader)
typedef struct
{
union
{
/* 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 */
/* Constants used with the XLIB transport */
#define XETrapDataStart 0L /* 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) */
typedef struct {
/* Error message indexes added to X for extension */
#define XEKeyIsClear 0
#define XEKeyIsEcho 1
#define XEKeyIsOther 2
#endif /* __XTRAPDI__ */