Chromium Code Reviews| 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> | |
| 9 | |
| 8 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "ui/events/devices/input_device.h" | |
| 12 #include "ui/events/devices/keyboard_device.h" | |
| 13 #include "ui/events/devices/touchscreen_device.h" | |
| 9 #include "ui/events/event_constants.h" | 14 #include "ui/events/event_constants.h" |
| 10 #include "ui/gfx/geometry/point_f.h" | 15 #include "ui/gfx/geometry/point_f.h" |
| 11 #include "ui/gfx/geometry/vector2d.h" | 16 #include "ui/gfx/geometry/vector2d.h" |
| 12 #include "ui/gfx/geometry/vector2d_f.h" | 17 #include "ui/gfx/geometry/vector2d_f.h" |
| 13 | 18 |
| 14 namespace ui { | 19 namespace ui { |
| 15 | 20 |
| 16 struct ScrollEventParams { | 21 struct ScrollEventParams { |
| 17 ScrollEventParams(int device_id, | 22 ScrollEventParams(int device_id, |
| 18 EventType type, | 23 EventType type, |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 47 int device_id; | 52 int device_id; |
| 48 int touch_id; | 53 int touch_id; |
| 49 EventType type; | 54 EventType type; |
| 50 gfx::PointF location; | 55 gfx::PointF location; |
| 51 gfx::Vector2dF radii; | 56 gfx::Vector2dF radii; |
| 52 float pressure; | 57 float pressure; |
| 53 base::TimeDelta timestamp; | 58 base::TimeDelta timestamp; |
| 54 }; | 59 }; |
| 55 | 60 |
| 56 // Interface used by device objects for event dispatch. | 61 // Interface used by device objects for event dispatch. |
| 57 class DeviceEventDispatcherEvdev { | 62 class DeviceEventDispatcherEvdev { |
|
alexst (slow to review)
2015/01/28 16:16:44
Please add some threading notes.
spang
2015/01/28 19:04:54
To #11, there's no thread until.
| |
| 58 public: | 63 public: |
| 59 DeviceEventDispatcherEvdev() {} | 64 DeviceEventDispatcherEvdev() {} |
| 60 virtual ~DeviceEventDispatcherEvdev() {} | 65 virtual ~DeviceEventDispatcherEvdev() {} |
| 61 | 66 |
| 67 // User input events. | |
| 62 virtual void DispatchKeyEvent(int device_id, | 68 virtual void DispatchKeyEvent(int device_id, |
| 63 unsigned int code, | 69 unsigned int code, |
| 64 bool down) = 0; | 70 bool down) = 0; |
| 65 virtual void DispatchMouseMoveEvent(int device_id, | 71 virtual void DispatchMouseMoveEvent(int device_id, |
| 66 const gfx::PointF& location) = 0; | 72 const gfx::PointF& location) = 0; |
| 67 virtual void DispatchMouseButtonEvent(int device_id, | 73 virtual void DispatchMouseButtonEvent(int device_id, |
| 68 const gfx::PointF& location, | 74 const gfx::PointF& location, |
| 69 unsigned int button, | 75 unsigned int button, |
| 70 bool down, | 76 bool down, |
| 71 bool allow_remap) = 0; | 77 bool allow_remap) = 0; |
| 72 virtual void DispatchMouseWheelEvent(int device_id, | 78 virtual void DispatchMouseWheelEvent(int device_id, |
| 73 const gfx::PointF& location, | 79 const gfx::PointF& location, |
| 74 const gfx::Vector2d& delta) = 0; | 80 const gfx::Vector2d& delta) = 0; |
| 75 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0; | 81 virtual void DispatchScrollEvent(const ScrollEventParams& params) = 0; |
| 76 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0; | 82 virtual void DispatchTouchEvent(const TouchEventParams& params) = 0; |
| 83 | |
| 84 // Device lifecycle events. | |
| 85 virtual void DispatchKeyboardDevicesUpdated( | |
| 86 const std::vector<KeyboardDevice>& devices) = 0; | |
| 87 virtual void DispatchTouchscreenDevicesUpdated( | |
| 88 const std::vector<TouchscreenDevice>& devices) = 0; | |
| 89 virtual void DispatchMouseDevicesUpdated( | |
| 90 const std::vector<InputDevice>& devices) = 0; | |
| 91 virtual void DispatchTouchpadDevicesUpdated( | |
| 92 const std::vector<InputDevice>& devices) = 0; | |
| 77 }; | 93 }; |
| 78 | 94 |
| 79 } // namespace | 95 } // namespace |
| 80 | 96 |
| 81 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ | 97 #endif // UI_EVENTS_OZONE_EVDEV_DEVICE_EVENT_DISPATCHER_H_ |
| OLD | NEW |