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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 KEYDOWN = 256, | 65 KEYDOWN = 256, |
66 KEYUP = 512, | 66 KEYUP = 512, |
67 KEYPRESS = 1024, | 67 KEYPRESS = 1024, |
68 DRAGDROP = 2048, | 68 DRAGDROP = 2048, |
69 FOCUS = 4096, | 69 FOCUS = 4096, |
70 BLUR = 8192, | 70 BLUR = 8192, |
71 SELECT = 16384, | 71 SELECT = 16384, |
72 CHANGE = 32768 | 72 CHANGE = 32768 |
73 }; | 73 }; |
74 | 74 |
75 static PassRefPtr<Event> create() | 75 static PassRefPtrWillBeRawPtr<Event> create() |
76 { | 76 { |
77 return adoptRef(new Event); | 77 return adoptRefCountedWillBeRefCountedGarbageCollected(new Event); |
78 } | 78 } |
79 | 79 |
80 // A factory for a simple event. The event doesn't bubble, and isn't | 80 // A factory for a simple event. The event doesn't bubble, and isn't |
81 // cancelable. | 81 // cancelable. |
82 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht
ml#fire-a-simple-event | 82 // http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.ht
ml#fire-a-simple-event |
83 static PassRefPtr<Event> create(const AtomicString& type) | 83 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type) |
84 { | 84 { |
85 return adoptRef(new Event(type, false, false)); | 85 return adoptRefCountedWillBeRefCountedGarbageCollected(new Event(type, f
alse, false)); |
86 } | 86 } |
87 static PassRefPtr<Event> createCancelable(const AtomicString& type) | 87 static PassRefPtr<Event> createCancelable(const AtomicString& type) |
88 { | 88 { |
89 return adoptRef(new Event(type, false, true)); | 89 return adoptRef(new Event(type, false, true)); |
90 } | 90 } |
91 static PassRefPtr<Event> createBubble(const AtomicString& type) | 91 static PassRefPtr<Event> createBubble(const AtomicString& type) |
92 { | 92 { |
93 return adoptRef(new Event(type, true, false)); | 93 return adoptRef(new Event(type, true, false)); |
94 } | 94 } |
95 static PassRefPtr<Event> createCancelableBubble(const AtomicString& type) | 95 static PassRefPtr<Event> createCancelableBubble(const AtomicString& type) |
96 { | 96 { |
97 return adoptRef(new Event(type, true, true)); | 97 return adoptRef(new Event(type, true, true)); |
98 } | 98 } |
99 | 99 |
100 static PassRefPtr<Event> create(const AtomicString& type, const EventInit& i
nitializer) | 100 static PassRefPtrWillBeRawPtr<Event> create(const AtomicString& type, const
EventInit& initializer) |
101 { | 101 { |
102 return adoptRef(new Event(type, initializer)); | 102 return adoptRefCountedWillBeRefCountedGarbageCollected(new Event(type, i
nitializer)); |
103 } | 103 } |
104 | 104 |
105 virtual ~Event(); | 105 virtual ~Event(); |
106 | 106 |
107 void initEvent(const AtomicString& type, bool canBubble, bool cancelable); | 107 void initEvent(const AtomicString& type, bool canBubble, bool cancelable); |
108 | 108 |
109 const AtomicString& type() const { return m_type; } | 109 const AtomicString& type() const { return m_type; } |
110 void setType(const AtomicString& type) { m_type = type; } | 110 void setType(const AtomicString& type) { m_type = type; } |
111 | 111 |
112 EventTarget* target() const { return m_target.get(); } | 112 EventTarget* target() const { return m_target.get(); } |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 RefPtr<Event> m_underlyingEvent; | 207 RefPtr<Event> m_underlyingEvent; |
208 OwnPtr<EventPath> m_eventPath; | 208 OwnPtr<EventPath> m_eventPath; |
209 }; | 209 }; |
210 | 210 |
211 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 211 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
212 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) | 212 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) |
213 | 213 |
214 } // namespace WebCore | 214 } // namespace WebCore |
215 | 215 |
216 #endif // Event_h | 216 #endif // Event_h |
OLD | NEW |