1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
10 * nsWinGesture - Touch input handling for tablet displays.
17 #include "mozilla/EventForwards.h"
18 #include "mozilla/TouchEvents.h"
20 // WM_TABLET_QUERYSYSTEMGESTURESTATUS return values
21 #define TABLET_ROTATE_GESTURE_ENABLE 0x02000000
23 class nsPointWin
: public nsIntPoint
{
25 nsPointWin
& operator=(const POINTS
& aPoint
) {
30 nsPointWin
& operator=(const POINT
& aPoint
) {
35 nsPointWin
& operator=(int val
) {
39 void ScreenToClient(HWND hWnd
) {
43 ::ScreenToClient(hWnd
, &tmp
);
53 bool SetWinGestureSupport(
54 HWND hWnd
, mozilla::WidgetGestureNotifyEvent::PanDirection aDirection
);
55 bool ShutdownWinGestureSupport();
57 // Simple gesture process
58 bool ProcessGestureMessage(HWND hWnd
, WPARAM wParam
, LPARAM lParam
,
59 mozilla::WidgetSimpleGestureEvent
& evt
);
62 bool IsPanEvent(LPARAM lParam
);
63 bool ProcessPanMessage(HWND hWnd
, WPARAM wParam
, LPARAM lParam
);
64 bool PanDeltaToPixelScroll(mozilla::WidgetWheelEvent
& aWheelEvent
);
65 void UpdatePanFeedbackX(HWND hWnd
, int32_t scrollOverflow
, bool& endFeedback
);
66 void UpdatePanFeedbackY(HWND hWnd
, int32_t scrollOverflow
, bool& endFeedback
);
67 void PanFeedbackFinalize(HWND hWnd
, bool endFeedback
);
73 // Pan and feedback state
74 nsPointWin mPanIntermediate
;
75 nsPointWin mPanRefPoint
;
76 nsPointWin mPixelScrollDelta
;
81 bool mPanInertiaActive
;
82 nsPointWin mPixelScrollOverflow
;
85 double mZoomIntermediate
;
88 double mRotateIntermediate
;
91 #endif /* WinGesture_h__ */