OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef UI_EVENTS_DEVICE_DATA_MANAGER_H_ | |
6 #define UI_EVENTS_DEVICE_DATA_MANAGER_H_ | |
7 | |
8 #include <stdint.h> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "ui/events/events_base_export.h" | |
13 #include "ui/gfx/transform.h" | |
14 | |
15 namespace ui { | |
16 | |
17 // Keeps track of device mappings and event transformations. | |
18 class EVENTS_BASE_EXPORT DeviceDataManager { | |
19 public: | |
20 virtual ~DeviceDataManager(); | |
21 | |
22 static void CreateInstance(); | |
23 static DeviceDataManager* GetInstance(); | |
24 | |
25 void ClearTouchTransformerRecord(); | |
26 void UpdateTouchInfoForDisplay(int64_t display_id, | |
27 int touch_device_id, | |
28 const gfx::Transform& touch_transformer); | |
29 void ApplyTouchTransformer(int touch_device_id, float* x, float* y); | |
30 int64_t GetDisplayForTouchDevice(int touch_device_id) const; | |
31 | |
32 protected: | |
33 DeviceDataManager(); | |
34 | |
35 static DeviceDataManager* instance_; | |
36 | |
37 bool IsTouchDeviceIdValid(int touch_device_id) const; | |
38 | |
39 static const int kMaxDeviceNum = 128; | |
40 | |
41 // Table to keep track of which display id is mapped to which touch device. | |
42 int64_t touch_device_to_display_map_[kMaxDeviceNum]; | |
sadrul
2014/06/20 13:37:52
These should be privates. Have a protected static
dnicoara
2014/06/20 14:48:00
Done.
| |
43 // Index table to find the TouchTransformer for a touch device. | |
44 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; | |
45 | |
46 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); | |
47 }; | |
48 | |
49 } // namespace ui | |
50 | |
51 #endif // UI_EVENTS_DEVICE_DATA_MANAGER_H_ | |
OLD | NEW |