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, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 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. |
11 * | 11 * |
12 * This library is distributed in the hope that it will be useful, | 12 * This library is distributed in the hope that it will be useful, |
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 * Library General Public License for more details. | 15 * Library General Public License for more details. |
16 * | 16 * |
17 * You should have received a copy of the GNU Library General Public License | 17 * You should have received a copy of the GNU Library General Public License |
18 * along with this library; see the file COPYING.LIB. If not, write to | 18 * along with this library; see the file COPYING.LIB. If not, write to |
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
20 * Boston, MA 02110-1301, USA. | 20 * Boston, MA 02110-1301, USA. |
21 */ | 21 */ |
22 | 22 |
23 #include "config.h" | 23 #include "config.h" |
24 #include "core/events/UIEvent.h" | 24 #include "core/events/UIEvent.h" |
25 | 25 |
26 | |
27 namespace blink { | 26 namespace blink { |
28 | 27 |
29 UIEvent::UIEvent() | 28 UIEvent::UIEvent() |
30 : m_detail(0) | 29 : m_detail(0) |
31 { | 30 { |
32 } | 31 } |
33 | 32 |
34 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab
leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) | 33 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelab
leArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) |
35 : Event(eventType, canBubbleArg, cancelableArg) | 34 : Event(eventType, canBubbleArg, cancelableArg) |
36 , m_view(viewArg) | 35 , m_view(viewArg) |
37 , m_detail(detailArg) | 36 , m_detail(detailArg) |
| 37 , m_sourceDevice(InputDevice::create()) |
38 { | 38 { |
39 } | 39 } |
40 | 40 |
41 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) | 41 UIEvent::UIEvent(const AtomicString& eventType, const UIEventInit& initializer) |
42 : Event(eventType, initializer) | 42 : Event(eventType, initializer) |
43 , m_view(initializer.view()) | 43 , m_view(initializer.view()) |
44 , m_detail(initializer.detail()) | 44 , m_detail(initializer.detail()) |
| 45 , m_sourceDevice(initializer.sourceDevice()) |
45 { | 46 { |
46 } | 47 } |
47 | 48 |
48 UIEvent::~UIEvent() | 49 UIEvent::~UIEvent() |
49 { | 50 { |
50 } | 51 } |
51 | 52 |
52 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c
ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) | 53 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool c
ancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg) |
53 { | 54 { |
54 if (dispatched()) | 55 if (dispatched()) |
55 return; | 56 return; |
56 | 57 |
57 initEvent(typeArg, canBubbleArg, cancelableArg); | 58 initEvent(typeArg, canBubbleArg, cancelableArg); |
58 | 59 |
59 m_view = viewArg; | 60 m_view = viewArg; |
60 m_detail = detailArg; | 61 m_detail = detailArg; |
| 62 m_sourceDevice = InputDevice::create(); |
61 } | 63 } |
62 | 64 |
63 bool UIEvent::isUIEvent() const | 65 bool UIEvent::isUIEvent() const |
64 { | 66 { |
65 return true; | 67 return true; |
66 } | 68 } |
67 | 69 |
68 const AtomicString& UIEvent::interfaceName() const | 70 const AtomicString& UIEvent::interfaceName() const |
69 { | 71 { |
70 return EventNames::UIEvent; | 72 return EventNames::UIEvent; |
(...skipping 30 matching lines...) Expand all Loading... |
101 } | 103 } |
102 | 104 |
103 int UIEvent::which() const | 105 int UIEvent::which() const |
104 { | 106 { |
105 return 0; | 107 return 0; |
106 } | 108 } |
107 | 109 |
108 DEFINE_TRACE(UIEvent) | 110 DEFINE_TRACE(UIEvent) |
109 { | 111 { |
110 visitor->trace(m_view); | 112 visitor->trace(m_view); |
| 113 visitor->trace(m_sourceDevice); |
111 Event::trace(visitor); | 114 Event::trace(visitor); |
112 } | 115 } |
113 | 116 |
114 } // namespace blink | 117 } // namespace blink |
OLD | NEW |