Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_EVENTS_OZONE_EVDEV_GESTURES_GESTURE_INTERPRETER_LIBEVDEV_CROS_H_ | |
| 6 #define UI_EVENTS_OZONE_EVDEV_GESTURES_GESTURE_INTERPRETER_LIBEVDEV_CROS_H_ | |
| 7 | |
| 8 #include <gestures/gestures.h> | |
| 9 #include <libevdev/libevdev.h> | |
| 10 | |
| 11 #include "base/callback.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "ui/events/events_export.h" | |
| 14 #include "ui/events/ozone/evdev/cursor_delegate_evdev.h" | |
| 15 #include "ui/events/ozone/evdev/gestures/event_reader_libevdev_cros.h" | |
| 16 | |
| 17 namespace ui { | |
| 18 | |
| 19 class Event; | |
| 20 class EventDeviceInfo; | |
| 21 class EventModifiersEvdev; | |
| 22 class CursorDelegateEvdev; | |
| 23 | |
| 24 typedef base::Callback<void(scoped_ptr<Event>)> EventDispatchCallback; | |
| 25 | |
| 26 class EVENTS_EXPORT GestureInterpreterLibevdevCros | |
|
rjkroege
2014/03/11 12:58:47
class comment?
spang
2014/03/11 16:38:11
Done.
| |
| 27 : public EventReaderLibevdevCros::Delegate { | |
| 28 public: | |
| 29 GestureInterpreterLibevdevCros(EventModifiersEvdev* modifiers, | |
| 30 CursorDelegateEvdev* cursor, | |
| 31 const EventDispatchCallback& callback); | |
| 32 virtual ~GestureInterpreterLibevdevCros(); | |
| 33 | |
| 34 // Overriden from ui::EventReaderLibevdevCros::Delegate | |
| 35 virtual void OnLibEvdevCrosOpen(Evdev* evdev, | |
| 36 EventStateRec* evstate) OVERRIDE; | |
| 37 virtual void OnLibEvdevCrosEvent(Evdev* evdev, | |
| 38 EventStateRec* evstate, | |
| 39 const timeval& time) OVERRIDE; | |
| 40 | |
| 41 // Handler for gesture events generated from libgestures. | |
| 42 void OnGestureReady(const Gesture* gesture); | |
| 43 | |
| 44 private: | |
| 45 void OnGestureMove(const Gesture* gesture, const GestureMove* move); | |
| 46 void OnGestureScroll(const Gesture* gesture, const GestureScroll* move); | |
| 47 void OnGestureButtonsChange(const Gesture* gesture, | |
| 48 const GestureButtonsChange* move); | |
| 49 void Dispatch(Event* event); | |
| 50 void DispatchMouseButton(unsigned int modifier, bool down); | |
| 51 | |
| 52 // Shared modifier state. | |
| 53 EventModifiersEvdev* modifiers_; | |
| 54 | |
| 55 // Shared cursor state. | |
| 56 CursorDelegateEvdev* cursor_; | |
| 57 | |
| 58 // Callback for dispatching events. | |
| 59 EventDispatchCallback dispatch_callback_; | |
| 60 | |
| 61 // Gestures interpretation state. | |
| 62 scoped_ptr<gestures::GestureInterpreter> interpreter_; | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(GestureInterpreterLibevdevCros); | |
| 65 }; | |
| 66 | |
| 67 } // namspace ui | |
| 68 | |
| 69 #endif // UI_EVENTS_OZONE_EVDEV_GESTURES_GESTURE_INTERPRETER_LIBEVDEV_CROS_H_ | |
| OLD | NEW |