2005-11-15 12:03:25 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2005 Jacek Caban for CodeWeavers
|
|
|
|
*
|
|
|
|
* 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
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "wine/debug.h"
|
|
|
|
#include "shdocvw.h"
|
|
|
|
|
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
|
|
|
|
2006-04-17 22:24:59 +00:00
|
|
|
#define CLIENTSITE_THIS(iface) DEFINE_THIS(DocHost, OleClientSite, iface)
|
2005-11-15 12:03:25 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
|
|
|
|
*ppv = NULL;
|
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
|
|
|
*ppv = CLIENTSITE(This);
|
|
|
|
}else if(IsEqualGUID(&IID_IOleClientSite, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleClientSite %p)\n", This, ppv);
|
|
|
|
*ppv = CLIENTSITE(This);
|
2005-11-16 11:21:00 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleWindow, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
|
2006-04-17 22:26:47 +00:00
|
|
|
*ppv = INPLACESITE(This);
|
2005-11-16 11:21:00 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppv);
|
2006-04-17 22:26:47 +00:00
|
|
|
*ppv = INPLACESITE(This);
|
2005-11-17 11:03:53 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IDocHostUIHandler, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppv);
|
2006-04-17 22:28:37 +00:00
|
|
|
*ppv = DOCHOSTUI(This);
|
2005-11-17 11:03:53 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDocHostUIHandler2 %p)\n", This, ppv);
|
2006-04-17 22:28:37 +00:00
|
|
|
*ppv = DOCHOSTUI2(This);
|
2005-12-01 10:11:14 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleDocumentSite, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleDocumentSite %p)\n", This, ppv);
|
2006-04-17 22:31:22 +00:00
|
|
|
*ppv = DOCSITE(This);
|
2006-04-17 22:24:59 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
|
2006-04-17 22:32:43 +00:00
|
|
|
*ppv = CLOLECMD(This);
|
2006-01-26 12:30:04 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
2006-04-17 22:34:21 +00:00
|
|
|
*ppv = CLDISP(This);
|
2006-02-15 10:53:31 +00:00
|
|
|
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
|
|
|
|
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
|
2006-04-17 22:35:16 +00:00
|
|
|
*ppv = SERVPROV(This);
|
2005-11-15 12:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if(*ppv) {
|
2006-04-17 22:24:59 +00:00
|
|
|
IOleClientSite_AddRef(CLIENTSITE(This));
|
2005-11-15 12:03:25 +00:00
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("Unsupported intrface %s\n", debugstr_guid(riid));
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClientSite_AddRef(IOleClientSite *iface)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
|
|
|
return IDispatch_AddRef(This->disp);
|
2005-11-15 12:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClientSite_Release(IOleClientSite *iface)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
|
|
|
return IDispatch_Release(This->disp);
|
2005-11-15 12:03:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAssign,
|
|
|
|
DWORD dwWhichMoniker, IMoniker **ppmk)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)->(%ld %ld %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, ppContainer);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_ShowObject(IOleClientSite *iface)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)->(%x)\n", This, fShow);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClientSite_RequestNewObjectLayout(IOleClientSite *iface)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
DocHost *This = CLIENTSITE_THIS(iface);
|
2005-11-15 12:03:25 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef CLIENTSITE_THIS
|
|
|
|
|
|
|
|
static const IOleClientSiteVtbl OleClientSiteVtbl = {
|
|
|
|
ClientSite_QueryInterface,
|
|
|
|
ClientSite_AddRef,
|
|
|
|
ClientSite_Release,
|
|
|
|
ClientSite_SaveObject,
|
|
|
|
ClientSite_GetMoniker,
|
|
|
|
ClientSite_GetContainer,
|
|
|
|
ClientSite_ShowObject,
|
|
|
|
ClientSite_OnShowWindow,
|
|
|
|
ClientSite_RequestNewObjectLayout
|
|
|
|
};
|
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
#define INPLACESITE_THIS(iface) DEFINE_THIS(DocHost, OleInPlaceSite, iface)
|
2005-11-16 11:21:00 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
|
|
|
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
|
|
|
return IOleClientSite_AddRef(CLIENTSITE(This));
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
|
|
|
return IOleClientSite_Release(CLIENTSITE(This));
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-22 11:59:57 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, phwnd);
|
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
*phwnd = This->hwnd;
|
2005-11-22 11:59:57 +00:00
|
|
|
return S_OK;
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)->(%x)\n", This, fEnterMode);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-12-01 10:11:14 +00:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Nothing to do here */
|
|
|
|
return S_OK;
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-12-01 10:11:14 +00:00
|
|
|
|
|
|
|
TRACE("(%p)\n", This);
|
|
|
|
|
|
|
|
/* Nothing to do here */
|
|
|
|
return S_OK;
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
|
|
|
|
IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
|
|
|
|
LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-28 10:01:17 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
|
2005-11-16 11:21:00 +00:00
|
|
|
lprcClipRect, lpFrameInfo);
|
2005-11-28 10:01:17 +00:00
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
IOleInPlaceFrame_AddRef(INPLACEFRAME(This->wb));
|
|
|
|
*ppFrame = INPLACEFRAME(This->wb);
|
2005-11-28 10:01:17 +00:00
|
|
|
*ppDoc = NULL;
|
2005-12-01 10:11:14 +00:00
|
|
|
|
2006-04-17 22:26:47 +00:00
|
|
|
GetClientRect(This->hwnd, lprcPosRect);
|
2005-11-28 10:01:17 +00:00
|
|
|
memcpy(lprcClipRect, lprcPosRect, sizeof(RECT));
|
|
|
|
|
|
|
|
lpFrameInfo->cb = sizeof(*lpFrameInfo);
|
|
|
|
lpFrameInfo->fMDIApp = FALSE;
|
2006-04-17 22:26:47 +00:00
|
|
|
lpFrameInfo->hwndFrame = This->frame_hwnd;
|
2005-11-28 10:01:17 +00:00
|
|
|
lpFrameInfo->haccel = NULL;
|
|
|
|
lpFrameInfo->cAccelEntries = 0; /* FIXME: should be 5 */
|
|
|
|
|
|
|
|
return S_OK;
|
2005-11-16 11:21:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)->({%ld %ld})\n", This, scrollExtent.cx, scrollExtent.cy);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)->(%x)\n", This, fUndoable);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)\n", This);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSite *iface,
|
|
|
|
LPCRECT lprcPosRect)
|
|
|
|
{
|
2006-04-17 22:26:47 +00:00
|
|
|
DocHost *This = INPLACESITE_THIS(iface);
|
2005-11-16 11:21:00 +00:00
|
|
|
FIXME("(%p)->(%p)\n", This, lprcPosRect);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef INPLACESITE_THIS
|
|
|
|
|
|
|
|
static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
|
|
|
|
InPlaceSite_QueryInterface,
|
|
|
|
InPlaceSite_AddRef,
|
|
|
|
InPlaceSite_Release,
|
|
|
|
InPlaceSite_GetWindow,
|
|
|
|
InPlaceSite_ContextSensitiveHelp,
|
|
|
|
InPlaceSite_CanInPlaceActivate,
|
|
|
|
InPlaceSite_OnInPlaceActivate,
|
|
|
|
InPlaceSite_OnUIActivate,
|
|
|
|
InPlaceSite_GetWindowContext,
|
|
|
|
InPlaceSite_Scroll,
|
|
|
|
InPlaceSite_OnUIDeactivate,
|
|
|
|
InPlaceSite_OnInPlaceDeactivate,
|
|
|
|
InPlaceSite_DiscardUndoState,
|
|
|
|
InPlaceSite_DeactivateAndUndo,
|
|
|
|
InPlaceSite_OnPosRectChange
|
|
|
|
};
|
|
|
|
|
2006-04-17 22:31:22 +00:00
|
|
|
#define DOCSITE_THIS(iface) DEFINE_THIS(DocHost, OleDocumentSite, iface)
|
2005-11-28 10:24:49 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI OleDocumentSite_QueryInterface(IOleDocumentSite *iface,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2006-04-17 22:31:22 +00:00
|
|
|
DocHost *This = DOCSITE_THIS(iface);
|
|
|
|
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
2005-11-28 10:24:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleDocumentSite_AddRef(IOleDocumentSite *iface)
|
|
|
|
{
|
2006-04-17 22:31:22 +00:00
|
|
|
DocHost *This = DOCSITE_THIS(iface);
|
|
|
|
return IOleClientSite_AddRef(CLIENTSITE(This));
|
2005-11-28 10:24:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI OleDocumentSite_Release(IOleDocumentSite *iface)
|
|
|
|
{
|
2006-04-17 22:31:22 +00:00
|
|
|
DocHost *This = DOCSITE_THIS(iface);
|
|
|
|
return IOleClientSite_Release(CLIENTSITE(This));
|
2005-11-28 10:24:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
|
|
|
|
IOleDocumentView *pViewToActivate)
|
|
|
|
{
|
2006-04-17 22:31:22 +00:00
|
|
|
DocHost *This = DOCSITE_THIS(iface);
|
2005-11-28 10:24:49 +00:00
|
|
|
IOleDocument *oledoc;
|
|
|
|
RECT rect;
|
|
|
|
HRESULT hres;
|
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pViewToActivate);
|
|
|
|
|
|
|
|
hres = IUnknown_QueryInterface(This->document, &IID_IOleDocument, (void**)&oledoc);
|
|
|
|
if(FAILED(hres))
|
|
|
|
return hres;
|
|
|
|
|
2006-04-17 22:31:22 +00:00
|
|
|
IOleDocument_CreateView(oledoc, INPLACESITE(This), NULL, 0, &This->view);
|
2005-11-28 10:24:49 +00:00
|
|
|
IOleDocument_Release(oledoc);
|
|
|
|
|
2006-04-17 22:31:22 +00:00
|
|
|
GetClientRect(This->hwnd, &rect);
|
2005-11-28 10:24:49 +00:00
|
|
|
IOleDocumentView_SetRect(This->view, &rect);
|
|
|
|
|
|
|
|
hres = IOleDocumentView_Show(This->view, TRUE);
|
|
|
|
|
|
|
|
return hres;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef DOCSITE_THIS
|
|
|
|
|
|
|
|
static const IOleDocumentSiteVtbl OleDocumentSiteVtbl = {
|
|
|
|
OleDocumentSite_QueryInterface,
|
|
|
|
OleDocumentSite_AddRef,
|
|
|
|
OleDocumentSite_Release,
|
|
|
|
OleDocumentSite_ActivateMe
|
|
|
|
};
|
|
|
|
|
2006-04-17 22:34:21 +00:00
|
|
|
#define DISP_THIS(iface) DEFINE_THIS(DocHost, Dispatch, iface)
|
2006-01-26 12:30:04 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI ClDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
|
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
|
|
|
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
2006-01-26 12:30:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClDispatch_AddRef(IDispatch *iface)
|
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
|
|
|
return IOleClientSite_AddRef(CLIENTSITE(This));
|
2006-01-26 12:30:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClDispatch_Release(IDispatch *iface)
|
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
|
|
|
return IOleClientSite_Release(CLIENTSITE(This));
|
2006-01-26 12:30:04 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
|
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
2006-02-20 10:13:51 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%p)\n", This, pctinfo);
|
|
|
|
|
2006-01-26 12:30:04 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClDispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid,
|
2006-02-15 10:53:31 +00:00
|
|
|
ITypeInfo **ppTInfo)
|
2006-01-26 12:30:04 +00:00
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
2006-02-20 10:13:51 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%u %ld %p)\n", This, iTInfo, lcid, ppTInfo);
|
|
|
|
|
2006-01-26 12:30:04 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames,
|
2006-02-15 10:53:31 +00:00
|
|
|
UINT cNames, LCID lcid, DISPID *rgDispId)
|
2006-01-26 12:30:04 +00:00
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
2006-02-20 10:13:51 +00:00
|
|
|
|
|
|
|
TRACE("(%p)->(%s %p %u %ld %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
2006-01-26 12:30:04 +00:00
|
|
|
lcid, rgDispId);
|
2006-02-20 10:13:51 +00:00
|
|
|
|
2006-01-26 12:30:04 +00:00
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClDispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid,
|
2006-02-15 10:53:31 +00:00
|
|
|
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
|
|
|
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
2006-01-26 12:30:04 +00:00
|
|
|
{
|
2006-04-17 22:34:21 +00:00
|
|
|
DocHost *This = DISP_THIS(iface);
|
2006-01-26 12:30:04 +00:00
|
|
|
FIXME("(%p)->(%ld %s %ld %04x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
|
|
|
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef DISP_THIS
|
|
|
|
|
|
|
|
static const IDispatchVtbl DispatchVtbl = {
|
|
|
|
ClDispatch_QueryInterface,
|
|
|
|
ClDispatch_AddRef,
|
|
|
|
ClDispatch_Release,
|
|
|
|
ClDispatch_GetTypeInfoCount,
|
|
|
|
ClDispatch_GetTypeInfo,
|
|
|
|
ClDispatch_GetIDsOfNames,
|
|
|
|
ClDispatch_Invoke
|
|
|
|
};
|
|
|
|
|
2006-04-17 22:35:16 +00:00
|
|
|
#define SERVPROV_THIS(iface) DEFINE_THIS(DocHost, ServiceProvider, iface)
|
2006-02-15 10:53:31 +00:00
|
|
|
|
|
|
|
static HRESULT WINAPI ClServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid,
|
|
|
|
void **ppv)
|
|
|
|
{
|
2006-04-17 22:35:16 +00:00
|
|
|
DocHost *This = SERVPROV_THIS(iface);
|
|
|
|
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
2006-02-15 10:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClServiceProvider_AddRef(IServiceProvider *iface)
|
|
|
|
{
|
2006-04-17 22:35:16 +00:00
|
|
|
DocHost *This = SERVPROV_THIS(iface);
|
|
|
|
return IOleClientSite_AddRef(CLIENTSITE(This));
|
2006-02-15 10:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static ULONG WINAPI ClServiceProvider_Release(IServiceProvider *iface)
|
|
|
|
{
|
2006-04-17 22:35:16 +00:00
|
|
|
DocHost *This = SERVPROV_THIS(iface);
|
|
|
|
return IOleClientSite_Release(CLIENTSITE(This));
|
2006-02-15 10:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT WINAPI ClServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
|
|
|
|
REFIID riid, void **ppv)
|
|
|
|
{
|
2006-04-17 22:35:16 +00:00
|
|
|
DocHost *This = SERVPROV_THIS(iface);
|
2006-02-15 10:53:31 +00:00
|
|
|
|
|
|
|
if(IsEqualGUID(&IID_IHlinkFrame, guidService)) {
|
|
|
|
TRACE("(%p)->(IID_IHlinkFrame %s %p)\n", This, debugstr_guid(riid), ppv);
|
2006-04-17 22:35:16 +00:00
|
|
|
return IDispatch_QueryInterface(This->disp, riid, ppv);
|
2006-02-15 10:53:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
|
|
|
|
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef SERVPROV_THIS
|
|
|
|
|
|
|
|
static const IServiceProviderVtbl ServiceProviderVtbl = {
|
|
|
|
ClServiceProvider_QueryInterface,
|
|
|
|
ClServiceProvider_AddRef,
|
|
|
|
ClServiceProvider_Release,
|
|
|
|
ClServiceProvider_QueryService
|
|
|
|
};
|
|
|
|
|
2005-11-15 12:03:25 +00:00
|
|
|
void WebBrowser_ClientSite_Init(WebBrowser *This)
|
|
|
|
{
|
2006-04-17 22:24:59 +00:00
|
|
|
This->doc_host.lpOleClientSiteVtbl = &OleClientSiteVtbl;
|
2006-04-17 22:26:47 +00:00
|
|
|
This->doc_host.lpOleInPlaceSiteVtbl = &OleInPlaceSiteVtbl;
|
2006-04-17 22:31:22 +00:00
|
|
|
This->doc_host.lpOleDocumentSiteVtbl = &OleDocumentSiteVtbl;
|
2006-04-17 22:34:21 +00:00
|
|
|
This->doc_host.lpDispatchVtbl = &DispatchVtbl;
|
2006-04-17 22:35:16 +00:00
|
|
|
This->doc_host.lpServiceProviderVtbl = &ServiceProviderVtbl;
|
2005-11-28 10:24:49 +00:00
|
|
|
|
2006-04-17 22:31:22 +00:00
|
|
|
This->doc_host.view = NULL;
|
2006-04-17 22:24:59 +00:00
|
|
|
|
|
|
|
This->doc_host.wb = This;
|
2005-11-28 10:24:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void WebBrowser_ClientSite_Destroy(WebBrowser *This)
|
|
|
|
{
|
2006-04-17 22:31:22 +00:00
|
|
|
if(This->doc_host.view)
|
|
|
|
IOleDocumentView_Release(This->doc_host.view);
|
2005-11-15 12:03:25 +00:00
|
|
|
}
|