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_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_CROS
_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_CROS
_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_CROS
_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_CROS
_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 #include <gestures/gestures.h> | 9 #include <gestures/gestures.h> |
10 #include <libevdev/libevdev.h> | 10 #include <libevdev/libevdev.h> |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 GesturePropertyProvider* property_provider, | 46 GesturePropertyProvider* property_provider, |
47 DeviceEventDispatcherEvdev* dispatcher); | 47 DeviceEventDispatcherEvdev* dispatcher); |
48 ~GestureInterpreterLibevdevCros() override; | 48 ~GestureInterpreterLibevdevCros() override; |
49 | 49 |
50 // Overriden from ui::EventReaderLibevdevCros::Delegate | 50 // Overriden from ui::EventReaderLibevdevCros::Delegate |
51 void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) override; | 51 void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) override; |
52 void OnLibEvdevCrosEvent(Evdev* evdev, | 52 void OnLibEvdevCrosEvent(Evdev* evdev, |
53 EventStateRec* evstate, | 53 EventStateRec* evstate, |
54 const timeval& time) override; | 54 const timeval& time) override; |
55 void OnLibEvdevCrosStopped(Evdev* evdev, EventStateRec* state) override; | 55 void OnLibEvdevCrosStopped(Evdev* evdev, EventStateRec* state) override; |
56 void SetAllowedKeys( | |
57 scoped_ptr<std::set<DomCode>> allowed_keys) override; | |
58 void AllowAllKeys() override; | |
59 | 56 |
60 // Handler for gesture events generated from libgestures. | 57 // Handler for gesture events generated from libgestures. |
61 void OnGestureReady(const Gesture* gesture); | 58 void OnGestureReady(const Gesture* gesture); |
62 | 59 |
63 // Accessors. | 60 // Accessors. |
64 int id() { return id_; } | 61 int id() { return id_; } |
65 GesturePropertyProvider* property_provider() { return property_provider_; } | 62 GesturePropertyProvider* property_provider() { return property_provider_; } |
66 Evdev* evdev() { return evdev_; } | 63 Evdev* evdev() { return evdev_; } |
67 | 64 |
68 private: | 65 private: |
(...skipping 17 matching lines...) Expand all Loading... |
86 bool SetMouseButtonState(unsigned int button, bool down); | 83 bool SetMouseButtonState(unsigned int button, bool down); |
87 void ReleaseMouseButtons(stime_t timestamp); | 84 void ReleaseMouseButtons(stime_t timestamp); |
88 | 85 |
89 // The unique device id. | 86 // The unique device id. |
90 int id_; | 87 int id_; |
91 | 88 |
92 // True if the device may be regarded as a mouse. This includes normal mice | 89 // True if the device may be regarded as a mouse. This includes normal mice |
93 // and multi-touch mice. | 90 // and multi-touch mice. |
94 bool is_mouse_; | 91 bool is_mouse_; |
95 | 92 |
96 // The evdev codes of the keys which should be processed. nullptr if all keys | |
97 // should be processed. | |
98 scoped_ptr<std::set<int>> allowed_keys_; | |
99 | |
100 // Shared cursor state. | 93 // Shared cursor state. |
101 CursorDelegateEvdev* cursor_; | 94 CursorDelegateEvdev* cursor_; |
102 | 95 |
103 // Shared gesture property provider. | 96 // Shared gesture property provider. |
104 GesturePropertyProvider* property_provider_; | 97 GesturePropertyProvider* property_provider_; |
105 | 98 |
106 // Dispatcher for events. | 99 // Dispatcher for events. |
107 DeviceEventDispatcherEvdev* dispatcher_; | 100 DeviceEventDispatcherEvdev* dispatcher_; |
108 | 101 |
109 // Gestures interpretation state. | 102 // Gestures interpretation state. |
(...skipping 11 matching lines...) Expand all Loading... |
121 | 114 |
122 // Gesture lib device properties. | 115 // Gesture lib device properties. |
123 scoped_ptr<GestureDeviceProperties> device_properties_; | 116 scoped_ptr<GestureDeviceProperties> device_properties_; |
124 | 117 |
125 DISALLOW_COPY_AND_ASSIGN(GestureInterpreterLibevdevCros); | 118 DISALLOW_COPY_AND_ASSIGN(GestureInterpreterLibevdevCros); |
126 }; | 119 }; |
127 | 120 |
128 } // namspace ui | 121 } // namspace ui |
129 | 122 |
130 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_C
ROS_H_ | 123 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_C
ROS_H_ |
OLD | NEW |