Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Side by Side Diff: ui/events/gesture_detection/motion_event.h

Issue 2860793003: Pass through tilt_x and tilt_y to blink (Closed)
Patch Set: Pass through tilt_x and tilt_y to blink Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 virtual size_t GetPointerCount() const = 0; 69 virtual size_t GetPointerCount() const = 0;
70 virtual int GetPointerId(size_t pointer_index) const = 0; 70 virtual int GetPointerId(size_t pointer_index) const = 0;
71 virtual float GetX(size_t pointer_index) const = 0; 71 virtual float GetX(size_t pointer_index) const = 0;
72 virtual float GetY(size_t pointer_index) const = 0; 72 virtual float GetY(size_t pointer_index) const = 0;
73 virtual float GetRawX(size_t pointer_index) const = 0; 73 virtual float GetRawX(size_t pointer_index) const = 0;
74 virtual float GetRawY(size_t pointer_index) const = 0; 74 virtual float GetRawY(size_t pointer_index) const = 0;
75 virtual float GetTouchMajor(size_t pointer_index) const = 0; 75 virtual float GetTouchMajor(size_t pointer_index) const = 0;
76 virtual float GetTouchMinor(size_t pointer_index) const = 0; 76 virtual float GetTouchMinor(size_t pointer_index) const = 0;
77 virtual float GetOrientation(size_t pointer_index) const = 0; 77 virtual float GetOrientation(size_t pointer_index) const = 0;
78 virtual float GetPressure(size_t pointer_index) const = 0; 78 virtual float GetPressure(size_t pointer_index) const = 0;
79 virtual float GetTilt(size_t pointer_index) const = 0; 79 virtual float GetTiltX(size_t pointer_index) const = 0;
80 virtual float GetTiltY(size_t pointer_index) const = 0;
80 virtual ToolType GetToolType(size_t pointer_index) const = 0; 81 virtual ToolType GetToolType(size_t pointer_index) const = 0;
81 virtual int GetButtonState() const = 0; 82 virtual int GetButtonState() const = 0;
82 virtual int GetFlags() const = 0; 83 virtual int GetFlags() const = 0;
83 virtual base::TimeTicks GetEventTime() const = 0; 84 virtual base::TimeTicks GetEventTime() const = 0;
84 85
85 // Optional historical data, default implementation provides an empty history. 86 // Optional historical data, default implementation provides an empty history.
86 virtual size_t GetHistorySize() const; 87 virtual size_t GetHistorySize() const;
87 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const; 88 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const;
88 virtual float GetHistoricalTouchMajor(size_t pointer_index, 89 virtual float GetHistoricalTouchMajor(size_t pointer_index,
89 size_t historical_index) const; 90 size_t historical_index) const;
(...skipping 13 matching lines...) Expand all
103 float GetRawY() const { return GetRawY(0); } 104 float GetRawY() const { return GetRawY(0); }
104 float GetRawOffsetX() const { return GetRawX() - GetX(); } 105 float GetRawOffsetX() const { return GetRawX() - GetX(); }
105 float GetRawOffsetY() const { return GetRawY() - GetY(); } 106 float GetRawOffsetY() const { return GetRawY() - GetY(); }
106 107
107 float GetTouchMajor() const { return GetTouchMajor(0); } 108 float GetTouchMajor() const { return GetTouchMajor(0); }
108 float GetTouchMinor() const { return GetTouchMinor(0); } 109 float GetTouchMinor() const { return GetTouchMinor(0); }
109 110
110 // Returns the orientation in radians. The meaning is overloaded: 111 // Returns the orientation in radians. The meaning is overloaded:
111 // * For a touch screen or pad, it's the orientation of the major axis 112 // * For a touch screen or pad, it's the orientation of the major axis
112 // clockwise from vertical. The return value lies in [-PI/2, PI/2]. 113 // clockwise from vertical. The return value lies in [-PI/2, PI/2].
113 // * For a stylus, it indicates the direction in which the stylus is pointing. 114 // * For a stylus, it indicates the direction in which the stylus is pointing.
use mustaq_at_chromium.org 2017/05/15 19:46:53 Please add a comment: "Stylus 3D orientation is re
114 // The return value lies in [-PI, PI]. 115 // The return value lies in [-PI, PI].
115 float GetOrientation() const { return GetOrientation(0); } 116 float GetOrientation() const { return GetOrientation(0); }
116 117
117 float GetPressure() const { return GetPressure(0); } 118 float GetPressure() const { return GetPressure(0); }
118 float GetTilt() const { return GetTilt(0); } 119 float GetTiltX() const { return GetTiltX(0); }
use mustaq_at_chromium.org 2017/05/15 19:46:53 We need a clear description here because these ang
jkwang 2017/05/16 01:13:26 Done.
120 float GetTiltY() const { return GetTiltY(0); }
119 ToolType GetToolType() const { return GetToolType(0); } 121 ToolType GetToolType() const { return GetToolType(0); }
120 122
121 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent. 123 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent.
122 int FindPointerIndexOfId(int id) const; 124 int FindPointerIndexOfId(int id) const;
123 125
124 // Note that these methods perform shallow copies of the originating events. 126 // Note that these methods perform shallow copies of the originating events.
125 // They guarantee only that the returned type will reflect the same 127 // They guarantee only that the returned type will reflect the same
126 // data exposed by the MotionEvent interface; no guarantees are made that the 128 // data exposed by the MotionEvent interface; no guarantees are made that the
127 // underlying implementation is identical to the source implementation. 129 // underlying implementation is identical to the source implementation.
128 std::unique_ptr<MotionEvent> Clone() const; 130 std::unique_ptr<MotionEvent> Clone() const;
129 std::unique_ptr<MotionEvent> Cancel() const; 131 std::unique_ptr<MotionEvent> Cancel() const;
130 }; 132 };
131 133
132 } // namespace ui 134 } // namespace ui
133 135
134 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ 136 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698