| 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 | 9 |
| 10 #include "base/android/scoped_java_ref.h" | 10 #include "base/android/scoped_java_ref.h" |
| (...skipping 29 matching lines...) Expand all Loading... |
| 40 jfloat touch_major_0_pixels, | 40 jfloat touch_major_0_pixels, |
| 41 jfloat touch_major_1_pixels, | 41 jfloat touch_major_1_pixels, |
| 42 jfloat touch_minor_0_pixels, | 42 jfloat touch_minor_0_pixels, |
| 43 jfloat touch_minor_1_pixels, | 43 jfloat touch_minor_1_pixels, |
| 44 jfloat orientation_0_rad, | 44 jfloat orientation_0_rad, |
| 45 jfloat orientation_1_rad, | 45 jfloat orientation_1_rad, |
| 46 jfloat raw_pos_x_pixels, | 46 jfloat raw_pos_x_pixels, |
| 47 jfloat raw_pos_y_pixels, | 47 jfloat raw_pos_y_pixels, |
| 48 jint android_tool_type_0, | 48 jint android_tool_type_0, |
| 49 jint android_tool_type_1, | 49 jint android_tool_type_1, |
| 50 jint android_button_state); | 50 jint android_button_state, |
| 51 jint meta_state); |
| 51 virtual ~MotionEventAndroid(); | 52 virtual ~MotionEventAndroid(); |
| 52 | 53 |
| 53 // ui::MotionEvent methods. | 54 // ui::MotionEvent methods. |
| 54 virtual int GetId() const OVERRIDE; | 55 virtual int GetId() const OVERRIDE; |
| 55 virtual Action GetAction() const OVERRIDE; | 56 virtual Action GetAction() const OVERRIDE; |
| 56 virtual int GetActionIndex() const OVERRIDE; | 57 virtual int GetActionIndex() const OVERRIDE; |
| 57 virtual size_t GetPointerCount() const OVERRIDE; | 58 virtual size_t GetPointerCount() const OVERRIDE; |
| 58 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; | 59 virtual int GetPointerId(size_t pointer_index) const OVERRIDE; |
| 59 virtual float GetX(size_t pointer_index) const OVERRIDE; | 60 virtual float GetX(size_t pointer_index) const OVERRIDE; |
| 60 virtual float GetY(size_t pointer_index) const OVERRIDE; | 61 virtual float GetY(size_t pointer_index) const OVERRIDE; |
| 61 virtual float GetRawX(size_t pointer_index) const OVERRIDE; | 62 virtual float GetRawX(size_t pointer_index) const OVERRIDE; |
| 62 virtual float GetRawY(size_t pointer_index) const OVERRIDE; | 63 virtual float GetRawY(size_t pointer_index) const OVERRIDE; |
| 63 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; | 64 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; |
| 64 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE; | 65 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE; |
| 65 virtual float GetOrientation(size_t pointer_index) const OVERRIDE; | 66 virtual float GetOrientation(size_t pointer_index) const OVERRIDE; |
| 66 virtual float GetPressure(size_t pointer_index) const OVERRIDE; | 67 virtual float GetPressure(size_t pointer_index) const OVERRIDE; |
| 67 virtual base::TimeTicks GetEventTime() const OVERRIDE; | 68 virtual base::TimeTicks GetEventTime() const OVERRIDE; |
| 68 virtual size_t GetHistorySize() const OVERRIDE; | 69 virtual size_t GetHistorySize() const OVERRIDE; |
| 69 virtual base::TimeTicks GetHistoricalEventTime( | 70 virtual base::TimeTicks GetHistoricalEventTime( |
| 70 size_t historical_index) const OVERRIDE; | 71 size_t historical_index) const OVERRIDE; |
| 71 virtual float GetHistoricalTouchMajor(size_t pointer_index, | 72 virtual float GetHistoricalTouchMajor(size_t pointer_index, |
| 72 size_t historical_index) const OVERRIDE; | 73 size_t historical_index) const OVERRIDE; |
| 73 virtual float GetHistoricalX(size_t pointer_index, | 74 virtual float GetHistoricalX(size_t pointer_index, |
| 74 size_t historical_index) const OVERRIDE; | 75 size_t historical_index) const OVERRIDE; |
| 75 virtual float GetHistoricalY(size_t pointer_index, | 76 virtual float GetHistoricalY(size_t pointer_index, |
| 76 size_t historical_index) const OVERRIDE; | 77 size_t historical_index) const OVERRIDE; |
| 77 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE; | 78 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE; |
| 78 virtual int GetButtonState() const OVERRIDE; | 79 virtual int GetButtonState() const OVERRIDE; |
| 80 virtual int GetFlags() const OVERRIDE; |
| 79 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; | 81 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; |
| 80 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; | 82 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; |
| 81 | 83 |
| 82 // Additional Android MotionEvent methods. | 84 // Additional Android MotionEvent methods. |
| 83 base::TimeTicks GetDownTime() const; | 85 base::TimeTicks GetDownTime() const; |
| 84 | 86 |
| 85 static bool RegisterMotionEventAndroid(JNIEnv* env); | 87 static bool RegisterMotionEventAndroid(JNIEnv* env); |
| 86 | 88 |
| 87 static base::android::ScopedJavaLocalRef<jobject> Obtain( | 89 static base::android::ScopedJavaLocalRef<jobject> Obtain( |
| 88 const MotionEventAndroid& event); | 90 const MotionEventAndroid& event); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 116 size_t cached_history_size_; | 118 size_t cached_history_size_; |
| 117 int cached_action_index_; | 119 int cached_action_index_; |
| 118 gfx::PointF cached_positions_[MAX_POINTERS_TO_CACHE]; | 120 gfx::PointF cached_positions_[MAX_POINTERS_TO_CACHE]; |
| 119 int cached_pointer_ids_[MAX_POINTERS_TO_CACHE]; | 121 int cached_pointer_ids_[MAX_POINTERS_TO_CACHE]; |
| 120 float cached_touch_majors_[MAX_POINTERS_TO_CACHE]; | 122 float cached_touch_majors_[MAX_POINTERS_TO_CACHE]; |
| 121 float cached_touch_minors_[MAX_POINTERS_TO_CACHE]; | 123 float cached_touch_minors_[MAX_POINTERS_TO_CACHE]; |
| 122 float cached_orientations_[MAX_POINTERS_TO_CACHE]; | 124 float cached_orientations_[MAX_POINTERS_TO_CACHE]; |
| 123 gfx::Vector2dF cached_raw_position_offset_; | 125 gfx::Vector2dF cached_raw_position_offset_; |
| 124 ToolType cached_tool_types_[MAX_POINTERS_TO_CACHE]; | 126 ToolType cached_tool_types_[MAX_POINTERS_TO_CACHE]; |
| 125 int cached_button_state_; | 127 int cached_button_state_; |
| 128 int cached_flags_; |
| 126 | 129 |
| 127 // Used to convert pixel coordinates from the Java-backed MotionEvent to | 130 // Used to convert pixel coordinates from the Java-backed MotionEvent to |
| 128 // DIP coordinates cached/returned by the MotionEventAndroid. | 131 // DIP coordinates cached/returned by the MotionEventAndroid. |
| 129 const float pix_to_dip_; | 132 const float pix_to_dip_; |
| 130 | 133 |
| 131 // Whether |event_| should be recycled on destruction. This will only be true | 134 // Whether |event_| should be recycled on destruction. This will only be true |
| 132 // for those events generated via |Obtain(...)|. | 135 // for those events generated via |Obtain(...)|. |
| 133 bool should_recycle_; | 136 bool should_recycle_; |
| 134 }; | 137 }; |
| 135 | 138 |
| 136 } // namespace content | 139 } // namespace content |
| 137 | 140 |
| 138 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ | 141 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_MOTION_EVENT_ANDROID_H_ |
| OLD | NEW |