Chromium Code Reviews| 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 Aug 17 11:16:34 2011. */ | 6 /* From ppb_input_event.idl modified Wed Aug 17 11:16:34 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" |
| 17 #include "ppapi/c/pp_time.h" | 17 #include "ppapi/c/pp_time.h" |
| 18 #include "ppapi/c/pp_var.h" | 18 #include "ppapi/c/pp_var.h" |
| 19 | 19 |
| 20 #define PPB_INPUT_EVENT_INTERFACE_1_0 "PPB_InputEvent;1.0" | 20 #define PPB_INPUT_EVENT_INTERFACE_1_0 "PPB_InputEvent;1.0" |
| 21 #define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0 | 21 #define PPB_INPUT_EVENT_INTERFACE PPB_INPUT_EVENT_INTERFACE_1_0 |
| 22 | 22 |
| 23 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 "PPB_MouseInputEvent;1.0" | 23 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 "PPB_MouseInputEvent;1.0" |
| 24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 | 24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 "PPB_MouseInputEvent;1.1" |
|
brettw
2011/08/24 20:55:09
What are we doing with the IDL for this? I don't s
| |
| 25 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 | |
| 25 | 26 |
| 26 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0" | 27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0" |
| 27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 | 28 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 |
| 28 | 29 |
| 29 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" | 30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" |
| 30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ | 31 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ |
| 31 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 | 32 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 |
| 32 | 33 |
| 33 /** | 34 /** |
| 34 * @file | 35 * @file |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 * @return The modifiers associated with the event, or 0 if the given | 378 * @return The modifiers associated with the event, or 0 if the given |
| 378 * resource is not a valid event resource. | 379 * resource is not a valid event resource. |
| 379 */ | 380 */ |
| 380 uint32_t (*GetModifiers)(PP_Resource event); | 381 uint32_t (*GetModifiers)(PP_Resource event); |
| 381 }; | 382 }; |
| 382 | 383 |
| 383 /** | 384 /** |
| 384 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several | 385 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several |
| 385 * functions related to mouse input events. | 386 * functions related to mouse input events. |
| 386 */ | 387 */ |
| 387 struct PPB_MouseInputEvent { | 388 struct PPB_MouseInputEvent_1_0 { |
| 388 /** | 389 /** |
| 389 * Create() creates a mouse input event with the given parameters. Normally | 390 * Create() creates a mouse input event with the given parameters. Normally |
|
brettw
2011/08/24 22:47:49
Lets remove the comments from the functions in the
yzshen1
2011/08/24 23:22:01
Done.
| |
| 390 * you will get a mouse event passed through the | 391 * you will get a mouse event passed through the |
| 391 * <code>HandleInputEvent</code> and will not need to create them, but some | 392 * <code>HandleInputEvent</code> and will not need to create them, but some |
| 392 * applications may want to create their own for internal use. The type must | 393 * applications may want to create their own for internal use. The type must |
| 393 * be one of the mouse event types. | 394 * be one of the mouse event types. |
| 394 * | 395 * |
| 395 * @param[in] instance The instance for which this event occurred. | 396 * @param[in] instance The instance for which this event occurred. |
| 396 * | 397 * |
| 397 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of | 398 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
| 398 * input event. | 399 * input event. |
| 399 * | 400 * |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 450 * left of the instance receiving the event. These values can be negative for | 451 * left of the instance receiving the event. These values can be negative for |
| 451 * mouse drags. The return value will be (0, 0) for non-mouse events. | 452 * mouse drags. The return value will be (0, 0) for non-mouse events. |
| 452 */ | 453 */ |
| 453 struct PP_Point (*GetPosition)(PP_Resource mouse_event); | 454 struct PP_Point (*GetPosition)(PP_Resource mouse_event); |
| 454 /** | 455 /** |
| 455 * TODO(brettw) figure out exactly what this means. | 456 * TODO(brettw) figure out exactly what this means. |
| 456 */ | 457 */ |
| 457 int32_t (*GetClickCount)(PP_Resource mouse_event); | 458 int32_t (*GetClickCount)(PP_Resource mouse_event); |
| 458 }; | 459 }; |
| 459 | 460 |
| 461 struct PPB_MouseInputEvent { | |
|
brettw
2011/08/24 20:55:09
Since we're updating the interface, can you email
| |
| 462 /** | |
| 463 * Create() creates a mouse input event with the given parameters. Normally | |
| 464 * you will get a mouse event passed through the | |
| 465 * <code>HandleInputEvent</code> and will not need to create them, but some | |
| 466 * applications may want to create their own for internal use. The type must | |
| 467 * be one of the mouse event types. | |
| 468 * | |
| 469 * @param[in] instance The instance for which this event occurred. | |
| 470 * | |
| 471 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of | |
| 472 * input event. | |
| 473 * | |
| 474 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time | |
| 475 * when the event occurred. | |
| 476 * | |
| 477 * @param[in] modifiers A bit field combination of the | |
| 478 * <code>PP_InputEvent_Modifier</code> flags. | |
| 479 * | |
| 480 * @param[in] mouse_button The button that changed for mouse down or up | |
| 481 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for | |
| 482 * mouse move, enter, and leave events. | |
| 483 * | |
| 484 * @param[in] mouse_position A <code>Point</code> containing the x and y | |
| 485 * position of the mouse when the event occurred. | |
| 486 * | |
| 487 * @param[in] mouse_movement The change in position of the mouse. | |
| 488 * | |
| 489 * @return A <code>PP_Resource</code> containing the new mouse input event. | |
| 490 */ | |
| 491 PP_Resource (*Create)(PP_Instance instance, | |
| 492 PP_InputEvent_Type type, | |
| 493 PP_TimeTicks time_stamp, | |
| 494 uint32_t modifiers, | |
| 495 PP_InputEvent_MouseButton mouse_button, | |
| 496 const struct PP_Point* mouse_position, | |
| 497 int32_t click_count, | |
| 498 const struct PP_Point* mouse_movement); | |
| 499 /** | |
| 500 * IsMouseInputEvent() determines if a resource is a mouse event. | |
| 501 * | |
| 502 * @param[in] resource A <code>PP_Resource</code> containing the event. | |
| 503 * | |
| 504 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input | |
| 505 * event, otherwise <code>PP_FALSE</code>. | |
| 506 */ | |
| 507 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); | |
| 508 /** | |
| 509 * GetButton() returns the mouse button that generated a mouse down or up | |
| 510 * event. | |
| 511 * | |
| 512 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse | |
| 513 * event. | |
| 514 * | |
| 515 * @return The mouse button associated with mouse down and up events. This | |
| 516 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, | |
| 517 * enter, and leave events, and for all non-mouse events. | |
| 518 */ | |
| 519 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); | |
| 520 /** | |
| 521 * GetPosition() returns the pixel location of a mouse input event. When | |
| 522 * the cursor lock is enabled, it returns the center of the associated plugin | |
| 523 * instance. | |
| 524 * | |
| 525 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse | |
| 526 * event. | |
| 527 * | |
| 528 * @return The point associated with the mouse event, relative to the upper- | |
| 529 * left of the instance receiving the event. These values can be negative for | |
| 530 * mouse drags. The return value will be (0, 0) for non-mouse events. | |
| 531 */ | |
| 532 struct PP_Point (*GetPosition)(PP_Resource mouse_event); | |
| 533 /** | |
| 534 * TODO(brettw) figure out exactly what this means. | |
| 535 */ | |
| 536 int32_t (*GetClickCount)(PP_Resource mouse_event); | |
| 537 /** | |
| 538 * Returns the change in position of the mouse. When the cursor lock is | |
| 539 * enabled, although the mouse position doesn't actually change, this function | |
| 540 * continues to provide movement information as when the cursor is unlocked. | |
| 541 * | |
| 542 * @return The change in position of the mouse, relative to the previous | |
| 543 * position. | |
| 544 */ | |
| 545 struct PP_Point (*GetMovement)(PP_Resource mouse_event); | |
| 546 }; | |
| 547 | |
| 460 /** | 548 /** |
| 461 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several | 549 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several |
| 462 * functions related to wheel input events. | 550 * functions related to wheel input events. |
| 463 */ | 551 */ |
| 464 struct PPB_WheelInputEvent { | 552 struct PPB_WheelInputEvent { |
| 465 /** | 553 /** |
| 466 * Create() creates a wheel input event with the given parameters. Normally | 554 * Create() creates a wheel input event with the given parameters. Normally |
| 467 * you will get a wheel event passed through the | 555 * you will get a wheel event passed through the |
| 468 * <code>HandleInputEvent</code> and will not need to create them, but some | 556 * <code>HandleInputEvent</code> and will not need to create them, but some |
| 469 * applications may want to create their own for internal use. | 557 * applications may want to create their own for internal use. |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 632 * undefined var. | 720 * undefined var. |
| 633 */ | 721 */ |
| 634 struct PP_Var (*GetCharacterText)(PP_Resource character_event); | 722 struct PP_Var (*GetCharacterText)(PP_Resource character_event); |
| 635 }; | 723 }; |
| 636 /** | 724 /** |
| 637 * @} | 725 * @} |
| 638 */ | 726 */ |
| 639 | 727 |
| 640 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ | 728 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ |
| 641 | 729 |
| OLD | NEW |