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

Unified Diff: sky/engine/core/events/GestureEvent.h

Issue 857533002: Add support for GestureEvents to Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/events/GestureEvent.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/events/GestureEvent.h
diff --git a/sky/engine/core/events/GestureEvent.h b/sky/engine/core/events/GestureEvent.h
index 5950f77a209ee7122fb836df216bbb27a4345f66..f5a037d727b2f47360baa8fc2f8ed495fc827c55 100644
--- a/sky/engine/core/events/GestureEvent.h
+++ b/sky/engine/core/events/GestureEvent.h
@@ -32,25 +32,50 @@
namespace blink {
+struct GestureEventInit : public UIEventInit {
+ int screenX = 0;
+ int screenY = 0;
+ int clientX = 0;
+ int clientY = 0;
+ bool ctrlKey = false;
+ bool altKey = false;
+ bool shiftKey = false;
+ bool metaKey = false;;
+ double deltaX = 0;
+ double deltaY = 0;
+ double velocityX = 0;
+ double velocityY = 0;
+};
+
class GestureEvent final : public MouseRelatedEvent {
+ DEFINE_WRAPPERTYPEINFO();
public:
virtual ~GestureEvent() { }
+ static PassRefPtr<GestureEvent> create() { return adoptRef(new GestureEvent); }
static PassRefPtr<GestureEvent> create(PassRefPtr<AbstractView>, const PlatformGestureEvent&);
+ static PassRefPtr<GestureEvent> create(const AtomicString& type, const GestureEventInit&);
- virtual bool isGestureEvent() const override;
+ bool isGestureEvent() const override;
- virtual const AtomicString& interfaceName() const override;
+ const AtomicString& interfaceName() const override;
float deltaX() const { return m_deltaX; }
float deltaY() const { return m_deltaY; }
+ float velocityX() const { return m_velocityX; }
+ float velocityY() const { return m_velocityY; }
+
private:
GestureEvent();
- GestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY);
+ GestureEvent(const AtomicString& type, const GestureEventInit&);
+ GestureEvent(const AtomicString& type, PassRefPtr<AbstractView>, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, float deltaX, float deltaY, float velocityX, float velocityY);
float m_deltaX;
float m_deltaY;
+
+ float m_velocityX;
+ float m_velocityY;
};
class GestureEventDispatchMediator final : public EventDispatchMediator {
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/events/GestureEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698