File: mouse_cursor.h

package info (click to toggle)
chromium 138.0.7204.183-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 6,071,908 kB
  • sloc: cpp: 34,937,088; ansic: 7,176,967; javascript: 4,110,704; python: 1,419,953; asm: 946,768; xml: 739,971; pascal: 187,324; sh: 89,623; perl: 88,663; objc: 79,944; sql: 50,304; cs: 41,786; fortran: 24,137; makefile: 21,806; php: 13,980; tcl: 13,166; yacc: 8,925; ruby: 7,485; awk: 3,720; lisp: 3,096; lex: 1,327; ada: 727; jsp: 228; sed: 36
file content (56 lines) | stat: -rw-r--r-- 2,343 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2012 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PPAPI_CPP_MOUSE_CURSOR_H_
#define PPAPI_CPP_MOUSE_CURSOR_H_

#include "ppapi/c/ppb_mouse_cursor.h"
#include "ppapi/cpp/image_data.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/point.h"

namespace pp {

class MouseCursor {
 public:
  /// 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 a default-constructor ImageData object.
  /// 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 handle 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. See <code>ppapi/c/ppb_mouse_cursor.h</code>.
  ///
  /// @param[in] image A <code>ImageData</code> object 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 should be a
  /// default-constructed ImageData.
  ///
  /// @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 true on success, or false if the instance or cursor type
  /// was invalid or if the image was too large.
  static bool SetCursor(const InstanceHandle& instance,
                        PP_MouseCursor_Type type,
                        const ImageData& image = ImageData(),
                        const Point& hot_spot = Point(0, 0));
};

}  // namespace pp

#endif  // PPAPI_CPP_MOUSE_CURSOR_H_