Bug 920377 part.14 Get rid of nsSimpleGestureEvent r=roc
authorMasayuki Nakano <masayuki@d-toybox.com>
Fri, 27 Sep 2013 15:20:57 +0900
changeset 148958 46cb542ac785b1777452baaaa771f1a08b8642e8
parent 148957 fe2419c32ee75250a3342c08040c462cd5fb2ccc
child 148959 bbdaf3ec9aae2796d5b555bbf9d48b623cb306ce
push id25366
push userkwierso@gmail.com
push dateSat, 28 Sep 2013 02:13:38 +0000
treeherdermozilla-central@e1914e294152 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs920377
milestone27.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 920377 part.14 Get rid of nsSimpleGestureEvent r=roc
content/events/src/nsDOMEvent.cpp
content/events/src/nsDOMSimpleGestureEvent.cpp
content/events/src/nsDOMSimpleGestureEvent.h
content/events/src/nsEventDispatcher.cpp
dom/base/nsDOMWindowUtils.cpp
dom/interfaces/events/nsIDOMEvent.idl
widget/EventForwards.h
widget/TouchEvents.h
widget/android/nsWindow.cpp
widget/cocoa/nsChildView.mm
widget/qt/nsWindow.cpp
widget/windows/nsWinGesture.cpp
widget/windows/nsWinGesture.h
widget/windows/nsWindow.cpp
widget/windows/winrt/MetroInput.cpp
--- a/content/events/src/nsDOMEvent.cpp
+++ b/content/events/src/nsDOMEvent.cpp
@@ -699,20 +699,20 @@ nsDOMEvent::DuplicatePrivateData()
       nsUIEvent* uiEvent = new nsUIEvent(false, msg, 0);
       uiEvent->eventStructType = NS_SMIL_TIME_EVENT;
       uiEvent->AssignUIEventData(*oldUIEvent, true);
       newEvent = uiEvent;
       break;
     }
     case NS_SIMPLE_GESTURE_EVENT:
     {
-      nsSimpleGestureEvent* oldSimpleGestureEvent =
-        static_cast<nsSimpleGestureEvent*>(mEvent);
-      nsSimpleGestureEvent* simpleGestureEvent = 
-        new nsSimpleGestureEvent(false, msg, nullptr, 0, 0.0);
+      WidgetSimpleGestureEvent* oldSimpleGestureEvent =
+        static_cast<WidgetSimpleGestureEvent*>(mEvent);
+      WidgetSimpleGestureEvent* simpleGestureEvent = 
+        new WidgetSimpleGestureEvent(false, msg, nullptr, 0, 0.0);
       simpleGestureEvent->
         AssignSimpleGestureEventData(*oldSimpleGestureEvent, true);
       newEvent = simpleGestureEvent;
       break;
     }
     case NS_TRANSITION_EVENT:
     {
       InternalTransitionEvent* oldTransitionEvent =
--- a/content/events/src/nsDOMSimpleGestureEvent.cpp
+++ b/content/events/src/nsDOMSimpleGestureEvent.cpp
@@ -2,38 +2,42 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsDOMSimpleGestureEvent.h"
 #include "prtime.h"
 #include "mozilla/TouchEvents.h"
 
+using namespace mozilla;
+
 nsDOMSimpleGestureEvent::nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
                                                  nsPresContext* aPresContext,
-                                                 nsSimpleGestureEvent* aEvent)
+                                                 WidgetSimpleGestureEvent* aEvent)
   : nsDOMMouseEvent(aOwner, aPresContext,
-                    aEvent ? aEvent : new nsSimpleGestureEvent(false, 0, nullptr, 0, 0.0))
+                    aEvent ? aEvent :
+                             new WidgetSimpleGestureEvent(false, 0, nullptr,
+                                                          0, 0.0))
 {
   NS_ASSERTION(mEvent->eventStructType == NS_SIMPLE_GESTURE_EVENT, "event type mismatch");
 
   if (aEvent) {
     mEventIsInternal = false;
   } else {
     mEventIsInternal = true;
     mEvent->time = PR_Now();
     mEvent->refPoint.x = mEvent->refPoint.y = 0;
     static_cast<nsMouseEvent*>(mEvent)->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_UNKNOWN;
   }
 }
 
 nsDOMSimpleGestureEvent::~nsDOMSimpleGestureEvent()
 {
   if (mEventIsInternal) {
-    delete static_cast<nsSimpleGestureEvent*>(mEvent);
+    delete static_cast<WidgetSimpleGestureEvent*>(mEvent);
     mEvent = nullptr;
   }
 }
 
 NS_IMPL_ADDREF_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
 NS_IMPL_RELEASE_INHERITED(nsDOMSimpleGestureEvent, nsDOMUIEvent)
 
 NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestureEvent)
