Fill in some more HAL fields. Flip some of them when appropriate.
[wine] / dlls / ddraw / dsurface / main.h
1 /* Copyright 2000-2001 TransGaming Technologies Inc. */
2
3 #ifndef DDRAW_DSURFACE_MAIN_H_INCLUDED
4 #define DDRAW_DSURFACE_MAIN_H_INCLUDED
5
6 #include "ddraw_private.h"
7
8 /* Support for IDirectDrawSurface7::Set/Get/FreePrivateData. I don't think
9  * anybody uses it for much so a good implementation is optional. */
10 typedef struct PrivateData
11 {
12     struct PrivateData* next;
13     struct PrivateData* prev;
14
15     GUID tag;
16     DWORD flags; /* DDSPD_* */
17     DWORD uniqueness_value;
18
19     union
20     {
21         LPVOID data;
22         LPUNKNOWN object;
23     } ptr;
24
25     DWORD size;
26 } PrivateData;
27
28 extern ICOM_VTABLE(IDirectDrawGammaControl) DDRAW_IDDGC_VTable;
29
30 /* Non-interface functions */
31 HRESULT
32 Main_DirectDrawSurface_Construct(IDirectDrawSurfaceImpl* This,
33                                  IDirectDrawImpl* pDD,
34                                  const DDSURFACEDESC2* pDDSD);
35 void Main_DirectDrawSurface_ForceDestroy(IDirectDrawSurfaceImpl* This);
36
37 void
38 Main_DirectDrawSurface_final_release(IDirectDrawSurfaceImpl* This);
39 HRESULT
40 Main_DirectDrawSurface_late_allocate(IDirectDrawSurfaceImpl* This);
41 BOOL
42 Main_DirectDrawSurface_attach(IDirectDrawSurfaceImpl *This,
43                               IDirectDrawSurfaceImpl *to);
44 BOOL Main_DirectDrawSurface_detach(IDirectDrawSurfaceImpl *This);
45 void
46 Main_DirectDrawSurface_lock_update(IDirectDrawSurfaceImpl* This,
47                                    LPCRECT pRect);
48 void
49 Main_DirectDrawSurface_unlock_update(IDirectDrawSurfaceImpl* This,
50                                      LPCRECT pRect);
51 void
52 Main_DirectDrawSurface_lose_surface(IDirectDrawSurfaceImpl* This);
53 void
54 Main_DirectDrawSurface_set_palette(IDirectDrawSurfaceImpl* This,
55                                    IDirectDrawPaletteImpl* pal);
56 void
57 Main_DirectDrawSurface_update_palette(IDirectDrawSurfaceImpl* This,
58                                       IDirectDrawPaletteImpl* pal,
59                                       DWORD dwStart, DWORD dwCount,
60                                       LPPALETTEENTRY palent);
61 HWND
62 Main_DirectDrawSurface_get_display_window(IDirectDrawSurfaceImpl* This);
63
64 HRESULT
65 Main_DirectDrawSurface_get_gamma_ramp(IDirectDrawSurfaceImpl* This,
66                                       DWORD dwFlags,
67                                       LPDDGAMMARAMP lpGammaRamp);
68 HRESULT
69 Main_DirectDrawSurface_set_gamma_ramp(IDirectDrawSurfaceImpl* This,
70                                       DWORD dwFlags,
71                                       LPDDGAMMARAMP lpGammaRamp);
72
73 BOOL Main_DirectDrawSurface_flip_data(IDirectDrawSurfaceImpl* front,
74                                       IDirectDrawSurfaceImpl* back,
75                                       DWORD dwFlags);
76
77 #define CHECK_LOST(This)                                        \
78         do {                                                    \
79                 if (This->lost) return DDERR_SURFACELOST;       \
80         } while (0)
81
82 #define CHECK_TEXTURE(This)                                     \
83         do {                                                    \
84                 if (!(This->surface_desc.ddsCaps.dwCaps2        \
85                       & DDSCAPS2_TEXTUREMANAGE))                \
86                         return DDERR_INVALIDOBJECT;             \
87         } while (0)
88
89 #define LOCK_OBJECT(This) do { } while (0)
90 #define UNLOCK_OBJECT(This) do { } while (0)
91
92 /* IDirectDrawSurface7 (partial) implementation */
93 ULONG WINAPI
94 Main_DirectDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface);
95 ULONG WINAPI
96 Main_DirectDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface);
97 HRESULT WINAPI
98 Main_DirectDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE7 iface, REFIID riid,
99                                       LPVOID* ppObj);
100 HRESULT WINAPI
101 Main_DirectDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
102                                           LPDIRECTDRAWSURFACE7 pAttach);
103 HRESULT WINAPI
104 Main_DirectDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE7 iface,
105                                            LPRECT pRect);
106 HRESULT WINAPI
107 Main_DirectDrawSurface_BltBatch(LPDIRECTDRAWSURFACE7 iface,
108                                 LPDDBLTBATCH pBatch, DWORD dwCount,
109                                 DWORD dwFlags);
110 HRESULT WINAPI
111 Main_DirectDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE7 iface);
112 HRESULT WINAPI
113 Main_DirectDrawSurface_DeleteAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
114                                              DWORD dwFlags,
115                                              LPDIRECTDRAWSURFACE7 pAttach);
116 HRESULT WINAPI
117 Main_DirectDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE7 iface,
118                                             LPVOID context,
119                                             LPDDENUMSURFACESCALLBACK7 cb);
120 HRESULT WINAPI
121 Main_DirectDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE7 iface,
122                                           DWORD dwFlags, LPVOID context,
123                                           LPDDENUMSURFACESCALLBACK7 cb);
124 HRESULT WINAPI
125 Main_DirectDrawSurface_Flip(LPDIRECTDRAWSURFACE7 iface,
126                             LPDIRECTDRAWSURFACE7 override, DWORD dwFlags);
127 HRESULT WINAPI
128 Main_DirectDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE7 iface,
129                                        REFGUID tag);
130 HRESULT WINAPI
131 Main_DirectDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE7 iface,
132                                           LPDDSCAPS2 pCaps,
133                                           LPDIRECTDRAWSURFACE7* ppSurface);
134 HRESULT WINAPI
135 Main_DirectDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE7 iface,
136                                     DWORD dwFlags);
137 HRESULT WINAPI
138 Main_DirectDrawSurface_GetCaps(LPDIRECTDRAWSURFACE7 iface,
139                                LPDDSCAPS2 pCaps);
140 HRESULT WINAPI
141 Main_DirectDrawSurface_GetClipper(LPDIRECTDRAWSURFACE7 iface,
142                                   LPDIRECTDRAWCLIPPER* ppClipper);
143 HRESULT WINAPI
144 Main_DirectDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE7 iface,
145                                    DWORD dwFlags, LPDDCOLORKEY pCKey);
146 HRESULT WINAPI
147 Main_DirectDrawSurface_GetDC(LPDIRECTDRAWSURFACE7 iface, HDC *phDC);
148 HRESULT WINAPI
149 Main_DirectDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE7 iface,
150                                       LPVOID* pDD);
151 HRESULT WINAPI
152 Main_DirectDrawSurface_GetFlipStatus(LPDIRECTDRAWSURFACE7 iface,
153                                      DWORD dwFlags);
154 HRESULT WINAPI
155 Main_DirectDrawSurface_GetLOD(LPDIRECTDRAWSURFACE7 iface,
156                               LPDWORD pdwMaxLOD);
157 HRESULT WINAPI
158 Main_DirectDrawSurface_GetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
159                                           LPLONG pX, LPLONG pY);
160 HRESULT WINAPI
161 Main_DirectDrawSurface_GetPalette(LPDIRECTDRAWSURFACE7 iface,
162                                   LPDIRECTDRAWPALETTE* ppPalette);
163 HRESULT WINAPI
164 Main_DirectDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE7 iface,
165                                       LPDDPIXELFORMAT pDDPixelFormat);
166 HRESULT WINAPI
167 Main_DirectDrawSurface_GetPriority(LPDIRECTDRAWSURFACE7 iface,
168                                    LPDWORD pdwPriority);
169 HRESULT WINAPI
170 Main_DirectDrawSurface_GetPrivateData(LPDIRECTDRAWSURFACE7 iface, REFGUID tag,
171                                       LPVOID pBuffer, LPDWORD pcbBufferSize);
172 HRESULT WINAPI
173 Main_DirectDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE7 iface,
174                                       LPDDSURFACEDESC2 pDDSD);
175 HRESULT WINAPI
176 Main_DirectDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE7 iface,
177                                           LPDWORD pValue);
178 HRESULT WINAPI
179 Main_DirectDrawSurface_Initialize(LPDIRECTDRAWSURFACE7 iface,
180                                   LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD);
181 HRESULT WINAPI
182 Main_DirectDrawSurface_IsLost(LPDIRECTDRAWSURFACE7 iface);
183 HRESULT WINAPI
184 Main_DirectDrawSurface_Lock(LPDIRECTDRAWSURFACE7 iface, LPRECT prect,
185                             LPDDSURFACEDESC2 pDDSD, DWORD flags, HANDLE h);
186 HRESULT WINAPI
187 Main_DirectDrawSurface_PageLock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
188 HRESULT WINAPI
189 Main_DirectDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE7 iface, DWORD dwFlags);
190 HRESULT WINAPI
191 Main_DirectDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE7 iface, HDC hDC);
192 HRESULT WINAPI
193 Main_DirectDrawSurface_SetClipper(LPDIRECTDRAWSURFACE7 iface,
194                                   LPDIRECTDRAWCLIPPER pDDClipper);
195 HRESULT WINAPI
196 Main_DirectDrawSurface_SetColorKey(LPDIRECTDRAWSURFACE7 iface,
197                                    DWORD dwFlags, LPDDCOLORKEY pCKey);
198 HRESULT WINAPI
199 Main_DirectDrawSurface_SetLOD(LPDIRECTDRAWSURFACE7 iface, DWORD dwMaxLOD);
200 HRESULT WINAPI
201 Main_DirectDrawSurface_SetOverlayPosition(LPDIRECTDRAWSURFACE7 iface,
202                                           LONG X, LONG Y);
203 HRESULT WINAPI
204 Main_DirectDrawSurface_SetPalette(LPDIRECTDRAWSURFACE7 iface,
205                                   LPDIRECTDRAWPALETTE pPalette);
206 HRESULT WINAPI
207 Main_DirectDrawSurface_SetPriority(LPDIRECTDRAWSURFACE7 iface,
208                                    DWORD dwPriority);
209 HRESULT WINAPI
210 Main_DirectDrawSurface_SetPrivateData(LPDIRECTDRAWSURFACE7 iface,
211                                       REFGUID tag, LPVOID pData,
212                                       DWORD cbSize, DWORD dwFlags);
213 HRESULT WINAPI
214 Main_DirectDrawSurface_Unlock(LPDIRECTDRAWSURFACE7 iface, LPRECT pRect);
215 HRESULT WINAPI
216 Main_DirectDrawSurface_UpdateOverlay(LPDIRECTDRAWSURFACE7 iface,
217                                      LPRECT pSrcRect,
218                                      LPDIRECTDRAWSURFACE7 pDstSurface,
219                                      LPRECT pDstRect, DWORD dwFlags,
220                                      LPDDOVERLAYFX pFX);
221 HRESULT WINAPI
222 Main_DirectDrawSurface_UpdateOverlayDisplay(LPDIRECTDRAWSURFACE7 iface,
223                                             DWORD dwFlags);
224 HRESULT WINAPI
225 Main_DirectDrawSurface_UpdateOverlayZOrder(LPDIRECTDRAWSURFACE7 iface,
226                                            DWORD dwFlags,
227                                            LPDIRECTDRAWSURFACE7 pDDSRef);
228
229 #endif