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

Unified Diff: sky/engine/public/platform/WebInputEvent.h

Issue 876853005: Add wheel support to sky-scrollable (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add missing files 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/frame/NewEventHandler.cpp ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/public/platform/WebInputEvent.h
diff --git a/sky/engine/public/platform/WebInputEvent.h b/sky/engine/public/platform/WebInputEvent.h
index 61cec7c9407974e36d3850f575558cefbd1cf039..ea2df82622f2ff0ebfb74f839d4aafbb39c49128 100644
--- a/sky/engine/public/platform/WebInputEvent.h
+++ b/sky/engine/public/platform/WebInputEvent.h
@@ -121,6 +121,8 @@ public:
GesturePinchEnd,
GesturePinchUpdate,
GestureTypeLast = GesturePinchUpdate,
+
+ WheelEvent,
};
enum Modifiers {
@@ -170,18 +172,21 @@ public:
return PointerTypeFirst <= type && type <= PointerTypeLast;
}
- // Returns true if the WebInputEvent |type| is a keyboard event.
static bool isKeyboardEventType(int type)
{
return KeyboardTypeFirst <= type && type <= KeyboardTypeLast;
}
- // Returns true if the WebInputEvent is a gesture event.
static bool isGestureEventType(int type)
{
return GestureTypeFirst <= type && type <= GestureTypeLast;
}
+ static bool isWheelEventType(int type)
+ {
+ return type == WheelEvent;
+ }
+
protected:
explicit WebInputEvent(unsigned sizeParam)
{
@@ -238,32 +243,35 @@ public:
// what is returned by the Windows API. For example, it should
// store VK_SHIFT instead of VK_RSHIFT. The location information
// should be stored in |modifiers|.
- int key;
+ int key = 0;
// |charCode| is the text generated by this keystroke. |unmodifiedCharCode|
// is |charCode|, but unmodified by an concurrently-held modifiers (except
// shift). This is useful for working out shortcut keys.
- WebUChar charCode;
- WebUChar unmodifiedCharCode;
-
- WebKeyboardEvent()
- : WebInputEvent(sizeof(WebKeyboardEvent))
- , key(0)
- , charCode(0)
- , unmodifiedCharCode(0)
- {
- }
+ WebUChar charCode = 0;
+ WebUChar unmodifiedCharCode = 0;
+
+ WebKeyboardEvent() : WebInputEvent(sizeof(WebKeyboardEvent)) {}
+};
+
+// WebWheelEvent --------------------------------------------------------------
+
+class WebWheelEvent : public WebInputEvent {
+public:
+ float x = 0;
+ float y = 0;
+ float offsetX = 0;
+ float offsetY = 0;
+
+ WebWheelEvent() : WebInputEvent(sizeof(WebWheelEvent)) {}
};
-// WebGestureEvent --------------------------------------------------------------
+// WebGestureEvent ------------------------------------------------------------
class WebGestureEvent : public WebInputEvent {
public:
- int x;
- int y;
- int globalX;
- int globalY;
- WebGestureDevice sourceDevice;
+ float x = 0;
+ float y = 0;
union {
// Tap information must be set for GestureTap, GestureTapUnconfirmed,
@@ -320,10 +328,6 @@ public:
WebGestureEvent()
: WebInputEvent(sizeof(WebGestureEvent))
- , x(0)
- , y(0)
- , globalX(0)
- , globalY(0)
{
memset(&data, 0, sizeof(data));
}
« no previous file with comments | « sky/engine/core/frame/NewEventHandler.cpp ('k') | sky/engine/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698