OLD | NEW |
1 | 1 |
2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 | 5 |
6 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 6 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
7 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 7 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
8 | 8 |
9 #include <jni.h> | 9 #include <jni.h> |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 // while all *output* coordinates are in DIPs (as with WebTouchEvent). | 22 // while all *output* coordinates are in DIPs (as with WebTouchEvent). |
23 class CONTENT_EXPORT MotionEventAndroid : public ui::MotionEvent { | 23 class CONTENT_EXPORT MotionEventAndroid : public ui::MotionEvent { |
24 public: | 24 public: |
25 struct Pointer { | 25 struct Pointer { |
26 Pointer(jint id, | 26 Pointer(jint id, |
27 jfloat pos_x_pixels, | 27 jfloat pos_x_pixels, |
28 jfloat pos_y_pixels, | 28 jfloat pos_y_pixels, |
29 jfloat touch_major_pixels, | 29 jfloat touch_major_pixels, |
30 jfloat touch_minor_pixels, | 30 jfloat touch_minor_pixels, |
31 jfloat orientation_rad, | 31 jfloat orientation_rad, |
| 32 jfloat tilt_rad, |
32 jint tool_type); | 33 jint tool_type); |
33 jint id; | 34 jint id; |
34 jfloat pos_x_pixels; | 35 jfloat pos_x_pixels; |
35 jfloat pos_y_pixels; | 36 jfloat pos_y_pixels; |
36 jfloat touch_major_pixels; | 37 jfloat touch_major_pixels; |
37 jfloat touch_minor_pixels; | 38 jfloat touch_minor_pixels; |
38 jfloat orientation_rad; | 39 jfloat orientation_rad; |
| 40 jfloat tilt_rad; |
39 jint tool_type; | 41 jint tool_type; |
40 }; | 42 }; |
41 | 43 |
42 // Forcing the caller to provide all cached values upon construction | 44 // Forcing the caller to provide all cached values upon construction |
43 // eliminates the need to perform a JNI call to retrieve values individually. | 45 // eliminates the need to perform a JNI call to retrieve values individually. |
44 MotionEventAndroid(float pix_to_dip, | 46 MotionEventAndroid(float pix_to_dip, |
45 JNIEnv* env, | 47 JNIEnv* env, |
46 jobject event, | 48 jobject event, |
47 jlong time_ms, | 49 jlong time_ms, |
48 jint android_action, | 50 jint android_action, |
(...skipping 15 matching lines...) Expand all Loading... |
64 size_t GetPointerCount() const override; | 66 size_t GetPointerCount() const override; |
65 int GetPointerId(size_t pointer_index) const override; | 67 int GetPointerId(size_t pointer_index) const override; |
66 float GetX(size_t pointer_index) const override; | 68 float GetX(size_t pointer_index) const override; |
67 float GetY(size_t pointer_index) const override; | 69 float GetY(size_t pointer_index) const override; |
68 float GetRawX(size_t pointer_index) const override; | 70 float GetRawX(size_t pointer_index) const override; |
69 float GetRawY(size_t pointer_index) const override; | 71 float GetRawY(size_t pointer_index) const override; |
70 float GetTouchMajor(size_t pointer_index) const override; | 72 float GetTouchMajor(size_t pointer_index) const override; |
71 float GetTouchMinor(size_t pointer_index) const override; | 73 float GetTouchMinor(size_t pointer_index) const override; |
72 float GetOrientation(size_t pointer_index) const override; | 74 float GetOrientation(size_t pointer_index) const override; |
73 float GetPressure(size_t pointer_index) const override; | 75 float GetPressure(size_t pointer_index) const override; |
| 76 float GetTilt(size_t pointer_index) const override; |
74 base::TimeTicks GetEventTime() const override; | 77 base::TimeTicks GetEventTime() const override; |
75 size_t GetHistorySize() const override; | 78 size_t GetHistorySize() const override; |
76 base::TimeTicks GetHistoricalEventTime( | 79 base::TimeTicks GetHistoricalEventTime( |
77 size_t historical_index) const override; | 80 size_t historical_index) const override; |
78 float GetHistoricalTouchMajor(size_t pointer_index, | 81 float GetHistoricalTouchMajor(size_t pointer_index, |
79 size_t historical_index) const override; | 82 size_t historical_index) const override; |
80 float GetHistoricalX(size_t pointer_index, | 83 float GetHistoricalX(size_t pointer_index, |
81 size_t historical_index) const override; | 84 size_t historical_index) const override; |
82 float GetHistoricalY(size_t pointer_index, | 85 float GetHistoricalY(size_t pointer_index, |
83 size_t historical_index) const override; | 86 size_t historical_index) const override; |
(...skipping 29 matching lines...) Expand all Loading... |
113 const int cached_button_state_; | 116 const int cached_button_state_; |
114 const int cached_flags_; | 117 const int cached_flags_; |
115 const gfx::Vector2dF cached_raw_position_offset_; | 118 const gfx::Vector2dF cached_raw_position_offset_; |
116 struct CachedPointer { | 119 struct CachedPointer { |
117 CachedPointer(); | 120 CachedPointer(); |
118 int id; | 121 int id; |
119 gfx::PointF position; | 122 gfx::PointF position; |
120 float touch_major; | 123 float touch_major; |
121 float touch_minor; | 124 float touch_minor; |
122 float orientation; | 125 float orientation; |
| 126 float tilt; |
123 ToolType tool_type; | 127 ToolType tool_type; |
124 } cached_pointers_[MAX_POINTERS_TO_CACHE]; | 128 } cached_pointers_[MAX_POINTERS_TO_CACHE]; |
125 | 129 |
126 // A unique identifier for the Android motion event. | 130 // A unique identifier for the Android motion event. |
127 const uint32 unique_event_id_; | 131 const uint32 unique_event_id_; |
128 | 132 |
129 DISALLOW_COPY_AND_ASSIGN(MotionEventAndroid); | 133 DISALLOW_COPY_AND_ASSIGN(MotionEventAndroid); |
130 }; | 134 }; |
131 | 135 |
132 } // namespace content | 136 } // namespace content |
133 | 137 |
134 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 138 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
OLD | NEW |