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

Side by Side Diff: ui/events/x/touch_factory_x11.h

Issue 59903023: Plumb maxTouchPoints for AuraX11 (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rename MaxTouchPoints() to GetMaxTouchPoints() Created 7 years, 1 month 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
« no previous file with comments | « ui/base/touch/touch_device_aurax11.cc ('k') | ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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_X_TOUCH_FACTORY_X11_H_ 5 #ifndef UI_EVENTS_X_TOUCH_FACTORY_X11_H_
6 #define UI_EVENTS_X_TOUCH_FACTORY_X11_H_ 6 #define UI_EVENTS_X_TOUCH_FACTORY_X11_H_
7 7
8 #include <bitset> 8 #include <bitset>
9 #include <map> 9 #include <map>
10 #include <vector> 10 #include <vector>
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 // Tries to find an existing slot ID mapping to tracking ID. If there 65 // Tries to find an existing slot ID mapping to tracking ID. If there
66 // isn't one already, allocates a new slot ID and sets up the mapping. 66 // isn't one already, allocates a new slot ID and sets up the mapping.
67 int GetSlotForTrackingID(uint32 tracking_id); 67 int GetSlotForTrackingID(uint32 tracking_id);
68 68
69 // Releases the slot ID mapping to tracking ID. 69 // Releases the slot ID mapping to tracking ID.
70 void ReleaseSlotForTrackingID(uint32 tracking_id); 70 void ReleaseSlotForTrackingID(uint32 tracking_id);
71 71
72 // Whether any touch device is currently present and enabled. 72 // Whether any touch device is currently present and enabled.
73 bool IsTouchDevicePresent(); 73 bool IsTouchDevicePresent();
74 74
75 // Return maximum simultaneous touch points supported by device.
76 int GetMaxTouchPoints() const;
77
75 // Sets up the device id in the list |devices| as multi-touch capable 78 // Sets up the device id in the list |devices| as multi-touch capable
76 // devices and enables touch events processing. This function is only 79 // devices and enables touch events processing. This function is only
77 // for test purpose, and it does not query from X server. 80 // for test purpose, and it does not query from X server.
78 void SetTouchDeviceForTest(const std::vector<unsigned int>& devices); 81 void SetTouchDeviceForTest(const std::vector<unsigned int>& devices);
79 82
80 private: 83 private:
81 // Requirement for Singleton 84 // Requirement for Singleton
82 friend struct DefaultSingletonTraits<TouchFactory>; 85 friend struct DefaultSingletonTraits<TouchFactory>;
83 86
84 // NOTE: To keep track of touch devices, we currently maintain a lookup table 87 // NOTE: To keep track of touch devices, we currently maintain a lookup table
(...skipping 18 matching lines...) Expand all
103 // Indicates whether touch events are explicitly disabled. 106 // Indicates whether touch events are explicitly disabled.
104 bool touch_events_disabled_; 107 bool touch_events_disabled_;
105 108
106 // The list of touch devices. For testing/debugging purposes, a single-pointer 109 // The list of touch devices. For testing/debugging purposes, a single-pointer
107 // device (mouse or touch screen without sufficient X/driver support for MT) 110 // device (mouse or touch screen without sufficient X/driver support for MT)
108 // can sometimes be treated as a touch device. The key in the map represents 111 // can sometimes be treated as a touch device. The key in the map represents
109 // the device id, and the value represents if the device is multi-touch 112 // the device id, and the value represents if the device is multi-touch
110 // capable. 113 // capable.
111 std::map<int, bool> touch_device_list_; 114 std::map<int, bool> touch_device_list_;
112 115
113 // Maximum simultaneous touch points. 116 // Maximum simultaneous touch points supported by device. In the case of
114 static const int kMaxTouchPoints = 32; 117 // devices with multiple digitizers (e.g. multiple touchscreens), the value
118 // is the maximum of the set of maximum supported contacts by each individual
119 // digitizer.
120 int max_touch_points_;
115 121
116 SequentialIDGenerator id_generator_; 122 SequentialIDGenerator id_generator_;
117 123
118 DISALLOW_COPY_AND_ASSIGN(TouchFactory); 124 DISALLOW_COPY_AND_ASSIGN(TouchFactory);
119 }; 125 };
120 126
121 } // namespace ui 127 } // namespace ui
122 128
123 #endif // UI_EVENTS_X_TOUCH_FACTORY_X11_H_ 129 #endif // UI_EVENTS_X_TOUCH_FACTORY_X11_H_
OLDNEW
« no previous file with comments | « ui/base/touch/touch_device_aurax11.cc ('k') | ui/events/x/touch_factory_x11.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698