OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SKY_ENGINE_CORE_EVENTS_WHEELEVENT_H_ |
| 6 #define SKY_ENGINE_CORE_EVENTS_WHEELEVENT_H_ |
| 7 |
| 8 #include "sky/engine/core/events/Event.h" |
| 9 #include "sky/engine/public/platform/WebInputEvent.h" |
| 10 |
| 11 namespace blink { |
| 12 |
| 13 struct WheelEventInit : public EventInit { |
| 14 double x = 0; |
| 15 double y = 0; |
| 16 double offsetX = 0; |
| 17 double offsetY = 0; |
| 18 }; |
| 19 |
| 20 class WheelEvent : public Event { |
| 21 DEFINE_WRAPPERTYPEINFO(); |
| 22 public: |
| 23 static PassRefPtr<WheelEvent> create() |
| 24 { |
| 25 return adoptRef(new WheelEvent); |
| 26 } |
| 27 static PassRefPtr<WheelEvent> create(const WebWheelEvent& event) |
| 28 { |
| 29 return adoptRef(new WheelEvent(event)); |
| 30 } |
| 31 static PassRefPtr<WheelEvent> create(const AtomicString& type, const WheelEv
entInit& initializer) |
| 32 { |
| 33 return adoptRef(new WheelEvent(type, initializer)); |
| 34 } |
| 35 |
| 36 ~WheelEvent() override; |
| 37 const AtomicString& interfaceName() const override; |
| 38 |
| 39 double x() const { return m_x; } |
| 40 double y() const { return m_y; } |
| 41 double offsetX() const { return m_offsetX; } |
| 42 double offsetY() const { return m_offsetY; } |
| 43 |
| 44 private: |
| 45 WheelEvent(); |
| 46 explicit WheelEvent(const WebWheelEvent& event); |
| 47 WheelEvent(const AtomicString&, const WheelEventInit&); |
| 48 |
| 49 double m_x; |
| 50 double m_y; |
| 51 double m_offsetX; |
| 52 double m_offsetY; |
| 53 }; |
| 54 |
| 55 } // namespace blink |
| 56 |
| 57 #endif // SKY_ENGINE_CORE_EVENTS_WHEELEVENT_H_ |
OLD | NEW |