Index: ppapi/c/dev/ppb_input_event_dev.h |
diff --git a/ppapi/c/dev/ppb_input_event_dev.h b/ppapi/c/dev/ppb_input_event_dev.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..16a01004889c0fe8942149b20b66ef236a483041 |
--- /dev/null |
+++ b/ppapi/c/dev/ppb_input_event_dev.h |
@@ -0,0 +1,118 @@ |
+/* Copyright (c) 2011 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_C_DEV_PPB_INPUT_EVENT_DEV_H_ |
+#define PPAPI_C_DEV_PPB_INPUT_EVENT_DEV_H_ |
+ |
+#include "ppapi/c/pp_bool.h" |
+#include "ppapi/c/pp_instance.h" |
+#include "ppapi/c/pp_macros.h" |
+#include "ppapi/c/pp_point.h" |
+#include "ppapi/c/pp_resource.h" |
+#include "ppapi/c/pp_stdint.h" |
+#include "ppapi/c/pp_time.h" |
+#include "ppapi/c/ppb_input_event.h" |
+ |
+#define PPB_MOUSE_INPUT_EVENT_DEV_INTERFACE_1_1 "PPB_MouseInputEvent(Dev);1.1" |
+#define PPB_MOUSE_INPUT_EVENT_DEV_INTERFACE \ |
+ PPB_MOUSE_INPUT_EVENT_DEV_INTERFACE_1_1 |
+ |
+/** |
+ * The <code>PPB_MouseInputEvent</code> interface contains pointers to several |
+ * functions related to mouse input events. |
+ */ |
+struct PPB_MouseInputEvent_Dev { |
+ /** |
+ * Create() creates a mouse input event with the given parameters. Normally |
+ * you will get a mouse event passed through the |
+ * <code>HandleInputEvent</code> and will not need to create them, but some |
+ * applications may want to create their own for internal use. The type must |
+ * be one of the mouse event types. |
+ * |
+ * @param[in] instance The instance for which this event occurred. |
+ * |
+ * @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 occurred. |
+ * |
+ * @param[in] modifiers A bit field combination of the |
+ * <code>PP_InputEvent_Modifier</code> flags. |
+ * |
+ * @param[in] mouse_button The button that changed for mouse down or up |
+ * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for |
+ * mouse move, enter, and leave events. |
+ * |
+ * @param[in] mouse_position A <code>Point</code> containing the x and y |
+ * position of the mouse when the event occurred. |
+ * |
+ * @param[in] mouse_movement The change in position of the mouse. |
+ * |
+ * @return A <code>PP_Resource</code> containing the new mouse input event. |
+ */ |
+ PP_Resource (*Create)(PP_Instance instance, |
+ PP_InputEvent_Type type, |
+ PP_TimeTicks time_stamp, |
+ uint32_t modifiers, |
+ PP_InputEvent_MouseButton mouse_button, |
+ const struct PP_Point* mouse_position, |
+ int32_t click_count, |
+ const struct PP_Point* mouse_movement); |
+ /** |
+ * IsMouseInputEvent() determines if a resource is a mouse event. |
+ * |
+ * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
+ * |
+ * @return <code>PP_TRUE</code> if the given resource is a valid mouse input |
+ * event, otherwise <code>PP_FALSE</code>. |
+ */ |
+ PP_Bool (*IsMouseInputEvent)(PP_Resource resource); |
+ /** |
+ * GetButton() returns the mouse button that generated a mouse down or up |
+ * event. |
+ * |
+ * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
+ * mouse event. |
+ * |
+ * @return The mouse button associated with mouse down and up events. This |
+ * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, |
+ * enter, and leave events, and for all non-mouse events. |
+ */ |
+ PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); |
+ /** |
+ * GetPosition() returns the pixel location of a mouse input event. When |
+ * the mouse is locked, it returns the last known mouse position just as |
+ * mouse lock was entered. |
+ * |
+ * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
+ * mouse event. |
+ * |
+ * @return The point associated with the mouse event, relative to the upper- |
+ * left of the instance receiving the event. These values can be negative for |
+ * mouse drags. The return value will be (0, 0) for non-mouse events. |
+ */ |
+ struct PP_Point (*GetPosition)(PP_Resource mouse_event); |
+ /** |
+ * TODO(brettw) figure out exactly what this means. |
+ */ |
+ int32_t (*GetClickCount)(PP_Resource mouse_event); |
+ /** |
+ * Returns the change in position of the mouse. When the mouse is locked, |
+ * although the mouse position doesn't actually change, this function |
+ * still provides movement information, which indicates what the change in |
+ * position would be had the mouse not been locked. |
+ * |
+ * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
+ * mouse event. |
+ * |
+ * @return The change in position of the mouse, relative to the previous |
+ * position. |
+ */ |
+ struct PP_Point (*GetMovement)(PP_Resource mouse_event); |
+}; |
+ |
+#endif /* PPAPI_C_DEV_PPB_INPUT_EVENT_DEV_H_ */ |
+ |