diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-20 22:04:32 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-07-20 22:04:32 +0000 |
commit | d912c698831fee8a5dd35ec603c2127663f593ed (patch) | |
tree | 2652decd8a67ee8dfe1b409006665ad21cdd0919 /ppapi/c | |
parent | 45cce16952513f09dc045533d16e0135094fc3e3 (diff) | |
download | chromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.zip chromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.tar.gz chromium_src-d912c698831fee8a5dd35ec603c2127663f593ed.tar.bz2 |
Convert input event to interface version 1.0. Rename some of the mouse and
wheel events to remove the redundant "Mouse" and "Wheel" in the getters.
Rename PP_INPUTEVENT_TYPE_MOUSEWHEEL to .._WHEEL so that it doesn't look
like a mouse event (it's its own type).
Add documentation to the C++ wrapper from the C wrappers. Do some minor
documentation updates.
Update IDL for some of the recent changes we've made. Update the way points
are passed for resource creation since IDL wanted to do it by pointer.
TEST=it compiles.
Review URL: http://codereview.chromium.org/7464003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@93263 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/pp_input_event.h | 4 | ||||
-rw-r--r-- | ppapi/c/ppb_input_event.h | 39 | ||||
-rw-r--r-- | ppapi/c/ppb_instance.h | 19 | ||||
-rw-r--r-- | ppapi/c/ppp_input_event.h | 25 | ||||
-rw-r--r-- | ppapi/c/ppp_instance.h | 5 | ||||
-rw-r--r-- | ppapi/c/ppp_messaging.h | 2 |
6 files changed, 54 insertions, 40 deletions
diff --git a/ppapi/c/pp_input_event.h b/ppapi/c/pp_input_event.h index c3defc9..a81bf2c 100644 --- a/ppapi/c/pp_input_event.h +++ b/ppapi/c/pp_input_event.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From pp_input_event.idl modified Sat Jul 16 16:50:26 2011. */ +/* From pp_input_event.idl modified Wed Jul 20 11:21:44 2011. */ #ifndef PPAPI_C_PP_INPUT_EVENT_H_ #define PPAPI_C_PP_INPUT_EVENT_H_ @@ -11,7 +11,6 @@ #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_stdint.h" -#include "ppapi/c/pp_time.h" #include "ppapi/c/ppb_input_event.h" /** @@ -190,7 +189,6 @@ struct PP_InputEvent_Wheel { PP_Bool scroll_by_page; }; PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_InputEvent_Wheel, 24); - /** * @} */ diff --git a/ppapi/c/ppb_input_event.h b/ppapi/c/ppb_input_event.h index b3c62a7..de66615 100644 --- a/ppapi/c/ppb_input_event.h +++ b/ppapi/c/ppb_input_event.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppb_input_event.idl modified Tue Jul 12 15:22:36 2011. */ +/* From ppb_input_event.idl modified Wed Jul 20 12:19:12 2011. */ #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ #define PPAPI_C_PPB_INPUT_EVENT_H_ @@ -68,7 +68,7 @@ typedef enum { * * Register for this event using the PP_INPUTEVENT_CLASS_WHEEL class. */ - PP_INPUTEVENT_TYPE_MOUSEWHEEL = 5, + PP_INPUTEVENT_TYPE_WHEEL = 5, /** * Notification that a key transitioned from "up" to "down". * TODO(brettw) differentiate from KEYDOWN. @@ -204,8 +204,8 @@ PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Class, 4); * @addtogroup Interfaces * @{ */ -#define PPB_INPUT_EVENT_INTERFACE_0_1 "PPB_InputEvent;0.1" -#define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_0_1 +#define PPB_INPUT_EVENT_INTERFACE_1_0 "PPB_InputEvent;1.0" +#define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0 struct PPB_InputEvent { /** @@ -343,8 +343,8 @@ struct PPB_InputEvent { uint32_t (*GetModifiers)(PP_Resource event); }; -#define PPB_MOUSE_INPUT_EVENT_INTERFACE_0_1 "PPB_MouseInputEvent;0.1" -#define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_0_1 +#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 struct PPB_MouseInputEvent { /** @@ -358,9 +358,8 @@ struct PPB_MouseInputEvent { PP_TimeTicks time_stamp, uint32_t modifiers, PP_InputEvent_MouseButton mouse_button, - struct PP_Point mouse_position, + const struct PP_Point* mouse_position, int32_t click_count); - /** * Determines if a resource is a mouse event. * @@ -374,7 +373,7 @@ struct PPB_MouseInputEvent { * value will be PP_EVENT_MOUSEBUTTON_NONE for mouse move, enter, and leave * events, and for all non-mouse events. */ - PP_InputEvent_MouseButton (*GetMouseButton)(PP_Resource mouse_event); + PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); /** * Returns the pixel location of a mouse input event. * @@ -382,15 +381,15 @@ struct PPB_MouseInputEvent { * 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 (*GetMousePosition)(PP_Resource mouse_event); + struct PP_Point (*GetPosition)(PP_Resource mouse_event); /** * TODO(brettw) figure out exactly what this means. */ - int32_t (*GetMouseClickCount)(PP_Resource mouse_event); + int32_t (*GetClickCount)(PP_Resource mouse_event); }; -#define PPB_WHEEL_INPUT_EVENT_INTERFACE_0_1 "PPB_WheelInputEvent;0.1" -#define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_0_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 struct PPB_WheelInputEvent { /** @@ -402,10 +401,9 @@ struct PPB_WheelInputEvent { PP_Resource (*Create)(PP_Instance instance, PP_TimeTicks time_stamp, uint32_t modifiers, - struct PP_FloatPoint wheel_delta, - struct PP_FloatPoint wheel_ticks, + const struct PP_FloatPoint* wheel_delta, + const struct PP_FloatPoint* wheel_ticks, PP_Bool scroll_by_page); - /** * Determines if a resource is a wheel event. * @@ -433,7 +431,7 @@ struct PPB_WheelInputEvent { * possible, for example, on some trackpads and newer mice that don't have * "clicks". */ - struct PP_FloatPoint (*GetWheelDelta)(PP_Resource wheel_event); + struct PP_FloatPoint (*GetDelta)(PP_Resource wheel_event); /** * The number of "clicks" of the scroll wheel that have produced the * event. The value may have system-specific acceleration applied to it, @@ -452,7 +450,7 @@ struct PPB_WheelInputEvent { * reaches positive or negative one. This should represent a similar amount * of scrolling as for a mouse that has a discrete mouse wheel. */ - struct PP_FloatPoint (*GetWheelTicks)(PP_Resource wheel_event); + struct PP_FloatPoint (*GetTicks)(PP_Resource wheel_event); /** * Indicates if the scroll delta x/y indicates pages or lines to * scroll by. @@ -463,9 +461,9 @@ struct PPB_WheelInputEvent { PP_Bool (*GetScrollByPage)(PP_Resource wheel_event); }; -#define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_0_1 "PPB_KeyboardInputEvent;0.1" +#define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ - PPB_KEYBOARD_INPUT_EVENT_INTERFACE_0_1 + PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 struct PPB_KeyboardInputEvent { /** @@ -480,7 +478,6 @@ struct PPB_KeyboardInputEvent { uint32_t modifiers, uint32_t key_code, struct PP_Var character_text); - /** * Determines if a resource is a keyboard event. * diff --git a/ppapi/c/ppb_instance.h b/ppapi/c/ppb_instance.h index cff11b6..7985071 100644 --- a/ppapi/c/ppb_instance.h +++ b/ppapi/c/ppb_instance.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppb_instance.idl modified Mon Jul 18 12:54:08 2011. */ +/* From ppb_instance.idl modified Wed Jul 20 11:13:48 2011. */ #ifndef PPAPI_C_PPB_INSTANCE_H_ #define PPAPI_C_PPB_INSTANCE_H_ @@ -37,15 +37,14 @@ struct PPB_Instance { /** - * BindGraphics() binds the given graphics as the current drawing surface. - * The contents of this device is what will be displayed in the module's + * BindGraphics() binds the given graphics as the current display surface. + * The contents of this device is what will be displayed in the instance's * area on the web page. The device must be a 2D or a 3D device. * * You can pass a <code>NULL</code> resource as the device parameter to * unbind all devices from the given instance. The instance will then appear * transparent. Re-binding the same device will return <code>PP_TRUE</code> - * and will do nothing. Unbinding a device will drop any pending flush - * callbacks. + * and will do nothing. * * Any previously-bound device will be released. It is an error to bind * a device when it is already bound to another instance. If you want @@ -65,11 +64,11 @@ struct PPB_Instance { */ PP_Bool (*BindGraphics)(PP_Instance instance, PP_Resource device); /** - * IsFullFrame() determines if the module instance is full-frame (repr). - * Such a module represents the entire document in a frame rather than an - * embedded resource. This can happen if the user does a top-level - * navigation or the page specifies an iframe to a resource with a MIME - * type registered by the module. + * IsFullFrame() determines if the instance is full-frame. Such an instance + * represents the entire document in a frame rather than an embedded + * resource. This can happen if the user does a top-level navigation or the + * page specifies an iframe to a resource with a MIME type registered by the + * module. * * @param[in] instance A <code>PP_Instance</code> indentifying one instance * of a module. diff --git a/ppapi/c/ppp_input_event.h b/ppapi/c/ppp_input_event.h index e0067e6a..6429207 100644 --- a/ppapi/c/ppp_input_event.h +++ b/ppapi/c/ppp_input_event.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppp_input_event.idl modified Wed Jul 13 17:03:43 2011. */ +/* From ppp_input_event.idl modified Wed Jul 20 11:12:41 2011. */ #ifndef PPAPI_C_PPP_INPUT_EVENT_H_ #define PPAPI_C_PPP_INPUT_EVENT_H_ @@ -35,6 +35,19 @@ struct PPP_InputEvent { * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By * default, no events are delivered. * + * If the event was handled, it will not be forwarded to the web page or + * browser. If it was not handled, it will bubble according to the normal + * rules. So it is important that an instance respond accurately with whether + * event propagation should continue. + * + * Event propagation also controls focus. If you handle an event like a mouse + * event, typically the instance will be given focus. Returning false from + * a filtered event handler or not registering for an event type means that + * the click will be given to a lower part of the page and your instance will + * not receive focus. This allows an instance to be partially transparent, + * where clicks on the transparent areas will behave like clicks to the + * underlying page. + * * In general, you should try to keep input event handling short. Especially * for filtered input events, the browser or page may be blocked waiting for * you to respond. @@ -43,6 +56,16 @@ struct PPP_InputEvent { * resource during this call. Unless you take a reference to the resource * to hold it for later, you don't need to release it. * + * <strong>Note:</strong> If you're not receiving input events, make sure you + * register for the event classes you want by calling RequestInputEvents or + * RequestFilteringInputEvents. If you're still not receiving keyboard input + * events, make sure you're returning true (or using a non-filtered event + * handler) for mouse events. Otherwise, the instance will not receive focus + * and keyboard events will not be sent. + * + * \see PPB_InputEvent.ReqeustInputEvents and + * PPB_InputEvent.RequestFilteringInputEvents + * * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have * registered to filter this class of events by calling * RequestFilteringInputEvents, and you return PP_FALSE, the event will diff --git a/ppapi/c/ppp_instance.h b/ppapi/c/ppp_instance.h index 31f93a3..6a0125a 100644 --- a/ppapi/c/ppp_instance.h +++ b/ppapi/c/ppp_instance.h @@ -3,13 +3,12 @@ * found in the LICENSE file. */ -/* From ppp_instance.idl modified Sat Jul 16 16:50:26 2011. */ +/* From ppp_instance.idl modified Wed Jul 20 11:17:15 2011. */ #ifndef PPAPI_C_PPP_INSTANCE_H_ #define PPAPI_C_PPP_INSTANCE_H_ #include "ppapi/c/pp_bool.h" -#include "ppapi/c/pp_input_event.h" #include "ppapi/c/pp_instance.h" #include "ppapi/c/pp_macros.h" #include "ppapi/c/pp_point.h" @@ -17,8 +16,6 @@ #include "ppapi/c/pp_resource.h" #include "ppapi/c/pp_size.h" #include "ppapi/c/pp_stdint.h" -#include "ppapi/c/pp_time.h" -#include "ppapi/c/ppb_input_event.h" /** * @file diff --git a/ppapi/c/ppp_messaging.h b/ppapi/c/ppp_messaging.h index 56ff612..97f2745 100644 --- a/ppapi/c/ppp_messaging.h +++ b/ppapi/c/ppp_messaging.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppp_messaging.idl modified Wed Jul 13 16:51:47 2011. */ +/* From ppp_messaging.idl modified Mon Jul 18 10:06:08 2011. */ #ifndef PPAPI_C_PPP_MESSAGING_H_ #define PPAPI_C_PPP_MESSAGING_H_ |