1/*
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.
6 *
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.
11 *
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.
16 *
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.
21 */
22
23#include "config.h"
24#include "UIEvent.h"
25
26#include "Node.h"
27
28namespace WebCore {
29
30UIEvent::UIEvent()
31 : m_detail(0)
32{
33}
34
35UIEvent::UIEvent(const AtomString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, RefPtr<WindowProxy>&& viewArg, int detailArg)
36 : Event(eventType, canBubble, isCancelable, isComposed)
37 , m_view(WTFMove(viewArg))
38 , m_detail(detailArg)
39{
40}
41
42UIEvent::UIEvent(const AtomString& eventType, CanBubble canBubble, IsCancelable isCancelable, IsComposed isComposed, MonotonicTime timestamp, RefPtr<WindowProxy>&& viewArg, int detailArg, IsTrusted isTrusted)
43 : Event(eventType, canBubble, isCancelable, isComposed, timestamp, isTrusted)
44 , m_view(WTFMove(viewArg))
45 , m_detail(detailArg)
46{
47}
48
49UIEvent::UIEvent(const AtomString& eventType, const UIEventInit& initializer)
50 : Event(eventType, initializer, IsTrusted::No)
51 , m_view(initializer.view.get())
52 , m_detail(initializer.detail)
53{
54}
55
56UIEvent::~UIEvent() = default;
57
58void UIEvent::initUIEvent(const AtomString& typeArg, bool canBubbleArg, bool cancelableArg, RefPtr<WindowProxy>&& viewArg, int detailArg)
59{
60 if (isBeingDispatched())
61 return;
62
63 initEvent(typeArg, canBubbleArg, cancelableArg);
64
65 m_view = viewArg;
66 m_detail = detailArg;
67}
68
69bool UIEvent::isUIEvent() const
70{
71 return true;
72}
73
74EventInterface UIEvent::eventInterface() const
75{
76 return UIEventInterfaceType;
77}
78
79int UIEvent::layerX()
80{
81 return 0;
82}
83
84int UIEvent::layerY()
85{
86 return 0;
87}
88
89int UIEvent::pageX() const
90{
91 return 0;
92}
93
94int UIEvent::pageY() const
95{
96 return 0;
97}
98
99int UIEvent::which() const
100{
101 return 0;
102}
103
104} // namespace WebCore
105