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 /* From ppb_input_event.idl modified Wed Nov 2 09:59:40 2011. */ | 6 /* From ppb_input_event.idl modified Mon Nov 14 10:36:01 2011. */ |
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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 */ | 241 */ |
242 | 242 |
243 /** | 243 /** |
244 * @addtogroup Interfaces | 244 * @addtogroup Interfaces |
245 * @{ | 245 * @{ |
246 */ | 246 */ |
247 /** | 247 /** |
248 * The <code>PPB_InputEvent</code> interface contains pointers to several | 248 * The <code>PPB_InputEvent</code> interface contains pointers to several |
249 * functions related to generic input events on the browser. | 249 * functions related to generic input events on the browser. |
250 */ | 250 */ |
251 struct PPB_InputEvent { | 251 struct PPB_InputEvent_1_0 { |
252 /** | 252 /** |
253 * RequestInputEvent() requests that input events corresponding to the given | 253 * RequestInputEvent() requests that input events corresponding to the given |
254 * input events are delivered to the instance. | 254 * input events are delivered to the instance. |
255 * | 255 * |
256 * It's recommended that you use RequestFilteringInputEvents() for keyboard | 256 * It's recommended that you use RequestFilteringInputEvents() for keyboard |
257 * events instead of this function so that you don't interfere with normal | 257 * events instead of this function so that you don't interfere with normal |
258 * browser accelerators. | 258 * browser accelerators. |
259 * | 259 * |
260 * By default, no input events are delivered. Call this function with the | 260 * By default, no input events are delivered. Call this function with the |
261 * classes of events you are interested in to have them be delivered to | 261 * classes of events you are interested in to have them be delivered to |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 * | 401 * |
402 * @param[in] resource A <code>PP_Resource</code> corresponding to an input | 402 * @param[in] resource A <code>PP_Resource</code> corresponding to an input |
403 * event. | 403 * event. |
404 * | 404 * |
405 * @return The modifiers associated with the event, or 0 if the given | 405 * @return The modifiers associated with the event, or 0 if the given |
406 * resource is not a valid event resource. | 406 * resource is not a valid event resource. |
407 */ | 407 */ |
408 uint32_t (*GetModifiers)(PP_Resource event); | 408 uint32_t (*GetModifiers)(PP_Resource event); |
409 }; | 409 }; |
410 | 410 |
| 411 typedef struct PPB_InputEvent_1_0 PPB_InputEvent; |
| 412 |
411 /** | 413 /** |
412 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several | 414 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several |
413 * functions related to mouse input events. | 415 * functions related to mouse input events. |
414 */ | 416 */ |
415 struct PPB_MouseInputEvent { | 417 struct PPB_MouseInputEvent_1_1 { |
416 /** | 418 /** |
417 * Create() creates a mouse input event with the given parameters. Normally | 419 * Create() creates a mouse input event with the given parameters. Normally |
418 * you will get a mouse event passed through the | 420 * you will get a mouse event passed through the |
419 * <code>HandleInputEvent</code> and will not need to create them, but some | 421 * <code>HandleInputEvent</code> and will not need to create them, but some |
420 * applications may want to create their own for internal use. The type must | 422 * applications may want to create their own for internal use. The type must |
421 * be one of the mouse event types. | 423 * be one of the mouse event types. |
422 * | 424 * |
423 * @param[in] instance The instance for which this event occurred. | 425 * @param[in] instance The instance for which this event occurred. |
424 * | 426 * |
425 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of | 427 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 * @return The change in position of the mouse, relative to the previous | 502 * @return The change in position of the mouse, relative to the previous |
501 * position. | 503 * position. |
502 * | 504 * |
503 * TODO(yzshen): This feature hasn't been fully supported yet. For now, | 505 * TODO(yzshen): This feature hasn't been fully supported yet. For now, |
504 * movement information is provided only if the mouse is locked. If the mouse | 506 * movement information is provided only if the mouse is locked. If the mouse |
505 * is not locked, the returned value is (0, 0). | 507 * is not locked, the returned value is (0, 0). |
506 */ | 508 */ |
507 struct PP_Point (*GetMovement)(PP_Resource mouse_event); | 509 struct PP_Point (*GetMovement)(PP_Resource mouse_event); |
508 }; | 510 }; |
509 | 511 |
| 512 typedef struct PPB_MouseInputEvent_1_1 PPB_MouseInputEvent; |
| 513 |
510 struct PPB_MouseInputEvent_1_0 { | 514 struct PPB_MouseInputEvent_1_0 { |
511 PP_Resource (*Create)(PP_Instance instance, | 515 PP_Resource (*Create)(PP_Instance instance, |
512 PP_InputEvent_Type type, | 516 PP_InputEvent_Type type, |
513 PP_TimeTicks time_stamp, | 517 PP_TimeTicks time_stamp, |
514 uint32_t modifiers, | 518 uint32_t modifiers, |
515 PP_InputEvent_MouseButton mouse_button, | 519 PP_InputEvent_MouseButton mouse_button, |
516 const struct PP_Point* mouse_position, | 520 const struct PP_Point* mouse_position, |
517 int32_t click_count); | 521 int32_t click_count); |
518 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); | 522 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); |
519 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); | 523 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); |
520 struct PP_Point (*GetPosition)(PP_Resource mouse_event); | 524 struct PP_Point (*GetPosition)(PP_Resource mouse_event); |
521 int32_t (*GetClickCount)(PP_Resource mouse_event); | 525 int32_t (*GetClickCount)(PP_Resource mouse_event); |
522 }; | 526 }; |
523 | 527 |
524 /** | 528 /** |
525 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several | 529 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several |
526 * functions related to wheel input events. | 530 * functions related to wheel input events. |
527 */ | 531 */ |
528 struct PPB_WheelInputEvent { | 532 struct PPB_WheelInputEvent_1_0 { |
529 /** | 533 /** |
530 * Create() creates a wheel input event with the given parameters. Normally | 534 * Create() creates a wheel input event with the given parameters. Normally |
531 * you will get a wheel event passed through the | 535 * you will get a wheel event passed through the |
532 * <code>HandleInputEvent</code> and will not need to create them, but some | 536 * <code>HandleInputEvent</code> and will not need to create them, but some |
533 * applications may want to create their own for internal use. | 537 * applications may want to create their own for internal use. |
534 * | 538 * |
535 * @param[in] instance The instance for which this event occurred. | 539 * @param[in] instance The instance for which this event occurred. |
536 * | 540 * |
537 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time | 541 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time |
538 * when the event occurred. | 542 * when the event occurred. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to a wheel | 626 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to a wheel |
623 * event. | 627 * event. |
624 * | 628 * |
625 * @return <code>PP_TRUE</code> if the event is a wheel event and the user is | 629 * @return <code>PP_TRUE</code> if the event is a wheel event and the user is |
626 * scrolling by pages. <code>PP_FALSE</code> if not or if the resource is not | 630 * scrolling by pages. <code>PP_FALSE</code> if not or if the resource is not |
627 * a wheel event. | 631 * a wheel event. |
628 */ | 632 */ |
629 PP_Bool (*GetScrollByPage)(PP_Resource wheel_event); | 633 PP_Bool (*GetScrollByPage)(PP_Resource wheel_event); |
630 }; | 634 }; |
631 | 635 |
| 636 typedef struct PPB_WheelInputEvent_1_0 PPB_WheelInputEvent; |
| 637 |
632 /** | 638 /** |
633 * The <code>PPB_KeyboardInputEvent</code> interface contains pointers to | 639 * The <code>PPB_KeyboardInputEvent</code> interface contains pointers to |
634 * several functions related to keyboard input events. | 640 * several functions related to keyboard input events. |
635 */ | 641 */ |
636 struct PPB_KeyboardInputEvent { | 642 struct PPB_KeyboardInputEvent_1_0 { |
637 /** | 643 /** |
638 * Creates a keyboard input event with the given parameters. Normally you | 644 * Creates a keyboard input event with the given parameters. Normally you |
639 * will get a keyboard event passed through the HandleInputEvent and will not | 645 * will get a keyboard event passed through the HandleInputEvent and will not |
640 * need to create them, but some applications may want to create their own | 646 * need to create them, but some applications may want to create their own |
641 * for internal use. The type must be one of the keyboard event types. | 647 * for internal use. The type must be one of the keyboard event types. |
642 * | 648 * |
643 * @param[in] instance The instance for which this event occurred. | 649 * @param[in] instance The instance for which this event occurred. |
644 * | 650 * |
645 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of | 651 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
646 * input event. | 652 * input event. |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 * | 697 * |
692 * @param[in] character_event A <code>PP_Resource</code> corresponding to a | 698 * @param[in] character_event A <code>PP_Resource</code> corresponding to a |
693 * keyboard event. | 699 * keyboard event. |
694 * | 700 * |
695 * @return A string var representing a single typed character for character | 701 * @return A string var representing a single typed character for character |
696 * input events. For non-character input events the return value will be an | 702 * input events. For non-character input events the return value will be an |
697 * undefined var. | 703 * undefined var. |
698 */ | 704 */ |
699 struct PP_Var (*GetCharacterText)(PP_Resource character_event); | 705 struct PP_Var (*GetCharacterText)(PP_Resource character_event); |
700 }; | 706 }; |
| 707 |
| 708 typedef struct PPB_KeyboardInputEvent_1_0 PPB_KeyboardInputEvent; |
701 /** | 709 /** |
702 * @} | 710 * @} |
703 */ | 711 */ |
704 | 712 |
705 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ | 713 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ |
706 | 714 |
OLD | NEW |