mshtml: Introduce EventTarget_Init.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1b09514c82
commit
d69f1f01e5
|
@ -1643,8 +1643,10 @@ static int event_id_cmp(const void *key, const struct wine_rb_entry *entry)
|
||||||
return (INT_PTR)key - WINE_RB_ENTRY_VALUE(entry, handler_vector_t, entry)->event_id;
|
return (INT_PTR)key - WINE_RB_ENTRY_VALUE(entry, handler_vector_t, entry)->event_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_event_target(EventTarget *event_target)
|
void EventTarget_Init(EventTarget *event_target, IUnknown *outer, dispex_static_data_t *dispex_data,
|
||||||
|
compat_mode_t compat_mode)
|
||||||
{
|
{
|
||||||
|
init_dispex_with_compat_mode(&event_target->dispex, outer, dispex_data, compat_mode);
|
||||||
wine_rb_init(&event_target->handler_map, event_id_cmp);
|
wine_rb_init(&event_target->handler_map, event_id_cmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ typedef enum {
|
||||||
|
|
||||||
eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
|
eventid_t str_to_eid(LPCWSTR) DECLSPEC_HIDDEN;
|
||||||
void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
|
void check_event_attr(HTMLDocumentNode*,nsIDOMHTMLElement*) DECLSPEC_HIDDEN;
|
||||||
void init_event_target(EventTarget*) DECLSPEC_HIDDEN;
|
|
||||||
void release_event_target(EventTarget*) DECLSPEC_HIDDEN;
|
void release_event_target(EventTarget*) DECLSPEC_HIDDEN;
|
||||||
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,HTMLDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
|
void fire_event(HTMLDocumentNode*,eventid_t,BOOL,HTMLDOMNode*,nsIDOMEvent*,IDispatch*) DECLSPEC_HIDDEN;
|
||||||
HRESULT set_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
|
HRESULT set_event_handler(EventTarget*,eventid_t,VARIANT*) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -1450,9 +1450,7 @@ void HTMLDOMNode_Init(HTMLDocumentNode *doc, HTMLDOMNode *node, nsIDOMNode *nsno
|
||||||
node->IHTMLDOMNode3_iface.lpVtbl = &HTMLDOMNode3Vtbl;
|
node->IHTMLDOMNode3_iface.lpVtbl = &HTMLDOMNode3Vtbl;
|
||||||
|
|
||||||
ccref_init(&node->ccref, 1);
|
ccref_init(&node->ccref, 1);
|
||||||
init_dispex_with_compat_mode(&node->event_target.dispex, (IUnknown*)&node->IHTMLDOMNode_iface,
|
EventTarget_Init(&node->event_target, (IUnknown*)&node->IHTMLDOMNode_iface, dispex_data, doc->document_mode);
|
||||||
dispex_data, doc->document_mode);
|
|
||||||
init_event_target(&node->event_target);
|
|
||||||
|
|
||||||
if(&doc->node != node)
|
if(&doc->node != node)
|
||||||
htmldoc_addref(&doc->basedoc);
|
htmldoc_addref(&doc->basedoc);
|
||||||
|
|
|
@ -3078,8 +3078,8 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon,
|
||||||
window->base.outer_window = outer_window;
|
window->base.outer_window = outer_window;
|
||||||
window->base.inner_window = window;
|
window->base.inner_window = window;
|
||||||
|
|
||||||
init_event_target(&window->event_target);
|
EventTarget_Init(&window->event_target, (IUnknown*)&window->base.IHTMLWindow2_iface,
|
||||||
init_dispex(&window->event_target.dispex, (IUnknown*)&window->base.IHTMLWindow2_iface, &HTMLWindow_dispex);
|
&HTMLWindow_dispex, COMPAT_MODE_NONE);
|
||||||
|
|
||||||
window->task_magic = get_task_target_magic();
|
window->task_magic = get_task_target_magic();
|
||||||
|
|
||||||
|
|
|
@ -1040,6 +1040,8 @@ void HTMLElement_Init(HTMLElement*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_s
|
||||||
void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
void HTMLTextContainer_Init(HTMLTextContainer*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
||||||
void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
void HTMLFrameBase_Init(HTMLFrameBase*,HTMLDocumentNode*,nsIDOMHTMLElement*,dispex_static_data_t*) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
|
void EventTarget_Init(EventTarget*,IUnknown*,dispex_static_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
|
||||||
|
|
||||||
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
|
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**) DECLSPEC_HIDDEN;
|
||||||
void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
|
void HTMLDOMNode_destructor(HTMLDOMNode*) DECLSPEC_HIDDEN;
|
||||||
void HTMLDOMNode_init_dispex_info(dispex_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
|
void HTMLDOMNode_init_dispex_info(dispex_data_t*,compat_mode_t) DECLSPEC_HIDDEN;
|
||||||
|
|
|
@ -901,9 +901,8 @@ static HRESULT WINAPI HTMLXMLHttpRequestFactory_create(IHTMLXMLHttpRequestFactor
|
||||||
|
|
||||||
ret->IHTMLXMLHttpRequest_iface.lpVtbl = &HTMLXMLHttpRequestVtbl;
|
ret->IHTMLXMLHttpRequest_iface.lpVtbl = &HTMLXMLHttpRequestVtbl;
|
||||||
ret->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfo2Vtbl;
|
ret->IProvideClassInfo2_iface.lpVtbl = &ProvideClassInfo2Vtbl;
|
||||||
init_event_target(&ret->event_target);
|
EventTarget_Init(&ret->event_target, (IUnknown*)&ret->IHTMLXMLHttpRequest_iface,
|
||||||
init_dispex(&ret->event_target.dispex, (IUnknown*)&ret->IHTMLXMLHttpRequest_iface,
|
&HTMLXMLHttpRequest_dispex, COMPAT_MODE_NONE);
|
||||||
&HTMLXMLHttpRequest_dispex);
|
|
||||||
ret->ref = 1;
|
ret->ref = 1;
|
||||||
|
|
||||||
*p = &ret->IHTMLXMLHttpRequest_iface;
|
*p = &ret->IHTMLXMLHttpRequest_iface;
|
||||||
|
|
Loading…
Reference in New Issue