shdocvw: Get rid of DocHost-related *_THIS macros.

This commit is contained in:
Jacek Caban 2010-11-13 17:48:09 +01:00 committed by Alexandre Julliard
parent ca353c9b7e
commit 538a870b89
3 changed files with 113 additions and 123 deletions

View File

@ -42,31 +42,31 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
*ppv = &This->IOleClientSite_iface;
}else if(IsEqualGUID(&IID_IOleWindow, riid)) {
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
*ppv = INPLACESITE(This);
*ppv = &This->IOleInPlaceSite_iface;
}else if(IsEqualGUID(&IID_IOleInPlaceSite, riid)) {
TRACE("(%p)->(IID_IOleInPlaceSite %p)\n", This, ppv);
*ppv = INPLACESITE(This);
*ppv = &This->IOleInPlaceSite_iface;
}else if(IsEqualGUID(&IID_IDocHostUIHandler, riid)) {
TRACE("(%p)->(IID_IDocHostUIHandler %p)\n", This, ppv);
*ppv = DOCHOSTUI(This);
*ppv = &This->IDocHostUIHandler2_iface;
}else if(IsEqualGUID(&IID_IDocHostUIHandler2, riid)) {
TRACE("(%p)->(IID_IDocHostUIHandler2 %p)\n", This, ppv);
*ppv = DOCHOSTUI2(This);
*ppv = &This->IDocHostUIHandler2_iface;
}else if(IsEqualGUID(&IID_IOleDocumentSite, riid)) {
TRACE("(%p)->(IID_IOleDocumentSite %p)\n", This, ppv);
*ppv = DOCSITE(This);
*ppv = &This->IOleDocumentSite_iface;
}else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
*ppv = OLECMD(This);
*ppv = &This->IOleCommandTarget_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = CLDISP(This);
*ppv = &This->IDispatch_iface;
}else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppv);
*ppv = PROPNOTIF(This);
*ppv = &This->IPropertyNotifySink_iface;
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
*ppv = SERVPROV(This);
*ppv = &This->IServiceProvider_iface;
}else {
*ppv = NULL;
WARN("Unsupported interface %s\n", debugstr_guid(riid));
@ -144,29 +144,32 @@ static const IOleClientSiteVtbl OleClientSiteVtbl = {
ClientSite_RequestNewObjectLayout
};
#define INPLACESITE_THIS(iface) DEFINE_THIS(DocHost, OleInPlaceSite, iface)
static inline DocHost *impl_from_IOleInPlaceSite(IOleInPlaceSite *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IOleInPlaceSite_iface));
}
static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppv)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
TRACE("(%p)->(%p)\n", This, phwnd);
@ -176,14 +179,14 @@ static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)->(%x)\n", This, fEnterMode);
return E_NOTIMPL;
}
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
TRACE("(%p)\n", This);
@ -193,7 +196,7 @@ static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
TRACE("(%p)\n", This);
@ -203,7 +206,7 @@ static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -212,7 +215,7 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
lprcClipRect, lpFrameInfo);
@ -235,21 +238,21 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)->({%d %d})\n", This, scrollExtent.cx, scrollExtent.cy);
return E_NOTIMPL;
}
static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)->(%x)\n", This, fUndoable);
return E_NOTIMPL;
}
static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
TRACE("(%p)\n", This);
@ -259,14 +262,14 @@ static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface)
static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -274,7 +277,7 @@ static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSite *iface,
LPCRECT lprcPosRect)
{
DocHost *This = INPLACESITE_THIS(iface);
DocHost *This = impl_from_IOleInPlaceSite(iface);
FIXME("(%p)->(%p)\n", This, lprcPosRect);
return E_NOTIMPL;
}
@ -297,31 +300,34 @@ static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
InPlaceSite_OnPosRectChange
};
#define DOCSITE_THIS(iface) DEFINE_THIS(DocHost, OleDocumentSite, iface)
static inline DocHost *impl_from_IOleDocumentSite(IOleDocumentSite *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IOleDocumentSite_iface));
}
static HRESULT WINAPI OleDocumentSite_QueryInterface(IOleDocumentSite *iface,
REFIID riid, void **ppv)
{
DocHost *This = DOCSITE_THIS(iface);
DocHost *This = impl_from_IOleDocumentSite(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI OleDocumentSite_AddRef(IOleDocumentSite *iface)
{
DocHost *This = DOCSITE_THIS(iface);
DocHost *This = impl_from_IOleDocumentSite(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI OleDocumentSite_Release(IOleDocumentSite *iface)
{
DocHost *This = DOCSITE_THIS(iface);
DocHost *This = impl_from_IOleDocumentSite(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
IOleDocumentView *pViewToActivate)
{
DocHost *This = DOCSITE_THIS(iface);
DocHost *This = impl_from_IOleDocumentSite(iface);
IOleDocument *oledoc;
RECT rect;
HRESULT hres;
@ -332,7 +338,7 @@ static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
if(FAILED(hres))
return hres;
IOleDocument_CreateView(oledoc, INPLACESITE(This), NULL, 0, &This->view);
IOleDocument_CreateView(oledoc, &This->IOleInPlaceSite_iface, NULL, 0, &This->view);
IOleDocument_Release(oledoc);
GetClientRect(This->hwnd, &rect);
@ -350,29 +356,32 @@ static const IOleDocumentSiteVtbl OleDocumentSiteVtbl = {
OleDocumentSite_ActivateMe
};
#define DISP_THIS(iface) DEFINE_THIS(DocHost, Dispatch, iface)
static inline DocHost *impl_from_IDispatch(IDispatch *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IDispatch_iface));
}
static HRESULT WINAPI ClDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI ClDispatch_AddRef(IDispatch *iface)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI ClDispatch_Release(IDispatch *iface)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI ClDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%p)\n", This, pctinfo);
@ -382,7 +391,7 @@ static HRESULT WINAPI ClDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinf
static HRESULT WINAPI ClDispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid,
ITypeInfo **ppTInfo)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo);
@ -392,7 +401,7 @@ static HRESULT WINAPI ClDispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID
static HRESULT WINAPI ClDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames,
UINT cNames, LCID lcid, DISPID *rgDispId)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
lcid, rgDispId);
@ -423,7 +432,7 @@ static HRESULT WINAPI ClDispatch_Invoke(IDispatch *iface, DISPID dispIdMember, R
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
DocHost *This = DISP_THIS(iface);
DocHost *This = impl_from_IDispatch(iface);
TRACE("(%p)->(%s %s %d %04x %p %p %p %p)\n", This, debugstr_dispid(dispIdMember),
debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
@ -461,31 +470,34 @@ static const IDispatchVtbl DispatchVtbl = {
ClDispatch_Invoke
};
#define SERVPROV_THIS(iface) DEFINE_THIS(DocHost, ServiceProvider, iface)
static inline DocHost *impl_from_IServiceProvider(IServiceProvider *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IServiceProvider_iface));
}
static HRESULT WINAPI ClServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid,
void **ppv)
{
DocHost *This = SERVPROV_THIS(iface);
DocHost *This = impl_from_IServiceProvider(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI ClServiceProvider_AddRef(IServiceProvider *iface)
{
DocHost *This = SERVPROV_THIS(iface);
DocHost *This = impl_from_IServiceProvider(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI ClServiceProvider_Release(IServiceProvider *iface)
{
DocHost *This = SERVPROV_THIS(iface);
DocHost *This = impl_from_IServiceProvider(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI ClServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
REFIID riid, void **ppv)
{
DocHost *This = SERVPROV_THIS(iface);
DocHost *This = impl_from_IServiceProvider(iface);
if(IsEqualGUID(&IID_IHlinkFrame, guidService)) {
TRACE("(%p)->(IID_IHlinkFrame %s %p)\n", This, debugstr_guid(riid), ppv);
@ -507,12 +519,10 @@ static const IServiceProviderVtbl ServiceProviderVtbl = {
void DocHost_ClientSite_Init(DocHost *This)
{
This->IOleClientSite_iface.lpVtbl = &OleClientSiteVtbl;
This->lpOleInPlaceSiteVtbl = &OleInPlaceSiteVtbl;
This->lpOleDocumentSiteVtbl = &OleDocumentSiteVtbl;
This->lpDispatchVtbl = &DispatchVtbl;
This->lpServiceProviderVtbl = &ServiceProviderVtbl;
This->view = NULL;
This->IOleInPlaceSite_iface.lpVtbl = &OleInPlaceSiteVtbl;
This->IOleDocumentSite_iface.lpVtbl = &OleDocumentSiteVtbl;
This->IDispatch_iface.lpVtbl = &DispatchVtbl;
This->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
}
void DocHost_ClientSite_Release(DocHost *This)

View File

@ -150,7 +150,7 @@ static void advise_prop_notif(DocHost *This, BOOL set)
return;
if(set)
hres = IConnectionPoint_Advise(cp, (IUnknown*)PROPNOTIF(This), &This->prop_notif_cookie);
hres = IConnectionPoint_Advise(cp, (IUnknown*)&This->IPropertyNotifySink_iface, &This->prop_notif_cookie);
else
hres = IConnectionPoint_Unadvise(cp, This->prop_notif_cookie);
IConnectionPoint_Release(cp);
@ -402,31 +402,34 @@ void release_dochost_client(DocHost *This)
}
}
#define OLECMD_THIS(iface) DEFINE_THIS(DocHost, OleCommandTarget, iface)
static inline DocHost *impl_from_IOleCommandTarget(IOleCommandTarget *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IOleCommandTarget_iface));
}
static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
REFIID riid, void **ppv)
{
DocHost *This = OLECMD_THIS(iface);
DocHost *This = impl_from_IOleCommandTarget(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI ClOleCommandTarget_AddRef(IOleCommandTarget *iface)
{
DocHost *This = OLECMD_THIS(iface);
DocHost *This = impl_from_IOleCommandTarget(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI ClOleCommandTarget_Release(IOleCommandTarget *iface)
{
DocHost *This = OLECMD_THIS(iface);
DocHost *This = impl_from_IOleCommandTarget(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI ClOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
{
DocHost *This = OLECMD_THIS(iface);
DocHost *This = impl_from_IOleCommandTarget(iface);
ULONG i= 0;
FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
pCmdText);
@ -441,7 +444,7 @@ static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface,
const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn,
VARIANT *pvaOut)
{
DocHost *This = OLECMD_THIS(iface);
DocHost *This = impl_from_IOleCommandTarget(iface);
TRACE("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
nCmdexecopt, debugstr_variant(pvaIn), debugstr_variant(pvaOut));
@ -479,7 +482,7 @@ static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface,
return E_NOTIMPL;
}
#undef OLECMD_THIS
#undef impl_from_IOleCommandTarget
static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
ClOleCommandTarget_QueryInterface,
@ -489,31 +492,34 @@ static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
ClOleCommandTarget_Exec
};
#define DOCHOSTUI_THIS(iface) DEFINE_THIS(DocHost, DocHostUIHandler, iface)
static inline DocHost *impl_from_IDocHostUIHandler2(IDocHostUIHandler2 *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IDocHostUIHandler2_iface));
}
static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface,
REFIID riid, void **ppv)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface,
DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
HRESULT hres;
TRACE("(%p)->(%d %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
@ -532,7 +538,7 @@ static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface
static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface,
DOCHOSTUIINFO *pInfo)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
HRESULT hres;
TRACE("(%p)->(%p)\n", This, pInfo);
@ -553,7 +559,7 @@ static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD d
IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%d %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
pFrame, pDoc);
return E_NOTIMPL;
@ -561,14 +567,14 @@ static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD d
static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
TRACE("(%p)\n", This);
@ -581,7 +587,7 @@ static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface,
BOOL fEnable)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%x)\n", This, fEnable);
return E_NOTIMPL;
}
@ -589,7 +595,7 @@ static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface,
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface,
BOOL fActivate)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%x)\n", This, fActivate);
return E_NOTIMPL;
}
@ -597,7 +603,7 @@ static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *i
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface,
BOOL fActivate)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%x)\n", This, fActivate);
return E_NOTIMPL;
}
@ -605,7 +611,7 @@ static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface,
LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%p %p %X)\n", This, prcBorder, pUIWindow, fRameWindow);
return E_NOTIMPL;
}
@ -613,7 +619,7 @@ static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface,
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface,
LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%p %p %d)\n", This, lpMsg, pguidCmdGroup, nCmdID);
return E_NOTIMPL;
}
@ -621,7 +627,7 @@ static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface,
LPOLESTR *pchKey, DWORD dw)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
TRACE("(%p)->(%p %d)\n", This, pchKey, dw);
@ -634,7 +640,7 @@ static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *ifac
static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -642,7 +648,7 @@ static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface,
IDispatch **ppDispatch)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
TRACE("(%p)->(%p)\n", This, ppDispatch);
@ -656,7 +662,7 @@ static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface,
static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface,
DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
TRACE("(%p)->(%d %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
@ -670,7 +676,7 @@ static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface,
static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface,
IDataObject *pDO, IDataObject **ppDORet)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
FIXME("(%p)->(%p %p)\n", This, pDO, ppDORet);
return E_NOTIMPL;
}
@ -678,7 +684,7 @@ static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *ifac
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface,
LPOLESTR *pchKey, DWORD dw)
{
DocHost *This = DOCHOSTUI_THIS(iface);
DocHost *This = impl_from_IDocHostUIHandler2(iface);
IDocHostUIHandler2 *handler;
HRESULT hres;
@ -698,8 +704,6 @@ static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *if
return S_OK;
}
#undef DOCHOSTUI_THIS
static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
DocHostUIHandler_QueryInterface,
DocHostUIHandler_AddRef,
@ -722,30 +726,33 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
DocHostUIHandler_GetOverrideKeyPath
};
#define PROPNOTIF_THIS(iface) DEFINE_THIS(DocHost, IPropertyNotifySink, iface)
static inline DocHost *impl_from_IPropertyNotifySink(IPropertyNotifySink *iface)
{
return (DocHost*)((char*)iface - FIELD_OFFSET(DocHost, IPropertyNotifySink_iface));
}
static HRESULT WINAPI PropertyNotifySink_QueryInterface(IPropertyNotifySink *iface,
REFIID riid, void **ppv)
{
DocHost *This = PROPNOTIF_THIS(iface);
DocHost *This = impl_from_IPropertyNotifySink(iface);
return IOleClientSite_QueryInterface(&This->IOleClientSite_iface, riid, ppv);
}
static ULONG WINAPI PropertyNotifySink_AddRef(IPropertyNotifySink *iface)
{
DocHost *This = PROPNOTIF_THIS(iface);
DocHost *This = impl_from_IPropertyNotifySink(iface);
return IOleClientSite_AddRef(&This->IOleClientSite_iface);
}
static ULONG WINAPI PropertyNotifySink_Release(IPropertyNotifySink *iface)
{
DocHost *This = PROPNOTIF_THIS(iface);
DocHost *This = impl_from_IPropertyNotifySink(iface);
return IOleClientSite_Release(&This->IOleClientSite_iface);
}
static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, DISPID dispID)
{
DocHost *This = PROPNOTIF_THIS(iface);
DocHost *This = impl_from_IPropertyNotifySink(iface);
TRACE("(%p)->(%d)\n", This, dispID);
@ -774,13 +781,11 @@ static HRESULT WINAPI PropertyNotifySink_OnChanged(IPropertyNotifySink *iface, D
static HRESULT WINAPI PropertyNotifySink_OnRequestEdit(IPropertyNotifySink *iface, DISPID dispID)
{
DocHost *This = PROPNOTIF_THIS(iface);
DocHost *This = impl_from_IPropertyNotifySink(iface);
FIXME("(%p)->(%d)\n", This, dispID);
return E_NOTIMPL;
}
#undef PROPNOTIF_THIS
static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
PropertyNotifySink_QueryInterface,
PropertyNotifySink_AddRef,
@ -791,29 +796,14 @@ static const IPropertyNotifySinkVtbl PropertyNotifySinkVtbl = {
void DocHost_Init(DocHost *This, IDispatch *disp, const IDocHostContainerVtbl* container)
{
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
This->lpIPropertyNotifySinkVtbl = &PropertyNotifySinkVtbl;
This->IDocHostUIHandler2_iface.lpVtbl = &DocHostUIHandler2Vtbl;
This->IOleCommandTarget_iface.lpVtbl = &OleCommandTargetVtbl;
This->IPropertyNotifySink_iface.lpVtbl = &PropertyNotifySinkVtbl;
This->disp = disp;
This->container_vtbl = container;
This->client_disp = NULL;
This->document = NULL;
This->hostui = NULL;
This->frame = NULL;
This->hwnd = NULL;
This->frame_hwnd = NULL;
This->url = NULL;
This->silent = VARIANT_FALSE;
This->offline = VARIANT_FALSE;
This->ready_state = READYSTATE_UNINITIALIZED;
This->is_prop_notif = FALSE;
DocHost_ClientSite_Init(This);
DocHost_Frame_Init(This);

View File

@ -94,13 +94,13 @@ typedef struct _IDocHostContainerVtbl
struct DocHost {
IOleClientSite IOleClientSite_iface;
const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl;
const IOleDocumentSiteVtbl *lpOleDocumentSiteVtbl;
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
const IDispatchVtbl *lpDispatchVtbl;
const IPropertyNotifySinkVtbl *lpIPropertyNotifySinkVtbl;
const IServiceProviderVtbl *lpServiceProviderVtbl;
IOleInPlaceSite IOleInPlaceSite_iface;
IDocHostUIHandler2 IDocHostUIHandler2_iface;
IOleDocumentSite IOleDocumentSite_iface;
IOleCommandTarget IOleCommandTarget_iface;
IDispatch IDispatch_iface;
IPropertyNotifySink IPropertyNotifySink_iface;
IServiceProvider IServiceProvider_iface;
/* Interfaces of InPlaceFrame object */
const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl;
@ -195,16 +195,6 @@ struct InternetExplorer {
};
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
#define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
#define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
#define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
#define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
#define PROPNOTIF(x) ((IPropertyNotifySink*) &(x)->lpIPropertyNotifySinkVtbl)
#define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
#define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
#define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpIHlinkFrameVtbl)