| 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_MAIN_PPAPI_MAIN_H_ | 5 #ifndef PPAPI_MAIN_PPAPI_MAIN_H_ |
| 6 #define PPAPI_MAIN_PPAPI_MAIN_H_ | 6 #define PPAPI_MAIN_PPAPI_MAIN_H_ |
| 7 | 7 |
| 8 #include "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "ppapi/c/pp_module.h" | 9 #include "ppapi/c/pp_module.h" |
| 10 #include "ppapi_main/ppapi_event.h" | 10 #include "ppapi_main/ppapi_event.h" |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void PPAPI_ReleaseEvent(PPAPIEvent* event); | 34 void PPAPI_ReleaseEvent(PPAPIEvent* event); |
| 35 | 35 |
| 36 | 36 |
| 37 // Functions for 3D instances | 37 // Functions for 3D instances |
| 38 int32_t *PPAPIGet3DAttribs(uint32_t width, uint32_t height); | 38 int32_t *PPAPIGet3DAttribs(uint32_t width, uint32_t height); |
| 39 void PPAPIBuildContext(uint32_t width, uint32_t height); | 39 void PPAPIBuildContext(uint32_t width, uint32_t height); |
| 40 void PPAPIRender(uint32_t width, uint32_t height); | 40 void PPAPIRender(uint32_t width, uint32_t height); |
| 41 | 41 |
| 42 EXTERN_C_END | 42 EXTERN_C_END |
| 43 | 43 |
| 44 #define PPAPI_MAIN_DEFAULT_ARGS \ | 44 #define PPAPI_MAIN_DEFAULT_ARGS NULL, NULL |
| 45 { \ | |
| 46 NULL, NULL \ | |
| 47 } | |
| 48 | 45 |
| 49 | 46 #define PPAPI_MAIN_USE(factory, ...) \ |
| 50 #define PPAPI_MAIN_USE(factory, args) \ | |
| 51 void* UserCreateInstance(PP_Instance inst) { \ | 47 void* UserCreateInstance(PP_Instance inst) { \ |
| 52 static const char *params[] = args; \ | 48 static const char *params[] = { __VA_ARGS__ }; \ |
| 53 return factory(inst, params); \ | 49 return factory(inst, params); \ |
| 54 } | 50 } |
| 55 | 51 |
| 56 #define PPAPI_MAIN_WITH_DEFAULT_ARGS \ | 52 #define PPAPI_MAIN_WITH_DEFAULT_ARGS \ |
| 57 PPAPI_MAIN_USE(PPAPI_CreateInstance, PPAPI_MAIN_DEFAULT_ARGS) | 53 PPAPI_MAIN_USE(PPAPI_CreateInstance, PPAPI_MAIN_DEFAULT_ARGS) |
| 58 | 54 |
| 59 #define PPAPI_MAIN_3D_WITH_DEFAULT_ARGS \ | 55 #define PPAPI_MAIN_3D_WITH_DEFAULT_ARGS \ |
| 60 PPAPI_MAIN_USE(PPAPI_CreateInstance3D, PPAPI_MAIN_DEFAULT_ARGS) | 56 PPAPI_MAIN_USE(PPAPI_CreateInstance3D, PPAPI_MAIN_DEFAULT_ARGS) |
| 61 | 57 |
| 62 #define PPAPI_MAIN_WITH_ARGS(args) \ | 58 #define PPAPI_MAIN_WITH_ARGS(...) \ |
| 63 PPAPI_MAIN_USE(PPAPI_CreateInstance, args) | 59 PPAPI_MAIN_USE(PPAPI_CreateInstance, __VA_ARGS__) |
| 64 | 60 |
| 65 | 61 |
| 66 #endif // PPAPI_MAIN_PPAPI_MAIN_H_ | 62 #endif // PPAPI_MAIN_PPAPI_MAIN_H_ |
| OLD | NEW |