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. */
5 #include "ppapi_simple/ps.h"
6 #include "ppapi_simple/ps_interface.h"
8 #define DEFINE_INTERFACE_FUNC(Name) \
9 static const PPB_##Name* s_##Name; \
10 const PPB_##Name* PSInterface##Name() { return s_##Name; }
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(InputEvent
)
26 DEFINE_INTERFACE_FUNC(Messaging
)
27 DEFINE_INTERFACE_FUNC(MessageLoop
)
28 DEFINE_INTERFACE_FUNC(MouseCursor
)
29 DEFINE_INTERFACE_FUNC(URLLoader
)
30 DEFINE_INTERFACE_FUNC(URLRequestInfo
)
31 DEFINE_INTERFACE_FUNC(URLResponseInfo
)
32 DEFINE_INTERFACE_FUNC(Var
)
33 DEFINE_INTERFACE_FUNC(VarArray
)
34 DEFINE_INTERFACE_FUNC(VarArrayBuffer
)
35 DEFINE_INTERFACE_FUNC(VarDictionary
)
36 DEFINE_INTERFACE_FUNC(View
)
37 DEFINE_INTERFACE_FUNC(WebSocket
)
39 #define REQUEST_INTERFACE(x, y) \
40 s_##x = (const PPB_##x*)(PSGetInterface(PPB_##y##_INTERFACE));
42 void PSInterfaceInit() {
43 REQUEST_INTERFACE(Audio
, AUDIO
)
44 REQUEST_INTERFACE(AudioConfig
, AUDIO_CONFIG
)
45 REQUEST_INTERFACE(Console
, CONSOLE
)
46 REQUEST_INTERFACE(Core
, CORE
)
47 REQUEST_INTERFACE(FileIO
, FILEIO
)
48 REQUEST_INTERFACE(FileRef
, FILEREF
)
49 REQUEST_INTERFACE(FileSystem
, FILESYSTEM
)
50 REQUEST_INTERFACE(Fullscreen
, FULLSCREEN
)
51 REQUEST_INTERFACE(Gamepad
, GAMEPAD
)
52 REQUEST_INTERFACE(Graphics2D
, GRAPHICS_2D
)
53 REQUEST_INTERFACE(Graphics3D
, GRAPHICS_3D
)
54 REQUEST_INTERFACE(ImageData
, IMAGEDATA
)
55 REQUEST_INTERFACE(Instance
, INSTANCE
)
56 REQUEST_INTERFACE(InputEvent
, INPUT_EVENT
)
57 REQUEST_INTERFACE(Messaging
, MESSAGING
)
58 REQUEST_INTERFACE(MessageLoop
, MESSAGELOOP
)
59 REQUEST_INTERFACE(MouseCursor
, MOUSECURSOR
)
60 REQUEST_INTERFACE(URLLoader
, URLLOADER
)
61 REQUEST_INTERFACE(URLRequestInfo
, URLREQUESTINFO
)
62 REQUEST_INTERFACE(URLResponseInfo
, URLRESPONSEINFO
)
63 REQUEST_INTERFACE(Var
, VAR
)
64 REQUEST_INTERFACE(VarArray
, VAR_ARRAY
)
65 REQUEST_INTERFACE(VarArrayBuffer
, VAR_ARRAY_BUFFER
)
66 REQUEST_INTERFACE(VarDictionary
, VAR_DICTIONARY
)
67 REQUEST_INTERFACE(View
, VIEW
)
68 REQUEST_INTERFACE(WebSocket
, WEBSOCKET
)