| 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 24 09:43:38 2011. */ | 6 /* From ppb_input_event.idl modified Wed Aug 24 09:43:38 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_1_1 "PPB_MouseInputEvent;1.1" | 24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 |
| 25 #define PPB_MOUSE_INPUT_EVENT_INTERFACE PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 | |
| 26 | 25 |
| 27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0" | 26 #define PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 "PPB_WheelInputEvent;1.0" |
| 28 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 | 27 #define PPB_WHEEL_INPUT_EVENT_INTERFACE PPB_WHEEL_INPUT_EVENT_INTERFACE_1_0 |
| 29 | 28 |
| 30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" | 29 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 "PPB_KeyboardInputEvent;1.0" |
| 31 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ | 30 #define PPB_KEYBOARD_INPUT_EVENT_INTERFACE \ |
| 32 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 | 31 PPB_KEYBOARD_INPUT_EVENT_INTERFACE_1_0 |
| 33 | 32 |
| 34 /** | 33 /** |
| 35 * @file | 34 * @file |
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 * @param[in] modifiers A bit field combination of the | 406 * @param[in] modifiers A bit field combination of the |
| 408 * <code>PP_InputEvent_Modifier</code> flags. | 407 * <code>PP_InputEvent_Modifier</code> flags. |
| 409 * | 408 * |
| 410 * @param[in] mouse_button The button that changed for mouse down or up | 409 * @param[in] mouse_button The button that changed for mouse down or up |
| 411 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for | 410 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for |
| 412 * mouse move, enter, and leave events. | 411 * mouse move, enter, and leave events. |
| 413 * | 412 * |
| 414 * @param[in] mouse_position A <code>Point</code> containing the x and y | 413 * @param[in] mouse_position A <code>Point</code> containing the x and y |
| 415 * position of the mouse when the event occurred. | 414 * position of the mouse when the event occurred. |
| 416 * | 415 * |
| 417 * @param[in] mouse_movement The change in position of the mouse. | |
| 418 * | |
| 419 * @return A <code>PP_Resource</code> containing the new mouse input event. | 416 * @return A <code>PP_Resource</code> containing the new mouse input event. |
| 420 */ | 417 */ |
| 421 PP_Resource (*Create)(PP_Instance instance, | 418 PP_Resource (*Create)(PP_Instance instance, |
| 422 PP_InputEvent_Type type, | 419 PP_InputEvent_Type type, |
| 423 PP_TimeTicks time_stamp, | 420 PP_TimeTicks time_stamp, |
| 424 uint32_t modifiers, | 421 uint32_t modifiers, |
| 425 PP_InputEvent_MouseButton mouse_button, | 422 PP_InputEvent_MouseButton mouse_button, |
| 426 const struct PP_Point* mouse_position, | 423 const struct PP_Point* mouse_position, |
| 427 int32_t click_count, | 424 int32_t click_count); |
| 428 const struct PP_Point* mouse_movement); | |
| 429 /** | 425 /** |
| 430 * IsMouseInputEvent() determines if a resource is a mouse event. | 426 * IsMouseInputEvent() determines if a resource is a mouse event. |
| 431 * | 427 * |
| 432 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. | 428 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
| 433 * | 429 * |
| 434 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input | 430 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input |
| 435 * event, otherwise <code>PP_FALSE</code>. | 431 * event, otherwise <code>PP_FALSE</code>. |
| 436 */ | 432 */ |
| 437 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); | 433 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); |
| 438 /** | 434 /** |
| 439 * GetButton() returns the mouse button that generated a mouse down or up | 435 * GetButton() returns the mouse button that generated a mouse down or up |
| 440 * event. | 436 * event. |
| 441 * | 437 * |
| 442 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a | 438 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
| 443 * mouse event. | 439 * mouse event. |
| 444 * | 440 * |
| 445 * @return The mouse button associated with mouse down and up events. This | 441 * @return The mouse button associated with mouse down and up events. This |
| 446 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, | 442 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, |
| 447 * enter, and leave events, and for all non-mouse events. | 443 * enter, and leave events, and for all non-mouse events. |
| 448 */ | 444 */ |
| 449 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); | 445 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); |
| 450 /** | 446 /** |
| 451 * GetPosition() returns the pixel location of a mouse input event. When | 447 * GetPosition() returns the pixel location of a mouse input event. |
| 452 * the mouse is locked, it returns the last known mouse position just as | |
| 453 * mouse lock was entered. | |
| 454 * | 448 * |
| 455 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a | 449 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
| 456 * mouse event. | 450 * mouse event. |
| 457 * | 451 * |
| 458 * @return The point associated with the mouse event, relative to the upper- | 452 * @return The point associated with the mouse event, relative to the upper- |
| 459 * left of the instance receiving the event. These values can be negative for | 453 * left of the instance receiving the event. These values can be negative for |
| 460 * mouse drags. The return value will be (0, 0) for non-mouse events. | 454 * mouse drags. The return value will be (0, 0) for non-mouse events. |
| 461 */ | 455 */ |
| 462 struct PP_Point (*GetPosition)(PP_Resource mouse_event); | 456 struct PP_Point (*GetPosition)(PP_Resource mouse_event); |
| 463 /** | 457 /** |
| 464 * TODO(brettw) figure out exactly what this means. | 458 * TODO(brettw) figure out exactly what this means. |
| 465 */ | 459 */ |
| 466 int32_t (*GetClickCount)(PP_Resource mouse_event); | 460 int32_t (*GetClickCount)(PP_Resource mouse_event); |
| 467 /** | |
| 468 * Returns the change in position of the mouse. When the mouse is locked, | |
| 469 * although the mouse position doesn't actually change, this function | |
| 470 * still provides movement information, which indicates what the change in | |
| 471 * position would be had the mouse not been locked. | |
| 472 * | |
| 473 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a | |
| 474 * mouse event. | |
| 475 * | |
| 476 * @return The change in position of the mouse, relative to the previous | |
| 477 * position. | |
| 478 */ | |
| 479 struct PP_Point (*GetMovement)(PP_Resource mouse_event); | |
| 480 }; | |
| 481 | |
| 482 struct PPB_MouseInputEvent_1_0 { | |
| 483 PP_Resource (*Create)(PP_Instance instance, | |
| 484 PP_InputEvent_Type type, | |
| 485 PP_TimeTicks time_stamp, | |
| 486 uint32_t modifiers, | |
| 487 PP_InputEvent_MouseButton mouse_button, | |
| 488 const struct PP_Point* mouse_position, | |
| 489 int32_t click_count); | |
| 490 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); | |
| 491 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); | |
| 492 struct PP_Point (*GetPosition)(PP_Resource mouse_event); | |
| 493 int32_t (*GetClickCount)(PP_Resource mouse_event); | |
| 494 }; | 461 }; |
| 495 | 462 |
| 496 /** | 463 /** |
| 497 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several | 464 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several |
| 498 * functions related to wheel input events. | 465 * functions related to wheel input events. |
| 499 */ | 466 */ |
| 500 struct PPB_WheelInputEvent { | 467 struct PPB_WheelInputEvent { |
| 501 /** | 468 /** |
| 502 * Create() creates a wheel input event with the given parameters. Normally | 469 * Create() creates a wheel input event with the given parameters. Normally |
| 503 * you will get a wheel event passed through the | 470 * you will get a wheel event passed through the |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 669 * undefined var. | 636 * undefined var. |
| 670 */ | 637 */ |
| 671 struct PP_Var (*GetCharacterText)(PP_Resource character_event); | 638 struct PP_Var (*GetCharacterText)(PP_Resource character_event); |
| 672 }; | 639 }; |
| 673 /** | 640 /** |
| 674 * @} | 641 * @} |
| 675 */ | 642 */ |
| 676 | 643 |
| 677 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ | 644 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ |
| 678 | 645 |
| OLD | NEW |