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