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_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
7 | 7 |
8 #include <bitset> | 8 #include <bitset> |
9 | 9 |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev | 22 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev |
23 : public EventConverterEvdev { | 23 : public EventConverterEvdev { |
24 public: | 24 public: |
25 enum { | 25 enum { |
26 MAX_FINGERS = 11 | 26 MAX_FINGERS = 11 |
27 }; | 27 }; |
28 TouchEventConverterEvdev(int fd, | 28 TouchEventConverterEvdev(int fd, |
29 base::FilePath path, | 29 base::FilePath path, |
30 int id, | 30 int id, |
31 InputDeviceType type, | 31 InputDeviceType type, |
32 const EventDispatchCallback& dispatch); | 32 const TouchEventDispatchCallback& touch_callback); |
33 ~TouchEventConverterEvdev() override; | 33 ~TouchEventConverterEvdev() override; |
34 | 34 |
35 // EventConverterEvdev: | 35 // EventConverterEvdev: |
36 bool HasTouchscreen() const override; | 36 bool HasTouchscreen() const override; |
37 gfx::Size GetTouchscreenSize() const override; | 37 gfx::Size GetTouchscreenSize() const override; |
38 | 38 |
39 // Unsafe part of initialization. | 39 // Unsafe part of initialization. |
40 virtual void Initialize(const EventDeviceInfo& info); | 40 virtual void Initialize(const EventDeviceInfo& info); |
41 | 41 |
42 private: | 42 private: |
(...skipping 20 matching lines...) Expand all Loading... |
63 | 63 |
64 void ProcessInputEvent(const input_event& input); | 64 void ProcessInputEvent(const input_event& input); |
65 void ProcessAbs(const input_event& input); | 65 void ProcessAbs(const input_event& input); |
66 void ProcessSyn(const input_event& input); | 66 void ProcessSyn(const input_event& input); |
67 | 67 |
68 void ReportEvent(int touch_id, | 68 void ReportEvent(int touch_id, |
69 const InProgressEvents& event, const base::TimeDelta& delta); | 69 const InProgressEvents& event, const base::TimeDelta& delta); |
70 void ReportEvents(base::TimeDelta delta); | 70 void ReportEvents(base::TimeDelta delta); |
71 | 71 |
72 // Callback for dispatching events. | 72 // Callback for dispatching events. |
73 EventDispatchCallback callback_; | 73 TouchEventDispatchCallback touch_callback_; |
74 | 74 |
75 // Set if we have seen a SYN_DROPPED and not yet re-synced with the device. | 75 // Set if we have seen a SYN_DROPPED and not yet re-synced with the device. |
76 bool syn_dropped_; | 76 bool syn_dropped_; |
77 | 77 |
78 // Set if this is a type A device (uses SYN_MT_REPORT). | 78 // Set if this is a type A device (uses SYN_MT_REPORT). |
79 bool is_type_a_; | 79 bool is_type_a_; |
80 | 80 |
81 // Pressure values. | 81 // Pressure values. |
82 int pressure_min_; | 82 int pressure_min_; |
83 int pressure_max_; // Used to normalize pressure values. | 83 int pressure_max_; // Used to normalize pressure values. |
(...skipping 18 matching lines...) Expand all Loading... |
102 | 102 |
103 // In-progress touch points. | 103 // In-progress touch points. |
104 InProgressEvents events_[MAX_FINGERS]; | 104 InProgressEvents events_[MAX_FINGERS]; |
105 | 105 |
106 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); | 106 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); |
107 }; | 107 }; |
108 | 108 |
109 } // namespace ui | 109 } // namespace ui |
110 | 110 |
111 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ | 111 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ |
OLD | NEW |