Bug 1259667 - part3: rename WidgetSimpleGestureEvent.direction to mDirection. r?masayuki
MozReview-Commit-ID: GYGNNTsZNWQ
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -1290,17 +1290,17 @@ nsDOMWindowUtils::SendSimpleGestureEvent
} else if (aType.EqualsLiteral("MozEdgeUICompleted")) {
msg = eEdgeUICompleted;
} else {
return NS_ERROR_FAILURE;
}
WidgetSimpleGestureEvent event(true, msg, widget);
event.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
- event.direction = aDirection;
+ event.mDirection = aDirection;
event.delta = aDelta;
event.clickCount = aClickCount;
event.mTime = PR_IntervalNow();
nsPresContext* presContext = GetPresContext();
if (!presContext)
return NS_ERROR_FAILURE;
--- a/dom/events/SimpleGestureEvent.cpp
+++ b/dom/events/SimpleGestureEvent.cpp
@@ -59,17 +59,17 @@ SimpleGestureEvent::SetAllowedDirections
{
mEvent->AsSimpleGestureEvent()->mAllowedDirections = aAllowedDirections;
return NS_OK;
}
uint32_t
SimpleGestureEvent::Direction()
{
- return mEvent->AsSimpleGestureEvent()->direction;
+ return mEvent->AsSimpleGestureEvent()->mDirection;
}
NS_IMETHODIMP
SimpleGestureEvent::GetDirection(uint32_t* aDirection)
{
NS_ENSURE_ARG_POINTER(aDirection);
*aDirection = Direction();
return NS_OK;
@@ -127,17 +127,17 @@ SimpleGestureEvent::InitSimpleGestureEve
MouseEvent::InitMouseEvent(aTypeArg, aCanBubbleArg, aCancelableArg,
aViewArg, aDetailArg,
aScreenX, aScreenY, aClientX, aClientY,
aCtrlKeyArg, aAltKeyArg, aShiftKeyArg,
aMetaKeyArg, aButton, aRelatedTarget);
WidgetSimpleGestureEvent* simpleGestureEvent = mEvent->AsSimpleGestureEvent();
simpleGestureEvent->mAllowedDirections = aAllowedDirectionsArg;
- simpleGestureEvent->direction = aDirectionArg;
+ simpleGestureEvent->mDirection = aDirectionArg;
simpleGestureEvent->delta = aDeltaArg;
simpleGestureEvent->clickCount = aClickCountArg;
}
} // namespace dom
} // namespace mozilla
using namespace mozilla;
--- a/widget/TouchEvents.h
+++ b/widget/TouchEvents.h
@@ -94,27 +94,27 @@ public:
return this;
}
WidgetSimpleGestureEvent(bool aIsTrusted, EventMessage aMessage,
nsIWidget* aWidget)
: WidgetMouseEventBase(aIsTrusted, aMessage, aWidget,
eSimpleGestureEventClass)
, mAllowedDirections(0)
- , direction(0)
+ , mDirection(0)
, clickCount(0)
, delta(0.0)
{
}
WidgetSimpleGestureEvent(const WidgetSimpleGestureEvent& aOther)
: WidgetMouseEventBase(aOther.IsTrusted(), aOther.mMessage,
aOther.mWidget, eSimpleGestureEventClass)
, mAllowedDirections(aOther.mAllowedDirections)
- , direction(aOther.direction)
+ , mDirection(aOther.mDirection)
, clickCount(0)
, delta(aOther.delta)
{
}
virtual WidgetEvent* Duplicate() const override
{
MOZ_ASSERT(mClass == eSimpleGestureEventClass,
@@ -125,30 +125,30 @@ public:
result->AssignSimpleGestureEventData(*this, true);
result->mFlags = mFlags;
return result;
}
// See nsIDOMSimpleGestureEvent for values
uint32_t mAllowedDirections;
// See nsIDOMSimpleGestureEvent for values
- uint32_t direction;
+ uint32_t mDirection;
// The number of taps for tap events
uint32_t clickCount;
// Delta for magnify and rotate events
double delta;
// XXX Not tested by test_assign_event_data.html
void AssignSimpleGestureEventData(const WidgetSimpleGestureEvent& aEvent,
bool aCopyTargets)
{
AssignMouseEventBaseData(aEvent, aCopyTargets);
// mAllowedDirections isn't copied
- direction = aEvent.direction;
+ mDirection = aEvent.mDirection;
delta = aEvent.delta;
clickCount = aEvent.clickCount;
}
};
/******************************************************************************
* mozilla::WidgetTouchEvent
******************************************************************************/
--- a/widget/android/nsWindow.cpp
+++ b/widget/android/nsWindow.cpp
@@ -2135,17 +2135,17 @@ nsWindow::OnNativeGestureEvent(AndroidGe
default:
return;
}
RefPtr<nsWindow> kungFuDeathGrip(this);
WidgetSimpleGestureEvent event(true, msg, this);
- event.direction = 0;
+ event.mDirection = 0;
event.delta = delta;
event.mModifiers = 0;
event.mTime = ae->Time();
event.mRefPoint = pt;
DispatchEvent(&event);
}
--- a/widget/cocoa/SwipeTracker.mm
+++ b/widget/cocoa/SwipeTracker.mm
@@ -206,15 +206,15 @@ SwipeTracker::CreateSwipeGestureEvent(Ev
return geckoEvent;
}
bool
SwipeTracker::SendSwipeEvent(EventMessage aMsg, uint32_t aDirection, double aDelta)
{
WidgetSimpleGestureEvent geckoEvent =
CreateSwipeGestureEvent(aMsg, &mWidget, mEventPosition);
- geckoEvent.direction = aDirection;
+ geckoEvent.mDirection = aDirection;
geckoEvent.delta = aDelta;
geckoEvent.mAllowedDirections = mAllowedDirections;
return mWidget.DispatchWindowEvent(geckoEvent);
}
} // namespace mozilla
--- a/widget/cocoa/nsChildView.mm
+++ b/widget/cocoa/nsChildView.mm
@@ -2572,17 +2572,17 @@ nsChildView::SendMayStartSwipe(const moz
// We're ready to start the animation. Tell Gecko about it, and at the same
// 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.direction = direction;
+ geckoEvent.mDirection = direction;
geckoEvent.delta = 0.0;
geckoEvent.mAllowedDirections = 0;
bool shouldStartSwipe = DispatchWindowEvent(geckoEvent); // event cancelled == swipe should start
SwipeInfo result = { shouldStartSwipe, geckoEvent.mAllowedDirections };
return result;
}
@@ -4183,25 +4183,25 @@ NSEvent* gLastDragMouseDownEvent = nil;
float deltaY = [anEvent deltaY]; // up=1.0, down=-1.0
// Setup the "swipe" event.
WidgetSimpleGestureEvent geckoEvent(true, eSwipeGesture, mGeckoChild);
[self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
// Record the left/right direction.
if (deltaX > 0.0)
- geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
+ geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_LEFT;
else if (deltaX < 0.0)
- geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
+ geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_RIGHT;
// Record the up/down direction.
if (deltaY > 0.0)
- geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_UP;
+ geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_UP;
else if (deltaY < 0.0)
- geckoEvent.direction |= nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
+ geckoEvent.mDirection |= nsIDOMSimpleGestureEvent::DIRECTION_DOWN;
// Send the event.
mGeckoChild->DispatchWindowEvent(geckoEvent);
NS_OBJC_END_TRY_ABORT_BLOCK;
}
- (void)beginGestureWithEvent:(NSEvent *)anEvent
@@ -4317,19 +4317,19 @@ NSEvent* gLastDragMouseDownEvent = nil;
return;
}
// Setup the event.
WidgetSimpleGestureEvent geckoEvent(true, msg, mGeckoChild);
[self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
geckoEvent.delta = -rotation;
if (rotation > 0.0) {
- geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
+ geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
} else {
- geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+ geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
}
// Send the event.
mGeckoChild->DispatchWindowEvent(geckoEvent);
// Keep track of the cumulative rotation for the final "rotate" event.
mCumulativeRotation += rotation;
@@ -4365,19 +4365,19 @@ NSEvent* gLastDragMouseDownEvent = nil;
case eGestureState_RotateGesture:
{
// Setup the "rotate" event.
WidgetSimpleGestureEvent geckoEvent(true, eRotateGesture, mGeckoChild);
[self convertCocoaMouseEvent:anEvent toGeckoEvent:&geckoEvent];
geckoEvent.delta = -mCumulativeRotation;
if (mCumulativeRotation > 0.0) {
- geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
+ geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
} else {
- geckoEvent.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+ geckoEvent.mDirection = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
}
// Send the event.
mGeckoChild->DispatchWindowEvent(geckoEvent);
}
break;
case eGestureState_None:
--- a/widget/windows/nsWinGesture.cpp
+++ b/widget/windows/nsWinGesture.cpp
@@ -370,24 +370,24 @@ nsWinGesture::ProcessGestureMessage(HWND
double degrees = -1 * radians * (180/M_PI);
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.direction = 0;
+ evt.mDirection = 0;
evt.delta = degrees - mRotateIntermediate;
mRotateIntermediate = degrees;
if (evt.delta > 0)
- evt.direction = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
+ evt.mDirection = nsIDOMSimpleGestureEvent::ROTATION_COUNTERCLOCKWISE;
else if (evt.delta < 0)
- evt.direction = nsIDOMSimpleGestureEvent::ROTATION_CLOCKWISE;
+ 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;
}