OLD | NEW |
---|---|
1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2013 The Chromium Authors. All rights reserved. |
2 * Use of this source code is governed by a BSD-style license that can be | 2 * Use of this source code is governed by a BSD-style license that can be |
3 * found in the LICENSE file. | 3 * found in the LICENSE file. |
4 */ | 4 */ |
5 | 5 |
6 /* From dev/ppb_var_array_dev.idl modified Thu Mar 14 13:41:46 2013. */ | 6 /* From ppb_var_array.idl modified Sat Jun 8 23:00:56 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_ | 8 #ifndef PPAPI_C_PPB_VAR_ARRAY_H_ |
9 #define PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_ | 9 #define PPAPI_C_PPB_VAR_ARRAY_H_ |
10 | 10 |
11 #include "ppapi/c/pp_bool.h" | 11 #include "ppapi/c/pp_bool.h" |
12 #include "ppapi/c/pp_macros.h" | 12 #include "ppapi/c/pp_macros.h" |
13 #include "ppapi/c/pp_stdint.h" | 13 #include "ppapi/c/pp_stdint.h" |
14 #include "ppapi/c/pp_var.h" | 14 #include "ppapi/c/pp_var.h" |
15 | 15 |
16 #define PPB_VAR_ARRAY_DEV_INTERFACE_0_1 "PPB_VarArray(Dev);0.1" | 16 #define PPB_VAR_ARRAY_INTERFACE_1_0 "PPB_VarArray;1.0" |
17 #define PPB_VAR_ARRAY_DEV_INTERFACE PPB_VAR_ARRAY_DEV_INTERFACE_0_1 | 17 #define PPB_VAR_ARRAY_INTERFACE PPB_VAR_ARRAY_INTERFACE_1_0 |
18 | 18 |
19 /** | 19 /** |
20 * @file | 20 * @file |
21 * This file defines the <code>PPB_VarArray_Dev</code> struct providing | 21 * This file defines the <code>PPB_VarArray</code> struct providing |
22 * a way to interact with array vars. | 22 * a way to interact with array vars. |
23 */ | 23 */ |
24 | 24 |
25 | 25 |
26 /** | 26 /** |
27 * @addtogroup Interfaces | 27 * @addtogroup Interfaces |
28 * @{ | 28 * @{ |
29 */ | 29 */ |
30 struct PPB_VarArray_Dev_0_1 { | 30 struct PPB_VarArray_1_0 { |
31 /** | 31 /** |
32 * Creates an array var, i.e., a <code>PP_Var</code> with type set to | 32 * Creates an array var, i.e., a <code>PP_Var</code> with type set to |
33 * <code>PP_VARTYPE_ARRAY</code>. The array length is set to 0. | 33 * <code>PP_VARTYPE_ARRAY</code>. The array length is set to 0. |
34 * | 34 * |
35 * @return An empty array var, whose reference count is set to 1 on behalf of | 35 * @return An empty array var, whose reference count is set to 1 on behalf of |
36 * the caller. | 36 * the caller. |
37 */ | 37 */ |
38 struct PP_Var (*Create)(void); | 38 struct PP_Var (*Create)(void); |
39 /** | 39 /** |
40 * Gets an element from the array. | 40 * Gets an element from the array. |
41 * | 41 * |
42 * @param[in] array An array var. | 42 * @param[in] array An array var. |
43 * @param[in] index An index indicating which element to return. | 43 * @param[in] index An index indicating which element to return. |
44 * | 44 * |
45 * @return The element at the specified position. The reference count is | 45 * @return The element at the specified position. The reference count of the |
46 * incremented on behalf of the caller. If <code>index</code> is larger than | 46 * element returned is incremented on behalf of the caller. If |
47 * or equal to the array length, an undefined var is returned. | 47 * <code>index</code> is larger than or equal to the array length, an |
48 * undefined var is returned. | |
48 */ | 49 */ |
49 struct PP_Var (*Get)(struct PP_Var array, uint32_t index); | 50 struct PP_Var (*Get)(struct PP_Var array, uint32_t index); |
50 /** | 51 /** |
51 * Sets the value of an element in the array. | 52 * Sets the value of an element in the array. |
52 * | 53 * |
53 * @param[in] array An array var. | 54 * @param[in] array An array var. |
54 * @param[in] index An index indicating which element to modify. If | 55 * @param[in] index An index indicating which element to modify. If |
55 * <code>index</code> is larger than or equal to the array length, the length | 56 * <code>index</code> is larger than or equal to the array length, the length |
56 * is updated to be <code>index</code> + 1. Any position in the array that | 57 * is updated to be <code>index</code> + 1. Any position in the array that |
57 * hasn't been set before is set to undefined, i.e., <code>PP_Var</code> of | 58 * hasn't been set before is set to undefined, i.e., <code>PP_Var</code> of |
(...skipping 11 matching lines...) Expand all Loading... | |
69 * | 70 * |
70 * @return The array length. | 71 * @return The array length. |
71 */ | 72 */ |
72 uint32_t (*GetLength)(struct PP_Var array); | 73 uint32_t (*GetLength)(struct PP_Var array); |
73 /** | 74 /** |
74 * Sets the array length. | 75 * Sets the array length. |
75 * | 76 * |
76 * @param[in] array An array var. | 77 * @param[in] array An array var. |
77 * @param[in] length The new array length. If <code>length</code> is smaller | 78 * @param[in] length The new array length. If <code>length</code> is smaller |
78 * than its current value, the array is truncated to the new length; any | 79 * than its current value, the array is truncated to the new length; any |
79 * elements that no longer fit are removed. If <code>length</code> is larger | 80 * elements that no longer fit are removed and the references to them will be |
darin (slow to review)
2013/06/10 16:00:26
nit: ", and"
raymes
2013/06/16 23:35:36
Done.
| |
80 * than its current value, undefined vars are appended to increase the array | 81 * released. If <code>length</code> is larger than its current value, |
81 * to the specified length. | 82 * undefined vars are appended to increase the array to the specified length. |
82 * | 83 * |
83 * @return A <code>PP_Bool</code> indicating whether the operation succeeds. | 84 * @return A <code>PP_Bool</code> indicating whether the operation succeeds. |
84 */ | 85 */ |
85 PP_Bool (*SetLength)(struct PP_Var array, uint32_t length); | 86 PP_Bool (*SetLength)(struct PP_Var array, uint32_t length); |
86 }; | 87 }; |
87 | 88 |
88 typedef struct PPB_VarArray_Dev_0_1 PPB_VarArray_Dev; | 89 typedef struct PPB_VarArray_1_0 PPB_VarArray; |
89 /** | 90 /** |
90 * @} | 91 * @} |
91 */ | 92 */ |
92 | 93 |
93 #endif /* PPAPI_C_DEV_PPB_VAR_ARRAY_DEV_H_ */ | 94 #endif /* PPAPI_C_PPB_VAR_ARRAY_H_ */ |
94 | 95 |
OLD | NEW |