Home | History | Annotate | Download | only in dev
      1 /* Copyright (c) 2012 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 /**
      7  * This file defines the <code>PPB_CursorControl_Dev</code> interface
      8  * implemented by the browser for controlling the cursor.
      9  */
     10 
     11 label Chrome {
     12   M14 = 0.4
     13 };
     14 
     15 [macro="PPB_CURSOR_CONTROL_DEV_INTERFACE"]
     16 interface PPB_CursorControl_Dev {
     17   /**
     18    * Set a cursor.  If "type" is PP_CURSORTYPE_CUSTOM, then "custom_image"
     19    * must be an ImageData resource containing the cursor and "hot_spot" must
     20    * contain the offset within that image that refers to the cursor's position.
     21    */
     22    PP_Bool SetCursor([in] PP_Instance instance,
     23                      [in] PP_CursorType_Dev type,
     24                      [in] PP_Resource custom_image,
     25                      [in] PP_Point hot_spot);
     26 
     27   /**
     28    * This method causes the cursor to be moved to the center of the
     29    * instance and be locked, preventing the user from moving it.
     30    * The cursor is implicitly hidden from the user while locked.
     31    * Cursor lock may only be requested in response to a
     32    * PP_InputEvent_MouseDown, and then only if the event was generated via
     33    * user gesture.
     34    *
     35    * While the cursor is locked, any movement of the mouse will
     36    * generate a PP_InputEvent_Type_MouseMove, whose x and y values
     37    * indicate the position the cursor would have been moved to had
     38    * the cursor not been locked, and had the screen been infinite in size.
     39    *
     40    * The browser may revoke cursor lock for reasons including but not
     41    * limited to the user pressing the ESC key, the user activating
     42    * another program via a reserved keystroke (e.g., ALT+TAB), or
     43    * some other system event.
     44    *
     45    * Returns PP_TRUE if the cursor could be locked, PP_FALSE otherwise.
     46    */
     47   PP_Bool LockCursor([in] PP_Instance instance);
     48 
     49   /**
     50    * Causes the cursor to be unlocked, allowing it to track user
     51    * movement again.
     52    */
     53   PP_Bool UnlockCursor([in] PP_Instance instance);
     54 
     55   /**
     56    * Returns PP_TRUE if the cursor is locked, PP_FALSE otherwise.
     57    */
     58   PP_Bool HasCursorLock([in] PP_Instance instance);
     59 
     60   /**
     61    * Returns PP_TRUE if the cursor can be locked, PP_FALSE otherwise.
     62    */
     63   PP_Bool CanLockCursor([in] PP_Instance instance);
     64 };
     65 
     66