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 /** | 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 { |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 314 * <code>PP_InputEvent_Class</code> that identify the classes of events the | 314 * <code>PP_InputEvent_Class</code> that identify the classes of events the |
| 315 * instance is no longer interested in. | 315 * instance is no longer interested in. |
| 316 */ | 316 */ |
| 317 void ClearInputEventRequest([in] PP_Instance instance, | 317 void ClearInputEventRequest([in] PP_Instance instance, |
| 318 [in] uint32_t event_classes); | 318 [in] uint32_t event_classes); |
| 319 | 319 |
| 320 /** | 320 /** |
| 321 * IsInputEvent() returns true if the given resource is a valid input event | 321 * IsInputEvent() returns true if the given resource is a valid input event |
| 322 * resource. | 322 * resource. |
| 323 * | 323 * |
| 324 * @param[in] resource A <code>PP_Resource</code>. | 324 * @param[in] resource A <code>PP_Resource</code> corresponding to a generic |
| 325 * resource. | |
| 325 * | 326 * |
| 326 * @return True if the given resource is a valid input event | 327 * @return <code>PP_TRUE</code> if the given resource is a valid input event |
| 327 * resource. | 328 * resource. |
| 328 */ | 329 */ |
| 329 PP_Bool IsInputEvent([in] PP_Resource resource); | 330 PP_Bool IsInputEvent([in] PP_Resource resource); |
| 330 | 331 |
| 331 /** | 332 /** |
| 332 * GetType() returns the type of input event for the given input event | 333 * GetType() returns the type of input event for the given input event |
| 333 * resource. | 334 * resource. |
| 334 * | 335 * |
| 335 * @param[in] resource A <code>PP_Resource</code> containing the input event. | 336 * @param[in] resource A <code>PP_Resource</code> corresponding to an input |
| 337 * event. | |
| 336 * | 338 * |
| 337 * @return A <code>PP_InputEvent_Type</code> if its a valid input event or | 339 * @return A <code>PP_InputEvent_Type</code> if its a valid input event or |
| 338 * <code>PP_INPUTEVENT_TYPE_UNDEFINED</code> if the resource is invalid. | 340 * <code>PP_INPUTEVENT_TYPE_UNDEFINED</code> if the resource is invalid. |
| 339 */ | 341 */ |
| 340 PP_InputEvent_Type GetType([in] PP_Resource event); | 342 PP_InputEvent_Type GetType([in] PP_Resource event); |
| 341 | 343 |
| 342 /** | 344 /** |
| 343 * GetTimeStamp() Returns the time that the event was generated. This will be | 345 * GetTimeStamp() Returns the time that the event was generated. This will be |
| 344 * before the current time since processing and dispatching the event has | 346 * before the current time since processing and dispatching the event has |
| 345 * some overhead. Use this value to compare the times the user generated two | 347 * some overhead. Use this value to compare the times the user generated two |
| 346 * events without being sensitive to variable processing time. | 348 * events without being sensitive to variable processing time. |
| 347 * | 349 * |
| 348 * @param[in] resource A <code>PP_Resource</code> containing the event. | 350 * @param[in] resource A <code>PP_Resource</code> corresponding to the event. |
| 349 * | 351 * |
| 350 * @return The return value is in time ticks, which is a monotonically | 352 * @return The return value is in time ticks, which is a monotonically |
| 351 * increasing clock not related to the wall clock time. It will not change | 353 * increasing clock not related to the wall clock time. It will not change |
| 352 * if the user changes their clock or daylight savings time starts, so can | 354 * if the user changes their clock or daylight savings time starts, so can |
| 353 * be reliably used to compare events. This means, however, that you can't | 355 * be reliably used to compare events. This means, however, that you can't |
| 354 * correlate event times to a particular time of day on the system clock. | 356 * correlate event times to a particular time of day on the system clock. |
| 355 */ | 357 */ |
| 356 PP_TimeTicks GetTimeStamp([in] PP_Resource event); | 358 PP_TimeTicks GetTimeStamp([in] PP_Resource event); |
| 357 | 359 |
| 358 /** | 360 /** |
| 359 * GetModifiers() returns a bitfield indicating which modifiers were down | 361 * GetModifiers() returns a bitfield indicating which modifiers were down |
| 360 * at the time of the event. This is a combination of the flags in the | 362 * at the time of the event. This is a combination of the flags in the |
| 361 * <code>PP_InputEvent_Modifier</code> enum. | 363 * <code>PP_InputEvent_Modifier</code> enum. |
| 362 * | 364 * |
| 363 * @param[in] resource A <code>PP_Resource</code> containing the input event. | 365 * @param[in] resource A <code>PP_Resource</code> corresponding to an input |
| 366 * event. | |
| 364 * | 367 * |
| 365 * @return The modifiers associated with the event, or 0 if the given | 368 * @return The modifiers associated with the event, or 0 if the given |
| 366 * resource is not a valid event resource. | 369 * resource is not a valid event resource. |
| 367 */ | 370 */ |
| 368 uint32_t GetModifiers([in] PP_Resource event); | 371 uint32_t GetModifiers([in] PP_Resource event); |
| 369 }; | 372 }; |
| 370 | 373 |
| 371 /** | 374 /** |
| 372 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several | 375 * The <code>PPB_MouseInputEvent</code> interface contains pointers to several |
| 373 * functions related to mouse input events. | 376 * functions related to mouse input events. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 405 [in] PP_InputEvent_Type type, | 408 [in] PP_InputEvent_Type type, |
| 406 [in] PP_TimeTicks time_stamp, | 409 [in] PP_TimeTicks time_stamp, |
| 407 [in] uint32_t modifiers, | 410 [in] uint32_t modifiers, |
| 408 [in] PP_InputEvent_MouseButton mouse_button, | 411 [in] PP_InputEvent_MouseButton mouse_button, |
| 409 [in] PP_Point mouse_position, | 412 [in] PP_Point mouse_position, |
| 410 [in] int32_t click_count); | 413 [in] int32_t click_count); |
| 411 | 414 |
| 412 /** | 415 /** |
| 413 * IsMouseInputEvent() determines if a resource is a mouse event. | 416 * IsMouseInputEvent() determines if a resource is a mouse event. |
| 414 * | 417 * |
| 415 * @param[in] resource A <code>PP_Resource</code> containing the event. | 418 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
| 416 * | 419 * |
| 417 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input | 420 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input |
| 418 * event, otherwise <code>PP_FALSE</code>. | 421 * event, otherwise <code>PP_FALSE</code>. |
| 419 */ | 422 */ |
| 420 PP_Bool IsMouseInputEvent([in] PP_Resource resource); | 423 PP_Bool IsMouseInputEvent([in] PP_Resource resource); |
| 421 | 424 |
| 422 /** | 425 /** |
| 423 * GetButton() returns the mouse button that generated a mouse down or up | 426 * GetButton() returns the mouse button that generated a mouse down or up |
| 424 * event. | 427 * event. |
| 425 * | 428 * |
| 426 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse | 429 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to an |
|
dmichael (off chromium)
2011/08/24 15:30:42
an->a
jond
2011/08/24 16:41:29
Done.
| |
| 427 * event. | 430 * mouse event. |
| 428 * | 431 * |
| 429 * @return The mouse button associated with mouse down and up events. This | 432 * @return The mouse button associated with mouse down and up events. This |
| 430 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, | 433 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, |
| 431 * enter, and leave events, and for all non-mouse events. | 434 * enter, and leave events, and for all non-mouse events. |
| 432 */ | 435 */ |
| 433 PP_InputEvent_MouseButton GetButton([in] PP_Resource mouse_event); | 436 PP_InputEvent_MouseButton GetButton([in] PP_Resource mouse_event); |
| 434 | 437 |
| 435 /** | 438 /** |
| 436 * GetPosition() returns the pixel location of a mouse input event. | 439 * GetPosition() returns the pixel location of a mouse input event. |
| 437 * | 440 * |
| 438 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse | 441 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to an |
| 439 * event. | 442 * mouse event. |
| 440 * | 443 * |
| 441 * @return The point associated with the mouse event, relative to the upper- | 444 * @return The point associated with the mouse event, relative to the upper- |
| 442 * left of the instance receiving the event. These values can be negative for | 445 * left of the instance receiving the event. These values can be negative for |
| 443 * mouse drags. The return value will be (0, 0) for non-mouse events. | 446 * mouse drags. The return value will be (0, 0) for non-mouse events. |
| 444 */ | 447 */ |
| 445 [returnByValue] PP_Point GetPosition([in] PP_Resource mouse_event); | 448 [returnByValue] PP_Point GetPosition([in] PP_Resource mouse_event); |
| 446 | 449 |
| 447 /** | 450 /** |
| 448 * TODO(brettw) figure out exactly what this means. | 451 * TODO(brettw) figure out exactly what this means. |
| 449 */ | 452 */ |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 485 PP_Resource Create([in] PP_Instance instance, | 488 PP_Resource Create([in] PP_Instance instance, |
| 486 [in] PP_TimeTicks time_stamp, | 489 [in] PP_TimeTicks time_stamp, |
| 487 [in] uint32_t modifiers, | 490 [in] uint32_t modifiers, |
| 488 [in] PP_FloatPoint wheel_delta, | 491 [in] PP_FloatPoint wheel_delta, |
| 489 [in] PP_FloatPoint wheel_ticks, | 492 [in] PP_FloatPoint wheel_ticks, |
| 490 [in] PP_Bool scroll_by_page); | 493 [in] PP_Bool scroll_by_page); |
| 491 | 494 |
| 492 /** | 495 /** |
| 493 * IsWheelInputEvent() determines if a resource is a wheel event. | 496 * IsWheelInputEvent() determines if a resource is a wheel event. |
| 494 * | 497 * |
| 495 * @param[in] wheel_event A <code>PP_Resource</code> containing the event. | 498 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to an |
| 499 * event. | |
| 496 * | 500 * |
| 497 * @return <code>PP_TRUE</code> if the given resource is a valid wheel input | 501 * @return <code>PP_TRUE</code> if the given resource is a valid wheel input |
| 498 * event. | 502 * event. |
| 499 */ | 503 */ |
| 500 PP_Bool IsWheelInputEvent([in] PP_Resource resource); | 504 PP_Bool IsWheelInputEvent([in] PP_Resource resource); |
| 501 | 505 |
| 502 /** | 506 /** |
| 503 * GetDelta() returns the amount vertically and horizontally the user has | 507 * GetDelta() returns the amount vertically and horizontally the user has |
| 504 * requested to scroll by with their mouse wheel. A scroll down or to the | 508 * requested to scroll by with their mouse wheel. A scroll down or to the |
| 505 * right (where the content moves up or left) is represented as positive | 509 * right (where the content moves up or left) is represented as positive |
| 506 * values, and a scroll up or to the left (where the content moves down or | 510 * values, and a scroll up or to the left (where the content moves down or |
| 507 * right) is represented as negative values. | 511 * right) is represented as negative values. |
| 508 * | 512 * |
| 509 * This amount is system dependent and will take into account the user's | 513 * This amount is system dependent and will take into account the user's |
| 510 * preferred scroll sensitivity and potentially also nonlinear acceleration | 514 * preferred scroll sensitivity and potentially also nonlinear acceleration |
| 511 * based on the speed of the scrolling. | 515 * based on the speed of the scrolling. |
| 512 * | 516 * |
| 513 * Devices will be of varying resolution. Some mice with large detents will | 517 * Devices will be of varying resolution. Some mice with large detents will |
| 514 * only generate integer scroll amounts. But fractional values are also | 518 * only generate integer scroll amounts. But fractional values are also |
| 515 * possible, for example, on some trackpads and newer mice that don't have | 519 * possible, for example, on some trackpads and newer mice that don't have |
| 516 * "clicks". | 520 * "clicks". |
| 517 * | 521 * |
| 518 * @param[in] wheel_event A <code>PP_Resource</code> containing the wheel | 522 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to a wheel |
| 519 * event. | 523 * event. |
| 520 * | 524 * |
| 521 * @return The vertical and horizontal scroll values. The units are either in | 525 * @return The vertical and horizontal scroll values. The units are either in |
| 522 * pixels (when scroll_by_page is false) or pages (when scroll_by_page is | 526 * pixels (when scroll_by_page is false) or pages (when scroll_by_page is |
| 523 * true). For example, y = -3 means scroll up 3 pixels when scroll_by_page | 527 * true). For example, y = -3 means scroll up 3 pixels when scroll_by_page |
| 524 * is false, and scroll up 3 pages when scroll_by_page is true. | 528 * is false, and scroll up 3 pages when scroll_by_page is true. |
| 525 */ | 529 */ |
| 526 PP_FloatPoint GetDelta([in] PP_Resource wheel_event); | 530 PP_FloatPoint GetDelta([in] PP_Resource wheel_event); |
| 527 | 531 |
| 528 /** | 532 /** |
| 529 * GetTicks() returns the number of "clicks" of the scroll wheel | 533 * GetTicks() returns the number of "clicks" of the scroll wheel |
| 530 * that have produced the event. The value may have system-specific | 534 * that have produced the event. The value may have system-specific |
| 531 * acceleration applied to it, depending on the device. The positive and | 535 * acceleration applied to it, depending on the device. The positive and |
| 532 * negative meanings are the same as for GetDelta(). | 536 * negative meanings are the same as for GetDelta(). |
| 533 * | 537 * |
| 534 * If you are scrolling, you probably want to use the delta values. These | 538 * If you are scrolling, you probably want to use the delta values. These |
| 535 * tick events can be useful if you aren't doing actual scrolling and don't | 539 * tick events can be useful if you aren't doing actual scrolling and don't |
| 536 * want or pixel values. An example may be cycling between different items in | 540 * want or pixel values. An example may be cycling between different items in |
| 537 * a game. | 541 * a game. |
| 538 * | 542 * |
| 539 * @param[in] wheel_event A <code>PP_Resource</code> containing the wheel | 543 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to a wheel |
| 540 * event. | 544 * event. |
| 541 * | 545 * |
| 542 * @return The number of "clicks" of the scroll wheel. You may receive | 546 * @return The number of "clicks" of the scroll wheel. You may receive |
| 543 * fractional values for the wheel ticks if the mouse wheel is high | 547 * fractional values for the wheel ticks if the mouse wheel is high |
| 544 * resolution or doesn't have "clicks". If your program wants discrete | 548 * resolution or doesn't have "clicks". If your program wants discrete |
| 545 * events (as in the "picking items" example) you should accumulate | 549 * events (as in the "picking items" example) you should accumulate |
| 546 * fractional click values from multiple messages until the total value | 550 * fractional click values from multiple messages until the total value |
| 547 * reaches positive or negative one. This should represent a similar amount | 551 * reaches positive or negative one. This should represent a similar amount |
| 548 * of scrolling as for a mouse that has a discrete mouse wheel. | 552 * of scrolling as for a mouse that has a discrete mouse wheel. |
| 549 */ | 553 */ |
| 550 PP_FloatPoint GetTicks([in] PP_Resource wheel_event); | 554 PP_FloatPoint GetTicks([in] PP_Resource wheel_event); |
| 551 | 555 |
| 552 /** | 556 /** |
| 553 * GetScrollByPage() indicates if the scroll delta x/y indicates pages or | 557 * GetScrollByPage() indicates if the scroll delta x/y indicates pages or |
| 554 * lines to scroll by. | 558 * lines to scroll by. |
| 555 * | 559 * |
| 556 * @param[in] wheel_event A <code>PP_Resource</code> containing the wheel | 560 * @param[in] wheel_event A <code>PP_Resource</code> corresponding to a wheel |
| 557 * event. | 561 * event. |
| 558 * | 562 * |
| 559 * @return <code>PP_TRUE</code> if the event is a wheel event and the user is | 563 * @return <code>PP_TRUE</code> if the event is a wheel event and the user is |
| 560 * scrolling by pages. <code>PP_FALSE</code> if not or if the resource is not | 564 * scrolling by pages. <code>PP_FALSE</code> if not or if the resource is not |
| 561 * a wheel event. | 565 * a wheel event. |
| 562 */ | 566 */ |
| 563 PP_Bool GetScrollByPage([in] PP_Resource wheel_event); | 567 PP_Bool GetScrollByPage([in] PP_Resource wheel_event); |
| 564 }; | 568 }; |
| 565 | 569 |
| 566 /** | 570 /** |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 599 PP_Resource Create([in] PP_Instance instance, | 603 PP_Resource Create([in] PP_Instance instance, |
| 600 [in] PP_InputEvent_Type type, | 604 [in] PP_InputEvent_Type type, |
| 601 [in] PP_TimeTicks time_stamp, | 605 [in] PP_TimeTicks time_stamp, |
| 602 [in] uint32_t modifiers, | 606 [in] uint32_t modifiers, |
| 603 [in] uint32_t key_code, | 607 [in] uint32_t key_code, |
| 604 [in] PP_Var character_text); | 608 [in] PP_Var character_text); |
| 605 | 609 |
| 606 /** | 610 /** |
| 607 * IsKeyboardInputEvent() determines if a resource is a keyboard event. | 611 * IsKeyboardInputEvent() determines if a resource is a keyboard event. |
| 608 * | 612 * |
| 609 * @param[in] resource A <code>PP_Resource</code> containing the event. | 613 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. |
| 610 * | 614 * |
| 611 * @return <code>PP_TRUE</code> if the given resource is a valid input event. | 615 * @return <code>PP_TRUE</code> if the given resource is a valid input event. |
| 612 */ | 616 */ |
| 613 PP_Bool IsKeyboardInputEvent([in] PP_Resource resource); | 617 PP_Bool IsKeyboardInputEvent([in] PP_Resource resource); |
| 614 | 618 |
| 615 /** | 619 /** |
| 616 * GetKeyCode() returns the DOM keyCode field for the keyboard event. | 620 * GetKeyCode() returns the DOM keyCode field for the keyboard event. |
| 617 * Chrome populates this with the Windows-style Virtual Key code of the key. | 621 * Chrome populates this with the Windows-style Virtual Key code of the key. |
| 618 * | 622 * |
| 619 * @param[in] key_event A <code>PP_Resource</code> containing the keyboard | 623 * @param[in] key_event A <code>PP_Resource</code> corresponding to a |
| 620 * event. | 624 * keyboard event. |
| 621 * | 625 * |
| 622 * @return The DOM keyCode field for the keyboard event. | 626 * @return The DOM keyCode field for the keyboard event. |
| 623 */ | 627 */ |
| 624 uint32_t GetKeyCode([in] PP_Resource key_event); | 628 uint32_t GetKeyCode([in] PP_Resource key_event); |
| 625 | 629 |
| 626 /** | 630 /** |
| 627 * GetCharacterText() returns the typed character as a UTF-8 string for the | 631 * GetCharacterText() returns the typed character as a UTF-8 string for the |
| 628 * given character event. | 632 * given character event. |
| 629 * | 633 * |
| 630 * @param[in] character_event A <code>PP_Resource</code> containing the | 634 * @param[in] character_event A <code>PP_Resource</code> corresponding to a |
| 631 * keyboard event. | 635 * keyboard event. |
| 632 * | 636 * |
| 633 * @return A string var representing a single typed character for character | 637 * @return A string var representing a single typed character for character |
| 634 * input events. For non-character input events the return value will be an | 638 * input events. For non-character input events the return value will be an |
| 635 * undefined var. | 639 * undefined var. |
| 636 */ | 640 */ |
| 637 PP_Var GetCharacterText([in] PP_Resource character_event); | 641 PP_Var GetCharacterText([in] PP_Resource character_event); |
| 638 }; | 642 }; |
| 639 | 643 |
| OLD | NEW |