| OLD | NEW |
| 1 /* Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 /* Copyright (c) 2011 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 /** | 6 /** |
| 7 * This file defines the API for handling the passing of data types between | 7 * This file defines the API for handling the passing of data types between |
| 8 * your module and the page. | 8 * your module and the page. |
| 9 */ | 9 */ |
| 10 | 10 |
| 11 /** | 11 /** |
| 12 * The <code>PP_VarType</code> is an enumeration of the different types that | 12 * The <code>PP_VarType</code> is an enumeration of the different types that |
| 13 * can be contained within a <code>PP_Var</code> structure. | 13 * can be contained within a <code>PP_Var</code> structure. |
| 14 */ | 14 */ |
| 15 [assert_size(4)] | 15 [assert_size(4)] |
| 16 enum PP_VarType { | 16 enum PP_VarType { |
| 17 /** | 17 /** |
| 18 * An undefined value. | 18 * An undefined value. |
| 19 */ | 19 */ |
| 20 PP_VARTYPE_UNDEFINED, | 20 PP_VARTYPE_UNDEFINED = 0, |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * A NULL value. This is similar to undefined, but JavaScript differentiates | 23 * A NULL value. This is similar to undefined, but JavaScript differentiates |
| 24 * the two so it is exposed here as well. | 24 * the two so it is exposed here as well. |
| 25 */ | 25 */ |
| 26 PP_VARTYPE_NULL, | 26 PP_VARTYPE_NULL = 1, |
| 27 | 27 |
| 28 /** | 28 /** |
| 29 * A boolean value, use the <code>as_bool</code> member of the var. | 29 * A boolean value, use the <code>as_bool</code> member of the var. |
| 30 */ | 30 */ |
| 31 PP_VARTYPE_BOOL, | 31 PP_VARTYPE_BOOL = 2, |
| 32 | 32 |
| 33 /** | 33 /** |
| 34 * A 32-bit integer value. Use the <code>as_int</code> member of the var. | 34 * A 32-bit integer value. Use the <code>as_int</code> member of the var. |
| 35 */ | 35 */ |
| 36 PP_VARTYPE_INT32, | 36 PP_VARTYPE_INT32 = 3, |
| 37 | 37 |
| 38 /** | 38 /** |
| 39 * A double-precision floating point value. Use the <code>as_double</code> | 39 * A double-precision floating point value. Use the <code>as_double</code> |
| 40 * member of the var. | 40 * member of the var. |
| 41 */ | 41 */ |
| 42 PP_VARTYPE_DOUBLE, | 42 PP_VARTYPE_DOUBLE = 4, |
| 43 | 43 |
| 44 /** | 44 /** |
| 45 * The Var represents a string. The <code>as_id</code> field is used to | 45 * The Var represents a string. The <code>as_id</code> field is used to |
| 46 * identify the string, which may be created and retrieved from the | 46 * identify the string, which may be created and retrieved from the |
| 47 * <code>PPB_Var</code> interface. | 47 * <code>PPB_Var</code> interface. |
| 48 */ | 48 */ |
| 49 PP_VARTYPE_STRING, | 49 PP_VARTYPE_STRING = 5, |
| 50 | 50 |
| 51 /** | 51 /** |
| 52 * Represents a JavaScript object. This vartype is not currently usable | 52 * Represents a JavaScript object. This vartype is not currently usable |
| 53 * from modules, although it is used internally for some tasks. | 53 * from modules, although it is used internally for some tasks. |
| 54 */ | 54 */ |
| 55 PP_VARTYPE_OBJECT, | 55 PP_VARTYPE_OBJECT = 6, |
| 56 | 56 |
| 57 /** | 57 /** |
| 58 * Arrays and dictionaries are not currently supported but will be added | 58 * Arrays and dictionaries are not currently supported but will be added |
| 59 * in future revisions. These objects are reference counted so be sure | 59 * in future revisions. These objects are reference counted so be sure |
| 60 * to properly AddRef/Release them as you would with strings to ensure your | 60 * to properly AddRef/Release them as you would with strings to ensure your |
| 61 * module will continue to work with future versions of the API. | 61 * module will continue to work with future versions of the API. |
| 62 */ | 62 */ |
| 63 PP_VARTYPE_ARRAY, | 63 PP_VARTYPE_ARRAY = 7, |
| 64 PP_VARTYPE_DICTIONARY | 64 PP_VARTYPE_DICTIONARY = 8 |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 | 67 |
| 68 /** | 68 /** |
| 69 * The PP_VarValue union stores the data for any one of the types listed | 69 * The PP_VarValue union stores the data for any one of the types listed |
| 70 * in the PP_VarType enum. | 70 * in the PP_VarType enum. |
| 71 */ | 71 */ |
| 72 [union] struct PP_VarValue { | 72 [union] struct PP_VarValue { |
| 73 /** | 73 /** |
| 74 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, | 74 * If <code>type</code> is <code>PP_VARTYPE_BOOL</code>, |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 207 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
| 208 result.value.as_double = value; | 208 result.value.as_double = value; |
| 209 return result; | 209 return result; |
| 210 } | 210 } |
| 211 /** | 211 /** |
| 212 * @} | 212 * @} |
| 213 */ | 213 */ |
| 214 | 214 |
| 215 #endinl | 215 #endinl |
| 216 | 216 |
| OLD | NEW |