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 /** | 6 /** |
7 * This file defines the <code>PPP_Instance</code> structure - a series of | 7 * This file defines the <code>PPP_Instance</code> structure - a series of |
8 * pointers to methods that you must implement in your module. | 8 * pointers to methods that you must implement in your module. |
9 */ | 9 */ |
10 | 10 |
11 label Chrome { | 11 label Chrome { |
12 M14 = 1.0 | 12 M14 = 0.5 |
13 }; | 13 }; |
14 | 14 |
15 /** | 15 /** |
16 * The <code>PPP_Instance</code> interface contains pointers to a series of | 16 * The <code>PPP_Instance</code> interface contains pointers to a series of |
17 * functions that you must implement in your module. These functions can be | 17 * functions that you must implement in your module. These functions can be |
18 * trivial (simply return the default return value) unless you want your module | 18 * trivial (simply return the default return value) unless you want your module |
19 * to handle events such as change of focus or input events (keyboard/mouse) | 19 * to handle events such as change of focus or input events (keyboard/mouse) |
20 * events. | 20 * events. |
21 */ | 21 */ |
22 interface PPP_Instance { | 22 interface PPP_Instance { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 * is invisible, clip will be (0, 0, 0, 0). | 154 * is invisible, clip will be (0, 0, 0, 0). |
155 */ | 155 */ |
156 [in] PP_Rect clip); | 156 [in] PP_Rect clip); |
157 | 157 |
158 /** | 158 /** |
159 * DidChangeFocus() is called when an instance has gained or lost focus. | 159 * DidChangeFocus() is called when an instance has gained or lost focus. |
160 * Having focus means that keyboard events will be sent to the instance. | 160 * Having focus means that keyboard events will be sent to the instance. |
161 * An instance's default condition is that it will not have focus. | 161 * An instance's default condition is that it will not have focus. |
162 * | 162 * |
163 * <strong>Note:</strong>Clicks on instances will give focus only if you | 163 * <strong>Note:</strong>Clicks on instances will give focus only if you |
164 * handle the click event. Return <code>true</code> from | 164 * handle the click event. Return <code>true</code> from HandleInputEvent to |
165 * <code>HandleInputEvent</code> in <code>PPP_InputEvent</code> (or use | 165 * signal that the click event was handled. Otherwise the browser will bubble |
166 * unfiltered events) to signal that the click event was handled. Otherwise, | 166 * the event and give focus to the element on the page that actually did end |
167 * the browser will bubble the event and give focus to the element on the page | 167 * up consuming it. If you're not getting focus, check to make sure you're |
168 * that actually did end up consuming it. If you're not getting focus, check | 168 * returning true from the mouse click in <code>HandleInputEvent</code>. |
169 * to make sure you're returning true from the mouse click in | |
170 * <code>HandleInputEvent</code>. | |
171 * | 169 * |
172 * @param[in] instance A <code>PP_Instance</code> indentifying the instance | 170 * @param[in] instance A <code>PP_Instance</code> indentifying the instance |
173 * receiving the input event. | 171 * receiving the input event. |
174 * | 172 * |
175 * @param[in] has_focus Indicates the new focused state of the instance. | 173 * @param[in] has_focus Indicates the new focused state of the instance. |
176 */ | 174 */ |
177 void DidChangeFocus( | 175 void DidChangeFocus( |
178 /* A PP_Instance indentifying one instance of a module. */ | 176 /* A PP_Instance indentifying one instance of a module. */ |
179 [in] PP_Instance instance, | 177 [in] PP_Instance instance, |
180 /* Indicates whether this NaCl module gained or lost event focus. */ | 178 /* Indicates whether this NaCl module gained or lost event focus. */ |
181 [in] PP_Bool has_focus); | 179 [in] PP_Bool has_focus); |
182 | 180 |
183 /** | 181 /** |
| 182 * HandleInputEvent() handles input events, such as keyboard events. This |
| 183 * function returns <code>PP_TRUE</code> if the event was handled or |
| 184 * <code>PP_FALSE</code> if it was not. |
| 185 * |
| 186 * If the event was handled, it will not be forwarded to the web page or |
| 187 * browser. If it was not handled, it will bubble according to the normal |
| 188 * rules. So it is important that a module respond accurately with whether |
| 189 * event propagation should continue. |
| 190 * |
| 191 * Event propagation also controls focus. If you handle an event like a mouse |
| 192 * event, typically the instance will be given focus. Returning false means |
| 193 * that the click will be given to a lower part of the page and your module |
| 194 * will not receive focus. This allows an instance to be partially |
| 195 * transparent, where clicks on the transparent areas will behave like clicks |
| 196 * to the underlying page. |
| 197 * |
| 198 * @param[in] instance A <code>PP_Instance</code> indentifying one instance |
| 199 * of a module. |
| 200 * |
| 201 * @param[in] event The input event. |
| 202 * |
| 203 * @return <code>PP_TRUE</code> if <code>event</code> was handled, |
| 204 * <code>PP_FALSE</code> otherwise. |
| 205 */ |
| 206 PP_Bool HandleInputEvent( |
| 207 /* A PP_Instance indentifying one instance of a module. */ |
| 208 [in] PP_Instance instance, |
| 209 /* The event. */ |
| 210 [in] PP_InputEvent event); |
| 211 |
| 212 /** |
184 * HandleDocumentLoad() is called after initialize for a full-frame | 213 * HandleDocumentLoad() is called after initialize for a full-frame |
185 * module that was instantiated based on the MIME type of a DOMWindow | 214 * module that was instantiated based on the MIME type of a DOMWindow |
186 * navigation. This situation only applies to modules that are pre-registered | 215 * navigation. This situation only applies to modules that are pre-registered |
187 * to handle certain MIME types. If you haven't specifically registered to | 216 * to handle certain MIME types. If you haven't specifically registered to |
188 * handle a MIME type or aren't positive this applies to you, your | 217 * handle a MIME type or aren't positive this applies to you, your |
189 * implementation of this function can just return <code>PP_FALSE</code>. | 218 * implementation of this function can just return <code>PP_FALSE</code>. |
190 * | 219 * |
191 * The given <code>url_loader</code> corresponds to a | 220 * The given <code>url_loader</code> corresponds to a |
192 * <code>PPB_URLLoader</code> instance that is already opened. Its response | 221 * <code>PPB_URLLoader</code> instance that is already opened. Its response |
193 * headers may be queried using <code>PPB_URLLoader::GetResponseInfo</code>. | 222 * headers may be queried using <code>PPB_URLLoader::GetResponseInfo</code>. |
(...skipping 20 matching lines...) Expand all Loading... |
214 [in] PP_Resource url_loader); | 243 [in] PP_Resource url_loader); |
215 | 244 |
216 }; | 245 }; |
217 | 246 |
218 #inline c | 247 #inline c |
219 | 248 |
220 typedef struct PPP_Instance PPP_Instance_0_5; | 249 typedef struct PPP_Instance PPP_Instance_0_5; |
221 | 250 |
222 #endinl | 251 #endinl |
223 | 252 |
OLD | NEW |