fonts: Add a couple of cyrillic glyphs to all built-in bitmap fonts.
[wine/wine64.git] / dlls / ddraw / surface_thunks.c
blob50909335e43ef8fd6e2faad90864ca5b706178d8
1 /* IDirectDrawSurface3 -> IDirectDrawSurface7 thunks
2 * Copyright 2000 TransGaming Technologies Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 #include "config.h"
20 #include <stdarg.h>
22 #include "windef.h"
23 #include "winbase.h"
24 #include "wingdi.h"
25 #include "ddraw.h"
26 #include "winerror.h"
28 #include "ddraw_private.h"
29 #include "ddcomimpl.h"
31 #define CONVERT(pdds) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, \
32 IDirectDrawSurface3, \
33 IDirectDrawSurface7, \
34 (pdds))
36 #define CONVERT_REV(pdds) COM_INTERFACE_CAST(IDirectDrawSurfaceImpl, \
37 IDirectDrawSurface7, \
38 IDirectDrawSurface3, \
39 (pdds))
41 static HRESULT WINAPI
42 IDirectDrawSurface3Impl_QueryInterface(LPDIRECTDRAWSURFACE3 This, REFIID iid,
43 LPVOID *ppObj)
45 return IDirectDrawSurface7_QueryInterface(CONVERT(This), iid, ppObj);
48 static ULONG WINAPI
49 IDirectDrawSurface3Impl_AddRef(LPDIRECTDRAWSURFACE3 This)
51 return IDirectDrawSurface7_AddRef(CONVERT(This));
54 static ULONG WINAPI
55 IDirectDrawSurface3Impl_Release(LPDIRECTDRAWSURFACE3 This)
57 return IDirectDrawSurface7_Release(CONVERT(This));
60 static HRESULT WINAPI
61 IDirectDrawSurface3Impl_AddAttachedSurface(LPDIRECTDRAWSURFACE3 This,
62 LPDIRECTDRAWSURFACE3 pAttach)
64 return IDirectDrawSurface7_AddAttachedSurface(CONVERT(This),
65 CONVERT(pAttach));
68 static HRESULT WINAPI
69 IDirectDrawSurface3Impl_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE3 This,
70 LPRECT pRect)
72 return IDirectDrawSurface7_AddOverlayDirtyRect(CONVERT(This), pRect);
75 static HRESULT WINAPI
76 IDirectDrawSurface3Impl_Blt(LPDIRECTDRAWSURFACE3 This, LPRECT prcDst,
77 LPDIRECTDRAWSURFACE3 pSrcSurf, LPRECT prcSrc,
78 DWORD dwFlags, LPDDBLTFX pFX)
80 return IDirectDrawSurface7_Blt(CONVERT(This), prcDst, CONVERT(pSrcSurf),
81 prcSrc, dwFlags, pFX);
84 static HRESULT WINAPI
85 IDirectDrawSurface3Impl_BltBatch(LPDIRECTDRAWSURFACE3 This,
86 LPDDBLTBATCH pBatch, DWORD dwCount,
87 DWORD dwFlags)
89 return IDirectDrawSurface7_BltBatch(CONVERT(This), pBatch, dwCount,
90 dwFlags);
93 static HRESULT WINAPI
94 IDirectDrawSurface3Impl_BltFast(LPDIRECTDRAWSURFACE3 This, DWORD x, DWORD y,
95 LPDIRECTDRAWSURFACE3 pSrcSurf, LPRECT prcSrc,
96 DWORD dwTrans)
98 return IDirectDrawSurface7_BltFast(CONVERT(This), x, y, CONVERT(pSrcSurf),
99 prcSrc, dwTrans);
102 static HRESULT WINAPI
103 IDirectDrawSurface3Impl_DeleteAttachedSurface(LPDIRECTDRAWSURFACE3 This,
104 DWORD dwFlags,
105 LPDIRECTDRAWSURFACE3 pAttached)
107 return IDirectDrawSurface7_DeleteAttachedSurface(CONVERT(This), dwFlags,
108 CONVERT(pAttached));
111 struct callback_info
113 LPDDENUMSURFACESCALLBACK callback;
114 LPVOID context;
117 static HRESULT CALLBACK
118 EnumCallback(LPDIRECTDRAWSURFACE7 iface, LPDDSURFACEDESC2 pDDSD,
119 LPVOID context)
121 const struct callback_info* info = context;
123 #if 0
124 /* This is an outgoing conversion so we have to do it. */
125 DDSURFACEDESC ddsd;
126 memset(&ddsd, 0, sizeof(ddsd));
127 ddsd.dwSize = sizeof(ddsd);
128 DDRAW_Convert_DDSURFACEDESC_2_To_1(pDDSD, &ddsd);
129 #endif
131 /* the LPDDSURFACEDESC2 -> LPDDSURFACEDESC coercion is safe, since
132 * the data format is compatible with older enum procs */
133 return info->callback((LPDIRECTDRAWSURFACE)CONVERT_REV(iface), (LPDDSURFACEDESC)pDDSD,
134 info->context);
137 static HRESULT WINAPI
138 IDirectDrawSurface3Impl_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE3 This,
139 LPVOID context,
140 LPDDENUMSURFACESCALLBACK callback)
142 struct callback_info info;
144 info.callback = callback;
145 info.context = context;
147 return IDirectDrawSurface7_EnumAttachedSurfaces(CONVERT(This), &info,
148 EnumCallback);
151 static HRESULT WINAPI
152 IDirectDrawSurface3Impl_EnumOverlayZOrders(LPDIRECTDRAWSURFACE3 This,
153 DWORD dwFlags, LPVOID context,
154 LPDDENUMSURFACESCALLBACK callback)
156 struct callback_info info;
158 info.callback = callback;
159 info.context = context;
161 return IDirectDrawSurface7_EnumOverlayZOrders(CONVERT(This), dwFlags,
162 &info, EnumCallback);
165 static HRESULT WINAPI
166 IDirectDrawSurface3Impl_Flip(LPDIRECTDRAWSURFACE3 This,
167 LPDIRECTDRAWSURFACE3 pOverride, DWORD dwFlags)
169 return IDirectDrawSurface7_Flip(CONVERT(This), CONVERT(pOverride),
170 dwFlags);
173 static HRESULT WINAPI
174 IDirectDrawSurface3Impl_GetAttachedSurface(LPDIRECTDRAWSURFACE3 This,
175 LPDDSCAPS pCaps,
176 LPDIRECTDRAWSURFACE3* ppAttached)
178 DDSCAPS2 caps;
179 LPDIRECTDRAWSURFACE7 pAttached7;
180 HRESULT hr;
182 caps.dwCaps = pCaps->dwCaps;
183 caps.dwCaps2 = 0;
184 caps.dwCaps3 = 0;
185 caps.dwCaps4 = 0;
187 hr = IDirectDrawSurface7_GetAttachedSurface(CONVERT(This), &caps,
188 &pAttached7);
189 if (FAILED(hr)) return hr;
191 *ppAttached = CONVERT_REV(pAttached7);
192 return hr;
195 static HRESULT WINAPI
196 IDirectDrawSurface3Impl_GetBltStatus(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags)
198 return IDirectDrawSurface7_GetBltStatus(CONVERT(This), dwFlags);
201 static HRESULT WINAPI
202 IDirectDrawSurface3Impl_GetCaps(LPDIRECTDRAWSURFACE3 This, LPDDSCAPS pCaps)
204 DDSCAPS2 caps;
205 HRESULT hr;
207 hr = IDirectDrawSurface7_GetCaps(CONVERT(This), &caps);
208 if (FAILED(hr)) return hr;
210 pCaps->dwCaps = caps.dwCaps;
211 return hr;
214 static HRESULT WINAPI
215 IDirectDrawSurface3Impl_GetClipper(LPDIRECTDRAWSURFACE3 This,
216 LPDIRECTDRAWCLIPPER* ppClipper)
218 return IDirectDrawSurface7_GetClipper(CONVERT(This), ppClipper);
221 static HRESULT WINAPI
222 IDirectDrawSurface3Impl_GetColorKey(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags,
223 LPDDCOLORKEY pCKey)
225 return IDirectDrawSurface7_GetColorKey(CONVERT(This), dwFlags, pCKey);
228 static HRESULT WINAPI
229 IDirectDrawSurface3Impl_GetDC(LPDIRECTDRAWSURFACE3 This, HDC* phDC)
231 return IDirectDrawSurface7_GetDC(CONVERT(This), phDC);
234 static HRESULT WINAPI
235 IDirectDrawSurface3Impl_GetFlipStatus(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags)
237 return IDirectDrawSurface7_GetFlipStatus(CONVERT(This), dwFlags);
240 static HRESULT WINAPI
241 IDirectDrawSurface3Impl_GetOverlayPosition(LPDIRECTDRAWSURFACE3 This, LPLONG pX,
242 LPLONG pY)
244 return IDirectDrawSurface7_GetOverlayPosition(CONVERT(This), pX, pY);
247 static HRESULT WINAPI
248 IDirectDrawSurface3Impl_GetPalette(LPDIRECTDRAWSURFACE3 This,
249 LPDIRECTDRAWPALETTE* ppPalette)
251 return IDirectDrawSurface7_GetPalette(CONVERT(This), ppPalette);
254 static HRESULT WINAPI
255 IDirectDrawSurface3Impl_GetPixelFormat(LPDIRECTDRAWSURFACE3 This,
256 LPDDPIXELFORMAT pPixelFormat)
258 return IDirectDrawSurface7_GetPixelFormat(CONVERT(This), pPixelFormat);
261 static HRESULT WINAPI
262 IDirectDrawSurface3Impl_GetSurfaceDesc(LPDIRECTDRAWSURFACE3 This,
263 LPDDSURFACEDESC pDDSD)
265 return IDirectDrawSurface7_GetSurfaceDesc(CONVERT(This),
266 (LPDDSURFACEDESC2)pDDSD);
269 static HRESULT WINAPI
270 IDirectDrawSurface3Impl_Initialize(LPDIRECTDRAWSURFACE3 This, LPDIRECTDRAW pDD,
271 LPDDSURFACEDESC pDDSD)
273 return IDirectDrawSurface7_Initialize(CONVERT(This), pDD,
274 (LPDDSURFACEDESC2)pDDSD);
277 static HRESULT WINAPI
278 IDirectDrawSurface3Impl_IsLost(LPDIRECTDRAWSURFACE3 This)
280 return IDirectDrawSurface7_IsLost(CONVERT(This));
283 static HRESULT WINAPI
284 IDirectDrawSurface3Impl_Lock(LPDIRECTDRAWSURFACE3 This, LPRECT pRect,
285 LPDDSURFACEDESC pDDSD, DWORD dwFlags, HANDLE h)
287 return IDirectDrawSurface7_Lock(CONVERT(This), pRect,
288 (LPDDSURFACEDESC2)pDDSD, dwFlags, h);
291 static HRESULT WINAPI
292 IDirectDrawSurface3Impl_ReleaseDC(LPDIRECTDRAWSURFACE3 This, HDC hDC)
294 return IDirectDrawSurface7_ReleaseDC(CONVERT(This), hDC);
297 static HRESULT WINAPI
298 IDirectDrawSurface3Impl_Restore(LPDIRECTDRAWSURFACE3 This)
300 return IDirectDrawSurface7_Restore(CONVERT(This));
303 static HRESULT WINAPI
304 IDirectDrawSurface3Impl_SetClipper(LPDIRECTDRAWSURFACE3 This,
305 LPDIRECTDRAWCLIPPER pClipper)
307 return IDirectDrawSurface7_SetClipper(CONVERT(This), pClipper);
310 static HRESULT WINAPI
311 IDirectDrawSurface3Impl_SetColorKey(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags,
312 LPDDCOLORKEY pCKey)
314 return IDirectDrawSurface7_SetColorKey(CONVERT(This), dwFlags, pCKey);
317 static HRESULT WINAPI
318 IDirectDrawSurface3Impl_SetOverlayPosition(LPDIRECTDRAWSURFACE3 This, LONG x,
319 LONG y)
321 return IDirectDrawSurface7_SetOverlayPosition(CONVERT(This), x, y);
324 static HRESULT WINAPI
325 IDirectDrawSurface3Impl_SetPalette(LPDIRECTDRAWSURFACE3 This,
326 LPDIRECTDRAWPALETTE pPalette)
328 return IDirectDrawSurface7_SetPalette(CONVERT(This), pPalette);
331 static HRESULT WINAPI
332 IDirectDrawSurface3Impl_Unlock(LPDIRECTDRAWSURFACE3 This, LPVOID data)
334 /* data might not be the LPRECT of later versions, so drop it. */
335 return IDirectDrawSurface7_Unlock(CONVERT(This), NULL);
338 static HRESULT WINAPI
339 IDirectDrawSurface3Impl_UpdateOverlay(LPDIRECTDRAWSURFACE3 This, LPRECT prcSrc,
340 LPDIRECTDRAWSURFACE3 pDstSurf,
341 LPRECT prcDst, DWORD dwFlags,
342 LPDDOVERLAYFX pFX)
344 return IDirectDrawSurface7_UpdateOverlay(CONVERT(This), prcSrc,
345 CONVERT(pDstSurf), prcDst,
346 dwFlags, pFX);
349 static HRESULT WINAPI
350 IDirectDrawSurface3Impl_UpdateOverlayDisplay(LPDIRECTDRAWSURFACE3 This,
351 DWORD dwFlags)
353 return IDirectDrawSurface7_UpdateOverlayDisplay(CONVERT(This), dwFlags);
356 static HRESULT WINAPI
357 IDirectDrawSurface3Impl_UpdateOverlayZOrder(LPDIRECTDRAWSURFACE3 This,
358 DWORD dwFlags,
359 LPDIRECTDRAWSURFACE3 pSurfReference)
361 return IDirectDrawSurface7_UpdateOverlayZOrder(CONVERT(This), dwFlags,
362 CONVERT(pSurfReference));
365 static HRESULT WINAPI
366 IDirectDrawSurface3Impl_GetDDInterface(LPDIRECTDRAWSURFACE3 This, LPVOID* ppDD)
368 return IDirectDrawSurface7_GetDDInterface(CONVERT(This), ppDD);
371 static HRESULT WINAPI
372 IDirectDrawSurface3Impl_PageLock(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags)
374 return IDirectDrawSurface7_PageLock(CONVERT(This), dwFlags);
377 static HRESULT WINAPI
378 IDirectDrawSurface3Impl_PageUnlock(LPDIRECTDRAWSURFACE3 This, DWORD dwFlags)
380 return IDirectDrawSurface7_PageUnlock(CONVERT(This), dwFlags);
383 static HRESULT WINAPI
384 IDirectDrawSurface3Impl_SetSurfaceDesc(LPDIRECTDRAWSURFACE3 This,
385 LPDDSURFACEDESC pDDSD, DWORD dwFlags)
387 return IDirectDrawSurface7_SetSurfaceDesc(CONVERT(This),
388 (LPDDSURFACEDESC2)pDDSD,
389 dwFlags);
392 const IDirectDrawSurface3Vtbl DDRAW_IDDS3_Thunk_VTable =
394 IDirectDrawSurface3Impl_QueryInterface,
395 IDirectDrawSurface3Impl_AddRef,
396 IDirectDrawSurface3Impl_Release,
397 IDirectDrawSurface3Impl_AddAttachedSurface,
398 IDirectDrawSurface3Impl_AddOverlayDirtyRect,
399 IDirectDrawSurface3Impl_Blt,
400 IDirectDrawSurface3Impl_BltBatch,
401 IDirectDrawSurface3Impl_BltFast,
402 IDirectDrawSurface3Impl_DeleteAttachedSurface,
403 IDirectDrawSurface3Impl_EnumAttachedSurfaces,
404 IDirectDrawSurface3Impl_EnumOverlayZOrders,
405 IDirectDrawSurface3Impl_Flip,
406 IDirectDrawSurface3Impl_GetAttachedSurface,
407 IDirectDrawSurface3Impl_GetBltStatus,
408 IDirectDrawSurface3Impl_GetCaps,
409 IDirectDrawSurface3Impl_GetClipper,
410 IDirectDrawSurface3Impl_GetColorKey,
411 IDirectDrawSurface3Impl_GetDC,
412 IDirectDrawSurface3Impl_GetFlipStatus,
413 IDirectDrawSurface3Impl_GetOverlayPosition,
414 IDirectDrawSurface3Impl_GetPalette,
415 IDirectDrawSurface3Impl_GetPixelFormat,
416 IDirectDrawSurface3Impl_GetSurfaceDesc,
417 IDirectDrawSurface3Impl_Initialize,
418 IDirectDrawSurface3Impl_IsLost,
419 IDirectDrawSurface3Impl_Lock,
420 IDirectDrawSurface3Impl_ReleaseDC,
421 IDirectDrawSurface3Impl_Restore,
422 IDirectDrawSurface3Impl_SetClipper,
423 IDirectDrawSurface3Impl_SetColorKey,
424 IDirectDrawSurface3Impl_SetOverlayPosition,
425 IDirectDrawSurface3Impl_SetPalette,
426 IDirectDrawSurface3Impl_Unlock,
427 IDirectDrawSurface3Impl_UpdateOverlay,
428 IDirectDrawSurface3Impl_UpdateOverlayDisplay,
429 IDirectDrawSurface3Impl_UpdateOverlayZOrder,
430 IDirectDrawSurface3Impl_GetDDInterface,
431 IDirectDrawSurface3Impl_PageLock,
432 IDirectDrawSurface3Impl_PageUnlock,
433 IDirectDrawSurface3Impl_SetSurfaceDesc