MouseRelatedEvent.h [plain text]
#ifndef MouseRelatedEvent_h
#define MouseRelatedEvent_h
#include "LayoutPoint.h"
#include "UIEventWithKeyState.h"
namespace WebCore {
class MouseRelatedEvent : public UIEventWithKeyState {
public:
int screenX() const { return m_screenLocation.x(); }
int screenY() const { return m_screenLocation.y(); }
const IntPoint& screenLocation() const { return m_screenLocation; }
int clientX() const { return m_clientLocation.x(); }
int clientY() const { return m_clientLocation.y(); }
#if ENABLE(POINTER_LOCK)
int movementX() const { return m_movementDelta.x(); }
int movementY() const { return m_movementDelta.y(); }
#endif
const LayoutPoint& clientLocation() const { return m_clientLocation; }
int layerX() override;
int layerY() override;
int offsetX();
int offsetY();
bool isSimulated() const { return m_isSimulated; }
virtual int pageX() const override;
virtual int pageY() const override;
virtual const LayoutPoint& pageLocation() const;
int x() const;
int y() const;
const LayoutPoint& absoluteLocation() const { return m_absoluteLocation; }
void setAbsoluteLocation(const LayoutPoint& p) { m_absoluteLocation = p; }
protected:
MouseRelatedEvent();
MouseRelatedEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr<AbstractView>,
int detail, const IntPoint& screenLocation, const IntPoint& windowLocation,
#if ENABLE(POINTER_LOCK)
const IntPoint& movementDelta,
#endif
bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, bool isSimulated = false);
void initCoordinates();
void initCoordinates(const LayoutPoint& clientLocation);
virtual void receivedTarget() override;
void computePageLocation();
void computeRelativePosition();
IntPoint m_screenLocation;
LayoutPoint m_clientLocation;
#if ENABLE(POINTER_LOCK)
LayoutPoint m_movementDelta;
#endif
private:
LayoutPoint m_pageLocation;
LayoutPoint m_layerLocation;
LayoutPoint m_offsetLocation;
LayoutPoint m_absoluteLocation;
bool m_isSimulated;
bool m_hasCachedRelativePosition;
};
}
#endif // MouseRelatedEvent_h