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