@@ -41,24 +45,24 @@ NS_INTERFACE_MAP_BEGIN(nsDOMSimpleGestur
 NS_INTERFACE_MAP_END_INHERITING(nsDOMMouseEvent)
 
 /* attribute unsigned long allowedDirections; */
 NS_IMETHODIMP
 nsDOMSimpleGestureEvent::GetAllowedDirections(uint32_t *aAllowedDirections)
 {
   NS_ENSURE_ARG_POINTER(aAllowedDirections);
   *aAllowedDirections =
-    static_cast<nsSimpleGestureEvent*>(mEvent)->allowedDirections;
+    static_cast<WidgetSimpleGestureEvent*>(mEvent)->allowedDirections;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMSimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
 {
-  static_cast<nsSimpleGestureEvent*>(mEvent)->allowedDirections =
+  static_cast<WidgetSimpleGestureEvent*>(mEvent)->allowedDirections =
     aAllowedDirections;
   return NS_OK;
 }
 
 /* readonly attribute unsigned long direction; */
 NS_IMETHODIMP
 nsDOMSimpleGestureEvent::GetDirection(uint32_t *aDirection)
 {
@@ -118,26 +122,27 @@ nsDOMSimpleGestureEvent::InitSimpleGestu
                                                 aCtrlKeyArg,
                                                 aAltKeyArg,
                                                 aShiftKeyArg,
                                                 aMetaKeyArg,
                                                 aButton,
                                                 aRelatedTarget);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  nsSimpleGestureEvent* simpleGestureEvent = static_cast<nsSimpleGestureEvent*>(mEvent);
+  WidgetSimpleGestureEvent* simpleGestureEvent =
+    static_cast<WidgetSimpleGestureEvent*>(mEvent);
   simpleGestureEvent->allowedDirections = aAllowedDirectionsArg;
   simpleGestureEvent->direction = aDirectionArg;
   simpleGestureEvent->delta = aDeltaArg;
   simpleGestureEvent->clickCount = aClickCountArg;
 
   return NS_OK;
 }
 
 nsresult NS_NewDOMSimpleGestureEvent(nsIDOMEvent** aInstancePtrResult,
                                      mozilla::dom::EventTarget* aOwner,
                                      nsPresContext* aPresContext,
-                                     nsSimpleGestureEvent *aEvent)
+                                     WidgetSimpleGestureEvent* aEvent)
 {
   nsDOMSimpleGestureEvent* it =
     new nsDOMSimpleGestureEvent(aOwner, aPresContext, aEvent);
   return CallQueryInterface(it, aInstancePtrResult);
 }
--- a/content/events/src/nsDOMSimpleGestureEvent.h
+++ b/content/events/src/nsDOMSimpleGestureEvent.h
@@ -12,17 +12,17 @@
 
 class nsPresContext;
 
 class nsDOMSimpleGestureEvent : public nsDOMMouseEvent,
                                 public nsIDOMSimpleGestureEvent
 {
 public:
   nsDOMSimpleGestureEvent(mozilla::dom::EventTarget* aOwner,
-                          nsPresContext*, nsSimpleGestureEvent*);
+                          nsPresContext*, mozilla::WidgetSimpleGestureEvent*);
   virtual ~nsDOMSimpleGestureEvent();
 
   NS_DECL_ISUPPORTS_INHERITED
 
   NS_DECL_NSIDOMSIMPLEGESTUREEVENT
 
   // Forward to base class
   NS_FORWARD_TO_NSDOMMOUSEEVENT
