| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 | 57 |
| 58 virtual ~MouseEvent(); | 58 virtual ~MouseEvent(); |
| 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>, |
| 68 int detail, int screenX, int screenY, int clientX, int clientY, |
| 69 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, |
| 70 short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, InputDe
vice* sourceDevice, unsigned short buttons = 0); |
| 71 |
| 72 |
| 67 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), | 73 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), |
| 68 // but we will match the standard DOM. | 74 // but we will match the standard DOM. |
| 69 short button() const { return m_button == -1 ? 0 : m_button; } | 75 short button() const { return m_button == -1 ? 0 : m_button; } |
| 70 unsigned short buttons() const { return m_buttons; } | 76 unsigned short buttons() const { return m_buttons; } |
| 71 bool buttonDown() const { return m_button != -1; } | 77 bool buttonDown() const { return m_button != -1; } |
| 72 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 78 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
| 73 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; } |
| 74 | 81 |
| 75 Node* toElement() const; | 82 Node* toElement() const; |
| 76 Node* fromElement() const; | 83 Node* fromElement() const; |
| 77 | 84 |
| 78 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g
et() : 0; } | 85 DataTransfer* dataTransfer() const { return isDragEvent() ? m_dataTransfer.g
et() : 0; } |
| 79 | 86 |
| 80 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } | 87 bool fromTouch() const { return m_syntheticEventType == PlatformMouseEvent::
FromTouch; } |
| 81 | 88 |
| 82 virtual const AtomicString& interfaceName() const override; | 89 virtual const AtomicString& interfaceName() const override; |
| 83 | 90 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 virtual bool dispatchEvent(EventDispatcher&) const override; | 137 virtual bool dispatchEvent(EventDispatcher&) const override; |
| 131 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } | 138 bool isSyntheticMouseEvent() const { return m_mouseEventType == SyntheticMou
seEvent; } |
| 132 MouseEventType m_mouseEventType; | 139 MouseEventType m_mouseEventType; |
| 133 }; | 140 }; |
| 134 | 141 |
| 135 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 142 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
| 136 | 143 |
| 137 } // namespace blink | 144 } // namespace blink |
| 138 | 145 |
| 139 #endif // MouseEvent_h | 146 #endif // MouseEvent_h |
| OLD | NEW |