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: views/events/event.h

Issue 7129008: Update rich touch information to conform to standard (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: addressing sky's comments Created 9 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views.cc ('k') | views/events/event.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 VIEWS_EVENTS_EVENT_H_ 5 #ifndef VIEWS_EVENTS_EVENT_H_
6 #define VIEWS_EVENTS_EVENT_H_ 6 #define VIEWS_EVENTS_EVENT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 class TouchEvent : public LocatedEvent { 254 class TouchEvent : public LocatedEvent {
255 public: 255 public:
256 TouchEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native); 256 TouchEvent(NativeEvent2 native_event_2, FromNativeEvent2 from_native);
257 257
258 // Create a new touch event. 258 // Create a new touch event.
259 TouchEvent(ui::EventType type, 259 TouchEvent(ui::EventType type,
260 int x, 260 int x,
261 int y, 261 int y,
262 int flags, 262 int flags,
263 int touch_id, 263 int touch_id,
264 float radius, 264 float radius_x,
265 float angle, 265 float radius_y,
266 float ratio); 266 float angle);
267 267
268 // Create a new TouchEvent which is identical to the provided model. 268 // Create a new TouchEvent which is identical to the provided model.
269 // If source / target views are provided, the model location will be converted 269 // If source / target views are provided, the model location will be converted
270 // from |source| coordinate system to |target| coordinate system. 270 // from |source| coordinate system to |target| coordinate system.
271 TouchEvent(const TouchEvent& model, View* source, View* target); 271 TouchEvent(const TouchEvent& model, View* source, View* target);
272 272
273 int identity() const { return touch_id_; } 273 int identity() const { return touch_id_; }
274 274
275 float radius() const { return radius_; } 275 float radius_x() const { return radius_x_; }
276 float radius_y() const { return radius_y_; }
276 float angle() const { return angle_; } 277 float angle() const { return angle_; }
277 float ratio() const { return ratio_; }
278 278
279 private: 279 private:
280 friend class internal::RootView; 280 friend class internal::RootView;
281 281
282 TouchEvent(const TouchEvent& model, View* root); 282 TouchEvent(const TouchEvent& model, View* root);
283 283
284 // The identity (typically finger) of the touch starting at 0 and incrementing 284 // The identity (typically finger) of the touch starting at 0 and incrementing
285 // for each separable additional touch that the hardware can detect. 285 // for each separable additional touch that the hardware can detect.
286 const int touch_id_; 286 const int touch_id_;
287 287
288 // Half length of the major axis of the touch ellipse. Default 0.0. 288 // Radius of the X (major) axis of the touch ellipse. 1.0 if unknown.
289 const float radius_; 289 const float radius_x_;
290
291 // Radius of the Y (minor) axis of the touch ellipse. 1.0 if unknown.
292 const float radius_y_;
290 293
291 // Angle of the major axis away from the X axis. Default 0.0. 294 // Angle of the major axis away from the X axis. Default 0.0.
292 const float angle_; 295 const float angle_;
293 296
294 // Length ratio between major axis and minor axis of the touch ellipse. 1.0
295 // if only the major axis is available, prentending the touch is a circle.
296 const float ratio_;
297
298 DISALLOW_COPY_AND_ASSIGN(TouchEvent); 297 DISALLOW_COPY_AND_ASSIGN(TouchEvent);
299 }; 298 };
300 #endif 299 #endif
301 300
302 //////////////////////////////////////////////////////////////////////////////// 301 ////////////////////////////////////////////////////////////////////////////////
303 // KeyEvent class 302 // KeyEvent class
304 // 303 //
305 // KeyEvent encapsulates keyboard input events - key press and release. 304 // KeyEvent encapsulates keyboard input events - key press and release.
306 // 305 //
307 //////////////////////////////////////////////////////////////////////////////// 306 ////////////////////////////////////////////////////////////////////////////////
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 419
421 // Bitmask of supported ui::DragDropTypes::DragOperation by the source. 420 // Bitmask of supported ui::DragDropTypes::DragOperation by the source.
422 int source_operations_; 421 int source_operations_;
423 422
424 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent); 423 DISALLOW_COPY_AND_ASSIGN(DropTargetEvent);
425 }; 424 };
426 425
427 } // namespace views 426 } // namespace views
428 427
429 #endif // VIEWS_EVENTS_EVENT_H_ 428 #endif // VIEWS_EVENTS_EVENT_H_
OLDNEW
« no previous file with comments | « chrome/browser/renderer_host/render_widget_host_view_views.cc ('k') | views/events/event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698