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

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: Removed comments for the 1.0 interface. Created 9 years, 4 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 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"
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 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 * @param[in] modifiers A bit field combination of the 404 * @param[in] modifiers A bit field combination of the
404 * <code>PP_InputEvent_Modifier</code> flags. 405 * <code>PP_InputEvent_Modifier</code> flags.
405 * 406 *
406 * @param[in] mouse_button The button that changed for mouse down or up 407 * @param[in] mouse_button The button that changed for mouse down or up
407 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for 408 * events. This value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for
408 * mouse move, enter, and leave events. 409 * mouse move, enter, and leave events.
409 * 410 *
410 * @param[in] mouse_position A <code>Point</code> containing the x and y 411 * @param[in] mouse_position A <code>Point</code> containing the x and y
411 * position of the mouse when the event occurred. 412 * position of the mouse when the event occurred.
412 * 413 *
414 * @param[in] mouse_movement The change in position of the mouse.
415 *
413 * @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.
414 */ 417 */
415 PP_Resource (*Create)(PP_Instance instance, 418 PP_Resource (*Create)(PP_Instance instance,
416 PP_InputEvent_Type type, 419 PP_InputEvent_Type type,
417 PP_TimeTicks time_stamp, 420 PP_TimeTicks time_stamp,
418 uint32_t modifiers, 421 uint32_t modifiers,
419 PP_InputEvent_MouseButton mouse_button, 422 PP_InputEvent_MouseButton mouse_button,
420 const struct PP_Point* mouse_position, 423 const struct PP_Point* mouse_position,
421 int32_t click_count); 424 int32_t click_count,
425 const struct PP_Point* mouse_movement);
422 /** 426 /**
423 * IsMouseInputEvent() determines if a resource is a mouse event. 427 * IsMouseInputEvent() determines if a resource is a mouse event.
424 * 428 *
425 * @param[in] resource A <code>PP_Resource</code> containing the event. 429 * @param[in] resource A <code>PP_Resource</code> containing the event.
426 * 430 *
427 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input 431 * @return <code>PP_TRUE</code> if the given resource is a valid mouse input
428 * event, otherwise <code>PP_FALSE</code>. 432 * event, otherwise <code>PP_FALSE</code>.
429 */ 433 */
430 PP_Bool (*IsMouseInputEvent)(PP_Resource resource); 434 PP_Bool (*IsMouseInputEvent)(PP_Resource resource);
431 /** 435 /**
432 * GetButton() returns the mouse button that generated a mouse down or up 436 * GetButton() returns the mouse button that generated a mouse down or up
433 * event. 437 * event.
434 * 438 *
435 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse 439 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse
436 * event. 440 * event.
437 * 441 *
438 * @return The mouse button associated with mouse down and up events. This 442 * @return The mouse button associated with mouse down and up events. This
439 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move, 443 * value will be <code>PP_EVENT_MOUSEBUTTON_NONE</code> for mouse move,
440 * enter, and leave events, and for all non-mouse events. 444 * enter, and leave events, and for all non-mouse events.
441 */ 445 */
442 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event); 446 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event);
443 /** 447 /**
444 * GetPosition() returns the pixel location of a mouse input event. 448 * GetPosition() returns the pixel location of a mouse input event. When
449 * the cursor lock is enabled, it returns the center of the associated plugin
450 * instance.
scheib 2011/08/30 17:44:42 spec has been moving, we're deciding to report the
yzshen1 2011/08/30 22:15:55 Done.
445 * 451 *
446 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse 452 * @param[in] mouse_event A <code>PP_Resource</code> containing the mouse
447 * event. 453 * event.
448 * 454 *
449 * @return The point associated with the mouse event, relative to the upper- 455 * @return The point associated with the mouse event, relative to the upper-
450 * left of the instance receiving the event. These values can be negative for 456 * 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. 457 * mouse drags. The return value will be (0, 0) for non-mouse events.
452 */ 458 */
453 struct PP_Point (*GetPosition)(PP_Resource mouse_event); 459 struct PP_Point (*GetPosition)(PP_Resource mouse_event);
454 /** 460 /**
455 * TODO(brettw) figure out exactly what this means. 461 * TODO(brettw) figure out exactly what this means.
456 */ 462 */
457 int32_t (*GetClickCount)(PP_Resource mouse_event); 463 int32_t (*GetClickCount)(PP_Resource mouse_event);
464 /**
465 * Returns the change in position of the mouse. When the cursor lock is
466 * enabled, although the mouse position doesn't actually change, this function
467 * continues to provide movement information as when the cursor is unlocked.
468 *
469 * @return The change in position of the mouse, relative to the previous
470 * position.
471 */
472 struct PP_Point (*GetMovement)(PP_Resource mouse_event);
473 };
474
475 struct PPB_MouseInputEvent_1_0 {
476 PP_Resource (*Create)(PP_Instance instance,
477 PP_InputEvent_Type type,
478 PP_TimeTicks time_stamp,
479 uint32_t modifiers,
480 PP_InputEvent_MouseButton mouse_button,
481 const struct PP_Point* mouse_position,
482 int32_t click_count);
483 PP_Bool (*IsMouseInputEvent)(PP_Resource resource);
484 PP_InputEvent_MouseButton (*GetButton)(PP_Resource mouse_event);
485 struct PP_Point (*GetPosition)(PP_Resource mouse_event);
486 int32_t (*GetClickCount)(PP_Resource mouse_event);
458 }; 487 };
459 488
460 /** 489 /**
461 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several 490 * The <code>PPB_WheelIputEvent</code> interface contains pointers to several
462 * functions related to wheel input events. 491 * functions related to wheel input events.
463 */ 492 */
464 struct PPB_WheelInputEvent { 493 struct PPB_WheelInputEvent {
465 /** 494 /**
466 * Create() creates a wheel input event with the given parameters. Normally 495 * Create() creates a wheel input event with the given parameters. Normally
467 * you will get a wheel event passed through the 496 * you will get a wheel event passed through the
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 * undefined var. 661 * undefined var.
633 */ 662 */
634 struct PP_Var (*GetCharacterText)(PP_Resource character_event); 663 struct PP_Var (*GetCharacterText)(PP_Resource character_event);
635 }; 664 };
636 /** 665 /**
637 * @} 666 * @}
638 */ 667 */
639 668
640 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */ 669 #endif /* PPAPI_C_PPB_INPUT_EVENT_H_ */
641 670
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