diff options
Diffstat (limited to 'WebKit/chromium/public/WebInputEvent.h')
| -rw-r--r-- | WebKit/chromium/public/WebInputEvent.h | 46 |
1 files changed, 45 insertions, 1 deletions
diff --git a/WebKit/chromium/public/WebInputEvent.h b/WebKit/chromium/public/WebInputEvent.h index 983aa2a..f8b057b 100644 --- a/WebKit/chromium/public/WebInputEvent.h +++ b/WebKit/chromium/public/WebInputEvent.h @@ -32,6 +32,7 @@ #define WebInputEvent_h #include "WebCommon.h" +#include "WebTouchPoint.h" #include <string.h> @@ -88,6 +89,7 @@ public: MouseMove, MouseEnter, MouseLeave, + ContextMenu, // WebMouseWheelEvent MouseWheel, @@ -96,7 +98,13 @@ public: RawKeyDown, KeyDown, KeyUp, - Char + Char, + + // WebTouchEvent + TouchStart, + TouchMove, + TouchEnd, + TouchCancel, }; enum Modifiers { @@ -121,6 +129,17 @@ public: int modifiers; double timeStampSeconds; // Seconds since epoch. + // Returns true if the WebInputEvent |type| is a mouse event. + static bool isMouseEventType(int type) + { + return type == MouseDown + || type == MouseUp + || type == MouseMove + || type == MouseEnter + || type == MouseLeave + || type == ContextMenu; + } + // Returns true if the WebInputEvent |type| is a keyboard event. static bool isKeyboardEventType(int type) { @@ -129,6 +148,15 @@ public: || type == KeyUp || type == Char; } + + // Returns true if the WebInputEvent |type| is a touch event. + static bool isTouchEventType(int type) + { + return type == TouchStart + || type == TouchMove + || type == TouchEnd + || type == TouchCancel; + } }; // WebKeyboardEvent ----------------------------------------------------------- @@ -255,6 +283,22 @@ public: } }; +// WebTouchEvent -------------------------------------------------------------- + +class WebTouchEvent : public WebInputEvent { +public: + static const int touchPointsLengthCap = 4; + + int touchPointsLength; + WebTouchPoint touchPoints[touchPointsLengthCap]; + + WebTouchEvent(unsigned sizeParam = sizeof(WebTouchEvent)) + : WebInputEvent(sizeParam) + , touchPointsLength(0) + { + } +}; + } // namespace WebKit #endif |
