| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 #ifndef MouseEvent_h | 24 #ifndef MouseEvent_h |
| 25 #define MouseEvent_h | 25 #define MouseEvent_h |
| 26 | 26 |
| 27 #include "core/CoreExport.h" | 27 #include "core/CoreExport.h" |
| 28 #include "core/events/EventDispatchMediator.h" | 28 #include "core/events/EventDispatchMediator.h" |
| 29 #include "core/events/MouseEventInit.h" | 29 #include "core/events/MouseEventInit.h" |
| 30 #include "core/events/MouseRelatedEvent.h" | 30 #include "core/events/MouseRelatedEvent.h" |
| 31 #include "platform/PlatformMouseEvent.h" | 31 #include "platform/PlatformMouseEvent.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | |
| 35 class DataTransfer; | 34 class DataTransfer; |
| 36 class EventDispatcher; | 35 class EventDispatcher; |
| 37 | 36 |
| 38 class CORE_EXPORT MouseEvent : public MouseRelatedEvent { | 37 class CORE_EXPORT MouseEvent : public MouseRelatedEvent { |
| 39 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
| 40 public: | 39 public: |
| 41 static PassRefPtrWillBeRawPtr<MouseEvent> create() | 40 static PassRefPtrWillBeRawPtr<MouseEvent> create() |
| 42 { | 41 { |
| 43 return adoptRefWillBeNoop(new MouseEvent); | 42 return adoptRefWillBeNoop(new MouseEvent); |
| 44 } | 43 } |
| 45 | 44 |
| 46 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& type, b
ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, | 45 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& type, b
ool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, |
| 47 int detail, int screenX, int screenY, int windowX, int windowY, | 46 int detail, int screenX, int screenY, int windowX, int windowY, |
| 48 int movementX, int movementY, | 47 int movementX, int movementY, |
| 49 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, | 48 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, |
| 50 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, | 49 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, |
| 51 bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = Platf
ormMouseEvent::RealOrIndistinguishable, | 50 bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = Platf
ormMouseEvent::RealOrIndistinguishable, |
| 52 double uiCreateTime = 0); | 51 double uiCreateTime = 0); |
| 53 | 52 |
| 54 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy
pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail,
PassRefPtrWillBeRawPtr<Node> relatedTarget); | 53 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy
pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail,
PassRefPtrWillBeRawPtr<Node> relatedTarget); |
| 55 | 54 |
| 56 static PassRefPtrWillBeRawPtr<MouseEvent> create(ScriptState*, const AtomicS
tring& eventType, const MouseEventInit&); | 55 static PassRefPtrWillBeRawPtr<MouseEvent> create(ScriptState*, const AtomicS
tring& eventType, const MouseEventInit&); |
| 57 | 56 |
| 58 ~MouseEvent() override; | 57 ~MouseEvent() override; |
| 59 | 58 |
| 60 static unsigned short platformModifiersToButtons(unsigned modifiers); | 59 static unsigned short platformModifiersToButtons(unsigned modifiers); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 75 short button() const { return m_button == -1 ? 0 : m_button; } | 74 short button() const { return m_button == -1 ? 0 : m_button; } |
| 76 unsigned short buttons() const { return m_buttons; } | 75 unsigned short buttons() const { return m_buttons; } |
| 77 bool buttonDown() const { return m_button != -1; } | 76 bool buttonDown() const { return m_button != -1; } |
| 78 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 77 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
| 79 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m
_relatedTarget = relatedTarget; } | 78 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m
_relatedTarget = relatedTarget; } |
| 80 PlatformMouseEvent::SyntheticEventType syntheticEventType() const { return m
_syntheticEventType; } | 79 PlatformMouseEvent::SyntheticEventType syntheticEventType() const { return m
_syntheticEventType; } |
| 81 | 80 |
| 82 Node* toElement() const; | 81 Node* toElement() const; |
| 83 Node* fromElement() const; | 82 Node* fromElement() const; |
| 84 | 83 |
| 85 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g
et() : 0; } | 84 virtual DataTransfer* dataTransfer() const { return 0; } |
| 86 | 85 |
| 87 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } | 86 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } |
| 88 | 87 |
| 89 const AtomicString& interfaceName() const override; | 88 const AtomicString& interfaceName() const override; |
| 90 | 89 |
| 91 bool isMouseEvent() const override; | 90 bool isMouseEvent() const override; |
| 92 bool isDragEvent() const final; | |
| 93 int which() const final; | 91 int which() const final; |
| 94 | 92 |
| 95 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; | 93 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; |
| 96 | 94 |
| 97 DECLARE_VIRTUAL_TRACE(); | 95 DECLARE_VIRTUAL_TRACE(); |
| 98 | 96 |
| 99 protected: | 97 protected: |
| 100 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, | 98 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, |
| 101 int detail, int screenX, int screenY, int windowX, int windowY, | 99 int detail, int screenX, int screenY, int windowX, int windowY, |
| 102 int movementX, int movementY, | 100 int movementX, int movementY, |
| 103 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, | 101 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, |
| 104 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, | 102 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, |
| 105 bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreat
eTime = 0); | 103 bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreat
eTime = 0); |
| 106 | 104 |
| 107 MouseEvent(const AtomicString& type, const MouseEventInit&); | 105 MouseEvent(const AtomicString& type, const MouseEventInit&); |
| 108 | 106 |
| 109 MouseEvent(); | 107 MouseEvent(); |
| 110 | 108 |
| 111 private: | 109 private: |
| 112 short m_button; | 110 short m_button; |
| 113 unsigned short m_buttons; | 111 unsigned short m_buttons; |
| 114 RefPtrWillBeMember<EventTarget> m_relatedTarget; | 112 RefPtrWillBeMember<EventTarget> m_relatedTarget; |
| 115 PersistentWillBeMember<DataTransfer> m_dataTransfer; | |
| 116 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; | 113 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; |
| 117 }; | 114 }; |
| 118 | 115 |
| 119 class SimulatedMouseEvent final : public MouseEvent { | 116 class SimulatedMouseEvent final : public MouseEvent { |
| 120 public: | 117 public: |
| 121 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString
& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event>
underlyingEvent); | 118 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString
& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event>
underlyingEvent); |
| 122 ~SimulatedMouseEvent() override; | 119 ~SimulatedMouseEvent() override; |
| 123 | 120 |
| 124 DECLARE_VIRTUAL_TRACE(); | 121 DECLARE_VIRTUAL_TRACE(); |
| 125 | 122 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 136 MouseEvent& event() const; | 133 MouseEvent& event() const; |
| 137 | 134 |
| 138 bool dispatchEvent(EventDispatcher&) const override; | 135 bool dispatchEvent(EventDispatcher&) const override; |
| 139 }; | 136 }; |
| 140 | 137 |
| 141 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 138 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
| 142 | 139 |
| 143 } // namespace blink | 140 } // namespace blink |
| 144 | 141 |
| 145 #endif // MouseEvent_h | 142 #endif // MouseEvent_h |
| OLD | NEW |