msi: Use the correct function pointer in msi_init_assembly_caches.
[wine] / dlls / d3drm / viewport.c
1 /*
2  * Implementation of IDirect3DRMViewport Interface
3  *
4  * Copyright 2012 AndrĂ© Hentschel
5  *
6  * This file contains the (internal) driver registration functions,
7  * driver enumeration APIs and DirectDraw creation functions.
8  *
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.
13  *
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.
18  *
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
22  */
23
24 #include "wine/debug.h"
25
26 #define COBJMACROS
27
28 #include "winbase.h"
29 #include "wingdi.h"
30
31 #include "d3drm_private.h"
32
33 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
34
35 typedef struct {
36     IDirect3DRMViewport IDirect3DRMViewport_iface;
37     IDirect3DRMViewport2 IDirect3DRMViewport2_iface;
38     LONG ref;
39 } IDirect3DRMViewportImpl;
40
41 static inline IDirect3DRMViewportImpl *impl_from_IDirect3DRMViewport(IDirect3DRMViewport *iface)
42 {
43     return CONTAINING_RECORD(iface, IDirect3DRMViewportImpl, IDirect3DRMViewport_iface);
44 }
45
46 static inline IDirect3DRMViewportImpl *impl_from_IDirect3DRMViewport2(IDirect3DRMViewport2 *iface)
47 {
48     return CONTAINING_RECORD(iface, IDirect3DRMViewportImpl, IDirect3DRMViewport2_iface);
49 }
50
51 /*** IUnknown methods ***/
52 static HRESULT WINAPI IDirect3DRMViewportImpl_QueryInterface(IDirect3DRMViewport* iface,
53                                                              REFIID riid, void** object)
54 {
55     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
56
57     TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
58
59     *object = NULL;
60
61     if (IsEqualGUID(riid, &IID_IUnknown) ||
62         IsEqualGUID(riid, &IID_IDirect3DRMViewport))
63     {
64         *object = &This->IDirect3DRMViewport_iface;
65     }
66     else if(IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
67     {
68         *object = &This->IDirect3DRMViewport2_iface;
69     }
70     else
71     {
72         FIXME("interface %s not implemented\n", debugstr_guid(riid));
73         return E_NOINTERFACE;
74     }
75
76     IDirect3DRMViewport_AddRef(iface);
77     return S_OK;
78 }
79
80 static ULONG WINAPI IDirect3DRMViewportImpl_AddRef(IDirect3DRMViewport* iface)
81 {
82     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
83     ULONG ref = InterlockedIncrement(&This->ref);
84
85     TRACE("(%p)->(): new ref = %d\n", This, ref);
86
87     return ref;
88 }
89
90 static ULONG WINAPI IDirect3DRMViewportImpl_Release(IDirect3DRMViewport* iface)
91 {
92     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
93     ULONG ref = InterlockedDecrement(&This->ref);
94
95     TRACE("(%p)->(): new ref = %d\n", This, ref);
96
97     if (!ref)
98         HeapFree(GetProcessHeap(), 0, This);
99
100     return ref;
101 }
102
103 /*** IDirect3DRMObject methods ***/
104 static HRESULT WINAPI IDirect3DRMViewportImpl_Clone(IDirect3DRMViewport* iface,
105                                                         LPUNKNOWN unkwn, REFIID riid,
106                                                         LPVOID* object)
107 {
108     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
109
110     FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
111
112     return E_NOTIMPL;
113 }
114
115 static HRESULT WINAPI IDirect3DRMViewportImpl_AddDestroyCallback(IDirect3DRMViewport* iface,
116                                                                      D3DRMOBJECTCALLBACK cb,
117                                                                      LPVOID argument)
118 {
119     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
120
121     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
122
123     return E_NOTIMPL;
124 }
125
126 static HRESULT WINAPI IDirect3DRMViewportImpl_DeleteDestroyCallback(IDirect3DRMViewport* iface,
127                                                                         D3DRMOBJECTCALLBACK cb,
128                                                                         LPVOID argument)
129 {
130     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
131
132     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
133
134     return E_NOTIMPL;
135 }
136
137 static HRESULT WINAPI IDirect3DRMViewportImpl_SetAppData(IDirect3DRMViewport* iface,
138                                                              DWORD data)
139 {
140     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
141
142     FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
143
144     return E_NOTIMPL;
145 }
146
147 static DWORD WINAPI IDirect3DRMViewportImpl_GetAppData(IDirect3DRMViewport* iface)
148 {
149     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
150
151     FIXME("(%p/%p)->(): stub\n", iface, This);
152
153     return 0;
154 }
155
156 static HRESULT WINAPI IDirect3DRMViewportImpl_SetName(IDirect3DRMViewport* iface, LPCSTR name)
157 {
158     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
159
160     FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
161
162     return E_NOTIMPL;
163 }
164
165 static HRESULT WINAPI IDirect3DRMViewportImpl_GetName(IDirect3DRMViewport* iface,
166                                                           LPDWORD size, LPSTR name)
167 {
168     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
169
170     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
171
172     return E_NOTIMPL;
173 }
174
175 static HRESULT WINAPI IDirect3DRMViewportImpl_GetClassName(IDirect3DRMViewport* iface,
176                                                                LPDWORD size, LPSTR name)
177 {
178     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
179
180     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
181
182     return E_NOTIMPL;
183 }
184
185 /*** IDirect3DRMViewport methods ***/
186 static HRESULT WINAPI IDirect3DRMViewportImpl_Init(IDirect3DRMViewport* iface,
187                                                    LPDIRECT3DRMDEVICE dev, LPDIRECT3DRMFRAME camera,
188                                                    DWORD xpos, DWORD ypos,
189                                                    DWORD width, DWORD height)
190 {
191     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
192
193     FIXME("(%p/%p)->(%p, %p, %u, %u, %u, %u): stub\n", iface, This, dev, camera,
194           xpos, ypos, width, height);
195
196     return E_NOTIMPL;
197 }
198
199 static HRESULT WINAPI IDirect3DRMViewportImpl_Clear(IDirect3DRMViewport* iface)
200 {
201     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
202
203     FIXME("(%p/%p)->(): stub\n", iface, This);
204
205     return E_NOTIMPL;
206 }
207
208 static HRESULT WINAPI IDirect3DRMViewportImpl_Render(IDirect3DRMViewport* iface,
209                                                      LPDIRECT3DRMFRAME frame)
210 {
211     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
212
213     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
214
215     return E_NOTIMPL;
216 }
217
218 static HRESULT WINAPI IDirect3DRMViewportImpl_SetFront(IDirect3DRMViewport* iface, D3DVALUE front)
219 {
220     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
221
222     FIXME("(%p/%p)->(%f): stub\n", iface, This, front);
223
224     return E_NOTIMPL;
225 }
226
227 static HRESULT WINAPI IDirect3DRMViewportImpl_SetBack(IDirect3DRMViewport* iface, D3DVALUE back)
228 {
229     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
230
231     FIXME("(%p/%p)->(%f): stub\n", iface, This, back);
232
233     return E_NOTIMPL;
234 }
235
236 static HRESULT WINAPI IDirect3DRMViewportImpl_SetField(IDirect3DRMViewport* iface, D3DVALUE field)
237 {
238     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
239
240     FIXME("(%p/%p)->(%f): stub\n", iface, This, field);
241
242     return E_NOTIMPL;
243 }
244
245 static HRESULT WINAPI IDirect3DRMViewportImpl_SetUniformScaling(IDirect3DRMViewport* iface, BOOL b)
246 {
247     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
248
249     FIXME("(%p/%p)->(%d): stub\n", iface, This, b);
250
251     return E_NOTIMPL;
252 }
253
254 static HRESULT WINAPI IDirect3DRMViewportImpl_SetCamera(IDirect3DRMViewport* iface,
255                                                         LPDIRECT3DRMFRAME frame)
256 {
257     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
258
259     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
260
261     return E_NOTIMPL;
262 }
263
264 static HRESULT WINAPI IDirect3DRMViewportImpl_SetProjection(IDirect3DRMViewport* iface,
265                                                             D3DRMPROJECTIONTYPE type)
266 {
267     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
268
269     FIXME("(%p/%p)->(%u): stub\n", iface, This, type);
270
271     return S_OK;
272 }
273
274 static HRESULT WINAPI IDirect3DRMViewportImpl_Transform(IDirect3DRMViewport* iface,
275                                                         D3DRMVECTOR4D *d, D3DVECTOR *s)
276 {
277     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
278
279     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, d, s);
280
281     return E_NOTIMPL;
282 }
283
284 static HRESULT WINAPI IDirect3DRMViewportImpl_InverseTransform(IDirect3DRMViewport* iface,
285                                                                D3DVECTOR *d, D3DRMVECTOR4D *s)
286 {
287     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
288
289     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, d, s);
290
291     return E_NOTIMPL;
292 }
293
294 static HRESULT WINAPI IDirect3DRMViewportImpl_Configure(IDirect3DRMViewport* iface, LONG x, LONG y,
295                                                         DWORD width, DWORD height)
296 {
297     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
298
299     FIXME("(%p/%p)->(%u, %u, %u, %u): stub\n", iface, This, x, y, width, height);
300
301     return E_NOTIMPL;
302 }
303
304 static HRESULT WINAPI IDirect3DRMViewportImpl_ForceUpdate(IDirect3DRMViewport* iface,
305                                                           DWORD x1, DWORD y1, DWORD x2, DWORD y2)
306 {
307     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
308
309     FIXME("(%p/%p)->(%u, %u, %u, %u): stub\n", iface, This, x1, y1, x2, y2);
310
311     return E_NOTIMPL;
312 }
313
314 static HRESULT WINAPI IDirect3DRMViewportImpl_SetPlane(IDirect3DRMViewport* iface,
315                                                        D3DVALUE left, D3DVALUE right,
316                                                        D3DVALUE bottom, D3DVALUE top)
317 {
318     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
319
320     FIXME("(%p/%p)->(%f, %f, %f, %f): stub\n", iface, This, left, right, bottom, top);
321
322     return E_NOTIMPL;
323 }
324
325 static HRESULT WINAPI IDirect3DRMViewportImpl_GetCamera(IDirect3DRMViewport* iface,
326                                                         LPDIRECT3DRMFRAME * frame)
327 {
328     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
329
330     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
331
332     return E_NOTIMPL;
333 }
334
335 static HRESULT WINAPI IDirect3DRMViewportImpl_GetDevice(IDirect3DRMViewport* iface,
336                                                         LPDIRECT3DRMDEVICE * device)
337 {
338     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
339
340     FIXME("(%p/%p)->(%p): stub\n", iface, This, device);
341
342     return E_NOTIMPL;
343 }
344
345 static HRESULT WINAPI IDirect3DRMViewportImpl_GetPlane(IDirect3DRMViewport* iface,
346                                                        D3DVALUE *left, D3DVALUE *right,
347                                                        D3DVALUE *bottom, D3DVALUE *top)
348 {
349     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
350
351     FIXME("(%p/%p)->(%p, %p, %p, %p): stub\n", iface, This, left, right, bottom, top);
352
353     return E_NOTIMPL;
354 }
355
356 static HRESULT WINAPI IDirect3DRMViewportImpl_Pick(IDirect3DRMViewport* iface, LONG x, LONG y,
357                                                    LPDIRECT3DRMPICKEDARRAY *return_visuals)
358 {
359     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
360
361     FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, x, y, return_visuals);
362
363     return E_NOTIMPL;
364 }
365
366 static BOOL WINAPI IDirect3DRMViewportImpl_GetUniformScaling(IDirect3DRMViewport* iface)
367 {
368     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
369
370     FIXME("(%p/%p)->(): stub\n", iface, This);
371
372     return E_NOTIMPL;
373 }
374
375 static LONG WINAPI IDirect3DRMViewportImpl_GetX(IDirect3DRMViewport* iface)
376 {
377     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
378
379     FIXME("(%p/%p)->(): stub\n", iface, This);
380
381     return E_NOTIMPL;
382 }
383
384 static LONG WINAPI IDirect3DRMViewportImpl_GetY(IDirect3DRMViewport* iface)
385 {
386     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
387
388     FIXME("(%p/%p)->(): stub\n", iface, This);
389
390     return E_NOTIMPL;
391 }
392
393 static DWORD WINAPI IDirect3DRMViewportImpl_GetWidth(IDirect3DRMViewport* iface)
394 {
395     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
396
397     FIXME("(%p/%p)->(): stub\n", iface, This);
398
399     return E_NOTIMPL;
400 }
401
402 static DWORD WINAPI IDirect3DRMViewportImpl_GetHeight(IDirect3DRMViewport* iface)
403 {
404     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
405
406     FIXME("(%p/%p)->(): stub\n", iface, This);
407
408     return E_NOTIMPL;
409 }
410
411 static D3DVALUE WINAPI IDirect3DRMViewportImpl_GetField(IDirect3DRMViewport* iface)
412 {
413     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
414
415     FIXME("(%p/%p)->(): stub\n", iface, This);
416
417     return E_NOTIMPL;
418 }
419
420 static D3DVALUE WINAPI IDirect3DRMViewportImpl_GetBack(IDirect3DRMViewport* iface)
421 {
422     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
423
424     FIXME("(%p/%p)->(): stub\n", iface, This);
425
426     return E_NOTIMPL;
427 }
428
429 static D3DVALUE WINAPI IDirect3DRMViewportImpl_GetFront(IDirect3DRMViewport* iface)
430 {
431     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
432
433     FIXME("(%p/%p)->(): stub\n", iface, This);
434
435     return E_NOTIMPL;
436 }
437
438 static D3DRMPROJECTIONTYPE WINAPI IDirect3DRMViewportImpl_GetProjection(IDirect3DRMViewport* iface)
439 {
440     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
441
442     FIXME("(%p/%p)->(): stub\n", iface, This);
443
444     return E_NOTIMPL;
445 }
446
447 static HRESULT WINAPI IDirect3DRMViewportImpl_GetDirect3DViewport(IDirect3DRMViewport* iface,
448                                                                   LPDIRECT3DVIEWPORT * viewport)
449 {
450     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport(iface);
451
452     FIXME("(%p/%p)->(%p): stub\n", iface, This, This);
453
454     return E_NOTIMPL;
455 }
456
457 static const struct IDirect3DRMViewportVtbl Direct3DRMViewport_Vtbl =
458 {
459     /*** IUnknown methods ***/
460     IDirect3DRMViewportImpl_QueryInterface,
461     IDirect3DRMViewportImpl_AddRef,
462     IDirect3DRMViewportImpl_Release,
463     /*** IDirect3DRMObject methods ***/
464     IDirect3DRMViewportImpl_Clone,
465     IDirect3DRMViewportImpl_AddDestroyCallback,
466     IDirect3DRMViewportImpl_DeleteDestroyCallback,
467     IDirect3DRMViewportImpl_SetAppData,
468     IDirect3DRMViewportImpl_GetAppData,
469     IDirect3DRMViewportImpl_SetName,
470     IDirect3DRMViewportImpl_GetName,
471     IDirect3DRMViewportImpl_GetClassName,
472     /*** IDirect3DRMViewport methods ***/
473     IDirect3DRMViewportImpl_Init,
474     IDirect3DRMViewportImpl_Clear,
475     IDirect3DRMViewportImpl_Render,
476     IDirect3DRMViewportImpl_SetFront,
477     IDirect3DRMViewportImpl_SetBack,
478     IDirect3DRMViewportImpl_SetField,
479     IDirect3DRMViewportImpl_SetUniformScaling,
480     IDirect3DRMViewportImpl_SetCamera,
481     IDirect3DRMViewportImpl_SetProjection,
482     IDirect3DRMViewportImpl_Transform,
483     IDirect3DRMViewportImpl_InverseTransform,
484     IDirect3DRMViewportImpl_Configure,
485     IDirect3DRMViewportImpl_ForceUpdate,
486     IDirect3DRMViewportImpl_SetPlane,
487     IDirect3DRMViewportImpl_GetCamera,
488     IDirect3DRMViewportImpl_GetDevice,
489     IDirect3DRMViewportImpl_GetPlane,
490     IDirect3DRMViewportImpl_Pick,
491     IDirect3DRMViewportImpl_GetUniformScaling,
492     IDirect3DRMViewportImpl_GetX,
493     IDirect3DRMViewportImpl_GetY,
494     IDirect3DRMViewportImpl_GetWidth,
495     IDirect3DRMViewportImpl_GetHeight,
496     IDirect3DRMViewportImpl_GetField,
497     IDirect3DRMViewportImpl_GetBack,
498     IDirect3DRMViewportImpl_GetFront,
499     IDirect3DRMViewportImpl_GetProjection,
500     IDirect3DRMViewportImpl_GetDirect3DViewport
501 };
502
503
504 /*** IUnknown methods ***/
505 static HRESULT WINAPI IDirect3DRMViewport2Impl_QueryInterface(IDirect3DRMViewport2* iface,
506                                                              REFIID riid, void** object)
507 {
508     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
509     return IDirect3DRMViewport_QueryInterface(&This->IDirect3DRMViewport_iface, riid, object);
510 }
511
512 static ULONG WINAPI IDirect3DRMViewport2Impl_AddRef(IDirect3DRMViewport2* iface)
513 {
514     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
515     return IDirect3DRMViewport_AddRef(&This->IDirect3DRMViewport_iface);
516 }
517
518 static ULONG WINAPI IDirect3DRMViewport2Impl_Release(IDirect3DRMViewport2* iface)
519 {
520     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
521     return IDirect3DRMViewport_Release(&This->IDirect3DRMViewport_iface);
522 }
523
524 /*** IDirect3DRMObject methods ***/
525 static HRESULT WINAPI IDirect3DRMViewport2Impl_Clone(IDirect3DRMViewport2* iface,
526                                                         LPUNKNOWN unkwn, REFIID riid,
527                                                         LPVOID* object)
528 {
529     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
530
531     FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
532
533     return E_NOTIMPL;
534 }
535
536 static HRESULT WINAPI IDirect3DRMViewport2Impl_AddDestroyCallback(IDirect3DRMViewport2* iface,
537                                                                      D3DRMOBJECTCALLBACK cb,
538                                                                      LPVOID argument)
539 {
540     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
541
542     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
543
544     return E_NOTIMPL;
545 }
546
547 static HRESULT WINAPI IDirect3DRMViewport2Impl_DeleteDestroyCallback(IDirect3DRMViewport2* iface,
548                                                                         D3DRMOBJECTCALLBACK cb,
549                                                                         LPVOID argument)
550 {
551     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
552
553     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
554
555     return E_NOTIMPL;
556 }
557
558 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetAppData(IDirect3DRMViewport2* iface,
559                                                              DWORD data)
560 {
561     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
562
563     FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
564
565     return E_NOTIMPL;
566 }
567
568 static DWORD WINAPI IDirect3DRMViewport2Impl_GetAppData(IDirect3DRMViewport2* iface)
569 {
570     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
571
572     FIXME("(%p/%p)->(): stub\n", iface, This);
573
574     return 0;
575 }
576
577 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetName(IDirect3DRMViewport2* iface, LPCSTR name)
578 {
579     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
580
581     FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
582
583     return E_NOTIMPL;
584 }
585
586 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetName(IDirect3DRMViewport2* iface,
587                                                           LPDWORD size, LPSTR name)
588 {
589     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
590
591     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
592
593     return E_NOTIMPL;
594 }
595
596 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetClassName(IDirect3DRMViewport2* iface,
597                                                                LPDWORD size, LPSTR name)
598 {
599     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
600
601     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
602
603     return E_NOTIMPL;
604 }
605
606 /*** IDirect3DRMViewport methods ***/
607 static HRESULT WINAPI IDirect3DRMViewport2Impl_Init(IDirect3DRMViewport2* iface,
608                                                    LPDIRECT3DRMDEVICE3 dev, LPDIRECT3DRMFRAME3 camera,
609                                                    DWORD xpos, DWORD ypos,
610                                                    DWORD width, DWORD height)
611 {
612     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
613
614     FIXME("(%p/%p)->(%p, %p, %u, %u, %u, %u): stub\n", iface, This, dev, camera,
615           xpos, ypos, width, height);
616
617     return E_NOTIMPL;
618 }
619
620 static HRESULT WINAPI IDirect3DRMViewport2Impl_Clear(IDirect3DRMViewport2* iface, DWORD flags)
621 {
622     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
623
624     FIXME("(%p/%p)->(): stub\n", iface, This);
625
626     return E_NOTIMPL;
627 }
628
629 static HRESULT WINAPI IDirect3DRMViewport2Impl_Render(IDirect3DRMViewport2* iface,
630                                                      LPDIRECT3DRMFRAME3 frame)
631 {
632     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
633
634     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
635
636     return E_NOTIMPL;
637 }
638
639 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetFront(IDirect3DRMViewport2* iface, D3DVALUE front)
640 {
641     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
642
643     FIXME("(%p/%p)->(%f): stub\n", iface, This, front);
644
645     return E_NOTIMPL;
646 }
647
648 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetBack(IDirect3DRMViewport2* iface, D3DVALUE back)
649 {
650     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
651
652     FIXME("(%p/%p)->(%f): stub\n", iface, This, back);
653
654     return E_NOTIMPL;
655 }
656
657 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetField(IDirect3DRMViewport2* iface, D3DVALUE field)
658 {
659     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
660
661     FIXME("(%p/%p)->(%f): stub\n", iface, This, field);
662
663     return E_NOTIMPL;
664 }
665
666 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetUniformScaling(IDirect3DRMViewport2* iface, BOOL b)
667 {
668     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
669
670     FIXME("(%p/%p)->(%d): stub\n", iface, This, b);
671
672     return E_NOTIMPL;
673 }
674
675 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetCamera(IDirect3DRMViewport2* iface,
676                                                         LPDIRECT3DRMFRAME3 frame)
677 {
678     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
679
680     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
681
682     return E_NOTIMPL;
683 }
684
685 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetProjection(IDirect3DRMViewport2* iface,
686                                                             D3DRMPROJECTIONTYPE type)
687 {
688     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
689
690     FIXME("(%p/%p)->(%u): stub\n", iface, This, type);
691
692     return S_OK;
693 }
694
695 static HRESULT WINAPI IDirect3DRMViewport2Impl_Transform(IDirect3DRMViewport2* iface,
696                                                         D3DRMVECTOR4D *d, D3DVECTOR *s)
697 {
698     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
699
700     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, d, s);
701
702     return E_NOTIMPL;
703 }
704
705 static HRESULT WINAPI IDirect3DRMViewport2Impl_InverseTransform(IDirect3DRMViewport2* iface,
706                                                                D3DVECTOR *d, D3DRMVECTOR4D *s)
707 {
708     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
709
710     FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, d, s);
711
712     return E_NOTIMPL;
713 }
714
715 static HRESULT WINAPI IDirect3DRMViewport2Impl_Configure(IDirect3DRMViewport2* iface, LONG x, LONG y,
716                                                         DWORD width, DWORD height)
717 {
718     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
719
720     FIXME("(%p/%p)->(%u, %u, %u, %u): stub\n", iface, This, x, y, width, height);
721
722     return E_NOTIMPL;
723 }
724
725 static HRESULT WINAPI IDirect3DRMViewport2Impl_ForceUpdate(IDirect3DRMViewport2* iface,
726                                                           DWORD x1, DWORD y1, DWORD x2, DWORD y2)
727 {
728     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
729
730     FIXME("(%p/%p)->(%u, %u, %u, %u): stub\n", iface, This, x1, y1, x2, y2);
731
732     return E_NOTIMPL;
733 }
734
735 static HRESULT WINAPI IDirect3DRMViewport2Impl_SetPlane(IDirect3DRMViewport2* iface,
736                                                        D3DVALUE left, D3DVALUE right,
737                                                        D3DVALUE bottom, D3DVALUE top)
738 {
739     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
740
741     FIXME("(%p/%p)->(%f, %f, %f, %f): stub\n", iface, This, left, right, bottom, top);
742
743     return E_NOTIMPL;
744 }
745
746 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetCamera(IDirect3DRMViewport2* iface,
747                                                         LPDIRECT3DRMFRAME3 * frame)
748 {
749     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
750
751     FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
752
753     return E_NOTIMPL;
754 }
755
756 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetDevice(IDirect3DRMViewport2* iface,
757                                                         LPDIRECT3DRMDEVICE3 * device)
758 {
759     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
760
761     FIXME("(%p/%p)->(%p): stub\n", iface, This, device);
762
763     return E_NOTIMPL;
764 }
765
766 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetPlane(IDirect3DRMViewport2* iface,
767                                                        D3DVALUE *left, D3DVALUE *right,
768                                                        D3DVALUE *bottom, D3DVALUE *top)
769 {
770     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
771
772     FIXME("(%p/%p)->(%p, %p, %p, %p): stub\n", iface, This, left, right, bottom, top);
773
774     return E_NOTIMPL;
775 }
776
777 static HRESULT WINAPI IDirect3DRMViewport2Impl_Pick(IDirect3DRMViewport2* iface, LONG x, LONG y,
778                                                    LPDIRECT3DRMPICKEDARRAY *return_visuals)
779 {
780     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
781
782     FIXME("(%p/%p)->(%u, %u, %p): stub\n", iface, This, x, y, return_visuals);
783
784     return E_NOTIMPL;
785 }
786
787 static BOOL WINAPI IDirect3DRMViewport2Impl_GetUniformScaling(IDirect3DRMViewport2* iface)
788 {
789     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
790
791     FIXME("(%p/%p)->(): stub\n", iface, This);
792
793     return E_NOTIMPL;
794 }
795
796 static LONG WINAPI IDirect3DRMViewport2Impl_GetX(IDirect3DRMViewport2* iface)
797 {
798     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
799
800     FIXME("(%p/%p)->(): stub\n", iface, This);
801
802     return E_NOTIMPL;
803 }
804
805 static LONG WINAPI IDirect3DRMViewport2Impl_GetY(IDirect3DRMViewport2* iface)
806 {
807     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
808
809     FIXME("(%p/%p)->(): stub\n", iface, This);
810
811     return E_NOTIMPL;
812 }
813
814 static DWORD WINAPI IDirect3DRMViewport2Impl_GetWidth(IDirect3DRMViewport2* iface)
815 {
816     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
817
818     FIXME("(%p/%p)->(): stub\n", iface, This);
819
820     return E_NOTIMPL;
821 }
822
823 static DWORD WINAPI IDirect3DRMViewport2Impl_GetHeight(IDirect3DRMViewport2* iface)
824 {
825     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
826
827     FIXME("(%p/%p)->(): stub\n", iface, This);
828
829     return E_NOTIMPL;
830 }
831
832 static D3DVALUE WINAPI IDirect3DRMViewport2Impl_GetField(IDirect3DRMViewport2* iface)
833 {
834     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
835
836     FIXME("(%p/%p)->(): stub\n", iface, This);
837
838     return E_NOTIMPL;
839 }
840
841 static D3DVALUE WINAPI IDirect3DRMViewport2Impl_GetBack(IDirect3DRMViewport2* iface)
842 {
843     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
844
845     FIXME("(%p/%p)->(): stub\n", iface, This);
846
847     return E_NOTIMPL;
848 }
849
850 static D3DVALUE WINAPI IDirect3DRMViewport2Impl_GetFront(IDirect3DRMViewport2* iface)
851 {
852     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
853
854     FIXME("(%p/%p)->(): stub\n", iface, This);
855
856     return E_NOTIMPL;
857 }
858
859 static D3DRMPROJECTIONTYPE WINAPI IDirect3DRMViewport2Impl_GetProjection(IDirect3DRMViewport2* iface)
860 {
861     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
862
863     FIXME("(%p/%p)->(): stub\n", iface, This);
864
865     return E_NOTIMPL;
866 }
867
868 static HRESULT WINAPI IDirect3DRMViewport2Impl_GetDirect3DViewport(IDirect3DRMViewport2* iface,
869                                                                   LPDIRECT3DVIEWPORT * viewport)
870 {
871     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
872
873     FIXME("(%p/%p)->(%p): stub\n", iface, This, This);
874
875     return E_NOTIMPL;
876 }
877
878 /*** IDirect3DRMViewport2 methods ***/
879 static HRESULT WINAPI IDirect3DRMViewport2Impl_TransformVectors(IDirect3DRMViewport2* iface,
880                                                                 DWORD numvectors,
881                                                                 LPD3DRMVECTOR4D dstvectors,
882                                                                 LPD3DVECTOR srcvectors)
883 {
884     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
885
886     FIXME("(%p/%p)->(%u, %p, %p): stub\n", iface, This, numvectors, dstvectors, srcvectors);
887
888     return E_NOTIMPL;
889 }
890
891 static HRESULT WINAPI IDirect3DRMViewport2Impl_InverseTransformVectors(IDirect3DRMViewport2* iface,
892                                                                 DWORD numvectors,
893                                                                 LPD3DVECTOR dstvectors,
894                                                                 LPD3DRMVECTOR4D srcvectors)
895 {
896     IDirect3DRMViewportImpl *This = impl_from_IDirect3DRMViewport2(iface);
897
898     FIXME("(%p/%p)->(%u, %p, %p): stub\n", iface, This, numvectors, dstvectors, srcvectors);
899
900     return E_NOTIMPL;
901 }
902
903 static const struct IDirect3DRMViewport2Vtbl Direct3DRMViewport2_Vtbl =
904 {
905     /*** IUnknown methods ***/
906     IDirect3DRMViewport2Impl_QueryInterface,
907     IDirect3DRMViewport2Impl_AddRef,
908     IDirect3DRMViewport2Impl_Release,
909     /*** IDirect3DRMObject methods ***/
910     IDirect3DRMViewport2Impl_Clone,
911     IDirect3DRMViewport2Impl_AddDestroyCallback,
912     IDirect3DRMViewport2Impl_DeleteDestroyCallback,
913     IDirect3DRMViewport2Impl_SetAppData,
914     IDirect3DRMViewport2Impl_GetAppData,
915     IDirect3DRMViewport2Impl_SetName,
916     IDirect3DRMViewport2Impl_GetName,
917     IDirect3DRMViewport2Impl_GetClassName,
918     /*** IDirect3DRMViewport methods ***/
919     IDirect3DRMViewport2Impl_Init,
920     IDirect3DRMViewport2Impl_Clear,
921     IDirect3DRMViewport2Impl_Render,
922     IDirect3DRMViewport2Impl_SetFront,
923     IDirect3DRMViewport2Impl_SetBack,
924     IDirect3DRMViewport2Impl_SetField,
925     IDirect3DRMViewport2Impl_SetUniformScaling,
926     IDirect3DRMViewport2Impl_SetCamera,
927     IDirect3DRMViewport2Impl_SetProjection,
928     IDirect3DRMViewport2Impl_Transform,
929     IDirect3DRMViewport2Impl_InverseTransform,
930     IDirect3DRMViewport2Impl_Configure,
931     IDirect3DRMViewport2Impl_ForceUpdate,
932     IDirect3DRMViewport2Impl_SetPlane,
933     IDirect3DRMViewport2Impl_GetCamera,
934     IDirect3DRMViewport2Impl_GetDevice,
935     IDirect3DRMViewport2Impl_GetPlane,
936     IDirect3DRMViewport2Impl_Pick,
937     IDirect3DRMViewport2Impl_GetUniformScaling,
938     IDirect3DRMViewport2Impl_GetX,
939     IDirect3DRMViewport2Impl_GetY,
940     IDirect3DRMViewport2Impl_GetWidth,
941     IDirect3DRMViewport2Impl_GetHeight,
942     IDirect3DRMViewport2Impl_GetField,
943     IDirect3DRMViewport2Impl_GetBack,
944     IDirect3DRMViewport2Impl_GetFront,
945     IDirect3DRMViewport2Impl_GetProjection,
946     IDirect3DRMViewport2Impl_GetDirect3DViewport,
947     /*** IDirect3DRMViewport2 methods ***/
948     IDirect3DRMViewport2Impl_TransformVectors,
949     IDirect3DRMViewport2Impl_InverseTransformVectors
950 };
951
952 HRESULT Direct3DRMViewport_create(REFIID riid, IUnknown** ppObj)
953 {
954     IDirect3DRMViewportImpl* object;
955
956     TRACE("(%p)\n", ppObj);
957
958     object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMViewportImpl));
959     if (!object)
960     {
961         ERR("Out of memory\n");
962         return E_OUTOFMEMORY;
963     }
964
965     object->IDirect3DRMViewport_iface.lpVtbl = &Direct3DRMViewport_Vtbl;
966     object->IDirect3DRMViewport2_iface.lpVtbl = &Direct3DRMViewport2_Vtbl;
967     object->ref = 1;
968
969     if (IsEqualGUID(riid, &IID_IDirect3DRMViewport2))
970         *ppObj = (IUnknown*)&object->IDirect3DRMViewport2_iface;
971     else
972         *ppObj = (IUnknown*)&object->IDirect3DRMViewport_iface;
973
974     return S_OK;
975 }