| 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 /* From pp_var.idl modified Tue Jul 12 15:26:30 2011. */ | 6 /* From pp_var.idl modified Fri Nov 11 19:57:17 2011. */ |
| 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 |
| 17 * This file defines the API for handling the passing of data types between | 17 * This file defines the API for handling the passing of data types between |
| 18 * your module and the page. | 18 * your module and the page. |
| 19 */ | 19 */ |
| 20 | 20 |
| 21 | 21 |
| 22 /** | 22 /** |
| 23 * @addtogroup Enums | 23 * @addtogroup Enums |
| 24 * @{ | 24 * @{ |
| 25 */ | 25 */ |
| 26 /** | 26 /** |
| 27 * The <code>PP_VarType</code> is an enumeration of the different types that | 27 * The <code>PP_VarType</code> is an enumeration of the different types that |
| 28 * can be contained within a <code>PP_Var</code> structure. | 28 * can be contained within a <code>PP_Var</code> structure. |
| 29 */ | 29 */ |
| 30 typedef enum { | 30 typedef enum { |
| 31 /** | 31 /** |
| 32 * An undefined value. | 32 * An undefined value. |
| 33 */ | 33 */ |
| 34 PP_VARTYPE_UNDEFINED, | 34 PP_VARTYPE_UNDEFINED = 0, |
| 35 /** | 35 /** |
| 36 * A NULL value. This is similar to undefined, but JavaScript differentiates | 36 * A NULL value. This is similar to undefined, but JavaScript differentiates |
| 37 * the two so it is exposed here as well. | 37 * the two so it is exposed here as well. |
| 38 */ | 38 */ |
| 39 PP_VARTYPE_NULL, | 39 PP_VARTYPE_NULL = 1, |
| 40 /** | 40 /** |
| 41 * A boolean value, use the <code>as_bool</code> member of the var. | 41 * A boolean value, use the <code>as_bool</code> member of the var. |
| 42 */ | 42 */ |
| 43 PP_VARTYPE_BOOL, | 43 PP_VARTYPE_BOOL = 2, |
| 44 /** | 44 /** |
| 45 * A 32-bit integer value. Use the <code>as_int</code> member of the var. | 45 * A 32-bit integer value. Use the <code>as_int</code> member of the var. |
| 46 */ | 46 */ |
| 47 PP_VARTYPE_INT32, | 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, | 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. |
| 57 */ | 57 */ |
| 58 PP_VARTYPE_STRING, | 58 PP_VARTYPE_STRING = 5, |
| 59 /** | 59 /** |
| 60 * Represents a JavaScript object. This vartype is not currently usable | 60 * Represents a JavaScript object. This vartype is not currently usable |
| 61 * from modules, although it is used internally for some tasks. | 61 * from modules, although it is used internally for some tasks. |
| 62 */ | 62 */ |
| 63 PP_VARTYPE_OBJECT, | 63 PP_VARTYPE_OBJECT = 6, |
| 64 /** | 64 /** |
| 65 * Arrays and dictionaries are not currently supported but will be added | 65 * Arrays and dictionaries are not currently supported but will be added |
| 66 * in future revisions. These objects are reference counted so be sure | 66 * in future revisions. These objects are reference counted so be sure |
| 67 * to properly AddRef/Release them as you would with strings to ensure your | 67 * to properly AddRef/Release them as you would with strings to ensure your |
| 68 * module will continue to work with future versions of the API. | 68 * module will continue to work with future versions of the API. |
| 69 */ | 69 */ |
| 70 PP_VARTYPE_ARRAY, | 70 PP_VARTYPE_ARRAY = 7, |
| 71 PP_VARTYPE_DICTIONARY | 71 PP_VARTYPE_DICTIONARY = 8 |
| 72 } PP_VarType; | 72 } PP_VarType; |
| 73 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); | 73 PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_VarType, 4); |
| 74 /** | 74 /** |
| 75 * @} | 75 * @} |
| 76 */ | 76 */ |
| 77 | 77 |
| 78 /** | 78 /** |
| 79 * @addtogroup Structs | 79 * @addtogroup Structs |
| 80 * @{ | 80 * @{ |
| 81 */ | 81 */ |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; | 217 struct PP_Var result = { PP_VARTYPE_DOUBLE, 0, {PP_FALSE} }; |
| 218 result.value.as_double = value; | 218 result.value.as_double = value; |
| 219 return result; | 219 return result; |
| 220 } | 220 } |
| 221 /** | 221 /** |
| 222 * @} | 222 * @} |
| 223 */ | 223 */ |
| 224 | 224 |
| 225 #endif /* PPAPI_C_PP_VAR_H_ */ | 225 #endif /* PPAPI_C_PP_VAR_H_ */ |
| 226 | 226 |
| OLD | NEW |