| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef WebPointerProperties_h | 5 #ifndef WebPointerProperties_h |
| 6 #define WebPointerProperties_h | 6 #define WebPointerProperties_h |
| 7 | 7 |
| 8 #include <cstdint> | 8 #include <cstdint> |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 using PointerId = int32_t; | 13 using PointerId = int32_t; |
| 14 | 14 |
| 15 // This class encapsulates the properties that are common between mouse and | 15 // This class encapsulates the properties that are common between mouse and |
| 16 // pointer events and touch points as we transition towards the unified pointer | 16 // pointer events and touch points as we transition towards the unified pointer |
| 17 // event model. | 17 // event model. |
| 18 // TODO(e_hakkinen): Replace WebTouchEvent with WebPointerEvent, remove | 18 // TODO(e_hakkinen): Replace WebTouchEvent with WebPointerEvent, remove |
| 19 // WebTouchEvent and WebTouchPoint and merge this into WebPointerEvent. | 19 // WebTouchEvent and WebTouchPoint and merge this into WebPointerEvent. |
| 20 class WebPointerProperties { | 20 class WebPointerProperties { |
| 21 public: | 21 public: |
| 22 enum class Button { | 22 enum class Button { |
| 23 kNoButton = -1, | 23 kNoButton = -1, |
| 24 kLeft, | 24 kLeft, |
| 25 kMiddle, | 25 kMiddle, |
| 26 kRight, | 26 kRight, |
| 27 kBack, | 27 kBack, |
| 28 kForward, | 28 kForward, |
| 29 kEraser | 29 kEraser, |
| 30 kLastEntry = kEraser // Must be the last entry in the list |
| 30 }; | 31 }; |
| 31 | 32 |
| 32 enum class Buttons : unsigned { | 33 enum class Buttons : unsigned { |
| 33 kNoButton = 0, | 34 kNoButton = 0, |
| 34 kLeft = 1 << 0, | 35 kLeft = 1 << 0, |
| 35 kRight = 1 << 1, | 36 kRight = 1 << 1, |
| 36 kMiddle = 1 << 2, | 37 kMiddle = 1 << 2, |
| 37 kBack = 1 << 3, | 38 kBack = 1 << 3, |
| 38 kForward = 1 << 4, | 39 kForward = 1 << 4, |
| 39 kEraser = 1 << 5 | 40 kEraser = 1 << 5 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 106 |
| 106 PointerType pointer_type; | 107 PointerType pointer_type; |
| 107 | 108 |
| 108 int movement_x; | 109 int movement_x; |
| 109 int movement_y; | 110 int movement_y; |
| 110 }; | 111 }; |
| 111 | 112 |
| 112 } // namespace blink | 113 } // namespace blink |
| 113 | 114 |
| 114 #endif | 115 #endif |
| OLD | NEW |