Bug 895274 part.184 Rename NS_WHEEL_WHEEL to eWheel r=smaug

This commit is contained in:
Masayuki Nakano 2015-09-11 01:59:54 +09:00
Родитель e6b646c7ae
Коммит 6b885d1496
16 изменённых файлов: 32 добавлений и 33 удалений

Просмотреть файл

@ -825,7 +825,7 @@ nsDOMWindowUtils::SendWheelEvent(float aX,
return NS_ERROR_NULL_POINTER;
}
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, widget);
WidgetWheelEvent wheelEvent(true, eWheel, widget);
wheelEvent.modifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
wheelEvent.deltaX = aDeltaX;
wheelEvent.deltaY = aDeltaY;

Просмотреть файл

@ -418,7 +418,7 @@ EVENT(waiting,
EventNameType_HTML,
eBasicEventClass)
EVENT(wheel,
NS_WHEEL_WHEEL,
eWheel,
EventNameType_All,
eWheelEventClass)
EVENT(copy,

Просмотреть файл

@ -711,7 +711,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
keyEvent->mIsComposing = !!composition;
}
break;
case NS_WHEEL_WHEEL:
case eWheel:
case NS_WHEEL_START:
case NS_WHEEL_STOP:
{
@ -723,7 +723,7 @@ EventStateManager::PreHandleEvent(nsPresContext* aPresContext,
mCurrentTargetContent = content;
}
if (aEvent->mMessage != NS_WHEEL_WHEEL) {
if (aEvent->mMessage != eWheel) {
break;
}
@ -3021,7 +3021,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
}
}
break;
case NS_WHEEL_WHEEL:
case eWheel:
case NS_WHEEL_START:
{
MOZ_ASSERT(aEvent->mFlags.mIsTrusted);
@ -3048,7 +3048,7 @@ EventStateManager::PostHandleEvent(nsPresContext* aPresContext,
ScrollbarsForWheel::PrepareToScrollText(this, aTargetFrame, wheelEvent);
if (aEvent->mMessage != NS_WHEEL_WHEEL ||
if (aEvent->mMessage != eWheel ||
(!wheelEvent->deltaX && !wheelEvent->deltaY)) {
break;
}
@ -5572,7 +5572,7 @@ EventStateManager::WheelPrefs::HasUserPrefsForDelta(WidgetWheelEvent* aEvent)
bool
EventStateManager::WheelEventIsScrollAction(WidgetWheelEvent* aEvent)
{
return aEvent->mMessage == NS_WHEEL_WHEEL &&
return aEvent->mMessage == eWheel &&
WheelPrefs::GetInstance()->ComputeActionFor(aEvent) == WheelPrefs::ACTION_SCROLL;
}

Просмотреть файл

@ -94,7 +94,7 @@ WheelTransaction::BeginTransaction(nsIFrame* aTargetFrame,
WidgetWheelEvent* aEvent)
{
NS_ASSERTION(!sTargetFrame, "previous transaction is not finished!");
MOZ_ASSERT(aEvent->mMessage == NS_WHEEL_WHEEL,
MOZ_ASSERT(aEvent->mMessage == eWheel,
"Transaction must be started with a wheel event");
ScrollbarsForWheel::OwnWheelTransaction(false);
sTargetFrame = aTargetFrame;
@ -176,7 +176,7 @@ WheelTransaction::OnEvent(WidgetEvent* aEvent)
}
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
case eWheel:
if (sMouseMoved != 0 &&
OutOfTime(sMouseMoved, GetIgnoreMoveDelayTime())) {
// Terminate the current mousewheel transaction if the mouse moved more

Просмотреть файл

@ -534,8 +534,8 @@ nsEventStatus
AccessibleCaretEventHub::HandleWheelEvent(WidgetWheelEvent* aEvent)
{
switch (aEvent->mMessage) {
case NS_WHEEL_WHEEL:
AC_LOGV("NS_WHEEL_WHEEL, isMomentum %d, state: %s", aEvent->isMomentum,
case eWheel:
AC_LOGV("eWheel, isMomentum %d, state: %s", aEvent->isMomentum,
mState->Name());
mState->OnScrolling(this);
break;

Просмотреть файл

@ -786,7 +786,7 @@ TouchCaret::HandleEvent(WidgetEvent* aEvent)
case eKeyUp:
case eKeyDown:
case eKeyPress:
case NS_WHEEL_WHEEL:
case eWheel:
case NS_WHEEL_START:
case NS_WHEEL_STOP:
// Disable touch caret while key/wheel event is received.

Просмотреть файл

@ -736,7 +736,7 @@ TEST_F(AccessibleCaretEventHubTester, TestWheelEventScroll)
MockAccessibleCaretEventHub::ScrollState(),
nsEventStatus_eIgnore);
HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_WHEEL),
HandleEventAndCheckState(CreateWheelEvent(eWheel),
MockAccessibleCaretEventHub::ScrollState(),
nsEventStatus_eIgnore);
@ -747,7 +747,7 @@ TEST_F(AccessibleCaretEventHubTester, TestWheelEventScroll)
nsEventStatus_eIgnore);
// Momentum scroll
HandleEventAndCheckState(CreateWheelEvent(NS_WHEEL_WHEEL),
HandleEventAndCheckState(CreateWheelEvent(eWheel),
MockAccessibleCaretEventHub::PostScrollState(),
nsEventStatus_eIgnore);

Просмотреть файл

@ -475,7 +475,7 @@ public:
// will return a real frame and we don't have to worry about
// destroying it by flushing later.
mPresShell->FlushPendingNotifications(Flush_Layout);
} else if (aVisitor.mEvent->mMessage == NS_WHEEL_WHEEL &&
} else if (aVisitor.mEvent->mMessage == eWheel &&
aVisitor.mEventStatus != nsEventStatus_eConsumeNoDefault) {
nsIFrame* frame = mPresShell->GetCurrentEventFrame();
if (frame) {

Просмотреть файл

@ -1789,7 +1789,7 @@ nsPluginFrame::HandleEvent(nsPresContext* aPresContext,
#ifdef XP_MACOSX
// we want to process some native mouse events in the cocoa event model
if ((anEvent->mMessage == eMouseEnterIntoWidget ||
anEvent->mMessage == NS_WHEEL_WHEEL) &&
anEvent->mMessage == eWheel) &&
mInstanceOwner->GetEventModel() == NPEventModelCocoa) {
*anEventStatus = mInstanceOwner->ProcessEvent(*anEvent);
// Due to plugin code reentering Gecko, this frame may be dead at this

Просмотреть файл

@ -383,7 +383,8 @@ NS_EVENT_MESSAGE(NS_POINTERLOCKCHANGE, NS_POINTERLOCK_START)
NS_EVENT_MESSAGE(NS_POINTERLOCKERROR, NS_POINTERLOCK_START + 1)
NS_EVENT_MESSAGE(eWheelEventFirst, 5400)
NS_EVENT_MESSAGE(NS_WHEEL_WHEEL, eWheelEventFirst)
// eWheel is the event message of DOM wheel event.
NS_EVENT_MESSAGE(eWheel, eWheelEventFirst)
NS_EVENT_MESSAGE(NS_WHEEL_START, eWheelEventFirst + 1)
NS_EVENT_MESSAGE(NS_WHEEL_STOP, eWheelEventFirst + 2)

Просмотреть файл

@ -241,7 +241,7 @@ PanGestureInput::IsMomentum() const
WidgetWheelEvent
PanGestureInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
{
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
wheelEvent.modifiers = this->modifiers;
wheelEvent.time = mTime;
wheelEvent.timeStamp = mTimeStamp;
@ -313,7 +313,7 @@ DeltaModeForDeltaType(ScrollWheelInput::ScrollDeltaType aDeltaType)
WidgetWheelEvent
ScrollWheelInput::ToWidgetWheelEvent(nsIWidget* aWidget) const
{
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
wheelEvent.modifiers = this->modifiers;
wheelEvent.time = mTime;
wheelEvent.timeStamp = mTimeStamp;

Просмотреть файл

@ -2755,7 +2755,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe
}
}
WidgetWheelEvent event(true, NS_WHEEL_WHEEL, this);
WidgetWheelEvent event(true, eWheel, this);
if (mAPZC) {
uint64_t inputBlockId = 0;
@ -2808,8 +2808,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe
MOZ_CRASH("unsupported event type");
return;
}
if (event.mMessage == NS_WHEEL_WHEEL &&
(event.deltaX != 0 || event.deltaY != 0)) {
if (event.mMessage == eWheel && (event.deltaX != 0 || event.deltaY != 0)) {
ProcessUntransformedAPZEvent(&event, guid, inputBlockId, result);
}
return;
@ -2853,8 +2852,7 @@ nsChildView::DispatchAPZWheelInputEvent(InputData& aEvent, bool aCanTriggerSwipe
MOZ_CRASH("unexpected event type");
return;
}
if (event.mMessage == NS_WHEEL_WHEEL &&
(event.deltaX != 0 || event.deltaY != 0)) {
if (event.mMessage == eWheel && (event.deltaX != 0 || event.deltaY != 0)) {
DispatchEvent(&event, status);
}
}

Просмотреть файл

@ -3134,7 +3134,7 @@ nsWindow::OnScrollEvent(GdkEventScroll *aEvent)
mLastScrollEventTime == aEvent->time)
return;
#endif
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this);
WidgetWheelEvent wheelEvent(true, eWheel, this);
wheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE;
switch (aEvent->direction) {
#if GTK_CHECK_VERSION(3,4,0)

Просмотреть файл

@ -1259,7 +1259,7 @@ nsEventStatus
nsWindow::wheelEvent(QWheelEvent* aEvent)
{
// check to see if we should rollup
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this);
WidgetWheelEvent wheelEvent(true, eWheel, this);
wheelEvent.deltaMode = nsIDOMWheelEvent::DOM_DELTA_LINE;
// negative values for aEvent->delta indicate downward scrolling;

Просмотреть файл

@ -626,23 +626,23 @@ MouseScrollHandler::HandleMouseWheelMessage(nsWindowBase* aWidget,
// Grab the widget, it might be destroyed by a DOM event handler.
nsRefPtr<nsWindowBase> kungFuDethGrip(aWidget);
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
if (mLastEventInfo.InitWheelEvent(aWidget, wheelEvent, modKeyState)) {
MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::HandleMouseWheelMessage: dispatching "
"NS_WHEEL_WHEEL event"));
"eWheel event"));
aWidget->DispatchWheelEvent(&wheelEvent);
if (aWidget->Destroyed()) {
MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::HandleMouseWheelMessage: The window was destroyed "
"by NS_WHEEL_WHEEL event"));
"by eWheel event"));
mLastEventInfo.ResetTransaction();
return;
}
}
else {
MOZ_LOG(gMouseScrollLog, LogLevel::Info,
("MouseScroll::HandleMouseWheelMessage: NS_WHEEL_WHEEL event is not "
("MouseScroll::HandleMouseWheelMessage: eWheel event is not "
"dispatched"));
}
}
@ -662,7 +662,7 @@ MouseScrollHandler::HandleScrollMessageAsMouseWheelMessage(nsWindowBase* aWidget
ModifierKeyState modKeyState = GetModifierKeyState(aMessage);
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, aWidget);
WidgetWheelEvent wheelEvent(true, eWheel, aWidget);
double& delta =
(aMessage == MOZ_WM_VSCROLL) ? wheelEvent.deltaY : wheelEvent.deltaX;
int32_t& lineOrPageDelta =
@ -819,7 +819,7 @@ MouseScrollHandler::LastEventInfo::InitWheelEvent(
WidgetWheelEvent& aWheelEvent,
const ModifierKeyState& aModKeyState)
{
MOZ_ASSERT(aWheelEvent.mMessage == NS_WHEEL_WHEEL);
MOZ_ASSERT(aWheelEvent.mMessage == eWheel);
// XXX Why don't we use lParam value? We should use lParam value because
// our internal message is always posted by original message handler.

Просмотреть файл

@ -6485,7 +6485,7 @@ bool nsWindow::OnGesture(WPARAM wParam, LPARAM lParam)
nsEventStatus status;
WidgetWheelEvent wheelEvent(true, NS_WHEEL_WHEEL, this);
WidgetWheelEvent wheelEvent(true, eWheel, this);
ModifierKeyState modifierKeyState;
modifierKeyState.InitInputEvent(wheelEvent);