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, 2007, 2008 Apple Inc. All rights reserv
ed. | 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserv
ed. |
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 return adoptRefWillBeRefCountedGarbageCollected(new Event); | 79 return adoptRefWillBeRefCountedGarbageCollected(new Event); |
80 } | 80 } |
81 | 81 |
82 // A factory for a simple event. The event doesn't bubble, and isn't | 82 // A factory for a simple event. The event doesn't bubble, and isn't |
83 // cancelable. | 83 // cancelable. |
84 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht
ml#fire-a-simple-event | 84 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht
ml#fire-a-simple-event |
85 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type) | 85 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type) |
86 { | 86 { |
87 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, f
alse)); | 87 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, f
alse)); |
88 } | 88 } |
89 static PassRefPtr<Event> createCancelable(const AtomicString& type) | 89 static PassRefPtrWillBeRawPtr<Event> createCancelable(const AtomicString& ty
pe) |
90 { | 90 { |
91 return adoptRef(new Event(type, false, true)); | 91 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, t
rue)); |
92 } | 92 } |
93 static PassRefPtr<Event> createBubble(const AtomicString& type) | 93 static PassRefPtrWillBeRawPtr<Event> createBubble(const AtomicString& type) |
94 { | 94 { |
95 return adoptRef(new Event(type, true, false)); | 95 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, fa
lse)); |
96 } | 96 } |
97 static PassRefPtr<Event> createCancelableBubble(const AtomicString& type) | 97 static PassRefPtrWillBeRawPtr<Event> createCancelableBubble(const AtomicStri
ng& type) |
98 { | 98 { |
99 return adoptRef(new Event(type, true, true)); | 99 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, true, tr
ue)); |
100 } | 100 } |
101 | 101 |
102 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const
EventInit& initializer) | 102 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const
EventInit& initializer) |
103 { | 103 { |
104 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, initiali
zer)); | 104 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, initiali
zer)); |
105 } | 105 } |
106 | 106 |
107 virtual ~Event(); | 107 virtual ~Event(); |
108 | 108 |
109 void initEvent(const AtomicString& type, bool canBubble, bool cancelable); | 109 void initEvent(const AtomicString& type, bool canBubble, bool cancelable); |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 RefPtr<Event> m_underlyingEvent; | 209 RefPtr<Event> m_underlyingEvent; |
210 OwnPtr<EventPath> m_eventPath; | 210 OwnPtr<EventPath> m_eventPath; |
211 }; | 211 }; |
212 | 212 |
213 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 213 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
214 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) | 214 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) |
215 | 215 |
216 } // namespace WebCore | 216 } // namespace WebCore |
217 | 217 |
218 #endif // Event_h | 218 #endif // Event_h |
OLD | NEW |