/**
  * Sets the given mouse cursor. The mouse cursor will be in effect whenever
  * the mouse is over the given instance until it is set again by another
  * call. Note that you can hide the mouse cursor by setting it to the
  * <code>PP_MOUSECURSOR_TYPE_NONE</code> type.
  *
  * This function allows setting both system defined mouse cursors and
  * custom cursors. To set a system-defined cursor, pass the type you want
  * and set the custom image to 0 and the hot spot to NULL. To set a custom
  * cursor, set the type to <code>PP_MOUSECURSOR_TYPE_CUSTOM</code> and
  * specify your image and hot spot.
  *
  * @param[in] instance A <code>PP_Instance</code> identifying the instance
  * that the mouse cursor will affect.
  *
  * @param[in] type A <code>PP_MouseCursor_Type</code> identifying the type of
  * mouse cursor to show.
  *
  * @param[in] image A <code>PPB_ImageData</code> resource identifying the
  * custom image to set when the type is
  * <code>PP_MOUSECURSOR_TYPE_CUSTOM</code>. The image must be less than 32
  * pixels in each direction and must be of the system's native image format.
  * When you are specifying a predefined cursor, this parameter must be 0.
  *
  * @param[in] hot_spot When setting a custom cursor, this identifies the
  * pixel position within the given image of the "hot spot" of the cursor.
  * When specifying a stock cursor, this parameter is ignored.
  *
  * @return PP_TRUE on success, or PP_FALSE if the instance or cursor type
  * is invalid, or if the image is too large.
  */
 public static PPBool SetCursor(PPInstance instance,
                                PPMouseCursorType type,
                                PPResource image,
                                PPPoint hot_spot)
 {
     return(_SetCursor(instance, type, image, hot_spot));
 }
Exemple #2
0
        private void OnHandleMessage(object sender, Var varMessage)
        {
            if (!varMessage.IsInt)
            {
                Console.WriteLine("Unexpected message.");
            }

            PPMouseCursorType cursor = (PPMouseCursorType)varMessage.AsInt();

            if (cursor == PPMouseCursorType.Custom)
            {
                var hotSpot = new PPPoint(16, 16);
                SetCursor(cursor, customCursor, hotSpot);
            }
            else
            {
                SetCursor(cursor);
            }
        }
 extern static PPBool _SetCursor(PPInstance instance,
                                 PPMouseCursorType type,
                                 PPResource image,
                                 PPPoint hot_spot);