| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 } | 43 } |
| 44 | 44 |
| 45 // TODO(mustaq): Should replace most/all of these params with a MouseEventIn
it. | 45 // TODO(mustaq): Should replace most/all of these params with a MouseEventIn
it. |
| 46 static MouseEvent* create(const AtomicString& type, bool canBubble, bool can
celable, AbstractView*, | 46 static MouseEvent* create(const AtomicString& type, bool canBubble, bool can
celable, AbstractView*, |
| 47 int detail, int screenX, int screenY, int windowX, int windowY, | 47 int detail, int screenX, int screenY, int windowX, int windowY, |
| 48 int movementX, int movementY, PlatformEvent::Modifiers, | 48 int movementX, int movementY, PlatformEvent::Modifiers, |
| 49 short button, unsigned short buttons, | 49 short button, unsigned short buttons, |
| 50 EventTarget* relatedTarget, | 50 EventTarget* relatedTarget, |
| 51 double platformTimeStamp, | 51 double platformTimeStamp, |
| 52 PlatformMouseEvent::SyntheticEventType, | 52 PlatformMouseEvent::SyntheticEventType, |
| 53 const String& region); | 53 const String& region, |
| 54 const PlatformMouseEvent*); |
| 54 | 55 |
| 55 static MouseEvent* create(const AtomicString& eventType, AbstractView*, cons
t PlatformMouseEvent&, int detail, Node* relatedTarget); | 56 static MouseEvent* create(const AtomicString& eventType, AbstractView*, cons
t PlatformMouseEvent&, int detail, Node* relatedTarget); |
| 56 | 57 |
| 57 static MouseEvent* create(ScriptState*, const AtomicString& eventType, const
MouseEventInit&); | 58 static MouseEvent* create(ScriptState*, const AtomicString& eventType, const
MouseEventInit&); |
| 58 | 59 |
| 59 static MouseEvent* create(const AtomicString& eventType, AbstractView*, Even
t* underlyingEvent, SimulatedClickCreationScope); | 60 static MouseEvent* create(const AtomicString& eventType, AbstractView*, Even
t* underlyingEvent, SimulatedClickCreationScope); |
| 60 | 61 |
| 61 ~MouseEvent() override; | 62 ~MouseEvent() override; |
| 62 | 63 |
| 63 static unsigned short platformModifiersToButtons(unsigned modifiers); | 64 static unsigned short platformModifiersToButtons(unsigned modifiers); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 87 | 88 |
| 88 const AtomicString& interfaceName() const override; | 89 const AtomicString& interfaceName() const override; |
| 89 | 90 |
| 90 bool isMouseEvent() const override; | 91 bool isMouseEvent() const override; |
| 91 int which() const final; | 92 int which() const final; |
| 92 | 93 |
| 93 EventDispatchMediator* createMediator() override; | 94 EventDispatchMediator* createMediator() override; |
| 94 | 95 |
| 95 int clickCount() { return detail(); } | 96 int clickCount() { return detail(); } |
| 96 | 97 |
| 98 const PlatformMouseEvent* mouseEvent() const { return m_mouseEvent.get(); } |
| 99 |
| 97 DECLARE_VIRTUAL_TRACE(); | 100 DECLARE_VIRTUAL_TRACE(); |
| 98 | 101 |
| 99 protected: | 102 protected: |
| 100 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, Abstra
ctView*, | 103 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, Abstra
ctView*, |
| 101 int detail, int screenX, int screenY, int windowX, int windowY, | 104 int detail, int screenX, int screenY, int windowX, int windowY, |
| 102 int movementX, int movementY, | 105 int movementX, int movementY, |
| 103 PlatformEvent::Modifiers, short button, unsigned short buttons, | 106 PlatformEvent::Modifiers, short button, unsigned short buttons, |
| 104 EventTarget* relatedTarget, | 107 EventTarget* relatedTarget, |
| 105 double platformTimeStamp, | 108 double platformTimeStamp, |
| 106 PlatformMouseEvent::SyntheticEventType, | 109 PlatformMouseEvent::SyntheticEventType, |
| 107 const String& region); | 110 const String& region, |
| 111 const PlatformMouseEvent*); |
| 108 | 112 |
| 109 MouseEvent(const AtomicString& type, const MouseEventInit&); | 113 MouseEvent(const AtomicString& type, const MouseEventInit&); |
| 110 | 114 |
| 111 MouseEvent(); | 115 MouseEvent(); |
| 112 | 116 |
| 113 short rawButton() const { return m_button; } | 117 short rawButton() const { return m_button; } |
| 114 | 118 |
| 115 private: | 119 private: |
| 116 friend class MouseEventDispatchMediator; | 120 friend class MouseEventDispatchMediator; |
| 117 void initMouseEventInternal(const AtomicString& type, bool canBubble, bool c
ancelable, AbstractView*, | 121 void initMouseEventInternal(const AtomicString& type, bool canBubble, bool c
ancelable, AbstractView*, |
| 118 int detail, int screenX, int screenY, int clientX, int clientY, | 122 int detail, int screenX, int screenY, int clientX, int clientY, |
| 119 PlatformEvent::Modifiers, | 123 PlatformEvent::Modifiers, |
| 120 short button, EventTarget* relatedTarget, InputDeviceCapabilities* sourc
eCapabilities, unsigned short buttons = 0); | 124 short button, EventTarget* relatedTarget, InputDeviceCapabilities* sourc
eCapabilities, unsigned short buttons = 0); |
| 121 | 125 |
| 122 short m_button; | 126 short m_button; |
| 123 unsigned short m_buttons; | 127 unsigned short m_buttons; |
| 124 Member<EventTarget> m_relatedTarget; | 128 Member<EventTarget> m_relatedTarget; |
| 125 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; | 129 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; |
| 126 String m_region; | 130 String m_region; |
| 131 std::unique_ptr<PlatformMouseEvent> m_mouseEvent; |
| 127 }; | 132 }; |
| 128 | 133 |
| 129 class MouseEventDispatchMediator final : public EventDispatchMediator { | 134 class MouseEventDispatchMediator final : public EventDispatchMediator { |
| 130 public: | 135 public: |
| 131 static MouseEventDispatchMediator* create(MouseEvent*); | 136 static MouseEventDispatchMediator* create(MouseEvent*); |
| 132 | 137 |
| 133 private: | 138 private: |
| 134 explicit MouseEventDispatchMediator(MouseEvent*); | 139 explicit MouseEventDispatchMediator(MouseEvent*); |
| 135 MouseEvent& event() const; | 140 MouseEvent& event() const; |
| 136 | 141 |
| 137 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 142 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
| 138 }; | 143 }; |
| 139 | 144 |
| 140 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 145 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
| 141 | 146 |
| 142 } // namespace blink | 147 } // namespace blink |
| 143 | 148 |
| 144 #endif // MouseEvent_h | 149 #endif // MouseEvent_h |
| OLD | NEW |