wined3d: Always create the software cursor.
[wine] / dlls / shdocvw / view.c
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 "wine/debug.h"
21 #include "shdocvw.h"
22
23 WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
24
25 /**********************************************************************
26  * Implement the IViewObject interface
27  */
28
29 static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
30 {
31     return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
32 }
33
34 static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
35 {
36     WebBrowser *This = impl_from_IViewObject2(iface);
37     return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
38 }
39
40 static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
41 {
42     WebBrowser *This = impl_from_IViewObject2(iface);
43     return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
44 }
45
46 static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
47 {
48     WebBrowser *This = impl_from_IViewObject2(iface);
49     return IWebBrowser2_Release(&This->IWebBrowser2_iface);
50 }
51
52 static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect,
53         LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev,
54         HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
55         BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR),
56         ULONG_PTR dwContinue)
57 {
58     WebBrowser *This = impl_from_IViewObject2(iface);
59     FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect, lindex,
60             pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
61             dwContinue);
62     return E_NOTIMPL;
63 }
64
65 static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
66         LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
67         LOGPALETTE **ppColorSet)
68 {
69     WebBrowser *This = impl_from_IViewObject2(iface);
70     FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
71             hicTargetDev, ppColorSet);
72     return E_NOTIMPL;
73 }
74
75 static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
76                                         void *pvAspect, DWORD *pdwFreeze)
77 {
78     WebBrowser *This = impl_from_IViewObject2(iface);
79     FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
80     return E_NOTIMPL;
81 }
82
83 static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
84 {
85     WebBrowser *This = impl_from_IViewObject2(iface);
86     FIXME("(%p)->(%d)\n", This, dwFreeze);
87     return E_NOTIMPL;
88 }
89
90 static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
91         IAdviseSink *pAdvSink)
92 {
93     WebBrowser *This = impl_from_IViewObject2(iface);
94     FIXME("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
95     return E_NOTIMPL;
96 }
97
98 static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
99         DWORD *pAdvf, IAdviseSink **ppAdvSink)
100 {
101     WebBrowser *This = impl_from_IViewObject2(iface);
102     FIXME("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
103     return E_NOTIMPL;
104 }
105
106 static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
107         DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
108 {
109     WebBrowser *This = impl_from_IViewObject2(iface);
110     FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
111     return E_NOTIMPL;
112 }
113
114 static const IViewObject2Vtbl ViewObjectVtbl = {
115     ViewObject_QueryInterface,
116     ViewObject_AddRef,
117     ViewObject_Release,
118     ViewObject_Draw,
119     ViewObject_GetColorSet,
120     ViewObject_Freeze,
121     ViewObject_Unfreeze,
122     ViewObject_SetAdvise,
123     ViewObject_GetAdvise,
124     ViewObject_GetExtent
125 };
126
127 /**********************************************************************
128  * Implement the IDataObject interface
129  */
130
131 static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
132 {
133     return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
134 }
135
136 static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
137 {
138     WebBrowser *This = impl_from_IDataObject(iface);
139     return IWebBrowser2_QueryInterface(&This->IWebBrowser2_iface, riid, ppvObj);
140 }
141
142 static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
143 {
144     WebBrowser *This = impl_from_IDataObject(iface);
145     return IWebBrowser2_AddRef(&This->IWebBrowser2_iface);
146 }
147
148 static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
149 {
150     WebBrowser *This = impl_from_IDataObject(iface);
151     return IWebBrowser2_Release(&This->IWebBrowser2_iface);
152 }
153
154 static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
155 {
156     WebBrowser *This = impl_from_IDataObject(iface);
157     FIXME("(%p)->()\n", This);
158     return E_NOTIMPL;
159 }
160
161 static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
162 {
163     WebBrowser *This = impl_from_IDataObject(iface);
164     FIXME("(%p)->()\n", This);
165     return E_NOTIMPL;
166 }
167
168 static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
169 {
170     WebBrowser *This = impl_from_IDataObject(iface);
171     FIXME("(%p)->()\n", This);
172     return E_NOTIMPL;
173 }
174
175 static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
176 {
177     WebBrowser *This = impl_from_IDataObject(iface);
178     FIXME("(%p)->()\n", This);
179     return E_NOTIMPL;
180 }
181
182 static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
183 {
184     WebBrowser *This = impl_from_IDataObject(iface);
185     FIXME("(%p)->()\n", This);
186     return E_NOTIMPL;
187 }
188
189 static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
190 {
191     WebBrowser *This = impl_from_IDataObject(iface);
192     FIXME("(%p)->()\n", This);
193     return E_NOTIMPL;
194 }
195
196 static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
197 {
198     WebBrowser *This = impl_from_IDataObject(iface);
199     FIXME("(%p)->()\n", This);
200     return E_NOTIMPL;
201 }
202
203 static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
204 {
205     WebBrowser *This = impl_from_IDataObject(iface);
206     FIXME("(%p)->()\n", This);
207     return E_NOTIMPL;
208 }
209
210 static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
211 {
212     WebBrowser *This = impl_from_IDataObject(iface);
213     FIXME("(%p)->()\n", This);
214     return E_NOTIMPL;
215 }
216
217 static const IDataObjectVtbl DataObjectVtbl = {
218     DataObject_QueryInterface,
219     DataObject_AddRef,
220     DataObject_Release,
221     DataObject_GetData,
222     DataObject_GetDataHere,
223     DataObject_QueryGetData,
224     DataObject_GetCanonicalFormatEtc,
225     DataObject_SetData,
226     DataObject_EnumFormatEtc,
227     DataObject_DAdvise,
228     DataObject_DUnadvise,
229     DataObject_EnumDAdvise
230 };
231
232 void WebBrowser_ViewObject_Init(WebBrowser *This)
233 {
234     This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
235     This->IDataObject_iface.lpVtbl  = &DataObjectVtbl;
236 }