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 /** | 6 /** |
7 * This file defines the Input Event interfaces. | 7 * This file defines the Input Event interfaces. |
8 */ | 8 */ |
9 | 9 |
10 label Chrome { | 10 label Chrome { |
11 M14 = 1.0 | 11 M13 = 1.0, |
| 12 M14 = 1.1 |
12 }; | 13 }; |
13 | 14 |
14 /** | 15 /** |
15 * This enumeration contains the types of input events. | 16 * This enumeration contains the types of input events. |
16 */ | 17 */ |
17 [assert_size(4)] | 18 [assert_size(4)] |
18 enum PP_InputEvent_Type { | 19 enum PP_InputEvent_Type { |
19 PP_INPUTEVENT_TYPE_UNDEFINED = -1, | 20 PP_INPUTEVENT_TYPE_UNDEFINED = -1, |
20 | 21 |
21 /** | 22 /** |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 * @return The modifiers associated with the event, or 0 if the given | 369 * @return The modifiers associated with the event, or 0 if the given |
369 * resource is not a valid event resource. | 370 * resource is not a valid event resource. |
370 */ | 371 */ |
371 uint32_t GetModifiers([in] PP_Resource event); | 372 uint32_t GetModifiers([in] PP_Resource event); |
372 }; | 373 }; |
373 | 374 |
374 /** | 375 /** |
375 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several | 376 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several |
376 * functions related to mouse input events. | 377 * functions related to mouse input events. |
377 */ | 378 */ |
378 [version=1.0, macro="PPB_MOUSE_INPUT_EVENT_INTERFACE"] | 379 [macro="PPB_MOUSE_INPUT_EVENT_INTERFACE"] |
379 interface PPB_MouseInputEvent { | 380 interface PPB_MouseInputEvent { |
380 /** | 381 /** |
381 * Create() creates a mouse input event with the given parameters. Normally | 382 * Create() creates a mouse input event with the given parameters. Normally |
382 * you will get a mouse event passed through the | 383 * you will get a mouse event passed through the |
383 * <code>HandleInputEvent</code> and will not need to create them, but some | 384 * <code>HandleInputEvent</code> and will not need to create them, but some |
384 * applications may want to create their own for internal use. The type must | 385 * applications may want to create their own for internal use. The type must |
385 * be one of the mouse event types. | 386 * be one of the mouse event types. |
386 * | 387 * |
387 * @param[in] instance The instance for which this event occurred. | 388 * @param[in] instance The instance for which this event occurred. |
388 * | 389 * |
(...skipping 17 matching lines...) Expand all Loading... |
406 */ | 407 */ |
407 PP_Resource Create([in] PP_Instance instance, | 408 PP_Resource Create([in] PP_Instance instance, |
408 [in] PP_InputEvent_Type type, | 409 [in] PP_InputEvent_Type type, |
409 [in] PP_TimeTicks time_stamp, | 410 [in] PP_TimeTicks time_stamp, |
410 [in] uint32_t modifiers, | 411 [in] uint32_t modifiers, |
411 [in] PP_InputEvent_MouseButton mouse_button, | 412 [in] PP_InputEvent_MouseButton mouse_button, |
412 [in] PP_Point mouse_position, | 413 [in] PP_Point mouse_position, |
413 [in] int32_t click_count); | 414 [in] int32_t click_count); |
414 | 415 |
415 /** | 416 /** |
| 417 * Create() creates a mouse input event with the given parameters. Normally |
| 418 * you will get a mouse event passed through the |
| 419 * <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 |
| 421 * be one of the mouse event types. |
| 422 * |
| 423 * @param[in] instance The instance for which this event occurred. |
| 424 * |
| 425 * @param[in] type A <code>PP_InputEvent_Type</code> identifying the type of |
| 426 * input event. |
| 427 * |
| 428 * @param[in] time_stamp A <code>PP_TimeTicks</code> indicating the time |
| 429 * when the event occurred. |
| 430 * |
| 431 * @param[in] modifiers A bit field combination of the |
| 432 * <code>PP_InputEvent_Modifier</code> flags. |
| 433 * |
| 434 * @param[in] mouse_button The button that changed for mouse down or up |
| 435 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for |
| 436 * mouse move, enter, and leave events. |
| 437 * |
| 438 * @param[in] mouse_position A <code>Point</code> containing the x and y |
| 439 * position of the mouse when the event occurred. |
| 440 * |
| 441 * @param[in] mouse_movement The change in position of the mouse. |
| 442 * |
| 443 * @return A <code>PP_Resource</code> containing the new mouse input event. |
| 444 */ |
| 445 [version=1.1] |
| 446 PP_Resource Create([in] PP_Instance instance, |
| 447 [in] PP_InputEvent_Type type, |
| 448 [in] PP_TimeTicks time_stamp, |
| 449 [in] uint32_t modifiers, |
| 450 [in] PP_InputEvent_MouseButton mouse_button, |
| 451 [in] PP_Point mouse_position, |
| 452 [in] int32_t click_count, |
| 453 [in] PP_Point mouse_movement); |
| 454 /** |
416 * IsMouseInputEvent() determines if a resource is a mouse event. | 455 * IsMouseInputEvent() determines if a resource is a mouse event. |
417 * | 456 * |
418 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. | 457 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
419 * | 458 * |
420 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input | 459 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input |
421 * event, otherwise <code>PP_FALSE</code>. | 460 * event, otherwise <code>PP_FALSE</code>. |
422 */ | 461 */ |
423 PP_Bool IsMouseInputEvent([in] PP_Resource resource); | 462 PP_Bool IsMouseInputEvent([in] PP_Resource resource); |
424 | 463 |
425 /** | 464 /** |
426 * GetButton() returns the mouse button that generated a mouse down or up | 465 * GetButton() returns the mouse button that generated a mouse down or up |
427 * event. | 466 * event. |
428 * | 467 * |
429 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a | 468 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
430 * mouse event. | 469 * mouse event. |
431 * | 470 * |
432 * @return The mouse button associated with mouse down and up events. This | 471 * @return The mouse button associated with mouse down and up events. This |
433 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, | 472 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, |
434 * enter, and leave events, and for all non-mouse events. | 473 * enter, and leave events, and for all non-mouse events. |
435 */ | 474 */ |
436 PP_InputEvent_MouseButton GetButton([in] PP_Resource mouse_event); | 475 PP_InputEvent_MouseButton GetButton([in] PP_Resource mouse_event); |
437 | 476 |
438 /** | 477 /** |
439 * GetPosition() returns the pixel location of a mouse input event. | 478 * GetPosition() returns the pixel location of a mouse input event. When |
| 479 * the mouse is locked, it returns the last known mouse position just as |
| 480 * mouse lock was entered. |
440 * | 481 * |
441 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to an | 482 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
442 * mouse event. | 483 * mouse event. |
443 * | 484 * |
444 * @return The point associated with the mouse event, relative to the upper- | 485 * @return The point associated with the mouse event, relative to the upper- |
445 * left of the instance receiving the event. These values can be negative for | 486 * left of the instance receiving the event. These values can be negative for |
446 * mouse drags. The return value will be (0, 0) for non-mouse events. | 487 * mouse drags. The return value will be (0, 0) for non-mouse events. |
447 */ | 488 */ |
448 [returnByValue] PP_Point GetPosition([in] PP_Resource mouse_event); | 489 [returnByValue] PP_Point GetPosition([in] PP_Resource mouse_event); |
449 | 490 |
450 /** | 491 /** |
451 * TODO(brettw) figure out exactly what this means. | 492 * TODO(brettw) figure out exactly what this means. |
452 */ | 493 */ |
453 int32_t GetClickCount([in] PP_Resource mouse_event); | 494 int32_t GetClickCount([in] PP_Resource mouse_event); |
| 495 |
| 496 /** |
| 497 * Returns the change in position of the mouse. When the mouse is locked, |
| 498 * although the mouse position doesn't actually change, this function |
| 499 * still provides movement information, which indicates what the change in |
| 500 * position would be had the mouse not been locked. |
| 501 * |
| 502 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a |
| 503 * mouse event. |
| 504 * |
| 505 * @return The change in position of the mouse, relative to the previous |
| 506 * position. |
| 507 * |
| 508 * TODO(yzshen): This feature hasn't been supported yet. The returned value is |
| 509 * always (0, 0) for system-generated mouse events (which are passed through |
| 510 * the <code>HandleInputEvent</code>). |
| 511 */ |
| 512 [version=1.1] |
| 513 PP_Point GetMovement([in] PP_Resource mouse_event); |
454 }; | 514 }; |
455 | 515 |
456 | 516 |
457 /** | 517 /** |
458 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several | 518 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several |
459 * functions related to wheel input events. | 519 * functions related to wheel input events. |
460 */ | 520 */ |
461 [version=1.0, macro="PPB_WHEEL_INPUT_EVENT_INTERFACE"] | 521 [version=1.0, macro="PPB_WHEEL_INPUT_EVENT_INTERFACE"] |
462 interface PPB_WheelInputEvent { | 522 interface PPB_WheelInputEvent { |
463 /** | 523 /** |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 * @param[in] character_event A <code>PP_Resource</code> corresponding to a | 694 * @param[in] character_event A <code>PP_Resource</code> corresponding to a |
635 * keyboard event. | 695 * keyboard event. |
636 * | 696 * |
637 * @return A string var representing a single typed character for character | 697 * @return A string var representing a single typed character for character |
638 * input events. For non-character input events the return value will be an | 698 * input events. For non-character input events the return value will be an |
639 * undefined var. | 699 * undefined var. |
640 */ | 700 */ |
641 PP_Var GetCharacterText([in] PP_Resource character_event); | 701 PP_Var GetCharacterText([in] PP_Resource character_event); |
642 }; | 702 }; |
643 | 703 |
OLD | NEW |