diff options
Diffstat (limited to 'chromium/ui/events/x/device_data_manager.h')
-rw-r--r-- | chromium/ui/events/x/device_data_manager.h | 29 |
1 files changed, 19 insertions, 10 deletions
diff --git a/chromium/ui/events/x/device_data_manager.h b/chromium/ui/events/x/device_data_manager.h index aff06493571..1135ec222b8 100644 --- a/chromium/ui/events/x/device_data_manager.h +++ b/chromium/ui/events/x/device_data_manager.h @@ -20,8 +20,12 @@ #include "base/basictypes.h" #include "base/event_types.h" +#include "base/memory/scoped_ptr.h" +#include "ui/events/event.h" #include "ui/events/event_constants.h" #include "ui/events/events_base_export.h" +#include "ui/gfx/geometry/rect.h" +#include "ui/gfx/transform.h" #include "ui/gfx/x/x11_atom_cache.h" template <typename T> struct DefaultSingletonTraits; @@ -104,18 +108,9 @@ class EVENTS_BASE_EXPORT DeviceDataManager { // Returns the DeviceDataManager singleton. static DeviceDataManager* GetInstance(); - // Natural scroll setter/getter. - bool natural_scroll_enabled() const { return natural_scroll_enabled_; } - void set_natural_scroll_enabled(bool enabled) { - natural_scroll_enabled_ = enabled; - } - // Returns if XInput2 is available on the system. bool IsXInput2Available() const; - // Get the natural scroll direction multiplier (1.0f or -1.0f). - float GetNaturalScrollFactor(int sourceid) const; - // Updates the list of devices. void UpdateDeviceList(Display* display); @@ -226,6 +221,14 @@ class EVENTS_BASE_EXPORT DeviceDataManager { DataType type, double value); + void ClearTouchTransformerRecord(); + void UpdateTouchInfoForDisplay(int64 display_id, + int touch_device_id, + const gfx::Transform& touch_transformer); + void ApplyTouchTransformer(int touch_device_id, float* x, float* y); + int64 GetDisplayForTouchDevice(int touch_device_id) const; + bool TouchEventNeedsCalibrate(int touch_device_id) const; + private: // Requirement for Singleton. friend struct DefaultSingletonTraits<DeviceDataManager>; @@ -245,10 +248,11 @@ class EVENTS_BASE_EXPORT DeviceDataManager { double min_value, double max_value); + bool IsTouchDeviceIdValid(int touch_device_id) const; + static const int kMaxDeviceNum = 128; static const int kMaxXIEventType = XI_LASTEVENT + 1; static const int kMaxSlotNum = 10; - bool natural_scroll_enabled_; // Major opcode for the XInput extension. Used to identify XInput events. int xi_opcode_; @@ -292,6 +296,11 @@ class EVENTS_BASE_EXPORT DeviceDataManager { unsigned char button_map_[256]; int button_map_count_; + // Table to keep track of which display id is mapped to which touch device. + int64 touch_device_to_display_map_[kMaxDeviceNum]; + // Index table to find the TouchTransformer for a touch device. + gfx::Transform touch_device_transformer_map_[kMaxDeviceNum]; + DISALLOW_COPY_AND_ASSIGN(DeviceDataManager); }; |