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_TABLET_EVENT_CONVERTER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ |
7 | 7 |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/message_loop/message_pump_libevent.h" | 9 #include "base/message_loop/message_pump_libevent.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 private: | 40 private: |
41 friend class MockTabletEventConverterEvdev; | 41 friend class MockTabletEventConverterEvdev; |
42 void ConvertKeyEvent(const input_event& input); | 42 void ConvertKeyEvent(const input_event& input); |
43 void ConvertAbsEvent(const input_event& input); | 43 void ConvertAbsEvent(const input_event& input); |
44 void DispatchMouseButton(const input_event& input); | 44 void DispatchMouseButton(const input_event& input); |
45 void UpdateCursor(); | 45 void UpdateCursor(); |
46 | 46 |
47 // Flush events delimited by EV_SYN. This is useful for handling | 47 // Flush events delimited by EV_SYN. This is useful for handling |
48 // non-axis-aligned movement properly. | 48 // non-axis-aligned movement properly. |
49 void FlushEvents(); | 49 void FlushEvents(const input_event& input); |
50 | 50 |
51 // Controller for watching the input fd. | 51 // Controller for watching the input fd. |
52 base::MessagePumpLibevent::FileDescriptorWatcher controller_; | 52 base::MessagePumpLibevent::FileDescriptorWatcher controller_; |
53 | 53 |
54 // Shared cursor state. | 54 // Shared cursor state. |
55 CursorDelegateEvdev* cursor_; | 55 CursorDelegateEvdev* cursor_; |
56 | 56 |
57 // Dispatcher for events. | 57 // Dispatcher for events. |
58 DeviceEventDispatcherEvdev* dispatcher_; | 58 DeviceEventDispatcherEvdev* dispatcher_; |
59 | 59 |
60 int y_abs_location_; | 60 int y_abs_location_; |
61 int x_abs_location_; | 61 int x_abs_location_; |
62 int x_abs_min_; | 62 int x_abs_min_; |
63 int y_abs_min_; | 63 int y_abs_min_; |
64 int x_abs_range_; | 64 int x_abs_range_; |
65 int y_abs_range_; | 65 int y_abs_range_; |
66 | 66 |
67 // BTN_TOOL_ code for the active device | 67 // BTN_TOOL_ code for the active device |
68 int stylus_; | 68 int stylus_; |
69 | 69 |
70 // Whether we need to move the cursor | 70 // Whether we need to move the cursor |
71 bool abs_value_dirty_; | 71 bool abs_value_dirty_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(TabletEventConverterEvdev); | 73 DISALLOW_COPY_AND_ASSIGN(TabletEventConverterEvdev); |
74 }; | 74 }; |
75 | 75 |
76 } // namespace ui | 76 } // namespace ui |
77 | 77 |
78 #endif // UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ | 78 #endif // UI_EVENTS_OZONE_TABLET_EVENT_CONVERTER_EVDEV_H_ |
OLD | NEW |