Bug 1259667 - part5: rename WidgetSimpleGestureEvent.delta to mDelta. r=masayuki
authorTetsuharu OHZEKI <saneyuki.snyk@gmail.com>
Tue, 10 May 2016 04:16:55 +0900
changeset 335738 a1f793376c1c2ba5a9e5b5267f21ee4e0206b48e
parent 335737 6ba2b4f6275704916269fbfe72b8c39dc731494e
child 335739 9b6254d5c31524b7acbad7662c2ec656c3315952
push id6249
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 13:59:36 +0000
treeherdermozilla-beta@bad9d4f5bf7e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmasayuki
bugs1259667
milestone49.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 1259667 - part5: rename WidgetSimpleGestureEvent.delta to mDelta. r=masayuki MozReview-Commit-ID: D33mzFY8Vrn
dom/base/nsDOMWindowUtils.cpp
dom/events/SimpleGestureEvent.cpp
widget/TouchEvents.h
widget/android/nsWindow.cpp
widget/cocoa/SwipeTracker.mm
widget/cocoa/nsChildView.mm
widget/windows/nsWinGesture.cpp
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1291,17 +1291,17 @@ nsDOMWindowUtils::SendSimpleGestureEvent
     msg = eEdgeUICompleted;
   } else {
     return NS_ERROR_FAILURE;
   }
 
   WidgetSimpleGestureEvent event(true, msg, widget);
   event.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
   event.mDirection = aDirection;
-  event.delta = aDelta;
+  event.mDelta = aDelta;
   event.mClickCount = aClickCount;
   event.mTime = PR_IntervalNow();
 
   nsPresContext* presContext = GetPresContext();
   if (!presContext)
     return NS_ERROR_FAILURE;
 
   event.mRefPoint =
--- a/dom/events/SimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.cpp
@@ -73,17 +73,17 @@ SimpleGestureEvent::GetDirection(uint32_
   NS_ENSURE_ARG_POINTER(aDirection);
   *aDirection = Direction();
   return NS_OK;
 }
 
 double
 SimpleGestureEvent::Delta()
 {
-  return mEvent->AsSimpleGestureEvent()->delta;
+  return mEvent->AsSimpleGestureEvent()->mDelta;
 }
 
 NS_IMETHODIMP
 SimpleGestureEvent::GetDelta(double* aDelta)
 {
   NS_ENSURE_ARG_POINTER(aDelta);
   *aDelta = Delta();
   return NS_OK;
@@ -128,17 +128,17 @@ SimpleGestureEvent::InitSimpleGestureEve
                              aViewArg, aDetailArg,
                              aScreenX, aScreenY, aClientX, aClientY,
                              aCtrlKeyArg, aAltKeyArg, aShiftKeyArg,
                              aMetaKeyArg, aButton, aRelatedTarget);
 
   WidgetSimpleGestureEvent* simpleGestureEvent = mEvent->AsSimpleGestureEvent();
   simpleGestureEvent->mAllowedDirections = aAllowedDirectionsArg;
   simpleGestureEvent->mDirection = aDirectionArg;
-  simpleGestureEvent->delta = aDeltaArg;
+  simpleGestureEvent->mDelta = aDeltaArg;
   simpleGestureEvent->mClickCount = aClickCountArg;
 }
 
 } // namespace dom
 } // namespace mozilla
 
 using namespace mozilla;
 using namespace mozilla::dom;
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -96,27 +96,27 @@ public:
 
   WidgetSimpleGestureEvent(bool aIsTrusted, EventMessage aMessage,
                            nsIWidget* aWidget)
     : WidgetMouseEventBase(aIsTrusted, aMessage, aWidget,
                            eSimpleGestureEventClass)
     , mAllowedDirections(0)
     , mDirection(0)
     , mClickCount(0)