@@ -30,32 +30,33 @@ public:
   virtual JSObject* WrapObject(JSContext* aCx,
 			       JS::Handle<JSObject*> aScope) MOZ_OVERRIDE
   {
     return mozilla::dom::SimpleGestureEventBinding::Wrap(aCx, aScope, this);
   }
 
   uint32_t AllowedDirections()
   {
-    return static_cast<nsSimpleGestureEvent*>(mEvent)->allowedDirections;
+    return static_cast<mozilla::WidgetSimpleGestureEvent*>(mEvent)->
+             allowedDirections;
   }
 
   uint32_t Direction()
   {
-    return static_cast<nsSimpleGestureEvent*>(mEvent)->direction;
+    return static_cast<mozilla::WidgetSimpleGestureEvent*>(mEvent)->direction;
   }
 
   double Delta()
   {
-    return static_cast<nsSimpleGestureEvent*>(mEvent)->delta;
+    return static_cast<mozilla::WidgetSimpleGestureEvent*>(mEvent)->delta;
   }
 
   uint32_t ClickCount()
   {
-    return static_cast<nsSimpleGestureEvent*>(mEvent)->clickCount;
+    return static_cast<mozilla::WidgetSimpleGestureEvent*>(mEvent)->clickCount;
   }
 
   void InitSimpleGestureEvent(const nsAString& aType,
                               bool aCanBubble,
                               bool aCancelable,
                               nsIDOMWindow* aView,
                               int32_t aDetail,
                               int32_t aScreenX,
--- a/content/events/src/nsEventDispatcher.cpp
+++ b/content/events/src/nsEventDispatcher.cpp
@@ -733,17 +733,17 @@ nsEventDispatcher::CreateEvent(mozilla::
     case NS_SMIL_TIME_EVENT:
       return NS_NewDOMTimeEvent(aDOMEvent, aOwner, aPresContext, aEvent);
 
     case NS_COMMAND_EVENT:
       return NS_NewDOMCommandEvent(aDOMEvent, aOwner, aPresContext,
                                    static_cast<WidgetCommandEvent*>(aEvent));
     case NS_SIMPLE_GESTURE_EVENT:
       return NS_NewDOMSimpleGestureEvent(aDOMEvent, aOwner, aPresContext,
-                                         static_cast<nsSimpleGestureEvent*>(aEvent));
+               static_cast<WidgetSimpleGestureEvent*>(aEvent));
     case NS_TOUCH_EVENT:
       return NS_NewDOMTouchEvent(aDOMEvent, aOwner, aPresContext,
                                  static_cast<WidgetTouchEvent*>(aEvent));
     case NS_TRANSITION_EVENT:
       return NS_NewDOMTransitionEvent(aDOMEvent, aOwner, aPresContext,
                static_cast<InternalTransitionEvent*>(aEvent));
     case NS_ANIMATION_EVENT:
       return NS_NewDOMAnimationEvent(aDOMEvent, aOwner, aPresContext,
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1258,17 +1258,17 @@ nsDOMWindowUtils::SendSimpleGestureEvent
     msg = NS_SIMPLE_GESTURE_EDGE_STARTED;
   else if (aType.EqualsLiteral("MozEdgeUICanceled"))
     msg = NS_SIMPLE_GESTURE_EDGE_CANCELED;
   else if (aType.EqualsLiteral("MozEdgeUICompleted"))
     msg = NS_SIMPLE_GESTURE_EDGE_COMPLETED;
   else
     return NS_ERROR_FAILURE;
  
-  nsSimpleGestureEvent event(true, msg, widget, aDirection, aDelta);
+  WidgetSimpleGestureEvent event(true, msg, widget, aDirection, aDelta);
   event.modifiers = GetWidgetModifiers(aModifiers);
   event.clickCount = aClickCount;
   event.time = PR_IntervalNow();
 
   nsPresContext* presContext = GetPresContext();
   if (!presContext)
     return NS_ERROR_FAILURE;
 
--- a/dom/interfaces/events/nsIDOMEvent.idl
+++ b/dom/interfaces/events/nsIDOMEvent.idl
@@ -350,17 +350,17 @@ NS_NewDOMAudioAvailableEvent(nsIDOMEvent
                              uint32_t aEventType = 0,
                              float* aFrameBuffer = nullptr,
                              uint32_t aFrameBufferLength = 0,
                              float aTime = 0);
 nsresult
 NS_NewDOMSimpleGestureEvent(nsIDOMEvent** aInstancePtrResult,
                             mozilla::dom::EventTarget* aOwner,
                             nsPresContext* aPresContext,
-                            nsSimpleGestureEvent* aEvent);
+                            mozilla::WidgetSimpleGestureEvent* aEvent);
 nsresult
 NS_NewDOMScrollAreaEvent(nsIDOMEvent** aInstancePtrResult,
                          mozilla::dom::EventTarget* aOwner,
                          nsPresContext* aPresContext,
                          mozilla::InternalScrollAreaEvent* aEvent);
 nsresult
 NS_NewDOMTransitionEvent(nsIDOMEvent** aInstancePtrResult,
                          mozilla::dom::EventTarget* aOwner,
--- a/widget/EventForwards.h
+++ b/widget/EventForwards.h
@@ -121,11 +121,10 @@ typedef mozilla::WidgetMouseEvent       
 typedef mozilla::WidgetDragEvent           nsDragEvent;
 typedef mozilla::WidgetMouseScrollEvent    nsMouseScrollEvent;
 
 namespace mozilla {
 typedef WidgetWheelEvent                   WheelEvent;
 }
 
 typedef mozilla::WidgetGestureNotifyEvent  nsGestureNotifyEvent;
-typedef mozilla::WidgetSimpleGestureEvent  nsSimpleGestureEvent;
 
 #endif // mozilla_EventForwards_h__
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -71,17 +71,17 @@ public:
                            nsIWidget* aWidget, uint32_t aDirection,
                            double aDelta) :
     WidgetMouseEventBase(aIsTrusted, aMessage, aWidget,
                          NS_SIMPLE_GESTURE_EVENT),
     allowedDirections(0), direction(aDirection), delta(aDelta), clickCount(0)
   {
   }
 
-  WidgetSimpleGestureEvent(const nsSimpleGestureEvent& aOther) :
+  WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther) :
     WidgetMouseEventBase(aOther.mFlags.mIsTrusted,
                          aOther.message, aOther.widget,
                          NS_SIMPLE_GESTURE_EVENT),
     allowedDirections(aOther.allowedDirections), direction(aOther.direction),
     delta(aOther.delta), clickCount(0)
   {
   }
 
