| OLD | NEW |
| 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_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/time/time.h" | |
| 10 #include "ui/events/event_constants.h" | |
| 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | |
| 12 #include "ui/gfx/geometry/point_f.h" | |
| 13 #include "ui/gfx/geometry/vector2d.h" | |
| 14 #include "ui/gfx/geometry/vector2d_f.h" | |
| 15 | |
| 16 namespace base { | |
| 17 class TimeDelta; | |
| 18 } | |
| 19 | |
| 20 namespace gfx { | |
| 21 class PointF; | |
| 22 class Vector2d; | |
| 23 class Vector2dF; | |
| 24 } | |
| 25 | 9 |
| 26 namespace ui { | 10 namespace ui { |
| 27 | 11 |
| 28 class Event; | 12 class Event; |
| 29 | 13 |
| 30 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; | 14 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; |
| 31 | 15 |
| 32 struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams { | |
| 33 KeyEventParams(int device_id, unsigned int code, bool down); | |
| 34 KeyEventParams(const KeyEventParams& other); | |
| 35 ~KeyEventParams(); | |
| 36 | |
| 37 int device_id; | |
| 38 unsigned int code; | |
| 39 bool down; | |
| 40 }; | |
| 41 | |
| 42 typedef base::Callback<void(const KeyEventParams& params)> | |
| 43 KeyEventDispatchCallback; | |
| 44 | |
| 45 struct EVENTS_OZONE_EVDEV_EXPORT MouseMoveEventParams { | |
| 46 MouseMoveEventParams(int device_id, const gfx::PointF& location); | |
| 47 MouseMoveEventParams(const MouseMoveEventParams& other); | |
| 48 ~MouseMoveEventParams(); | |
| 49 | |
| 50 int device_id; | |
| 51 gfx::PointF location; | |
| 52 }; | |
| 53 | |
| 54 typedef base::Callback<void(const MouseMoveEventParams& params)> | |
| 55 MouseMoveEventDispatchCallback; | |
| 56 | |
| 57 struct EVENTS_OZONE_EVDEV_EXPORT MouseButtonEventParams { | |
| 58 MouseButtonEventParams(int device_id, | |
| 59 const gfx::PointF& location, | |
| 60 unsigned int button, | |
| 61 bool down, | |
| 62 bool allow_remap); | |
| 63 MouseButtonEventParams(const MouseButtonEventParams& other); | |
| 64 ~MouseButtonEventParams(); | |
| 65 | |
| 66 int device_id; | |
| 67 gfx::PointF location; | |
| 68 unsigned int button; | |
| 69 bool down; | |
| 70 bool allow_remap; | |
| 71 }; | |
| 72 | |
| 73 typedef base::Callback<void(const MouseButtonEventParams& params)> | |
| 74 MouseButtonEventDispatchCallback; | |
| 75 | |
| 76 struct EVENTS_OZONE_EVDEV_EXPORT MouseWheelEventParams { | |
| 77 MouseWheelEventParams(int device_id, | |
| 78 const gfx::PointF& location, | |
| 79 const gfx::Vector2d& delta); | |
| 80 MouseWheelEventParams(const MouseWheelEventParams& other); | |
| 81 ~MouseWheelEventParams(); | |
| 82 | |
| 83 int device_id; | |
| 84 gfx::PointF location; | |
| 85 gfx::Vector2d delta; | |
| 86 }; | |
| 87 | |
| 88 typedef base::Callback<void(const MouseWheelEventParams& params)> | |
| 89 MouseWheelEventDispatchCallback; | |
| 90 | |
| 91 struct EVENTS_OZONE_EVDEV_EXPORT ScrollEventParams { | |
| 92 ScrollEventParams(int device_id, | |
| 93 EventType type, | |
| 94 const gfx::PointF location, | |
| 95 const gfx::Vector2dF delta, | |
| 96 const gfx::Vector2dF ordinal_delta, | |
| 97 int finger_count, | |
| 98 const base::TimeDelta timestamp); | |
| 99 ScrollEventParams(const ScrollEventParams& other); | |
| 100 ~ScrollEventParams(); | |
| 101 | |
| 102 int device_id; | |
| 103 EventType type; | |
| 104 const gfx::PointF location; | |
| 105 const gfx::Vector2dF delta; | |
| 106 const gfx::Vector2dF ordinal_delta; | |
| 107 int finger_count; | |
| 108 const base::TimeDelta timestamp; | |
| 109 }; | |
| 110 | |
| 111 typedef base::Callback<void(const ScrollEventParams& params)> | |
| 112 ScrollEventDispatchCallback; | |
| 113 | |
| 114 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams { | |
| 115 TouchEventParams(int device_id, | |
| 116 int touch_id, | |
| 117 EventType type, | |
| 118 const gfx::PointF& location, | |
| 119 const gfx::Vector2dF& radii, | |
| 120 float pressure, | |
| 121 const base::TimeDelta& timestamp); | |
| 122 TouchEventParams(const TouchEventParams& other); | |
| 123 ~TouchEventParams(); | |
| 124 | |
| 125 int device_id; | |
| 126 int touch_id; | |
| 127 EventType type; | |
| 128 gfx::PointF location; | |
| 129 gfx::Vector2dF radii; | |
| 130 float pressure; | |
| 131 base::TimeDelta timestamp; | |
| 132 }; | |
| 133 | |
| 134 typedef base::Callback<void(const TouchEventParams& params)> | |
| 135 TouchEventDispatchCallback; | |
| 136 | |
| 137 } // namspace ui | 16 } // namspace ui |
| 138 | 17 |
| 139 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ | 18 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
| OLD | NEW |