From 364b12609c4c0d4cfc70383f4ebc3c8e7bd4537d Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Fri, 10 Oct 2008 15:46:32 -0500 Subject: [PATCH] mshtml: Added get_onmouseover implementations. --- dlls/mshtml/htmldoc.c | 6 ++++-- dlls/mshtml/htmlelem.c | 6 ++++-- dlls/mshtml/htmlevent.c | 13 +++++++++++++ dlls/mshtml/htmlevent.h | 11 +++++++++++ 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index b9cafe5d17a..00bc68c331a 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -1081,8 +1081,10 @@ static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIAN static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p) { HTMLDocument *This = HTMLDOC_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_doc_event(This, EVENTID_MOUSEOVER, p); } static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v) diff --git a/dlls/mshtml/htmlelem.c b/dlls/mshtml/htmlelem.c index 1052e6c637b..b53521a192e 100644 --- a/dlls/mshtml/htmlelem.c +++ b/dlls/mshtml/htmlelem.c @@ -510,8 +510,10 @@ static HRESULT WINAPI HTMLElement_put_onmouseover(IHTMLElement *iface, VARIANT v static HRESULT WINAPI HTMLElement_get_onmouseover(IHTMLElement *iface, VARIANT *p) { HTMLElement *This = HTMLELEM_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + + TRACE("(%p)->(%p)\n", This, p); + + return get_node_event(&This->node, EVENTID_MOUSEOVER, p); } static HRESULT WINAPI HTMLElement_put_onmousemove(IHTMLElement *iface, VARIANT v) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 05c529662ac..4c8e2a2e161 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -471,6 +471,19 @@ HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, even return E_NOTIMPL; } +HRESULT get_event_handler(event_target_t **event_target, eventid_t eid, VARIANT *var) +{ + if(*event_target && (*event_target)->event_table[eid]) { + V_VT(var) = VT_DISPATCH; + V_DISPATCH(var) = (*event_target)->event_table[eid]; + IDispatch_AddRef(V_DISPATCH(var)); + }else { + V_VT(var) = VT_NULL; + } + + return S_OK; +} + void check_event_attr(HTMLDocument *doc, nsIDOMElement *nselem) { const PRUnichar *attr_value; diff --git a/dlls/mshtml/htmlevent.h b/dlls/mshtml/htmlevent.h index f4a99c34221..b5b581b0a33 100644 --- a/dlls/mshtml/htmlevent.h +++ b/dlls/mshtml/htmlevent.h @@ -30,13 +30,24 @@ void check_event_attr(HTMLDocument*,nsIDOMElement*); void release_event_target(event_target_t*); void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*); HRESULT set_event_handler(event_target_t**,HTMLDocument*,eventid_t,VARIANT*); +HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*); static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) { return set_event_handler(&node->event_target, node->doc, eid, var); } +static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var) +{ + return get_event_handler(&node->event_target, eid, var); +} + static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) { return set_event_handler(&doc->event_target, doc, eid, var); } + +static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var) +{ + return get_event_handler(&doc->event_target, eid, var); +}