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 PointerEvent_h | 5 #ifndef PointerEvent_h |
6 #define PointerEvent_h | 6 #define PointerEvent_h |
7 | 7 |
8 #include "core/events/MouseEvent.h" | 8 #include "core/events/MouseEvent.h" |
9 #include "core/events/PointerEventInit.h" | 9 #include "core/events/PointerEventInit.h" |
10 #include "platform/PlatformTouchPoint.h" | 10 #include "platform/PlatformTouchPoint.h" |
11 | 11 |
12 namespace blink { | 12 namespace blink { |
13 | 13 |
14 class PointerEvent final : public MouseEvent { | 14 class PointerEvent final : public MouseEvent { |
15 DEFINE_WRAPPERTYPEINFO(); | 15 DEFINE_WRAPPERTYPEINFO(); |
16 | 16 |
17 public: | 17 public: |
18 static PassRefPtrWillBeRawPtr<PointerEvent> create() | 18 static PassRefPtrWillBeRawPtr<PointerEvent> create() |
19 { | 19 { |
20 return adoptRefWillBeNoop(new PointerEvent); | 20 return adoptRefWillBeNoop(new PointerEvent); |
21 } | 21 } |
22 | 22 |
23 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type, const PointerEventInit& initializer) | 23 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type, const PointerEventInit& initializer) |
24 { | 24 { |
25 return adoptRefWillBeNoop(new PointerEvent(type, initializer)); | 25 return adoptRefWillBeNoop(new PointerEvent(type, initializer)); |
26 } | 26 } |
27 | 27 |
28 long pointerId() const { return m_pointerId; } | 28 int pointerId() const { return m_pointerId; } |
Ian Vollick
2016/02/12 15:01:17
Did we change this so that it could be handled by
Navid Zolghadr
2016/02/12 16:30:47
No. The spec is indicating the range for this fiel
| |
29 double width() const { return m_width; } | 29 double width() const { return m_width; } |
30 double height() const { return m_height; } | 30 double height() const { return m_height; } |
31 float pressure() const { return m_pressure; } | 31 float pressure() const { return m_pressure; } |
32 long tiltX() const { return m_tiltX; } | 32 long tiltX() const { return m_tiltX; } |
33 long tiltY() const { return m_tiltY; } | 33 long tiltY() const { return m_tiltY; } |
34 const String& pointerType() const { return m_pointerType; } | 34 const String& pointerType() const { return m_pointerType; } |
35 bool isPrimary() const { return m_isPrimary; } | 35 bool isPrimary() const { return m_isPrimary; } |
36 | 36 |
37 short button() const override { return rawButton(); } | 37 short button() const override { return rawButton(); } |
38 bool isMouseEvent() const override; | 38 bool isMouseEvent() const override; |
39 bool isPointerEvent() const override; | 39 bool isPointerEvent() const override; |
40 | 40 |
41 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; | 41 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; |
42 | 42 |
43 DECLARE_VIRTUAL_TRACE(); | 43 DECLARE_VIRTUAL_TRACE(); |
44 | 44 |
45 private: | 45 private: |
46 PointerEvent(); | 46 PointerEvent(); |
47 PointerEvent(const AtomicString&, const PointerEventInit&); | 47 PointerEvent(const AtomicString&, const PointerEventInit&); |
48 | 48 |
49 long m_pointerId; | 49 int m_pointerId; |
50 double m_width; | 50 double m_width; |
51 double m_height; | 51 double m_height; |
52 float m_pressure; | 52 float m_pressure; |
53 long m_tiltX; | 53 long m_tiltX; |
54 long m_tiltY; | 54 long m_tiltY; |
55 String m_pointerType; | 55 String m_pointerType; |
56 bool m_isPrimary; | 56 bool m_isPrimary; |
57 }; | 57 }; |
58 | 58 |
59 | 59 |
60 class PointerEventDispatchMediator final : public EventDispatchMediator { | 60 class PointerEventDispatchMediator final : public EventDispatchMediator { |
61 public: | 61 public: |
62 static PassRefPtrWillBeRawPtr<PointerEventDispatchMediator> create(PassRefPt rWillBeRawPtr<PointerEvent>); | 62 static PassRefPtrWillBeRawPtr<PointerEventDispatchMediator> create(PassRefPt rWillBeRawPtr<PointerEvent>); |
63 | 63 |
64 private: | 64 private: |
65 explicit PointerEventDispatchMediator(PassRefPtrWillBeRawPtr<PointerEvent>); | 65 explicit PointerEventDispatchMediator(PassRefPtrWillBeRawPtr<PointerEvent>); |
66 PointerEvent& event() const; | 66 PointerEvent& event() const; |
67 bool dispatchEvent(EventDispatcher&) const override; | 67 bool dispatchEvent(EventDispatcher&) const override; |
68 }; | 68 }; |
69 | 69 |
70 DEFINE_EVENT_TYPE_CASTS(PointerEvent); | 70 DEFINE_EVENT_TYPE_CASTS(PointerEvent); |
71 | 71 |
72 } // namespace blink | 72 } // namespace blink |
73 | 73 |
74 #endif // PointerEvent_h | 74 #endif // PointerEvent_h |
OLD | NEW |