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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 KEYDOWN = 256, | 67 KEYDOWN = 256, |
68 KEYUP = 512, | 68 KEYUP = 512, |
69 KEYPRESS = 1024, | 69 KEYPRESS = 1024, |
70 DRAGDROP = 2048, | 70 DRAGDROP = 2048, |
71 FOCUS = 4096, | 71 FOCUS = 4096, |
72 BLUR = 8192, | 72 BLUR = 8192, |
73 SELECT = 16384, | 73 SELECT = 16384, |
74 CHANGE = 32768 | 74 CHANGE = 32768 |
75 }; | 75 }; |
76 | 76 |
77 static PassRefPtr<Event> create() | 77 static PassRefPtrWillBeRawPtr<Event> create() |
78 { | 78 { |
79 return adoptRef(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 PassRefPtr<Event> create(const AtomicString& type) | 85 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type) |
86 { | 86 { |
87 return adoptRef(new Event(type, false, false)); | 87 return adoptRefWillBeRefCountedGarbageCollected(new Event(type, false, f
alse)); |
88 } | 88 } |
89 static PassRefPtr<Event> createCancelable(const AtomicString& type) | 89 static PassRefPtr<Event> createCancelable(const AtomicString& type) |
90 { | 90 { |
91 return adoptRef(new Event(type, false, true)); | 91 return adoptRef(new Event(type, false, true)); |
92 } | 92 } |
93 static PassRefPtr<Event> createBubble(const AtomicString& type) | 93 static PassRefPtr<Event> createBubble(const AtomicString& type) |
94 { | 94 { |
95 return adoptRef(new Event(type, true, false)); | 95 return adoptRef(new Event(type, true, false)); |
96 } | 96 } |
97 static PassRefPtr<Event> createCancelableBubble(const AtomicString& type) | 97 static PassRefPtr<Event> createCancelableBubble(const AtomicString& type) |
98 { | 98 { |
99 return adoptRef(new Event(type, true, true)); | 99 return adoptRef(new Event(type, true, true)); |
100 } | 100 } |
101 | 101 |
102 static PassRefPtr<Event> create(const AtomicString& type, const EventInit& i
nitializer) | 102 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const
EventInit& initializer) |
103 { | 103 { |
104 return adoptRef(new Event(type, initializer)); | 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); |
110 | 110 |
111 const AtomicString& type() const { return m_type; } | 111 const AtomicString& type() const { return m_type; } |
112 void setType(const AtomicString& type) { m_type = type; } | 112 void setType(const AtomicString& type) { m_type = type; } |
113 | 113 |
114 EventTarget* target() const { return m_target.get(); } | 114 EventTarget* target() const { return m_target.get(); } |
(...skipping 94 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 |