| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ | 5 #ifndef SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ |
| 6 #define SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ | 6 #define SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ |
| 7 | 7 |
| 8 #include "sky/engine/core/events/Event.h" | 8 #include "sky/engine/core/events/Event.h" |
| 9 #include "sky/engine/core/events/EventDispatchMediator.h" | 9 #include "sky/engine/core/events/EventDispatchMediator.h" |
| 10 #include "sky/engine/core/frame/LocalDOMWindow.h" | 10 #include "sky/engine/core/frame/LocalDOMWindow.h" |
| 11 #include "sky/engine/public/platform/WebInputEvent.h" |
| 11 | 12 |
| 12 namespace blink { | 13 namespace blink { |
| 13 | 14 |
| 14 struct PointerEventInit : public EventInit { | 15 struct PointerEventInit : public EventInit { |
| 15 int pointer = 0; | 16 int pointer = 0; |
| 16 String kind; | 17 String kind; |
| 17 double x = 0; | 18 double x = 0; |
| 18 double y = 0; | 19 double y = 0; |
| 19 double dx = 0; | 20 double dx = 0; |
| 20 double dy = 0; | 21 double dy = 0; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 36 double tilt = 0; | 37 double tilt = 0; |
| 37 }; | 38 }; |
| 38 | 39 |
| 39 class PointerEvent : public Event { | 40 class PointerEvent : public Event { |
| 40 DEFINE_WRAPPERTYPEINFO(); | 41 DEFINE_WRAPPERTYPEINFO(); |
| 41 public: | 42 public: |
| 42 static PassRefPtr<PointerEvent> create() | 43 static PassRefPtr<PointerEvent> create() |
| 43 { | 44 { |
| 44 return adoptRef(new PointerEvent); | 45 return adoptRef(new PointerEvent); |
| 45 } | 46 } |
| 47 static PassRefPtr<PointerEvent> create(const WebPointerEvent& event) |
| 48 { |
| 49 return adoptRef(new PointerEvent(event)); |
| 50 } |
| 46 static PassRefPtr<PointerEvent> create(const AtomicString& type, const Point
erEventInit& initializer) | 51 static PassRefPtr<PointerEvent> create(const AtomicString& type, const Point
erEventInit& initializer) |
| 47 { | 52 { |
| 48 return adoptRef(new PointerEvent(type, initializer)); | 53 return adoptRef(new PointerEvent(type, initializer)); |
| 49 } | 54 } |
| 50 ~PointerEvent() override; | 55 ~PointerEvent() override; |
| 51 | 56 |
| 52 int pointer() const { return m_pointer; } | 57 int pointer() const { return m_pointer; } |
| 53 const String& kind() const { return m_kind; } | 58 const String& kind() const { return m_kind; } |
| 54 double x() const { return m_x; } | 59 double x() const { return m_x; } |
| 55 double y() const { return m_y; } | 60 double y() const { return m_y; } |
| 56 double dx() const { return m_dx; } | 61 double dx() const { return m_dx; } |
| 57 double dy() const { return m_dy; } | 62 double dy() const { return m_dy; } |
| 58 int buttons() const { return m_buttons; } | 63 int buttons() const { return m_buttons; } |
| 59 bool down() const { return m_down; } | 64 bool down() const { return m_down; } |
| 60 bool primary() const { return m_primary; } | 65 bool primary() const { return m_primary; } |
| 61 bool obscured() const { return m_obscured; } | 66 bool obscured() const { return m_obscured; } |
| 62 double pressure() const { return m_pressure; } | 67 double pressure() const { return m_pressure; } |
| 63 double pressureMin() const { return m_pressureMin; } | 68 double pressureMin() const { return m_pressureMin; } |
| 64 double pressureMax() const { return m_pressureMax; } | 69 double pressureMax() const { return m_pressureMax; } |
| 65 double distance() const { return m_distance; } | 70 double distance() const { return m_distance; } |
| 66 double distanceMin() const { return m_distanceMin; } | 71 double distanceMin() const { return m_distanceMin; } |
| 67 double distanceMax() const { return m_distanceMax; } | 72 double distanceMax() const { return m_distanceMax; } |
| 68 double radiusMajor() const { return m_radiusMajor; } | 73 double radiusMajor() const { return m_radiusMajor; } |
| 69 double radiusMinor() const { return m_radiusMinor; } | 74 double radiusMinor() const { return m_radiusMinor; } |
| 70 double radiusMin() const { return m_radiusMin; } | 75 double radiusMin() const { return m_radiusMin; } |
| 71 double radiusMax() const { return m_radiusMax; } | 76 double radiusMax() const { return m_radiusMax; } |
| 72 double orientation() const { return m_orientation; } | 77 double orientation() const { return m_orientation; } |
| 73 double tilt() const { return m_tilt; } | 78 double tilt() const { return m_tilt; } |
| 74 | 79 |
| 75 protected: | 80 private: |
| 76 PointerEvent(); | 81 PointerEvent(); |
| 82 explicit PointerEvent(const WebPointerEvent& event); |
| 77 PointerEvent(const AtomicString&, const PointerEventInit&); | 83 PointerEvent(const AtomicString&, const PointerEventInit&); |
| 78 | 84 |
| 79 private: | |
| 80 int m_pointer; | 85 int m_pointer; |
| 81 String m_kind; | 86 String m_kind; |
| 82 double m_x; | 87 double m_x; |
| 83 double m_y; | 88 double m_y; |
| 84 double m_dx; | 89 double m_dx; |
| 85 double m_dy; | 90 double m_dy; |
| 86 int m_buttons; | 91 int m_buttons; |
| 87 bool m_down; | 92 bool m_down; |
| 88 bool m_primary; | 93 bool m_primary; |
| 89 bool m_obscured; | 94 bool m_obscured; |
| 90 double m_pressure; | 95 double m_pressure; |
| 91 double m_pressureMin; | 96 double m_pressureMin; |
| 92 double m_pressureMax; | 97 double m_pressureMax; |
| 93 double m_distance; | 98 double m_distance; |
| 94 double m_distanceMin; | 99 double m_distanceMin; |
| 95 double m_distanceMax; | 100 double m_distanceMax; |
| 96 double m_radiusMajor; | 101 double m_radiusMajor; |
| 97 double m_radiusMinor; | 102 double m_radiusMinor; |
| 98 double m_radiusMin; | 103 double m_radiusMin; |
| 99 double m_radiusMax; | 104 double m_radiusMax; |
| 100 double m_orientation; | 105 double m_orientation; |
| 101 double m_tilt; | 106 double m_tilt; |
| 102 }; | 107 }; |
| 103 | 108 |
| 104 } // namespace blink | 109 } // namespace blink |
| 105 | 110 |
| 106 #endif // SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ | 111 #endif // SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_ |
| OLD | NEW |