-    , delta(0.0)
+    , mDelta(0.0)
   {
   }
 
   WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther)
     : WidgetMouseEventBase(aOther.IsTrusted(), aOther.mMessage,
                            aOther.mWidget, eSimpleGestureEventClass)
     , mAllowedDirections(aOther.mAllowedDirections)
     , mDirection(aOther.mDirection)
     , mClickCount(0)
-    , delta(aOther.delta)
+    , mDelta(aOther.mDelta)
   {
   }
 
   virtual WidgetEvent* Duplicate() const override
   {
     MOZ_ASSERT(mClass == eSimpleGestureEventClass,
                "Duplicate() must be overridden by sub class");
     // Not copying widget, it is a weak reference.
@@ -129,27 +129,27 @@ public:
 
   // See nsIDOMSimpleGestureEvent for values
   uint32_t mAllowedDirections;
   // See nsIDOMSimpleGestureEvent for values
   uint32_t mDirection;
   // The number of taps for tap events
   uint32_t mClickCount;
   // Delta for magnify and rotate events
-  double delta;
+  double mDelta;
 
   // XXX Not tested by test_assign_event_data.html
   void AssignSimpleGestureEventData(const WidgetSimpleGestureEvent& aEvent,
                                     bool aCopyTargets)
   {
     AssignMouseEventBaseData(aEvent, aCopyTargets);
 
     // mAllowedDirections isn't copied
     mDirection = aEvent.mDirection;
-    delta = aEvent.delta;
+    mDelta = aEvent.mDelta;
     mClickCount = aEvent.mClickCount;
   }
 };
 
 /******************************************************************************
  * mozilla::WidgetTouchEvent
  ******************************************************************************/
 
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2136,17 +2136,17 @@ nsWindow::OnNativeGestureEvent(AndroidGe
             return;
     }
 
     RefPtr<nsWindow> kungFuDeathGrip(this);
 
     WidgetSimpleGestureEvent event(true, msg, this);
 
     event.mDirection = 0;
-    event.delta = delta;
+    event.mDelta = delta;
     event.mModifiers = 0;
     event.mTime = ae->Time();
     event.mRefPoint = pt;
 
     DispatchEvent(&event);
 }
 
 
--- a/widget/cocoa/SwipeTracker.mm
+++ b/widget/cocoa/SwipeTracker.mm
@@ -207,14 +207,14 @@ SwipeTracker::CreateSwipeGestureEvent(Ev
 }
 
 bool
 SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection, double aDelta)
 {
   WidgetSimpleGestureEvent geckoEvent =
     CreateSwipeGestureEvent(aMsg, &mWidget, mEventPosition);
   geckoEvent.mDirection = aDirection;
-  geckoEvent.delta = aDelta;
+  geckoEvent.mDelta = aDelta;
   geckoEvent.mAllowedDirections = mAllowedDirections;
   return mWidget.DispatchWindowEvent(geckoEvent);
 }
 
 } // namespace mozilla
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2573,17 +2573,17 @@ nsChildView::SendMayStartSwipe(const moz
   // time ask it if it really wants to start an animation for this event.
   // This event also reports back the directions that we can swipe in.
   LayoutDeviceIntPoint position =
     RoundedToInt(aSwipeStartEvent.mPanStartPoint * ScreenToLayoutDeviceScale(1));
   WidgetSimpleGestureEvent geckoEvent =
     SwipeTracker::CreateSwipeGestureEvent(eSwipeGestureMayStart, this,
                                           position);
   geckoEvent.mDirection = direction;
-  geckoEvent.delta = 0.0;
+  geckoEvent.mDelta = 0.0;
   geckoEvent.mAllowedDirections = 0;
   bool shouldStartSwipe = DispatchWindowEvent(geckoEvent); // event cancelled == swipe should start
 
   SwipeInfo result = { shouldStartSwipe, geckoEvent.mAllowedDirections };
   return result;
 }
 
 void
@@ -4248,17 +4248,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
   case eGestureState_None:
   case eGestureState_RotateGesture:
   default:
     return;
   }
 
   // Setup the event.
   WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild);
