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 Tue Aug 14 09:41:28 2012. */ | 6 /* From ppb_input_event.idl modified Mon Nov 26 19:51:21 2012. */ |
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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
267 * was not handled. This will then forward the event to the containing page | 267 * was not handled. This will then forward the event to the containing page |
268 * for scrolling, producing the nested scrolling behavior users expect from | 268 * for scrolling, producing the nested scrolling behavior users expect from |
269 * frames in a page. | 269 * frames in a page. |
270 */ | 270 */ |
271 PP_INPUTEVENT_CLASS_WHEEL = 1 << 2, | 271 PP_INPUTEVENT_CLASS_WHEEL = 1 << 2, |
272 /** | 272 /** |
273 * Identifies touch input events. | 273 * Identifies touch input events. |
274 * | 274 * |
275 * Request touch events only if you intend to handle them. If the browser | 275 * Request touch events only if you intend to handle them. If the browser |
276 * knows you do not need to handle touch events, it can handle them at a | 276 * knows you do not need to handle touch events, it can handle them at a |
277 * higher level and achieve higher performance. | 277 * higher level and achieve higher performance. If the plugin does not |
| 278 * register for touch-events, then it will receive synthetic mouse events that |
| 279 * are generated from the touch events (e.g. mouse-down for touch-start, |
| 280 * mouse-move for touch-move (with left-button down), and mouse-up for |
| 281 * touch-end. If the plugin does register for touch events, then the synthetic |
| 282 * mouse events are not created. |
278 */ | 283 */ |
279 PP_INPUTEVENT_CLASS_TOUCH = 1 << 3, | 284 PP_INPUTEVENT_CLASS_TOUCH = 1 << 3, |
280 /** | 285 /** |
281 * Identifies IME composition input events. | 286 * Identifies IME composition input events. |
282 * | 287 * |
283 * Request this input event class if you allow on-the-spot IME input. | 288 * Request this input event class if you allow on-the-spot IME input. |
284 */ | 289 */ |
285 PP_INPUTEVENT_CLASS_IME = 1 << 4 | 290 PP_INPUTEVENT_CLASS_IME = 1 << 4 |
286 } PP_InputEvent_Class; | 291 } PP_InputEvent_Class; |
287 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Class, 4); | 292 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_InputEvent_Class, 4); |
(...skipping 26 matching lines...) Expand all Loading... |
314 * to non-filtering mode). | 319 * to non-filtering mode). |
315 * | 320 * |
316 * Input events may have high overhead, so you should only request input | 321 * Input events may have high overhead, so you should only request input |
317 * events that your plugin will actually handle. For example, the browser may | 322 * events that your plugin will actually handle. For example, the browser may |
318 * do optimizations for scroll or touch events that can be processed | 323 * do optimizations for scroll or touch events that can be processed |
319 * substantially faster if it knows there are no non-default receivers for | 324 * substantially faster if it knows there are no non-default receivers for |
320 * that message. Requesting that such messages be delivered, even if they are | 325 * that message. Requesting that such messages be delivered, even if they are |
321 * processed very quickly, may have a noticeable effect on the performance of | 326 * processed very quickly, may have a noticeable effect on the performance of |
322 * the page. | 327 * the page. |
323 * | 328 * |
| 329 * Note that synthetic mouse events will be generated from touch events if |
| 330 * (and only if) the you do not request touch events. |
| 331 * |
324 * When requesting input events through this function, the events will be | 332 * When requesting input events through this function, the events will be |
325 * delivered and <i>not</i> bubbled to the page. This means that even if you | 333 * delivered and <i>not</i> bubbled to the page. This means that even if you |
326 * aren't interested in the message, no other parts of the page will get | 334 * aren't interested in the message, no other parts of the page will get |
327 * a crack at the message. | 335 * a crack at the message. |
328 * | 336 * |
329 * <strong>Example:</strong> | 337 * <strong>Example:</strong> |
330 * <code> | 338 * <code> |
331 * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); | 339 * RequestInputEvents(instance, PP_INPUTEVENT_CLASS_MOUSE); |
332 * RequestFilteringInputEvents(instance, | 340 * RequestFilteringInputEvents(instance, |
333 * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); | 341 * PP_INPUTEVENT_CLASS_WHEEL | PP_INPUTEVENT_CLASS_KEYBOARD); |
(...skipping 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
880 uint32_t touch_id); | 888 uint32_t touch_id); |
881 }; | 889 }; |
882 | 890 |
883 typedef struct PPB_TouchInputEvent_1_0 PPB_TouchInputEvent; | 891 typedef struct PPB_TouchInputEvent_1_0 PPB_TouchInputEvent; |
884 /** | 892 /** |
885 * @} | 893 * @} |
886 */ | 894 */ |
887 | 895 |
888 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ | 896 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ |
889 | 897 |
OLD | NEW |