@@ -148,11 +148,10 @@ public:
     // Currently, we don't need to copy touches.
   }
 };
 
 } // namespace mozilla
 
 // TODO: Remove following typedefs
 typedef mozilla::WidgetGestureNotifyEvent nsGestureNotifyEvent;
-typedef mozilla::WidgetSimpleGestureEvent nsSimpleGestureEvent;
 
 #endif // mozilla_TouchEvents_h__
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -1298,17 +1298,17 @@ nsWindow::OnNativeGestureEvent(AndroidGe
   nsRefPtr<nsWindow> kungFuDeathGrip(this);
   DispatchGestureEvent(msg, 0, delta, pt, ae->Time());
 }
 
 void
 nsWindow::DispatchGestureEvent(uint32_t msg, uint32_t direction, double delta,
                                const nsIntPoint &refPoint, uint64_t time)
 {
-    nsSimpleGestureEvent event(true, msg, this, direction, delta);
+    WidgetSimpleGestureEvent event(true, msg, this, direction, delta);
 
     event.modifiers = 0;
     event.time = time;
     event.refPoint = LayoutDeviceIntPoint::FromUntyped(refPoint);
 
     DispatchEvent(&event);
 }
 
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -3838,17 +3838,18 @@ NSEvent* gLastDragMouseDownEvent = nil;
     return;
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
   float deltaX = [anEvent deltaX];  // left=1.0, right=-1.0
   float deltaY = [anEvent deltaY];  // up=1.0, down=-1.0
 
   // Setup the "swipe" event.
