| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 PointerEventFactory_h | 5 #ifndef PointerEventFactory_h |
| 6 #define PointerEventFactory_h | 6 #define PointerEventFactory_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/events/PointerEvent.h" | 9 #include "core/events/PointerEvent.h" |
| 10 #include "public/platform/WebPointerProperties.h" | 10 #include "public/platform/WebPointerProperties.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {} | 87 : std::pair<int, int>(static_cast<int>(pointerType), rawId) {} |
| 88 int pointerTypeInt() const { return first; } | 88 int pointerTypeInt() const { return first; } |
| 89 WebPointerProperties::PointerType pointerType() const { | 89 WebPointerProperties::PointerType pointerType() const { |
| 90 return static_cast<WebPointerProperties::PointerType>(first); | 90 return static_cast<WebPointerProperties::PointerType>(first); |
| 91 } | 91 } |
| 92 int rawId() const { return second; } | 92 int rawId() const { return second; } |
| 93 } IncomingId; | 93 } IncomingId; |
| 94 typedef struct PointerAttributes { | 94 typedef struct PointerAttributes { |
| 95 IncomingId incomingId; | 95 IncomingId incomingId; |
| 96 bool isActiveButtons; | 96 bool isActiveButtons; |
| 97 PointerAttributes() : incomingId(), isActiveButtons(false) {} | 97 double clientX; |
| 98 PointerAttributes(IncomingId incomingId, unsigned isActiveButtons) | 98 double clientY; |
| 99 : incomingId(incomingId), isActiveButtons(isActiveButtons) {} | 99 PointerAttributes() |
| 100 : incomingId(), isActiveButtons(false), clientX(0), clientY(0) {} |
| 101 PointerAttributes(IncomingId incomingId, |
| 102 unsigned isActiveButtons, |
| 103 double clientX, |
| 104 double clientY) |
| 105 : incomingId(incomingId), |
| 106 isActiveButtons(isActiveButtons), |
| 107 clientX(clientX), |
| 108 clientY(clientY) {} |
| 100 } PointerAttributes; | 109 } PointerAttributes; |
| 101 | 110 |
| 102 int addIdAndActiveButtons(const IncomingId, bool isActiveButtons); | 111 int addIdAndActiveButtons(const IncomingId, bool isActiveButtons); |
| 103 bool isPrimary(const int) const; | 112 bool isPrimary(const int) const; |
| 104 void setIdTypeButtons(PointerEventInit&, | 113 void setIdTypeButtons(PointerEventInit&, |
| 105 const WebPointerProperties&, | 114 const WebPointerProperties&, |
| 106 unsigned buttons); | 115 unsigned buttons); |
| 107 void setEventSpecificFields(PointerEventInit&, const AtomicString& type); | 116 void setEventSpecificFields(PointerEventInit&, const AtomicString& type); |
| 108 | 117 |
| 109 // Creates pointerevents like boundary and capture events from another | 118 // Creates pointerevents like boundary and capture events from another |
| (...skipping 15 matching lines...) Expand all Loading... |
| 125 int m_primaryId[static_cast<int>( | 134 int m_primaryId[static_cast<int>( |
| 126 WebPointerProperties::PointerType::LastEntry) + | 135 WebPointerProperties::PointerType::LastEntry) + |
| 127 1]; | 136 1]; |
| 128 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + | 137 int m_idCount[static_cast<int>(WebPointerProperties::PointerType::LastEntry) + |
| 129 1]; | 138 1]; |
| 130 }; | 139 }; |
| 131 | 140 |
| 132 } // namespace blink | 141 } // namespace blink |
| 133 | 142 |
| 134 #endif // PointerEventFactory_h | 143 #endif // PointerEventFactory_h |
| OLD | NEW |