Commit 7149f04b authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Get rid of more *_THIS macros.

parent 8767356d
......@@ -135,18 +135,18 @@ struct DocHost {
};
struct WebBrowser {
IWebBrowser2 IWebBrowser2_iface;
const IOleObjectVtbl *lpOleObjectVtbl;
const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
const IOleControlVtbl *lpOleControlVtbl;
IWebBrowser2 IWebBrowser2_iface;
IOleObject IOleObject_iface;
IOleInPlaceObject IOleInPlaceObject_iface;
IOleControl IOleControl_iface;
const IPersistStorageVtbl *lpPersistStorageVtbl;
const IPersistMemoryVtbl *lpPersistMemoryVtbl;
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
const IViewObject2Vtbl *lpViewObjectVtbl;
const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
const IServiceProviderVtbl *lpServiceProviderVtbl;
IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
IOleCommandTarget IOleCommandTarget_iface;
IServiceProvider IServiceProvider_iface;
const IDataObjectVtbl *lpDataObjectVtbl;
HlinkFrame hlink_frame;
......@@ -194,9 +194,6 @@ struct InternetExplorer {
DocHost doc_host;
};
#define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
#define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
#define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
#define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
......@@ -204,7 +201,6 @@ struct InternetExplorer {
#define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
#define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
#define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
#define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
#define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
#define DATAOBJECT(x) ((IDataObject*) &(x)->lpDataObjectVtbl)
......
......@@ -56,16 +56,16 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
*ppv = &This->IWebBrowser2_iface;
}else if(IsEqualGUID(&IID_IOleObject, riid)) {
TRACE("(%p)->(IID_IOleObject %p)\n", This, ppv);
*ppv = OLEOBJ(This);
*ppv = &This->IOleObject_iface;
}else if(IsEqualGUID(&IID_IOleWindow, riid)) {
TRACE("(%p)->(IID_IOleWindow %p)\n", This, ppv);
*ppv = INPLACEOBJ(This);
*ppv = &This->IOleInPlaceObject_iface;
}else if(IsEqualGUID (&IID_IOleInPlaceObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceObject %p)\n", This, ppv);
*ppv = INPLACEOBJ(This);
*ppv = &This->IOleInPlaceObject_iface;
}else if(IsEqualGUID(&IID_IOleControl, riid)) {
TRACE("(%p)->(IID_IOleControl %p)\n", This, ppv);
*ppv = CONTROL(This);
*ppv = &This->IOleControl_iface;
}else if(IsEqualGUID(&IID_IPersist, riid)) {
TRACE("(%p)->(IID_IPersist %p)\n", This, ppv);
*ppv = PERSTORAGE(This);
......@@ -95,12 +95,12 @@ static HRESULT WINAPI WebBrowser_QueryInterface(IWebBrowser2 *iface, REFIID riid
*ppv = VIEWOBJ2(This);
}else if(IsEqualGUID(&IID_IOleInPlaceActiveObject, riid)) {
TRACE("(%p)->(IID_IOleInPlaceActiveObject %p)\n", This, ppv);
*ppv = ACTIVEOBJ(This);
*ppv = &This->IOleInPlaceActiveObject_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_IServiceProvider, riid)) {
*ppv = SERVPROV(This);
*ppv = &This->IServiceProvider_iface;
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
}else if(IsEqualGUID(&IID_IDataObject, riid)) {
*ppv = DATAOBJECT(This);
......@@ -1060,33 +1060,34 @@ static const IWebBrowser2Vtbl WebBrowser2Vtbl =
WebBrowser_put_Resizable
};
#define SERVPROV_THIS(iface) DEFINE_THIS(WebBrowser, OleObject, iface)
/*
* IServiceProvider interface.
*/
static HRESULT WINAPI WebBrowser_IServiceProvider_QueryInterface(IServiceProvider *iface,
static inline WebBrowser *impl_from_IServiceProvider(IServiceProvider *iface)
{
return (WebBrowser*)((char*)iface - FIELD_OFFSET(WebBrowser, IServiceProvider_iface));
}
static HRESULT WINAPI WBServiceProvider_QueryInterface(IServiceProvider *iface,
REFIID riid, LPVOID *ppv)
{
WebBrowser *This = SERVPROV_THIS(iface);
WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_QueryInterface(&This->IWebBrowser2_iface, riid, ppv);
}
static ULONG WINAPI WebBrowser_IServiceProvider_AddRef(IServiceProvider *iface)
static ULONG WINAPI WBServiceProvider_AddRef(IServiceProvider *iface)
{
WebBrowser *This = SERVPROV_THIS(iface);
WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_AddRef(&This->IWebBrowser2_iface);
}
static ULONG WINAPI WebBrowser_IServiceProvider_Release(IServiceProvider *iface)
static ULONG WINAPI WBServiceProvider_Release(IServiceProvider *iface)
{
WebBrowser *This = SERVPROV_THIS(iface);
WebBrowser *This = impl_from_IServiceProvider(iface);
return IWebBrowser_Release(&This->IWebBrowser2_iface);
}
static HRESULT STDMETHODCALLTYPE WebBrowser_IServiceProvider_QueryService(IServiceProvider *iface,
static HRESULT STDMETHODCALLTYPE WBServiceProvider_QueryService(IServiceProvider *iface,
REFGUID guidService, REFIID riid, void **ppv)
{
WebBrowser *This = SERVPROV_THIS(iface);
WebBrowser *This = impl_from_IServiceProvider(iface);
static const IID IID_IBrowserService2 =
{0x68BD21CC,0x438B,0x11d2,{0xA5,0x60,0x00,0xA0,0xC,0x2D,0xBF,0xE8}};
......@@ -1103,14 +1104,14 @@ static HRESULT STDMETHODCALLTYPE WebBrowser_IServiceProvider_QueryService(IServi
return E_NOINTERFACE;
}
#undef SERVPROV_THIS
#undef impl_from_IServiceProvider
static const IServiceProviderVtbl ServiceProviderVtbl =
{
WebBrowser_IServiceProvider_QueryInterface,
WebBrowser_IServiceProvider_AddRef,
WebBrowser_IServiceProvider_Release,
WebBrowser_IServiceProvider_QueryService
WBServiceProvider_QueryInterface,
WBServiceProvider_AddRef,
WBServiceProvider_Release,
WBServiceProvider_QueryService
};
#define DOCHOST_THIS(iface) DEFINE_THIS2(WebBrowser,doc_host,iface)
......@@ -1179,7 +1180,7 @@ static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, voi
ret = heap_alloc_zero(sizeof(WebBrowser));
ret->IWebBrowser2_iface.lpVtbl = &WebBrowser2Vtbl;
ret->lpServiceProviderVtbl = &ServiceProviderVtbl;
ret->IServiceProvider_iface.lpVtbl = &ServiceProviderVtbl;
ret->ref = 1;
ret->version = version;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment