1 module awebview.wrapper.webconfig;
2 
3 import awebview.wrapper.webstring : WebString, WebStringCpp;
4 import awebview.wrapper.webstringarray : WebStringArray, WebStringArrayCpp;
5 import awebview.wrapper.webstringarray;
6 public import awebview.wrapper.cpp : LogLevel;
7 import awebview.wrapper.cpp;
8 import std.algorithm : move;
9 
10 import carbon.memory;
11 
12 
13 struct WebConfig
14 {
15     static WebConfig opCall() nothrow @nogc
16     {
17         WebConfig dst;
18         WebConfigMember.ctor(&dst._wc);
19 
20         return dst;
21     }
22 
23 
24     this(this) nothrow @nogc
25     {
26         callAllPostblit(packagePath);
27         callAllPostblit(pluginPath);
28         callAllPostblit(logPath);
29         callAllPostblit(childProcessPath);
30         callAllPostblit(userAgent);
31         callAllPostblit(remoteDebuggingHost);
32         callAllPostblit(userScript);
33         callAllPostblit(userStyleSheet);
34         callAllPostblit(assetProtocol);
35         callAllPostblit(additionalOptions);
36     }
37 
38 
39     ~this() nothrow @nogc
40     {
41         callAllDtor(packagePath);
42         callAllDtor(pluginPath);
43         callAllDtor(logPath);
44         callAllDtor(childProcessPath);
45         callAllDtor(userAgent);
46         callAllDtor(remoteDebuggingHost);
47         callAllDtor(userScript);
48         callAllDtor(userStyleSheet);
49         callAllDtor(assetProtocol);
50         callAllDtor(additionalOptions);
51     }
52 
53 
54   @property
55   {
56     inout(awebview.wrapper.cpp.WebConfig)* cppObj() inout pure nothrow @safe @nogc
57     { return &_wc; }
58 
59     ref inout(LogLevel) logLevel() inout pure nothrow @trusted @nogc
60     { return _wc.log_level; }
61 
62     ref inout(WebStringCpp) packagePath() inout pure nothrow @trusted @nogc
63     { return *cast(typeof(return)*)&_wc.package_path; }
64 
65     ref inout(WebStringCpp) pluginPath() inout pure nothrow @trusted @nogc
66     { return *cast(typeof(return)*)&_wc.plugin_path; }
67 
68     ref inout(WebStringCpp) logPath() inout pure nothrow @trusted @nogc
69     { return *cast(typeof(return)*)&_wc.log_path; }
70 
71     ref inout(WebStringCpp) childProcessPath() inout pure nothrow @trusted @nogc
72     { return *cast(typeof(return)*)&_wc.child_process_path; }
73 
74     ref inout(WebStringCpp) userAgent() inout pure nothrow @trusted @nogc
75     { return *cast(typeof(return)*)&_wc.user_agent; }
76 
77     ref inout(int) remoteDebuggingPort() inout pure nothrow @safe @nogc
78     { return _wc.remote_debugging_port; }
79 
80     ref inout(WebStringCpp) remoteDebuggingHost() inout pure nothrow @trusted @nogc
81     { return *cast(typeof(return)*)&_wc.remote_debugging_host; }
82 
83     ref inout(bool) reduceMemoryUsageOnNavigation() inout pure nothrow @safe @nogc
84     { return _wc.reduce_memory_usage_on_navigation; }
85 
86     ref inout(WebStringCpp) userScript() inout pure nothrow @trusted @nogc
87     { return *cast(typeof(return)*)&_wc.user_script; }
88 
89     ref inout(WebStringCpp) userStyleSheet() inout pure nothrow @trusted @nogc
90     { return *cast(typeof(return)*)&_wc.user_stylesheet; }
91 
92     ref inout(WebStringCpp) assetProtocol() inout pure nothrow @trusted @nogc
93     { return *cast(typeof(return)*)&_wc.asset_protocol; }
94 
95     ref inout(WebStringArrayCpp) additionalOptions() inout nothrow @nogc
96     { return *cast(typeof(return)*)&_wc.additional_options; }
97   }
98 
99 
100   private:
101     awebview.wrapper.cpp.WebConfig _wc;
102 }