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 |
| 6 /* From dev/ppb_cursor_control_dev.idl modified Thu Nov 17 14:24:28 2011. */ |
| 7 |
5 #ifndef PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ | 8 #ifndef PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ |
6 #define PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ | 9 #define PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ |
7 | 10 |
| 11 #include "ppapi/c/dev/pp_cursor_type_dev.h" |
8 #include "ppapi/c/pp_bool.h" | 12 #include "ppapi/c/pp_bool.h" |
9 #include "ppapi/c/dev/pp_cursor_type_dev.h" | |
10 #include "ppapi/c/pp_instance.h" | 13 #include "ppapi/c/pp_instance.h" |
| 14 #include "ppapi/c/pp_macros.h" |
11 #include "ppapi/c/pp_point.h" | 15 #include "ppapi/c/pp_point.h" |
12 #include "ppapi/c/pp_resource.h" | 16 #include "ppapi/c/pp_resource.h" |
| 17 #include "ppapi/c/pp_stdint.h" |
13 | 18 |
14 #define PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 "PPB_CursorControl(Dev);0.4" | 19 #define PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 "PPB_CursorControl(Dev);0.4" |
15 #define PPB_CURSOR_CONTROL_DEV_INTERFACE PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 | 20 #define PPB_CURSOR_CONTROL_DEV_INTERFACE PPB_CURSOR_CONTROL_DEV_INTERFACE_0_4 |
16 | 21 |
| 22 /** |
| 23 * @file |
| 24 * This file defines the <code>PPB_CursorControl_Dev</code> interface |
| 25 * implemented by the browser for controlling the cursor. |
| 26 */ |
| 27 |
| 28 |
| 29 /** |
| 30 * @addtogroup Interfaces |
| 31 * @{ |
| 32 */ |
17 struct PPB_CursorControl_Dev { | 33 struct PPB_CursorControl_Dev { |
18 // Set a cursor. If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image" | 34 /** |
19 // must be an ImageData resource containing the cursor and "hot_spot" must | 35 * Set a cursor. If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image" |
20 // contain the offset within that image that refers to the cursor's position. | 36 * must be an ImageData resource containing the cursor and "hot_spot" must |
| 37 * contain the offset within that image that refers to the cursor's position. |
| 38 */ |
21 PP_Bool (*SetCursor)(PP_Instance instance, | 39 PP_Bool (*SetCursor)(PP_Instance instance, |
22 enum PP_CursorType_Dev type, | 40 enum PP_CursorType_Dev type, |
23 PP_Resource custom_image, | 41 PP_Resource custom_image, |
24 const struct PP_Point* hot_spot); | 42 const struct PP_Point* hot_spot); |
25 | 43 /** |
26 // This method causes the cursor to be moved to the center of the | 44 * This method causes the cursor to be moved to the center of the |
27 // instance and be locked, preventing the user from moving it. | 45 * instance and be locked, preventing the user from moving it. |
28 // The cursor is implicitly hidden from the user while locked. | 46 * The cursor is implicitly hidden from the user while locked. |
29 // Cursor lock may only be requested in response to a | 47 * Cursor lock may only be requested in response to a |
30 // PP_InputEvent_MouseDown, and then only if the event was generated via | 48 * PP_InputEvent_MouseDown, and then only if the event was generated via |
31 // user gesture. | 49 * user gesture. |
32 // | 50 * |
33 // While the cursor is locked, any movement of the mouse will | 51 * While the cursor is locked, any movement of the mouse will |
34 // generate a PP_InputEvent_Type_MouseMove, whose x and y values | 52 * generate a PP_InputEvent_Type_MouseMove, whose x and y values |
35 // indicate the position the cursor would have been moved to had | 53 * indicate the position the cursor would have been moved to had |
36 // the cursor not been locked, and had the screen been infinite in size. | 54 * the cursor not been locked, and had the screen been infinite in size. |
37 // | 55 * |
38 // The browser may revoke cursor lock for reasons including but not | 56 * The browser may revoke cursor lock for reasons including but not |
39 // limited to the user pressing the ESC key, the user activating | 57 * limited to the user pressing the ESC key, the user activating |
40 // another program via a reserved keystroke (e.g., ALT+TAB), or | 58 * another program via a reserved keystroke (e.g., ALT+TAB), or |
41 // some other system event. | 59 * some other system event. |
42 // | 60 * |
43 // Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise. | 61 * Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise. |
44 PP_Bool (*LockCursor)(PP_Instance); | 62 */ |
45 | 63 PP_Bool (*LockCursor)(PP_Instance instance); |
46 // Causes the cursor to be unlocked, allowing it to track user | 64 /** |
47 // movement again. | 65 * Causes the cursor to be unlocked, allowing it to track user |
48 PP_Bool (*UnlockCursor)(PP_Instance); | 66 * movement again. |
49 | 67 */ |
50 // Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. | 68 PP_Bool (*UnlockCursor)(PP_Instance instance); |
51 PP_Bool (*HasCursorLock)(PP_Instance); | 69 /** |
52 | 70 * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise. |
53 // Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. | 71 */ |
54 PP_Bool (*CanLockCursor)(PP_Instance); | 72 PP_Bool (*HasCursorLock)(PP_Instance instance); |
| 73 /** |
| 74 * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise. |
| 75 */ |
| 76 PP_Bool (*CanLockCursor)(PP_Instance instance); |
55 }; | 77 }; |
| 78 /** |
| 79 * @} |
| 80 */ |
56 | 81 |
57 #endif /* PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ */ | 82 #endif /* PPAPI_C_DEV_PPB_CURSOR_CONTROL_DEV_H_ */ |
58 | 83 |
OLD | NEW |