| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef PlatformMouseEvent_h | 26 #ifndef PlatformMouseEvent_h |
| 27 #define PlatformMouseEvent_h | 27 #define PlatformMouseEvent_h |
| 28 | 28 |
| 29 #include "platform/PlatformEvent.h" | 29 #include "platform/PlatformEvent.h" |
| 30 #include "platform/geometry/IntPoint.h" | 30 #include "platform/geometry/IntPoint.h" |
| 31 #include "public/platform/WebPointerProperties.h" |
| 31 | 32 |
| 32 namespace blink { | 33 namespace blink { |
| 33 | 34 |
| 34 // These button numbers match the ones used in the DOM API, 0 through 2, except
for NoButton which is specified in PointerEvent | 35 // These button numbers match the ones used in the DOM API, 0 through 2, except
for NoButton which is specified in PointerEvent |
| 35 // spec but not in MouseEvent spec. | 36 // spec but not in MouseEvent spec. |
| 36 enum MouseButton { NoButton = -1, LeftButton, MiddleButton, RightButton }; | 37 enum MouseButton { NoButton = -1, LeftButton, MiddleButton, RightButton }; |
| 37 | 38 |
| 38 class PlatformMouseEvent : public PlatformEvent { | 39 class PlatformMouseEvent : public PlatformEvent { |
| 39 public: | 40 public: |
| 40 enum SyntheticEventType { | 41 enum SyntheticEventType { |
| (...skipping 27 matching lines...) Expand all Loading... |
| 68 PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition,
MouseButton button, PlatformEvent::Type type, int clickCount, Modifiers modifie
rs, SyntheticEventType synthesized, double timestamp) | 69 PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition,
MouseButton button, PlatformEvent::Type type, int clickCount, Modifiers modifie
rs, SyntheticEventType synthesized, double timestamp) |
| 69 : PlatformEvent(type, modifiers, timestamp) | 70 : PlatformEvent(type, modifiers, timestamp) |
| 70 , m_position(position) | 71 , m_position(position) |
| 71 , m_globalPosition(globalPosition) | 72 , m_globalPosition(globalPosition) |
| 72 , m_button(button) | 73 , m_button(button) |
| 73 , m_clickCount(clickCount) | 74 , m_clickCount(clickCount) |
| 74 , m_synthesized(synthesized) | 75 , m_synthesized(synthesized) |
| 75 { | 76 { |
| 76 } | 77 } |
| 77 | 78 |
| 79 const WebPointerProperties& pointerProperties() const { return m_pointerProp
erties; } |
| 78 const IntPoint& position() const { return m_position; } | 80 const IntPoint& position() const { return m_position; } |
| 79 const IntPoint& globalPosition() const { return m_globalPosition; } | 81 const IntPoint& globalPosition() const { return m_globalPosition; } |
| 80 const IntPoint& movementDelta() const { return m_movementDelta; } | 82 const IntPoint& movementDelta() const { return m_movementDelta; } |
| 81 | 83 |
| 82 MouseButton button() const { return m_button; } | 84 MouseButton button() const { return m_button; } |
| 83 int clickCount() const { return m_clickCount; } | 85 int clickCount() const { return m_clickCount; } |
| 84 bool fromTouch() const { return m_synthesized == FromTouch; } | 86 bool fromTouch() const { return m_synthesized == FromTouch; } |
| 85 SyntheticEventType syntheticEventType() const { return m_synthesized; } | 87 SyntheticEventType syntheticEventType() const { return m_synthesized; } |
| 86 | 88 |
| 87 protected: | 89 protected: |
| 90 WebPointerProperties m_pointerProperties; |
| 91 |
| 88 IntPoint m_position; | 92 IntPoint m_position; |
| 89 IntPoint m_globalPosition; | 93 IntPoint m_globalPosition; |
| 90 IntPoint m_movementDelta; | 94 IntPoint m_movementDelta; |
| 91 MouseButton m_button; | 95 MouseButton m_button; |
| 92 int m_clickCount; | 96 int m_clickCount; |
| 93 SyntheticEventType m_synthesized; | 97 SyntheticEventType m_synthesized; |
| 94 }; | 98 }; |
| 95 | 99 |
| 96 } // namespace blink | 100 } // namespace blink |
| 97 | 101 |
| 98 #endif // PlatformMouseEvent_h | 102 #endif // PlatformMouseEvent_h |
| OLD | NEW |