| Index: Source/platform/PlatformMouseEvent.h
|
| diff --git a/Source/core/platform/PlatformGestureEvent.h b/Source/platform/PlatformMouseEvent.h
|
| similarity index 54%
|
| rename from Source/core/platform/PlatformGestureEvent.h
|
| rename to Source/platform/PlatformMouseEvent.h
|
| index 61b99afb7392a150ee9280e7877a5834c1fc6c6a..7c8e0361e538d472d5de6305f8838e90e1450de9 100644
|
| --- a/Source/core/platform/PlatformGestureEvent.h
|
| +++ b/Source/platform/PlatformMouseEvent.h
|
| @@ -1,5 +1,5 @@
|
| /*
|
| - * Copyright (C) 2011 Apple Inc. All rights reserved.
|
| + * Copyright (C) 2004, 2005, 2006, 2009 Apple Inc. All rights reserved.
|
| *
|
| * Redistribution and use in source and binary forms, with or without
|
| * modification, are permitted provided that the following conditions
|
| @@ -23,60 +23,54 @@
|
| * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| */
|
|
|
| -#ifndef PlatformGestureEvent_h
|
| -#define PlatformGestureEvent_h
|
| +#ifndef PlatformMouseEvent_h
|
| +#define PlatformMouseEvent_h
|
|
|
| #include "platform/PlatformEvent.h"
|
| -#include "platform/geometry/FloatPoint.h"
|
| #include "platform/geometry/IntPoint.h"
|
| -#include "platform/geometry/IntSize.h"
|
|
|
| namespace WebCore {
|
|
|
| -class PlatformGestureEvent : public PlatformEvent {
|
| -public:
|
| - PlatformGestureEvent()
|
| - : PlatformEvent(PlatformEvent::GestureScrollBegin)
|
| - , m_deltaX(0)
|
| - , m_deltaY(0)
|
| - {
|
| - }
|
| +// These button numbers match the ones used in the DOM API, 0 through 2, except for NoButton which isn't specified.
|
| +enum MouseButton { NoButton = -1, LeftButton, MiddleButton, RightButton };
|
|
|
| - PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, float deltaX, float deltaY, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
|
| - : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
|
| - , m_position(position)
|
| - , m_globalPosition(globalPosition)
|
| - , m_deltaX(deltaX)
|
| - , m_deltaY(deltaY)
|
| +class PlatformMouseEvent : public PlatformEvent {
|
| +public:
|
| + PlatformMouseEvent()
|
| + : PlatformEvent(PlatformEvent::MouseMoved)
|
| + , m_button(NoButton)
|
| + , m_clickCount(0)
|
| + , m_modifierFlags(0)
|
| {
|
| }
|
|
|
| - PlatformGestureEvent(Type type, const IntPoint& position, const IntPoint& globalPosition, double timestamp, const IntSize& area, const FloatPoint& delta, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey)
|
| + PlatformMouseEvent(const IntPoint& position, const IntPoint& globalPosition, MouseButton button, PlatformEvent::Type type, int clickCount, bool shiftKey, bool ctrlKey, bool altKey, bool metaKey, double timestamp)
|
| : PlatformEvent(type, shiftKey, ctrlKey, altKey, metaKey, timestamp)
|
| , m_position(position)
|
| , m_globalPosition(globalPosition)
|
| - , m_area(area)
|
| - , m_deltaX(delta.x())
|
| - , m_deltaY(delta.y())
|
| + , m_button(button)
|
| + , m_clickCount(clickCount)
|
| + , m_modifierFlags(0)
|
| {
|
| }
|
|
|
| - const IntPoint& position() const { return m_position; } // PlatformWindow coordinates.
|
| - const IntPoint& globalPosition() const { return m_globalPosition; } // Screen coordinates.
|
| -
|
| - const IntSize& area() const { return m_area; }
|
| + const IntPoint& position() const { return m_position; }
|
| + const IntPoint& globalPosition() const { return m_globalPosition; }
|
| + const IntPoint& movementDelta() const { return m_movementDelta; }
|
|
|
| - float deltaX() const { return m_deltaX; }
|
| - float deltaY() const { return m_deltaY; }
|
| + MouseButton button() const { return m_button; }
|
| + int clickCount() const { return m_clickCount; }
|
| + unsigned modifierFlags() const { return m_modifierFlags; }
|
|
|
| protected:
|
| IntPoint m_position;
|
| IntPoint m_globalPosition;
|
| - IntSize m_area;
|
| - float m_deltaX;
|
| - float m_deltaY;
|
| + IntPoint m_movementDelta;
|
| + MouseButton m_button;
|
| + int m_clickCount;
|
| + unsigned m_modifierFlags;
|
| };
|
|
|
| } // namespace WebCore
|
|
|
| -#endif // PlatformGestureEvent_h
|
| +#endif // PlatformMouseEvent_h
|
|
|