| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 ACTION_DOWN, | 24 ACTION_DOWN, |
| 25 ACTION_UP, | 25 ACTION_UP, |
| 26 ACTION_MOVE, | 26 ACTION_MOVE, |
| 27 ACTION_CANCEL, | 27 ACTION_CANCEL, |
| 28 ACTION_POINTER_DOWN, | 28 ACTION_POINTER_DOWN, |
| 29 ACTION_POINTER_UP, | 29 ACTION_POINTER_UP, |
| 30 ACTION_HOVER_ENTER, | 30 ACTION_HOVER_ENTER, |
| 31 ACTION_HOVER_EXIT, | 31 ACTION_HOVER_EXIT, |
| 32 ACTION_HOVER_MOVE, | 32 ACTION_HOVER_MOVE, |
| 33 ACTION_BUTTON_PRESS, | 33 ACTION_BUTTON_PRESS, |
| 34 ACTION_BUTTON_RELEASE | 34 ACTION_BUTTON_RELEASE, |
| 35 ACTION_LAST = ACTION_BUTTON_RELEASE |
| 35 }; | 36 }; |
| 36 | 37 |
| 37 enum ToolType { | 38 enum ToolType { |
| 38 TOOL_TYPE_UNKNOWN, | 39 TOOL_TYPE_UNKNOWN, |
| 39 TOOL_TYPE_FINGER, | 40 TOOL_TYPE_FINGER, |
| 40 TOOL_TYPE_STYLUS, | 41 TOOL_TYPE_STYLUS, |
| 41 TOOL_TYPE_MOUSE, | 42 TOOL_TYPE_MOUSE, |
| 42 TOOL_TYPE_ERASER | 43 TOOL_TYPE_ERASER, |
| 44 TOOL_TYPE_LAST = TOOL_TYPE_ERASER |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 enum ButtonType { | 47 enum ButtonType { |
| 46 BUTTON_PRIMARY = 1 << 0, | 48 BUTTON_PRIMARY = 1 << 0, |
| 47 BUTTON_SECONDARY = 1 << 1, | 49 BUTTON_SECONDARY = 1 << 1, |
| 48 BUTTON_TERTIARY = 1 << 2, | 50 BUTTON_TERTIARY = 1 << 2, |
| 49 BUTTON_BACK = 1 << 3, | 51 BUTTON_BACK = 1 << 3, |
| 50 BUTTON_FORWARD = 1 << 4, | 52 BUTTON_FORWARD = 1 << 4, |
| 51 BUTTON_STYLUS_PRIMARY = 1 << 5, | 53 BUTTON_STYLUS_PRIMARY = 1 << 5, |
| 52 BUTTON_STYLUS_SECONDARY = 1 << 6, | 54 BUTTON_STYLUS_SECONDARY = 1 << 6 |
| 53 }; | 55 }; |
| 54 | 56 |
| 55 // The implementer promises that |GetPointerId()| will never exceed | 57 // The implementer promises that |GetPointerId()| will never exceed |
| 56 // MAX_POINTER_ID. | 58 // MAX_POINTER_ID. |
| 57 enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 16 }; | 59 enum { MAX_POINTER_ID = 31, MAX_TOUCH_POINT_COUNT = 16 }; |
| 58 | 60 |
| 59 virtual ~MotionEvent() {} | 61 virtual ~MotionEvent() {} |
| 60 | 62 |
| 61 // An unique identifier this motion event. | 63 // An unique identifier this motion event. |
| 62 virtual uint32_t GetUniqueEventId() const = 0; | 64 virtual uint32_t GetUniqueEventId() const = 0; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 // They guarantee only that the returned type will reflect the same | 125 // They guarantee only that the returned type will reflect the same |
| 124 // data exposed by the MotionEvent interface; no guarantees are made that the | 126 // data exposed by the MotionEvent interface; no guarantees are made that the |
| 125 // underlying implementation is identical to the source implementation. | 127 // underlying implementation is identical to the source implementation. |
| 126 std::unique_ptr<MotionEvent> Clone() const; | 128 std::unique_ptr<MotionEvent> Clone() const; |
| 127 std::unique_ptr<MotionEvent> Cancel() const; | 129 std::unique_ptr<MotionEvent> Cancel() const; |
| 128 }; | 130 }; |
| 129 | 131 |
| 130 } // namespace ui | 132 } // namespace ui |
| 131 | 133 |
| 132 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ | 134 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ |
| OLD | NEW |