Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: ppapi/c/ppb_input_event.h

Issue 7715021: Add movement information to PPB_MouseInputEvent. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | ppapi/cpp/input_event.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 PPB_MOUSE_INPUT_EVENT_INTERFACE_1_0 24 #define PPB_MOUSE_INPUT_EVENT_INTERFACE_1_1 "PPB_MouseInputEvent;1.1"
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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
406 * @param[in] modifiers A bit field combination of the 407 * @param[in] modifiers A bit field combination of the
407 * <code>PP_InputEvent_Modifier</code> flags. 408 * <code>PP_InputEvent_Modifier</code> flags.
408 * 409 *
409 * @param[in] mouse_button The button that changed for mouse down or up 410 * @param[in] mouse_button The button that changed for mouse down or up
410 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for 411 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for
411 * mouse move, enter, and leave events. 412 * mouse move, enter, and leave events.
412 * 413 *
413 * @param[in] mouse_position A <code>Point</code> containing the x and y 414 * @param[in] mouse_position A <code>Point</code> containing the x and y
414 * position of the mouse when the event occurred. 415 * position of the mouse when the event occurred.
415 * 416 *
417 * @param[in] mouse_movement The change in position of the mouse.
418 *
416 * @return A <code>PP_Resource</code> containing the new mouse input event. 419 * @return A <code>PP_Resource</code> containing the new mouse input event.
417 */ 420 */
418 PP_Resource (*Create)(PP_Instance instance, 421 PP_Resource (*Create)(PP_Instance instance,
419 PP_InputEvent_Type type, 422 PP_InputEvent_Type type,
420 PP_TimeTicks time_stamp, 423 PP_TimeTicks time_stamp,
421 uint32_t modifiers, 424 uint32_t modifiers,
422 PP_InputEvent_MouseButton mouse_button, 425 PP_InputEvent_MouseButton mouse_button,
423 const struct PP_Point* mouse_position, 426 const struct PP_Point* mouse_position,
424 int32_t click_count); 427 int32_t click_count,
428 const struct PP_Point* mouse_movement);
425 /** 429 /**
426 * IsMouseInputEvent() determines if a resource is a mouse event. 430 * IsMouseInputEvent() determines if a resource is a mouse event.
427 * 431 *
428 * @param[in] resource A <code>PP_Resource</code> corresponding to an event. 432 * @param[in] resource A <code>PP_Resource</code> corresponding to an event.
429 * 433 *
430 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input 434 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input
431 * event, otherwise <code>PP_FALSE</code>. 435 * event, otherwise <code>PP_FALSE</code>.
432 */ 436 */
433 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); 437 PP_Bool (*IsMouseInputEvent)(PP_Resource resource);
434 /** 438 /**
435 * GetButton() returns the mouse button that generated a mouse down or up 439 * GetButton() returns the mouse button that generated a mouse down or up
436 * event. 440 * event.
437 * 441 *
438 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a 442 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a
439 * mouse event. 443 * mouse event.
440 * 444 *
441 * @return The mouse button associated with mouse down and up events. This 445 * @return The mouse button associated with mouse down and up events. This
442 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, 446 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move,
443 * enter, and leave events, and for all non-mouse events. 447 * enter, and leave events, and for all non-mouse events.
444 */ 448 */
445 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); 449 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event);
446 /** 450 /**
447 * GetPosition() returns the pixel location of a mouse input event. 451 * GetPosition() returns the pixel location of a mouse input event. When
452 * the mouse is locked, it returns the last known mouse position just as
453 * mouse lock was entered.
448 * 454 *
449 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to an 455 * @param[in] mouse_event A <code>PP_Resource</code> corresponding to a
450 * mouse event. 456 * mouse event.
451 * 457 *
452 * @return The point associated with the mouse event, relative to the upper- 458 * @return The point associated with the mouse event, relative to the upper-
453 * left of the instance receiving the event. These values can be negative for 459 * left of the instance receiving the event. These values can be negative for
454 * mouse drags. The return value will be (0, 0) for non-mouse events. 460 * mouse drags. The return value will be (0, 0) for non-mouse events.
455 */ 461 */
456 struct PP_Point (*GetPosition)(PP_Resource mouse_event); 462 struct PP_Point (*GetPosition)(PP_Resource mouse_event);
457 /** 463 /**
458 * TODO(brettw) figure out exactly what this means. 464 * TODO(brettw) figure out exactly what this means.
459 */ 465 */
460 int32_t (*GetClickCount)(PP_Resource mouse_event); 466 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);
461 }; 494 };
462 495
463 /** 496 /**
464 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several 497 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several
465 * functions related to wheel input events. 498 * functions related to wheel input events.
466 */ 499 */
467 struct PPB_WheelInputEvent { 500 struct PPB_WheelInputEvent {
468 /** 501 /**
469 * Create() creates a wheel input event with the given parameters. Normally 502 * Create() creates a wheel input event with the given parameters. Normally
470 * you will get a wheel event passed through the 503 * you will get a wheel event passed through the
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
636 * undefined var. 669 * undefined var.
637 */ 670 */
638 struct PP_Var (*GetCharacterText)(PP_Resource character_event); 671 struct PP_Var (*GetCharacterText)(PP_Resource character_event);
639 }; 672 };
640 /** 673 /**
641 * @} 674 * @}
642 */ 675 */
643 676
644 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ 677 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */
645 678
OLDNEW
« no previous file with comments | « no previous file | ppapi/cpp/input_event.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698