mirror of
git://source.winehq.org/git/wine.git
synced 2024-10-06 13:44:06 +00:00
mshtml: Use DispatchEx for exposing document node IDispatchEx interface.
This commit is contained in:
parent
0856706071
commit
7cb0b66eb7
|
@ -4537,11 +4537,6 @@ static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = {
|
||||||
SupportErrorInfo_InterfaceSupportsErrorInfo
|
SupportErrorInfo_InterfaceSupportsErrorInfo
|
||||||
};
|
};
|
||||||
|
|
||||||
static inline HTMLDocumentNode *impl_from_IDispatchEx(IDispatchEx *iface)
|
|
||||||
{
|
|
||||||
return CONTAINING_RECORD(iface, HTMLDocumentNode, IDispatchEx_iface);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT has_elem_name(nsIDOMHTMLDocument *html_document, const WCHAR *name)
|
static HRESULT has_elem_name(nsIDOMHTMLDocument *html_document, const WCHAR *name)
|
||||||
{
|
{
|
||||||
static const WCHAR fmt[] = L":-moz-any(applet,embed,form,iframe,img,object)[name=\"%s\"]";
|
static const WCHAR fmt[] = L":-moz-any(applet,embed,form,iframe,img,object)[name=\"%s\"]";
|
||||||
|
@ -4642,84 +4637,6 @@ static HRESULT dispid_from_elem_name(HTMLDocumentNode *This, const WCHAR *name,
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
DISPEX_IDISPATCH_IMPL(DocDispatchEx, IDispatchEx,
|
|
||||||
impl_from_IDispatchEx(iface)->node.event_target.dispex)
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_GetDispID(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex, pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
|
||||||
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_InvokeEx(&This->node.event_target.dispex.IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_DeleteMemberByName(&This->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_DeleteMemberByDispID(&This->node.event_target.dispex.IDispatchEx_iface, id);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_GetMemberProperties(&This->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch, pgrfdex);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *pbstrName)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_GetMemberName(&This->node.event_target.dispex.IDispatchEx_iface, id, pbstrName);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_GetNextDispID(&This->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid);
|
|
||||||
}
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
|
|
||||||
{
|
|
||||||
HTMLDocumentNode *This = impl_from_IDispatchEx(iface);
|
|
||||||
|
|
||||||
return IDispatchEx_GetNameSpaceParent(&This->node.event_target.dispex.IDispatchEx_iface, ppunk);
|
|
||||||
}
|
|
||||||
|
|
||||||
static const IDispatchExVtbl DocDispatchExVtbl = {
|
|
||||||
DocDispatchEx_QueryInterface,
|
|
||||||
DocDispatchEx_AddRef,
|
|
||||||
DocDispatchEx_Release,
|
|
||||||
DocDispatchEx_GetTypeInfoCount,
|
|
||||||
DocDispatchEx_GetTypeInfo,
|
|
||||||
DocDispatchEx_GetIDsOfNames,
|
|
||||||
DocDispatchEx_Invoke,
|
|
||||||
DocDispatchEx_GetDispID,
|
|
||||||
DocDispatchEx_InvokeEx,
|
|
||||||
DocDispatchEx_DeleteMemberByName,
|
|
||||||
DocDispatchEx_DeleteMemberByDispID,
|
|
||||||
DocDispatchEx_GetMemberProperties,
|
|
||||||
DocDispatchEx_GetMemberName,
|
|
||||||
DocDispatchEx_GetNextDispID,
|
|
||||||
DocDispatchEx_GetNameSpaceParent
|
|
||||||
};
|
|
||||||
|
|
||||||
static inline HTMLDocumentNode *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
|
static inline HTMLDocumentNode *impl_from_IProvideMultipleClassInfo(IProvideMultipleClassInfo *iface)
|
||||||
{
|
{
|
||||||
return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface);
|
return CONTAINING_RECORD(iface, HTMLDocumentNode, IProvideMultipleClassInfo_iface);
|
||||||
|
@ -5255,8 +5172,6 @@ static void *HTMLDocumentNode_query_interface(DispatchEx *dispex, REFIID riid)
|
||||||
{
|
{
|
||||||
HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
|
HTMLDocumentNode *This = impl_from_DispatchEx(dispex);
|
||||||
|
|
||||||
if(IsEqualGUID(&IID_IDispatch, riid) || IsEqualGUID(&IID_IDispatchEx, riid))
|
|
||||||
return &This->IDispatchEx_iface;
|
|
||||||
if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid))
|
if(IsEqualGUID(&IID_IHTMLDocument, riid) || IsEqualGUID(&IID_IHTMLDocument2, riid))
|
||||||
return &This->IHTMLDocument2_iface;
|
return &This->IHTMLDocument2_iface;
|
||||||
if(IsEqualGUID(&IID_IHTMLDocument3, riid))
|
if(IsEqualGUID(&IID_IHTMLDocument3, riid))
|
||||||
|
@ -5748,7 +5663,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
|
||||||
if(!doc)
|
if(!doc)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
doc->IDispatchEx_iface.lpVtbl = &DocDispatchExVtbl;
|
|
||||||
doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl;
|
doc->IHTMLDocument2_iface.lpVtbl = &HTMLDocumentVtbl;
|
||||||
doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
|
doc->IHTMLDocument3_iface.lpVtbl = &HTMLDocument3Vtbl;
|
||||||
doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
|
doc->IHTMLDocument4_iface.lpVtbl = &HTMLDocument4Vtbl;
|
||||||
|
|
|
@ -953,7 +953,6 @@ typedef struct nsDocumentEventListener nsDocumentEventListener;
|
||||||
struct HTMLDocumentNode {
|
struct HTMLDocumentNode {
|
||||||
HTMLDOMNode node;
|
HTMLDOMNode node;
|
||||||
|
|
||||||
IDispatchEx IDispatchEx_iface;
|
|
||||||
IHTMLDocument2 IHTMLDocument2_iface;
|
IHTMLDocument2 IHTMLDocument2_iface;
|
||||||
IHTMLDocument3 IHTMLDocument3_iface;
|
IHTMLDocument3 IHTMLDocument3_iface;
|
||||||
IHTMLDocument4 IHTMLDocument4_iface;
|
IHTMLDocument4 IHTMLDocument4_iface;
|
||||||
|
|
|
@ -3535,35 +3535,67 @@ static inline HTMLDocumentObj *impl_from_IDispatchEx(IDispatchEx *iface)
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DispatchEx)
|
HTMLDOCUMENTOBJ_IUNKNOWN_METHODS(DispatchEx)
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetTypeInfoCount, UINT*)
|
DISPEX_IDISPATCH_NOUNK_IMPL(DocObjDispatchEx, IDispatchEx,
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetTypeInfo, UINT,LCID,ITypeInfo**)
|
impl_from_IDispatchEx(iface)->doc_node->node.event_target.dispex)
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_5(DispatchEx, GetIDsOfNames, REFIID,LPOLESTR*,UINT,LCID,DISPID*)
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocObjDispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember, REFIID riid, LCID lcid,
|
static HRESULT WINAPI DocObjDispatchEx_GetDispID(IDispatchEx *iface, BSTR name, DWORD grfdex, DISPID *pid)
|
||||||
WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
|
||||||
{
|
{
|
||||||
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, dispIdMember, lcid, wFlags, pDispParams,
|
return IDispatchEx_GetDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, name, grfdex, pid);
|
||||||
pVarResult, pExcepInfo, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetDispID, BSTR,DWORD,DISPID*)
|
|
||||||
|
|
||||||
static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
static HRESULT WINAPI DocObjDispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
||||||
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
VARIANT *pvarRes, EXCEPINFO *pei, IServiceProvider *pspCaller)
|
||||||
{
|
{
|
||||||
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
return IDispatchEx_InvokeEx(&This->doc_node->IDispatchEx_iface, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller);
|
return IDispatchEx_InvokeEx(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, lcid,
|
||||||
|
wFlags, pdp, pvarRes, pei, pspCaller);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, DeleteMemberByName, BSTR,DWORD)
|
static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByName(IDispatchEx *iface, BSTR bstrName, DWORD grfdex)
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, DeleteMemberByDispID, DISPID)
|
{
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetMemberProperties, DISPID,DWORD,DWORD*)
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_2(DispatchEx, GetMemberName, DISPID,BSTR*)
|
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_3(DispatchEx, GetNextDispID, DWORD,DISPID,DISPID*)
|
return IDispatchEx_DeleteMemberByName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, bstrName, grfdex);
|
||||||
HTMLDOCUMENTOBJ_FWD_TO_NODE_1(DispatchEx, GetNameSpaceParent, IUnknown**)
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DocObjDispatchEx_DeleteMemberByDispID(IDispatchEx *iface, DISPID id)
|
||||||
|
{
|
||||||
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
|
return IDispatchEx_DeleteMemberByDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DocObjDispatchEx_GetMemberProperties(IDispatchEx *iface, DISPID id, DWORD grfdexFetch, DWORD *pgrfdex)
|
||||||
|
{
|
||||||
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
|
return IDispatchEx_GetMemberProperties(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, grfdexFetch,
|
||||||
|
pgrfdex);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DocObjDispatchEx_GetMemberName(IDispatchEx *iface, DISPID id, BSTR *name)
|
||||||
|
{
|
||||||
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
|
return IDispatchEx_GetMemberName(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, id, name);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DocObjDispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, DISPID id, DISPID *pid)
|
||||||
|
{
|
||||||
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
|
return IDispatchEx_GetNextDispID(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, grfdex, id, pid);
|
||||||
|
}
|
||||||
|
|
||||||
|
static HRESULT WINAPI DocObjDispatchEx_GetNameSpaceParent(IDispatchEx *iface, IUnknown **ppunk)
|
||||||
|
{
|
||||||
|
HTMLDocumentObj *This = impl_from_IDispatchEx(iface);
|
||||||
|
|
||||||
|
return IDispatchEx_GetNameSpaceParent(&This->doc_node->node.event_target.dispex.IDispatchEx_iface, ppunk);
|
||||||
|
}
|
||||||
|
|
||||||
static const IDispatchExVtbl DocObjDispatchExVtbl = {
|
static const IDispatchExVtbl DocObjDispatchExVtbl = {
|
||||||
DocObjDispatchEx_QueryInterface,
|
DocObjDispatchEx_QueryInterface,
|
||||||
|
|
Loading…
Reference in a new issue