-  geckoEvent.delta = deltaZ;
+  geckoEvent.mDelta = 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;
 
@@ -4315,17 +4315,17 @@ NSEvent* gLastDragMouseDownEvent = nil;
   case eGestureState_MagnifyGesture:
   default:
     return;
   }
 
   // Setup the event.
   WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild);
   [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
-  geckoEvent.delta = -rotation;
+  geckoEvent.mDelta = -rotation;
   if (rotation > 0.0) {
     geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
   } else {
     geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
   }
 
   // Send the event.
   mGeckoChild->DispatchWindowEvent(geckoEvent);
@@ -4350,30 +4350,30 @@ NSEvent* gLastDragMouseDownEvent = nil;
 
   nsAutoRetainCocoaObject kungFuDeathGrip(self);
 
   switch (mGestureState) {
   case eGestureState_MagnifyGesture:
     {
       // Setup the "magnify" event.
       WidgetSimpleGestureEvent geckoEvent(true, eMagnifyGesture, mGeckoChild);
-      geckoEvent.delta = mCumulativeMagnification;
+      geckoEvent.mDelta = mCumulativeMagnification;
       [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
 
       // Send the event.
       mGeckoChild->DispatchWindowEvent(geckoEvent);
     }
     break;
 
   case eGestureState_RotateGesture:
     {
       // Setup the "rotate" event.
       WidgetSimpleGestureEvent geckoEvent(true, eRotateGesture, mGeckoChild);
       [self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
-      geckoEvent.delta = -mCumulativeRotation;
+      geckoEvent.mDelta = -mCumulativeRotation;
       if (mCumulativeRotation > 0.0) {
         geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
       } else {
         geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
       }
 
       // Send the event.
       mGeckoChild->DispatchWindowEvent(geckoEvent);
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -330,32 +330,32 @@ nsWinGesture::ProcessGestureMessage(HWND
     {
       if (gi.dwFlags & GF_BEGIN) {
         // Send a zoom start event
 
         // The low 32 bits are the distance in pixels.
         mZoomIntermediate = (float)gi.ullArguments;
 
         evt.mMessage = eMagnifyGestureStart;
-        evt.delta = 0.0;
+        evt.mDelta = 0.0;
       }
       else if (gi.dwFlags & GF_END) {
         // Send a zoom end event, the delta is the change
         // in touch points.
         evt.mMessage = eMagnifyGesture;
         // (positive for a "zoom in")
-        evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
+        evt.mDelta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
         mZoomIntermediate = (float)gi.ullArguments;
       }
       else {
         // Send a zoom intermediate event, the delta is the change
         // in touch points.
         evt.mMessage = eMagnifyGestureUpdate;
         // (positive for a "zoom in")
-        evt.delta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
+        evt.mDelta = -1.0 * (mZoomIntermediate - (float)gi.ullArguments);
         mZoomIntermediate = (float)gi.ullArguments;
       }
     }
     break;
 
     case GID_ROTATE:
     {
       // Send a rotate start event
@@ -371,22 +371,22 @@ nsWinGesture::ProcessGestureMessage(HWND
 
       if (gi.dwFlags & GF_BEGIN) {
           // At some point we should pass the initial angle in
           // along with delta. It's useful.
           degrees = mRotateIntermediate = 0.0;
       }
 
       evt.mDirection = 0;
-      evt.delta = degrees - mRotateIntermediate;
+      evt.mDelta = degrees - mRotateIntermediate;
       mRotateIntermediate = degrees;
 
-      if (evt.delta > 0)
+      if (evt.mDelta > 0)
         evt.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
-      else if (evt.delta < 0)
+      else if (evt.mDelta < 0)
         evt.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
 
       if (gi.dwFlags & GF_BEGIN) {
         evt.mMessage = eRotateGestureStart;
       } else if (gi.dwFlags & GF_END) {
         evt.mMessage = eRotateGesture;
       } else {
         evt.mMessage = eRotateGestureUpdate;