-  nsSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_SWIPE, mGeckoChild, 0, 0.0);
+  WidgetSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_SWIPE,
+                                      mGeckoChild, 0, 0.0);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
 
   // Record the left/right direction.
   if (deltaX > 0.0)
     geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
   else if (deltaX < 0.0)
     geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
 
@@ -3907,17 +3908,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   case eGestureState_None:
   case eGestureState_RotateGesture:
   default:
     return;
   }
 
   // Setup the event.
-  nsSimpleGestureEvent geckoEvent(true, msg, mGeckoChild, 0, deltaZ);
+  WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild, 0, deltaZ);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
 
   // Send the event.
   mGeckoChild->DispatchWindowEvent(geckoEvent);
 
   // Keep track of the cumulative magnification for the final "magnify" event.
   mCumulativeMagnification += deltaZ;
   
@@ -3930,18 +3931,18 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   if (!anEvent || !mGeckoChild) {
     return;
   }
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
   // Setup the "double tap" event.
-  nsSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_TAP,
-                                  mGeckoChild, 0, 0.0);
+  WidgetSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_TAP,
+                                      mGeckoChild, 0, 0.0);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
   geckoEvent.clickCount = 1;
 
   // Send the event.
   mGeckoChild->DispatchWindowEvent(geckoEvent);
 
   // Clear the gesture state
   mGestureState = eGestureState_None;
@@ -3973,17 +3974,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   case eGestureState_None:
   case eGestureState_MagnifyGesture:
   default:
     return;
   }
 
   // Setup the event.
-  nsSimpleGestureEvent geckoEvent(true, msg, mGeckoChild, 0, 0.0);
+  WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild, 0, 0.0);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
   geckoEvent.delta = -rotation;
   if (rotation > 0.0) {
     geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
   } else {
     geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
   }
 
