| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
| 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 4 * (C) 2001 Dirk Mueller (mueller@kde.org) | 4 * (C) 2001 Dirk Mueller (mueller@kde.org) |
| 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) | 6 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) |
| 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 7 * (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 8 * | 8 * |
| 9 * Redistribution and use in source and binary forms, with or without | 9 * Redistribution and use in source and binary forms, with or without |
| 10 * modification, are permitted provided that the following conditions | 10 * modification, are permitted provided that the following conditions |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 // - Inherit from EventTargetWithInlineData (only in rare cases should you use | 80 // - Inherit from EventTargetWithInlineData (only in rare cases should you use |
| 81 // EventTarget directly). | 81 // EventTarget directly). |
| 82 // - Figure out if you now need to inherit from ActiveDOMObject as well. | 82 // - Figure out if you now need to inherit from ActiveDOMObject as well. |
| 83 // - In your class declaration, you will typically use | 83 // - In your class declaration, you will typically use |
| 84 // REFCOUNTED_EVENT_TARGET(YourClassName) and | 84 // REFCOUNTED_EVENT_TARGET(YourClassName) and |
| 85 // WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(YourClassName). Make sure to include | 85 // WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(YourClassName). Make sure to include |
| 86 // this header file in your .h file, or you will get very strange compiler | 86 // this header file in your .h file, or you will get very strange compiler |
| 87 // errors. | 87 // errors. |
| 88 // - If you added an onfoo attribute, use DEFINE_ATTRIBUTE_EVENT_LISTENER(foo) | 88 // - If you added an onfoo attribute, use DEFINE_ATTRIBUTE_EVENT_LISTENER(foo) |
| 89 // in your class declaration. | 89 // in your class declaration. |
| 90 // - Call ScriptWrappable::init(this) in your constructor, unless you are alread
y | |
| 91 // doing so. | |
| 92 // - Override EventTarget::interfaceName() and executionContext(). The former | 90 // - Override EventTarget::interfaceName() and executionContext(). The former |
| 93 // will typically return EventTargetNames::YourClassName. The latter will | 91 // will typically return EventTargetNames::YourClassName. The latter will |
| 94 // return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) | 92 // return ActiveDOMObject::executionContext (if you are an ActiveDOMObject) |
| 95 // or the document you're in. | 93 // or the document you're in. |
| 96 // - Your trace() method will need to call EventTargetWithInlineData::trace. | 94 // - Your trace() method will need to call EventTargetWithInlineData::trace. |
| 97 // | 95 // |
| 98 // Optionally, add a FooEvent.idl class, but that's outside the scope of this | 96 // Optionally, add a FooEvent.idl class, but that's outside the scope of this |
| 99 // comment (and much more straightforward). | 97 // comment (and much more straightforward). |
| 100 class EventTarget : public WillBeGarbageCollectedMixin, public ScriptWrappable { | 98 class EventTarget : public WillBeGarbageCollectedMixin, public ScriptWrappable { |
| 101 DEFINE_WRAPPERTYPEINFO(); | 99 DEFINE_WRAPPERTYPEINFO(); |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro | 263 typedef int thisIsHereToForceASemiColonAfterThisEventTargetMacro |
| 266 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) | 264 #define DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(baseClass) DEFINE_EVENT_
TARGET_REFCOUNTING(baseClass) |
| 267 #endif | 265 #endif |
| 268 | 266 |
| 269 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. | 267 // Use this macro if your EventTarget subclass is also a subclass of WTF::RefCou
nted. |
| 270 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. | 268 // A ref-counted class that uses a different method of refcounting should use DE
FINE_EVENT_TARGET_REFCOUNTING directly. |
| 271 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. | 269 // Both of these macros are meant to be placed just before the "public:" section
of the class declaration. |
| 272 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_
BE_REMOVED(RefCounted<className>) | 270 #define REFCOUNTED_EVENT_TARGET(className) DEFINE_EVENT_TARGET_REFCOUNTING_WILL_
BE_REMOVED(RefCounted<className>) |
| 273 | 271 |
| 274 #endif // EventTarget_h | 272 #endif // EventTarget_h |
| OLD | NEW |