Sync with trunk head (part 1 or 2)
[reactos.git] / include / ddk / dciddi.h
1 #pragma once
2
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 /* DCI Command Escape */
8 #define DCICOMMAND 3075
9 #define DCI_VERSION 0x0100
10
11 #define DCICREATEPRIMARYSURFACE 1
12 #define DCICREATEOFFSCREENSURFACE 2
13 #define DCICREATEOVERLAYSURFACE 3
14 #define DCIENUMSURFACE 4
15 #define DCIESCAPE 5
16
17 /* DCI Errors */
18 #define DCI_OK 0
19 #define DCI_FAIL_GENERIC -1
20 #define DCI_FAIL_UNSUPPORTEDVERSION -2
21 #define DCI_FAIL_INVALIDSURFACE -3
22 #define DCI_FAIL_UNSUPPORTED -4
23 #define DCI_ERR_CURRENTLYNOTAVAIL -5
24 #define DCI_ERR_INVALIDRECT -6
25 #define DCI_ERR_UNSUPPORTEDFORMAT -7
26 #define DCI_ERR_UNSUPPORTEDMASK -8
27 #define DCI_ERR_TOOBIGHEIGHT -9
28 #define DCI_ERR_TOOBIGWIDTH -10
29 #define DCI_ERR_TOOBIGSIZE -11
30 #define DCI_ERR_OUTOFMEMORY -12
31 #define DCI_ERR_INVALIDPOSITION -13
32 #define DCI_ERR_INVALIDSTRETCH -14
33 #define DCI_ERR_INVALIDCLIPLIST -15
34 #define DCI_ERR_SURFACEISOBSCURED -16
35 #define DCI_ERR_XALIGN -17
36 #define DCI_ERR_YALIGN -18
37 #define DCI_ERR_XYALIGN -19
38 #define DCI_ERR_WIDTHALIGN -20
39 #define DCI_ERR_HEIGHTALIGN -21
40
41 #define DCI_STATUS_POINTERCHANGED 1
42 #define DCI_STATUS_STRIDECHANGED 2
43 #define DCI_STATUS_FORMATCHANGED 4
44 #define DCI_STATUS_SURFACEINFOCHANGED 8
45 #define DCI_STATUS_CHROMAKEYCHANGED 16
46 #define DCI_STATUS_WASSTILLDRAWING 32
47
48 #define DCI_SUCCESS(error) (((DCIRVAL)error) >= 0)
49
50 /* DCI Capability Flags */
51 #define DCI_SURFACE_TYPE 0x0000000F
52 #define DCI_PRIMARY 0x00000000
53 #define DCI_OFFSCREEN 0x00000001
54 #define DCI_OVERLAY 0x00000002
55 #define DCI_VISIBLE 0x00000010
56 #define DCI_CHROMAKEY 0x00000020
57 #define DCI_1632_ACCESS 0x00000040
58 #define DCI_DWORDSIZE 0x00000080
59 #define DCI_DWORDALIGN 0x00000100
60 #define DCI_WRITEONLY 0x00000200
61 #define DCI_ASYNC 0x00000400
62 #define DCI_CAN_STRETCHX 0x00001000
63 #define DCI_CAN_STRETCHY 0x00002000
64 #define DCI_CAN_STRETCHXY (DCI_CAN_STRETCHX | DCI_CAN_STRETCHY)
65 #define DCI_CAN_STRETCHXN 0x00004000
66 #define DCI_CAN_STRETCHYN 0x00008000
67 #define DCI_CAN_STRETCHXYN (DCI_CAN_STRETCHXN | DCI_CAN_STRETCHYN)
68 #define DCI_CANOVERLAY 0x00010000
69
70 /* DCI FOURCC definitions for extended DIB formats */
71 #ifndef YVU9
72 #define YVU9 mmioFOURCC('Y','V','U','9')
73 #endif
74 #ifndef Y411
75 #define Y411 mmioFOURCC('Y','4','1','1')
76 #endif
77 #ifndef YUY2
78 #define YUY2 mmioFOURCC('Y','U','Y','2')
79 #endif
80 #ifndef YVYU
81 #define YVYU mmioFOURCC('Y','V','Y','U')
82 #endif
83 #ifndef UYVY
84 #define UYVY mmioFOURCC('U','Y','V','Y')
85 #endif
86 #ifndef Y211
87 #define Y211 mmioFOURCC('Y','2','1','1')
88 #endif
89
90 #if (WINVER < 0x0400)
91
92 #ifndef RDH_RECTANGLES
93
94 typedef struct tagRECTL {
95 LONG left;
96 LONG top;
97 LONG right;
98 LONG bottom;
99 } RECTL, *PRECTL, NEAR* NPRECTL, FAR* LPRECTL, CONST FAR* LPCRECTL;
100
101 #define RDH_RECTANGLES 0
102
103 typedef struct tagRGNDATAHEADER {
104 DWORD dwSize;
105 DWORD iType;
106 DWORD nCount;
107 DWORD nRgnSize;
108 RECTL rcBound;
109 } RGNDATAHEADER, *PRGNDATAHEADER, NEAR* NPRGNDATAHEADER, FAR* LPRGNDATAHEADER, CONST FAR* LPCRGNDATAHEADER;
110
111 typedef struct tagRGNDATA {
112 RGNDATAHEADER rdh;
113 char Buffer[1];
114 } RGNDATA, *PRGNDATA, NEAR* NPRGNDATA, FAR* LPRGNDATA, CONST FAR* LPCRGNDATA;
115
116 #endif /* RDH_RECTANGLES */
117
118 #endif /* (WINVER < 0x0400) */
119
120 typedef int DCIRVAL; /* DCI callback return type */
121
122 /* Escape command structures */
123
124 typedef struct _DCICMD {
125 DWORD dwCommand;
126 DWORD dwParam1;
127 DWORD dwParam2;
128 DWORD dwVersion;
129 DWORD dwReserved;
130 } DCICMD,*LPDCICMD;
131
132 typedef struct _DCICREATEINPUT {
133 DCICMD cmd;
134 DWORD dwCompression;
135 DWORD dwMask[3];
136 DWORD dwWidth;
137 DWORD dwHeight;
138 DWORD dwDCICaps;
139 DWORD dwBitCount;
140 LPVOID lpSurface;
141 } DCICREATEINPUT, FAR *LPDCICREATEINPUT;
142
143 typedef struct _DCISURFACEINFO {
144 DWORD dwSize;
145 DWORD dwDCICaps;
146 DWORD dwCompression;
147 DWORD dwMask[3];
148 DWORD dwWidth;
149 DWORD dwHeight;
150 LONG lStride;
151 DWORD dwBitCount;
152 ULONG_PTR dwOffSurface;
153 WORD wSelSurface;
154 WORD wReserved;
155 DWORD dwReserved1;
156 DWORD dwReserved2;
157 DWORD dwReserved3;
158 DCIRVAL (CALLBACK *BeginAccess) (LPVOID, LPRECT);
159 void (CALLBACK *EndAccess) (LPVOID);
160 void (CALLBACK *DestroySurface) (LPVOID);
161 } DCISURFACEINFO, FAR *LPDCISURFACEINFO;
162
163 typedef void
164 (*ENUM_CALLBACK)(
165 LPDCISURFACEINFO lpSurfaceInfo,
166 LPVOID lpContext);
167
168 typedef struct _DCIENUMINPUT {
169 DCICMD cmd;
170 RECT rSrc;
171 RECT rDst;
172 void (CALLBACK *EnumCallback)(LPDCISURFACEINFO, LPVOID);
173 LPVOID lpContext;
174 } DCIENUMINPUT, FAR *LPDCIENUMINPUT;
175
176 typedef DCISURFACEINFO DCIPRIMARY, FAR *LPDCIPRIMARY;
177
178 typedef struct _DCIOFFSCREEN {
179 DCISURFACEINFO dciInfo;
180 DCIRVAL (CALLBACK *Draw) (LPVOID);
181 DCIRVAL (CALLBACK *SetClipList) (LPVOID, LPRGNDATA);
182 DCIRVAL (CALLBACK *SetDestination) (LPVOID, LPRECT, LPRECT);
183 } DCIOFFSCREEN, FAR *LPDCIOFFSCREEN;
184
185 typedef struct _DCIOVERLAY{
186 DCISURFACEINFO dciInfo;
187 DWORD dwChromakeyValue;
188 DWORD dwChromakeyMask;
189 } DCIOVERLAY, FAR *LPDCIOVERLAY;
190
191 #ifdef __cplusplus
192 } /* extern "C" */
193 #endif