windowscodecs: Add wrapper functions for IWICMetadataQueryWriter methods.
[wine] / dlls / windowscodecs / proxy.c
1 /*
2  * Misleadingly named convenience functions for accessing WIC.
3  *
4  * Copyright 2012 Vincent Povirk for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #include "config.h"
22
23 #include <stdarg.h>
24
25 #define COBJMACROS
26 #define NONAMELESSUNION
27
28 #include "windef.h"
29 #include "winbase.h"
30 #include "objbase.h"
31 #include "wincodec.h"
32
33 #include "wincodecs_private.h"
34
35 #include "wine/debug.h"
36
37 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
38
39 HRESULT WINAPI IWICBitmapFlipRotator_Initialize_Proxy_W(IWICBitmapFlipRotator *iface,
40     IWICBitmapSource *pISource, WICBitmapTransformOptions options)
41 {
42     return IWICBitmapFlipRotator_Initialize(iface, pISource, options);
43 }
44
45 HRESULT WINAPI IWICBitmapLock_GetDataPointer_Proxy_W(IWICBitmapLock *iface,
46     UINT *pcbBufferSize, BYTE **ppbData)
47 {
48     return IWICBitmapLock_GetDataPointer(iface, pcbBufferSize, ppbData);
49 }
50
51 HRESULT WINAPI IWICBitmapLock_GetStride_Proxy_W(IWICBitmapLock *iface,
52     UINT *pcbStride)
53 {
54     return IWICBitmapLock_GetStride(iface, pcbStride);
55 }
56
57 HRESULT WINAPI IWICBitmapSource_GetSize_Proxy_W(IWICBitmapSource *iface,
58     UINT *puiWidth, UINT *puiHeight)
59 {
60     return IWICBitmapSource_GetSize(iface, puiWidth, puiHeight);
61 }
62
63 HRESULT WINAPI IWICBitmapSource_GetPixelFormat_Proxy_W(IWICBitmapSource *iface,
64     WICPixelFormatGUID *pPixelFormat)
65 {
66     return IWICBitmapSource_GetPixelFormat(iface, pPixelFormat);
67 }
68
69 HRESULT WINAPI IWICBitmapSource_GetResolution_Proxy_W(IWICBitmapSource *iface,
70     double *pDpiX, double *pDpiY)
71 {
72     return IWICBitmapSource_GetResolution(iface, pDpiX, pDpiY);
73 }
74
75 HRESULT WINAPI IWICBitmapSource_CopyPalette_Proxy_W(IWICBitmapSource *iface,
76     IWICPalette *pIPalette)
77 {
78     return IWICBitmapSource_CopyPalette(iface, pIPalette);
79 }
80
81 HRESULT WINAPI IWICBitmapSource_CopyPixels_Proxy_W(IWICBitmapSource *iface,
82     const WICRect *prc, UINT cbStride, UINT cbBufferSize, BYTE *pbBuffer)
83 {
84     return IWICBitmapSource_CopyPixels(iface, prc, cbStride, cbBufferSize, pbBuffer);
85 }
86
87 HRESULT WINAPI IWICBitmap_Lock_Proxy_W(IWICBitmap *iface,
88     const WICRect *prcLock, DWORD flags, IWICBitmapLock **ppILock)
89 {
90     return IWICBitmap_Lock(iface, prcLock, flags, ppILock);
91 }
92
93 HRESULT WINAPI IWICBitmap_SetPalette_Proxy_W(IWICBitmap *iface,
94     IWICPalette *pIPalette)
95 {
96     return IWICBitmap_SetPalette(iface, pIPalette);
97 }
98
99 HRESULT WINAPI IWICBitmap_SetResolution_Proxy_W(IWICBitmap *iface,
100     double dpiX, double dpiY)
101 {
102     return IWICBitmap_SetResolution(iface, dpiX, dpiY);
103 }
104
105 HRESULT WINAPI IWICColorContext_InitializeFromMemory_Proxy_W(IWICColorContext *iface,
106     const BYTE *pbBuffer, UINT cbBufferSize)
107 {
108     return IWICColorContext_InitializeFromMemory(iface, pbBuffer, cbBufferSize);
109 }
110
111 HRESULT WINAPI IWICComponentInfo_GetCLSID_Proxy_W(IWICComponentInfo *iface,
112     CLSID *pclsid)
113 {
114     return IWICComponentInfo_GetCLSID(iface, pclsid);
115 }
116
117 HRESULT WINAPI IWICComponentInfo_GetAuthor_Proxy_W(IWICComponentInfo *iface,
118     UINT cchAuthor, WCHAR *wzAuthor, UINT *pcchActual)
119 {
120     return IWICComponentInfo_GetAuthor(iface, cchAuthor, wzAuthor, pcchActual);
121 }
122
123 HRESULT WINAPI IWICComponentInfo_GetVersion_Proxy_W(IWICComponentInfo *iface,
124     UINT cchVersion, WCHAR *wzVersion, UINT *pcchActual)
125 {
126     return IWICComponentInfo_GetVersion(iface, cchVersion, wzVersion, pcchActual);
127 }
128
129 HRESULT WINAPI IWICComponentInfo_GetSpecVersion_Proxy_W(IWICComponentInfo *iface,
130     UINT cchSpecVersion, WCHAR *wzSpecVersion, UINT *pcchActual)
131 {
132     return IWICComponentInfo_GetSpecVersion(iface, cchSpecVersion, wzSpecVersion, pcchActual);
133 }
134
135 HRESULT WINAPI IWICComponentInfo_GetFriendlyName_Proxy_W(IWICComponentInfo *iface,
136     UINT cchFriendlyName, WCHAR *wzFriendlyName, UINT *pcchActual)
137 {
138     return IWICComponentInfo_GetFriendlyName(iface, cchFriendlyName, wzFriendlyName, pcchActual);
139 }
140
141 HRESULT WINAPI IWICFastMetadataEncoder_Commit_Proxy_W(IWICFastMetadataEncoder *iface)
142 {
143     return IWICFastMetadataEncoder_Commit(iface);
144 }
145
146 HRESULT WINAPI IWICFastMetadataEncoder_GetMetadataQueryWriter_Proxy_W(IWICFastMetadataEncoder *iface,
147     IWICMetadataQueryWriter **ppIMetadataQueryWriter)
148 {
149     return IWICFastMetadataEncoder_GetMetadataQueryWriter(iface, ppIMetadataQueryWriter);
150 }
151
152 HRESULT WINAPI IWICImagingFactory_CreateBitmapClipper_Proxy_W(IWICImagingFactory *pFactory,
153     IWICBitmapClipper **ppIBitmapClipper)
154 {
155     return IWICImagingFactory_CreateBitmapClipper(pFactory, ppIBitmapClipper);
156 }
157
158 HRESULT WINAPI IWICImagingFactory_CreateBitmapFlipRotator_Proxy_W(IWICImagingFactory *pFactory,
159     IWICBitmapFlipRotator **ppIBitmapFlipRotator)
160 {
161     return IWICImagingFactory_CreateBitmapFlipRotator(pFactory, ppIBitmapFlipRotator);
162 }
163
164 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromHBITMAP_Proxy_W(IWICImagingFactory *pFactory,
165     HBITMAP hBitmap, HPALETTE hPalette, WICBitmapAlphaChannelOption options, IWICBitmap **ppIBitmap)
166 {
167     return IWICImagingFactory_CreateBitmapFromHBITMAP(pFactory, hBitmap, hPalette, options, ppIBitmap);
168 }
169
170 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromHICON_Proxy_W(IWICImagingFactory *pFactory,
171     HICON hIcon, IWICBitmap **ppIBitmap)
172 {
173     return IWICImagingFactory_CreateBitmapFromHICON(pFactory, hIcon, ppIBitmap);
174 }
175
176 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromMemory_Proxy_W(IWICImagingFactory *pFactory,
177     UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat, UINT cbStride,
178     UINT cbBufferSize, BYTE *pbBuffer, IWICBitmap **ppIBitmap)
179 {
180     return IWICImagingFactory_CreateBitmapFromMemory(pFactory, uiWidth, uiHeight,
181         pixelFormat, cbStride, cbBufferSize, pbBuffer, ppIBitmap);
182 }
183
184 HRESULT WINAPI IWICImagingFactory_CreateBitmapFromSource_Proxy_W(IWICImagingFactory *pFactory,
185     IWICBitmapSource *piBitmapSource, WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
186 {
187     return IWICImagingFactory_CreateBitmapFromSource(pFactory, piBitmapSource, option, ppIBitmap);
188 }
189
190 HRESULT WINAPI IWICImagingFactory_CreateBitmapScaler_Proxy_W(IWICImagingFactory *pFactory,
191     IWICBitmapScaler **ppIBitmapScaler)
192 {
193     return IWICImagingFactory_CreateBitmapScaler(pFactory, ppIBitmapScaler);
194 }
195
196 HRESULT WINAPI IWICImagingFactory_CreateBitmap_Proxy_W(IWICImagingFactory *pFactory,
197     UINT uiWidth, UINT uiHeight, REFWICPixelFormatGUID pixelFormat,
198     WICBitmapCreateCacheOption option, IWICBitmap **ppIBitmap)
199 {
200     return IWICImagingFactory_CreateBitmap(pFactory, uiWidth, uiHeight,
201         pixelFormat, option, ppIBitmap);
202 }
203
204 HRESULT WINAPI IWICImagingFactory_CreateComponentInfo_Proxy_W(IWICImagingFactory *pFactory,
205     REFCLSID clsidComponent, IWICComponentInfo **ppIInfo)
206 {
207     return IWICImagingFactory_CreateComponentInfo(pFactory, clsidComponent, ppIInfo);
208 }
209
210 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromFileHandle_Proxy_W(IWICImagingFactory *pFactory,
211     ULONG_PTR hFile, const GUID *pguidVendor, WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
212 {
213     return IWICImagingFactory_CreateDecoderFromFileHandle(pFactory, hFile, pguidVendor, metadataOptions, ppIDecoder);
214 }
215
216 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromFilename_Proxy_W(IWICImagingFactory *pFactory,
217     LPCWSTR wzFilename, const GUID *pguidVendor, DWORD dwDesiredAccess,
218     WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
219 {
220     return IWICImagingFactory_CreateDecoderFromFilename(pFactory, wzFilename,
221         pguidVendor, dwDesiredAccess, metadataOptions, ppIDecoder);
222 }
223
224 HRESULT WINAPI IWICImagingFactory_CreateDecoderFromStream_Proxy_W(IWICImagingFactory *pFactory,
225     IStream *pIStream, const GUID *pguidVendor,
226     WICDecodeOptions metadataOptions, IWICBitmapDecoder **ppIDecoder)
227 {
228     return IWICImagingFactory_CreateDecoderFromStream(pFactory, pIStream, pguidVendor, metadataOptions, ppIDecoder);
229 }
230
231 HRESULT WINAPI IWICImagingFactory_CreateEncoder_Proxy_W(IWICImagingFactory *pFactory,
232     REFGUID guidContainerFormat, const GUID *pguidVendor, IWICBitmapEncoder **ppIEncoder)
233 {
234     return IWICImagingFactory_CreateEncoder(pFactory, guidContainerFormat, pguidVendor, ppIEncoder);
235 }
236
237 HRESULT WINAPI IWICImagingFactory_CreateFastMetadataEncoderFromDecoder_Proxy_W(IWICImagingFactory *pFactory,
238     IWICBitmapDecoder *pIDecoder, IWICFastMetadataEncoder **ppIFastEncoder)
239 {
240     return IWICImagingFactory_CreateFastMetadataEncoderFromDecoder(pFactory, pIDecoder, ppIFastEncoder);
241 }
242
243 HRESULT WINAPI IWICImagingFactory_CreateFastMetadataEncoderFromFrameDecode_Proxy_W(IWICImagingFactory *pFactory,
244     IWICBitmapFrameDecode *pIFrameDecoder, IWICFastMetadataEncoder **ppIFastEncoder)
245 {
246     return IWICImagingFactory_CreateFastMetadataEncoderFromFrameDecode(pFactory, pIFrameDecoder, ppIFastEncoder);
247 }
248
249 HRESULT WINAPI IWICImagingFactory_CreateFormatConverter_Proxy_W(IWICImagingFactory *pFactory,
250     IWICFormatConverter **ppIFormatConverter)
251 {
252     return IWICImagingFactory_CreateFormatConverter(pFactory, ppIFormatConverter);
253 }
254
255 HRESULT WINAPI IWICImagingFactory_CreatePalette_Proxy_W(IWICImagingFactory *pFactory,
256     IWICPalette **ppIPalette)
257 {
258     return IWICImagingFactory_CreatePalette(pFactory, ppIPalette);
259 }
260
261 HRESULT WINAPI IWICImagingFactory_CreateQueryWriterFromReader_Proxy_W(IWICImagingFactory *pFactory,
262     IWICMetadataQueryReader *pIQueryReader, const GUID *pguidVendor,
263     IWICMetadataQueryWriter **ppIQueryWriter)
264 {
265     return IWICImagingFactory_CreateQueryWriterFromReader(pFactory, pIQueryReader, pguidVendor, ppIQueryWriter);
266 }
267
268 HRESULT WINAPI IWICImagingFactory_CreateQueryWriter_Proxy_W(IWICImagingFactory *pFactory,
269     REFGUID guidMetadataFormat, const GUID *pguidVendor, IWICMetadataQueryWriter **ppIQueryWriter)
270 {
271     return IWICImagingFactory_CreateQueryWriter(pFactory, guidMetadataFormat, pguidVendor, ppIQueryWriter);
272 }
273
274 HRESULT WINAPI IWICImagingFactory_CreateStream_Proxy_W(IWICImagingFactory *pFactory,
275     IWICStream **ppIWICStream)
276 {
277     return IWICImagingFactory_CreateStream(pFactory, ppIWICStream);
278 }
279
280 HRESULT WINAPI IWICMetadataQueryReader_GetContainerFormat_Proxy_W(IWICMetadataQueryReader *iface,
281     GUID *pguidContainerFormat)
282 {
283     return IWICMetadataQueryReader_GetContainerFormat(iface, pguidContainerFormat);
284 }
285
286 HRESULT WINAPI IWICMetadataQueryReader_GetLocation_Proxy_W(IWICMetadataQueryReader *iface,
287     UINT cchMaxLength, WCHAR *wzNamespace, UINT *pcchActualLength)
288 {
289     return IWICMetadataQueryReader_GetLocation(iface, cchMaxLength, wzNamespace, pcchActualLength);
290 }
291
292 HRESULT WINAPI IWICMetadataQueryReader_GetMetadataByName_Proxy_W(IWICMetadataQueryReader *iface,
293     LPCWSTR wzName, PROPVARIANT *pvarValue)
294 {
295     return IWICMetadataQueryReader_GetMetadataByName(iface, wzName, pvarValue);
296 }
297
298 HRESULT WINAPI IWICMetadataQueryReader_GetEnumerator_Proxy_W(IWICMetadataQueryReader *iface,
299     IEnumString **ppIEnumString)
300 {
301     return IWICMetadataQueryReader_GetEnumerator(iface, ppIEnumString);
302 }
303
304 HRESULT WINAPI IWICMetadataQueryWriter_SetMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface,
305     LPCWSTR wzName, const PROPVARIANT *pvarValue)
306 {
307     return IWICMetadataQueryWriter_SetMetadataByName(iface, wzName, pvarValue);
308 }
309
310 HRESULT WINAPI IWICMetadataQueryWriter_RemoveMetadataByName_Proxy_W(IWICMetadataQueryWriter *iface,
311     LPCWSTR wzName)
312 {
313     return IWICMetadataQueryWriter_RemoveMetadataByName(iface, wzName);
314 }
315
316 HRESULT WINAPI IWICPalette_InitializePredefined_Proxy_W(IWICPalette *iface,
317     WICBitmapPaletteType ePaletteType, BOOL fAddTransparentColor)
318 {
319     return IWICPalette_InitializePredefined(iface, ePaletteType, fAddTransparentColor);
320 }
321
322 HRESULT WINAPI IWICPalette_InitializeCustom_Proxy_W(IWICPalette *iface,
323     WICColor *pColors, UINT colorCount)
324 {
325     return IWICPalette_InitializeCustom(iface, pColors, colorCount);
326 }
327
328 HRESULT WINAPI IWICPalette_InitializeFromBitmap_Proxy_W(IWICPalette *iface,
329     IWICBitmapSource *pISurface, UINT colorCount, BOOL fAddTransparentColor)
330 {
331     return IWICPalette_InitializeFromBitmap(iface, pISurface, colorCount, fAddTransparentColor);
332 }
333
334 HRESULT WINAPI IWICPalette_InitializeFromPalette_Proxy_W(IWICPalette *iface,
335     IWICPalette *pIPalette)
336 {
337     return IWICPalette_InitializeFromPalette(iface, pIPalette);
338 }
339
340 HRESULT WINAPI IWICPalette_GetType_Proxy_W(IWICPalette *iface,
341     WICBitmapPaletteType *pePaletteType)
342 {
343     return IWICPalette_GetType(iface, pePaletteType);
344 }
345
346 HRESULT WINAPI IWICPalette_GetColorCount_Proxy_W(IWICPalette *iface,
347     UINT *pcCount)
348 {
349     return IWICPalette_GetColorCount(iface, pcCount);
350 }
351
352 HRESULT WINAPI IWICPalette_GetColors_Proxy_W(IWICPalette *iface,
353     UINT colorCount, WICColor *pColors, UINT *pcActualColors)
354 {
355     return IWICPalette_GetColors(iface, colorCount, pColors, pcActualColors);
356 }
357
358 HRESULT WINAPI IWICPalette_HasAlpha_Proxy_W(IWICPalette *iface,
359     BOOL *pfHasAlpha)
360 {
361     return IWICPalette_HasAlpha(iface, pfHasAlpha);
362 }
363
364 HRESULT WINAPI WICCreateImagingFactory_Proxy(UINT SDKVersion, IWICImagingFactory **ppIImagingFactory)
365 {
366     TRACE("%x, %p\n", SDKVersion, ppIImagingFactory);
367
368     return ImagingFactory_CreateInstance(NULL, &IID_IWICImagingFactory, (void**)ppIImagingFactory);
369 }