| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_DEBUG_BUFFER_H_ | 5 #ifndef UI_EVENTS_OZONE_EVDEV_TOUCH_DEBUG_BUFFER_H_ |
| 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_DEBUG_BUFFER_H_ | 6 #define UI_EVENTS_OZONE_EVDEV_TOUCH_DEBUG_BUFFER_H_ |
| 7 | 7 |
| 8 #include <linux/input.h> | 8 #include <linux/input.h> |
| 9 #include <stddef.h> | 9 #include <stddef.h> |
| 10 | 10 |
| 11 #include <memory> |
| 11 #include <string> | 12 #include <string> |
| 12 #include <vector> | 13 #include <vector> |
| 13 | 14 |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" | 15 #include "ui/events/ozone/evdev/events_ozone_evdev_export.h" |
| 16 | 16 |
| 17 namespace ui { | 17 namespace ui { |
| 18 | 18 |
| 19 class EventDeviceInfo; | 19 class EventDeviceInfo; |
| 20 | 20 |
| 21 class EVENTS_OZONE_EVDEV_EXPORT TouchEventLogEvdev { | 21 class EVENTS_OZONE_EVDEV_EXPORT TouchEventLogEvdev { |
| 22 public: | 22 public: |
| 23 TouchEventLogEvdev(); | 23 TouchEventLogEvdev(); |
| 24 ~TouchEventLogEvdev(); | 24 ~TouchEventLogEvdev(); |
| 25 | 25 |
| 26 void Initialize(const EventDeviceInfo& devinfo); | 26 void Initialize(const EventDeviceInfo& devinfo); |
| 27 void ProcessEvent(size_t cur_slot, const input_event* ev); | 27 void ProcessEvent(size_t cur_slot, const input_event* ev); |
| 28 | 28 |
| 29 void DumpLog(const char* filename); | 29 void DumpLog(const char* filename); |
| 30 | 30 |
| 31 private: | 31 private: |
| 32 struct TouchEvent { | 32 struct TouchEvent { |
| 33 struct input_event ev; | 33 struct input_event ev; |
| 34 int slot; | 34 int slot; |
| 35 }; | 35 }; |
| 36 const int kDebugBufferSize = 65536; | 36 const int kDebugBufferSize = 65536; |
| 37 scoped_ptr<TouchEvent[]> logged_events_; | 37 std::unique_ptr<TouchEvent[]> logged_events_; |
| 38 int debug_buffer_tail_ = 0; | 38 int debug_buffer_tail_ = 0; |
| 39 | 39 |
| 40 std::string device_name_; | 40 std::string device_name_; |
| 41 | 41 |
| 42 struct AbsAxisData { | 42 struct AbsAxisData { |
| 43 AbsAxisData(int code, const input_absinfo& info); | 43 AbsAxisData(int code, const input_absinfo& info); |
| 44 AbsAxisData(const AbsAxisData& other); | 44 AbsAxisData(const AbsAxisData& other); |
| 45 ~AbsAxisData(); | 45 ~AbsAxisData(); |
| 46 | 46 |
| 47 int code; | 47 int code; |
| 48 input_absinfo info; | 48 input_absinfo info; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 std::vector<AbsAxisData> axes_; | 51 std::vector<AbsAxisData> axes_; |
| 52 }; | 52 }; |
| 53 | 53 |
| 54 } // namespace ui | 54 } // namespace ui |
| 55 | 55 |
| 56 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVDEV_BUFFER_H_ | 56 #endif // UI_EVENTS_OZONE_EVDEV_TOUCH_EVDEV_BUFFER_H_ |
| OLD | NEW |