Xdbeproto.h
上传用户:lctgjx
上传日期:2022-06-04
资源大小:8887k
文件大小:9k
源码类别:

流媒体/Mpeg4/MP4

开发平台:

Visual C++

  1. /* $Xorg: Xdbeproto.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ */
  2. /******************************************************************************
  3.  * 
  4.  * Copyright (c) 1994, 1995  Hewlett-Packard Company
  5.  *
  6.  * Permission is hereby granted, free of charge, to any person obtaining
  7.  * a copy of this software and associated documentation files (the
  8.  * "Software"), to deal in the Software without restriction, including
  9.  * without limitation the rights to use, copy, modify, merge, publish,
  10.  * distribute, sublicense, and/or sell copies of the Software, and to
  11.  * permit persons to whom the Software is furnished to do so, subject to
  12.  * the following conditions:
  13.  * 
  14.  * The above copyright notice and this permission notice shall be included
  15.  * in all copies or substantial portions of the Software.
  16.  * 
  17.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  18.  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  19.  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  20.  * IN NO EVENT SHALL HEWLETT-PACKARD COMPANY BE LIABLE FOR ANY CLAIM,
  21.  * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
  22.  * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
  23.  * THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24.  * 
  25.  * Except as contained in this notice, the name of the Hewlett-Packard
  26.  * Company shall not be used in advertising or otherwise to promote the
  27.  * sale, use or other dealings in this Software without prior written
  28.  * authorization from the Hewlett-Packard Company.
  29.  * 
  30.  *     Header file for Xlib-related DBE
  31.  *
  32.  *****************************************************************************/
  33. #ifndef XDBE_PROTO_H
  34. #define XDBE_PROTO_H
  35. /* INCLUDES */
  36. /* DEFINES */
  37. /* Values for swap_action field of XdbeSwapInfo structure */
  38. #define XdbeUndefined    0
  39. #define XdbeBackground   1
  40. #define XdbeUntouched    2
  41. #define XdbeCopied       3
  42. #ifdef NEED_DBE_PROTOCOL
  43. #define DBE_PROTOCOL_NAME "DOUBLE-BUFFER"
  44. /* Current version numbers */
  45. #define DBE_MAJOR_VERSION       1
  46. #define DBE_MINOR_VERSION       0
  47. /* Used when adding extension; also used in Xdbe macros */
  48. #define DbeNumberEvents 0
  49. #define DbeBadBuffer 0
  50. #define DbeNumberErrors (DbeBadBuffer + 1)
  51. /* Request values used in (S)ProcDbeDispatch() */
  52. #define X_DbeGetVersion                 0
  53. #define X_DbeAllocateBackBufferName     1
  54. #define X_DbeDeallocateBackBufferName   2
  55. #define X_DbeSwapBuffers                3
  56. #define X_DbeBeginIdiom                 4
  57. #define X_DbeEndIdiom                   5
  58. #define X_DbeGetVisualInfo              6
  59. #define X_DbeGetBackBufferAttributes    7
  60. typedef CARD8  xDbeSwapAction;
  61. typedef CARD32 xDbeBackBuffer;
  62. #endif /* NEED_DBE_PROTOCOL */
  63. /* TYPEDEFS */
  64. /* Client data types */
  65. /* XdbeVisualInfo and XdbeScreenVisualInfo are defined in this file,
  66.  * "Xdbeproto.h", rather than "Xdbe.h" because the server uses these data
  67.  * types.
  68.  */
  69. typedef struct
  70. {
  71.     VisualID    visual;    /* one visual ID that supports double-buffering */
  72.     int         depth;     /* depth of visual in bits                      */
  73.     int         perflevel; /* performance level of visual                  */
  74. }
  75. XdbeVisualInfo;
  76. typedef struct
  77. {
  78.     int                 count;          /* number of items in visual_depth   */
  79.     XdbeVisualInfo      *visinfo;       /* list of visuals & depths for scrn */
  80. }
  81. XdbeScreenVisualInfo;
  82. /* Protocol data types */
  83. #ifdef NEED_DBE_PROTOCOL
  84. typedef struct
  85. {
  86.     CARD32 window B32; /* window      */
  87.     xDbeSwapAction swapAction; /* swap action */
  88.     CARD8 pad1; /* unused      */
  89.     CARD16 pad2 B16;
  90. } xDbeSwapInfo;
  91. typedef struct
  92. {
  93.     CARD32 visualID B32; /* associated visual      */
  94.     CARD8 depth; /* depth of visual        */
  95.     CARD8 perfLevel; /* performance level hint */
  96.     CARD16 pad1 B16;
  97. } xDbeVisInfo;
  98. #define sz_xDbeVisInfo 8
  99. typedef struct
  100. {
  101.     CARD32 n B32; /* number of visual info items in list  */
  102. } xDbeScreenVisInfo; /* followed by n xDbeVisInfo items */
  103. typedef struct
  104. {
  105.     CARD32 window B32; /* window */
  106. } xDbeBufferAttributes;
  107. /* Requests and replies */
  108. typedef struct
  109. {
  110.     CARD8 reqType; /* major-opcode: always codes->major_opcode */
  111.     CARD8 dbeReqType; /* minor-opcode: always X_DbeGetVersion (0) */
  112.     CARD16 length B16; /* request length: (2)                      */
  113.     CARD8 majorVersion; /* client-major-version                     */
  114.     CARD8 minorVersion; /* client-minor-version                     */
  115.     CARD16 unused B16; /* unused                                   */
  116. } xDbeGetVersionReq;
  117. #define sz_xDbeGetVersionReq 8
  118. typedef struct
  119. {
  120.     BYTE type; /* Reply: X_Reply (1)   */
  121.     CARD8 unused; /* unused               */
  122.     CARD16 sequenceNumber B16; /* sequence number      */
  123.     CARD32 length B32; /* reply length: (0)    */
  124.     CARD8 majorVersion; /* server-major-version */
  125.     CARD8 minorVersion; /* server-minor-version */
  126.     CARD16 pad1 B16; /* unused               */
  127.     CARD32 pad2 B32;
  128.     CARD32 pad3 B32;
  129.     CARD32 pad4 B32;
  130.     CARD32 pad5 B32;
  131.     CARD32 pad6 B32;
  132. } xDbeGetVersionReply;
  133. #define sz_xDbeGetVersionReply 32
  134. typedef struct
  135. {
  136.     CARD8 reqType; /* major-opcode: codes->major_opcode */
  137.     CARD8 dbeReqType; /* X_DbeAllocateBackBufferName (1)   */
  138.     CARD16 length B16; /* request length: (4)               */
  139.     CARD32 window B32; /* window                            */
  140.     xDbeBackBuffer buffer B32; /* back buffer name                  */
  141.     xDbeSwapAction swapAction; /* swap action hint                  */
  142.     CARD8 pad1; /* unused                            */
  143.     CARD16 pad2 B16;
  144. } xDbeAllocateBackBufferNameReq;
  145. #define sz_xDbeAllocateBackBufferNameReq 16
  146. typedef struct
  147. {
  148.     CARD8 reqType; /* major-opcode: codes->major_opcode */
  149.     CARD8 dbeReqType; /* X_DbeDeallocateBackBufferName (2) */
  150.     CARD16 length B16; /* request length: (2)               */
  151.     xDbeBackBuffer buffer B32; /* back buffer name                  */
  152. } xDbeDeallocateBackBufferNameReq;
  153. #define sz_xDbeDeallocateBackBufferNameReq 8
  154. typedef struct
  155. {
  156.     CARD8 reqType; /* major-opcode: always codes->major_opcode  */
  157.     CARD8 dbeReqType; /* minor-opcode: always X_DbeSwapBuffers (3) */
  158.     CARD16 length B16; /* request length: (2+2n)                    */
  159.     CARD32 n B32; /* n, number of window/swap action pairs     */
  160. } xDbeSwapBuffersReq; /* followed by n window/swap action pairs    */
  161. #define sz_xDbeSwapBuffersReq 8
  162. typedef struct
  163. {
  164.     CARD8 reqType; /* major-opcode: always codes->major_opcode */
  165.     CARD8 dbeReqType; /* minor-opcode: always X_DbeBeginIdom (4)  */
  166.     CARD16 length B16; /* request length: (1)                      */
  167. } xDbeBeginIdiomReq;
  168. #define sz_xDbeBeginIdiomReq 4
  169. typedef struct
  170. {
  171.     CARD8 reqType; /* major-opcode: always codes->major_opcode */
  172.     CARD8 dbeReqType; /* minor-opcode: always X_DbeEndIdom (5)    */
  173.     CARD16 length B16; /* request length: (1)                      */
  174. } xDbeEndIdiomReq;
  175. #define sz_xDbeEndIdiomReq 4
  176. typedef struct
  177. {
  178.     CARD8 reqType; /* always codes->major_opcode     */
  179.     CARD8 dbeReqType; /* always X_DbeGetVisualInfo (6)  */
  180.     CARD16 length B16; /* request length: (2+n)          */
  181.     CARD32 n B32; /* n, number of drawables in list */
  182. } xDbeGetVisualInfoReq; /* followed by n drawables        */
  183. #define sz_xDbeGetVisualInfoReq 8
  184. typedef struct
  185. {
  186.     BYTE type; /* Reply: X_Reply (1)                */
  187.     CARD8 unused; /* unused                            */
  188.     CARD16 sequenceNumber B16; /* sequence number                   */
  189.     CARD32 length B32; /* reply length                      */
  190.     CARD32 m; /* m, number of visual infos in list */
  191.     CARD32 pad1 B32; /* unused                            */
  192.     CARD32 pad2 B32;
  193.     CARD32 pad3 B32;
  194.     CARD32 pad4 B32;
  195.     CARD32 pad5 B32;
  196. } xDbeGetVisualInfoReply; /* followed by m visual infos        */
  197. #define sz_xDbeGetVisualInfoReply 32
  198. typedef struct
  199. {
  200.     CARD8 reqType; /* always codes->major_opcode       */
  201.     CARD8 dbeReqType; /* X_DbeGetBackBufferAttributes (7) */
  202.     CARD16 length B16; /* request length: (2)              */
  203.     xDbeBackBuffer buffer B32; /* back buffer name                 */
  204. } xDbeGetBackBufferAttributesReq;
  205. #define sz_xDbeGetBackBufferAttributesReq 8
  206. typedef struct
  207. {
  208.     BYTE type; /* Reply: X_Reply (1) */
  209.     CARD8 unused; /* unused             */
  210.     CARD16 sequenceNumber B16; /* sequence number    */
  211.     CARD32 length B32; /* reply length: (0)  */
  212.     CARD32 attributes; /* attributes         */
  213.     CARD32 pad1 B32; /* unused             */
  214.     CARD32 pad2 B32;
  215.     CARD32 pad3 B32;
  216.     CARD32 pad4 B32;
  217.     CARD32 pad5 B32;
  218. } xDbeGetBackBufferAttributesReply;
  219. #define sz_xDbeGetBackBufferAttributesReply 32
  220. #endif /* NEED_DBE_PROTOCOL */
  221. #endif /* XDBE_PROTO_H */