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 <gestures/gestures.h> | 8 #include <gestures/gestures.h> |
9 #include <libevdev/libevdev.h> | 9 #include <libevdev/libevdev.h> |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 KeyboardEvdev* keyboard, | 49 KeyboardEvdev* keyboard, |
50 GesturePropertyProvider* property_provider, | 50 GesturePropertyProvider* property_provider, |
51 const EventDispatchCallback& callback); | 51 const EventDispatchCallback& callback); |
52 ~GestureInterpreterLibevdevCros() override; | 52 ~GestureInterpreterLibevdevCros() override; |
53 | 53 |
54 // Overriden from ui::EventReaderLibevdevCros::Delegate | 54 // Overriden from ui::EventReaderLibevdevCros::Delegate |
55 void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) override; | 55 void OnLibEvdevCrosOpen(Evdev* evdev, EventStateRec* evstate) override; |
56 void OnLibEvdevCrosEvent(Evdev* evdev, | 56 void OnLibEvdevCrosEvent(Evdev* evdev, |
57 EventStateRec* evstate, | 57 EventStateRec* evstate, |
58 const timeval& time) override; | 58 const timeval& time) override; |
| 59 void SetAllowedKeys( |
| 60 scoped_ptr<std::set<DomCode>> allowed_keys) override; |
| 61 void AllowAllKeys() override; |
59 | 62 |
60 // Handler for gesture events generated from libgestures. | 63 // Handler for gesture events generated from libgestures. |
61 void OnGestureReady(const Gesture* gesture); | 64 void OnGestureReady(const Gesture* gesture); |
62 | 65 |
63 // Accessors. | 66 // Accessors. |
64 int id() { return id_; } | 67 int id() { return id_; } |
65 GesturePropertyProvider* property_provider() { return property_provider_; } | 68 GesturePropertyProvider* property_provider() { return property_provider_; } |
66 Evdev* evdev() { return evdev_; } | 69 Evdev* evdev() { return evdev_; } |
67 | 70 |
68 private: | 71 private: |
(...skipping 13 matching lines...) Expand all Loading... |
82 void DispatchMouseButton(unsigned int modifier, bool down); | 85 void DispatchMouseButton(unsigned int modifier, bool down); |
83 void DispatchChangedKeys(Evdev* evdev, const timeval& time); | 86 void DispatchChangedKeys(Evdev* evdev, const timeval& time); |
84 | 87 |
85 // The unique device id. | 88 // The unique device id. |
86 int id_; | 89 int id_; |
87 | 90 |
88 // True if the device may be regarded as a mouse. This includes normal mice | 91 // True if the device may be regarded as a mouse. This includes normal mice |
89 // and multi-touch mice. | 92 // and multi-touch mice. |
90 bool is_mouse_; | 93 bool is_mouse_; |
91 | 94 |
| 95 // The evdev codes of the keys which should be processed. nullptr if all keys |
| 96 // should be processed. |
| 97 scoped_ptr<std::set<int>> allowed_keys_; |
| 98 |
92 // Shared modifier state. | 99 // Shared modifier state. |
93 EventModifiersEvdev* modifiers_; | 100 EventModifiersEvdev* modifiers_; |
94 | 101 |
95 // Shared mouse button map. | 102 // Shared mouse button map. |
96 MouseButtonMapEvdev* button_map_; | 103 MouseButtonMapEvdev* button_map_; |
97 | 104 |
98 // Shared cursor state. | 105 // Shared cursor state. |
99 CursorDelegateEvdev* cursor_; | 106 CursorDelegateEvdev* cursor_; |
100 | 107 |
101 // Shared keyboard state. | 108 // Shared keyboard state. |
(...skipping 16 matching lines...) Expand all Loading... |
118 | 125 |
119 // Gesture lib device properties. | 126 // Gesture lib device properties. |
120 scoped_ptr<GestureDeviceProperties> device_properties_; | 127 scoped_ptr<GestureDeviceProperties> device_properties_; |
121 | 128 |
122 DISALLOW_COPY_AND_ASSIGN(GestureInterpreterLibevdevCros); | 129 DISALLOW_COPY_AND_ASSIGN(GestureInterpreterLibevdevCros); |
123 }; | 130 }; |
124 | 131 |
125 } // namspace ui | 132 } // namspace ui |
126 | 133 |
127 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_C
ROS_H_ | 134 #endif // UI_EVENTS_OZONE_EVDEV_LIBGESTURES_GLUE_GESTURE_INTERPRETER_LIBEVDEV_C
ROS_H_ |
OLD | NEW |