2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de)
4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com)
5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Library General Public License for more details.
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
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
27 #include "DOMWindow.h"
28 #include "EventDispatcher.h"
37 UIEvent::UIEvent(const AtomicString& eventType, bool canBubbleArg, bool cancelableArg, PassRefPtr<AbstractView> viewArg, int detailArg)
38 : Event(eventType, canBubbleArg, cancelableArg)
48 void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg, PassRefPtr<AbstractView> viewArg, int detailArg)
53 initEvent(typeArg, canBubbleArg, cancelableArg);
59 bool UIEvent::isUIEvent() const
64 const AtomicString& UIEvent::interfaceName() const
66 return eventNames().interfaceForUIEvent;
69 int UIEvent::keyCode() const
74 int UIEvent::charCode() const
81 warnDeprecatedLayerXYUsage();
87 warnDeprecatedLayerXYUsage();
91 int UIEvent::pageX() const
96 int UIEvent::pageY() const
101 int UIEvent::which() const
106 void UIEvent::warnDeprecatedLayerXYUsage()
108 DEFINE_STATIC_LOCAL(String, consoleMessage , ("event.layerX and event.layerY are broken and deprecated in WebKit. They will be removed from the engine in the near future."));
110 m_view->console()->addMessage(JSMessageSource, LogMessageType, WarningMessageLevel, consoleMessage, 1, String());
113 PassRefPtr<FocusInEventDispatchMediator> FocusInEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
115 return adoptRef(new FocusInEventDispatchMediator(event, oldFocusedNode));
118 FocusInEventDispatchMediator::FocusInEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> oldFocusedNode)
119 : EventDispatchMediator(event)
120 , m_oldFocusedNode(oldFocusedNode)
124 bool FocusInEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
126 dispatcher->adjustRelatedTarget(event(), m_oldFocusedNode);
127 return EventDispatchMediator::dispatchEvent(dispatcher);
130 PassRefPtr<FocusOutEventDispatchMediator> FocusOutEventDispatchMediator::create(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
132 return adoptRef(new FocusOutEventDispatchMediator(event, newFocusedNode));
135 FocusOutEventDispatchMediator::FocusOutEventDispatchMediator(PassRefPtr<Event> event, PassRefPtr<Node> newFocusedNode)
136 : EventDispatchMediator(event)
137 , m_newFocusedNode(newFocusedNode)
141 bool FocusOutEventDispatchMediator::dispatchEvent(EventDispatcher* dispatcher) const
143 dispatcher->adjustRelatedTarget(event(), m_newFocusedNode);
144 return EventDispatchMediator::dispatchEvent(dispatcher);
147 } // namespace WebCore