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

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

Issue 1019023003: Improve Material ink effects (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 9 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 | « no previous file | sky/engine/core/events/GestureEvent.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_GESTUREEVENT_H_ 5 #ifndef SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
6 #define SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_ 6 #define SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
7 7
8 #include "sky/engine/core/events/Event.h" 8 #include "sky/engine/core/events/Event.h"
9 #include "sky/engine/public/platform/WebInputEvent.h" 9 #include "sky/engine/public/platform/WebInputEvent.h"
10 10
11 namespace blink { 11 namespace blink {
12 12
13 struct GestureEventInit : public EventInit { 13 struct GestureEventInit : public EventInit {
14 int primaryPointer = 0;
14 double x = 0; 15 double x = 0;
15 double y = 0; 16 double y = 0;
16 double dx = 0; 17 double dx = 0;
17 double dy = 0; 18 double dy = 0;
18 double velocityX = 0; 19 double velocityX = 0;
19 double velocityY = 0; 20 double velocityY = 0;
20 }; 21 };
21 22
22 class GestureEvent : public Event { 23 class GestureEvent : public Event {
23 DEFINE_WRAPPERTYPEINFO(); 24 DEFINE_WRAPPERTYPEINFO();
24 public: 25 public:
25 static PassRefPtr<GestureEvent> create() 26 static PassRefPtr<GestureEvent> create()
26 { 27 {
27 return adoptRef(new GestureEvent); 28 return adoptRef(new GestureEvent);
28 } 29 }
29 static PassRefPtr<GestureEvent> create(const WebGestureEvent& event) 30 static PassRefPtr<GestureEvent> create(const WebGestureEvent& event)
30 { 31 {
31 return adoptRef(new GestureEvent(event)); 32 return adoptRef(new GestureEvent(event));
32 } 33 }
33 static PassRefPtr<GestureEvent> create(const AtomicString& type, const Gestu reEventInit& initializer) 34 static PassRefPtr<GestureEvent> create(const AtomicString& type, const Gestu reEventInit& initializer)
34 { 35 {
35 return adoptRef(new GestureEvent(type, initializer)); 36 return adoptRef(new GestureEvent(type, initializer));
36 } 37 }
37 38
38 ~GestureEvent() override; 39 ~GestureEvent() override;
39 const AtomicString& interfaceName() const override; 40 const AtomicString& interfaceName() const override;
40 41
42 int primaryPointer() const { return m_primaryPointer; }
eseidel 2015/03/19 18:00:36 dart 'get' has spoiled me.
41 float x() const { return m_x; } 43 float x() const { return m_x; }
42 float y() const { return m_y; } 44 float y() const { return m_y; }
43 float dx() const { return m_dx; } 45 float dx() const { return m_dx; }
44 float dy() const { return m_dy; } 46 float dy() const { return m_dy; }
45 float velocityX() const { return m_velocityX; } 47 float velocityX() const { return m_velocityX; }
46 float velocityY() const { return m_velocityY; } 48 float velocityY() const { return m_velocityY; }
47 49
48 private: 50 private:
49 GestureEvent(); 51 GestureEvent();
50 explicit GestureEvent(const WebGestureEvent&); 52 explicit GestureEvent(const WebGestureEvent&);
51 GestureEvent(const AtomicString& type, const GestureEventInit&); 53 GestureEvent(const AtomicString& type, const GestureEventInit&);
52 54
55 int m_primaryPointer;
53 float m_x; 56 float m_x;
54 float m_y; 57 float m_y;
55 float m_dx; 58 float m_dx;
56 float m_dy; 59 float m_dy;
57 float m_velocityX; 60 float m_velocityX;
58 float m_velocityY; 61 float m_velocityY;
59 }; 62 };
60 63
61 } // namespace blink 64 } // namespace blink
62 65
63 #endif // SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_ 66 #endif // SKY_ENGINE_CORE_EVENTS_GESTUREEVENT_H_
OLDNEW
« no previous file with comments | « no previous file | sky/engine/core/events/GestureEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698