From ecaab0fcaee6d830bed98ff2ba5f10abc3e5482a Mon Sep 17 00:00:00 2001 From: Jacek Caban Date: Sun, 6 Sep 2009 18:57:02 +0200 Subject: [PATCH] mshtml: Added IHTMLEventObj::get_screen[XY] implementation. --- dlls/mshtml/htmlevent.c | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/htmlevent.c b/dlls/mshtml/htmlevent.c index 847901590e9..0ba0a07d6b9 100644 --- a/dlls/mshtml/htmlevent.c +++ b/dlls/mshtml/htmlevent.c @@ -514,15 +514,45 @@ static HRESULT WINAPI HTMLEventObj_get_offsetY(IHTMLEventObj *iface, LONG *p) static HRESULT WINAPI HTMLEventObj_get_screenX(IHTMLEventObj *iface, LONG *p) { HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + PRInt32 x = 0; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->nsevent) { + nsIDOMMouseEvent *mouse_event; + nsresult nsres; + + nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMMouseEvent, (void**)&mouse_event); + if(NS_SUCCEEDED(nsres)) { + nsIDOMMouseEvent_GetScreenX(mouse_event, &x); + nsIDOMMouseEvent_Release(mouse_event); + } + } + + *p = x; + return S_OK; } static HRESULT WINAPI HTMLEventObj_get_screenY(IHTMLEventObj *iface, LONG *p) { HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface); - FIXME("(%p)->(%p)\n", This, p); - return E_NOTIMPL; + PRInt32 y = 0; + + TRACE("(%p)->(%p)\n", This, p); + + if(This->nsevent) { + nsIDOMMouseEvent *mouse_event; + nsresult nsres; + + nsres = nsIDOMEvent_QueryInterface(This->nsevent, &IID_nsIDOMMouseEvent, (void**)&mouse_event); + if(NS_SUCCEEDED(nsres)) { + nsIDOMMouseEvent_GetScreenY(mouse_event, &y); + nsIDOMMouseEvent_Release(mouse_event); + } + } + + *p = y; + return S_OK; } static HRESULT WINAPI HTMLEventObj_get_srcFilter(IHTMLEventObj *iface, IDispatch **p)