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

  1. /*
  2.  * $XConsortium: multibuf.h,v 1.18 94/04/17 20:11:21 dpw Exp $
  3.  *
  4. Copyright (c) 1989  X Consortium
  5.  
  6. Permission is hereby granted, free of charge, to any person obtaining a copy
  7. of this software and associated documentation files (the "Software"), to deal
  8. in the Software without restriction, including without limitation the rights
  9. to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  10. copies of the Software, and to permit persons to whom the Software is
  11. furnished to do so, subject to the following conditions:
  12.  
  13. The above copyright notice and this permission notice shall be included in
  14. all copies or substantial portions of the Software.
  15.  
  16. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  17. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  18. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  19. X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  20. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  21. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  22.  
  23. Except as contained in this notice, the name of the X Consortium shall not be
  24. used in advertising or otherwise to promote the sale, use or other dealings
  25. in this Software without prior written authorization from the X Consortium.
  26.  */
  27.  
  28. #ifndef _MULTIBUF_H_
  29. #define _MULTIBUF_H_
  30.  
  31. #include <X11/Xfuncproto.h>
  32.  
  33. #define MULTIBUFFER_PROTOCOL_NAME "Multi-Buffering"
  34.  
  35. #define MULTIBUFFER_MAJOR_VERSION    1    /* current version numbers */
  36. #define MULTIBUFFER_MINOR_VERSION    1    /* has ClearImageBufferArea */
  37.  
  38. #define X_MbufGetBufferVersion        0
  39. #define X_MbufCreateImageBuffers    1
  40. #define X_MbufDestroyImageBuffers    2
  41. #define X_MbufDisplayImageBuffers    3
  42. #define X_MbufSetMBufferAttributes    4
  43. #define X_MbufGetMBufferAttributes    5
  44. #define X_MbufSetBufferAttributes    6
  45. #define X_MbufGetBufferAttributes    7
  46. #define X_MbufGetBufferInfo        8
  47. #define X_MbufCreateStereoWindow    9
  48. #define X_MbufClearImageBufferArea    10
  49.  
  50. /*
  51.  * update_action field
  52.  */
  53. #define MultibufferUpdateActionUndefined    0
  54. #define MultibufferUpdateActionBackground    1
  55. #define MultibufferUpdateActionUntouched    2
  56. #define MultibufferUpdateActionCopied        3
  57.  
  58. /*
  59.  * update_hint field
  60.  */
  61. #define MultibufferUpdateHintFrequent        0
  62. #define MultibufferUpdateHintIntermittent    1
  63. #define MultibufferUpdateHintStatic        2
  64.  
  65. /*
  66.  * valuemask fields
  67.  */
  68. #define MultibufferWindowUpdateHint    (1L << 0)
  69. #define MultibufferBufferEventMask    (1L << 0)
  70.  
  71. /*
  72.  * mono vs. stereo and left vs. right
  73.  */
  74. #define MultibufferModeMono        0
  75. #define MultibufferModeStereo        1
  76. #define MultibufferSideMono        0
  77. #define MultibufferSideLeft          1
  78. #define MultibufferSideRight        2
  79.  
  80. /*
  81.  * clobber state
  82.  */
  83. #define MultibufferUnclobbered        0
  84. #define MultibufferPartiallyClobbered    1
  85. #define MultibufferFullyClobbered    2
  86.  
  87. /*
  88.  * event stuff
  89.  */
  90. #define MultibufferClobberNotifyMask    0x02000000
  91. #define MultibufferUpdateNotifyMask    0x04000000
  92.  
  93. #define MultibufferClobberNotify    0
  94. #define MultibufferUpdateNotify        1
  95. #define MultibufferNumberEvents        (MultibufferUpdateNotify + 1)
  96.  
  97. #define MultibufferBadBuffer        0
  98. #define MultibufferNumberErrors        (MultibufferBadBuffer + 1)
  99.  
  100.  
  101. #ifndef _MULTIBUF_SERVER_
  102. /*
  103.  * Extra definitions that will only be needed in the client
  104.  */
  105. typedef XID Multibuffer;
  106.  
  107. typedef struct {
  108.     int    type;            /* of event */
  109.     unsigned long serial;   /* # of last request processed by server */
  110.     int send_event;        /* true if this came frome a SendEvent request */
  111.     Display *display;        /* Display the event was read from */
  112.     Multibuffer buffer;        /* buffer of event */
  113.     int    state;            /* see Clobbered constants above */
  114. } XmbufClobberNotifyEvent;
  115.  
  116. typedef struct {
  117.     int    type;            /* of event */
  118.     unsigned long serial;   /* # of last request processed by server */
  119.     int send_event;        /* true if this came frome a SendEvent request */
  120.     Display *display;        /* Display the event was read from */
  121.     Multibuffer buffer;        /* buffer of event */
  122. } XmbufUpdateNotifyEvent;
  123.  
  124.  
  125. /*
  126.  * per-window attributes that can be got
  127.  */
  128. typedef struct {
  129.     int displayed_index;    /* which buffer is being displayed */
  130.     int update_action;        /* Undefined, Background, Untouched, Copied */
  131.     int update_hint;        /* Frequent, Intermittent, Static */
  132.     int window_mode;        /* Mono, Stereo */
  133.     int nbuffers;        /* Number of buffers */
  134.     Multibuffer *buffers;    /* Buffers */
  135. } XmbufWindowAttributes;
  136.  
  137. /*
  138.  * per-window attributes that can be set
  139.  */
  140. typedef struct {
  141.     int update_hint;        /* Frequent, Intermittent, Static */
  142. } XmbufSetWindowAttributes;
  143.  
  144.  
  145. /*
  146.  * per-buffer attributes that can be got
  147.  */
  148. typedef struct {
  149.     Window window;        /* which window this belongs to */
  150.     unsigned long event_mask;    /* events that have been selected */
  151.     int buffer_index;        /* which buffer is this */
  152.     int side;            /* Mono, Left, Right */
  153. } XmbufBufferAttributes;
  154.  
  155. /*
  156.  * per-buffer attributes that can be set
  157.  */
  158. typedef struct {
  159.     unsigned long event_mask;    /* events that have been selected */
  160. } XmbufSetBufferAttributes;
  161.  
  162.  
  163. /*
  164.  * per-screen buffer info (there will be lists of them)
  165.  */
  166. typedef struct {
  167.     VisualID visualid;        /* visual usuable at this depth */
  168.     int max_buffers;        /* most buffers for this visual */
  169.     int depth;            /* depth of buffers to be created */
  170. } XmbufBufferInfo;
  171.  
  172. _XFUNCPROTOBEGIN
  173.  
  174. extern Bool XmbufQueryExtension(
  175. #if NeedFunctionPrototypes
  176.     Display*        /* dpy */,
  177.     int*        /* event_base_return */,
  178.     int*        /* error_base_return */
  179. #endif
  180. );
  181.  
  182. extern Status XmbufGetVersion(
  183. #if NeedFunctionPrototypes
  184.     Display*        /* dpy */,
  185.     int*        /* major_version_return */,
  186.     int*        /* minor_version_return */
  187. #endif
  188. );
  189.  
  190. extern int XmbufCreateBuffers(
  191. #if NeedFunctionPrototypes
  192.     Display*        /* dpy */,
  193.     Window        /* w */,
  194.     int            /* count */,
  195.     int            /* update_action */,
  196.     int            /* update_hint */,
  197.     Multibuffer*    /* buffers */
  198. #endif
  199. );
  200.  
  201. extern void XmbufDestroyBuffers(
  202. #if NeedFunctionPrototypes
  203.     Display*        /* dpy */,
  204.     Window        /* window */
  205. #endif
  206. );
  207.  
  208. extern void XmbufDisplayBuffers(
  209. #if NeedFunctionPrototypes
  210.     Display*        /* dpy */,
  211.     int            /* count */,
  212.     Multibuffer*    /* buffers */,
  213.     int            /* min_delay */,
  214.     int            /* max_delay */
  215. #endif
  216. );
  217.  
  218. extern Status XmbufGetWindowAttributes(
  219. #if NeedFunctionPrototypes
  220.     Display*            /* dpy */,
  221.     Window            /* w */,
  222.     XmbufWindowAttributes*    /* attr */
  223. #endif
  224. );
  225.  
  226. extern void XmbufChangeWindowAttributes(
  227. #if NeedFunctionPrototypes
  228.     Display*            /* dpy */,
  229.     Window            /* w */,
  230.     unsigned long        /* valuemask */,
  231.     XmbufSetWindowAttributes*    /* attr */
  232. #endif
  233. );
  234.  
  235. extern Status XmbufGetBufferAttributes(
  236. #if NeedFunctionPrototypes
  237.     Display*            /* dpy */,
  238.     Multibuffer            /* b */,
  239.     XmbufBufferAttributes*    /* attr */
  240. #endif
  241. );
  242.  
  243. extern void XmbufChangeBufferAttributes(
  244. #if NeedFunctionPrototypes
  245.     Display*            /* dpy */,
  246.     Multibuffer            /* b */,
  247.     unsigned long        /* valuemask */,
  248.     XmbufSetBufferAttributes*    /* attr */
  249. #endif
  250. );
  251.  
  252. extern Status XmbufGetScreenInfo(
  253. #if NeedFunctionPrototypes
  254.     Display*            /* dpy */,
  255.     Drawable            /* d */,
  256.     int*            /* nmono_return */,
  257.     XmbufBufferInfo**        /* mono_info_return */,
  258.     int*            /* nstereo_return */,
  259.     XmbufBufferInfo**        /* stereo_info_return */
  260. #endif
  261. );
  262.  
  263. extern Window XmbufCreateStereoWindow(
  264. #if NeedFunctionPrototypes
  265.     Display*            /* dpy */,
  266.     Window            /* parent */,
  267.     int                /* x */,
  268.     int                /* y */,
  269.     unsigned int        /* width */,
  270.     unsigned int        /* height */,
  271.     unsigned int        /* border_width */,
  272.     int                /* depth */,
  273.     unsigned int        /* class */,
  274.     Visual*            /* visual */,
  275.     unsigned long        /* valuemask */,
  276.     XSetWindowAttributes*    /* attr */,
  277.     Multibuffer*        /* leftp */,
  278.     Multibuffer*        /* rightp */
  279. #endif
  280. );
  281.  
  282. extern void XmbufClearBufferArea(
  283. #if NeedFunctionPrototypes
  284.     Display*            /* dpy */,
  285.     Multibuffer            /* buffer */,
  286.     int                /* x */,
  287.     int                /* y */,
  288.     unsigned int        /* width */,
  289.     unsigned int        /* height */,
  290.     Bool            /* exposures */
  291. #endif
  292. );
  293.  
  294. _XFUNCPROTOEND
  295.  
  296. #else
  297.  
  298. typedef Bool    (* mbInitFunc)();
  299. extern void    RegisterMultibufferInit();
  300. extern void    RegisterDoubleBufferHardware();
  301.  
  302. extern int    CreateImageBuffers ();
  303. extern void    DestroyImageBuffers ();
  304. extern int    DisplayImageBuffers ();
  305.  
  306. #endif /* _MULTIBUF_SERVER_ */
  307. #endif /* _MULTIBUF_H_ */
  308.