2 * Copyright 2009 Vincent Povirk for CodeWeavers
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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
30 #include "wincodecs_private.h"
32 #include "wine/debug.h"
34 WINE_DEFAULT_DEBUG_CHANNEL(wincodecs);
59 const IWICBitmapDecoderVtbl *lpVtbl;
63 static HRESULT WINAPI IcoDecoder_QueryInterface(IWICBitmapDecoder *iface, REFIID iid,
66 IcoDecoder *This = (IcoDecoder*)iface;
67 TRACE("(%p,%s,%p)\n", iface, debugstr_guid(iid), ppv);
69 if (!ppv) return E_INVALIDARG;
71 if (IsEqualIID(&IID_IUnknown, iid) || IsEqualIID(&IID_IWICBitmapDecoder, iid))
81 IUnknown_AddRef((IUnknown*)*ppv);
85 static ULONG WINAPI IcoDecoder_AddRef(IWICBitmapDecoder *iface)
87 IcoDecoder *This = (IcoDecoder*)iface;
88 ULONG ref = InterlockedIncrement(&This->ref);
90 TRACE("(%p) refcount=%u\n", iface, ref);
95 static ULONG WINAPI IcoDecoder_Release(IWICBitmapDecoder *iface)
97 IcoDecoder *This = (IcoDecoder*)iface;
98 ULONG ref = InterlockedDecrement(&This->ref);
100 TRACE("(%p) refcount=%u\n", iface, ref);
104 HeapFree(GetProcessHeap(), 0, This);
110 static HRESULT WINAPI IcoDecoder_QueryCapability(IWICBitmapDecoder *iface, IStream *pIStream,
111 DWORD *pdwCapability)
113 FIXME("(%p,%p,%p): stub\n", iface, pIStream, pdwCapability);
117 static HRESULT WINAPI IcoDecoder_Initialize(IWICBitmapDecoder *iface, IStream *pIStream,
118 WICDecodeOptions cacheOptions)
120 FIXME("(%p,%p,%x): stub\n", iface, pIStream, cacheOptions);
124 static HRESULT WINAPI IcoDecoder_GetContainerFormat(IWICBitmapDecoder *iface,
125 GUID *pguidContainerFormat)
127 FIXME("(%p,%p): stub\n", iface, pguidContainerFormat);
131 static HRESULT WINAPI IcoDecoder_GetDecoderInfo(IWICBitmapDecoder *iface,
132 IWICBitmapDecoderInfo **ppIDecoderInfo)
134 FIXME("(%p,%p): stub\n", iface, ppIDecoderInfo);
138 static HRESULT WINAPI IcoDecoder_CopyPalette(IWICBitmapDecoder *iface,
139 IWICPalette *pIPalette)
141 TRACE("(%p,%p)\n", iface, pIPalette);
142 return WINCODEC_ERR_PALETTEUNAVAILABLE;
145 static HRESULT WINAPI IcoDecoder_GetMetadataQueryReader(IWICBitmapDecoder *iface,
146 IWICMetadataQueryReader **ppIMetadataQueryReader)
148 TRACE("(%p,%p)\n", iface, ppIMetadataQueryReader);
149 return WINCODEC_ERR_UNSUPPORTEDOPERATION;
152 static HRESULT WINAPI IcoDecoder_GetPreview(IWICBitmapDecoder *iface,
153 IWICBitmapSource **ppIBitmapSource)
155 TRACE("(%p,%p)\n", iface, ppIBitmapSource);
156 return WINCODEC_ERR_UNSUPPORTEDOPERATION;
159 static HRESULT WINAPI IcoDecoder_GetColorContexts(IWICBitmapDecoder *iface,
160 UINT cCount, IWICColorContext **ppIColorContexts, UINT *pcActualCount)
162 TRACE("(%p,%u,%p,%p)\n", iface, cCount, ppIColorContexts, pcActualCount);
163 return WINCODEC_ERR_UNSUPPORTEDOPERATION;
166 static HRESULT WINAPI IcoDecoder_GetThumbnail(IWICBitmapDecoder *iface,
167 IWICBitmapSource **ppIThumbnail)
169 TRACE("(%p,%p)\n", iface, ppIThumbnail);
170 return WINCODEC_ERR_CODECNOTHUMBNAIL;
173 static HRESULT WINAPI IcoDecoder_GetFrameCount(IWICBitmapDecoder *iface,
176 FIXME("(%p,%p): stub\n", iface, pCount);
180 static HRESULT WINAPI IcoDecoder_GetFrame(IWICBitmapDecoder *iface,
181 UINT index, IWICBitmapFrameDecode **ppIBitmapFrame)
183 FIXME("(%p,%u,%p): stub\n", iface, index, ppIBitmapFrame);
187 static const IWICBitmapDecoderVtbl IcoDecoder_Vtbl = {
188 IcoDecoder_QueryInterface,
191 IcoDecoder_QueryCapability,
192 IcoDecoder_Initialize,
193 IcoDecoder_GetContainerFormat,
194 IcoDecoder_GetDecoderInfo,
195 IcoDecoder_CopyPalette,
196 IcoDecoder_GetMetadataQueryReader,
197 IcoDecoder_GetPreview,
198 IcoDecoder_GetColorContexts,
199 IcoDecoder_GetThumbnail,
200 IcoDecoder_GetFrameCount,
204 HRESULT IcoDecoder_CreateInstance(IUnknown *pUnkOuter, REFIID iid, void** ppv)
209 TRACE("(%p,%s,%p)\n", pUnkOuter, debugstr_guid(iid), ppv);
213 if (pUnkOuter) return CLASS_E_NOAGGREGATION;
215 This = HeapAlloc(GetProcessHeap(), 0, sizeof(IcoDecoder));
216 if (!This) return E_OUTOFMEMORY;
218 This->lpVtbl = &IcoDecoder_Vtbl;
221 ret = IUnknown_QueryInterface((IUnknown*)This, iid, ppv);
222 IUnknown_Release((IUnknown*)This);