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