| 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 25 matching lines...) Expand all Loading... |
| 36 enum GestureSource { | 36 enum GestureSource { |
| 37 GestureSourceUninitialized, | 37 GestureSourceUninitialized, |
| 38 GestureSourceTouchpad, | 38 GestureSourceTouchpad, |
| 39 GestureSourceTouchscreen | 39 GestureSourceTouchscreen |
| 40 }; | 40 }; |
| 41 | 41 |
| 42 class CORE_EXPORT GestureEvent final : public MouseRelatedEvent { | 42 class CORE_EXPORT GestureEvent final : public MouseRelatedEvent { |
| 43 public: | 43 public: |
| 44 ~GestureEvent() override { } | 44 ~GestureEvent() override { } |
| 45 | 45 |
| 46 static PassRefPtrWillBeRawPtr<GestureEvent> create(PassRefPtrWillBeRawPtr<Ab
stractView>, const PlatformGestureEvent&); | 46 static RawPtr<GestureEvent> create(RawPtr<AbstractView>, const PlatformGestu
reEvent&); |
| 47 | 47 |
| 48 bool isGestureEvent() const override; | 48 bool isGestureEvent() const override; |
| 49 | 49 |
| 50 const AtomicString& interfaceName() const override; | 50 const AtomicString& interfaceName() const override; |
| 51 | 51 |
| 52 float deltaX() const { return m_deltaX; } | 52 float deltaX() const { return m_deltaX; } |
| 53 float deltaY() const { return m_deltaY; } | 53 float deltaY() const { return m_deltaY; } |
| 54 float velocityX() const { return m_velocityX; } | 54 float velocityX() const { return m_velocityX; } |
| 55 float velocityY() const { return m_velocityY; } | 55 float velocityY() const { return m_velocityY; } |
| 56 bool inertial() const { return m_inertial; } | 56 bool inertial() const { return m_inertial; } |
| 57 | 57 |
| 58 GestureSource source() const { return m_source; } | 58 GestureSource source() const { return m_source; } |
| 59 int resendingPluginId() const { return m_resendingPluginId; } | 59 int resendingPluginId() const { return m_resendingPluginId; } |
| 60 | 60 |
| 61 PassRefPtrWillBeRawPtr<EventDispatchMediator> createMediator() override; | 61 RawPtr<EventDispatchMediator> createMediator() override; |
| 62 | 62 |
| 63 DECLARE_VIRTUAL_TRACE(); | 63 DECLARE_VIRTUAL_TRACE(); |
| 64 | 64 |
| 65 private: | 65 private: |
| 66 GestureEvent(); | 66 GestureEvent(); |
| 67 GestureEvent(const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView>,
int screenX, int screenY, int clientX, int clientY, PlatformEvent::Modifiers, f
loat deltaX, float deltaY, float velocityX, float velocityY, bool inertial, doub
le platformTimeStamp, int resendingPluginId, GestureSource); | 67 GestureEvent(const AtomicString& type, RawPtr<AbstractView>, int screenX, in
t screenY, int clientX, int clientY, PlatformEvent::Modifiers, float deltaX, flo
at deltaY, float velocityX, float velocityY, bool inertial, double platformTimeS
tamp, int resendingPluginId, GestureSource); |
| 68 | 68 |
| 69 float m_deltaX; | 69 float m_deltaX; |
| 70 float m_deltaY; | 70 float m_deltaY; |
| 71 float m_velocityX; | 71 float m_velocityX; |
| 72 float m_velocityY; | 72 float m_velocityY; |
| 73 bool m_inertial; | 73 bool m_inertial; |
| 74 | 74 |
| 75 GestureSource m_source; | 75 GestureSource m_source; |
| 76 int m_resendingPluginId; | 76 int m_resendingPluginId; |
| 77 }; | 77 }; |
| 78 | 78 |
| 79 class GestureEventDispatchMediator final : public EventDispatchMediator { | 79 class GestureEventDispatchMediator final : public EventDispatchMediator { |
| 80 public: | 80 public: |
| 81 static PassRefPtrWillBeRawPtr<GestureEventDispatchMediator> create(PassRefPt
rWillBeRawPtr<GestureEvent> gestureEvent) | 81 static RawPtr<GestureEventDispatchMediator> create(RawPtr<GestureEvent> gest
ureEvent) |
| 82 { | 82 { |
| 83 return adoptRefWillBeNoop(new GestureEventDispatchMediator(gestureEvent)
); | 83 return (new GestureEventDispatchMediator(gestureEvent)); |
| 84 } | 84 } |
| 85 | 85 |
| 86 private: | 86 private: |
| 87 explicit GestureEventDispatchMediator(PassRefPtrWillBeRawPtr<GestureEvent>); | 87 explicit GestureEventDispatchMediator(RawPtr<GestureEvent>); |
| 88 | 88 |
| 89 GestureEvent& event() const; | 89 GestureEvent& event() const; |
| 90 | 90 |
| 91 bool dispatchEvent(EventDispatcher&) const override; | 91 bool dispatchEvent(EventDispatcher&) const override; |
| 92 }; | 92 }; |
| 93 | 93 |
| 94 DEFINE_EVENT_TYPE_CASTS(GestureEvent); | 94 DEFINE_EVENT_TYPE_CASTS(GestureEvent); |
| 95 | 95 |
| 96 } // namespace blink | 96 } // namespace blink |
| 97 | 97 |
| 98 #endif // GestureEvent_h | 98 #endif // GestureEvent_h |
| OLD | NEW |