| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 #ifndef GestureEvent_h | 26 #ifndef GestureEvent_h |
| 27 #define GestureEvent_h | 27 #define GestureEvent_h |
| 28 | 28 |
| 29 #include "core/events/EventDispatcher.h" | 29 #include "core/events/EventDispatcher.h" |
| 30 #include "core/events/MouseRelatedEvent.h" | 30 #include "core/events/MouseRelatedEvent.h" |
| 31 #include "platform/PlatformGestureEvent.h" | 31 #include "platform/PlatformGestureEvent.h" |
| 32 | 32 |
| 33 namespace WebCore { | 33 namespace WebCore { |
| 34 | 34 |
| 35 class GestureEvent : public MouseRelatedEvent { | 35 class GestureEvent FINAL : public MouseRelatedEvent { |
| 36 public: | 36 public: |
| 37 virtual ~GestureEvent() { } | 37 virtual ~GestureEvent() { } |
| 38 | 38 |
| 39 static PassRefPtr<GestureEvent> create(); | 39 static PassRefPtr<GestureEvent> create(); |
| 40 static PassRefPtr<GestureEvent> create(PassRefPtr<AbstractView>, const Platf
ormGestureEvent&); | 40 static PassRefPtr<GestureEvent> create(PassRefPtr<AbstractView>, const Platf
ormGestureEvent&); |
| 41 | 41 |
| 42 void initGestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, in
t screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, boo
l shiftKey, bool metaKey, float deltaX, float deltaY); | 42 void initGestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, in
t screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, boo
l shiftKey, bool metaKey, float deltaX, float deltaY); |
| 43 | 43 |
| 44 virtual bool isGestureEvent() const OVERRIDE; | 44 virtual bool isGestureEvent() const OVERRIDE; |
| 45 | 45 |
| 46 virtual const AtomicString& interfaceName() const; | 46 virtual const AtomicString& interfaceName() const OVERRIDE; |
| 47 | 47 |
| 48 float deltaX() const { return m_deltaX; } | 48 float deltaX() const { return m_deltaX; } |
| 49 float deltaY() const { return m_deltaY; } | 49 float deltaY() const { return m_deltaY; } |
| 50 | 50 |
| 51 private: | 51 private: |
| 52 GestureEvent(); | 52 GestureEvent(); |
| 53 GestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, int screenX
, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKe
y, bool metaKey, float deltaX, float deltaY); | 53 GestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, int screenX
, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKe
y, bool metaKey, float deltaX, float deltaY); |
| 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 : public EventDispatchMediator { | 59 class GestureEventDispatchMediator FINAL : public EventDispatchMediator { |
| 60 public: | 60 public: |
| 61 static PassRefPtr<GestureEventDispatchMediator> create(PassRefPtr<GestureEve
nt> gestureEvent) | 61 static PassRefPtr<GestureEventDispatchMediator> create(PassRefPtr<GestureEve
nt> gestureEvent) |
| 62 { | 62 { |
| 63 return adoptRef(new GestureEventDispatchMediator(gestureEvent)); | 63 return adoptRef(new GestureEventDispatchMediator(gestureEvent)); |
| 64 } | 64 } |
| 65 | 65 |
| 66 private: | 66 private: |
| 67 explicit GestureEventDispatchMediator(PassRefPtr<GestureEvent>); | 67 explicit GestureEventDispatchMediator(PassRefPtr<GestureEvent>); |
| 68 | 68 |
| 69 GestureEvent* event() const; | 69 GestureEvent* event() const; |
| 70 | 70 |
| 71 virtual bool dispatchEvent(EventDispatcher*) const OVERRIDE; | 71 virtual 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 WebCore | 76 } // namespace WebCore |
| 77 | 77 |
| 78 #endif // GestureEvent_h | 78 #endif // GestureEvent_h |
| OLD | NEW |