OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
11 #include "ui/events/devices/input_device.h" | 11 #include "ui/events/devices/input_device.h" |
12 #include "ui/events/devices/touchscreen_device.h" | 12 #include "ui/events/devices/touchscreen_device.h" |
13 #include "ui/events/event.h" | 13 #include "ui/events/event.h" |
14 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
16 #include "ui/gfx/geometry/point_f.h" | 16 #include "ui/gfx/geometry/point_f.h" |
17 #include "ui/gfx/geometry/vector2d.h" | 17 #include "ui/gfx/geometry/vector2d.h" |
18 #include "ui/gfx/geometry/vector2d_f.h" | 18 #include "ui/gfx/geometry/vector2d_f.h" |
19 | 19 |
20 namespace ui { | 20 namespace ui { |
21 | 21 |
22 struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams { | 22 struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams { |
23 KeyEventParams(int device_id, | 23 KeyEventParams(int device_id, |
24 unsigned int code, | 24 unsigned int code, |
25 bool down, | 25 bool down, |
26 bool suppress_auto_repeat, | 26 bool suppress_auto_repeat, |
27 base::TimeDelta timestamp); | 27 base::TimeTicks timestamp); |
28 KeyEventParams(const KeyEventParams& other); | 28 KeyEventParams(const KeyEventParams& other); |
29 ~KeyEventParams(); | 29 ~KeyEventParams(); |
30 | 30 |
31 int device_id; | 31 int device_id; |
32 unsigned int code; | 32 unsigned int code; |
33 bool down; | 33 bool down; |
34 bool suppress_auto_repeat; | 34 bool suppress_auto_repeat; |
35 base::TimeDelta timestamp; | 35 base::TimeTicks timestamp; |
36 }; | 36 }; |
37 | 37 |
38 struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams { | 38 struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams { |
39 MouseMoveEventParams(int device_id, | 39 MouseMoveEventParams(int device_id, |
40 const gfx::PointF& location, | 40 const gfx::PointF& location, |
41 const PointerDetails& details, | 41 const PointerDetails& details, |
42 base::TimeDelta timestamp); | 42 base::TimeTicks timestamp); |
43 MouseMoveEventParams(const MouseMoveEventParams& other); | 43 MouseMoveEventParams(const MouseMoveEventParams& other); |
44 ~MouseMoveEventParams(); | 44 ~MouseMoveEventParams(); |
45 | 45 |
46 int device_id; | 46 int device_id; |
47 gfx::PointF location; | 47 gfx::PointF location; |
48 PointerDetails pointer_details; | 48 PointerDetails pointer_details; |
49 base::TimeDelta timestamp; | 49 base::TimeTicks timestamp; |
50 }; | 50 }; |
51 | 51 |
52 struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams { | 52 struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams { |
53 MouseButtonEventParams(int device_id, | 53 MouseButtonEventParams(int device_id, |
54 const gfx::PointF& location, | 54 const gfx::PointF& location, |
55 unsigned int button, | 55 unsigned int button, |
56 bool down, | 56 bool down, |
57 bool allow_remap, | 57 bool allow_remap, |
58 const PointerDetails& details, | 58 const PointerDetails& details, |
59 base::TimeDelta timestamp); | 59 base::TimeTicks timestamp); |
60 MouseButtonEventParams(const MouseButtonEventParams& other); | 60 MouseButtonEventParams(const MouseButtonEventParams& other); |
61 ~MouseButtonEventParams(); | 61 ~MouseButtonEventParams(); |
62 | 62 |
63 int device_id; | 63 int device_id; |
64 gfx::PointF location; | 64 gfx::PointF location; |
65 unsigned int button; | 65 unsigned int button; |
66 bool down; | 66 bool down; |
67 bool allow_remap; | 67 bool allow_remap; |
68 PointerDetails pointer_details; | 68 PointerDetails pointer_details; |
69 base::TimeDelta timestamp; | 69 base::TimeTicks timestamp; |
70 }; | 70 }; |
71 | 71 |
72 struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams { | 72 struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams { |
73 MouseWheelEventParams(int device_id, | 73 MouseWheelEventParams(int device_id, |
74 const gfx::PointF& location, | 74 const gfx::PointF& location, |
75 const gfx::Vector2d& delta, | 75 const gfx::Vector2d& delta, |
76 base::TimeDelta timestamp); | 76 base::TimeTicks timestamp); |
77 MouseWheelEventParams(const MouseWheelEventParams& other); | 77 MouseWheelEventParams(const MouseWheelEventParams& other); |
78 ~MouseWheelEventParams(); | 78 ~MouseWheelEventParams(); |
79 | 79 |
80 int device_id; | 80 int device_id; |
81 gfx::PointF location; | 81 gfx::PointF location; |
82 gfx::Vector2d delta; | 82 gfx::Vector2d delta; |
83 base::TimeDelta timestamp; | 83 base::TimeTicks timestamp; |
84 }; | 84 }; |
85 | 85 |
86 struct EVENTS_OZONE_EVDEV_EXPORT PinchEventParams { | 86 struct EVENTS_OZONE_EVDEV_EXPORT PinchEventParams { |
87 PinchEventParams(int device_id, | 87 PinchEventParams(int device_id, |
88 EventType type, | 88 EventType type, |
89 const gfx::PointF location, | 89 const gfx::PointF location, |
90 float scale, | 90 float scale, |
91 const base::TimeDelta timestamp); | 91 const base::TimeTicks timestamp); |
92 PinchEventParams(const PinchEventParams& other); | 92 PinchEventParams(const PinchEventParams& other); |
93 ~PinchEventParams(); | 93 ~PinchEventParams(); |
94 | 94 |
95 int device_id; | 95 int device_id; |
96 EventType type; | 96 EventType type; |
97 const gfx::PointF location; | 97 const gfx::PointF location; |
98 float scale; | 98 float scale; |
99 const base::TimeDelta timestamp; | 99 const base::TimeTicks timestamp; |
100 }; | 100 }; |
101 | 101 |
102 struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams { | 102 struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams { |
103 ScrollEventParams(int device_id, | 103 ScrollEventParams(int device_id, |
104 EventType type, | 104 EventType type, |
105 const gfx::PointF location, | 105 const gfx::PointF location, |
106 const gfx::Vector2dF& delta, | 106 const gfx::Vector2dF& delta, |
107 const gfx::Vector2dF& ordinal_delta, | 107 const gfx::Vector2dF& ordinal_delta, |
108 int finger_count, | 108 int finger_count, |
109 const base::TimeDelta timestamp); | 109 const base::TimeTicks timestamp); |
110 ScrollEventParams(const ScrollEventParams& other); | 110 ScrollEventParams(const ScrollEventParams& other); |
111 ~ScrollEventParams(); | 111 ~ScrollEventParams(); |
112 | 112 |
113 int device_id; | 113 int device_id; |
114 EventType type; | 114 EventType type; |
115 const gfx::PointF location; | 115 const gfx::PointF location; |
116 const gfx::Vector2dF delta; | 116 const gfx::Vector2dF delta; |
117 const gfx::Vector2dF ordinal_delta; | 117 const gfx::Vector2dF ordinal_delta; |
118 int finger_count; | 118 int finger_count; |
119 const base::TimeDelta timestamp; | 119 const base::TimeTicks timestamp; |
120 }; | 120 }; |
121 | 121 |
122 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams { | 122 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams { |
123 TouchEventParams(int device_id, | 123 TouchEventParams(int device_id, |
124 int slot, | 124 int slot, |
125 EventType type, | 125 EventType type, |
126 const gfx::PointF& location, | 126 const gfx::PointF& location, |
127 const PointerDetails& pointer_details, | 127 const PointerDetails& pointer_details, |
128 const base::TimeDelta& timestamp); | 128 const base::TimeTicks& timestamp); |
129 TouchEventParams(const TouchEventParams& other); | 129 TouchEventParams(const TouchEventParams& other); |
130 ~TouchEventParams(); | 130 ~TouchEventParams(); |
131 | 131 |
132 int device_id; | 132 int device_id; |
133 int slot; | 133 int slot; |
134 EventType type; | 134 EventType type; |
135 gfx::PointF location; | 135 gfx::PointF location; |
136 PointerDetails pointer_details; | 136 PointerDetails pointer_details; |
137 base::TimeDelta timestamp; | 137 base::TimeTicks timestamp; |
138 }; | 138 }; |
139 | 139 |
140 // Interface used by device objects for event dispatch. | 140 // Interface used by device objects for event dispatch. |
141 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev { | 141 class EVENTS_OZONE_EVDEV_EXPORT DeviceEventDispatcherEvdev { |
142 public: | 142 public: |
143 DeviceEventDispatcherEvdev() {} | 143 DeviceEventDispatcherEvdev() {} |
144 virtual ~DeviceEventDispatcherEvdev() {} | 144 virtual ~DeviceEventDispatcherEvdev() {} |
145 | 145 |
146 // User input events. | 146 // User input events. |
147 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0; | 147 virtual void DispatchKeyEvent(const KeyEventParams& params) = 0; |
(...skipping 13 matching lines...) Expand all Loading... |
161 virtual void DispatchMouseDevicesUpdated( | 161 virtual void DispatchMouseDevicesUpdated( |
162 const std::vector<InputDevice>& devices) = 0; | 162 const std::vector<InputDevice>& devices) = 0; |
163 virtual void DispatchTouchpadDevicesUpdated( | 163 virtual void DispatchTouchpadDevicesUpdated( |
164 const std::vector<InputDevice>& devices) = 0; | 164 const std::vector<InputDevice>& devices) = 0; |
165 virtual void DispatchDeviceListsComplete() = 0; | 165 virtual void DispatchDeviceListsComplete() = 0; |
166 }; | 166 }; |
167 | 167 |
168 } // namespace ui | 168 } // namespace ui |
169 | 169 |
170 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ | 170 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
OLD | NEW |