| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "ui/events/event_utils.h" | 5 #include "ui/events/event_utils.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <string.h> | 8 #include <string.h> |
| 9 #include <X11/extensions/XInput.h> | 9 #include <X11/extensions/XInput.h> |
| 10 #include <X11/extensions/XInput2.h> | 10 #include <X11/extensions/XInput2.h> |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 147 } |
| 148 | 148 |
| 149 void ClearTouchIdIfReleased(const base::NativeEvent& native_event) { | 149 void ClearTouchIdIfReleased(const base::NativeEvent& native_event) { |
| 150 ClearTouchIdIfReleasedFromXEvent(*native_event); | 150 ClearTouchIdIfReleasedFromXEvent(*native_event); |
| 151 } | 151 } |
| 152 | 152 |
| 153 int GetTouchId(const base::NativeEvent& native_event) { | 153 int GetTouchId(const base::NativeEvent& native_event) { |
| 154 return GetTouchIdFromXEvent(*native_event); | 154 return GetTouchIdFromXEvent(*native_event); |
| 155 } | 155 } |
| 156 | 156 |
| 157 float GetTouchRadiusX(const base::NativeEvent& native_event) { | |
| 158 return GetTouchRadiusXFromXEvent(*native_event); | |
| 159 } | |
| 160 | |
| 161 float GetTouchRadiusY(const base::NativeEvent& native_event) { | |
| 162 return GetTouchRadiusYFromXEvent(*native_event); | |
| 163 } | |
| 164 | |
| 165 float GetTouchAngle(const base::NativeEvent& native_event) { | 157 float GetTouchAngle(const base::NativeEvent& native_event) { |
| 166 return GetTouchAngleFromXEvent(*native_event); | 158 return GetTouchAngleFromXEvent(*native_event); |
| 167 } | 159 } |
| 168 | 160 |
| 169 float GetTouchForce(const base::NativeEvent& native_event) { | 161 PointerDetails GetTouchPointerDetailsFromNative( |
| 170 return GetTouchForceFromXEvent(*native_event); | 162 const base::NativeEvent& native_event) { |
| 163 return PointerDetails(EventPointerType::POINTER_TYPE_TOUCH, |
| 164 GetTouchRadiusXFromXEvent(*native_event), |
| 165 GetTouchRadiusYFromXEvent(*native_event), |
| 166 GetTouchForceFromXEvent(*native_event), |
| 167 /* tilt_x */ 0.f, |
| 168 /* tilt_y */ 0.f); |
| 171 } | 169 } |
| 172 | 170 |
| 173 bool GetScrollOffsets(const base::NativeEvent& native_event, | 171 bool GetScrollOffsets(const base::NativeEvent& native_event, |
| 174 float* x_offset, | 172 float* x_offset, |
| 175 float* y_offset, | 173 float* y_offset, |
| 176 float* x_offset_ordinal, | 174 float* x_offset_ordinal, |
| 177 float* y_offset_ordinal, | 175 float* y_offset_ordinal, |
| 178 int* finger_count) { | 176 int* finger_count) { |
| 179 return GetScrollOffsetsFromXEvent(*native_event, x_offset, y_offset, | 177 return GetScrollOffsetsFromXEvent(*native_event, x_offset, y_offset, |
| 180 x_offset_ordinal, y_offset_ordinal, | 178 x_offset_ordinal, y_offset_ordinal, |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 xievent->detail = | 232 xievent->detail = |
| 235 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); | 233 UpdateX11EventButton(event->changed_button_flags(), xievent->detail); |
| 236 break; | 234 break; |
| 237 } | 235 } |
| 238 default: | 236 default: |
| 239 break; | 237 break; |
| 240 } | 238 } |
| 241 } | 239 } |
| 242 | 240 |
| 243 } // namespace ui | 241 } // namespace ui |
| OLD | NEW |