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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 int movementX, int movementY, | 48 int movementX, int movementY, |
49 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, | 49 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, short button, un
signed short buttons, |
50 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, | 50 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, |
51 bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = Platf
ormMouseEvent::RealOrIndistinguishable, | 51 bool isSimulated = false, PlatformMouseEvent::SyntheticEventType = Platf
ormMouseEvent::RealOrIndistinguishable, |
52 double uiCreateTime = 0); | 52 double uiCreateTime = 0); |
53 | 53 |
54 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy
pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail,
PassRefPtrWillBeRawPtr<Node> relatedTarget); | 54 static PassRefPtrWillBeRawPtr<MouseEvent> create(const AtomicString& eventTy
pe, PassRefPtrWillBeRawPtr<AbstractView>, const PlatformMouseEvent&, int detail,
PassRefPtrWillBeRawPtr<Node> relatedTarget); |
55 | 55 |
56 static PassRefPtrWillBeRawPtr<MouseEvent> create(ScriptState*, const AtomicS
tring& eventType, const MouseEventInit&); | 56 static PassRefPtrWillBeRawPtr<MouseEvent> create(ScriptState*, const AtomicS
tring& eventType, const MouseEventInit&); |
57 | 57 |
58 virtual ~MouseEvent(); | 58 ~MouseEvent() override; |
59 | 59 |
60 static unsigned short platformModifiersToButtons(unsigned modifiers); | 60 static unsigned short platformModifiersToButtons(unsigned modifiers); |
61 | 61 |
62 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble,
bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, | 62 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble,
bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, |
63 int detail, int screenX, int screenY, int clientX, int clientY, | 63 int detail, int screenX, int screenY, int clientX, int clientY, |
64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, | 64 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, |
65 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, unsigne
d short buttons = 0); | 65 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, unsigne
d short buttons = 0); |
66 | 66 |
67 void initMouseEventInternal(ScriptState*, const AtomicString& type, bool can
Bubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, | 67 void initMouseEventInternal(ScriptState*, const AtomicString& type, bool can
Bubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView>, |
68 int detail, int screenX, int screenY, int clientX, int clientY, | 68 int detail, int screenX, int screenY, int clientX, int clientY, |
(...skipping 10 matching lines...) Expand all Loading... |
79 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m
_relatedTarget = relatedTarget; } | 79 void setRelatedTarget(PassRefPtrWillBeRawPtr<EventTarget> relatedTarget) { m
_relatedTarget = relatedTarget; } |
80 PlatformMouseEvent::SyntheticEventType syntheticEventType() const { return m
_syntheticEventType; } | 80 PlatformMouseEvent::SyntheticEventType syntheticEventType() const { return m
_syntheticEventType; } |
81 | 81 |
82 Node* toElement() const; | 82 Node* toElement() const; |
83 Node* fromElement() const; | 83 Node* fromElement() const; |
84 | 84 |
85 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g
et() : 0; } | 85 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g
et() : 0; } |
86 | 86 |
87 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } | 87 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } |
88 | 88 |
89 virtual const AtomicString& interfaceName() const override; | 89 const AtomicString& interfaceName() const override; |
90 | 90 |
91 virtual bool isMouseEvent() const override; | 91 bool isMouseEvent() const override; |
92 virtual bool isDragEvent() const override final; | 92 bool isDragEvent() const final; |
93 virtual int which() const override final; | 93 int which() const final; |
94 | 94 |
95 DECLARE_VIRTUAL_TRACE(); | 95 DECLARE_VIRTUAL_TRACE(); |
96 | 96 |
97 protected: | 97 protected: |
98 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, | 98 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtrWillBeRawPtr<AbstractView>, |
99 int detail, int screenX, int screenY, int windowX, int windowY, | 99 int detail, int screenX, int screenY, int windowX, int windowY, |
100 int movementX, int movementY, | 100 int movementX, int movementY, |
101 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, |
102 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, | 102 PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, DataTransfer*, |
103 bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreat
eTime = 0); | 103 bool isSimulated, PlatformMouseEvent::SyntheticEventType, double uiCreat
eTime = 0); |
104 | 104 |
105 MouseEvent(const AtomicString& type, const MouseEventInit&); | 105 MouseEvent(const AtomicString& type, const MouseEventInit&); |
106 | 106 |
107 MouseEvent(); | 107 MouseEvent(); |
108 | 108 |
109 private: | 109 private: |
110 short m_button; | 110 short m_button; |
111 unsigned short m_buttons; | 111 unsigned short m_buttons; |
112 RefPtrWillBeMember<EventTarget> m_relatedTarget; | 112 RefPtrWillBeMember<EventTarget> m_relatedTarget; |
113 PersistentWillBeMember<DataTransfer> m_dataTransfer; | 113 PersistentWillBeMember<DataTransfer> m_dataTransfer; |
114 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; | 114 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; |
115 }; | 115 }; |
116 | 116 |
117 class SimulatedMouseEvent final : public MouseEvent { | 117 class SimulatedMouseEvent final : public MouseEvent { |
118 public: | 118 public: |
119 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString
& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event>
underlyingEvent); | 119 static PassRefPtrWillBeRawPtr<SimulatedMouseEvent> create(const AtomicString
& eventType, PassRefPtrWillBeRawPtr<AbstractView>, PassRefPtrWillBeRawPtr<Event>
underlyingEvent); |
120 virtual ~SimulatedMouseEvent(); | 120 ~SimulatedMouseEvent() override; |
121 | 121 |
122 DECLARE_VIRTUAL_TRACE(); | 122 DECLARE_VIRTUAL_TRACE(); |
123 | 123 |
124 private: | 124 private: |
125 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<Ab
stractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent); | 125 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtrWillBeRawPtr<Ab
stractView>, PassRefPtrWillBeRawPtr<Event> underlyingEvent); |
126 }; | 126 }; |
127 | 127 |
128 class MouseEventDispatchMediator final : public EventDispatchMediator { | 128 class MouseEventDispatchMediator final : public EventDispatchMediator { |
129 public: | 129 public: |
130 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; | 130 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; |
131 static PassRefPtrWillBeRawPtr<MouseEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<MouseEvent>, MouseEventType = NonSyntheticMouseEvent); | 131 static PassRefPtrWillBeRawPtr<MouseEventDispatchMediator> create(PassRefPtrW
illBeRawPtr<MouseEvent>, MouseEventType = NonSyntheticMouseEvent); |
132 | 132 |
133 private: | 133 private: |
134 explicit MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent>, Mous
eEventType); | 134 explicit MouseEventDispatchMediator(PassRefPtrWillBeRawPtr<MouseEvent>, Mous
eEventType); |
135 MouseEvent& event() const; | 135 MouseEvent& event() const; |
136 | 136 |
137 virtual bool dispatchEvent(EventDispatcher&) const override; | 137 bool dispatchEvent(EventDispatcher&) const override; |
138 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } | 138 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } |
139 MouseEventType m_mouseEventType; | 139 MouseEventType m_mouseEventType; |
140 }; | 140 }; |
141 | 141 |
142 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 142 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
143 | 143 |
144 } // namespace blink | 144 } // namespace blink |
145 | 145 |
146 #endif // MouseEvent_h | 146 #endif // MouseEvent_h |
OLD | NEW |