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 22 matching lines...) Expand all Loading... |
33 namespace blink { | 33 namespace blink { |
34 class DataTransfer; | 34 class DataTransfer; |
35 class EventDispatcher; | 35 class EventDispatcher; |
36 | 36 |
37 class CORE_EXPORT MouseEvent : public MouseRelatedEvent { | 37 class CORE_EXPORT MouseEvent : public MouseRelatedEvent { |
38 DEFINE_WRAPPERTYPEINFO(); | 38 DEFINE_WRAPPERTYPEINFO(); |
39 | 39 |
40 public: | 40 public: |
41 static MouseEvent* create() { return new MouseEvent; } | 41 static MouseEvent* create() { return new MouseEvent; } |
42 | 42 |
43 // TODO(mustaq): Should replace most/all of these params with a MouseEventInit
. | 43 // TODO(mustaq): Should replace most/all of these params with a |
| 44 // MouseEventInit. |
44 static MouseEvent* create(const AtomicString& type, | 45 static MouseEvent* create(const AtomicString& type, |
45 bool canBubble, | 46 bool canBubble, |
46 bool cancelable, | 47 bool cancelable, |
47 AbstractView*, | 48 AbstractView*, |
48 int detail, | 49 int detail, |
49 int screenX, | 50 int screenX, |
50 int screenY, | 51 int screenY, |
51 int windowX, | 52 int windowX, |
52 int windowY, | 53 int windowY, |
53 int movementX, | 54 int movementX, |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 int clientX, | 92 int clientX, |
92 int clientY, | 93 int clientY, |
93 bool ctrlKey, | 94 bool ctrlKey, |
94 bool altKey, | 95 bool altKey, |
95 bool shiftKey, | 96 bool shiftKey, |
96 bool metaKey, | 97 bool metaKey, |
97 short button, | 98 short button, |
98 EventTarget* relatedTarget, | 99 EventTarget* relatedTarget, |
99 unsigned short buttons = 0); | 100 unsigned short buttons = 0); |
100 | 101 |
101 // WinIE uses 1,4,2 for left/middle/right but not for click (just for mousedow
n/up, maybe others), | 102 // WinIE uses 1,4,2 for left/middle/right but not for click (just for |
102 // but we will match the standard DOM. | 103 // mousedown/up, maybe others), but we will match the standard DOM. |
103 virtual short button() const { return m_button == -1 ? 0 : m_button; } | 104 virtual short button() const { return m_button == -1 ? 0 : m_button; } |
104 unsigned short buttons() const { return m_buttons; } | 105 unsigned short buttons() const { return m_buttons; } |
105 bool buttonDown() const { return m_button != -1; } | 106 bool buttonDown() const { return m_button != -1; } |
106 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } | 107 EventTarget* relatedTarget() const { return m_relatedTarget.get(); } |
107 void setRelatedTarget(EventTarget* relatedTarget) { | 108 void setRelatedTarget(EventTarget* relatedTarget) { |
108 m_relatedTarget = relatedTarget; | 109 m_relatedTarget = relatedTarget; |
109 } | 110 } |
110 PlatformMouseEvent::SyntheticEventType getSyntheticEventType() const { | 111 PlatformMouseEvent::SyntheticEventType getSyntheticEventType() const { |
111 return m_syntheticEventType; | 112 return m_syntheticEventType; |
112 } | 113 } |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 MouseEvent& event() const; | 197 MouseEvent& event() const; |
197 | 198 |
198 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 199 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
199 }; | 200 }; |
200 | 201 |
201 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 202 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
202 | 203 |
203 } // namespace blink | 204 } // namespace blink |
204 | 205 |
205 #endif // MouseEvent_h | 206 #endif // MouseEvent_h |
OLD | NEW |