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

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

Issue 755403006: Added experimental Touch.tilt, Touch.tiltDirection support for Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unused code (event_sender.cc) Created 5 years, 9 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
« no previous file with comments | « ui/events/events_stub.cc ('k') | ui/events/gesture_detection/motion_event_generic.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "ui/events/gesture_detection/gesture_detection_export.h" 10 #include "ui/events/gesture_detection/gesture_detection_export.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 virtual int GetActionIndex() const = 0; 53 virtual int GetActionIndex() const = 0;
54 virtual size_t GetPointerCount() const = 0; 54 virtual size_t GetPointerCount() const = 0;
55 virtual int GetPointerId(size_t pointer_index) const = 0; 55 virtual int GetPointerId(size_t pointer_index) const = 0;
56 virtual float GetX(size_t pointer_index) const = 0; 56 virtual float GetX(size_t pointer_index) const = 0;
57 virtual float GetY(size_t pointer_index) const = 0; 57 virtual float GetY(size_t pointer_index) const = 0;
58 virtual float GetRawX(size_t pointer_index) const = 0; 58 virtual float GetRawX(size_t pointer_index) const = 0;
59 virtual float GetRawY(size_t pointer_index) const = 0; 59 virtual float GetRawY(size_t pointer_index) const = 0;
60 virtual float GetTouchMajor(size_t pointer_index) const = 0; 60 virtual float GetTouchMajor(size_t pointer_index) const = 0;
61 virtual float GetTouchMinor(size_t pointer_index) const = 0; 61 virtual float GetTouchMinor(size_t pointer_index) const = 0;
62 virtual float GetOrientation(size_t pointer_index) const = 0; 62 virtual float GetOrientation(size_t pointer_index) const = 0;
63 virtual float GetTilt(size_t pointer_index) const = 0;
64 virtual float GetTiltDirection(size_t pointer_index) const = 0;
63 virtual float GetPressure(size_t pointer_index) const = 0; 65 virtual float GetPressure(size_t pointer_index) const = 0;
64 virtual ToolType GetToolType(size_t pointer_index) const = 0; 66 virtual ToolType GetToolType(size_t pointer_index) const = 0;
65 virtual int GetButtonState() const = 0; 67 virtual int GetButtonState() const = 0;
66 virtual int GetFlags() const = 0; 68 virtual int GetFlags() const = 0;
67 virtual base::TimeTicks GetEventTime() const = 0; 69 virtual base::TimeTicks GetEventTime() const = 0;
68 70
69 // Optional historical data, default implementation provides an empty history. 71 // Optional historical data, default implementation provides an empty history.
70 virtual size_t GetHistorySize() const; 72 virtual size_t GetHistorySize() const;
71 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const; 73 virtual base::TimeTicks GetHistoricalEventTime(size_t historical_index) const;
72 virtual float GetHistoricalTouchMajor(size_t pointer_index, 74 virtual float GetHistoricalTouchMajor(size_t pointer_index,
(...skipping 14 matching lines...) Expand all
87 float GetRawOffsetX() const { return GetRawX() - GetX(); } 89 float GetRawOffsetX() const { return GetRawX() - GetX(); }
88 float GetRawOffsetY() const { return GetRawY() - GetY(); } 90 float GetRawOffsetY() const { return GetRawY() - GetY(); }
89 91
90 float GetTouchMajor() const { return GetTouchMajor(0); } 92 float GetTouchMajor() const { return GetTouchMajor(0); }
91 float GetTouchMinor() const { return GetTouchMinor(0); } 93 float GetTouchMinor() const { return GetTouchMinor(0); }
92 94
93 // Returns the orientation of the major axis clockwise from vertical, in 95 // Returns the orientation of the major axis clockwise from vertical, in
94 // radians. The return value lies in [-PI/2, PI/2]. 96 // radians. The return value lies in [-PI/2, PI/2].
95 float GetOrientation() const { return GetOrientation(0); } 97 float GetOrientation() const { return GetOrientation(0); }
96 98
99 // Gets the tilt angle of the stylus away from the perpendicular to the
100 // screen. The return value lies in [0, PI/2). Default is NaN.
101 float GetTilt() const { return GetTilt(0); }
102
103 // Gets the clockwise angle from the X axis to the XY-projection of the
104 // stylus. The range is from -PI radians to PI radians. Default is NaN.
105 float GetTiltDirection() const { return GetTiltDirection(0); }
106
97 float GetPressure() const { return GetPressure(0); } 107 float GetPressure() const { return GetPressure(0); }
98 ToolType GetToolType() const { return GetToolType(0); } 108 ToolType GetToolType() const { return GetToolType(0); }
99 109
100 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent. 110 // O(N) search of pointers (use sparingly!). Returns -1 if |id| nonexistent.
101 int FindPointerIndexOfId(int id) const; 111 int FindPointerIndexOfId(int id) const;
102 112
103 // Note that these methods perform shallow copies of the originating events. 113 // Note that these methods perform shallow copies of the originating events.
104 // They guarantee only that the returned type will reflect the same 114 // They guarantee only that the returned type will reflect the same
105 // data exposed by the MotionEvent interface; no guarantees are made that the 115 // data exposed by the MotionEvent interface; no guarantees are made that the
106 // underlying implementation is identical to the source implementation. 116 // underlying implementation is identical to the source implementation.
107 scoped_ptr<MotionEvent> Clone() const; 117 scoped_ptr<MotionEvent> Clone() const;
108 scoped_ptr<MotionEvent> Cancel() const; 118 scoped_ptr<MotionEvent> Cancel() const;
109 }; 119 };
110 120
111 } // namespace ui 121 } // namespace ui
112 122
113 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_ 123 #endif // UI_EVENTS_GESTURE_DETECTION_MOTION_EVENT_H_
OLDNEW
« no previous file with comments | « ui/events/events_stub.cc ('k') | ui/events/gesture_detection/motion_event_generic.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698