summaryrefslogtreecommitdiffstats
path: root/native_client_sdk/src/libraries/ppapi_main/ppapi_event.h
diff options
context:
space:
mode:
Diffstat (limited to 'native_client_sdk/src/libraries/ppapi_main/ppapi_event.h')
-rw-r--r--native_client_sdk/src/libraries/ppapi_main/ppapi_event.h81
1 files changed, 81 insertions, 0 deletions
diff --git a/native_client_sdk/src/libraries/ppapi_main/ppapi_event.h b/native_client_sdk/src/libraries/ppapi_main/ppapi_event.h
new file mode 100644
index 0000000..6d222db
--- /dev/null
+++ b/native_client_sdk/src/libraries/ppapi_main/ppapi_event.h
@@ -0,0 +1,81 @@
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+
+#ifndef PPAPI_MAIN_PPAPI_EVENT_H_
+#define PPAPI_MAIN_PPAPI_EVENT_H_
+
+#include "ppapi/c/pp_input_event.h"
+#include "ppapi/c/pp_point.h"
+#include "ppapi/c/pp_touch_point.h"
+#include "ppapi/c/ppb_input_event.h"
+
+#include "utils/macros.h"
+
+EXTERN_C_BEGIN
+
+/*
+ * Event Structures
+ *
+ * The following event structures are based on the equivilent structs
+ * defined in ppapi/c/ppb_input_event.h.
+ *
+ */
+
+// Generic Event
+typedef struct {
+ PP_InputEvent_Type event_type;
+ PP_TimeTicks time_ticks;
+ uint32_t modifiers;
+} PPAPIEvent;
+
+
+// Key Code Up/Down
+typedef struct {
+ PPAPIEvent event;
+
+ uint32_t key_code;
+} PPAPIKeyEvent;
+
+
+// Cooked Character Event
+typedef struct {
+ PPAPIEvent event;
+
+ char text[5];
+} PPAPICharEvent;
+
+
+// Mouse Event
+typedef struct {
+ PPAPIEvent event;
+
+ PP_InputEvent_MouseButton button;
+ struct PP_Point location;
+ struct PP_Point delta;
+} PPAPIMouseEvent;
+
+
+// Wheel Event
+typedef struct {
+ PPAPIEvent event;
+
+ PP_InputEvent_MouseButton button;
+ struct PP_FloatPoint delta;
+ uint32_t by_page;
+} PPAPIWheelEvent;
+
+
+// Touch Event
+#define MAX_TOUCH_POINTS 4
+typedef struct {
+ PPAPIEvent event;
+
+ uint32_t point_count;
+ struct PP_TouchPoint points[MAX_TOUCH_POINTS];
+} PPAPITouchEvent;
+
+EXTERN_C_END
+
+#endif // PPAPI_MAIN_PPAPI_EVENT_H_ \ No newline at end of file