OLD | NEW |
---|---|
(Empty) | |
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_MouseCursor</code> interface for setting | |
8 * the mouse cursor. | |
9 */ | |
10 | |
11 label Chrome { | |
12 M19 = 1.0 | |
13 }; | |
14 | |
15 /** | |
16 * The <code>PP_MouseCursor_Type</code> enumeration lists the available stock | |
17 * cursor types. | |
18 */ | |
19 [assert_size(4), notypedef] | |
20 enum PP_MouseCursor_Type { | |
21 PP_MOUSECURSOR_TYPE_CUSTOM = -1, | |
22 PP_MOUSECURSOR_TYPE_POINTER = 0, | |
23 PP_MOUSECURSOR_TYPE_CROSS = 1, | |
24 PP_MOUSECURSOR_TYPE_HAND = 2, | |
25 PP_MOUSECURSOR_TYPE_IBEAM = 3, | |
26 PP_MOUSECURSOR_TYPE_WAIT = 4, | |
27 PP_MOUSECURSOR_TYPE_HELP = 5, | |
28 PP_MOUSECURSOR_TYPE_EASTRESIZE = 6, | |
29 PP_MOUSECURSOR_TYPE_NORTHRESIZE = 7, | |
30 PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE = 8, | |
31 PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE = 9, | |
32 PP_MOUSECURSOR_TYPE_SOUTHRESIZE = 10, | |
33 PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE = 11, | |
34 PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE = 12, | |
35 PP_MOUSECURSOR_TYPE_WESTRESIZE = 13, | |
36 PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE = 14, | |
37 PP_MOUSECURSOR_TYPE_EASTWESTRESIZE = 15, | |
38 PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE = 16, | |
39 PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE = 17, | |
40 PP_MOUSECURSOR_TYPE_COLUMNRESIZE = 18, | |
41 PP_MOUSECURSOR_TYPE_ROWRESIZE = 19, | |
42 PP_MOUSECURSOR_TYPE_MIDDLEPANNING = 20, | |
43 PP_MOUSECURSOR_TYPE_EASTPANNING = 21, | |
44 PP_MOUSECURSOR_TYPE_NORTHPANNING = 22, | |
45 PP_MOUSECURSOR_TYPE_NORTHEASTPANNING = 23, | |
46 PP_MOUSECURSOR_TYPE_NORTHWESTPANNING = 24, | |
47 PP_MOUSECURSOR_TYPE_SOUTHPANNING = 25, | |
48 PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING = 26, | |
49 PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING = 27, | |
50 PP_MOUSECURSOR_TYPE_WESTPANNING = 28, | |
51 PP_MOUSECURSOR_TYPE_MOVE = 29, | |
52 PP_MOUSECURSOR_TYPE_VERTICALTEXT = 30, | |
53 PP_MOUSECURSOR_TYPE_CELL = 31, | |
54 PP_MOUSECURSOR_TYPE_CONTEXTMENU = 32, | |
55 PP_MOUSECURSOR_TYPE_ALIAS = 33, | |
56 PP_MOUSECURSOR_TYPE_PROGRESS = 34, | |
57 PP_MOUSECURSOR_TYPE_NODROP = 35, | |
58 PP_MOUSECURSOR_TYPE_COPY = 36, | |
59 PP_MOUSECURSOR_TYPE_NONE = 37, | |
60 PP_MOUSECURSOR_TYPE_NOTALLOWED = 38, | |
61 PP_MOUSECURSOR_TYPE_ZOOMIN = 39, | |
62 PP_MOUSECURSOR_TYPE_ZOOMOUT = 40, | |
63 PP_MOUSECURSOR_TYPE_GRAB = 41, | |
64 PP_MOUSECURSOR_TYPE_GRABBING = 42 | |
65 }; | |
66 | |
67 /** | |
68 * The <code>PPB_MouseCursor</code> allows setting the mouse cursor. | |
69 */ | |
70 interface PPB_MouseCursor { | |
71 /** | |
72 * Sets the given mouse cursor. The mouse cursor will be in effect whenever | |
73 * the mouse is over the given instance until it is set again by another | |
74 * call. Note that you can hide the mouse cursor by setting it to the | |
75 * <code>PP_MOUSECURSOR_TYPE_NONE</code> type. | |
76 * | |
77 * This function allows setting both system defined mouse cursors and | |
78 * custom cursors. To set a system-defined cursor, pass the type you want | |
79 * and set the custom image to 0 and the hot spot to NULL. To set a custom | |
80 * cursor, set the type to <code>PP_MOUSECURSOR_TYPE_CUSTOM</code> and | |
81 * specify your image and hot spot. | |
82 * | |
83 * @param[in] instance A <code>PP_Instance</code> indentifying the instance | |
84 * that the mouse cursor will affect. | |
85 * | |
86 * @param[in] type A <code>PP_MouseCursor_Type</code> identifying the type of | |
87 * mouse cursor to show. | |
88 * | |
89 * @param[in] image A <code>PPB_ImageData</code> resource identifying the | |
90 * custom image to set when the type is | |
91 * <code>PP_MOUSECURSOR_TYPE_CUSTOM</code>. The image must be less than 32 | |
92 * pixels in each direction and must be of the system's native image format. | |
93 * When you are specifying a predefined cursor, this parameter must be 0. | |
94 * | |
95 * @param[in] hot_spot When setting a custom cursor, this idenfifies the | |
96 * pixel position within the given image of the "hot spot" of the cursor. | |
97 * When specifying a stock cursor, this parameter is ignored. | |
98 * | |
99 * @return PP_TRUE on success, or PP_FALSE if the instance or cursor type | |
100 * was invalid, or if the image too large. | |
dmichael (off chromium)
2012/03/26 17:43:17
nit: image "is" too large
| |
101 */ | |
102 PP_Bool SetCursor([in] PP_Instance instance, | |
dmichael (off chromium)
2012/03/26 17:43:17
This could have been 2 functions, maybe
SetCursor(
brettw
2012/03/26 17:59:30
A previous version of this patch actually did what
dmichael (off chromium)
2012/03/27 15:48:44
I can live with it either way. The two behaviors s
brettw
2012/03/27 16:10:47
It might be nice, but I don't think it's worth the
| |
103 [in] PP_MouseCursor_Type type, | |
104 [in] PP_Resource image, | |
105 [in] PP_Point hot_spot); | |
106 }; | |
OLD | NEW |