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

Side by Side Diff: ppapi/c/dev/ppb_testing_dev.h

Issue 8413021: Add functions to generate input events to PPB_Testing_Dev. These make (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 Fri Nov 18 20:23:43 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
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 renderer, 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 renderer just as if it had
100 * come from the user. If the renderer 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 renderer 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 renderer will change the timestamp, add modifiers,
111 * and may slightly alter the mouse position, due to coordinate transforms
112 * it 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698