| 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. |
| 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 | 23 |
| 24 #ifndef SKY_ENGINE_CORE_EVENTS_EVENT_H_ | 24 #ifndef SKY_ENGINE_CORE_EVENTS_EVENT_H_ |
| 25 #define SKY_ENGINE_CORE_EVENTS_EVENT_H_ | 25 #define SKY_ENGINE_CORE_EVENTS_EVENT_H_ |
| 26 | 26 |
| 27 #include "sky/engine/bindings/core/v8/ScriptWrappable.h" | 27 #include "sky/engine/bindings/core/v8/ScriptWrappable.h" |
| 28 #include "sky/engine/core/dom/DOMTimeStamp.h" | |
| 29 #include "sky/engine/core/events/EventPath.h" | 28 #include "sky/engine/core/events/EventPath.h" |
| 30 #include "sky/engine/platform/heap/Handle.h" | 29 #include "sky/engine/platform/heap/Handle.h" |
| 31 #include "sky/engine/wtf/RefCounted.h" | 30 #include "sky/engine/wtf/RefCounted.h" |
| 32 #include "sky/engine/wtf/text/AtomicString.h" | 31 #include "sky/engine/wtf/text/AtomicString.h" |
| 33 | 32 |
| 34 namespace blink { | 33 namespace blink { |
| 35 | 34 |
| 36 class EventTarget; | 35 class EventTarget; |
| 37 class EventDispatcher; | 36 class EventDispatcher; |
| 38 class ExecutionContext; | 37 class ExecutionContext; |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 void setTarget(PassRefPtr<EventTarget>); | 95 void setTarget(PassRefPtr<EventTarget>); |
| 97 | 96 |
| 98 EventTarget* currentTarget() const; | 97 EventTarget* currentTarget() const; |
| 99 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren
tTarget; } | 98 void setCurrentTarget(EventTarget* currentTarget) { m_currentTarget = curren
tTarget; } |
| 100 | 99 |
| 101 unsigned short eventPhase() const { return m_eventPhase; } | 100 unsigned short eventPhase() const { return m_eventPhase; } |
| 102 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } | 101 void setEventPhase(unsigned short eventPhase) { m_eventPhase = eventPhase; } |
| 103 | 102 |
| 104 bool bubbles() const { return m_canBubble; } | 103 bool bubbles() const { return m_canBubble; } |
| 105 bool cancelable() const { return m_cancelable; } | 104 bool cancelable() const { return m_cancelable; } |
| 106 DOMTimeStamp timeStamp() const { return m_createTime; } | 105 double timeStamp() const { return m_timeStamp; } |
| 107 | 106 |
| 108 void stopPropagation() { m_propagationStopped = true; } | 107 void stopPropagation() { m_propagationStopped = true; } |
| 109 void stopImmediatePropagation() { m_immediatePropagationStopped = true; } | 108 void stopImmediatePropagation() { m_immediatePropagationStopped = true; } |
| 110 | 109 |
| 111 // IE Extensions | 110 // IE Extensions |
| 112 EventTarget* srcElement() const { return target(); } // MSIE extension - "th
e object that fired the event" | 111 EventTarget* srcElement() const { return target(); } // MSIE extension - "th
e object that fired the event" |
| 113 | 112 |
| 114 bool legacyReturnValue(ExecutionContext*) const; | 113 bool legacyReturnValue(ExecutionContext*) const; |
| 115 void setLegacyReturnValue(ExecutionContext*, bool returnValue); | 114 void setLegacyReturnValue(ExecutionContext*, bool returnValue); |
| 116 | 115 |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 bool isBeingDispatched() const { return eventPhase(); } | 156 bool isBeingDispatched() const { return eventPhase(); } |
| 158 | 157 |
| 159 protected: | 158 protected: |
| 160 Event(); | 159 Event(); |
| 161 Event(const AtomicString& type, bool canBubble, bool cancelable); | 160 Event(const AtomicString& type, bool canBubble, bool cancelable); |
| 162 Event(const AtomicString& type, const EventInit&); | 161 Event(const AtomicString& type, const EventInit&); |
| 163 | 162 |
| 164 virtual void receivedTarget(); | 163 virtual void receivedTarget(); |
| 165 bool dispatched() const { return m_target; } | 164 bool dispatched() const { return m_target; } |
| 166 | 165 |
| 166 double m_timeStamp; |
| 167 |
| 167 private: | 168 private: |
| 168 AtomicString m_type; | 169 AtomicString m_type; |
| 169 bool m_canBubble; | 170 bool m_canBubble; |
| 170 bool m_cancelable; | 171 bool m_cancelable; |
| 171 | 172 |
| 172 bool m_propagationStopped; | 173 bool m_propagationStopped; |
| 173 bool m_immediatePropagationStopped; | 174 bool m_immediatePropagationStopped; |
| 174 bool m_defaultPrevented; | 175 bool m_defaultPrevented; |
| 175 bool m_defaultHandled; | 176 bool m_defaultHandled; |
| 176 bool m_cancelBubble; | 177 bool m_cancelBubble; |
| 177 | 178 |
| 178 unsigned short m_eventPhase; | 179 unsigned short m_eventPhase; |
| 179 RefPtr<EventTarget> m_currentTarget; | 180 RefPtr<EventTarget> m_currentTarget; |
| 180 RefPtr<EventTarget> m_target; | 181 RefPtr<EventTarget> m_target; |
| 181 DOMTimeStamp m_createTime; | |
| 182 RefPtr<Event> m_underlyingEvent; | 182 RefPtr<Event> m_underlyingEvent; |
| 183 OwnPtr<EventPath> m_eventPath; | 183 OwnPtr<EventPath> m_eventPath; |
| 184 }; | 184 }; |
| 185 | 185 |
| 186 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ | 186 #define DEFINE_EVENT_TYPE_CASTS(typeName) \ |
| 187 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) | 187 DEFINE_TYPE_CASTS(typeName, Event, event, event->is##typeName(), event.is##t
ypeName()) |
| 188 | 188 |
| 189 } // namespace blink | 189 } // namespace blink |
| 190 | 190 |
| 191 #endif // SKY_ENGINE_CORE_EVENTS_EVENT_H_ | 191 #endif // SKY_ENGINE_CORE_EVENTS_EVENT_H_ |
| OLD | NEW |