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

Unified Diff: ppapi/cpp/input_event.h

Issue 10543159: ppapi: Add support for touch events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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 | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/input_event.h
diff --git a/ppapi/cpp/input_event.h b/ppapi/cpp/input_event.h
index 653aae5879794f9d3313ac4ea3c678db2ebde7fd..379e0e8f202ab474e66baaeca294c5d58dba13c9 100644
--- a/ppapi/cpp/input_event.h
+++ b/ppapi/cpp/input_event.h
@@ -9,6 +9,7 @@
#include "ppapi/c/ppb_input_event.h"
#include "ppapi/cpp/resource.h"
+#include "ppapi/cpp/touch_point.h"
/// @file
/// This file defines the API used to handle mouse and keyboard input events.
@@ -298,6 +299,50 @@ class KeyboardInputEvent : public InputEvent {
Var GetCharacterText() const;
};
+class TouchInputEvent : public InputEvent {
+ public:
+ /// Constructs an is_null() touch input event object.
+ TouchInputEvent();
+
+ /// Constructs a touch input event object from the given generic input event.
+ /// If the given event is itself is_null() or is not a touch input event, the
+ /// touch object will be is_null().
+ explicit TouchInputEvent(const InputEvent& event);
+
+ /// Constructs a touch input even from the given parameters.
+ ///
+ /// @param[in] instance The instance for which this event occured.
+ ///
+ /// @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of
+ /// input event.
+ ///
+ /// @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time
+ /// when the event occured.
+ ///
+ /// @param[in] modifiers A bit field combination of the
+ /// <code>PP_InputEvent_Modifier</code> flags.
+ TouchInputEvent(const InstanceHandle& instance,
+ PP_InputEvent_Type type,
+ PP_TimeTicks time_stamp,
+ uint32_t modifiers);
+
+ /// Adds the touch-point to the specified TouchList.
+ void AddTouchPoint(PP_TouchListType list, PP_TouchPoint point);
+
+ /// @return The number of TouchPoints in this TouchList.
+ uint32_t GetTouchCount(PP_TouchListType list) const;
+
+ /// @return The TouchPoint at the given index of the given list, or an empty
+ /// TouchPoint if the index is out of range.
+ TouchPoint GetTouchByIndex(PP_TouchListType list, uint32_t index) const;
+
+ /// @return The TouchPoint in the given list with the given identifier, or an
+ /// empty TouchPoint if the list does not contain a TouchPoint with that
+ /// identifier.
+ TouchPoint GetTouchById(PP_TouchListType list, uint32_t id) const;
+};
+
+
} // namespace pp
#endif // PPAPI_CPP_INPUT_EVENT_H_
« no previous file with comments | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/input_event.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698