Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: ui/events/ozone/evdev/touch_event_converter_evdev.h

Issue 2263693003: Add palm suppression feature to EventConverterEvdev (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@stylus
Patch Set: added support for MT_TOOL_PALM to cancel events Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <stddef.h> 8 #include <stddef.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 10 matching lines...) Expand all
21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" 21 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h"
22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h" 22 #include "ui/events/ozone/evdev/touch_evdev_debug_buffer.h"
23 23
24 namespace gfx { 24 namespace gfx {
25 class PointF; 25 class PointF;
26 } 26 }
27 27
28 namespace ui { 28 namespace ui {
29 29
30 class DeviceEventDispatcherEvdev; 30 class DeviceEventDispatcherEvdev;
31 class PalmSuppressionFilter;
31 class TouchEvent; 32 class TouchEvent;
32 class TouchNoiseFinder; 33 class TouchNoiseFinder;
33 struct InProgressTouchEvdev; 34 struct InProgressTouchEvdev;
34 struct PointerDetails; 35 struct PointerDetails;
35
36 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev 36 class EVENTS_OZONE_EVDEV_EXPORT TouchEventConverterEvdev
37 : public EventConverterEvdev { 37 : public EventConverterEvdev {
38 public: 38 public:
39 TouchEventConverterEvdev(int fd, 39 TouchEventConverterEvdev(int fd,
40 base::FilePath path, 40 base::FilePath path,
41 int id, 41 int id,
42 const EventDeviceInfo& devinfo, 42 const EventDeviceInfo& devinfo,
43 DeviceEventDispatcherEvdev* dispatcher); 43 DeviceEventDispatcherEvdev* dispatcher);
44 ~TouchEventConverterEvdev() override; 44 ~TouchEventConverterEvdev() override;
45 45
46 // EventConverterEvdev: 46 // EventConverterEvdev:
47 bool HasTouchscreen() const override; 47 bool HasTouchscreen() const override;
48 bool HasPen() const override;
48 gfx::Size GetTouchscreenSize() const override; 49 gfx::Size GetTouchscreenSize() const override;
49 int GetTouchPoints() const override; 50 int GetTouchPoints() const override;
50 void OnEnabled() override; 51 void OnEnabled() override;
51 void OnDisabled() override; 52 void OnDisabled() override;
53 void SetPalmSuppressionFilter(PalmSuppressionFilter* palm_filter) override;
52 54
53 void DumpTouchEventLog(const char* filename) override; 55 void DumpTouchEventLog(const char* filename) override;
54 56
55 // Update touch event logging state 57 // Update touch event logging state
56 void SetTouchEventLoggingEnabled(bool enabled) override; 58 void SetTouchEventLoggingEnabled(bool enabled) override;
57 59
58 // Unsafe part of initialization. 60 // Unsafe part of initialization.
59 virtual void Initialize(const EventDeviceInfo& info); 61 virtual void Initialize(const EventDeviceInfo& info);
60 62
61 private: 63 private:
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 99
98 // Dispatcher for events. 100 // Dispatcher for events.
99 DeviceEventDispatcherEvdev* dispatcher_; 101 DeviceEventDispatcherEvdev* dispatcher_;
100 102
101 // Set if we drop events in kernel (SYN_DROPPED) or in process. 103 // Set if we drop events in kernel (SYN_DROPPED) or in process.
102 bool dropped_events_ = false; 104 bool dropped_events_ = false;
103 105
104 // Device has multitouch capability. 106 // Device has multitouch capability.
105 bool has_mt_ = false; 107 bool has_mt_ = false;
106 108
109 // Device has pen capability.
110 bool has_pen_ = false;
111
107 // Use BTN_LEFT instead of BT_TOUCH. 112 // Use BTN_LEFT instead of BT_TOUCH.
108 bool quirk_left_mouse_button_ = false; 113 bool quirk_left_mouse_button_ = false;
109 114
110 // Pressure values. 115 // Pressure values.
111 int pressure_min_; 116 int pressure_min_;
112 int pressure_max_; // Used to normalize pressure values. 117 int pressure_max_; // Used to normalize pressure values.
113 118
114 // Input range for x-axis. 119 // Input range for x-axis.
115 float x_min_tuxels_; 120 float x_min_tuxels_;
116 float x_num_tuxels_; 121 float x_num_tuxels_;
(...skipping 16 matching lines...) Expand all
133 138
134 // In-progress touch points. 139 // In-progress touch points.
135 std::vector<InProgressTouchEvdev> events_; 140 std::vector<InProgressTouchEvdev> events_;
136 141
137 // Finds touch noise. 142 // Finds touch noise.
138 std::unique_ptr<TouchNoiseFinder> touch_noise_finder_; 143 std::unique_ptr<TouchNoiseFinder> touch_noise_finder_;
139 144
140 // Records the recent touch events. It is used to fill the feedback reports 145 // Records the recent touch events. It is used to fill the feedback reports
141 TouchEventLogEvdev touch_evdev_debug_buffer_; 146 TouchEventLogEvdev touch_evdev_debug_buffer_;
142 147
148 // Decides whether events should be dropped for palm suppression.
149 PalmSuppressionFilter* palm_filter_;
150
143 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev); 151 DISALLOW_COPY_AND_ASSIGN(TouchEventConverterEvdev);
144 }; 152 };
145 153
146 } // namespace ui 154 } // namespace ui
147 155
148 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_ 156 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVENT_CONVERTER_EVDEV_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698