Commit 2c04cfdb authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

mshtml: Use an iface instead of a vtbl pointer in HTMLScriptElement.

parent 0d2f29a0
...@@ -34,47 +34,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml); ...@@ -34,47 +34,48 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
typedef struct { typedef struct {
HTMLElement element; HTMLElement element;
const IHTMLScriptElementVtbl *lpHTMLScriptElementVtbl; IHTMLScriptElement IHTMLScriptElement_iface;
nsIDOMHTMLScriptElement *nsscript; nsIDOMHTMLScriptElement *nsscript;
} HTMLScriptElement; } HTMLScriptElement;
#define HTMLSCRIPT(x) ((IHTMLScriptElement*) &(x)->lpHTMLScriptElementVtbl) static inline HTMLScriptElement *impl_from_IHTMLScriptElement(IHTMLScriptElement *iface)
{
#define HTMLSCRIPT_THIS(iface) DEFINE_THIS(HTMLScriptElement, HTMLScriptElement, iface) return CONTAINING_RECORD(iface, HTMLScriptElement, IHTMLScriptElement_iface);
}
static HRESULT WINAPI HTMLScriptElement_QueryInterface(IHTMLScriptElement *iface, static HRESULT WINAPI HTMLScriptElement_QueryInterface(IHTMLScriptElement *iface,
REFIID riid, void **ppv) REFIID riid, void **ppv)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv); return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
} }
static ULONG WINAPI HTMLScriptElement_AddRef(IHTMLScriptElement *iface) static ULONG WINAPI HTMLScriptElement_AddRef(IHTMLScriptElement *iface)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
} }
static ULONG WINAPI HTMLScriptElement_Release(IHTMLScriptElement *iface) static ULONG WINAPI HTMLScriptElement_Release(IHTMLScriptElement *iface)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node)); return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
} }
static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount(IHTMLScriptElement *iface, UINT *pctinfo) static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount(IHTMLScriptElement *iface, UINT *pctinfo)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo); return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
} }
static HRESULT WINAPI HTMLScriptElement_GetTypeInfo(IHTMLScriptElement *iface, UINT iTInfo, static HRESULT WINAPI HTMLScriptElement_GetTypeInfo(IHTMLScriptElement *iface, UINT iTInfo,
LCID lcid, ITypeInfo **ppTInfo) LCID lcid, ITypeInfo **ppTInfo)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo); return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
} }
...@@ -82,7 +83,7 @@ static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames(IHTMLScriptElement *iface, ...@@ -82,7 +83,7 @@ static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames(IHTMLScriptElement *iface,
LPOLESTR *rgszNames, UINT cNames, LPOLESTR *rgszNames, UINT cNames,
LCID lcid, DISPID *rgDispId) LCID lcid, DISPID *rgDispId)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId); return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
} }
...@@ -90,70 +91,70 @@ static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID ...@@ -90,70 +91,70 @@ static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr) VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams, return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
pVarResult, pExcepInfo, puArgErr); pVarResult, pExcepInfo, puArgErr);
} }
static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR v) static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_get_src(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_src(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_htmlFor(IHTMLScriptElement *iface, BSTR v) static HRESULT WINAPI HTMLScriptElement_put_htmlFor(IHTMLScriptElement *iface, BSTR v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_get_htmlFor(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_htmlFor(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_event(IHTMLScriptElement *iface, BSTR v) static HRESULT WINAPI HTMLScriptElement_put_event(IHTMLScriptElement *iface, BSTR v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_get_event(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_event(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR v) static HRESULT WINAPI HTMLScriptElement_put_text(IHTMLScriptElement *iface, BSTR v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%s)\n", This, debugstr_w(v)); FIXME("(%p)->(%s)\n", This, debugstr_w(v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v) static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
HRESULT hr = S_OK; HRESULT hr = S_OK;
nsresult nsres; nsresult nsres;
...@@ -170,7 +171,7 @@ static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VAR ...@@ -170,7 +171,7 @@ static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VAR
static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p) static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
PRBool defer = FALSE; PRBool defer = FALSE;
nsresult nsres; nsresult nsres;
...@@ -192,28 +193,28 @@ static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VAR ...@@ -192,28 +193,28 @@ static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VAR
static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_onerror(IHTMLScriptElement *iface, VARIANT v) static HRESULT WINAPI HTMLScriptElement_put_onerror(IHTMLScriptElement *iface, VARIANT v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(v(%d))\n", This, V_VT(&v)); FIXME("(%p)->(v(%d))\n", This, V_VT(&v));
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_get_onerror(IHTMLScriptElement *iface, VARIANT *p) static HRESULT WINAPI HTMLScriptElement_get_onerror(IHTMLScriptElement *iface, VARIANT *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
FIXME("(%p)->(%p)\n", This, p); FIXME("(%p)->(%p)\n", This, p);
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR v) static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR v)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
nsAString nstype_str; nsAString nstype_str;
nsresult nsres; nsresult nsres;
...@@ -230,7 +231,7 @@ static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR ...@@ -230,7 +231,7 @@ static HRESULT WINAPI HTMLScriptElement_put_type(IHTMLScriptElement *iface, BSTR
static HRESULT WINAPI HTMLScriptElement_get_type(IHTMLScriptElement *iface, BSTR *p) static HRESULT WINAPI HTMLScriptElement_get_type(IHTMLScriptElement *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface); HTMLScriptElement *This = impl_from_IHTMLScriptElement(iface);
const PRUnichar *nstype; const PRUnichar *nstype;
nsAString nstype_str; nsAString nstype_str;
nsresult nsres; nsresult nsres;
...@@ -274,8 +275,6 @@ static const IHTMLScriptElementVtbl HTMLScriptElementVtbl = { ...@@ -274,8 +275,6 @@ static const IHTMLScriptElementVtbl HTMLScriptElementVtbl = {
HTMLScriptElement_get_type HTMLScriptElement_get_type
}; };
#undef HTMLSCRIPT_THIS
#define HTMLSCRIPT_NODE_THIS(iface) DEFINE_THIS2(HTMLScriptElement, element.node, iface) #define HTMLSCRIPT_NODE_THIS(iface) DEFINE_THIS2(HTMLScriptElement, element.node, iface)
static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
...@@ -286,13 +285,13 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv) ...@@ -286,13 +285,13 @@ static HRESULT HTMLScriptElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
if(IsEqualGUID(&IID_IUnknown, riid)) { if(IsEqualGUID(&IID_IUnknown, riid)) {
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
*ppv = HTMLSCRIPT(This); *ppv = &This->IHTMLScriptElement_iface;
}else if(IsEqualGUID(&IID_IDispatch, riid)) { }else if(IsEqualGUID(&IID_IDispatch, riid)) {
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv); TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
*ppv = HTMLSCRIPT(This); *ppv = &This->IHTMLScriptElement_iface;
}else if(IsEqualGUID(&IID_IHTMLScriptElement, riid)) { }else if(IsEqualGUID(&IID_IHTMLScriptElement, riid)) {
TRACE("(%p)->(IID_IHTMLScriptElement %p)\n", This, ppv); TRACE("(%p)->(IID_IHTMLScriptElement %p)\n", This, ppv);
*ppv = HTMLSCRIPT(This); *ppv = &This->IHTMLScriptElement_iface;
} }
if(*ppv) { if(*ppv) {
...@@ -313,7 +312,7 @@ static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p) ...@@ -313,7 +312,7 @@ static HRESULT HTMLScriptElement_get_readystate(HTMLDOMNode *iface, BSTR *p)
{ {
HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface); HTMLScriptElement *This = HTMLSCRIPT_NODE_THIS(iface);
return IHTMLScriptElement_get_readyState(HTMLSCRIPT(This), p); return IHTMLScriptElement_get_readyState(&This->IHTMLScriptElement_iface, p);
} }
#undef HTMLSCRIPT_NODE_THIS #undef HTMLSCRIPT_NODE_THIS
...@@ -352,7 +351,7 @@ HRESULT HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsele ...@@ -352,7 +351,7 @@ HRESULT HTMLScriptElement_Create(HTMLDocumentNode *doc, nsIDOMHTMLElement *nsele
if(!ret) if(!ret)
return E_OUTOFMEMORY; return E_OUTOFMEMORY;
ret->lpHTMLScriptElementVtbl = &HTMLScriptElementVtbl; ret->IHTMLScriptElement_iface.lpVtbl = &HTMLScriptElementVtbl;
ret->element.node.vtbl = &HTMLScriptElementImplVtbl; ret->element.node.vtbl = &HTMLScriptElementImplVtbl;
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript); nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLScriptElement, (void**)&ret->nsscript);
......
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