@@ -4009,29 +4010,31 @@ NSEvent* gLastDragMouseDownEvent = nil;
   }
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
   switch (mGestureState) {
   case eGestureState_MagnifyGesture:
     {
       // Setup the "magnify" event.
-      nsSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_MAGNIFY,
-                                      mGeckoChild, 0, mCumulativeMagnification);
+      WidgetSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_MAGNIFY,
+                                          mGeckoChild, 0,
+                                          mCumulativeMagnification);
       [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
 
       // Send the event.
       mGeckoChild->DispatchWindowEvent(geckoEvent);
     }
     break;
 
   case eGestureState_RotateGesture:
     {
       // Setup the "rotate" event.
-      nsSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_ROTATE, mGeckoChild, 0, 0.0);
+      WidgetSimpleGestureEvent geckoEvent(true, NS_SIMPLE_GESTURE_ROTATE,
+                                          mGeckoChild, 0, 0.0);
       [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
       geckoEvent.delta = -mCumulativeRotation;
       if (mCumulativeRotation > 0.0) {
         geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
       } else {
         geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
       }
 
@@ -4075,17 +4078,18 @@ NSEvent* gLastDragMouseDownEvent = nil;
                 withKind:(uint32_t)aMsg
        allowedDirections:(uint32_t*)aAllowedDirections
                direction:(uint32_t)aDirection
                    delta:(double)aDelta
 {
   if (!mGeckoChild)
     return false;
 
-  nsSimpleGestureEvent geckoEvent(true, aMsg, mGeckoChild, aDirection, aDelta);
+  WidgetSimpleGestureEvent geckoEvent(true, aMsg, mGeckoChild,
+                                      aDirection, aDelta);
   geckoEvent.allowedDirections = *aAllowedDirections;
   [self convertCocoaMouseEvent:aEvent toGeckoEvent:&geckoEvent];
   bool eventCancelled = mGeckoChild->DispatchWindowEvent(geckoEvent);
   *aAllowedDirections = geckoEvent.allowedDirections;
   return eventCancelled; // event cancelled == swipe should start
 }
 
 - (void)sendSwipeEndEvent:(NSEvent *)anEvent
--- a/widget/qt/nsWindow.cpp
+++ b/widget/qt/nsWindow.cpp
@@ -2072,17 +2072,17 @@ nsWindow::OnGestureEvent(QGestureEvent* 
 
     return result;
 }
 
 nsEventStatus
 nsWindow::DispatchGestureEvent(uint32_t aMsg, uint32_t aDirection,
                                double aDelta, const nsIntPoint& aRefPoint)
 {
-    nsSimpleGestureEvent mozGesture(true, aMsg, this, 0, 0.0);
+    WidgetSimpleGestureEvent mozGesture(true, aMsg, this, 0, 0.0);
     mozGesture.direction = aDirection;
     mozGesture.delta = aDelta;
     mozGesture.refPoint = LayoutDeviceIntPoint::FromUntyped(aRefPoint);
 
     Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
 
     mozGesture.InitBasicModifiers(modifiers & Qt::ControlModifier,
                                   modifiers & Qt::AltModifier,
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -292,17 +292,18 @@ bool nsWinGesture::IsPanEvent(LPARAM lPa
     return true;
 
   return false;
 }
 
 /* Gesture event processing */
 
 bool
-nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, nsSimpleGestureEvent& evt)
+nsWinGesture::ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam,
+                                    WidgetSimpleGestureEvent& evt)
 {
   GESTUREINFO gi;
 
   ZeroMemory(&gi,sizeof(GESTUREINFO));
   gi.cbSize = sizeof(GESTUREINFO);
 
   BOOL result = GetGestureInfo((HGESTUREINFO)lParam, &gi);
   if (!result)
--- a/widget/windows/nsWinGesture.h
+++ b/widget/windows/nsWinGesture.h
@@ -202,17 +202,17 @@ public:
   bool ShutdownWinGestureSupport();
   bool RegisterTouchWindow(HWND hWnd);
   bool UnregisterTouchWindow(HWND hWnd);
   bool GetTouchInputInfo(HTOUCHINPUT hTouchInput, uint32_t cInputs, PTOUCHINPUT pInputs);
   bool CloseTouchInputHandle(HTOUCHINPUT hTouchInput);
   bool IsAvailable();
   
   // Simple gesture process
-  bool ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, nsSimpleGestureEvent& evt);
+  bool ProcessGestureMessage(HWND hWnd, WPARAM wParam, LPARAM lParam, mozilla::WidgetSimpleGestureEvent& evt);
 
   // Pan processing
   bool IsPanEvent(LPARAM lParam);
   bool ProcessPanMessage(HWND hWnd, WPARAM wParam, LPARAM lParam);
   bool PanDeltaToPixelScroll(mozilla::WheelEvent& aWheelEvent);
   void UpdatePanFeedbackX(HWND hWnd, int32_t scrollOverflow, bool& endFeedback);
   void UpdatePanFeedbackY(HWND hWnd, int32_t scrollOverflow, bool& endFeedback);
   void PanFeedbackFinalize(HWND hWnd, bool endFeedback);
--- a/widget/windows/nsWindow.cpp
+++ b/widget/windows/nsWindow.cpp
@@ -6206,17 +6206,17 @@ bool nsWindow::OnGesture(WPARAM wParam, 
     }
 
     mGesture.CloseGestureInfoHandle((HGESTUREINFO)lParam);
 
     return true;
   }
 
   // Other gestures translate into simple gesture events:
