| 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_UI_MOTION_EVENT_GENERIC_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ |
| 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 int id; | 29 int id; |
| 30 MotionEvent::ToolType tool_type; | 30 MotionEvent::ToolType tool_type; |
| 31 float x; | 31 float x; |
| 32 float y; | 32 float y; |
| 33 float raw_x; | 33 float raw_x; |
| 34 float raw_y; | 34 float raw_y; |
| 35 float pressure; | 35 float pressure; |
| 36 float touch_major; | 36 float touch_major; |
| 37 float touch_minor; | 37 float touch_minor; |
| 38 float orientation; | 38 float orientation; |
| 39 float tilt; | 39 float tilt_x; |
| 40 float tilt_y; |
| 40 // source_device_id is only used on Aura. | 41 // source_device_id is only used on Aura. |
| 41 int source_device_id; | 42 int source_device_id; |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 // A generic MotionEvent implementation. | 45 // A generic MotionEvent implementation. |
| 45 class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent { | 46 class GESTURE_DETECTION_EXPORT MotionEventGeneric : public MotionEvent { |
| 46 public: | 47 public: |
| 47 MotionEventGeneric(Action action, | 48 MotionEventGeneric(Action action, |
| 48 base::TimeTicks event_time, | 49 base::TimeTicks event_time, |
| 49 const PointerProperties& pointer); | 50 const PointerProperties& pointer); |
| 50 MotionEventGeneric(const MotionEventGeneric& other); | 51 MotionEventGeneric(const MotionEventGeneric& other); |
| 51 | 52 |
| 52 ~MotionEventGeneric() override; | 53 ~MotionEventGeneric() override; |
| 53 | 54 |
| 54 // MotionEvent implementation. | 55 // MotionEvent implementation. |
| 55 uint32_t GetUniqueEventId() const override; | 56 uint32_t GetUniqueEventId() const override; |
| 56 Action GetAction() const override; | 57 Action GetAction() const override; |
| 57 int GetActionIndex() const override; | 58 int GetActionIndex() const override; |
| 58 size_t GetPointerCount() const override; | 59 size_t GetPointerCount() const override; |
| 59 int GetPointerId(size_t pointer_index) const override; | 60 int GetPointerId(size_t pointer_index) const override; |
| 60 float GetX(size_t pointer_index) const override; | 61 float GetX(size_t pointer_index) const override; |
| 61 float GetY(size_t pointer_index) const override; | 62 float GetY(size_t pointer_index) const override; |
| 62 float GetRawX(size_t pointer_index) const override; | 63 float GetRawX(size_t pointer_index) const override; |
| 63 float GetRawY(size_t pointer_index) const override; | 64 float GetRawY(size_t pointer_index) const override; |
| 64 float GetTouchMajor(size_t pointer_index) const override; | 65 float GetTouchMajor(size_t pointer_index) const override; |
| 65 float GetTouchMinor(size_t pointer_index) const override; | 66 float GetTouchMinor(size_t pointer_index) const override; |
| 66 float GetOrientation(size_t pointer_index) const override; | 67 float GetOrientation(size_t pointer_index) const override; |
| 67 float GetPressure(size_t pointer_index) const override; | 68 float GetPressure(size_t pointer_index) const override; |
| 68 float GetTilt(size_t pointer_index) const override; | 69 float GetTiltX(size_t pointer_index) const override; |
| 70 float GetTiltY(size_t pointer_index) const override; |
| 69 ToolType GetToolType(size_t pointer_index) const override; | 71 ToolType GetToolType(size_t pointer_index) const override; |
| 70 int GetButtonState() const override; | 72 int GetButtonState() const override; |
| 71 int GetFlags() const override; | 73 int GetFlags() const override; |
| 72 base::TimeTicks GetEventTime() const override; | 74 base::TimeTicks GetEventTime() const override; |
| 73 size_t GetHistorySize() const override; | 75 size_t GetHistorySize() const override; |
| 74 base::TimeTicks GetHistoricalEventTime( | 76 base::TimeTicks GetHistoricalEventTime( |
| 75 size_t historical_index) const override; | 77 size_t historical_index) const override; |
| 76 float GetHistoricalTouchMajor(size_t pointer_index, | 78 float GetHistoricalTouchMajor(size_t pointer_index, |
| 77 size_t historical_index) const override; | 79 size_t historical_index) const override; |
| 78 float GetHistoricalX(size_t pointer_index, | 80 float GetHistoricalX(size_t pointer_index, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 int action_index_; | 127 int action_index_; |
| 126 int button_state_; | 128 int button_state_; |
| 127 int flags_; | 129 int flags_; |
| 128 base::StackVector<PointerProperties, kTypicalMaxPointerCount> pointers_; | 130 base::StackVector<PointerProperties, kTypicalMaxPointerCount> pointers_; |
| 129 std::vector<std::unique_ptr<MotionEvent>> historical_events_; | 131 std::vector<std::unique_ptr<MotionEvent>> historical_events_; |
| 130 }; | 132 }; |
| 131 | 133 |
| 132 } // namespace ui | 134 } // namespace ui |
| 133 | 135 |
| 134 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ | 136 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_GENERIC_H_ |
| OLD | NEW |