Bug 920377 part.15 Get rid of nsGestureNotifyEvent r=roc

This commit is contained in:
Masayuki Nakano 2013-09-27 15:20:57 +09:00
parent b02623b48f
commit e3ab617d31
8 changed files with 25 additions and 24 deletions

View File

@ -2809,7 +2809,7 @@ nsEventStateManager::DoScrollText(nsIScrollableFrame* aScrollableFrame,
}
void
nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
nsEventStateManager::DecideGestureEvent(WidgetGestureNotifyEvent* aEvent,
nsIFrame* targetFrame)
{
@ -2828,7 +2828,8 @@ nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
*
* Note: we'll have to one-off various cases to ensure a good usable behavior
*/
nsGestureNotifyEvent::ePanDirection panDirection = nsGestureNotifyEvent::ePanNone;
WidgetGestureNotifyEvent::ePanDirection panDirection =
WidgetGestureNotifyEvent::ePanNone;
bool displayPanFeedback = false;
for (nsIFrame* current = targetFrame; current;
current = nsLayoutUtils::GetCrossDocParentFrame(current)) {
@ -2837,7 +2838,7 @@ nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
// Scrollbars should always be draggable
if (currentFrameType == nsGkAtoms::scrollbarFrame) {
panDirection = nsGestureNotifyEvent::ePanNone;
panDirection = WidgetGestureNotifyEvent::ePanNone;
break;
}
@ -2846,10 +2847,10 @@ nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
nsTreeBodyFrame* treeFrame = do_QueryFrame(current);
if (treeFrame) {
if (treeFrame->GetHorizontalOverflow()) {
panDirection = nsGestureNotifyEvent::ePanHorizontal;
panDirection = WidgetGestureNotifyEvent::ePanHorizontal;
}
if (treeFrame->GetVerticalOverflow()) {
panDirection = nsGestureNotifyEvent::ePanVertical;
panDirection = WidgetGestureNotifyEvent::ePanVertical;
}
break;
}
@ -2873,12 +2874,12 @@ nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
// Vertical panning has priority over horizontal panning, so
// when vertical movement is possible we can just finish the loop.
if (scrollRange.height > 0) {
panDirection = nsGestureNotifyEvent::ePanVertical;
panDirection = WidgetGestureNotifyEvent::ePanVertical;
break;
}
if (canScrollHorizontally) {
panDirection = nsGestureNotifyEvent::ePanHorizontal;
panDirection = WidgetGestureNotifyEvent::ePanHorizontal;
displayPanFeedback = false;
}
} else { //Not a XUL box
@ -2886,13 +2887,13 @@ nsEventStateManager::DecideGestureEvent(nsGestureNotifyEvent* aEvent,
//Check if we have visible scrollbars
if (scrollbarVisibility & nsIScrollableFrame::VERTICAL) {
panDirection = nsGestureNotifyEvent::ePanVertical;
panDirection = WidgetGestureNotifyEvent::ePanVertical;
displayPanFeedback = true;
break;
}
if (scrollbarVisibility & nsIScrollableFrame::HORIZONTAL) {
panDirection = nsGestureNotifyEvent::ePanHorizontal;
panDirection = WidgetGestureNotifyEvent::ePanHorizontal;
displayPanFeedback = true;
}
}
@ -3222,7 +3223,8 @@ nsEventStateManager::PostHandleEvent(nsPresContext* aPresContext,
case NS_GESTURENOTIFY_EVENT_START:
{
if (nsEventStatus_eConsumeNoDefault != *aStatus)
DecideGestureEvent(static_cast<nsGestureNotifyEvent*>(aEvent), mCurrentTarget);
DecideGestureEvent(static_cast<WidgetGestureNotifyEvent*>(aEvent),
mCurrentTarget);
}
break;

View File

@ -655,7 +655,8 @@ protected:
* the target element, as well as the orientation to trigger panning and
* display visual boundary feedback. The decision is stored back in aEvent.
*/
void DecideGestureEvent(nsGestureNotifyEvent* aEvent, nsIFrame* targetFrame);
void DecideGestureEvent(mozilla::WidgetGestureNotifyEvent* aEvent,
nsIFrame* targetFrame);
// routines for the d&d gesture tracking state machine
void BeginTrackingDragGesture ( nsPresContext* aPresContext, nsMouseEvent* inDownEvent,

View File

@ -125,6 +125,4 @@ namespace mozilla {
typedef WidgetWheelEvent WheelEvent;
}
typedef mozilla::WidgetGestureNotifyEvent nsGestureNotifyEvent;
#endif // mozilla_EventForwards_h__

View File

@ -151,7 +151,4 @@ public:
} // namespace mozilla
// TODO: Remove following typedefs
typedef mozilla::WidgetGestureNotifyEvent nsGestureNotifyEvent;
#endif // mozilla_TouchEvents_h__

View File

@ -1973,7 +1973,8 @@ nsEventStatus nsWindow::OnTouchEvent(QTouchEvent *event, bool &handled)
handled = true;
for (int i = touchPoints.count() -1; i >= 0; i--) {
QPointF fpos = touchPoints[i].pos();
nsGestureNotifyEvent gestureNotifyEvent(true, NS_GESTURENOTIFY_EVENT_START, this);
WidgetGestureNotifyEvent gestureNotifyEvent(true,
NS_GESTURENOTIFY_EVENT_START, this);
gestureNotifyEvent.refPoint = LayoutDeviceIntPoint(fpos.x(), fpos.y());
DispatchEvent(&gestureNotifyEvent);
}

View File

@ -119,7 +119,8 @@ bool nsWinGesture::InitLibrary()
#define GCOUNT 5
bool nsWinGesture::SetWinGestureSupport(HWND hWnd, nsGestureNotifyEvent::ePanDirection aDirection)
bool nsWinGesture::SetWinGestureSupport(HWND hWnd,
WidgetGestureNotifyEvent::ePanDirection aDirection)
{
if (!getGestureInfo)
return false;
@ -144,15 +145,15 @@ bool nsWinGesture::SetWinGestureSupport(HWND hWnd, nsGestureNotifyEvent::ePanDir
if (gEnableSingleFingerPanEvents) {
if (aDirection == nsGestureNotifyEvent::ePanVertical ||
aDirection == nsGestureNotifyEvent::ePanBoth)
if (aDirection == WidgetGestureNotifyEvent::ePanVertical ||
aDirection == WidgetGestureNotifyEvent::ePanBoth)
{
config[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
config[2].dwBlock -= GC_PAN_WITH_SINGLE_FINGER_VERTICALLY;
}
if (aDirection == nsGestureNotifyEvent::ePanHorizontal ||
aDirection == nsGestureNotifyEvent::ePanBoth)
if (aDirection == WidgetGestureNotifyEvent::ePanHorizontal ||
aDirection == WidgetGestureNotifyEvent::ePanBoth)
{
config[2].dwWant |= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;
config[2].dwBlock -= GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY;

View File

@ -198,7 +198,7 @@ public:
nsWinGesture();
public:
bool SetWinGestureSupport(HWND hWnd, nsGestureNotifyEvent::ePanDirection aDirection);
bool SetWinGestureSupport(HWND hWnd, mozilla::WidgetGestureNotifyEvent::ePanDirection aDirection);
bool ShutdownWinGestureSupport();
bool RegisterTouchWindow(HWND hWnd);
bool UnregisterTouchWindow(HWND hWnd);

View File

@ -5343,7 +5343,8 @@ nsWindow::ProcessMessage(UINT msg, WPARAM& wParam, LPARAM& lParam,
nsPointWin touchPoint;
touchPoint = gestureinfo->ptsLocation;
touchPoint.ScreenToClient(mWnd);
nsGestureNotifyEvent gestureNotifyEvent(true, NS_GESTURENOTIFY_EVENT_START, this);
WidgetGestureNotifyEvent gestureNotifyEvent(true,
NS_GESTURENOTIFY_EVENT_START, this);
gestureNotifyEvent.refPoint = LayoutDeviceIntPoint::FromUntyped(touchPoint);
nsEventStatus status;
DispatchEvent(&gestureNotifyEvent, status);