Home | History | Annotate | Line # | Download | only in extensions
      1 /***************************************************************************
      2  * Copyright 1995 Network Computing Devices
      3  *
      4  * Permission to use, copy, modify, distribute, and sell this software and
      5  * its documentation for any purpose is hereby granted without fee, provided
      6  * that the above copyright notice appear in all copies and that both that
      7  * copyright notice and this permission notice appear in supporting
      8  * documentation, and that the name of Network Computing Devices
      9  * not be used in advertising or publicity pertaining to distribution
     10  * of the software without specific, written prior permission.
     11  *
     12  * NETWORK COMPUTING DEVICES DISCLAIMs ALL WARRANTIES WITH REGARD TO
     13  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
     14  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE
     15  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     16  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
     17  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING
     18  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     19  **************************************************************************/
     20 
     21 #ifndef _RECORDPROTO_H_
     22 #define _RECORDPROTO_H_
     23 
     24 #include <X11/extensions/recordconst.h>
     25 
     26 /* only difference between 1.12 and 1.13 is byte order of device events,
     27    which the library doesn't deal with. */
     28 
     29 /*********************************************************
     30  *
     31  * Protocol request constants
     32  *
     33  */
     34 #define X_RecordQueryVersion    0     /* First request from client */
     35 #define X_RecordCreateContext   1     /* Create client RC */
     36 #define X_RecordRegisterClients 2     /* Add to client RC */
     37 #define X_RecordUnregisterClients 3   /* Delete from client RC */
     38 #define X_RecordGetContext      4     /* Query client RC */
     39 #define X_RecordEnableContext   5     /* Enable interception and reporting */
     40 #define X_RecordDisableContext  6     /* Disable interception and reporting */
     41 #define X_RecordFreeContext     7     /* Free client RC */
     42 
     43 #define sz_XRecordRange		32
     44 #define sz_XRecordClientInfo 	12
     45 #define sz_XRecordState 	16
     46 #define sz_XRecordDatum 	32
     47 
     48 
     49 #define XRecordGlobaldef
     50 #define XRecordGlobalref extern
     51 
     52 #define RecordMaxEvent     	(128L-1L)
     53 #define RecordMinDeviceEvent	(2L)
     54 #define RecordMaxDeviceEvent	(6L)
     55 #define RecordMaxError          (256L-1L)
     56 #define RecordMaxCoreRequest    (128L-1L)
     57 #define RecordMaxExtRequest     (256L-1L)
     58 #define RecordMinExtRequest     (129L-1L)
     59 
     60 #define RECORD_RC 		CARD32
     61 #define RECORD_XIDBASE		CARD32
     62 #define RECORD_CLIENTSPEC	CARD32
     63 #define RECORD_ELEMENT_HEADER	CARD8
     64 
     65 typedef RECORD_CLIENTSPEC RecordClientSpec, *RecordClientSpecPtr;
     66 
     67 typedef struct
     68 {
     69     CARD8	first;
     70     CARD8	last;
     71 } RECORD_RANGE8;
     72 
     73 typedef struct
     74 {
     75     CARD16	first;
     76     CARD16	last;
     77 } RECORD_RANGE16;
     78 
     79 typedef struct
     80 {
     81     RECORD_RANGE8	majorCode;
     82     RECORD_RANGE16	minorCode;
     83 } RECORD_EXTRANGE;
     84 
     85 typedef struct
     86 {
     87     RECORD_RANGE8	coreRequests;
     88     RECORD_RANGE8	coreReplies;
     89     RECORD_EXTRANGE	extRequests;
     90     RECORD_EXTRANGE	extReplies;
     91     RECORD_RANGE8	deliveredEvents;
     92     RECORD_RANGE8	deviceEvents;
     93     RECORD_RANGE8	errors;
     94     BOOL		clientStarted;
     95     BOOL		clientDied;
     96 } RECORDRANGE;
     97 #define sz_RECORDRANGE 	24
     98 
     99 /* typedef RECORDRANGE xRecordRange, *xRecordRangePtr;
    100 #define sz_xRecordRange 24 */
    101 
    102 /* Cannot have structures within structures going over the wire */
    103 typedef struct
    104 {
    105     CARD8       	coreRequestsFirst;
    106     CARD8       	coreRequestsLast;
    107     CARD8       	coreRepliesFirst;
    108     CARD8       	coreRepliesLast;
    109     CARD8  		extRequestsMajorFirst;
    110     CARD8		extRequestsMajorLast;
    111     CARD16  		extRequestsMinorFirst;
    112     CARD16  		extRequestsMinorLast;
    113     CARD8  		extRepliesMajorFirst;
    114     CARD8		extRepliesMajorLast;
    115     CARD16  		extRepliesMinorFirst;
    116     CARD16  		extRepliesMinorLast;
    117     CARD8       	deliveredEventsFirst;
    118     CARD8       	deliveredEventsLast;
    119     CARD8		deviceEventsFirst;
    120     CARD8		deviceEventsLast;
    121     CARD8       	errorsFirst;
    122     CARD8       	errorsLast;
    123     BOOL                clientStarted;
    124     BOOL		clientDied;
    125 } xRecordRange;
    126 #define sz_xRecordRange 24
    127 
    128 typedef struct
    129 {
    130     RECORD_CLIENTSPEC	clientResource;
    131     CARD32		nRanges;
    132 /* LISTofRECORDRANGE */
    133 } RECORD_CLIENT_INFO;
    134 
    135 typedef RECORD_CLIENT_INFO xRecordClientInfo;
    136 
    137 /*
    138  * Initialize
    139  */
    140 typedef struct {
    141     CARD8       reqType;
    142     CARD8       recordReqType;
    143     CARD16      length;
    144     CARD16      majorVersion;
    145     CARD16      minorVersion;
    146 } xRecordQueryVersionReq;
    147 #define sz_xRecordQueryVersionReq 	8
    148 
    149 typedef struct
    150 {
    151     CARD8   type;
    152     CARD8   pad0;
    153     CARD16  sequenceNumber;
    154     CARD32  length;
    155     CARD16  majorVersion;
    156     CARD16  minorVersion;
    157     CARD32  pad1;
    158     CARD32  pad2;
    159     CARD32  pad3;
    160     CARD32  pad4;
    161     CARD32  pad5;
    162  } xRecordQueryVersionReply;
    163 #define sz_xRecordQueryVersionReply  	32
    164 
    165 /*
    166  * Create RC
    167  */
    168 typedef struct
    169 {
    170     CARD8     		reqType;
    171     CARD8     		recordReqType;
    172     CARD16    		length;
    173     RECORD_RC		context;
    174     RECORD_ELEMENT_HEADER elementHeader;
    175     CARD8		pad;
    176     CARD16		pad0;
    177     CARD32		nClients;
    178     CARD32		nRanges;
    179 /* LISTofRECORD_CLIENTSPEC */
    180 /* LISTofRECORDRANGE */
    181 } xRecordCreateContextReq;
    182 #define sz_xRecordCreateContextReq 	20
    183 
    184 /*
    185  * Add to  RC
    186  */
    187 typedef struct
    188 {
    189     CARD8     		reqType;
    190     CARD8     		recordReqType;
    191     CARD16    		length;
    192     RECORD_RC		context;
    193     RECORD_ELEMENT_HEADER elementHeader;
    194     CARD8		pad;
    195     CARD16		pad0;
    196     CARD32		nClients;
    197     CARD32		nRanges;
    198 /* LISTofRECORD_CLIENTSPEC */
    199 /* LISTofRECORDRANGE */
    200 } xRecordRegisterClientsReq;
    201 #define sz_xRecordRegisterClientsReq 	20
    202 
    203 /*
    204  * Delete from RC
    205  */
    206 typedef struct
    207 {
    208     CARD8     		reqType;
    209     CARD8     		recordReqType;
    210     CARD16    		length;
    211     RECORD_RC		context;
    212     CARD32		nClients;
    213 /* LISTofRECORD_CLIENTSPEC */
    214 } xRecordUnregisterClientsReq;
    215 #define sz_xRecordUnregisterClientsReq 	12
    216 
    217 /*
    218  * Query RC
    219  */
    220 typedef struct
    221 {
    222     CARD8     	reqType;
    223     CARD8     	recordReqType;
    224     CARD16    	length;
    225     RECORD_RC	context;
    226 } xRecordGetContextReq;
    227 #define sz_xRecordGetContextReq 		8
    228 
    229 typedef struct
    230 {
    231     CARD8   	type;
    232     BOOL    	enabled;
    233     CARD16  	sequenceNumber;
    234     CARD32  	length;
    235     RECORD_ELEMENT_HEADER  elementHeader;
    236     CARD8	pad;
    237     CARD16	pad0;
    238     CARD32  	nClients;
    239     CARD32  	pad1;
    240     CARD32  	pad2;
    241     CARD32  	pad3;
    242     CARD32  	pad4;
    243 /* LISTofCLIENT_INFO */ 		/* intercepted-clients */
    244 } xRecordGetContextReply;
    245 #define sz_xRecordGetContextReply  	32
    246 
    247 /*
    248  * Enable data interception
    249  */
    250 typedef struct
    251 {
    252     CARD8     	reqType;
    253     CARD8     	recordReqType;
    254     CARD16    	length;
    255     RECORD_RC	context;
    256 } xRecordEnableContextReq;
    257 #define sz_xRecordEnableContextReq 	8
    258 
    259 typedef struct
    260 {
    261     CARD8		type;
    262     CARD8		category;
    263     CARD16		sequenceNumber;
    264     CARD32		length;
    265     RECORD_ELEMENT_HEADER  elementHeader;
    266     BOOL		clientSwapped;
    267     CARD16		pad1;
    268     RECORD_XIDBASE 	idBase;
    269     CARD32		serverTime;
    270     CARD32		recordedSequenceNumber;
    271     CARD32		pad3;
    272     CARD32		pad4;
    273     /* BYTE		data; */
    274 } xRecordEnableContextReply;
    275 #define sz_xRecordEnableContextReply 	32
    276 
    277 /*
    278  * Disable data interception
    279  */
    280 typedef struct
    281 {
    282     CARD8     	reqType;
    283     CARD8     	recordReqType;
    284     CARD16    	length;
    285     RECORD_RC 	context;
    286 } xRecordDisableContextReq;
    287 #define sz_xRecordDisableContextReq	8
    288 
    289 /*
    290  * Free RC
    291  */
    292 typedef struct
    293 {
    294     CARD8     	reqType;
    295     CARD8     	recordReqType;
    296     CARD16    	length;
    297     RECORD_RC 	context;
    298 } xRecordFreeContextReq;
    299 #define sz_xRecordFreeContextReq 	8
    300 
    301 #undef RECORD_RC
    302 #undef RECORD_XIDBASE
    303 #undef RECORD_ELEMENT_HEADER
    304 #undef RECORD_CLIENTSPEC
    305 
    306 #endif
    307