Pepper_31_C_interfaces
ppb_mouse_cursor.h
Go to the documentation of this file.
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 Thu Mar 28 10:11:32 2013. */
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  */
81 };
83 /**
84  * @}
85  */
86 
87 /**
88  * @addtogroup Interfaces
89  * @{
90  */
91 /**
92  * The <code>PPB_MouseCursor</code> allows setting the mouse cursor.
93  */
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> identifying 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 identifies 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  */
127  enum PP_MouseCursor_Type type,
128  PP_Resource image,
129  const struct PP_Point* hot_spot);
130 };
131 
133 /**
134  * @}
135  */
136 
137 #endif /* PPAPI_C_PPB_MOUSE_CURSOR_H_ */
138 
PP_MouseCursor_Type
PP_COMPILE_ASSERT_ENUM_SIZE_IN_BYTES(PP_MouseCursor_Type, 4)
int32_t PP_Resource
Definition: pp_resource.h:40
PP_Bool(* SetCursor)(PP_Instance instance, enum PP_MouseCursor_Type type, PP_Resource image, const struct PP_Point *hot_spot)
int32_t PP_Instance
Definition: pp_instance.h:34
PP_Bool
Definition: pp_bool.h:30