Chromium Code Reviews| 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_DEVICES_DEVICE_DATA_MANAGER_H_ | 5 #ifndef UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ |
| 6 #define UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ | 6 #define UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 22 matching lines...) Expand all Loading... | |
| 33 static DeviceDataManager* GetInstance(); | 33 static DeviceDataManager* GetInstance(); |
| 34 static bool HasInstance(); | 34 static bool HasInstance(); |
| 35 | 35 |
| 36 void ClearTouchTransformerRecord(); | 36 void ClearTouchTransformerRecord(); |
| 37 void UpdateTouchInfoForDisplay(int64_t display_id, | 37 void UpdateTouchInfoForDisplay(int64_t display_id, |
| 38 unsigned int touch_device_id, | 38 unsigned int touch_device_id, |
| 39 const gfx::Transform& touch_transformer); | 39 const gfx::Transform& touch_transformer); |
| 40 void ApplyTouchTransformer(unsigned int touch_device_id, float* x, float* y); | 40 void ApplyTouchTransformer(unsigned int touch_device_id, float* x, float* y); |
| 41 int64_t GetDisplayForTouchDevice(unsigned int touch_device_id) const; | 41 int64_t GetDisplayForTouchDevice(unsigned int touch_device_id) const; |
| 42 | 42 |
| 43 // Sets/Gets the display that touches from |touch_device_id| should be | |
| 44 // redirected to. | |
| 45 void SetTargetDisplayForTouchDevice(unsigned int touch_device_id, | |
| 46 int64_t target_display_id); | |
| 47 int64_t GetTargetDisplayForTouchDevice(unsigned int touch_device_id); | |
|
sadrul
2015/03/02 16:56:18
How is this different from GetDisplayForTouchDevic
pkotwicz
2015/03/02 17:55:53
In mirror mode (either software or hardware):
- Ge
sadrul
2015/03/03 04:43:09
We should have just one of these functions. Having
oshima
2015/03/04 00:54:36
How about using GetDisplayForTouchDevice() for all
sadrul
2015/03/05 11:07:14
I think that sounds good, yeah.
| |
| 48 | |
| 43 void UpdateTouchRadiusScale(unsigned int touch_device_id, double scale); | 49 void UpdateTouchRadiusScale(unsigned int touch_device_id, double scale); |
| 44 void ApplyTouchRadiusScale(unsigned int touch_device_id, double* radius); | 50 void ApplyTouchRadiusScale(unsigned int touch_device_id, double* radius); |
| 45 | 51 |
| 46 const std::vector<TouchscreenDevice>& touchscreen_devices() const { | 52 const std::vector<TouchscreenDevice>& touchscreen_devices() const { |
| 47 return touchscreen_devices_; | 53 return touchscreen_devices_; |
| 48 } | 54 } |
| 49 | 55 |
| 50 const std::vector<KeyboardDevice>& keyboard_devices() const { | 56 const std::vector<KeyboardDevice>& keyboard_devices() const { |
| 51 return keyboard_devices_; | 57 return keyboard_devices_; |
| 52 } | 58 } |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 71 | 77 |
| 72 private: | 78 private: |
| 73 static DeviceDataManager* instance_; | 79 static DeviceDataManager* instance_; |
| 74 | 80 |
| 75 bool IsTouchDeviceIdValid(unsigned int touch_device_id) const; | 81 bool IsTouchDeviceIdValid(unsigned int touch_device_id) const; |
| 76 | 82 |
| 77 double touch_radius_scale_map_[kMaxDeviceNum]; | 83 double touch_radius_scale_map_[kMaxDeviceNum]; |
| 78 | 84 |
| 79 // Table to keep track of which display id is mapped to which touch device. | 85 // Table to keep track of which display id is mapped to which touch device. |
| 80 int64_t touch_device_to_display_map_[kMaxDeviceNum]; | 86 int64_t touch_device_to_display_map_[kMaxDeviceNum]; |
| 87 // Index table to find the target display id for a touch device. | |
| 88 int64_t touch_device_to_target_display_map_[kMaxDeviceNum]; | |
| 81 // Index table to find the TouchTransformer for a touch device. | 89 // Index table to find the TouchTransformer for a touch device. |
| 82 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; | 90 gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; |
| 83 | 91 |
| 84 std::vector<TouchscreenDevice> touchscreen_devices_; | 92 std::vector<TouchscreenDevice> touchscreen_devices_; |
| 85 std::vector<KeyboardDevice> keyboard_devices_; | 93 std::vector<KeyboardDevice> keyboard_devices_; |
| 86 | 94 |
| 87 ObserverList<InputDeviceEventObserver> observers_; | 95 ObserverList<InputDeviceEventObserver> observers_; |
| 88 | 96 |
| 89 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); | 97 DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); |
| 90 }; | 98 }; |
| 91 | 99 |
| 92 } // namespace ui | 100 } // namespace ui |
| 93 | 101 |
| 94 #endif // UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ | 102 #endif // UI_EVENTS_DEVICES_DEVICE_DATA_MANAGER_H_ |
| OLD | NEW |