| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 Node* fromElement() const; | 84 Node* fromElement() const; |
| 85 | 85 |
| 86 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } | 86 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } |
| 87 | 87 |
| 88 virtual const AtomicString& interfaceName() const override; | 88 virtual const AtomicString& interfaceName() const override; |
| 89 | 89 |
| 90 virtual bool isMouseEvent() const override; | 90 virtual bool isMouseEvent() const override; |
| 91 virtual bool isDragEvent() const override final; | 91 virtual bool isDragEvent() const override final; |
| 92 virtual int which() const override final; | 92 virtual int which() const override final; |
| 93 | 93 |
| 94 virtual void trace(Visitor*) override; | |
| 95 | |
| 96 protected: | 94 protected: |
| 97 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, | 95 MouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRe
fPtr<AbstractView>, |
| 98 int detail, int screenX, int screenY, int pageX, int pageY, | 96 int detail, int screenX, int screenY, int pageX, int pageY, |
| 99 int movementX, int movementY, | 97 int movementX, int movementY, |
| 100 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
utton, | 98 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short b
utton, |
| 101 PassRefPtr<EventTarget> relatedTarget, | 99 PassRefPtr<EventTarget> relatedTarget, |
| 102 bool isSimulated, PlatformMouseEvent::SyntheticEventType); | 100 bool isSimulated, PlatformMouseEvent::SyntheticEventType); |
| 103 | 101 |
| 104 MouseEvent(const AtomicString& type, const MouseEventInit&); | 102 MouseEvent(const AtomicString& type, const MouseEventInit&); |
| 105 | 103 |
| 106 MouseEvent(); | 104 MouseEvent(); |
| 107 | 105 |
| 108 private: | 106 private: |
| 109 unsigned short m_button; | 107 unsigned short m_button; |
| 110 bool m_buttonDown; | 108 bool m_buttonDown; |
| 111 RefPtr<EventTarget> m_relatedTarget; | 109 RefPtr<EventTarget> m_relatedTarget; |
| 112 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; | 110 PlatformMouseEvent::SyntheticEventType m_syntheticEventType; |
| 113 }; | 111 }; |
| 114 | 112 |
| 115 class SimulatedMouseEvent final : public MouseEvent { | 113 class SimulatedMouseEvent final : public MouseEvent { |
| 116 public: | 114 public: |
| 117 static PassRefPtr<SimulatedMouseEvent> create(const AtomicString& eventType,
PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); | 115 static PassRefPtr<SimulatedMouseEvent> create(const AtomicString& eventType,
PassRefPtr<AbstractView>, PassRefPtr<Event> underlyingEvent); |
| 118 virtual ~SimulatedMouseEvent(); | 116 virtual ~SimulatedMouseEvent(); |
| 119 | 117 |
| 120 virtual void trace(Visitor*) override; | |
| 121 | |
| 122 private: | 118 private: |
| 123 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtr<AbstractView>,
PassRefPtr<Event> underlyingEvent); | 119 SimulatedMouseEvent(const AtomicString& eventType, PassRefPtr<AbstractView>,
PassRefPtr<Event> underlyingEvent); |
| 124 }; | 120 }; |
| 125 | 121 |
| 126 class MouseEventDispatchMediator final : public EventDispatchMediator { | 122 class MouseEventDispatchMediator final : public EventDispatchMediator { |
| 127 public: | 123 public: |
| 128 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; | 124 enum MouseEventType { SyntheticMouseEvent, NonSyntheticMouseEvent}; |
| 129 static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtr<MouseEvent>,
MouseEventType = NonSyntheticMouseEvent); | 125 static PassRefPtr<MouseEventDispatchMediator> create(PassRefPtr<MouseEvent>,
MouseEventType = NonSyntheticMouseEvent); |
| 130 | 126 |
| 131 private: | 127 private: |
| 132 explicit MouseEventDispatchMediator(PassRefPtr<MouseEvent>, MouseEventType); | 128 explicit MouseEventDispatchMediator(PassRefPtr<MouseEvent>, MouseEventType); |
| 133 MouseEvent* event() const; | 129 MouseEvent* event() const; |
| 134 | 130 |
| 135 virtual bool dispatchEvent(EventDispatcher*) const override; | 131 virtual bool dispatchEvent(EventDispatcher*) const override; |
| 136 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } | 132 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } |
| 137 MouseEventType m_mouseEventType; | 133 MouseEventType m_mouseEventType; |
| 138 }; | 134 }; |
| 139 | 135 |
| 140 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 136 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
| 141 | 137 |
| 142 } // namespace blink | 138 } // namespace blink |
| 143 | 139 |
| 144 #endif // MouseEvent_h | 140 #endif // MouseEvent_h |
| OLD | NEW |