OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2012 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 ppb_input_event.idl modified Mon Dec 16 15:35:15 2013. */ | 6 /* From ppb_input_event.idl modified Thu Apr 3 14:52:10 2014. */ |
7 | 7 |
8 #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ | 8 #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ |
9 #define PPAPI_C_PPB_INPUT_EVENT_H_ | 9 #define PPAPI_C_PPB_INPUT_EVENT_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" |
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 * do optimizations for scroll or touch events that can be processed | 327 * do optimizations for scroll or touch events that can be processed |
328 * substantially faster if it knows there are no non-default receivers for | 328 * substantially faster if it knows there are no non-default receivers for |
329 * that message. Requesting that such messages be delivered, even if they are | 329 * that message. Requesting that such messages be delivered, even if they are |
330 * processed very quickly, may have a noticeable effect on the performance of | 330 * processed very quickly, may have a noticeable effect on the performance of |
331 * the page. | 331 * the page. |
332 * | 332 * |
333 * Note that synthetic mouse events will be generated from touch events if | 333 * Note that synthetic mouse events will be generated from touch events if |
334 * (and only if) you do not request touch events. | 334 * (and only if) you do not request touch events. |
335 * | 335 * |
336 * When requesting input events through this function, the events will be | 336 * When requesting input events through this function, the events will be |
337 * delivered and <i>not</i> bubbled to the page. This means that even if you | 337 * delivered and <i>not</i> bubbled to the default handlers. |
338 * aren't interested in the message, no other parts of the page will get | |
339 * a crack at the message. | |
340 * | 338 * |
341 * <strong>Example:</strong> | 339 * <strong>Example:</strong> |
342 * @code | 340 * @code |
343 * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); | 341 * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); |
344 * RequestFilteringInputEvents(instance, | 342 * RequestFilteringInputEvents(instance, |
345 * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); | 343 * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); |
346 * @endcode | 344 * @endcode |
347 * | 345 * |
348 * @param instance The <code>PP_Instance</code> of the instance requesting | 346 * @param instance The <code>PP_Instance</code> of the instance requesting |
349 * the given events. | 347 * the given events. |
(...skipping 12 matching lines...) Expand all Loading... |
362 * events, these must use RequestFilteringInputEvents(). | 360 * events, these must use RequestFilteringInputEvents(). |
363 */ | 361 */ |
364 int32_t (*RequestInputEvents)(PP_Instance instance, uint32_t event_classes); | 362 int32_t (*RequestInputEvents)(PP_Instance instance, uint32_t event_classes); |
365 /** | 363 /** |
366 * RequestFilteringInputEvents() requests that input events corresponding to | 364 * RequestFilteringInputEvents() requests that input events corresponding to |
367 * the given input events are delivered to the instance for filtering. | 365 * the given input events are delivered to the instance for filtering. |
368 * | 366 * |
369 * By default, no input events are delivered. In most cases you would | 367 * By default, no input events are delivered. In most cases you would |
370 * register to receive events by calling RequestInputEvents(). In some cases, | 368 * register to receive events by calling RequestInputEvents(). In some cases, |
371 * however, you may wish to filter events such that they can be bubbled up | 369 * however, you may wish to filter events such that they can be bubbled up |
372 * to the DOM. In this case, register for those classes of events using | 370 * to the default handlers. In this case, register for those classes of |
373 * this function instead of RequestInputEvents(). | 371 * events using this function instead of RequestInputEvents(). |
374 * | 372 * |
375 * Filtering input events requires significantly more overhead than just | 373 * Filtering input events requires significantly more overhead than just |
376 * delivering them to the instance. As such, you should only request | 374 * delivering them to the instance. As such, you should only request |
377 * filtering in those cases where it's absolutely necessary. The reason is | 375 * filtering in those cases where it's absolutely necessary. The reason is |
378 * that it requires the browser to stop and block for the instance to handle | 376 * that it requires the browser to stop and block for the instance to handle |
379 * the input event, rather than sending the input event asynchronously. This | 377 * the input event, rather than sending the input event asynchronously. This |
380 * can have significant overhead. | 378 * can have significant overhead. |
381 * | 379 * |
382 * <strong>Example:</strong> | 380 * <strong>Example:</strong> |
383 * @code | 381 * @code |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); | 1037 void (*GetSelection)(PP_Resource ime_event, uint32_t* start, uint32_t* end); |
1040 }; | 1038 }; |
1041 | 1039 |
1042 typedef struct PPB_IMEInputEvent_1_0 PPB_IMEInputEvent; | 1040 typedef struct PPB_IMEInputEvent_1_0 PPB_IMEInputEvent; |
1043 /** | 1041 /** |
1044 * @} | 1042 * @} |
1045 */ | 1043 */ |
1046 | 1044 |
1047 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ | 1045 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ |
1048 | 1046 |
OLD | NEW |