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

Side by Side Diff: ui/events/x/events_x.cc

Issue 1586653002: ui: Fix TouchEvent PointerDetails creation from NativeEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase following X event refactor Created 4 years, 11 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/win/events_win.cc ('k') | ui/events/x/events_x_unittest.cc » ('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 (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
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
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
OLDNEW
« no previous file with comments | « ui/events/win/events_win.cc ('k') | ui/events/x/events_x_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698