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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 | 54 |
55 static MouseEvent* create(const AtomicString& eventType, AbstractView*, cons
t PlatformMouseEvent&, int detail, Node* relatedTarget); | 55 static MouseEvent* create(const AtomicString& eventType, AbstractView*, cons
t PlatformMouseEvent&, int detail, Node* relatedTarget); |
56 | 56 |
57 static MouseEvent* create(ScriptState*, const AtomicString& eventType, const
MouseEventInit&); | 57 static MouseEvent* create(ScriptState*, const AtomicString& eventType, const
MouseEventInit&); |
58 | 58 |
59 static MouseEvent* create(const AtomicString& eventType, AbstractView*, Even
t* underlyingEvent, SimulatedClickCreationScope); | 59 static MouseEvent* create(const AtomicString& eventType, AbstractView*, Even
t* underlyingEvent, SimulatedClickCreationScope); |
60 | 60 |
61 ~MouseEvent() override; | 61 ~MouseEvent() override; |
62 | 62 |
63 static unsigned short platformModifiersToButtons(unsigned modifiers); | 63 static unsigned short platformModifiersToButtons(unsigned modifiers); |
| 64 static unsigned short buttonToButtons(short button); |
64 | 65 |
65 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble,
bool cancelable, AbstractView*, | 66 void initMouseEvent(ScriptState*, const AtomicString& type, bool canBubble,
bool cancelable, AbstractView*, |
66 int detail, int screenX, int screenY, int clientX, int clientY, | 67 int detail, int screenX, int screenY, int clientX, int clientY, |
67 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, | 68 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, |
68 short button, EventTarget* relatedTarget, unsigned short buttons = 0); | 69 short button, EventTarget* relatedTarget, unsigned short buttons = 0); |
69 | 70 |
70 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), | 71 // WinIE uses 1,4,2 for left/middle/right but not for click (just for moused
own/up, maybe others), |
71 // but we will match the standard DOM. | 72 // but we will match the standard DOM. |
72 virtual short button() const { return m_button == -1 ? 0 : m_button; } | 73 virtual short button() const { return m_button == -1 ? 0 : m_button; } |
73 unsigned short buttons() const { return m_buttons; } | 74 unsigned short buttons() const { return m_buttons; } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 MouseEvent& event() const; | 141 MouseEvent& event() const; |
141 | 142 |
142 DispatchEventResult dispatchEvent(EventDispatcher&) const override; | 143 DispatchEventResult dispatchEvent(EventDispatcher&) const override; |
143 }; | 144 }; |
144 | 145 |
145 DEFINE_EVENT_TYPE_CASTS(MouseEvent); | 146 DEFINE_EVENT_TYPE_CASTS(MouseEvent); |
146 | 147 |
147 } // namespace blink | 148 } // namespace blink |
148 | 149 |
149 #endif // MouseEvent_h | 150 #endif // MouseEvent_h |
OLD | NEW |