| 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" | 9 #include "base/time/time.h" |
| 10 #include "ui/events/event_constants.h" | 10 #include "ui/events/event_constants.h" |
| 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 11 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 12 #include "ui/gfx/geometry/point_f.h" | 12 #include "ui/gfx/geometry/point_f.h" |
| 13 #include "ui/gfx/geometry/vector2d_f.h" | 13 #include "ui/gfx/geometry/vector2d_f.h" |
| 14 | 14 |
| 15 namespace base { | 15 namespace base { |
| 16 class TimeDelta; | 16 class TimeDelta; |
| 17 } | 17 } |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class PointF; | 20 class PointF; |
| 21 class Vector2dF; | 21 class Vector2dF; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace ui { | 24 namespace ui { |
| 25 | 25 |
| 26 class Event; | 26 class Event; |
| 27 | 27 |
| 28 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; | 28 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; |
| 29 | 29 |
| 30 struct EVENTS_OZONE_EVDEV_EXPORT KeyEventParams { |
| 31 KeyEventParams(int device_id, unsigned int code, bool down); |
| 32 KeyEventParams(const KeyEventParams& other); |
| 33 ~KeyEventParams(); |
| 34 |
| 35 int device_id; |
| 36 unsigned int code; |
| 37 bool down; |
| 38 }; |
| 39 |
| 40 typedef base::Callback<void(const KeyEventParams& params)> |
| 41 KeyEventDispatchCallback; |
| 42 |
| 30 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams { | 43 struct EVENTS_OZONE_EVDEV_EXPORT TouchEventParams { |
| 31 TouchEventParams(int device_id, | 44 TouchEventParams(int device_id, |
| 32 int touch_id, | 45 int touch_id, |
| 33 EventType type, | 46 EventType type, |
| 34 const gfx::PointF& location, | 47 const gfx::PointF& location, |
| 35 const gfx::Vector2dF& radii, | 48 const gfx::Vector2dF& radii, |
| 36 float pressure, | 49 float pressure, |
| 37 const base::TimeDelta& timestamp); | 50 const base::TimeDelta& timestamp); |
| 38 TouchEventParams(const TouchEventParams& other); | 51 TouchEventParams(const TouchEventParams& other); |
| 39 ~TouchEventParams(); | 52 ~TouchEventParams(); |
| 40 | 53 |
| 41 int device_id; | 54 int device_id; |
| 42 int touch_id; | 55 int touch_id; |
| 43 EventType type; | 56 EventType type; |
| 44 gfx::PointF location; | 57 gfx::PointF location; |
| 45 gfx::Vector2dF radii; | 58 gfx::Vector2dF radii; |
| 46 float pressure; | 59 float pressure; |
| 47 base::TimeDelta timestamp; | 60 base::TimeDelta timestamp; |
| 48 }; | 61 }; |
| 49 | 62 |
| 50 typedef base::Callback<void(const TouchEventParams& params)> | 63 typedef base::Callback<void(const TouchEventParams& params)> |
| 51 TouchEventDispatchCallback; | 64 TouchEventDispatchCallback; |
| 52 | 65 |
| 53 } // namspace ui | 66 } // namspace ui |
| 54 | 67 |
| 55 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ | 68 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
| OLD | NEW |