Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
11 KiB

  1. /**************************************************************************
  2. *
  3. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4. * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5. * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6. * PURPOSE.
  7. *
  8. * Copyright (c) 1994 - 1995 Microsoft Corporation\Intel. All Rights Reserved.
  9. *
  10. **************************************************************************/
  11. /*******************************************************************
  12. *
  13. * FILE: dciddi.h
  14. *
  15. * DESCRIPTION: definitions for MS/Intel-defined DCI interface
  16. *
  17. *******************************************************************/
  18. #ifndef _INC_DCIDDI
  19. #define _INC_DCIDDI
  20. #ifdef __cplusplus
  21. extern "C" {
  22. #endif
  23. /* DCI Command Escapes */
  24. #define DCICOMMAND 3075
  25. #define DCI_VERSION 0x0100
  26. #define DCICREATEPRIMARYSURFACE 1
  27. #define DCICREATEOFFSCREENSURFACE 2
  28. #define DCICREATEOVERLAYSURFACE 3
  29. #define DCIENUMSURFACE 4
  30. #define DCIESCAPE 5
  31. /* DCI-Defined error codes */
  32. #define DCI_OK 0 /* success */
  33. /* Hard errors -- DCI will be unavailable */
  34. #define DCI_FAIL_GENERIC -1
  35. #define DCI_FAIL_UNSUPPORTEDVERSION -2
  36. #define DCI_FAIL_INVALIDSURFACE -3
  37. #define DCI_FAIL_UNSUPPORTED -4
  38. /* Soft errors -- DCI may be available later */
  39. #define DCI_ERR_CURRENTLYNOTAVAIL -5
  40. #define DCI_ERR_INVALIDRECT -6
  41. #define DCI_ERR_UNSUPPORTEDFORMAT -7
  42. #define DCI_ERR_UNSUPPORTEDMASK -8
  43. #define DCI_ERR_TOOBIGHEIGHT -9
  44. #define DCI_ERR_TOOBIGWIDTH -10
  45. #define DCI_ERR_TOOBIGSIZE -11
  46. #define DCI_ERR_OUTOFMEMORY -12
  47. #define DCI_ERR_INVALIDPOSITION -13
  48. #define DCI_ERR_INVALIDSTRETCH -14
  49. #define DCI_ERR_INVALIDCLIPLIST -15
  50. #define DCI_ERR_SURFACEISOBSCURED -16
  51. #define DCI_ERR_XALIGN -17
  52. #define DCI_ERR_YALIGN -18
  53. #define DCI_ERR_XYALIGN -19
  54. #define DCI_ERR_WIDTHALIGN -20
  55. #define DCI_ERR_HEIGHTALIGN -21
  56. /* success messages -- DCI call succeeded, but specified item changed */
  57. #define DCI_STATUS_POINTERCHANGED 1
  58. #define DCI_STATUS_STRIDECHANGED 2
  59. #define DCI_STATUS_FORMATCHANGED 4
  60. #define DCI_STATUS_SURFACEINFOCHANGED 8
  61. #define DCI_STATUS_CHROMAKEYCHANGED 16
  62. #define DCI_STATUS_WASSTILLDRAWING 32
  63. /* DCI Capability Flags */
  64. #define DCI_SURFACE_TYPE 0x0000000F
  65. #define DCI_PRIMARY 0x00000000
  66. #define DCI_OFFSCREEN 0x00000001
  67. #define DCI_OVERLAY 0x00000002
  68. #define DCI_VISIBLE 0x00000010
  69. #define DCI_CHROMAKEY 0x00000020
  70. #define DCI_1632_ACCESS 0x00000040
  71. #define DCI_DWORDSIZE 0x00000080
  72. #define DCI_DWORDALIGN 0x00000100
  73. #define DCI_WRITEONLY 0x00000200
  74. #define DCI_ASYNC 0x00000400
  75. #define DCI_CAN_STRETCHX 0x00001000
  76. #define DCI_CAN_STRETCHY 0x00002000
  77. #define DCI_CAN_STRETCHXY (DCI_CAN_STRETCHX | DCI_CAN_STRETCHY)
  78. #define DCI_CAN_STRETCHXN 0x00004000
  79. #define DCI_CAN_STRETCHYN 0x00008000
  80. #define DCI_CAN_STRETCHXYN (DCI_CAN_STRETCHXN | DCI_CAN_STRETCHYN)
  81. #define DCI_CANOVERLAY 0x00010000
  82. /*
  83. * Win32 RGNDATA structure. This will be used for cliplist info. passing.
  84. */
  85. #if (WINVER < 0x0400)
  86. #ifndef RDH_RECTANGLES
  87. typedef struct tagRECTL
  88. {
  89. LONG left;
  90. LONG top;
  91. LONG right;
  92. LONG bottom;
  93. } RECTL;
  94. typedef RECTL* PRECTL;
  95. typedef RECTL NEAR* NPRECTL;
  96. typedef RECTL FAR* LPRECTL;
  97. typedef const RECTL FAR* LPCRECTL;
  98. #define RDH_RECTANGLES 1
  99. typedef struct tagRGNDATAHEADER {
  100. DWORD dwSize; /* size of structure */
  101. DWORD iType; /* Will be RDH_RECTANGLES */
  102. DWORD nCount; /* # of clipping rectangles */
  103. DWORD nRgnSize; /* size of buffer -- can be zero */
  104. RECTL rcBound; /* bounding rectangle for region*/
  105. } RGNDATAHEADER;
  106. typedef RGNDATAHEADER* PRGNDATAHEADER;
  107. typedef RGNDATAHEADER NEAR* NPRGNDATAHEADER;
  108. typedef RGNDATAHEADER FAR* LPRGNDATAHEADER;
  109. typedef const RGNDATAHEADER FAR* LPCRGNDATAHEADER;
  110. typedef struct tagRGNDATA {
  111. RGNDATAHEADER rdh;
  112. char Buffer[1];
  113. } RGNDATA;
  114. typedef RGNDATA* PRGNDATA;
  115. typedef RGNDATA NEAR* NPRGNDATA;
  116. typedef RGNDATA FAR* LPRGNDATA;
  117. typedef const RGNDATA FAR* LPCRGNDATA;
  118. #endif
  119. #endif
  120. typedef int DCIRVAL; /* return for callbacks */
  121. /**************************************************************************
  122. * input structures
  123. **************************************************************************/
  124. /*
  125. * Used by a DCI client to provide input parameters for the
  126. * DCICREATEPRIMARYSURFACE escape.
  127. */
  128. typedef struct _DCICMD {
  129. DWORD dwCommand;
  130. DWORD dwParam1;
  131. DWORD dwParam2;
  132. DWORD dwVersion;
  133. DWORD dwReserved;
  134. } DCICMD;
  135. typedef DCICMD FAR *LPDCICMD;
  136. /*
  137. * This structure is used by a DCI client to provide input parameters for
  138. * the DCICREATE... calls. The fields that are actually relevant differ for
  139. * each of the three calls. Details are in the DCI Spec chapter providing
  140. * the function specifications.
  141. */
  142. typedef struct _DCICREATEINPUT {
  143. DCICMD cmd; /* common header structure */
  144. DWORD dwCompression; /* format of surface to be created */
  145. DWORD dwMask[3]; /* for nonstandard RGB (e.g. 5-6-5, RGB32) */
  146. DWORD dwWidth; /* height of the surface to be created */
  147. DWORD dwHeight; /* width of input surfaces */
  148. DWORD dwDCICaps; /* capabilities of surface wanted */
  149. DWORD dwBitCount; /* bit depth of format to be created */
  150. LPVOID lpSurface; /* pointer to an associated surface */
  151. } DCICREATEINPUT, FAR *LPDCICREATEINPUT;
  152. /**************************************************************************
  153. * surface info. structures
  154. **************************************************************************/
  155. /*
  156. * This structure is used to return information about available support
  157. * during a DCIEnumSurface call. It is also used to create a primary
  158. * surface, and as a member of the larger structures returned by the
  159. * offscreen and overlay calls.
  160. */
  161. typedef struct _DCISURFACEINFO {
  162. DWORD dwSize; /* size of structure */
  163. DWORD dwDCICaps; /* capability flags (stretch, etc.) */
  164. DWORD dwCompression; /* format of surface to be created */
  165. DWORD dwMask[3]; /* for BI_BITMASK surfaces */
  166. DWORD dwWidth; /* width of surface */
  167. DWORD dwHeight; /* height of surface */
  168. LONG lStride; /* distance in bytes betw. one pixel */
  169. /* and the pixel directly below it */
  170. DWORD dwBitCount; /* Bits per pixel for this dwCompression */
  171. DWORD dwOffSurface; /* offset of surface pointer */
  172. WORD wSelSurface; /* selector of surface pointer */
  173. WORD wReserved;
  174. DWORD dwReserved1; /* reserved for provider */
  175. DWORD dwReserved2; /* reserved for DCIMAN */
  176. DWORD dwReserved3; /* reserved for future */
  177. DCIRVAL (CALLBACK *BeginAccess) (LPVOID, LPRECT); /* BeginAccess callback */
  178. void (CALLBACK *EndAccess) (LPVOID); /* EndAcess callback */
  179. void (CALLBACK *DestroySurface) (LPVOID); /* Destroy surface callback */
  180. } DCISURFACEINFO, FAR *LPDCISURFACEINFO;
  181. /*
  182. * This structure is used by a DCI client to provide input parameters for the
  183. * DCIEnumSurface call.
  184. */
  185. typedef struct _DCIENUMINPUT {
  186. DCICMD cmd; /* common header structure */
  187. RECT rSrc; /* source rect. for stretch */
  188. RECT rDst; /* dest. rect. for stretch */
  189. void (CALLBACK *EnumCallback)(LPDCISURFACEINFO, LPVOID); /* callback for supported formats */
  190. LPVOID lpContext;
  191. } DCIENUMINPUT, FAR *LPDCIENUMINPUT;
  192. /*
  193. * This structure must be allocated and returned by the DCI provider in
  194. * response to a DCICREATEPRIMARYSURFACE call.
  195. */
  196. typedef DCISURFACEINFO DCIPRIMARY, FAR *LPDCIPRIMARY;
  197. /*
  198. * This structure must be allocated and returned by the DCI provider in
  199. * response to a DCICREATEOFFSCREENSURFACE call.
  200. */
  201. typedef struct _DCIOFFSCREEN {
  202. DCISURFACEINFO dciInfo; /* surface info */
  203. DCIRVAL (CALLBACK *Draw) (LPVOID); /* copy to onscreen buffer */
  204. DCIRVAL (CALLBACK *SetClipList) (LPVOID, LPRGNDATA); /* SetCliplist callback */
  205. DCIRVAL (CALLBACK *SetDestination) (LPVOID, LPRECT, LPRECT); /* SetDestination callback */
  206. } DCIOFFSCREEN, FAR *LPDCIOFFSCREEN;
  207. /*
  208. * This structure must be allocated and returned by the DCI provider in response
  209. * to a DCICREATEOVERLAYSURFACE call.
  210. */
  211. typedef struct _DCIOVERLAY{
  212. DCISURFACEINFO dciInfo; /* surface info */
  213. DWORD dwChromakeyValue; /* chromakey color value */
  214. DWORD dwChromakeyMask; /* specifies valid bits of value */
  215. } DCIOVERLAY, FAR *LPDCIOVERLAY;
  216. /* DCI FOURCC def.s for extended DIB formats */
  217. #ifndef YVU9
  218. #define YVU9 mmioFOURCC('Y','V','U','9')
  219. #endif
  220. #ifndef Y411
  221. #define Y411 mmioFOURCC('Y','4','1','1')
  222. #endif
  223. #ifndef YUY2
  224. #define YUY2 mmioFOURCC('Y','U','Y','2')
  225. #endif
  226. #ifndef YVYU
  227. #define YVYU mmioFOURCC('Y','V','Y','U')
  228. #endif
  229. #ifndef UYVY
  230. #define UYVY mmioFOURCC('U','Y','V','Y')
  231. #endif
  232. #ifndef Y211
  233. #define Y211 mmioFOURCC('Y','2','1','1')
  234. #endif
  235. #ifdef __cplusplus
  236. }
  237. #endif
  238. #endif // _INC_DCIDDI