| OLD | NEW |
| (Empty) |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "ppapi_simple/ps.h" | |
| 6 #include "ppapi_simple/ps_interface.h" | |
| 7 | |
| 8 #define DEFINE_INTERFACE_FUNC(Name) \ | |
| 9 static const PPB_##Name* s_##Name; \ | |
| 10 const PPB_##Name* PSInterface##Name() { return s_##Name; } | |
| 11 | |
| 12 DEFINE_INTERFACE_FUNC(Audio) | |
| 13 DEFINE_INTERFACE_FUNC(AudioConfig) | |
| 14 DEFINE_INTERFACE_FUNC(Console) | |
| 15 DEFINE_INTERFACE_FUNC(Core) | |
| 16 DEFINE_INTERFACE_FUNC(FileIO) | |
| 17 DEFINE_INTERFACE_FUNC(FileRef) | |
| 18 DEFINE_INTERFACE_FUNC(FileSystem) | |
| 19 DEFINE_INTERFACE_FUNC(Fullscreen) | |
| 20 DEFINE_INTERFACE_FUNC(Gamepad) | |
| 21 DEFINE_INTERFACE_FUNC(Graphics2D) | |
| 22 DEFINE_INTERFACE_FUNC(Graphics3D) | |
| 23 DEFINE_INTERFACE_FUNC(ImageData) | |
| 24 DEFINE_INTERFACE_FUNC(Instance) | |
| 25 DEFINE_INTERFACE_FUNC(Messaging) | |
| 26 DEFINE_INTERFACE_FUNC(MessageLoop) | |
| 27 DEFINE_INTERFACE_FUNC(MouseCursor) | |
| 28 DEFINE_INTERFACE_FUNC(URLLoader) | |
| 29 DEFINE_INTERFACE_FUNC(URLRequestInfo) | |
| 30 DEFINE_INTERFACE_FUNC(URLResponseInfo) | |
| 31 DEFINE_INTERFACE_FUNC(Var) | |
| 32 DEFINE_INTERFACE_FUNC(VarArrayBuffer) | |
| 33 DEFINE_INTERFACE_FUNC(View) | |
| 34 DEFINE_INTERFACE_FUNC(WebSocket) | |
| 35 | |
| 36 | |
| 37 #define REQUEST_INTERFACE(x, y) \ | |
| 38 s_##x = static_cast<const PPB_##x*>(PSGetInterface(PPB_ ## y ##_INTERFACE)); | |
| 39 | |
| 40 void PSInterfaceInit() { | |
| 41 REQUEST_INTERFACE(Audio, AUDIO) | |
| 42 REQUEST_INTERFACE(AudioConfig, AUDIO_CONFIG) | |
| 43 REQUEST_INTERFACE(Console, CONSOLE) | |
| 44 REQUEST_INTERFACE(Core, CORE) | |
| 45 REQUEST_INTERFACE(FileIO, FILEIO) | |
| 46 REQUEST_INTERFACE(FileRef, FILEREF) | |
| 47 REQUEST_INTERFACE(FileSystem, FILESYSTEM) | |
| 48 REQUEST_INTERFACE(Fullscreen, FULLSCREEN) | |
| 49 REQUEST_INTERFACE(Gamepad, GAMEPAD) | |
| 50 REQUEST_INTERFACE(Graphics2D, GRAPHICS_2D) | |
| 51 REQUEST_INTERFACE(Graphics3D, GRAPHICS_3D) | |
| 52 REQUEST_INTERFACE(ImageData, IMAGEDATA) | |
| 53 REQUEST_INTERFACE(Instance, INSTANCE) | |
| 54 REQUEST_INTERFACE(Messaging, MESSAGING) | |
| 55 REQUEST_INTERFACE(MessageLoop, MESSAGELOOP) | |
| 56 REQUEST_INTERFACE(MouseCursor, MOUSECURSOR) | |
| 57 REQUEST_INTERFACE(URLLoader, URLLOADER) | |
| 58 REQUEST_INTERFACE(URLRequestInfo, URLREQUESTINFO) | |
| 59 REQUEST_INTERFACE(URLResponseInfo, URLRESPONSEINFO) | |
| 60 REQUEST_INTERFACE(Var, VAR) | |
| 61 REQUEST_INTERFACE(VarArrayBuffer, VAR_ARRAY_BUFFER) | |
| 62 REQUEST_INTERFACE(View, VIEW) | |
| 63 REQUEST_INTERFACE(WebSocket, WEBSOCKET) | |
| 64 } | |
| OLD | NEW |