OLD | NEW |
1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 pp_var.idl modified Mon Feb 11 15:41:10 2013. */ | 6 /* From pp_var.idl modified Tue Sep 3 11:51:25 2013. */ |
7 | 7 |
8 #ifndef PPAPI_C_PP_VAR_H_ | 8 #ifndef PPAPI_C_PP_VAR_H_ |
9 #define PPAPI_C_PP_VAR_H_ | 9 #define PPAPI_C_PP_VAR_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 | 14 |
15 /** | 15 /** |
16 * @file | 16 * @file |
(...skipping 29 matching lines...) Expand all Loading... |
46 */ | 46 */ |
47 PP_VARTYPE_INT32 = 3, | 47 PP_VARTYPE_INT32 = 3, |
48 /** | 48 /** |
49 * A double-precision floating point value. Use the <code>as_double</code> | 49 * A double-precision floating point value. Use the <code>as_double</code> |
50 * member of the var. | 50 * member of the var. |
51 */ | 51 */ |
52 PP_VARTYPE_DOUBLE = 4, | 52 PP_VARTYPE_DOUBLE = 4, |
53 /** | 53 /** |
54 * The Var represents a string. The <code>as_id</code> field is used to | 54 * The Var represents a string. The <code>as_id</code> field is used to |
55 * identify the string, which may be created and retrieved from the | 55 * identify the string, which may be created and retrieved from the |
56 * <code>PPB_Var</code> interface. | 56 * <code>PPB_Var</code> interface. These objects are reference counted, so |
| 57 * AddRef and Release must be used properly to avoid memory leaks. |
57 */ | 58 */ |
58 PP_VARTYPE_STRING = 5, | 59 PP_VARTYPE_STRING = 5, |
59 /** | 60 /** |
60 * Represents a JavaScript object. This vartype is not currently usable | 61 * Represents a JavaScript object. This vartype is not currently usable |
61 * from modules, although it is used internally for some tasks. | 62 * from modules, although it is used internally for some tasks. |
62 */ | 63 */ |
63 PP_VARTYPE_OBJECT = 6, | 64 PP_VARTYPE_OBJECT = 6, |
64 /** | 65 /** |
65 * Arrays and dictionaries are not currently supported but will be added | 66 * Represents an array of Vars. The <code>as_id</code> field is used to |
66 * in future revisions. These objects are reference counted so be sure | 67 * identify the array, which may be created and manipulated from the |
67 * to properly AddRef/Release them as you would with strings to ensure your | 68 * <code>PPB_VarArray</code> interface. These objects are reference counted, |
68 * module will continue to work with future versions of the API. | 69 * so AddRef and Release must be used properly to avoid memory leaks. |
69 */ | 70 */ |
70 PP_VARTYPE_ARRAY = 7, | 71 PP_VARTYPE_ARRAY = 7, |
| 72 /** |
| 73 * Represents a mapping from strings to Vars. The <code>as_id</code> field is |
| 74 * used to identify the dictionary, which may be created and manipulated from |
| 75 * the <code>PPB_VarDictionary</code> interface. These objects are reference |
| 76 * counted, so AddRef and Release must be used properly to avoid memory leaks. |
| 77 */ |
71 PP_VARTYPE_DICTIONARY = 8, | 78 PP_VARTYPE_DICTIONARY = 8, |
72 /** | 79 /** |
73 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which | 80 * ArrayBuffer represents a JavaScript ArrayBuffer. This is the type which |
74 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is | 81 * represents Typed Arrays in JavaScript. Unlike JavaScript 'Array', it is |
75 * only meant to contain basic numeric types, and is always stored | 82 * only meant to contain basic numeric types, and is always stored |
76 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to | 83 * contiguously. See PPB_VarArrayBuffer_Dev for functions special to |
77 * ArrayBuffer vars. | 84 * ArrayBuffer vars. |
78 */ | 85 */ |
79 PP_VARTYPE_ARRAY_BUFFER = 9 | 86 PP_VARTYPE_ARRAY_BUFFER = 9 |
80 } PP_VarType; | 87 } PP_VarType; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 232 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
226 result.value.as_double = value; | 233 result.value.as_double = value; |
227 return result; | 234 return result; |
228 } | 235 } |
229 /** | 236 /** |
230 * @} | 237 * @} |
231 */ | 238 */ |
232 | 239 |
233 #endif /* PPAPI_C_PP_VAR_H_ */ | 240 #endif /* PPAPI_C_PP_VAR_H_ */ |
234 | 241 |
OLD | NEW |