Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: sky/engine/core/events/PointerEvent.h

Issue 845313011: Add blink::WebPointerEvent (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sky/engine/core/events/EventTypeNames.in ('k') | sky/engine/core/events/PointerEvent.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « sky/engine/core/events/EventTypeNames.in ('k') | sky/engine/core/events/PointerEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698