| OLD | NEW |
| (Empty) |
| 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 | |
| 3 * found in the LICENSE file. | |
| 4 */ | |
| 5 | |
| 6 /* From dev/ppb_mouse_lock_dev.idl modified Tue Sep 6 16:06:47 2011. */ | |
| 7 | |
| 8 #ifndef PPAPI_C_DEV_PPB_MOUSE_LOCK_DEV_H_ | |
| 9 #define PPAPI_C_DEV_PPB_MOUSE_LOCK_DEV_H_ | |
| 10 | |
| 11 #include "ppapi/c/pp_completion_callback.h" | |
| 12 #include "ppapi/c/pp_instance.h" | |
| 13 #include "ppapi/c/pp_macros.h" | |
| 14 #include "ppapi/c/pp_stdint.h" | |
| 15 | |
| 16 #define PPB_MOUSELOCK_DEV_INTERFACE_0_1 "PPB_MouseLock(Dev);0.1" | |
| 17 #define PPB_MOUSELOCK_DEV_INTERFACE PPB_MOUSELOCK_DEV_INTERFACE_0_1 | |
| 18 | |
| 19 /** | |
| 20 * @file | |
| 21 * This file defines the <code>PPB_MouseLock_Dev</code> interface. | |
| 22 */ | |
| 23 | |
| 24 | |
| 25 /** | |
| 26 * @addtogroup Interfaces | |
| 27 * @{ | |
| 28 */ | |
| 29 /** | |
| 30 * The <code>PPB_MouseLock_Dev</code> interface is implemented by the browser. | |
| 31 * It provides a way of locking the target of mouse events to a single plugin | |
| 32 * instance and removing the cursor from view. This is a useful input mode for | |
| 33 * certain classes of applications, especially first person perspective 3D | |
| 34 * applications and 3D modelling software. | |
| 35 */ | |
| 36 struct PPB_MouseLock_Dev { | |
| 37 /** | |
| 38 * Requests the mouse to be locked. The browser will permit mouse lock only | |
| 39 * while the tab is in fullscreen mode. | |
| 40 * | |
| 41 * While the mouse is locked, the cursor is implicitly hidden from the user. | |
| 42 * Any movement of the mouse will generate a | |
| 43 * <code>PP_INPUTEVENT_TYPE_MOUSEMOVE</code>. The <code>GetPosition</code> of | |
| 44 * <code>PPB_MouseInputEvent</code> reports the last known mouse position just | |
| 45 * as mouse lock was entered; while the <code>GetMovement</code> provides | |
| 46 * relative movement information, which indicates what the change in position | |
| 47 * of the mouse would be had it not been locked. | |
| 48 * | |
| 49 * The browser may revoke mouse lock for reasons including but not limited to | |
| 50 * the user pressing the ESC key, the user activating another program via a | |
| 51 * reserved keystroke (e.g., ALT+TAB), or some other system event. | |
| 52 * | |
| 53 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 54 * of a module. | |
| 55 * @param[in] callback A <code>PP_CompletionCallback</code> to be called upon | |
| 56 * completion. | |
| 57 * | |
| 58 * @return An int32_t containing an error code from <code>pp_errors.h</code>. | |
| 59 */ | |
| 60 int32_t (*LockMouse)(PP_Instance instance, | |
| 61 struct PP_CompletionCallback callback); | |
| 62 /** | |
| 63 * Causes the mouse to be unlocked, allowing it to track user movement again. | |
| 64 * This is an asynchronous operation. The plugin instance will be notified via | |
| 65 * the <code>PPP_MouseLock</code> interface when it has lost the mouse lock. | |
| 66 * | |
| 67 * @param[in] instance A <code>PP_Instance</code> identifying one instance | |
| 68 * of a module. | |
| 69 */ | |
| 70 void (*UnlockMouse)(PP_Instance instance); | |
| 71 }; | |
| 72 /** | |
| 73 * @} | |
| 74 */ | |
| 75 | |
| 76 #endif /* PPAPI_C_DEV_PPB_MOUSE_LOCK_DEV_H_ */ | |
| 77 | |
| OLD | NEW |