Release 1.1.37.
[wine/gsoc-2012-control.git] / dlls / d3drm / d3drm.c
blob4eed18be98a92758fa6772febcbe63cfb69f7f69
1 /*
2 * Implementation of IDirect3DRM Interface
4 * Copyright 2010 Christian Costa
6 * This file contains the (internal) driver registration functions,
7 * driver enumeration APIs and DirectDraw creation functions.
9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Lesser General Public
11 * License as published by the Free Software Foundation; either
12 * version 2.1 of the License, or (at your option) any later version.
14 * This library is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * Lesser General Public License for more details.
19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this library; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
24 #include "wine/debug.h"
26 #define COBJMACROS
28 #include "winbase.h"
29 #include "wingdi.h"
31 #include "d3drm_private.h"
32 #include "d3drm.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
36 typedef struct {
37 const IDirect3DRMVtbl *lpVtbl;
38 LONG ref;
39 } IDirect3DRMImpl;
41 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl;
43 HRESULT Direct3DRM_create(LPDIRECT3DRM* ppDirect3DRM)
45 IDirect3DRMImpl* object;
47 TRACE("(%p)\n", ppDirect3DRM);
49 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMImpl));
50 if (!object)
52 ERR("Out of memory\n");
53 return E_OUTOFMEMORY;
56 object->lpVtbl = &Direct3DRM_Vtbl;
57 object->ref = 1;
59 *ppDirect3DRM = (IDirect3DRM*)object;
61 return S_OK;
64 /*** IUnknown methods ***/
65 static HRESULT WINAPI IDirect3DRMImpl_QueryInterface(IDirect3DRM* iface, REFIID riid, void** ppvObject)
67 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
69 TRACE("(%p/%p)->(%s,%p)\n", iface, This, debugstr_guid(riid), ppvObject);
71 if (IsEqualGUID(riid, &IID_IUnknown) ||
72 IsEqualGUID(riid, &IID_IDirect3DRM))
74 IClassFactory_AddRef(iface);
75 *ppvObject = This;
76 return S_OK;
79 ERR("(%p)->(%s,%p),not found\n",This,debugstr_guid(riid),ppvObject);
80 return E_NOINTERFACE;
83 static ULONG WINAPI IDirect3DRMImpl_AddRef(IDirect3DRM* iface)
85 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
87 TRACE("(%p/%p)\n", iface, This);
89 return InterlockedIncrement(&This->ref);
92 static ULONG WINAPI IDirect3DRMImpl_Release(IDirect3DRM* iface)
94 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
95 ULONG ref = InterlockedDecrement(&This->ref);
97 TRACE("(%p/%p)\n", iface, This);
99 if (!ref)
100 HeapFree(GetProcessHeap(), 0, This);
102 return ref;
105 /*** IDirect3DRM methods ***/
106 static HRESULT WINAPI IDirect3DRMImpl_CreateObject(IDirect3DRM* iface, REFCLSID rclsid, LPUNKNOWN pUnkOuter, REFIID riid, LPVOID *ppvObj)
108 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
110 FIXME("(%p/%p)->(%s,%p,%s,%p): stub\n", iface, This, debugstr_guid(rclsid), pUnkOuter, debugstr_guid(riid), ppvObj);
112 return E_NOTIMPL;
115 static HRESULT WINAPI IDirect3DRMImpl_CreateFrame(IDirect3DRM* iface, LPDIRECT3DRMFRAME pFrameParent, LPDIRECT3DRMFRAME * ppFrame)
117 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
119 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pFrameParent, ppFrame);
121 return E_NOTIMPL;
124 static HRESULT WINAPI IDirect3DRMImpl_CreateMesh(IDirect3DRM* iface, LPDIRECT3DRMMESH * ppMesh)
126 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
128 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMesh);
130 return E_NOTIMPL;
133 static HRESULT WINAPI IDirect3DRMImpl_CreateMeshBuilder(IDirect3DRM* iface, LPDIRECT3DRMMESHBUILDER * ppMeshBuilder)
135 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
137 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppMeshBuilder);
139 return E_NOTIMPL;
142 static HRESULT WINAPI IDirect3DRMImpl_CreateFace(IDirect3DRM* iface, LPDIRECT3DRMFACE * ppFace)
144 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
146 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppFace);
148 return E_NOTIMPL;
151 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimation(IDirect3DRM* iface, LPDIRECT3DRMANIMATION * ppAnimation)
153 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
155 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimation);
157 return E_NOTIMPL;
160 static HRESULT WINAPI IDirect3DRMImpl_CreateAnimationSet(IDirect3DRM* iface, LPDIRECT3DRMANIMATIONSET * ppAnimationSet)
162 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
164 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppAnimationSet);
166 return E_NOTIMPL;
169 static HRESULT WINAPI IDirect3DRMImpl_CreateTexture(IDirect3DRM* iface, LPD3DRMIMAGE pImage, LPDIRECT3DRMTEXTURE * ppTexture)
171 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
173 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pImage, ppTexture);
175 return E_NOTIMPL;
178 static HRESULT WINAPI IDirect3DRMImpl_CreateLight(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DCOLOR color, LPDIRECT3DRMLIGHT * ppLight)
180 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
182 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, type, color, ppLight);
184 return E_NOTIMPL;
187 static HRESULT WINAPI IDirect3DRMImpl_CreateLightRGB(IDirect3DRM* iface, D3DRMLIGHTTYPE type, D3DVALUE red, D3DVALUE green, D3DVALUE blue, LPDIRECT3DRMLIGHT * ppLight)
189 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
191 FIXME("(%p/%p)->(%d,%f,%f,%f,%p): stub\n", iface, This, type, red, green, blue, ppLight);
193 return E_NOTIMPL;
196 static HRESULT WINAPI IDirect3DRMImpl_Material(IDirect3DRM* iface, D3DVALUE m, LPDIRECT3DRMMATERIAL * ppMaterial)
198 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
200 FIXME("(%p/%p)->(%f,%p): stub\n", iface, This, m, ppMaterial);
202 return E_NOTIMPL;
205 static HRESULT WINAPI IDirect3DRMImpl_CreateDevice(IDirect3DRM* iface, DWORD width, DWORD height, LPDIRECT3DRMDEVICE * ppDevice)
207 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
209 FIXME("(%p/%p)->(%d,%d,%p): stub\n", iface, This, width, height, ppDevice);
211 return E_NOTIMPL;
214 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromSurface(IDirect3DRM* iface, LPGUID pGUID, LPDIRECTDRAW pDD, LPDIRECTDRAWSURFACE pDDSBack, LPDIRECT3DRMDEVICE * ppDevice)
216 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
218 FIXME("(%p/%p)->(%s,%p,%p,%p): stub\n", iface, This, debugstr_guid(pGUID), pDD, pDDSBack, ppDevice);
220 return E_NOTIMPL;
223 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromD3D(IDirect3DRM* iface, LPDIRECT3D pD3D, LPDIRECT3DDEVICE pD3DDev, LPDIRECT3DRMDEVICE * ppDevice)
225 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
227 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, pD3D, pD3DDev, ppDevice);
229 return E_NOTIMPL;
232 static HRESULT WINAPI IDirect3DRMImpl_CreateDeviceFromClipper(IDirect3DRM* iface, LPDIRECTDRAWCLIPPER pDDClipper, LPGUID pGUID, int width, int height, LPDIRECT3DRMDEVICE * ppDevice)
234 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
236 FIXME("(%p/%p)->(%p,%s,%d,%d,%p): stub\n", iface, This, pDDClipper, debugstr_guid(pGUID), width, height, ppDevice);
238 return E_NOTIMPL;
241 static HRESULT WINAPI IDirect3DRMImpl_CreateShadow(IDirect3DRM* iface, LPDIRECT3DRMVISUAL pVisual, LPDIRECT3DRMLIGHT pLight, D3DVALUE px, D3DVALUE py, D3DVALUE pz, D3DVALUE nx, D3DVALUE ny, D3DVALUE nz, LPDIRECT3DRMVISUAL * ppVisual)
243 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
245 FIXME("(%p/%p)->(%p,%p,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, pVisual, pLight, px, py, pz, nx, ny, nz, ppVisual);
247 return E_NOTIMPL;
250 static HRESULT WINAPI IDirect3DRMImpl_CreateTextureFromSurface(IDirect3DRM* iface, LPDIRECTDRAWSURFACE pDDS, LPDIRECT3DRMTEXTURE * ppTexture)
252 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
254 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, pDDS, ppTexture);
256 return E_NOTIMPL;
259 static HRESULT WINAPI IDirect3DRMImpl_CreateViewport(IDirect3DRM* iface, LPDIRECT3DRMDEVICE pDevice, LPDIRECT3DRMFRAME pFrame, DWORD xpos, DWORD ypos, DWORD width, DWORD height, LPDIRECT3DRMVIEWPORT * ppViewport)
261 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
263 FIXME("(%p/%p)->(%p,%p,%d,%d,%d,%d,%p): stub\n", iface, This, pDevice, pFrame, xpos, ypos, width, height, ppViewport);
265 return E_NOTIMPL;
268 static HRESULT WINAPI IDirect3DRMImpl_CreateWrap(IDirect3DRM* iface, D3DRMWRAPTYPE type, LPDIRECT3DRMFRAME pFrame, D3DVALUE ox, D3DVALUE oy, D3DVALUE oz, D3DVALUE dx, D3DVALUE dy, D3DVALUE dz, D3DVALUE ux, D3DVALUE uy, D3DVALUE uz, D3DVALUE ou, D3DVALUE ov, D3DVALUE su, D3DVALUE sv, LPDIRECT3DRMWRAP * ppWrap)
270 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
272 FIXME("(%p/%p)->(%d,%p,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%f,%p): stub\n", iface, This, type, pFrame, ox, oy, oz, dx, dy, dz, ux, uy, uz, ou, ov, su, sv, ppWrap);
274 return E_NOTIMPL;
277 static HRESULT WINAPI IDirect3DRMImpl_CreateUserVisual(IDirect3DRM* iface, D3DRMUSERVISUALCALLBACK cb, LPVOID pArg, LPDIRECT3DRMUSERVISUAL * ppUserVisual)
279 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
281 FIXME("(%p/%p)->(%p,%p,%p): stub\n", iface, This, cb, pArg, ppUserVisual);
283 return E_NOTIMPL;
286 static HRESULT WINAPI IDirect3DRMImpl_LoadTexture(IDirect3DRM* iface, const char * filename, LPDIRECT3DRMTEXTURE * ppTexture)
288 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
290 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, filename, ppTexture);
292 return E_NOTIMPL;
295 static HRESULT WINAPI IDirect3DRMImpl_LoadTextureFromResource(IDirect3DRM* iface, HRSRC rs, LPDIRECT3DRMTEXTURE * ppTexture)
297 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
299 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, rs, ppTexture);
301 return E_NOTIMPL;
304 static HRESULT WINAPI IDirect3DRMImpl_SetSearchPath(IDirect3DRM* iface, LPCSTR path)
306 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
308 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
310 return E_NOTIMPL;
313 static HRESULT WINAPI IDirect3DRMImpl_AddSearchPath(IDirect3DRM* iface, LPCSTR path)
315 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
317 FIXME("(%p/%p)->(%s): stub\n", iface, This, path);
319 return E_NOTIMPL;
322 static HRESULT WINAPI IDirect3DRMImpl_GetSearchPath(IDirect3DRM* iface, DWORD *size_return, LPSTR path_return)
324 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
326 FIXME("(%p/%p)->(%p,%s): stub\n", iface, This, size_return, path_return);
328 return E_NOTIMPL;
331 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureColors(IDirect3DRM* iface, DWORD nb_colors)
333 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
335 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_colors);
337 return E_NOTIMPL;
340 static HRESULT WINAPI IDirect3DRMImpl_SetDefaultTextureShades(IDirect3DRM* iface, DWORD nb_shades)
342 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
344 FIXME("(%p/%p)->(%d): stub\n", iface, This, nb_shades);
346 return E_NOTIMPL;
349 static HRESULT WINAPI IDirect3DRMImpl_GetDevices(IDirect3DRM* iface, LPDIRECT3DRMDEVICEARRAY * ppDeviceArray)
351 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
353 FIXME("(%p/%p)->(%p): stub\n", iface, This, ppDeviceArray);
355 return E_NOTIMPL;
358 static HRESULT WINAPI IDirect3DRMImpl_GetNamedObject(IDirect3DRM* iface, const char * pName, LPDIRECT3DRMOBJECT * ppObject)
360 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
362 FIXME("(%p/%p)->(%s,%p): stub\n", iface, This, pName, ppObject);
364 return E_NOTIMPL;
367 static HRESULT WINAPI IDirect3DRMImpl_EnumerateObjects(IDirect3DRM* iface, D3DRMOBJECTCALLBACK cb, LPVOID pArg)
369 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
371 FIXME("(%p/%p)->(%p,%p): stub\n", iface, This, cb, pArg);
373 return E_NOTIMPL;
376 static HRESULT WINAPI IDirect3DRMImpl_Load(IDirect3DRM* iface, LPVOID pObjSource, LPVOID pObjID, LPIID * ppGUIDs, DWORD nb_GUIDs, D3DRMLOADOPTIONS LOFlags, D3DRMLOADCALLBACK LoadProc, LPVOID pArgLP, D3DRMLOADTEXTURECALLBACK LoadTextureProc, LPVOID pArgLTP, LPDIRECT3DRMFRAME pParentFrame)
378 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
380 FIXME("(%p/%p)->(%p,%p,%p,%d,%d,%p,%p,%p,%p,%p): stub\n", iface, This, pObjSource, pObjID, ppGUIDs, nb_GUIDs, LOFlags, LoadProc, pArgLP, LoadTextureProc, pArgLTP, pParentFrame);
382 return E_NOTIMPL;
385 static HRESULT WINAPI IDirect3DRMImpl_Tick(IDirect3DRM* iface, D3DVALUE tick)
387 IDirect3DRMImpl *This = (IDirect3DRMImpl *)iface;
389 FIXME("(%p/%p)->(%f): stub\n", iface, This, tick);
391 return E_NOTIMPL;
394 static const struct IDirect3DRMVtbl Direct3DRM_Vtbl =
396 IDirect3DRMImpl_QueryInterface,
397 IDirect3DRMImpl_AddRef,
398 IDirect3DRMImpl_Release,
399 IDirect3DRMImpl_CreateObject,
400 IDirect3DRMImpl_CreateFrame,
401 IDirect3DRMImpl_CreateMesh,
402 IDirect3DRMImpl_CreateMeshBuilder,
403 IDirect3DRMImpl_CreateFace,
404 IDirect3DRMImpl_CreateAnimation,
405 IDirect3DRMImpl_CreateAnimationSet,
406 IDirect3DRMImpl_CreateTexture,
407 IDirect3DRMImpl_CreateLight,
408 IDirect3DRMImpl_CreateLightRGB,
409 IDirect3DRMImpl_Material,
410 IDirect3DRMImpl_CreateDevice,
411 IDirect3DRMImpl_CreateDeviceFromSurface,
412 IDirect3DRMImpl_CreateDeviceFromD3D,
413 IDirect3DRMImpl_CreateDeviceFromClipper,
414 IDirect3DRMImpl_CreateShadow,
415 IDirect3DRMImpl_CreateTextureFromSurface,
416 IDirect3DRMImpl_CreateViewport,
417 IDirect3DRMImpl_CreateWrap,
418 IDirect3DRMImpl_CreateUserVisual,
419 IDirect3DRMImpl_LoadTexture,
420 IDirect3DRMImpl_LoadTextureFromResource,
421 IDirect3DRMImpl_SetSearchPath,
422 IDirect3DRMImpl_AddSearchPath,
423 IDirect3DRMImpl_GetSearchPath,
424 IDirect3DRMImpl_SetDefaultTextureColors,
425 IDirect3DRMImpl_SetDefaultTextureShades,
426 IDirect3DRMImpl_GetDevices,
427 IDirect3DRMImpl_GetNamedObject,
428 IDirect3DRMImpl_EnumerateObjects,
429 IDirect3DRMImpl_Load,
430 IDirect3DRMImpl_Tick