ReactOS  0.4.13-dev-1000-gbfea773
view.c
Go to the documentation of this file.
1 /*
2  * Copyright 2005 Jacek Caban
3  * Copyright 2010 Ilya Shpigor
4  *
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.
9  *
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.
14  *
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
18  */
19 
20 #include "ieframe.h"
21 
22 #include "wine/debug.h"
23 
25 
26 /**********************************************************************
27  * Implement the IViewObject interface
28  */
29 
31 {
32  return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
33 }
34 
36 {
38  return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
39 }
40 
42 {
44  return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
45 }
46 
48 {
50  return IWebBrowser2_Release(&This->IWebBrowser2_iface);
51 }
52 
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)
58 {
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;
64 }
65 
67  LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
68  LOGPALETTE **ppColorSet)
69 {
71  FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
72  hicTargetDev, ppColorSet);
73  return E_NOTIMPL;
74 }
75 
76 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
77  void *pvAspect, DWORD *pdwFreeze)
78 {
80  FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
81  return E_NOTIMPL;
82 }
83 
85 {
87  FIXME("(%p)->(%d)\n", This, dwFreeze);
88  return E_NOTIMPL;
89 }
90 
92  IAdviseSink *pAdvSink)
93 {
95 
96  TRACE("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
97 
98  if (aspects || advf) FIXME("aspects and/or flags not supported yet\n");
99 
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);
105 
106  return S_OK;
107 }
108 
110  DWORD *pAdvf, IAdviseSink **ppAdvSink)
111 {
113 
114  TRACE("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
115 
116  if (pAspects) *pAspects = This->sink_aspects;
117  if (pAdvf) *pAdvf = This->sink_flags;
118  if (ppAdvSink)
119  {
120  *ppAdvSink = This->sink;
121  if (*ppAdvSink) IAdviseSink_AddRef(*ppAdvSink);
122  }
123 
124  return S_OK;
125 }
126 
127 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
128  DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
129 {
131  FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
132  return E_NOTIMPL;
133 }
134 
135 static const IViewObject2Vtbl ViewObjectVtbl = {
146 };
147 
148 /**********************************************************************
149  * Implement the IDataObject interface
150  */
151 
153 {
154  return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
155 }
156 
158 {
160  return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppvObj);
161 }
162 
164 {
166  return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
167 }
168 
170 {
172  return IWebBrowser2_Release(&This->IWebBrowser2_iface);
173 }
174 
175 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
176 {
178  FIXME("(%p)->()\n", This);
179  return E_NOTIMPL;
180 }
181 
182 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
183 {
185  FIXME("(%p)->()\n", This);
186  return E_NOTIMPL;
187 }
188 
189 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
190 {
192  FIXME("(%p)->()\n", This);
193  return E_NOTIMPL;
194 }
195 
196 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
197 {
199  FIXME("(%p)->()\n", This);
200  return E_NOTIMPL;
201 }
202 
203 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
204 {
206  FIXME("(%p)->()\n", This);
207  return E_NOTIMPL;
208 }
209 
210 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
211 {
213  FIXME("(%p)->()\n", This);
214  return E_NOTIMPL;
215 }
216 
217 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
218 {
220  FIXME("(%p)->()\n", This);
221  return E_NOTIMPL;
222 }
223 
225 {
227  FIXME("(%p)->()\n", This);
228  return E_NOTIMPL;
229 }
230 
232 {
234  FIXME("(%p)->()\n", This);
235  return E_NOTIMPL;
236 }
237 
238 static const IDataObjectVtbl DataObjectVtbl = {
251 };
252 
254 {
255  This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
256  This->IDataObject_iface.lpVtbl = &DataObjectVtbl;
257 }
#define REFIID
Definition: guiddef.h:118
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects, DWORD *pAdvf, IAdviseSink **ppAdvSink)
Definition: view.c:109
REFIID riid
Definition: precomp.h:44
static HDC
Definition: imagelist.c:92
REFIID LPVOID * ppv
Definition: atlbase.h:39
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev, LOGPALETTE **ppColorSet)
Definition: view.c:66
uint32_t ULONG_PTR
Definition: typedefs.h:63
static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
Definition: view.c:169
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
Definition: view.c:210
#define FIXME(fmt,...)
Definition: debug.h:110
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex, DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
Definition: view.c:127
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
Definition: view.c:47
static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
Definition: view.c:224
static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
Definition: view.c:189
static WebBrowser * impl_from_IViewObject2(IViewObject2 *iface)
Definition: view.c:30
#define TRACE(s)
Definition: solgame.cpp:4
static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
Definition: view.c:203
static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
Definition: view.c:163
static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID *ppvObj)
Definition: view.c:157
static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev, HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds, BOOL(STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR), ULONG_PTR dwContinue)
Definition: view.c:53
WINE_DEFAULT_DEBUG_CHANNEL(d3d)
LONG HRESULT
Definition: typedefs.h:77
#define WINAPI
Definition: msvc.h:8
#define STDMETHODCALLTYPE
Definition: bdasup.h:9
unsigned long DWORD
Definition: ntddk_ex.h:95
static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
Definition: view.c:217
static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
Definition: view.c:175
void WebBrowser_ViewObject_Init(WebBrowser *This)
Definition: view.c:253
static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
Definition: view.c:196
interface IDataObject * LPDATAOBJECT
Definition: objfwd.h:21
static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
Definition: view.c:231
static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
Definition: view.c:182
#define S_OK
Definition: intsafe.h:59
static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
Definition: view.c:35
static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf, IAdviseSink *pAdvSink)
Definition: view.c:91
#define E_NOTIMPL
Definition: ddrawi.h:99
static const IViewObject2Vtbl ViewObjectVtbl
Definition: view.c:135
static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
Definition: view.c:41
unsigned int ULONG
Definition: retypes.h:1
static const IDataObjectVtbl DataObjectVtbl
Definition: view.c:238
static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
Definition: view.c:84
static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex, void *pvAspect, DWORD *pdwFreeze)
Definition: view.c:76
static WebBrowser * impl_from_IDataObject(IDataObject *iface)
Definition: view.c:152