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 dev/ppb_testing_dev.idl modified Thu Nov 17 13:50:20 2011. */ | 6 /* From dev/ppb_testing_dev.idl modified Sat Nov 19 15:58:18 2011. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_TESTING_DEV_H_ |
9 #define PPAPI_C_DEV_PPB_TESTING_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_TESTING_DEV_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
13 #include "ppapi/c/pp_macros.h" | 13 #include "ppapi/c/pp_macros.h" |
14 #include "ppapi/c/pp_point.h" | 14 #include "ppapi/c/pp_point.h" |
15 #include "ppapi/c/pp_resource.h" | 15 #include "ppapi/c/pp_resource.h" |
16 #include "ppapi/c/pp_stdint.h" | 16 #include "ppapi/c/pp_stdint.h" |
17 | 17 |
18 #define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7" | 18 #define PPB_TESTING_DEV_INTERFACE_0_7 "PPB_Testing(Dev);0.7" |
19 #define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_7 | 19 #define PPB_TESTING_DEV_INTERFACE_0_8 "PPB_Testing(Dev);0.8" |
| 20 #define PPB_TESTING_DEV_INTERFACE PPB_TESTING_DEV_INTERFACE_0_8 |
20 | 21 |
21 /** | 22 /** |
22 * @file | 23 * @file |
23 * This file contains interface functions used for unit testing. Do not use in | 24 * This file contains interface functions used for unit testing. Do not use in |
24 * production code. They are not guaranteed to be available in normal plugin | 25 * production code. They are not guaranteed to be available in normal plugin |
25 * environments so you should not depend on them. | 26 * environments so you should not depend on them. |
26 */ | 27 */ |
27 | 28 |
28 | 29 |
29 /** | 30 /** |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 * Returns the number of live objects (resources + strings + objects) | 84 * Returns the number of live objects (resources + strings + objects) |
84 * associated with this plugin instance. Used for detecting leaks. Returns | 85 * associated with this plugin instance. Used for detecting leaks. Returns |
85 * (uint32_t)-1 on failure. | 86 * (uint32_t)-1 on failure. |
86 */ | 87 */ |
87 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); | 88 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); |
88 /** | 89 /** |
89 * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE | 90 * Returns PP_TRUE if the plugin is running out-of-process, PP_FALSE |
90 * otherwise. | 91 * otherwise. |
91 */ | 92 */ |
92 PP_Bool (*IsOutOfProcess)(); | 93 PP_Bool (*IsOutOfProcess)(); |
| 94 /** |
| 95 * Passes the input event to the browser, which sends it back to the |
| 96 * plugin. The plugin should implement PPP_InputEvent and register for |
| 97 * the input event type. |
| 98 * |
| 99 * This method sends an input event through the browser just as if it had |
| 100 * come from the user. If the browser determines that it is an event for the |
| 101 * plugin, it will be sent to be handled by the plugin's PPP_InputEvent |
| 102 * interface. When generating mouse events, make sure the position is within |
| 103 * the plugin's area on the page. When generating a keyboard event, make sure |
| 104 * the plugin is focused. |
| 105 * |
| 106 * Note that the browser may generate extra input events in order to |
| 107 * maintain certain invariants, such as always having a "mouse enter" event |
| 108 * before any other mouse event. Furthermore, the event the plugin receives |
| 109 * after sending a simulated event will be slightly different from the |
| 110 * original event. The browser may change the timestamp, add modifiers, and |
| 111 * slightly alter the mouse position, due to coordinate transforms it |
| 112 * performs. |
| 113 */ |
| 114 void (*SimulateInputEvent)(PP_Instance instance, PP_Resource input_event); |
| 115 }; |
| 116 |
| 117 struct PPB_Testing_Dev_0_7 { |
| 118 PP_Bool (*ReadImageData)(PP_Resource device_context_2d, |
| 119 PP_Resource image, |
| 120 const struct PP_Point* top_left); |
| 121 void (*RunMessageLoop)(PP_Instance instance); |
| 122 void (*QuitMessageLoop)(PP_Instance instance); |
| 123 uint32_t (*GetLiveObjectsForInstance)(PP_Instance instance); |
| 124 PP_Bool (*IsOutOfProcess)(); |
93 }; | 125 }; |
94 /** | 126 /** |
95 * @} | 127 * @} |
96 */ | 128 */ |
97 | 129 |
98 #endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */ | 130 #endif /* PPAPI_C_DEV_PPB_TESTING_DEV_H_ */ |
99 | 131 |
OLD | NEW |