home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-bin / x11r6.1 / include / x11 / extensions / record.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-10-17  |  5.8 KB  |  240 lines

  1. /* 
  2. $XConsortium: record.h /main/4 1996/01/31 20:28:22 dpw $
  3. */
  4.  
  5. /***************************************************************************
  6.  * Copyright 1995 Network Computing Devices
  7.  *
  8.  * Permission to use, copy, modify, distribute, and sell this software and
  9.  * its documentation for any purpose is hereby granted without fee, provided
  10.  * that the above copyright notice appear in all copies and that both that
  11.  * copyright notice and this permission notice appear in supporting
  12.  * documentation, and that the name of Network Computing Devices 
  13.  * not be used in advertising or publicity pertaining to distribution
  14.  * of the software without specific, written prior permission.
  15.  *
  16.  * NETWORK COMPUTING DEVICES DISCLAIMs ALL WARRANTIES WITH REGARD TO 
  17.  * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 
  18.  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE 
  19.  * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 
  20.  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 
  21.  * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 
  22.  * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  23.  **************************************************************************/
  24. #ifndef _RECORD_H_
  25. #define _RECORD_H_
  26.  
  27. #define XRecordBadContext       0    /* Not a valid RC */
  28.  
  29. /*
  30.  * Constants for arguments of various requests
  31.  */
  32. #define    XRecordFromServerTime        0x01
  33. #define    XRecordFromClientTime        0x02
  34. #define    XRecordFromClientSequence    0x04
  35.  
  36. #define XRecordCurrentClients        1
  37. #define XRecordFutureClients        2
  38. #define XRecordAllClients        3
  39.  
  40. #define XRecordFromServer               0
  41. #define XRecordFromClient               1
  42. #define XRecordClientStarted               2
  43. #define XRecordClientDied               3
  44. #define XRecordStartOfData        4
  45. #define XRecordEndOfData        5
  46.  
  47. typedef unsigned long   XRecordClientSpec;
  48.  
  49. #ifndef _XRECORD_SERVER_
  50.  
  51. typedef unsigned long     XRecordContext;
  52.  
  53. typedef struct
  54. {
  55.     unsigned char     first;
  56.     unsigned char     last;
  57. } XRecordRange8;
  58.  
  59. typedef struct
  60. {
  61.     unsigned short     first;
  62.     unsigned short     last;
  63. } XRecordRange16; 
  64.  
  65. typedef struct
  66. {
  67.     XRecordRange8    ext_major;
  68.     XRecordRange16     ext_minor; 
  69. } XRecordExtRange; 
  70.  
  71. typedef struct
  72. {
  73.     XRecordRange8     core_requests;    /* core X requests */
  74.     XRecordRange8     core_replies;    /* core X replies */
  75.     XRecordExtRange   ext_requests;    /* extension requests */
  76.     XRecordExtRange   ext_replies;    /* extension replies */
  77.     XRecordRange8     delivered_events;    /* delivered core and ext events */
  78.     XRecordRange8     device_events;     /* all core and ext device events */
  79.     XRecordRange8     errors;        /* core X and ext errors */
  80.     Bool          client_started;    /* connection setup reply */
  81.     Bool              client_died;     /* notice of client disconnect */    
  82. } XRecordRange;
  83.  
  84. typedef struct
  85. {
  86.     XRecordClientSpec     client;
  87.     unsigned long     nranges; 
  88.     XRecordRange     **ranges;
  89. } XRecordClientInfo;
  90.  
  91. typedef struct
  92. {
  93.     Bool         enabled;
  94.     int            datum_flags; 
  95.     unsigned long     nclients; 
  96.     XRecordClientInfo     **client_info;
  97. } XRecordState;
  98.  
  99. typedef struct
  100. {
  101.     XID         id_base;
  102.     Time        server_time; 
  103.     unsigned long     client_seq;
  104.     int            category; 
  105.     Bool         client_swapped;
  106.     unsigned char     *data;
  107.     unsigned long     data_len;    /* in 4-byte units */
  108. } XRecordInterceptData;
  109.  
  110. _XFUNCPROTOBEGIN
  111.  
  112. /*********************************************************
  113.  *
  114.  * Prototypes 
  115.  *
  116.  */
  117.  
  118. XID XRecordIdBaseMask(
  119. #if NeedFunctionPrototypes
  120.     Display *dpy
  121. #endif
  122. );
  123.  
  124. extern Status XRecordQueryVersion(
  125. #if NeedFunctionPrototypes
  126.     Display*             /* dpy */,
  127.     int*             /* cmajor_return */, 
  128.     int*            /* cminor_return */  
  129. #endif
  130. );
  131.  
  132. extern XRecordContext XRecordCreateContext(
  133. #if NeedFunctionPrototypes
  134.     Display*            /* dpy */, 
  135.     int                /* datum_flags */, 
  136.     XRecordClientSpec*        /* clients */,
  137.     int                /* nclients */,     
  138.     XRecordRange**              /* ranges */,
  139.     int                /* nranges */
  140. #endif
  141. );
  142.  
  143. extern XRecordRange *XRecordAllocRange(
  144. #if NeedFunctionPrototypes
  145.     void
  146. #endif
  147. );
  148.  
  149. extern Status XRecordRegisterClients(
  150. #if NeedFunctionPrototypes
  151.     Display*             /* dpy */, 
  152.     XRecordContext         /* context */, 
  153.     int                /* datum_flags */,
  154.     XRecordClientSpec*        /* clients */,
  155.     int                /* nclients */, 
  156.     XRecordRange**         /* ranges */,  
  157.     int                /* nranges */
  158. #endif
  159. );
  160.  
  161. extern Status XRecordUnregisterClients(
  162. #if NeedFunctionPrototypes
  163.     Display*             /* dpy */, 
  164.     XRecordContext         /* context */, 
  165.     XRecordClientSpec*        /* clients */,
  166.     int                /* nclients */ 
  167. #endif
  168. );
  169.  
  170. extern Status XRecordGetContext(
  171. #if NeedFunctionPrototypes
  172.     Display*            /* dpy */,
  173.     XRecordContext         /* context */, 
  174.     XRecordState**         /* state_return */ 
  175. #endif
  176. );
  177.  
  178. extern void XRecordFreeState(
  179. #if NeedFunctionPrototypes
  180. XRecordState*            /* state */
  181. #endif
  182. ); 
  183.  
  184. typedef void (*XRecordInterceptProc) (
  185. #if NeedFunctionPrototypes
  186.     XPointer            /* closure */, 
  187.     XRecordInterceptData*    /* recorded_data */
  188. #endif
  189. );
  190.  
  191. extern Status XRecordEnableContext(
  192. #if NeedFunctionPrototypes
  193.     Display*            /* dpy */,
  194.     XRecordContext         /* context */, 
  195.     XRecordInterceptProc    /* callback */,
  196.     XPointer            /* closure */
  197. #endif
  198. ); 
  199.  
  200. extern Status XRecordEnableContextAsync(
  201. #if NeedFunctionPrototypes
  202.     Display*            /* dpy */,
  203.     XRecordContext         /* context */, 
  204.     XRecordInterceptProc    /* callback */,
  205.     XPointer            /* closure */
  206. #endif
  207. ); 
  208.  
  209. extern void XRecordProcessReplies(
  210. #if NeedFunctionPrototypes
  211.     Display*            /* dpy */
  212. #endif
  213. ); 
  214.  
  215. extern void XRecordFreeData(
  216. #if NeedFunctionPrototypes
  217. XRecordInterceptData*    /* data */
  218. #endif
  219. ); 
  220.  
  221. extern Status XRecordDisableContext(
  222. #if NeedFunctionPrototypes
  223.     Display*            /* dpy */,
  224.     XRecordContext         /* context */
  225. #endif
  226. ); 
  227.  
  228. extern Status XRecordFreeContext(
  229. #if NeedFunctionPrototypes
  230.     Display*             /* dpy */, 
  231.     XRecordContext         /* context */
  232. #endif
  233. );
  234.  
  235. _XFUNCPROTOEND
  236.  
  237. #endif /* _XRECORD_SERVER_ */
  238.  
  239. #endif /* _RECORD_H_ */
  240.