Chromium Code Reviews| 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/gfx/geometry/point_f.h" | 11 #include "ui/gfx/geometry/point_f.h" |
| 12 #include "ui/gfx/geometry/vector2d_f.h" | 12 #include "ui/gfx/geometry/vector2d_f.h" |
| 13 | 13 |
| 14 namespace base { | 14 namespace base { |
| 15 class TimeDelta; | 15 class TimeDelta; |
| 16 } | 16 } |
| 17 | 17 |
| 18 namespace gfx { | 18 namespace gfx { |
| 19 class PointF; | 19 class PointF; |
| 20 class Vector2dF; | 20 class Vector2dF; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace ui { | 23 namespace ui { |
| 24 | 24 |
| 25 class Event; | 25 class Event; |
| 26 | 26 |
| 27 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; | 27 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; |
| 28 | 28 |
| 29 typedef base::Callback<void(int device_id, unsigned int code, bool down)> | |
|
alexst (slow to review)
2015/01/26 22:18:25
My brain wants more structure here.
You are pass
spang
2015/01/26 23:01:21
We could remove the structs once the 7 argument li
spang
2015/01/27 21:31:54
Done.
| |
| 30 KeyEventDispatchCallback; | |
| 31 | |
| 29 struct TouchEventParams { | 32 struct TouchEventParams { |
| 30 TouchEventParams(int device_id, | 33 TouchEventParams(int device_id, |
| 31 int touch_id, | 34 int touch_id, |
| 32 EventType type, | 35 EventType type, |
| 33 const gfx::PointF& location, | 36 const gfx::PointF& location, |
| 34 const gfx::Vector2dF& radii, | 37 const gfx::Vector2dF& radii, |
| 35 float pressure, | 38 float pressure, |
| 36 const base::TimeDelta& timestamp); | 39 const base::TimeDelta& timestamp); |
| 37 TouchEventParams(const TouchEventParams& other); | 40 TouchEventParams(const TouchEventParams& other); |
| 38 ~TouchEventParams(); | 41 ~TouchEventParams(); |
| 39 | 42 |
| 40 int device_id; | 43 int device_id; |
| 41 int touch_id; | 44 int touch_id; |
| 42 EventType type; | 45 EventType type; |
| 43 gfx::PointF location; | 46 gfx::PointF location; |
| 44 gfx::Vector2dF radii; | 47 gfx::Vector2dF radii; |
| 45 float pressure; | 48 float pressure; |
| 46 base::TimeDelta timestamp; | 49 base::TimeDelta timestamp; |
| 47 }; | 50 }; |
| 48 | 51 |
| 49 typedef base::Callback<void(const TouchEventParams& params)> | 52 typedef base::Callback<void(const TouchEventParams& params)> |
| 50 TouchEventDispatchCallback; | 53 TouchEventDispatchCallback; |
| 51 | 54 |
| 52 } // namspace ui | 55 } // namspace ui |
| 53 | 56 |
| 54 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ | 57 #endif // UI_EVENTS_OZONE_EVDEV_EVENT_DISPATCH_CALLBACK_H_ |
| OLD | NEW |