OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef PointerIdManager_h |
| 6 #define PointerIdManager_h |
| 7 |
| 8 #include "wtf/ListHashSet.h" |
| 9 |
| 10 namespace blink { |
| 11 |
| 12 /** |
| 13 Helper class for tracking the primary pointer id for each type of PointerEvent
s. |
| 14 */ |
| 15 class PointerIdManager { |
| 16 public: |
| 17 // TODO(mustaq): Move this enum to PointerEvent.h? Change the spec to use en
ums? |
| 18 enum PointerType { |
| 19 PointerTypeUnknown = 0, |
| 20 PointerTypeMouse, |
| 21 PointerTypePen, |
| 22 PointerTypeTouch, |
| 23 PointerTypeLastEntry // Must be the last entry in the list |
| 24 }; |
| 25 |
| 26 PointerIdManager(); |
| 27 ~PointerIdManager(); |
| 28 void clear(); |
| 29 void add(PointerType, unsigned); |
| 30 void remove(PointerType, unsigned); |
| 31 bool isPrimary(PointerType, unsigned); |
| 32 |
| 33 private: |
| 34 ListHashSet<unsigned> m_ids[PointerTypeLastEntry]; |
| 35 bool m_hasPrimaryId[PointerTypeLastEntry]; |
| 36 }; |
| 37 |
| 38 } // namespace blink |
| 39 |
| 40 #endif // PointerIdManager_h |
OLD | NEW |