2005-11-12 20:09:46 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Jacek Caban
|
2010-05-18 15:17:29 +02:00
|
|
|
* Copyright 2010 Ilya Shpigor
|
2005-11-12 20:09:46 +01:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2005-11-12 20:09:46 +01:00
|
|
|
*/
|
|
|
|
|
2011-07-27 14:46:48 +02:00
|
|
|
#include "ieframe.h"
|
|
|
|
|
2005-11-12 20:09:46 +01:00
|
|
|
#include "wine/debug.h"
|
|
|
|
|
2011-07-29 12:18:33 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(ieframe);
|
2005-11-12 20:09:46 +01:00
|
|
|
|
2010-05-18 15:17:29 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IViewObject interface
|
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IViewObject2(IViewObject2 *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IViewObject2_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2005-11-12 20:09:46 +01:00
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_QueryInterface(IViewObject2 *iface, REFIID riid, void **ppv)
|
2005-11-12 20:09:46 +01:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppv);
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static ULONG WINAPI ViewObject_AddRef(IViewObject2 *iface)
|
2005-11-12 20:09:46 +01:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_AddRef(This->hlink_frame.outer);
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static ULONG WINAPI ViewObject_Release(IViewObject2 *iface)
|
2005-11-12 20:09:46 +01:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_Release(This->hlink_frame.outer);
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_Draw(IViewObject2 *iface, DWORD dwDrawAspect,
|
2005-11-12 20:09:46 +01:00
|
|
|
LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcTargetDev,
|
|
|
|
HDC hdcDraw, LPCRECTL lprcBounds, LPCRECTL lprcWBounds,
|
|
|
|
BOOL (STDMETHODCALLTYPE *pfnContinue)(ULONG_PTR),
|
|
|
|
ULONG_PTR dwContinue)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%p)->(%d %d %p %p %p %p %p %p %p %08lx)\n", This, dwDrawAspect, lindex,
|
2005-11-12 20:09:46 +01:00
|
|
|
pvAspect, ptd, hdcTargetDev, hdcDraw, lprcBounds, lprcWBounds, pfnContinue,
|
|
|
|
dwContinue);
|
2018-03-28 17:41:07 +02:00
|
|
|
return S_OK;
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_GetColorSet(IViewObject2 *iface, DWORD dwAspect,
|
2005-11-12 20:09:46 +01:00
|
|
|
LONG lindex, void *pvAspect, DVTARGETDEVICE *ptd, HDC hicTargetDev,
|
|
|
|
LOGPALETTE **ppColorSet)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%p)->(%d %d %p %p %p %p)\n", This, dwAspect, lindex, pvAspect, ptd,
|
2005-11-12 20:09:46 +01:00
|
|
|
hicTargetDev, ppColorSet);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_Freeze(IViewObject2 *iface, DWORD dwDrawAspect, LONG lindex,
|
2005-11-12 20:09:46 +01:00
|
|
|
void *pvAspect, DWORD *pdwFreeze)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%p)->(%d %d %p %p)\n", This, dwDrawAspect, lindex, pvAspect, pdwFreeze);
|
2005-11-12 20:09:46 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_Unfreeze(IViewObject2 *iface, DWORD dwFreeze)
|
2005-11-12 20:09:46 +01:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%p)->(%d)\n", This, dwFreeze);
|
2005-11-12 20:09:46 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_SetAdvise(IViewObject2 *iface, DWORD aspects, DWORD advf,
|
2005-11-12 20:09:46 +01:00
|
|
|
IAdviseSink *pAdvSink)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2015-07-17 12:35:45 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%d %08x %p)\n", This, aspects, advf, pAdvSink);
|
|
|
|
|
|
|
|
if (aspects || advf) FIXME("aspects and/or flags not supported yet\n");
|
|
|
|
|
|
|
|
This->sink_aspects = aspects;
|
|
|
|
This->sink_flags = advf;
|
|
|
|
if (This->sink) IAdviseSink_Release(This->sink);
|
|
|
|
This->sink = pAdvSink;
|
|
|
|
if (This->sink) IAdviseSink_AddRef(This->sink);
|
|
|
|
|
|
|
|
return S_OK;
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_GetAdvise(IViewObject2 *iface, DWORD *pAspects,
|
2005-11-12 20:09:46 +01:00
|
|
|
DWORD *pAdvf, IAdviseSink **ppAdvSink)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2015-07-17 12:35:45 +02:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p %p %p)\n", This, pAspects, pAdvf, ppAdvSink);
|
|
|
|
|
|
|
|
if (pAspects) *pAspects = This->sink_aspects;
|
|
|
|
if (pAdvf) *pAdvf = This->sink_flags;
|
|
|
|
if (ppAdvSink)
|
|
|
|
{
|
|
|
|
*ppAdvSink = This->sink;
|
|
|
|
if (*ppAdvSink) IAdviseSink_AddRef(*ppAdvSink);
|
|
|
|
}
|
|
|
|
|
|
|
|
return S_OK;
|
2005-11-12 20:09:46 +01:00
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static HRESULT WINAPI ViewObject_GetExtent(IViewObject2 *iface, DWORD dwAspect, LONG lindex,
|
2005-11-12 20:09:46 +01:00
|
|
|
DVTARGETDEVICE *ptd, LPSIZEL lpsizel)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IViewObject2(iface);
|
2006-10-05 23:49:39 +02:00
|
|
|
FIXME("(%p)->(%d %d %p %p)\n", This, dwAspect, lindex, ptd, lpsizel);
|
2005-11-12 20:09:46 +01:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2008-11-11 19:57:49 +01:00
|
|
|
static const IViewObject2Vtbl ViewObjectVtbl = {
|
2005-11-12 20:09:46 +01:00
|
|
|
ViewObject_QueryInterface,
|
|
|
|
ViewObject_AddRef,
|
|
|
|
ViewObject_Release,
|
|
|
|
ViewObject_Draw,
|
|
|
|
ViewObject_GetColorSet,
|
|
|
|
ViewObject_Freeze,
|
|
|
|
ViewObject_Unfreeze,
|
|
|
|
ViewObject_SetAdvise,
|
|
|
|
ViewObject_GetAdvise,
|
2008-11-11 19:57:49 +01:00
|
|
|
ViewObject_GetExtent
|
2005-11-12 20:09:46 +01:00
|
|
|
};
|
|
|
|
|
2010-05-18 15:17:29 +02:00
|
|
|
/**********************************************************************
|
|
|
|
* Implement the IDataObject interface
|
|
|
|
*/
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
static inline WebBrowser *impl_from_IDataObject(IDataObject *iface)
|
|
|
|
{
|
2010-11-24 14:06:38 +01:00
|
|
|
return CONTAINING_RECORD(iface, WebBrowser, IDataObject_iface);
|
2010-11-13 17:47:44 +01:00
|
|
|
}
|
2010-05-18 15:17:29 +02:00
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_QueryInterface(LPDATAOBJECT iface, REFIID riid, LPVOID * ppvObj)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_QueryInterface(This->hlink_frame.outer, riid, ppvObj);
|
2010-05-18 15:17:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DataObject_AddRef(LPDATAOBJECT iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_AddRef(This->hlink_frame.outer);
|
2010-05-18 15:17:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI DataObject_Release(LPDATAOBJECT iface)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2019-12-10 13:44:44 +01:00
|
|
|
return IUnknown_Release(This->hlink_frame.outer);
|
2010-05-18 15:17:29 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_GetData(LPDATAOBJECT iface, LPFORMATETC pformatetcIn, STGMEDIUM *pmedium)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_GetDataHere(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_QueryGetData(LPDATAOBJECT iface, LPFORMATETC pformatetc)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_GetCanonicalFormatEtc(LPDATAOBJECT iface, LPFORMATETC pformatectIn, LPFORMATETC pformatetcOut)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_SetData(LPDATAOBJECT iface, LPFORMATETC pformatetc, STGMEDIUM *pmedium, BOOL fRelease)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_EnumFormatEtc(LPDATAOBJECT iface, DWORD dwDirection, IEnumFORMATETC **ppenumFormatEtc)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_DAdvise(LPDATAOBJECT iface, FORMATETC *pformatetc, DWORD advf, IAdviseSink *pAdvSink, DWORD *pdwConnection)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_DUnadvise(LPDATAOBJECT iface, DWORD dwConnection)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI DataObject_EnumDAdvise(LPDATAOBJECT iface, IEnumSTATDATA **ppenumAdvise)
|
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
WebBrowser *This = impl_from_IDataObject(iface);
|
2010-05-18 15:17:29 +02:00
|
|
|
FIXME("(%p)->()\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const IDataObjectVtbl DataObjectVtbl = {
|
|
|
|
DataObject_QueryInterface,
|
|
|
|
DataObject_AddRef,
|
|
|
|
DataObject_Release,
|
|
|
|
DataObject_GetData,
|
|
|
|
DataObject_GetDataHere,
|
|
|
|
DataObject_QueryGetData,
|
|
|
|
DataObject_GetCanonicalFormatEtc,
|
|
|
|
DataObject_SetData,
|
|
|
|
DataObject_EnumFormatEtc,
|
|
|
|
DataObject_DAdvise,
|
|
|
|
DataObject_DUnadvise,
|
|
|
|
DataObject_EnumDAdvise
|
|
|
|
};
|
|
|
|
|
2010-11-13 17:47:44 +01:00
|
|
|
void WebBrowser_ViewObject_Init(WebBrowser *This)
|
2010-05-18 15:17:29 +02:00
|
|
|
{
|
2010-11-13 17:47:44 +01:00
|
|
|
This->IViewObject2_iface.lpVtbl = &ViewObjectVtbl;
|
|
|
|
This->IDataObject_iface.lpVtbl = &DataObjectVtbl;
|
2010-05-18 15:17:29 +02:00
|
|
|
}
|