-  nsSimpleGestureEvent event(true, 0, this, 0, 0.0);
+  WidgetSimpleGestureEvent event(true, 0, this, 0, 0.0);
   if ( !mGesture.ProcessGestureMessage(mWnd, wParam, lParam, event) ) {
     return false; // fall through to DefWndProc
   }
   
   // Polish up and send off the new event
   ModifierKeyState modifierKeyState;
   modifierKeyState.InitInputEvent(event);
   event.button    = 0;
--- a/widget/windows/winrt/MetroInput.cpp
+++ b/widget/windows/winrt/MetroInput.cpp
@@ -250,21 +250,21 @@ MetroInput::~MetroInput()
  */
 HRESULT
 MetroInput::OnEdgeGestureStarted(UI::Input::IEdgeGesture* sender,
                                  UI::Input::IEdgeGestureEventArgs* aArgs)
 {
 #ifdef DEBUG_INPUT
   LogFunction();
 #endif
-  nsSimpleGestureEvent geckoEvent(true,
-                                  NS_SIMPLE_GESTURE_EDGE_STARTED,
-                                  mWidget.Get(),
-                                  0,
-                                  0.0);
+  WidgetSimpleGestureEvent geckoEvent(true,
+                                      NS_SIMPLE_GESTURE_EDGE_STARTED,
+                                      mWidget.Get(),
+                                      0,
+                                      0.0);
   mModifierKeyState.Update();
   mModifierKeyState.InitInputEvent(geckoEvent);
   geckoEvent.time = ::GetMessageTime();
 
   geckoEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
 
   // Safe
   DispatchEventIgnoreStatus(&geckoEvent);
@@ -282,21 +282,21 @@ MetroInput::OnEdgeGestureStarted(UI::Inp
  */
 HRESULT
 MetroInput::OnEdgeGestureCanceled(UI::Input::IEdgeGesture* sender,
                                   UI::Input::IEdgeGestureEventArgs* aArgs)
 {
 #ifdef DEBUG_INPUT
   LogFunction();
 #endif
-  nsSimpleGestureEvent geckoEvent(true,
-                                  NS_SIMPLE_GESTURE_EDGE_CANCELED,
-                                  mWidget.Get(),
-                                  0,
-                                  0.0);
+  WidgetSimpleGestureEvent geckoEvent(true,
+                                      NS_SIMPLE_GESTURE_EDGE_CANCELED,
+                                      mWidget.Get(),
+                                      0,
+                                      0.0);
   mModifierKeyState.Update();
   mModifierKeyState.InitInputEvent(geckoEvent);
   geckoEvent.time = ::GetMessageTime();
 
   geckoEvent.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
 
   // Safe
   DispatchEventIgnoreStatus(&geckoEvent);
@@ -313,21 +313,21 @@ MetroInput::OnEdgeGestureCanceled(UI::In
  */
 HRESULT
 MetroInput::OnEdgeGestureCompleted(UI::Input::IEdgeGesture* sender,
                                    UI::Input::IEdgeGestureEventArgs* aArgs)
 {
 #ifdef DEBUG_INPUT
   LogFunction();
 #endif
-  nsSimpleGestureEvent geckoEvent(true,
-                                  NS_SIMPLE_GESTURE_EDGE_COMPLETED,
-                                  mWidget.Get(),
-                                  0,
-                                  0.0);
+  WidgetSimpleGestureEvent geckoEvent(true,
+                                      NS_SIMPLE_GESTURE_EDGE_COMPLETED,
+                                      mWidget.Get(),
+                                      0,
+                                      0.0);
   mModifierKeyState.Update();
   mModifierKeyState.InitInputEvent(geckoEvent);
   geckoEvent.time = ::GetMessageTime();
 
   UI::Input::EdgeGestureKind value;
   aArgs->get_Kind(&value);
 
   if (value == UI::Input::EdgeGestureKind::EdgeGestureKind_Keyboard) {
@@ -816,27 +816,27 @@ MetroInput::ProcessManipulationDelta(
   if ((aDelta.Translation.X != 0.0f
     || aDelta.Translation.Y != 0.0f)
    && (aDelta.Rotation == 0.0f
     && aDelta.Expansion == 0.0f)) {
     return;
   }
 
   // Send a gecko event indicating the magnification since the last update.
-  nsSimpleGestureEvent* magEvent =
-    new nsSimpleGestureEvent(true, aMagEventType, mWidget.Get(), 0, 0.0);
+  WidgetSimpleGestureEvent* magEvent =
+    new WidgetSimpleGestureEvent(true, aMagEventType, mWidget.Get(), 0, 0.0);
 
   magEvent->delta = aDelta.Expansion;
   magEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
   magEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(MetroUtils::LogToPhys(aPosition));
   DispatchAsyncEventIgnoreStatus(magEvent);
 
   // Send a gecko event indicating the rotation since the last update.
-  nsSimpleGestureEvent* rotEvent =
-    new nsSimpleGestureEvent(true, aRotEventType, mWidget.Get(), 0, 0.0);
+  WidgetSimpleGestureEvent* rotEvent =
+    new WidgetSimpleGestureEvent(true, aRotEventType, mWidget.Get(), 0, 0.0);
 
   rotEvent->delta = aDelta.Rotation;
   rotEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
   rotEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(MetroUtils::LogToPhys(aPosition));
   if (rotEvent->delta >= 0) {
     rotEvent->direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
   } else {
     rotEvent->direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
@@ -956,32 +956,32 @@ MetroInput::OnManipulationCompleted(
   // If our thresholds were exceeded for both a vertical and a horizontal
   // swipe, it means the user is flinging her/his finger around and we
   // should just ignore the input.
   if (isHorizontalSwipe && isVerticalSwipe) {
     return S_OK;
   }
 
   if (isHorizontalSwipe) {
-    nsSimpleGestureEvent* swipeEvent =
-      new nsSimpleGestureEvent(true, NS_SIMPLE_GESTURE_SWIPE,
-                               mWidget.Get(), 0, 0.0);
+    WidgetSimpleGestureEvent* swipeEvent =
+      new WidgetSimpleGestureEvent(true, NS_SIMPLE_GESTURE_SWIPE,
+                                   mWidget.Get(), 0, 0.0);
     swipeEvent->direction = delta.Translation.X > 0
                          ? nsIDOMSimpleGestureEvent::DIRECTION_RIGHT
                          : nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
     swipeEvent->delta = delta.Translation.X;
     swipeEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
     swipeEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(MetroUtils::LogToPhys(position));
     DispatchAsyncEventIgnoreStatus(swipeEvent);
   }
 
   if (isVerticalSwipe) {
-    nsSimpleGestureEvent* swipeEvent =
-      new nsSimpleGestureEvent(true, NS_SIMPLE_GESTURE_SWIPE,
-                               mWidget.Get(), 0, 0.0);
+    WidgetSimpleGestureEvent* swipeEvent =
+      new WidgetSimpleGestureEvent(true, NS_SIMPLE_GESTURE_SWIPE,
+                                   mWidget.Get(), 0, 0.0);
     swipeEvent->direction = delta.Translation.Y > 0
                          ? nsIDOMSimpleGestureEvent::DIRECTION_DOWN
                          : nsIDOMSimpleGestureEvent::DIRECTION_UP;
     swipeEvent->delta = delta.Translation.Y;
     swipeEvent->inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
     swipeEvent->refPoint = LayoutDeviceIntPoint::FromUntyped(MetroUtils::LogToPhys(position));
     DispatchAsyncEventIgnoreStatus(swipeEvent);
   }