mshtml: Use ifaces instead of vtbl pointers in HTMLFrameBase.

This commit is contained in:
Michael Stefaniuc 2011-01-03 00:59:45 +01:00 committed by Alexandre Julliard
parent 2a809403d9
commit 6b793e94ad
5 changed files with 57 additions and 55 deletions

View File

@ -220,7 +220,7 @@ static HRESULT HTMLFrameElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLFrameElement *This = impl_from_HTMLDOMNode(iface);
return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p);
return IHTMLFrameBase2_get_readyState(&This->framebase.IHTMLFrameBase2_iface, p);
}
static HRESULT HTMLFrameElement_get_dispid(HTMLDOMNode *iface, BSTR name,

View File

@ -61,32 +61,35 @@ HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
return S_OK;
}
#define HTMLFRAMEBASE_THIS(iface) DEFINE_THIS(HTMLFrameBase, IHTMLFrameBase, iface)
static inline HTMLFrameBase *impl_from_IHTMLFrameBase(IHTMLFrameBase *iface)
{
return CONTAINING_RECORD(iface, HTMLFrameBase, IHTMLFrameBase_iface);
}
static HRESULT WINAPI HTMLFrameBase_QueryInterface(IHTMLFrameBase *iface, REFIID riid, void **ppv)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLFrameBase_AddRef(IHTMLFrameBase *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLFrameBase_Release(IHTMLFrameBase *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase *iface, UINT *pctinfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IDispatchEx_GetTypeInfoCount(&This->element.node.dispex.IDispatchEx_iface, pctinfo);
}
@ -94,7 +97,7 @@ static HRESULT WINAPI HTMLFrameBase_GetTypeInfoCount(IHTMLFrameBase *iface, UINT
static HRESULT WINAPI HTMLFrameBase_GetTypeInfo(IHTMLFrameBase *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IDispatchEx_GetTypeInfo(&This->element.node.dispex.IDispatchEx_iface, iTInfo, lcid,
ppTInfo);
@ -103,7 +106,7 @@ static HRESULT WINAPI HTMLFrameBase_GetTypeInfo(IHTMLFrameBase *iface, UINT iTIn
static HRESULT WINAPI HTMLFrameBase_GetIDsOfNames(IHTMLFrameBase *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IDispatchEx_GetIDsOfNames(&This->element.node.dispex.IDispatchEx_iface, riid, rgszNames,
cNames, lcid, rgDispId);
@ -113,7 +116,7 @@ static HRESULT WINAPI HTMLFrameBase_Invoke(IHTMLFrameBase *iface, DISPID dispIdM
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
return IDispatchEx_Invoke(&This->element.node.dispex.IDispatchEx_iface, dispIdMember, riid,
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
@ -121,7 +124,7 @@ static HRESULT WINAPI HTMLFrameBase_Invoke(IHTMLFrameBase *iface, DISPID dispIdM
static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
@ -135,21 +138,21 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_name(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
nsAString nsstr;
const PRUnichar *strdata;
nsresult nsres;
@ -190,91 +193,91 @@ static HRESULT WINAPI HTMLFrameBase_get_name(IHTMLFrameBase *iface, BSTR *p)
static HRESULT WINAPI HTMLFrameBase_put_border(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_border(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_frameBorder(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_frameBorder(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_frameSpacing(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_frameSpacing(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_marginWidth(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_marginWidth(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_marginHeight(IHTMLFrameBase *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_marginHeight(IHTMLFrameBase *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_noResize(IHTMLFrameBase *iface, VARIANT_BOOL v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_get_noResize(IHTMLFrameBase *iface, VARIANT_BOOL *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
nsAString nsstr;
nsresult nsres;
@ -305,7 +308,7 @@ static HRESULT WINAPI HTMLFrameBase_put_scrolling(IHTMLFrameBase *iface, BSTR v)
static HRESULT WINAPI HTMLFrameBase_get_scrolling(IHTMLFrameBase *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase(iface);
nsAString nsstr;
const PRUnichar *strdata;
nsresult nsres;
@ -369,32 +372,35 @@ static const IHTMLFrameBaseVtbl HTMLFrameBaseVtbl = {
HTMLFrameBase_get_scrolling
};
#define HTMLFRAMEBASE2_THIS(iface) DEFINE_THIS(HTMLFrameBase, IHTMLFrameBase2, iface)
static inline HTMLFrameBase *impl_from_IHTMLFrameBase2(IHTMLFrameBase2 *iface)
{
return CONTAINING_RECORD(iface, HTMLFrameBase, IHTMLFrameBase2_iface);
}
static HRESULT WINAPI HTMLFrameBase2_QueryInterface(IHTMLFrameBase2 *iface, REFIID riid, void **ppv)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
return IHTMLDOMNode_QueryInterface(&This->element.node.IHTMLDOMNode_iface, riid, ppv);
}
static ULONG WINAPI HTMLFrameBase2_AddRef(IHTMLFrameBase2 *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
return IHTMLDOMNode_AddRef(&This->element.node.IHTMLDOMNode_iface);
}
static ULONG WINAPI HTMLFrameBase2_Release(IHTMLFrameBase2 *iface)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
return IHTMLDOMNode_Release(&This->element.node.IHTMLDOMNode_iface);
}
static HRESULT WINAPI HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UINT *pctinfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -402,7 +408,7 @@ static HRESULT WINAPI HTMLFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UI
static HRESULT WINAPI HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2 *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -410,7 +416,7 @@ static HRESULT WINAPI HTMLFrameBase2_GetTypeInfo(IHTMLFrameBase2 *iface, UINT iT
static HRESULT WINAPI HTMLFrameBase2_GetIDsOfNames(IHTMLFrameBase2 *iface, REFIID riid,
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
@ -419,14 +425,14 @@ static HRESULT WINAPI HTMLFrameBase2_Invoke(IHTMLFrameBase2 *iface, DISPID dispI
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)\n", This);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, IHTMLWindow2 **p)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
TRACE("(%p)->(%p)\n", This, p);
@ -442,35 +448,35 @@ static HRESULT WINAPI HTMLFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, I
static HRESULT WINAPI HTMLFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_get_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
TRACE("(%p)->(%p)\n", This, p);
@ -484,20 +490,18 @@ static HRESULT WINAPI HTMLFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR
static HRESULT WINAPI HTMLFrameBase2_put_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL v)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%x)\n", This, v);
return E_NOTIMPL;
}
static HRESULT WINAPI HTMLFrameBase2_get_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL *p)
{
HTMLFrameBase *This = HTMLFRAMEBASE2_THIS(iface);
HTMLFrameBase *This = impl_from_IHTMLFrameBase2(iface);
FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL;
}
#undef HTMLFRAMEBASE2_THIS
static const IHTMLFrameBase2Vtbl HTMLFrameBase2Vtbl = {
HTMLFrameBase2_QueryInterface,
HTMLFrameBase2_AddRef,
@ -520,10 +524,10 @@ HRESULT HTMLFrameBase_QI(HTMLFrameBase *This, REFIID riid, void **ppv)
{
if(IsEqualGUID(&IID_IHTMLFrameBase, riid)) {
TRACE("(%p)->(IID_IHTMLFrameBase %p)\n", This, ppv);
*ppv = HTMLFRAMEBASE(This);
*ppv = &This->IHTMLFrameBase_iface;
}else if(IsEqualGUID(&IID_IHTMLFrameBase2, riid)) {
TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This, ppv);
*ppv = HTMLFRAMEBASE2(This);
*ppv = &This->IHTMLFrameBase2_iface;
}else {
return HTMLElement_QI(&This->element.node, riid, ppv);
}
@ -550,8 +554,8 @@ void HTMLFrameBase_Init(HTMLFrameBase *This, HTMLDocumentNode *doc, nsIDOMHTMLEl
{
nsresult nsres;
This->lpIHTMLFrameBaseVtbl = &HTMLFrameBaseVtbl;
This->lpIHTMLFrameBase2Vtbl = &HTMLFrameBase2Vtbl;
This->IHTMLFrameBase_iface.lpVtbl = &HTMLFrameBaseVtbl;
This->IHTMLFrameBase2_iface.lpVtbl = &HTMLFrameBase2Vtbl;
HTMLElement_Init(&This->element, doc, nselem, dispex_data);

View File

@ -223,7 +223,7 @@ static HRESULT HTMLIFrame_get_readystate(HTMLDOMNode *iface, BSTR *p)
{
HTMLIFrame *This = impl_from_HTMLDOMNode(iface);
return IHTMLFrameBase2_get_readyState(HTMLFRAMEBASE2(&This->framebase), p);
return IHTMLFrameBase2_get_readyState(&This->framebase.IHTMLFrameBase2_iface, p);
}
static HRESULT HTMLIFrame_bind_to_tree(HTMLDOMNode *iface)

View File

@ -1610,7 +1610,7 @@ static HRESULT WINAPI HTMLWindow4_get_frameElement(IHTMLWindow4 *iface, IHTMLFra
TRACE("(%p)->(%p)\n", This, p);
if(This->frame_element) {
*p = HTMLFRAMEBASE(This->frame_element);
*p = &This->frame_element->IHTMLFrameBase_iface;
IHTMLFrameBase_AddRef(*p);
}else
*p = NULL;

View File

@ -575,8 +575,8 @@ typedef struct {
struct HTMLFrameBase {
HTMLElement element;
const IHTMLFrameBaseVtbl *lpIHTMLFrameBaseVtbl;
const IHTMLFrameBase2Vtbl *lpIHTMLFrameBase2Vtbl;
IHTMLFrameBase IHTMLFrameBase_iface;
IHTMLFrameBase2 IHTMLFrameBase2_iface;
HTMLWindow *content_window;
@ -638,8 +638,6 @@ struct HTMLDocumentNode {
#define BINDINFO(x) ((IInternetBindInfo*) &(x)->lpInternetBindInfoVtbl);
#define HTMLTEXTCONT(x) ((IHTMLTextContainer*) &(x)->lpHTMLTextContainerVtbl)
#define HTMLFRAMEBASE(x) ((IHTMLFrameBase*) &(x)->lpIHTMLFrameBaseVtbl)
#define HTMLFRAMEBASE2(x) ((IHTMLFrameBase2*) &(x)->lpIHTMLFrameBase2Vtbl)
#define HTMLOPTFACTORY(x) ((IHTMLOptionElementFactory*) &(x)->lpHTMLOptionElementFactoryVtbl)
#define HTMLIMGFACTORY(x) ((IHTMLImageElementFactory*) &(x)->lpHTMLImageElementFactoryVtbl)