makefiles: Don't use standard libs for programs that specify -nodefaultlibs.
[wine/zf.git] / dlls / ieframe / view.c
blobd307bb5a003178e0b9ab4321e72f34afefcc5fd3
1 /*
2 * Copyright 2005 Jacek Caban
3 * Copyright 2010 Ilya Shpigor
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include "ieframe.h"
22 #include "wine/debug.h"
24 WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
26 /**********************************************************************
27 * Implement the IViewObject interface
30 static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
32 return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
35 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
37 WebBrowser *This = impl_from_IViewObject2(iface);
38 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppv);
41 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
43 WebBrowser *This = impl_from_IViewObject2(iface);
44 return IUnknown_AddRef(This->hlink_frame.outer);
47 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
49 WebBrowser *This = impl_from_IViewObject2(iface);
50 return IUnknown_Release(This->hlink_frame.outer);
53 static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect,
54 LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev,
55 HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
56 BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR),
57 ULONG_PTR dwContinue)
59 WebBrowser *This = impl_from_IViewObject2(iface);
60 FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect, lindex,
61 pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
62 dwContinue);
63 return S_OK;
66 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
67 LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
68 LOGPALETTE **ppColorSet)
70 WebBrowser *This = impl_from_IViewObject2(iface);
71 FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
72 hicTargetDev, ppColorSet);
73 return E_NOTIMPL;
76 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
77 void *pvAspect, DWORD *pdwFreeze)
79 WebBrowser *This = impl_from_IViewObject2(iface);
80 FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
81 return E_NOTIMPL;
84 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
86 WebBrowser *This = impl_from_IViewObject2(iface);
87 FIXME("(%p)->(%d)\n", This, dwFreeze);
88 return E_NOTIMPL;
91 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
92 IAdviseSink *pAdvSink)
94 WebBrowser *This = impl_from_IViewObject2(iface);
96 TRACE("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
98 if (aspects || advf) FIXME("aspects and/or flags not supported yet\n");
100 This->sink_aspects = aspects;
101 This->sink_flags = advf;
102 if (This->sink) IAdviseSink_Release(This->sink);
103 This->sink = pAdvSink;
104 if (This->sink) IAdviseSink_AddRef(This->sink);
106 return S_OK;
109 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
110 DWORD *pAdvf, IAdviseSink **ppAdvSink)
112 WebBrowser *This = impl_from_IViewObject2(iface);
114 TRACE("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
116 if (pAspects) *pAspects = This->sink_aspects;
117 if (pAdvf) *pAdvf = This->sink_flags;
118 if (ppAdvSink)
120 *ppAdvSink = This->sink;
121 if (*ppAdvSink) IAdviseSink_AddRef(*ppAdvSink);
124 return S_OK;
127 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
128 DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
130 WebBrowser *This = impl_from_IViewObject2(iface);
131 FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
132 return E_NOTIMPL;
135 static const IViewObject2Vtbl ViewObjectVtbl = {
136 ViewObject_QueryInterface,
137 ViewObject_AddRef,
138 ViewObject_Release,
139 ViewObject_Draw,
140 ViewObject_GetColorSet,
141 ViewObject_Freeze,
142 ViewObject_Unfreeze,
143 ViewObject_SetAdvise,
144 ViewObject_GetAdvise,
145 ViewObject_GetExtent
148 /**********************************************************************
149 * Implement the IDataObject interface
152 static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
154 return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
157 static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
159 WebBrowser *This = impl_from_IDataObject(iface);
160 return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppvObj);
163 static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
165 WebBrowser *This = impl_from_IDataObject(iface);
166 return IUnknown_AddRef(This->hlink_frame.outer);
169 static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
171 WebBrowser *This = impl_from_IDataObject(iface);
172 return IUnknown_Release(This->hlink_frame.outer);
175 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
177 WebBrowser *This = impl_from_IDataObject(iface);
178 FIXME("(%p)->()\n", This);
179 return E_NOTIMPL;
182 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
184 WebBrowser *This = impl_from_IDataObject(iface);
185 FIXME("(%p)->()\n", This);
186 return E_NOTIMPL;
189 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
191 WebBrowser *This = impl_from_IDataObject(iface);
192 FIXME("(%p)->()\n", This);
193 return E_NOTIMPL;
196 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
198 WebBrowser *This = impl_from_IDataObject(iface);
199 FIXME("(%p)->()\n", This);
200 return E_NOTIMPL;
203 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
205 WebBrowser *This = impl_from_IDataObject(iface);
206 FIXME("(%p)->()\n", This);
207 return E_NOTIMPL;
210 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
212 WebBrowser *This = impl_from_IDataObject(iface);
213 FIXME("(%p)->()\n", This);
214 return E_NOTIMPL;
217 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
219 WebBrowser *This = impl_from_IDataObject(iface);
220 FIXME("(%p)->()\n", This);
221 return E_NOTIMPL;
224 static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
226 WebBrowser *This = impl_from_IDataObject(iface);
227 FIXME("(%p)->()\n", This);
228 return E_NOTIMPL;
231 static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
233 WebBrowser *This = impl_from_IDataObject(iface);
234 FIXME("(%p)->()\n", This);
235 return E_NOTIMPL;
238 static const IDataObjectVtbl DataObjectVtbl = {
239 DataObject_QueryInterface,
240 DataObject_AddRef,
241 DataObject_Release,
242 DataObject_GetData,
243 DataObject_GetDataHere,
244 DataObject_QueryGetData,
245 DataObject_GetCanonicalFormatEtc,
246 DataObject_SetData,
247 DataObject_EnumFormatEtc,
248 DataObject_DAdvise,
249 DataObject_DUnadvise,
250 DataObject_EnumDAdvise
253 void WebBrowser_ViewObject_Init(WebBrowser *This)
255 This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
256 This->IDataObject_iface.lpVtbl = &DataObjectVtbl;