| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
| 3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
| 4 */ | 4 */ |
| 5 | 5 |
| 6 /* From ppp_input_event.idl modified Wed Jul 13 17:03:43 2011. */ |
| 7 |
| 6 #ifndef PPAPI_C_PPP_INPUT_EVENT_H_ | 8 #ifndef PPAPI_C_PPP_INPUT_EVENT_H_ |
| 7 #define PPAPI_C_PPP_INPUT_EVENT_H_ | 9 #define PPAPI_C_PPP_INPUT_EVENT_H_ |
| 8 | 10 |
| 9 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
| 10 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 13 #include "ppapi/c/pp_macros.h" |
| 11 #include "ppapi/c/pp_resource.h" | 14 #include "ppapi/c/pp_resource.h" |
| 15 #include "ppapi/c/pp_stdint.h" |
| 12 | 16 |
| 17 /** |
| 18 * @file |
| 19 * This file defines the API for receiving input events form the browser. |
| 20 */ |
| 21 |
| 22 |
| 23 /** |
| 24 * @addtogroup Interfaces |
| 25 * @{ |
| 26 */ |
| 13 #define PPP_INPUT_EVENT_INTERFACE_0_1 "PPP_InputEvent;0.1" | 27 #define PPP_INPUT_EVENT_INTERFACE_0_1 "PPP_InputEvent;0.1" |
| 14 #define PPP_INPUT_EVENT_INTERFACE PPP_INPUT_EVENT_INTERFACE_0_1 | 28 #define PPP_INPUT_EVENT_INTERFACE PPP_INPUT_EVENT_INTERFACE_0_1 |
| 15 | 29 |
| 16 struct PPP_InputEvent { | 30 struct PPP_InputEvent { |
| 17 /** | 31 /** |
| 18 * Function for receiving input events from the browser. | 32 * Function for receiving input events from the browser. |
| 19 * | 33 * |
| 20 * In order to receive input events, you must register for them by calling | 34 * In order to receive input events, you must register for them by calling |
| 21 * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By | 35 * PPB_InputEvent.RequestInputEvents() or RequestFilteringInputEvents(). By |
| 22 * default, no events are delivered. | 36 * default, no events are delivered. |
| 23 * | 37 * |
| 24 * In general, you should try to keep input event handling short. Especially | 38 * In general, you should try to keep input event handling short. Especially |
| 25 * for filtered input events, the browser or page may be blocked waiting for | 39 * for filtered input events, the browser or page may be blocked waiting for |
| 26 * you to respond. | 40 * you to respond. |
| 27 * | 41 * |
| 28 * The caller of this function will maintain a reference to the input event | 42 * The caller of this function will maintain a reference to the input event |
| 29 * resource during this call. Unless you take a reference to the resource | 43 * resource during this call. Unless you take a reference to the resource |
| 30 * to hold it for later, you don't need to release it. | 44 * to hold it for later, you don't need to release it. |
| 31 * | 45 * |
| 32 * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have | 46 * @return PP_TRUE if the event was handled, PP_FALSE if not. If you have |
| 33 * registered to filter this class of events by calling | 47 * registered to filter this class of events by calling |
| 34 * RequestFilteringInputEvents, and you return PP_FALSE, the event will | 48 * RequestFilteringInputEvents, and you return PP_FALSE, the event will |
| 35 * be forwarded to the page (and eventually the browser) for the default | 49 * be forwarded to the page (and eventually the browser) for the default |
| 36 * handling. For non-filtered events, the return value will be ignored. | 50 * handling. For non-filtered events, the return value will be ignored. |
| 37 */ | 51 */ |
| 38 PP_Bool (*HandleInputEvent)(PP_Instance instance, PP_Resource input_event); | 52 PP_Bool (*HandleInputEvent)(PP_Instance instance, PP_Resource input_event); |
| 39 }; | 53 }; |
| 54 /** |
| 55 * @} |
| 56 */ |
| 40 | 57 |
| 41 #endif /* PPAPI_C_PPP_INPUT_EVENT_H_ */ | 58 #endif /* PPAPI_C_PPP_INPUT_EVENT_H_ */ |
| 59 |
| OLD | NEW |