msxml3: Support iso-8859-x encodings in writer.
[wine.git] / dlls / d3drm / light.c
blob72477638a92dfa464b0f2e174bc8d13ae90915f3
1 /*
2 * Implementation of IDirect3DRMLight Interface
4 * Copyright 2012 André Hentschel
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "wine/debug.h"
23 #define COBJMACROS
25 #include "winbase.h"
26 #include "wingdi.h"
28 #include "d3drm_private.h"
30 WINE_DEFAULT_DEBUG_CHANNEL(d3drm);
32 typedef struct {
33 IDirect3DRMLight IDirect3DRMLight_iface;
34 LONG ref;
35 } IDirect3DRMLightImpl;
37 static inline IDirect3DRMLightImpl *impl_from_IDirect3DRMLight(IDirect3DRMLight *iface)
39 return CONTAINING_RECORD(iface, IDirect3DRMLightImpl, IDirect3DRMLight_iface);
42 /*** IUnknown methods ***/
43 static HRESULT WINAPI IDirect3DRMLightImpl_QueryInterface(IDirect3DRMLight* iface,
44 REFIID riid, void** object)
46 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
48 TRACE("(%p/%p)->(%s, %p)\n", iface, This, debugstr_guid(riid), object);
50 *object = NULL;
52 if(IsEqualGUID(riid, &IID_IUnknown) ||
53 IsEqualGUID(riid, &IID_IDirect3DRMLight))
55 *object = &This->IDirect3DRMLight_iface;
57 else
59 FIXME("interface %s not implemented\n", debugstr_guid(riid));
60 return E_NOINTERFACE;
63 IDirect3DRMLight_AddRef(iface);
64 return S_OK;
67 static ULONG WINAPI IDirect3DRMLightImpl_AddRef(IDirect3DRMLight* iface)
69 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
71 TRACE("(%p)\n", This);
73 return InterlockedIncrement(&This->ref);
76 static ULONG WINAPI IDirect3DRMLightImpl_Release(IDirect3DRMLight* iface)
78 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
79 ULONG ref = InterlockedDecrement(&This->ref);
81 TRACE("(%p)\n", This);
83 if (!ref)
84 HeapFree(GetProcessHeap(), 0, This);
86 return ref;
89 /*** IDirect3DRMObject methods ***/
90 static HRESULT WINAPI IDirect3DRMLightImpl_Clone(IDirect3DRMLight* iface,
91 LPUNKNOWN unkwn, REFIID riid,
92 LPVOID* object)
94 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
96 FIXME("(%p/%p)->(%p, %s, %p): stub\n", iface, This, unkwn, debugstr_guid(riid), object);
98 return E_NOTIMPL;
101 static HRESULT WINAPI IDirect3DRMLightImpl_AddDestroyCallback(IDirect3DRMLight* iface,
102 D3DRMOBJECTCALLBACK cb,
103 LPVOID argument)
105 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
107 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
109 return E_NOTIMPL;
112 static HRESULT WINAPI IDirect3DRMLightImpl_DeleteDestroyCallback(IDirect3DRMLight* iface,
113 D3DRMOBJECTCALLBACK cb,
114 LPVOID argument)
116 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
118 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, cb, argument);
120 return E_NOTIMPL;
123 static HRESULT WINAPI IDirect3DRMLightImpl_SetAppData(IDirect3DRMLight* iface,
124 DWORD data)
126 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
128 FIXME("(%p/%p)->(%u): stub\n", iface, This, data);
130 return E_NOTIMPL;
133 static DWORD WINAPI IDirect3DRMLightImpl_GetAppData(IDirect3DRMLight* iface)
135 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
137 FIXME("(%p/%p)->(): stub\n", iface, This);
139 return 0;
142 static HRESULT WINAPI IDirect3DRMLightImpl_SetName(IDirect3DRMLight* iface, LPCSTR name)
144 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
146 FIXME("(%p/%p)->(%s): stub\n", iface, This, name);
148 return E_NOTIMPL;
151 static HRESULT WINAPI IDirect3DRMLightImpl_GetName(IDirect3DRMLight* iface,
152 LPDWORD size, LPSTR name)
154 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
156 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
158 return E_NOTIMPL;
161 static HRESULT WINAPI IDirect3DRMLightImpl_GetClassName(IDirect3DRMLight* iface,
162 LPDWORD size, LPSTR name)
164 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
166 FIXME("(%p/%p)->(%p, %p): stub\n", iface, This, size, name);
168 return E_NOTIMPL;
171 /*** IDirect3DRMLight methods ***/
172 static HRESULT WINAPI IDirect3DRMLightImpl_SetType(IDirect3DRMLight* iface, D3DRMLIGHTTYPE type)
174 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
176 FIXME("(%p/%p)->(%u): stub\n", iface, This, type);
178 return E_NOTIMPL;
181 static HRESULT WINAPI IDirect3DRMLightImpl_SetColor(IDirect3DRMLight* iface, D3DCOLOR color)
183 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
185 FIXME("(%p/%p)->(%u): stub\n", iface, This, color);
187 return E_NOTIMPL;
190 static HRESULT WINAPI IDirect3DRMLightImpl_SetColorRGB(IDirect3DRMLight* iface,
191 D3DVALUE red, D3DVALUE green, D3DVALUE blue)
193 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
195 FIXME("(%p/%p)->(%f,%f,%f): stub\n", iface, This, red, green, blue);
197 return E_NOTIMPL;
200 static HRESULT WINAPI IDirect3DRMLightImpl_SetRange(IDirect3DRMLight* iface, D3DVALUE range)
202 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
204 FIXME("(%p/%p)->(%f): stub\n", iface, This, range);
206 return E_NOTIMPL;
209 static HRESULT WINAPI IDirect3DRMLightImpl_SetUmbra(IDirect3DRMLight* iface, D3DVALUE umbra)
211 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
213 FIXME("(%p/%p)->(%f): stub\n", iface, This, umbra);
215 return E_NOTIMPL;
218 static HRESULT WINAPI IDirect3DRMLightImpl_SetPenumbra(IDirect3DRMLight* iface, D3DVALUE penumbra)
220 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
222 FIXME("(%p/%p)->(%f): stub\n", iface, This, penumbra);
224 return E_NOTIMPL;
227 static HRESULT WINAPI IDirect3DRMLightImpl_SetConstantAttenuation(IDirect3DRMLight* iface,
228 D3DVALUE cattenuation)
230 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
232 FIXME("(%p/%p)->(%f): stub\n", iface, This, cattenuation);
234 return E_NOTIMPL;
237 static HRESULT WINAPI IDirect3DRMLightImpl_SetLinearAttenuation(IDirect3DRMLight* iface,
238 D3DVALUE lattenuation)
240 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
242 FIXME("(%p/%p)->(%f): stub\n", iface, This, lattenuation);
244 return E_NOTIMPL;
247 static HRESULT WINAPI IDirect3DRMLightImpl_SetQuadraticAttenuation(IDirect3DRMLight* iface,
248 D3DVALUE qattenuation)
250 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
252 FIXME("(%p/%p)->(%f): stub\n", iface, This, qattenuation);
254 return E_NOTIMPL;
257 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetRange(IDirect3DRMLight* iface)
259 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
261 FIXME("(%p/%p)->(): stub\n", iface, This);
263 return 0;
266 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetUmbra(IDirect3DRMLight* iface)
268 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
270 FIXME("(%p/%p)->(): stub\n", iface, This);
272 return 0;
275 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetPenumbra(IDirect3DRMLight* iface)
277 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
279 FIXME("(%p/%p)->(): stub\n", iface, This);
281 return 0;
284 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetConstantAttenuation(IDirect3DRMLight* iface)
286 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
288 FIXME("(%p/%p)->(): stub\n", iface, This);
290 return 0;
293 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetLinearAttenuation(IDirect3DRMLight* iface)
295 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
297 FIXME("(%p/%p)->(): stub\n", iface, This);
299 return 0;
302 static D3DVALUE WINAPI IDirect3DRMLightImpl_GetQuadraticAttenuation(IDirect3DRMLight* iface)
304 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
306 FIXME("(%p/%p)->(): stub\n", iface, This);
308 return 0;
311 static D3DCOLOR WINAPI IDirect3DRMLightImpl_GetColor(IDirect3DRMLight* iface)
313 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
315 FIXME("(%p/%p)->(): stub\n", iface, This);
317 return 0;
320 static D3DRMLIGHTTYPE WINAPI IDirect3DRMLightImpl_GetType(IDirect3DRMLight* iface)
322 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
324 FIXME("(%p/%p)->(): stub\n", iface, This);
326 return D3DRMLIGHT_AMBIENT;
329 static HRESULT WINAPI IDirect3DRMLightImpl_SetEnableFrame(IDirect3DRMLight* iface,
330 LPDIRECT3DRMFRAME frame)
332 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
334 FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
336 return E_NOTIMPL;
339 static HRESULT WINAPI IDirect3DRMLightImpl_GetEnableFrame(IDirect3DRMLight* iface,
340 LPDIRECT3DRMFRAME* frame)
342 IDirect3DRMLightImpl *This = impl_from_IDirect3DRMLight(iface);
344 FIXME("(%p/%p)->(%p): stub\n", iface, This, frame);
346 return E_NOTIMPL;
349 static const struct IDirect3DRMLightVtbl Direct3DRMLight_Vtbl =
351 /*** IUnknown methods ***/
352 IDirect3DRMLightImpl_QueryInterface,
353 IDirect3DRMLightImpl_AddRef,
354 IDirect3DRMLightImpl_Release,
355 /*** IDirect3DRMObject methods ***/
356 IDirect3DRMLightImpl_Clone,
357 IDirect3DRMLightImpl_AddDestroyCallback,
358 IDirect3DRMLightImpl_DeleteDestroyCallback,
359 IDirect3DRMLightImpl_SetAppData,
360 IDirect3DRMLightImpl_GetAppData,
361 IDirect3DRMLightImpl_SetName,
362 IDirect3DRMLightImpl_GetName,
363 IDirect3DRMLightImpl_GetClassName,
364 /*** IDirect3DRMLight methods ***/
365 IDirect3DRMLightImpl_SetType,
366 IDirect3DRMLightImpl_SetColor,
367 IDirect3DRMLightImpl_SetColorRGB,
368 IDirect3DRMLightImpl_SetRange,
369 IDirect3DRMLightImpl_SetUmbra,
370 IDirect3DRMLightImpl_SetPenumbra,
371 IDirect3DRMLightImpl_SetConstantAttenuation,
372 IDirect3DRMLightImpl_SetLinearAttenuation,
373 IDirect3DRMLightImpl_SetQuadraticAttenuation,
374 IDirect3DRMLightImpl_GetRange,
375 IDirect3DRMLightImpl_GetUmbra,
376 IDirect3DRMLightImpl_GetPenumbra,
377 IDirect3DRMLightImpl_GetConstantAttenuation,
378 IDirect3DRMLightImpl_GetLinearAttenuation,
379 IDirect3DRMLightImpl_GetQuadraticAttenuation,
380 IDirect3DRMLightImpl_GetColor,
381 IDirect3DRMLightImpl_GetType,
382 IDirect3DRMLightImpl_SetEnableFrame,
383 IDirect3DRMLightImpl_GetEnableFrame
386 HRESULT Direct3DRMLight_create(IUnknown** ppObj)
388 IDirect3DRMLightImpl* object;
390 TRACE("(%p)\n", ppObj);
392 object = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirect3DRMLightImpl));
393 if (!object)
395 ERR("Out of memory\n");
396 return E_OUTOFMEMORY;
399 object->IDirect3DRMLight_iface.lpVtbl = &Direct3DRMLight_Vtbl;
400 object->ref = 1;
402 *ppObj = (IUnknown*)&object->IDirect3DRMLight_iface;
404 return S_OK;