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

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

Issue 846783003: Add PointerEvent interface to Sky (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/Event.cpp ('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
(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_POINTEREVENT_H_
6 #define SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_
7
8 #include "sky/engine/core/events/Event.h"
9 #include "sky/engine/core/events/EventDispatchMediator.h"
10 #include "sky/engine/core/frame/LocalDOMWindow.h"
11
12 namespace blink {
13
14 struct PointerEventInit : public EventInit {
15 int pointer = 0;
16 String kind;
17 double x = 0;
18 double y = 0;
19 double dx = 0;
20 double dy = 0;
21 int buttons = 0;
22 bool down = false;
23 bool primary = false;
24 bool obscured = false;
25 double pressure = 0;
26 double pressureMin = 0;
27 double pressureMax = 0;
28 double distance = 0;
29 double distanceMin = 0;
30 double distanceMax = 0;
31 double radiusMajor = 0;
32 double radiusMinor = 0;
33 double radiusMin = 0;
34 double radiusMax = 0;
35 double orientation = 0;
36 double tilt = 0;
37 };
38
39 class PointerEvent : public Event {
40 DEFINE_WRAPPERTYPEINFO();
41 public:
42 static PassRefPtr<PointerEvent> create()
43 {
44 return adoptRef(new PointerEvent);
45 }
46 static PassRefPtr<PointerEvent> create(const AtomicString& type, const Point erEventInit& initializer)
47 {
48 return adoptRef(new PointerEvent(type, initializer));
49 }
50 ~PointerEvent() override;
51
52 int pointer() const { return m_pointer; }
53 const String& kind() const { return m_kind; }
54 double x() const { return m_x; }
55 double y() const { return m_y; }
56 double dx() const { return m_dx; }
57 double dy() const { return m_dy; }
58 int buttons() const { return m_buttons; }
59 bool down() const { return m_down; }
60 bool primary() const { return m_primary; }
61 bool obscured() const { return m_obscured; }
62 double pressure() const { return m_pressure; }
63 double pressureMin() const { return m_pressureMin; }
64 double pressureMax() const { return m_pressureMax; }
65 double distance() const { return m_distance; }
66 double distanceMin() const { return m_distanceMin; }
67 double distanceMax() const { return m_distanceMax; }
68 double radiusMajor() const { return m_radiusMajor; }
69 double radiusMinor() const { return m_radiusMinor; }
70 double radiusMin() const { return m_radiusMin; }
71 double radiusMax() const { return m_radiusMax; }
72 double orientation() const { return m_orientation; }
73 double tilt() const { return m_tilt; }
74
75 protected:
76 PointerEvent();
77 PointerEvent(const AtomicString&, const PointerEventInit&);
78
79 private:
80 int m_pointer;
81 String m_kind;
82 double m_x;
83 double m_y;
84 double m_dx;
85 double m_dy;
86 int m_buttons;
87 bool m_down;
88 bool m_primary;
89 bool m_obscured;
90 double m_pressure;
91 double m_pressureMin;
92 double m_pressureMax;
93 double m_distance;
94 double m_distanceMin;
95 double m_distanceMax;
96 double m_radiusMajor;
97 double m_radiusMinor;
98 double m_radiusMin;
99 double m_radiusMax;
100 double m_orientation;
101 double m_tilt;
102 };
103
104 } // namespace blink
105
106 #endif // SKY_ENGINE_CORE_EVENTS_POINTEREVENT_H_
OLDNEW
« no previous file with comments | « sky/engine/core/events/Event.cpp ('k') | sky/engine/core/events/PointerEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698