| 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 #ifndef PPAPI_SIMPLE_PS_H_ | 5 #ifndef PPAPI_SIMPLE_PS_H_ |
| 6 #define PPAPI_SIMPLE_PS_H_ | 6 #define PPAPI_SIMPLE_PS_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "sdk_util/macros.h" | 9 #include "sdk_util/macros.h" |
| 10 | 10 |
| 11 EXTERN_C_BEGIN | 11 EXTERN_C_BEGIN |
| 12 | 12 |
| 13 /** | 13 /** |
| (...skipping 24 matching lines...) Expand all Loading... |
| 38 */ | 38 */ |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * PSGetInstanceId | 41 * PSGetInstanceId |
| 42 * | 42 * |
| 43 * Return the PP_Instance id of this instance of the module. This is required | 43 * Return the PP_Instance id of this instance of the module. This is required |
| 44 * by most of the Pepper resource creation routines. | 44 * by most of the Pepper resource creation routines. |
| 45 */ | 45 */ |
| 46 PP_Instance PSGetInstanceId(void); | 46 PP_Instance PSGetInstanceId(void); |
| 47 | 47 |
| 48 | |
| 49 /** | 48 /** |
| 50 * PSGetInterface | 49 * PSGetInterface |
| 51 * | 50 * |
| 52 * Return the Pepper instance referred to by 'name'. Will return a pointer | 51 * Return the Pepper instance referred to by 'name'. Will return a pointer |
| 53 * to the interface, or NULL if not found or not available. | 52 * to the interface, or NULL if not found or not available. |
| 54 */ | 53 */ |
| 55 const void* PSGetInterface(const char *name); | 54 const void* PSGetInterface(const char *name); |
| 56 | 55 |
| 57 | |
| 58 /** | 56 /** |
| 59 * PSUserCreateInstance | 57 * PSUserCreateInstance |
| 60 * | 58 * |
| 61 * Prototype for the user provided function which creates and configures | 59 * Prototype for the user provided function which creates and configures |
| 62 * the instance object. This function is defined by one of the macros below, | 60 * the instance object. This function is defined by one of the macros below, |
| 63 * or by the equivalent macro in one of the other headers. For 'C' | 61 * or by the equivalent macro in one of the other headers. For 'C' |
| 64 * development, one of the basic instances which support C callback are used. | 62 * development, one of the basic instances which support C callback are used. |
| 65 * For C++, this function should instantiate the user defined instance. See | 63 * For C++, this function should instantiate the user defined instance. See |
| 66 * the two macros below. | 64 * the two macros below. |
| 67 */ | 65 */ |
| 68 extern void* PSUserCreateInstance(PP_Instance inst); | 66 extern void* PSUserCreateInstance(PP_Instance inst); |
| 69 | 67 |
| 70 | |
| 71 /** | |
| 72 * PPAPI_SIMPLE_USE_MAIN | |
| 73 * | |
| 74 * For use with C projects, this macro calls the provided factory with | |
| 75 * configuration information. | |
| 76 */ | |
| 77 #define PPAPI_SIMPLE_USE_MAIN(factory, func) \ | |
| 78 void* PSUserCreateInstance(PP_Instance inst) { \ | |
| 79 return factory(inst, func); \ | |
| 80 } | |
| 81 | |
| 82 | |
| 83 EXTERN_C_END | 68 EXTERN_C_END |
| 84 | 69 |
| 85 | 70 #endif /* PPAPI_SIMPLE_PS_H_ */ |
| 86 #endif // PPAPI_SIMPLE_PS_H_ | |
| OLD | NEW |