1 module awebview.wrapper.cpp;
2 
3 import std.algorithm,
4        std.array;
5 
6 enum modules = [`platform`,
7                 `jsobject`,
8                 `jsvalue`,
9                 `jsarray`,
10                 `webstring`,
11                 `webstringarray`,
12                 `weburl`,
13                 `webmenuitem`,
14                 `webviewlistener`,
15                 `webview`,
16                 `surface`,
17                 `bitmapsurface`,
18                 `childprocess`,
19                 `datasource`,
20                 `datapak`,
21                 `mmanager`,
22                 `printconfig`,
23                 `resourceinterceptor`,
24                 `webconfig`,
25                 `webcore`,
26                 `webkeyboardcodes`,
27                 `webkeyboardevent`,
28                 `webpreferences`,
29                 `websession`,
30                 `webtouchevent`];
31 
32 private string getPublicImports()
33 {
34     return `public import ` ~ modules.map!(a => `awebview.wrapper.cpp.` ~ a).join(", ") ~ ";";
35 }
36 
37 private string getMTAwesomium()
38 {
39     return modules.map!(a => `mixin awebview.wrapper.cpp.` ~ a ~ `.Awesomium!();`).join("\n");
40 }
41 
42 private string getMTawebview()
43 {
44     return modules.map!(a => `mixin awebview.wrapper.cpp.` ~ a ~ `.Awesomium4D!();`).join("\n");
45 }
46 
47 mixin(getPublicImports());
48 
49 @nogc:
50 nothrow:
51 
52 extern(C++, Awesomium)
53 {
54     mixin(getMTAwesomium());
55 }
56 
57 extern(C++, Awesomium4D)
58 {
59     mixin(getMTawebview());
60 }