OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * * Redistributions of source code must retain the above copyright | 7 * * Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * * Redistributions in binary form must reproduce the above copyright | 9 * * Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 17 matching lines...) Expand all Loading... |
28 | 28 |
29 #include "core/CoreExport.h" | 29 #include "core/CoreExport.h" |
30 #include "core/events/EventDispatcher.h" | 30 #include "core/events/EventDispatcher.h" |
31 #include "core/events/MouseRelatedEvent.h" | 31 #include "core/events/MouseRelatedEvent.h" |
32 #include "platform/PlatformGestureEvent.h" | 32 #include "platform/PlatformGestureEvent.h" |
33 | 33 |
34 namespace blink { | 34 namespace blink { |
35 | 35 |
36 class CORE_EXPORT GestureEvent final : public MouseRelatedEvent { | 36 class CORE_EXPORT GestureEvent final : public MouseRelatedEvent { |
37 public: | 37 public: |
38 virtual ~GestureEvent() { } | 38 ~GestureEvent() override { } |
39 | 39 |
40 static PassRefPtrWillBeRawPtr<GestureEvent> create(PassRefPtrWillBeRawPtr<Ab
stractView>, const PlatformGestureEvent&); | 40 static PassRefPtrWillBeRawPtr<GestureEvent> create(PassRefPtrWillBeRawPtr<Ab
stractView>, const PlatformGestureEvent&); |
41 | 41 |
42 virtual bool isGestureEvent() const override; | 42 bool isGestureEvent() const override; |
43 | 43 |
44 virtual const AtomicString& interfaceName() const override; | 44 const AtomicString& interfaceName() const override; |
45 | 45 |
46 float deltaX() const { return m_deltaX; } | 46 float deltaX() const { return m_deltaX; } |
47 float deltaY() const { return m_deltaY; } | 47 float deltaY() const { return m_deltaY; } |
48 | 48 |
49 DECLARE_VIRTUAL_TRACE(); | 49 DECLARE_VIRTUAL_TRACE(); |
50 | 50 |
51 private: | 51 private: |
52 GestureEvent(); | 52 GestureEvent(); |
53 GestureEvent(const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView>,
int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey,
bool shiftKey, bool metaKey, float deltaX, float deltaY, double uiTimeStamp); | 53 GestureEvent(const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView>,
int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey,
bool shiftKey, bool metaKey, float deltaX, float deltaY, double uiTimeStamp); |
54 | 54 |
55 float m_deltaX; | 55 float m_deltaX; |
56 float m_deltaY; | 56 float m_deltaY; |
57 }; | 57 }; |
58 | 58 |
59 class GestureEventDispatchMediator final : public EventDispatchMediator { | 59 class GestureEventDispatchMediator final : public EventDispatchMediator { |
60 public: | 60 public: |
61 static PassRefPtrWillBeRawPtr<GestureEventDispatchMediator> create(PassRefPt
rWillBeRawPtr<GestureEvent> gestureEvent) | 61 static PassRefPtrWillBeRawPtr<GestureEventDispatchMediator> create(PassRefPt
rWillBeRawPtr<GestureEvent> gestureEvent) |
62 { | 62 { |
63 return adoptRefWillBeNoop(new GestureEventDispatchMediator(gestureEvent)
); | 63 return adoptRefWillBeNoop(new GestureEventDispatchMediator(gestureEvent)
); |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 explicit GestureEventDispatchMediator(PassRefPtrWillBeRawPtr<GestureEvent>); | 67 explicit GestureEventDispatchMediator(PassRefPtrWillBeRawPtr<GestureEvent>); |
68 | 68 |
69 GestureEvent& event() const; | 69 GestureEvent& event() const; |
70 | 70 |
71 virtual bool dispatchEvent(EventDispatcher&) const override; | 71 bool dispatchEvent(EventDispatcher&) const override; |
72 }; | 72 }; |
73 | 73 |
74 DEFINE_EVENT_TYPE_CASTS(GestureEvent); | 74 DEFINE_EVENT_TYPE_CASTS(GestureEvent); |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif // GestureEvent_h | 78 #endif // GestureEvent_h |
OLD | NEW |