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

Side by Side Diff: ppapi/api/ppp_instance.idl

Issue 7466008: Reland http://codereview.chromium.org/7452002/ again (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 5 months 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
« no previous file with comments | « no previous file | ppapi/c/pp_input_event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 /** 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 = 0.5 12 M14 = 1.0
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
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 HandleInputEvent to 164 * handle the click event. Return <code>true</code> from
165 * signal that the click event was handled. Otherwise the browser will bubble 165 * <code>HandleInputEvent</code> in <code>PPP_InputEvent</code> (or use
166 * the event and give focus to the element on the page that actually did end 166 * unfiltered events) to signal that the click event was handled. Otherwise,
167 * up consuming it. If you're not getting focus, check to make sure you're 167 * the browser will bubble the event and give focus to the element on the page
168 * returning true from the mouse click in <code>HandleInputEvent</code>. 168 * that actually did end up consuming it. If you're not getting focus, check
169 * to make sure you're returning true from the mouse click in
170 * <code>HandleInputEvent</code>.
169 * 171 *
170 * @param[in] instance A <code>PP_Instance</code> indentifying the instance 172 * @param[in] instance A <code>PP_Instance</code> indentifying the instance
171 * receiving the input event. 173 * receiving the input event.
172 * 174 *
173 * @param[in] has_focus Indicates the new focused state of the instance. 175 * @param[in] has_focus Indicates the new focused state of the instance.
174 */ 176 */
175 void DidChangeFocus( 177 void DidChangeFocus(
176 /* A PP_Instance indentifying one instance of a module. */ 178 /* A PP_Instance indentifying one instance of a module. */
177 [in] PP_Instance instance, 179 [in] PP_Instance instance,
178 /* Indicates whether this NaCl module gained or lost event focus. */ 180 /* Indicates whether this NaCl module gained or lost event focus. */
179 [in] PP_Bool has_focus); 181 [in] PP_Bool has_focus);
180 182
181 /** 183 /**
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 /**
213 * HandleDocumentLoad() is called after initialize for a full-frame 184 * HandleDocumentLoad() is called after initialize for a full-frame
214 * module that was instantiated based on the MIME type of a DOMWindow 185 * module that was instantiated based on the MIME type of a DOMWindow
215 * navigation. This situation only applies to modules that are pre-registered 186 * navigation. This situation only applies to modules that are pre-registered
216 * to handle certain MIME types. If you haven't specifically registered to 187 * to handle certain MIME types. If you haven't specifically registered to
217 * handle a MIME type or aren't positive this applies to you, your 188 * handle a MIME type or aren't positive this applies to you, your
218 * implementation of this function can just return <code>PP_FALSE</code>. 189 * implementation of this function can just return <code>PP_FALSE</code>.
219 * 190 *
220 * The given <code>url_loader</code> corresponds to a 191 * The given <code>url_loader</code> corresponds to a
221 * <code>PPB_URLLoader</code> instance that is already opened. Its response 192 * <code>PPB_URLLoader</code> instance that is already opened. Its response
222 * headers may be queried using <code>PPB_URLLoader::GetResponseInfo</code>. 193 * headers may be queried using <code>PPB_URLLoader::GetResponseInfo</code>.
(...skipping 20 matching lines...) Expand all
243 [in] PP_Resource url_loader); 214 [in] PP_Resource url_loader);
244 215
245 }; 216 };
246 217
247 #inline c 218 #inline c
248 219
249 typedef struct PPP_Instance PPP_Instance_0_5; 220 typedef struct PPP_Instance PPP_Instance_0_5;
250 221
251 #endinl 222 #endinl
252 223
OLDNEW
« no previous file with comments | « no previous file | ppapi/c/pp_input_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698