diff --git a/content/base/src/nsGenericElement.cpp b/content/base/src/nsGenericElement.cpp index 86e3958d33db..fc47a547cd80 100644 --- a/content/base/src/nsGenericElement.cpp +++ b/content/base/src/nsGenericElement.cpp @@ -3641,7 +3641,7 @@ nsGenericElement::DispatchClickEvent(nsPresContext* aPresContext, pressure = static_cast(aSourceEvent)->pressure; inputSource = static_cast(aSourceEvent)->inputSource; } else if (aSourceEvent->eventStructType == NS_KEY_EVENT) { - inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; } event.pressure = pressure; event.clickCount = clickCount; diff --git a/content/events/src/nsDOMDragEvent.cpp b/content/events/src/nsDOMDragEvent.cpp index abb29ba8e28e..b76f89831824 100644 --- a/content/events/src/nsDOMDragEvent.cpp +++ b/content/events/src/nsDOMDragEvent.cpp @@ -54,7 +54,7 @@ nsDOMDragEvent::nsDOMDragEvent(nsPresContext* aPresContext, mEventIsInternal = PR_TRUE; mEvent->time = PR_Now(); mEvent->refPoint.x = mEvent->refPoint.y = 0; - static_cast(mEvent)->inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN; + static_cast(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; } } diff --git a/content/events/src/nsDOMMouseEvent.cpp b/content/events/src/nsDOMMouseEvent.cpp index 7c5969f6413f..dcd9aa439e33 100644 --- a/content/events/src/nsDOMMouseEvent.cpp +++ b/content/events/src/nsDOMMouseEvent.cpp @@ -59,7 +59,7 @@ nsDOMMouseEvent::nsDOMMouseEvent(nsPresContext* aPresContext, mEventIsInternal = PR_TRUE; mEvent->time = PR_Now(); mEvent->refPoint.x = mEvent->refPoint.y = 0; - static_cast(mEvent)->inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN; + static_cast(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; } switch (mEvent->eventStructType) @@ -98,7 +98,6 @@ DOMCI_DATA(MouseEvent, nsDOMMouseEvent) NS_INTERFACE_MAP_BEGIN(nsDOMMouseEvent) NS_INTERFACE_MAP_ENTRY(nsIDOMMouseEvent) - NS_INTERFACE_MAP_ENTRY(nsIDOMNSMouseEvent) NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(MouseEvent) NS_INTERFACE_MAP_END_INHERITING(nsDOMUIEvent) diff --git a/content/events/src/nsDOMMouseEvent.h b/content/events/src/nsDOMMouseEvent.h index 78a121112918..7fae6f5e5d3d 100644 --- a/content/events/src/nsDOMMouseEvent.h +++ b/content/events/src/nsDOMMouseEvent.h @@ -41,13 +41,12 @@ #include "nsIDOMMouseEvent.h" #include "nsDOMUIEvent.h" -#include "nsIDOMNSMouseEvent.h" class nsIContent; class nsEvent; class nsDOMMouseEvent : public nsDOMUIEvent, - public nsIDOMNSMouseEvent + public nsIDOMMouseEvent { public: nsDOMMouseEvent(nsPresContext* aPresContext, nsInputEvent* aEvent); @@ -58,9 +57,6 @@ public: // nsIDOMMouseEvent Interface NS_DECL_NSIDOMMOUSEEVENT - // nsIDOMNSMouseEvent Interface - NS_DECL_NSIDOMNSMOUSEEVENT - // Forward to base class NS_FORWARD_TO_NSDOMUIEVENT diff --git a/content/events/src/nsDOMMouseScrollEvent.cpp b/content/events/src/nsDOMMouseScrollEvent.cpp index ac61c741286d..4069b32e02f8 100644 --- a/content/events/src/nsDOMMouseScrollEvent.cpp +++ b/content/events/src/nsDOMMouseScrollEvent.cpp @@ -51,7 +51,7 @@ nsDOMMouseScrollEvent::nsDOMMouseScrollEvent(nsPresContext* aPresContext, mEventIsInternal = PR_TRUE; mEvent->time = PR_Now(); mEvent->refPoint.x = mEvent->refPoint.y = 0; - static_cast(mEvent)->inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN; + static_cast(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; } if(mEvent->eventStructType == NS_MOUSE_SCROLL_EVENT) { diff --git a/content/events/src/nsDOMSimpleGestureEvent.cpp b/content/events/src/nsDOMSimpleGestureEvent.cpp index c3d3b59f1c44..60482ab0c587 100644 --- a/content/events/src/nsDOMSimpleGestureEvent.cpp +++ b/content/events/src/nsDOMSimpleGestureEvent.cpp @@ -51,7 +51,7 @@ nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(nsPresContext* aPresContext, ns mEventIsInternal = PR_TRUE; mEvent->time = PR_Now(); mEvent->refPoint.x = mEvent->refPoint.y = 0; - static_cast(mEvent)->inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN; + static_cast(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; } } diff --git a/content/events/test/test_bug547996-1.html b/content/events/test/test_bug547996-1.html index 0113e80052e9..1a367cab1732 100644 --- a/content/events/test/test_bug547996-1.html +++ b/content/events/test/test_bug547996-1.html @@ -26,8 +26,8 @@ function prepareListener(eventName, expectedValue) { }; } -const INPUT_SOURCE_UNKNOWN = Components.interfaces.nsIDOMNSMouseEvent.MOZ_SOURCE_UNKNOWN; -const INPUT_SOURCE_KEYBOARD = Components.interfaces.nsIDOMNSMouseEvent.MOZ_SOURCE_KEYBOARD; +const INPUT_SOURCE_UNKNOWN = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN; +const INPUT_SOURCE_KEYBOARD = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD; function doTest() { var eventNames = [ diff --git a/content/events/test/test_bug547996-2.xhtml b/content/events/test/test_bug547996-2.xhtml index 2896a868fa83..98368df887b2 100644 --- a/content/events/test/test_bug547996-2.xhtml +++ b/content/events/test/test_bug547996-2.xhtml @@ -29,13 +29,13 @@ function check(event) { function doTest() { setup(); - expectedInputSource = Components.interfaces.nsIDOMNSMouseEvent.MOZ_SOURCE_KEYBOARD; + expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_KEYBOARD; testKeyboard(); - expectedInputSource = Components.interfaces.nsIDOMNSMouseEvent.MOZ_SOURCE_MOUSE; + expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_MOUSE; testMouse(); - expectedInputSource = Components.interfaces.nsIDOMNSMouseEvent.MOZ_SOURCE_UNKNOWN; + expectedInputSource = Components.interfaces.nsIDOMMouseEvent.MOZ_SOURCE_UNKNOWN; testScriptedClicks(); cleanup(); diff --git a/content/html/content/src/nsGenericHTMLElement.cpp b/content/html/content/src/nsGenericHTMLElement.cpp index b481b76d614e..e49e694b2442 100644 --- a/content/html/content/src/nsGenericHTMLElement.cpp +++ b/content/html/content/src/nsGenericHTMLElement.cpp @@ -3401,7 +3401,7 @@ nsresult nsGenericHTMLElement::Click() // is called from chrome code. nsMouseEvent event(nsContentUtils::IsCallerChrome(), NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN; nsEventDispatcher::Dispatch(this, context, &event); @@ -3507,7 +3507,7 @@ nsGenericHTMLElement::PerformAccesskey(PRBool aKeyCausesActivation, // Click on it if the users prefs indicate to do so. nsMouseEvent event(aIsTrustedEvent, NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; nsAutoPopupStatePusher popupStatePusher(aIsTrustedEvent ? openAllowed : openAbused); diff --git a/content/html/content/src/nsHTMLButtonElement.cpp b/content/html/content/src/nsHTMLButtonElement.cpp index 6523fbd541a7..3d63cebd9e98 100644 --- a/content/html/content/src/nsHTMLButtonElement.cpp +++ b/content/html/content/src/nsHTMLButtonElement.cpp @@ -368,7 +368,7 @@ nsHTMLButtonElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor) nsMouseEvent event(NS_IS_TRUSTED_EVENT(aVisitor.mEvent), NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; nsEventDispatcher::Dispatch(static_cast(this), aVisitor.mPresContext, &event, nsnull, &status); diff --git a/content/html/content/src/nsHTMLInputElement.cpp b/content/html/content/src/nsHTMLInputElement.cpp index bdce19b1d2ae..b1d5806c8448 100644 --- a/content/html/content/src/nsHTMLInputElement.cpp +++ b/content/html/content/src/nsHTMLInputElement.cpp @@ -2179,7 +2179,7 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor) { nsMouseEvent event(NS_IS_TRUSTED_EVENT(aVisitor.mEvent), NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; nsEventStatus status = nsEventStatus_eIgnore; nsEventDispatcher::Dispatch(static_cast(this), @@ -2217,7 +2217,7 @@ nsHTMLInputElement::PostHandleEvent(nsEventChainPostVisitor& aVisitor) nsMouseEvent event(NS_IS_TRUSTED_EVENT(aVisitor.mEvent), NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; rv = nsEventDispatcher::Dispatch(radioContent, aVisitor.mPresContext, &event, nsnull, &status); diff --git a/content/html/content/src/nsHTMLLabelElement.cpp b/content/html/content/src/nsHTMLLabelElement.cpp index 766c9052dc5f..18ac868243f7 100644 --- a/content/html/content/src/nsHTMLLabelElement.cpp +++ b/content/html/content/src/nsHTMLLabelElement.cpp @@ -314,7 +314,7 @@ nsHTMLLabelElement::PerformAccesskey(PRBool aKeyCausesActivation, // Click on it if the users prefs indicate to do so. nsMouseEvent event(aIsTrustedEvent, NS_MOUSE_CLICK, nsnull, nsMouseEvent::eReal); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD; nsAutoPopupStatePusher popupStatePusher(aIsTrustedEvent ? openAllowed : openAbused); diff --git a/content/xul/content/src/nsXULElement.cpp b/content/xul/content/src/nsXULElement.cpp index 3691da8297a2..8a87d56a396a 100644 --- a/content/xul/content/src/nsXULElement.cpp +++ b/content/xul/content/src/nsXULElement.cpp @@ -694,7 +694,7 @@ nsXULElement::PerformAccesskey(PRBool aKeyCausesActivation, } } if (aKeyCausesActivation && tag != nsGkAtoms::textbox && tag != nsGkAtoms::menulist) { - elm->ClickWithInputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_KEYBOARD); + elm->ClickWithInputSource(nsIDOMMouseEvent::MOZ_SOURCE_KEYBOARD); } } else { @@ -2077,7 +2077,7 @@ nsXULElement::Blur() NS_IMETHODIMP nsXULElement::Click() { - return ClickWithInputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_UNKNOWN); + return ClickWithInputSource(nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN); } nsresult diff --git a/dom/base/nsDOMClassInfo.cpp b/dom/base/nsDOMClassInfo.cpp index 150cbb8f740b..6b381971b423 100644 --- a/dom/base/nsDOMClassInfo.cpp +++ b/dom/base/nsDOMClassInfo.cpp @@ -473,9 +473,6 @@ // Simple gestures include #include "nsIDOMSimpleGestureEvent.h" - -#include "nsIDOMNSMouseEvent.h" - #include "nsIDOMMozTouchEvent.h" #include "nsIEventListenerService.h" @@ -2463,21 +2460,18 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(MouseEvent, nsIDOMMouseEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(MouseScrollEvent, nsIDOMMouseScrollEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseScrollEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(DragEvent, nsIDOMDragEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMDragEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END @@ -3940,14 +3934,12 @@ nsDOMClassInfo::Init() DOM_CLASSINFO_MAP_BEGIN(SimpleGestureEvent, nsIDOMSimpleGestureEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMSimpleGestureEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END DOM_CLASSINFO_MAP_BEGIN(MozTouchEvent, nsIDOMMozTouchEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMozTouchEvent) DOM_CLASSINFO_MAP_ENTRY(nsIDOMMouseEvent) - DOM_CLASSINFO_MAP_ENTRY(nsIDOMNSMouseEvent) DOM_CLASSINFO_UI_EVENT_MAP_ENTRIES DOM_CLASSINFO_MAP_END diff --git a/dom/interfaces/events/Makefile.in b/dom/interfaces/events/Makefile.in index 5a881e36519a..78b2c8f05499 100644 --- a/dom/interfaces/events/Makefile.in +++ b/dom/interfaces/events/Makefile.in @@ -74,7 +74,6 @@ XPIDLSRCS = \ nsIDOMPaintRequest.idl \ nsIDOMPaintRequestList.idl \ nsIDOMSimpleGestureEvent.idl \ - nsIDOMNSMouseEvent.idl \ nsIDOMMozTouchEvent.idl \ nsIDOMDeviceOrientationEvent.idl\ nsIDOMDeviceMotionEvent.idl \ diff --git a/dom/interfaces/events/nsIDOMDragEvent.idl b/dom/interfaces/events/nsIDOMDragEvent.idl index 6f6f62a6eeaf..d5dc7d5febde 100644 --- a/dom/interfaces/events/nsIDOMDragEvent.idl +++ b/dom/interfaces/events/nsIDOMDragEvent.idl @@ -40,7 +40,7 @@ interface nsIDOMDataTransfer; -[scriptable, uuid(326d652c-4c43-424e-95fe-4281d20975d7)] +[scriptable, uuid(26b40393-c383-4e9a-977f-e8e1351926eb)] interface nsIDOMDragEvent : nsIDOMMouseEvent { readonly attribute nsIDOMDataTransfer dataTransfer; diff --git a/dom/interfaces/events/nsIDOMMouseEvent.idl b/dom/interfaces/events/nsIDOMMouseEvent.idl index e4f5e423bc8c..c8768da78d0f 100644 --- a/dom/interfaces/events/nsIDOMMouseEvent.idl +++ b/dom/interfaces/events/nsIDOMMouseEvent.idl @@ -22,6 +22,7 @@ * Contributor(s): * Tom Pixley (original author) * Johnny Stenback + * Oleg Romashin * * Alternatively, the contents of this file may be used under the terms of * either of the GNU General Public License Version 2 or later (the "GPL"), @@ -47,7 +48,7 @@ * http://www.w3.org/TR/DOM-Level-2-Events/ */ -[scriptable, uuid(260c32cb-d709-46d4-8889-00de1ab091c6)] +[scriptable, uuid(7e6cb6e1-d3ba-4e60-a6ff-96350187a1e3)] interface nsIDOMMouseEvent : nsIDOMUIEvent { readonly attribute long screenX; @@ -79,4 +80,36 @@ interface nsIDOMMouseEvent : nsIDOMUIEvent in boolean metaKeyArg, in unsigned short buttonArg, in nsIDOMEventTarget relatedTargetArg); + + // Finger or touch pressure event value + // ranges between 0.0 and 1.0 + readonly attribute float mozPressure; + + const unsigned short MOZ_SOURCE_UNKNOWN = 0; + const unsigned short MOZ_SOURCE_MOUSE = 1; + const unsigned short MOZ_SOURCE_PEN = 2; + const unsigned short MOZ_SOURCE_ERASER = 3; + const unsigned short MOZ_SOURCE_CURSOR = 4; + const unsigned short MOZ_SOURCE_TOUCH = 5; + const unsigned short MOZ_SOURCE_KEYBOARD = 6; + + readonly attribute unsigned short mozInputSource; + + void initNSMouseEvent(in DOMString typeArg, + in boolean canBubbleArg, + in boolean cancelableArg, + in nsIDOMWindow viewArg, + in long detailArg, + in long screenXArg, + in long screenYArg, + in long clientXArg, + in long clientYArg, + in boolean ctrlKeyArg, + in boolean altKeyArg, + in boolean shiftKeyArg, + in boolean metaKeyArg, + in unsigned short buttonArg, + in nsIDOMEventTarget relatedTargetArg, + in float pressure, + in unsigned short inputSourceArg); }; diff --git a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl index d8df147cf9da..ad3a003da360 100644 --- a/dom/interfaces/events/nsIDOMMouseScrollEvent.idl +++ b/dom/interfaces/events/nsIDOMMouseScrollEvent.idl @@ -38,7 +38,7 @@ #include "nsIDOMMouseEvent.idl" -[scriptable, uuid(196cb2ff-7a20-4226-9e14-00ef201d1b0c)] +[scriptable, uuid(eac2ea89-7926-417a-bbc8-bb893e77bebb)] interface nsIDOMMouseScrollEvent : nsIDOMMouseEvent { const long HORIZONTAL_AXIS = 1; diff --git a/dom/interfaces/events/nsIDOMMozTouchEvent.idl b/dom/interfaces/events/nsIDOMMozTouchEvent.idl index 7eedfba937cb..2c9a650ff813 100644 --- a/dom/interfaces/events/nsIDOMMozTouchEvent.idl +++ b/dom/interfaces/events/nsIDOMMozTouchEvent.idl @@ -40,7 +40,7 @@ #include "nsIDOMMouseEvent.idl" -[scriptable, uuid(1add2f2b-2931-429f-a16f-b724469ac8c4)] +[scriptable, uuid(e680bab6-740a-4097-b5e0-5e9d7d381cbc)] interface nsIDOMMozTouchEvent : nsIDOMMouseEvent { readonly attribute unsigned long streamId; diff --git a/dom/interfaces/events/nsIDOMNSMouseEvent.idl b/dom/interfaces/events/nsIDOMNSMouseEvent.idl deleted file mode 100644 index 44e945b846d5..000000000000 --- a/dom/interfaces/events/nsIDOMNSMouseEvent.idl +++ /dev/null @@ -1,80 +0,0 @@ -/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2008 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * Oleg Romashin (original author) - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -#include "nsIDOMMouseEvent.idl" - -/** - * The nsIDOMNSMouseEvent interface extends nsIDOMMouseEvent - * by providing various information related to the mouse event. - */ - -[scriptable, uuid(78977629-3069-4381-b4fd-0beca7cb4e2f)] -interface nsIDOMNSMouseEvent : nsIDOMMouseEvent -{ - // Finger or touch pressure event value - // ranges between 0.0 and 1.0 - readonly attribute float mozPressure; - - const unsigned short MOZ_SOURCE_UNKNOWN = 0; - const unsigned short MOZ_SOURCE_MOUSE = 1; - const unsigned short MOZ_SOURCE_PEN = 2; - const unsigned short MOZ_SOURCE_ERASER = 3; - const unsigned short MOZ_SOURCE_CURSOR = 4; - const unsigned short MOZ_SOURCE_TOUCH = 5; - const unsigned short MOZ_SOURCE_KEYBOARD = 6; - - readonly attribute unsigned short mozInputSource; - - void initNSMouseEvent(in DOMString typeArg, - in boolean canBubbleArg, - in boolean cancelableArg, - in nsIDOMWindow viewArg, - in long detailArg, - in long screenXArg, - in long screenYArg, - in long clientXArg, - in long clientYArg, - in boolean ctrlKeyArg, - in boolean altKeyArg, - in boolean shiftKeyArg, - in boolean metaKeyArg, - in unsigned short buttonArg, - in nsIDOMEventTarget relatedTargetArg, - in float pressure, - in unsigned short inputSourceArg); -}; diff --git a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl index 9857ca0d242d..1c69af0ee32d 100644 --- a/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl +++ b/dom/interfaces/events/nsIDOMSimpleGestureEvent.idl @@ -97,7 +97,7 @@ * consuming events. */ -[scriptable, uuid(0efb9da9-e7c4-495e-815d-3f561cb6e6bb)] +[scriptable, uuid(0fdcef08-b4e8-4d41-91a0-4f5d259bfb81)] interface nsIDOMSimpleGestureEvent : nsIDOMMouseEvent { /* Swipe direction constants */ diff --git a/widget/public/nsGUIEvent.h b/widget/public/nsGUIEvent.h index 90b87b283bdc..1453d295ebfd 100644 --- a/widget/public/nsGUIEvent.h +++ b/widget/public/nsGUIEvent.h @@ -50,7 +50,7 @@ #include "nsCOMPtr.h" #include "nsIAtom.h" #include "nsIDOMKeyEvent.h" -#include "nsIDOMNSMouseEvent.h" +#include "nsIDOMMouseEvent.h" #include "nsIDOMDataTransfer.h" #include "nsIDOMEventTarget.h" #include "nsWeakPtr.h" @@ -832,8 +832,8 @@ public: } nsMouseEvent_base(PRBool isTrusted, PRUint32 msg, nsIWidget *w, PRUint8 type) - : nsInputEvent(isTrusted, msg, w, type), button(0), pressure(0), - inputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE) {} + : nsInputEvent(isTrusted, msg, w, type), button(0), pressure(0) + , inputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE) {} /// The possible related target nsCOMPtr relatedTarget; @@ -844,7 +844,7 @@ public: // ranges between 0.0 and 1.0 float pressure; - // Possible values at nsIDOMNSMouseEvent + // Possible values at nsIDOMMouseEvent PRUint16 inputSource; }; diff --git a/widget/src/windows/nsWindow.cpp b/widget/src/windows/nsWindow.cpp index 39e928208719..1cb96528ad12 100644 --- a/widget/src/windows/nsWindow.cpp +++ b/widget/src/windows/nsWindow.cpp @@ -119,7 +119,7 @@ #include "mozilla/WidgetTraceEvent.h" #include "nsIAppShell.h" #include "nsISupportsPrimitives.h" -#include "nsIDOMNSMouseEvent.h" +#include "nsIDOMMouseEvent.h" #include "nsITheme.h" #include "nsIObserverService.h" #include "nsIScreenManager.h" @@ -6248,7 +6248,7 @@ PRBool nsWindow::OnTouch(WPARAM wParam, LPARAM lParam) touchPoint.ScreenToClient(mWnd); nsMozTouchEvent touchEvent(PR_TRUE, msg, this, pInputs[i].dwID); - touchEvent.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_TOUCH; + touchEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; touchEvent.refPoint = touchPoint; nsEventStatus status; @@ -6280,7 +6280,7 @@ PRBool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) event.isAlt = IS_VK_DOWN(NS_VK_ALT); event.button = 0; event.time = ::GetMessageTime(); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_TOUCH; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; PRBool endFeedback = PR_TRUE; @@ -6321,7 +6321,7 @@ PRBool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) event.isAlt = IS_VK_DOWN(NS_VK_ALT); event.button = 0; event.time = ::GetMessageTime(); - event.inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_TOUCH; + event.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH; nsEventStatus status; DispatchEvent(&event, status); @@ -6337,11 +6337,11 @@ PRBool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam) PRUint16 nsWindow::GetMouseInputSource() { - PRUint16 inputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE; + PRUint16 inputSource = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE; LPARAM lParamExtraInfo = ::GetMessageExtraInfo(); if ((lParamExtraInfo & TABLET_INK_SIGNATURE) == TABLET_INK_CHECK) { inputSource = (lParamExtraInfo & TABLET_INK_TOUCH) ? - PRUint16(nsIDOMNSMouseEvent::MOZ_SOURCE_TOUCH) : nsIDOMNSMouseEvent::MOZ_SOURCE_PEN; + PRUint16(nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) : nsIDOMMouseEvent::MOZ_SOURCE_PEN; } return inputSource; } diff --git a/widget/src/windows/nsWindow.h b/widget/src/windows/nsWindow.h index d0aec2c7a850..38866c90089b 100644 --- a/widget/src/windows/nsWindow.h +++ b/widget/src/windows/nsWindow.h @@ -77,6 +77,8 @@ #include "nsUXThemeData.h" +#include "nsIDOMMouseEvent.h" + /** * Forward class definitions */ @@ -211,7 +213,7 @@ public: LPARAM lParam, PRBool aIsContextMenuKey = PR_FALSE, PRInt16 aButton = nsMouseEvent::eLeftButton, - PRUint16 aInputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE); + PRUint16 aInputSource = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE); virtual PRBool DispatchWindowEvent(nsGUIEvent* event); virtual PRBool DispatchWindowEvent(nsGUIEvent*event, nsEventStatus &aStatus); virtual PRBool DispatchKeyEvent(PRUint32 aEventType, WORD aCharCode, diff --git a/widget/src/xpwidgets/nsBaseDragService.cpp b/widget/src/xpwidgets/nsBaseDragService.cpp index 95736d65345e..396343e938fe 100644 --- a/widget/src/xpwidgets/nsBaseDragService.cpp +++ b/widget/src/xpwidgets/nsBaseDragService.cpp @@ -81,7 +81,7 @@ nsBaseDragService::nsBaseDragService() mHasImage(PR_FALSE), mUserCancelled(PR_FALSE), mDragAction(DRAGDROP_ACTION_NONE), mTargetSize(0,0), mImageX(0), mImageY(0), mScreenX(-1), mScreenY(-1), mSuppressLevel(0), - mInputSource(nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE) + mInputSource(nsIDOMMouseEvent::MOZ_SOURCE_MOUSE) { } @@ -281,9 +281,7 @@ nsBaseDragService::InvokeDragSessionWithImage(nsIDOMNode* aDOMNode, aDragEvent->GetScreenX(&mScreenX); aDragEvent->GetScreenY(&mScreenY); - - nsCOMPtr mouseEvent = do_QueryInterface(aDragEvent); - mouseEvent->GetMozInputSource(&mInputSource); + aDragEvent->GetMozInputSource(&mInputSource); return InvokeDragSession(aDOMNode, aTransferableArray, aRegion, aActionType); } @@ -309,9 +307,7 @@ nsBaseDragService::InvokeDragSessionWithSelection(nsISelection* aSelection, aDragEvent->GetScreenX(&mScreenX); aDragEvent->GetScreenY(&mScreenY); - - nsCOMPtr mouseEvent = do_QueryInterface(aDragEvent); - mouseEvent->GetMozInputSource(&mInputSource); + aDragEvent->GetMozInputSource(&mInputSource); // just get the focused node from the selection // XXXndeakin this should actually be the deepest node that contains both @@ -399,7 +395,7 @@ nsBaseDragService::EndDragSession(PRBool aDoneDrag) mImageY = 0; mScreenX = -1; mScreenY = -1; - mInputSource = nsIDOMNSMouseEvent::MOZ_SOURCE_MOUSE; + mInputSource = nsIDOMMouseEvent::MOZ_SOURCE_MOUSE; return NS_OK; } diff --git a/widget/src/xpwidgets/nsBaseDragService.h b/widget/src/xpwidgets/nsBaseDragService.h index 5ee75d933e04..53a7fda9574f 100644 --- a/widget/src/xpwidgets/nsBaseDragService.h +++ b/widget/src/xpwidgets/nsBaseDragService.h @@ -174,7 +174,7 @@ protected: PRUint32 mSuppressLevel; - // The input source of the drag event. Possible values are from nsIDOMNSMouseEvent. + // The input source of the drag event. Possible values are from nsIDOMMouseEvent. PRUint16 mInputSource; };