From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/dom/UIEvent.h | 47 ++++++++++++++++++-------------------------- 1 file changed, 19 insertions(+), 28 deletions(-) (limited to 'Source/WebCore/dom/UIEvent.h') diff --git a/Source/WebCore/dom/UIEvent.h b/Source/WebCore/dom/UIEvent.h index 077bee460..973d73ef3 100644 --- a/Source/WebCore/dom/UIEvent.h +++ b/Source/WebCore/dom/UIEvent.h @@ -21,50 +21,39 @@ * */ -#ifndef UIEvent_h -#define UIEvent_h +#pragma once #include "DOMWindow.h" #include "Event.h" +#include "UIEventInit.h" namespace WebCore { +// FIXME: Remove this when no one is depending on it anymore. typedef DOMWindow AbstractView; -struct UIEventInit : public EventInit { - UIEventInit(); - UIEventInit(bool bubbles, bool cancelable); - - RefPtr view; - int detail; -}; - class UIEvent : public Event { public: - static PassRefPtr create() + static Ref create(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow* view, int detail) { - return adoptRef(new UIEvent); + return adoptRef(*new UIEvent(type, canBubble, cancelable, view, detail)); } - static PassRefPtr create(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr view, int detail) + static Ref createForBindings() { - return adoptRef(new UIEvent(type, canBubble, cancelable, view, detail)); + return adoptRef(*new UIEvent); } - static PassRefPtr create(const AtomicString& type, const UIEventInit& initializer) + static Ref create(const AtomicString& type, const UIEventInit& initializer, IsTrusted isTrusted = IsTrusted::No) { - return adoptRef(new UIEvent(type, initializer)); + return adoptRef(*new UIEvent(type, initializer, isTrusted)); } virtual ~UIEvent(); - void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr, int detail); + WEBCORE_EXPORT void initUIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail); - AbstractView* view() const { return m_view.get(); } + DOMWindow* view() const { return m_view.get(); } int detail() const { return m_detail; } - virtual EventInterface eventInterface() const override; - virtual bool isUIEvent() const override; - - virtual int keyCode() const; - virtual int charCode() const; + EventInterface eventInterface() const override; virtual int layerX(); virtual int layerY(); @@ -76,15 +65,17 @@ public: protected: UIEvent(); - UIEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr, int detail); - UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, PassRefPtr, int detail); - UIEvent(const AtomicString&, const UIEventInit&); + UIEvent(const AtomicString& type, bool canBubble, bool cancelable, DOMWindow*, int detail); + UIEvent(const AtomicString& type, bool canBubble, bool cancelable, double timestamp, DOMWindow*, int detail); + UIEvent(const AtomicString&, const UIEventInit&, IsTrusted); private: - RefPtr m_view; + bool isUIEvent() const final; + + RefPtr m_view; int m_detail; }; } // namespace WebCore -#endif // UIEvent_h +SPECIALIZE_TYPE_TRAITS_EVENT(UIEvent) -- cgit v1.2.1