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

Unified Diff: ppapi/c/ppb_input_event.h

Issue 7715021: Add movement information to PPB_MouseInputEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | « no previous file | ppapi/cpp/input_event.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/c/ppb_input_event.h
diff --git a/ppapi/c/ppb_input_event.h b/ppapi/c/ppb_input_event.h
index 2ad6741e124668991554ee3f653450aae4732fd3..b73352aede62aa03c80537a29851aaf4ff3b619e 100644
--- a/ppapi/c/ppb_input_event.h
+++ b/ppapi/c/ppb_input_event.h
@@ -21,7 +21,8 @@
#define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0
#define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 "PPB_MouseInputEvent;1.0"
-#define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0
+#define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 "PPB_MouseInputEvent;1.1"
brettw 2011/08/24 20:55:09 What are we doing with the IDL for this? I don't s
+#define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1
#define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0"
#define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0
@@ -384,7 +385,7 @@ struct PPB_InputEvent {
* The <code>PPB_MouseInputEvent</code> interface contains pointers to several
* functions related to mouse input events.
*/
-struct PPB_MouseInputEvent {
+struct PPB_MouseInputEvent_1_0 {
/**
* Create() creates a mouse input event with the given parameters. Normally
brettw 2011/08/24 22:47:49 Lets remove the comments from the functions in the
yzshen1 2011/08/24 23:22:01 Done.
* you will get a mouse event passed through the
@@ -457,6 +458,93 @@ struct PPB_MouseInputEvent {
int32_t (*GetClickCount)(PP_Resource mouse_event);
};
+struct PPB_MouseInputEvent {
brettw 2011/08/24 20:55:09 Since we're updating the interface, can you email
+ /**
+ * 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> containing the 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> containing the 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 cursor lock is enabled, it returns the center of the associated plugin
+ * instance.
+ *
+ * @param[in] mouse_event A <code>PP_Resource</code> containing the 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 cursor lock is
+ * enabled, although the mouse position doesn't actually change, this function
+ * continues to provide movement information as when the cursor is unlocked.
+ *
+ * @return The change in position of the mouse, relative to the previous
+ * position.
+ */
+ struct PP_Point (*GetMovement)(PP_Resource mouse_event);
+};
+
/**
* The <code>PPB_WheelIputEvent</code> interface contains pointers to several
* functions related to wheel input events.
« no previous file with comments | « no previous file | ppapi/cpp/input_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698