Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Side by Side Diff: ppapi/c/ppb_mouse_cursor.h

Issue 9814015: Add new MouseCursor interface for setting the mouse cursor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ppapi/api/ppb_mouse_cursor.idl ('k') | ppapi/cpp/mouse_cursor.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 /* From ppb_mouse_cursor.idl modified Mon Mar 26 22:05:07 2012. */
7
8 #ifndef PPAPI_C_PPB_MOUSE_CURSOR_H_
9 #define PPAPI_C_PPB_MOUSE_CURSOR_H_
10
11 #include "ppapi/c/pp_bool.h"
12 #include "ppapi/c/pp_instance.h"
13 #include "ppapi/c/pp_macros.h"
14 #include "ppapi/c/pp_point.h"
15 #include "ppapi/c/pp_resource.h"
16 #include "ppapi/c/pp_stdint.h"
17
18 #define PPB_MOUSECURSOR_INTERFACE_1_0 "PPB_MouseCursor;1.0"
19 #define PPB_MOUSECURSOR_INTERFACE PPB_MOUSECURSOR_INTERFACE_1_0
20
21 /**
22 * @file
23 * This file defines the <code>PPB_MouseCursor</code> interface for setting
24 * the mouse cursor.
25 */
26
27
28 /**
29 * @addtogroup Enums
30 * @{
31 */
32 /**
33 * The <code>PP_MouseCursor_Type</code> enumeration lists the available stock
34 * cursor types.
35 */
36 enum PP_MouseCursor_Type {
37 PP_MOUSECURSOR_TYPE_CUSTOM = -1,
38 PP_MOUSECURSOR_TYPE_POINTER = 0,
39 PP_MOUSECURSOR_TYPE_CROSS = 1,
40 PP_MOUSECURSOR_TYPE_HAND = 2,
41 PP_MOUSECURSOR_TYPE_IBEAM = 3,
42 PP_MOUSECURSOR_TYPE_WAIT = 4,
43 PP_MOUSECURSOR_TYPE_HELP = 5,
44 PP_MOUSECURSOR_TYPE_EASTRESIZE = 6,
45 PP_MOUSECURSOR_TYPE_NORTHRESIZE = 7,
46 PP_MOUSECURSOR_TYPE_NORTHEASTRESIZE = 8,
47 PP_MOUSECURSOR_TYPE_NORTHWESTRESIZE = 9,
48 PP_MOUSECURSOR_TYPE_SOUTHRESIZE = 10,
49 PP_MOUSECURSOR_TYPE_SOUTHEASTRESIZE = 11,
50 PP_MOUSECURSOR_TYPE_SOUTHWESTRESIZE = 12,
51 PP_MOUSECURSOR_TYPE_WESTRESIZE = 13,
52 PP_MOUSECURSOR_TYPE_NORTHSOUTHRESIZE = 14,
53 PP_MOUSECURSOR_TYPE_EASTWESTRESIZE = 15,
54 PP_MOUSECURSOR_TYPE_NORTHEASTSOUTHWESTRESIZE = 16,
55 PP_MOUSECURSOR_TYPE_NORTHWESTSOUTHEASTRESIZE = 17,
56 PP_MOUSECURSOR_TYPE_COLUMNRESIZE = 18,
57 PP_MOUSECURSOR_TYPE_ROWRESIZE = 19,
58 PP_MOUSECURSOR_TYPE_MIDDLEPANNING = 20,
59 PP_MOUSECURSOR_TYPE_EASTPANNING = 21,
60 PP_MOUSECURSOR_TYPE_NORTHPANNING = 22,
61 PP_MOUSECURSOR_TYPE_NORTHEASTPANNING = 23,
62 PP_MOUSECURSOR_TYPE_NORTHWESTPANNING = 24,
63 PP_MOUSECURSOR_TYPE_SOUTHPANNING = 25,
64 PP_MOUSECURSOR_TYPE_SOUTHEASTPANNING = 26,
65 PP_MOUSECURSOR_TYPE_SOUTHWESTPANNING = 27,
66 PP_MOUSECURSOR_TYPE_WESTPANNING = 28,
67 PP_MOUSECURSOR_TYPE_MOVE = 29,
68 PP_MOUSECURSOR_TYPE_VERTICALTEXT = 30,
69 PP_MOUSECURSOR_TYPE_CELL = 31,
70 PP_MOUSECURSOR_TYPE_CONTEXTMENU = 32,
71 PP_MOUSECURSOR_TYPE_ALIAS = 33,
72 PP_MOUSECURSOR_TYPE_PROGRESS = 34,
73 PP_MOUSECURSOR_TYPE_NODROP = 35,
74 PP_MOUSECURSOR_TYPE_COPY = 36,
75 PP_MOUSECURSOR_TYPE_NONE = 37,
76 PP_MOUSECURSOR_TYPE_NOTALLOWED = 38,
77 PP_MOUSECURSOR_TYPE_ZOOMIN = 39,
78 PP_MOUSECURSOR_TYPE_ZOOMOUT = 40,
79 PP_MOUSECURSOR_TYPE_GRAB = 41,
80 PP_MOUSECURSOR_TYPE_GRABBING = 42
81 };
82 PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_MouseCursor_Type, 4);
83 /**
84 * @}
85 */
86
87 /**
88 * @addtogroup Interfaces
89 * @{
90 */
91 /**
92 * The <code>PPB_MouseCursor</code> allows setting the mouse cursor.
93 */
94 struct PPB_MouseCursor_1_0 {
95 /**
96 * Sets the given mouse cursor. The mouse cursor will be in effect whenever
97 * the mouse is over the given instance until it is set again by another
98 * call. Note that you can hide the mouse cursor by setting it to the
99 * <code>PP_MOUSECURSOR_TYPE_NONE</code> type.
100 *
101 * This function allows setting both system defined mouse cursors and
102 * custom cursors. To set a system-defined cursor, pass the type you want
103 * and set the custom image to 0 and the hot spot to NULL. To set a custom
104 * cursor, set the type to <code>PP_MOUSECURSOR_TYPE_CUSTOM</code> and
105 * specify your image and hot spot.
106 *
107 * @param[in] instance A <code>PP_Instance</code> indentifying the instance
108 * that the mouse cursor will affect.
109 *
110 * @param[in] type A <code>PP_MouseCursor_Type</code> identifying the type of
111 * mouse cursor to show.
112 *
113 * @param[in] image A <code>PPB_ImageData</code> resource identifying the
114 * custom image to set when the type is
115 * <code>PP_MOUSECURSOR_TYPE_CUSTOM</code>. The image must be less than 32
116 * pixels in each direction and must be of the system's native image format.
117 * When you are specifying a predefined cursor, this parameter must be 0.
118 *
119 * @param[in] hot_spot When setting a custom cursor, this idenfifies the
120 * pixel position within the given image of the "hot spot" of the cursor.
121 * When specifying a stock cursor, this parameter is ignored.
122 *
123 * @return PP_TRUE on success, or PP_FALSE if the instance or cursor type
124 * is invalid, or if the image is too large.
125 */
126 PP_Bool (*SetCursor)(PP_Instance instance,
127 enum PP_MouseCursor_Type type,
128 PP_Resource image,
129 const struct PP_Point* hot_spot);
130 };
131
132 typedef struct PPB_MouseCursor_1_0 PPB_MouseCursor;
133 /**
134 * @}
135 */
136
137 #endif /* PPAPI_C_PPB_MOUSE_CURSOR_H_ */
138
OLDNEW
« no previous file with comments | « ppapi/api/ppb_mouse_cursor.idl ('k') | ppapi/cpp/mouse_cursor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698