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

Side by Side Diff: ui/events/gestures/motion_event_aura.h

Issue 567783002: Add modifier flags to MotionEvent (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove MotionEvent modifiers Created 6 years, 3 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/gestures/gesture_provider_aura.cc ('k') | ui/events/gestures/motion_event_aura.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 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 UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 5 #ifndef UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 6 #define UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 21 matching lines...) Expand all
32 virtual float GetX(size_t pointer_index) const OVERRIDE; 32 virtual float GetX(size_t pointer_index) const OVERRIDE;
33 virtual float GetY(size_t pointer_index) const OVERRIDE; 33 virtual float GetY(size_t pointer_index) const OVERRIDE;
34 virtual float GetRawX(size_t pointer_index) const OVERRIDE; 34 virtual float GetRawX(size_t pointer_index) const OVERRIDE;
35 virtual float GetRawY(size_t pointer_index) const OVERRIDE; 35 virtual float GetRawY(size_t pointer_index) const OVERRIDE;
36 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE; 36 virtual float GetTouchMajor(size_t pointer_index) const OVERRIDE;
37 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE; 37 virtual float GetTouchMinor(size_t pointer_index) const OVERRIDE;
38 virtual float GetOrientation(size_t pointer_index) const OVERRIDE; 38 virtual float GetOrientation(size_t pointer_index) const OVERRIDE;
39 virtual float GetPressure(size_t pointer_index) const OVERRIDE; 39 virtual float GetPressure(size_t pointer_index) const OVERRIDE;
40 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE; 40 virtual ToolType GetToolType(size_t pointer_index) const OVERRIDE;
41 virtual int GetButtonState() const OVERRIDE; 41 virtual int GetButtonState() const OVERRIDE;
42 virtual int GetFlags() const OVERRIDE;
42 virtual base::TimeTicks GetEventTime() const OVERRIDE; 43 virtual base::TimeTicks GetEventTime() const OVERRIDE;
43 44
44 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE; 45 virtual scoped_ptr<MotionEvent> Clone() const OVERRIDE;
45 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE; 46 virtual scoped_ptr<MotionEvent> Cancel() const OVERRIDE;
46 47
47 int GetSourceDeviceId(size_t pointer_index) const; 48 int GetSourceDeviceId(size_t pointer_index) const;
48 49
49 // We can't cleanup removed touch points immediately upon receipt of a 50 // We can't cleanup removed touch points immediately upon receipt of a
50 // TouchCancel or TouchRelease, as the MotionEvent needs to be able to report 51 // TouchCancel or TouchRelease, as the MotionEvent needs to be able to report
51 // information about those touch events. Once the MotionEvent has been 52 // information about those touch events. Once the MotionEvent has been
(...skipping 14 matching lines...) Expand all
66 float touch_major; 67 float touch_major;
67 float touch_minor; 68 float touch_minor;
68 float orientation; 69 float orientation;
69 }; 70 };
70 71
71 MotionEventAura( 72 MotionEventAura(
72 size_t pointer_count, 73 size_t pointer_count,
73 const base::TimeTicks& last_touch_time, 74 const base::TimeTicks& last_touch_time,
74 Action cached_action, 75 Action cached_action,
75 int cached_action_index, 76 int cached_action_index,
77 int flags,
76 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT]); 78 const PointData (&active_touches)[MotionEvent::MAX_TOUCH_POINT_COUNT]);
77 79
78 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch); 80 static PointData GetPointDataFromTouchEvent(const TouchEvent& touch);
79 void AddTouch(const TouchEvent& touch); 81 void AddTouch(const TouchEvent& touch);
80 void UpdateTouch(const TouchEvent& touch); 82 void UpdateTouch(const TouchEvent& touch);
81 void UpdateCachedAction(const TouchEvent& touch); 83 void UpdateCachedAction(const TouchEvent& touch);
82 size_t GetIndexFromId(int id) const; 84 size_t GetIndexFromId(int id) const;
83 85
84 size_t pointer_count_; 86 size_t pointer_count_;
85 base::TimeTicks last_touch_time_; 87 base::TimeTicks last_touch_time_;
86 Action cached_action_; 88 Action cached_action_;
87 // The index of the touch responsible for last ACTION_POINTER_DOWN or 89 // The index of the touch responsible for last ACTION_POINTER_DOWN or
88 // ACTION_POINTER_UP. -1 if no such action has occurred. 90 // ACTION_POINTER_UP. -1 if no such action has occurred.
89 int cached_action_index_; 91 int cached_action_index_;
92 int flags_;
90 93
91 // We want constant time indexing by pointer_index, and fast indexing by id. 94 // We want constant time indexing by pointer_index, and fast indexing by id.
92 PointData active_touches_[MotionEvent::MAX_TOUCH_POINT_COUNT]; 95 PointData active_touches_[MotionEvent::MAX_TOUCH_POINT_COUNT];
93 96
94 DISALLOW_COPY_AND_ASSIGN(MotionEventAura); 97 DISALLOW_COPY_AND_ASSIGN(MotionEventAura);
95 }; 98 };
96 99
97 } // namespace ui 100 } // namespace ui
98 101
99 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_ 102 #endif // UI_EVENTS_GESTURE_DETECTION_UI_MOTION_EVENT_H_
OLDNEW
« no previous file with comments | « ui/events/gestures/gesture_provider_aura.cc ('k') | ui/events/gestures/motion_event_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698