1 module awebview.wrapper.cpp.webcore;
2 
3 
4 mixin template Awesomium()
5 {
6     enum LogSeverity { info, warning, error, errorReport, fatal }
7     interface WebCore {}
8 }
9 
10 
11 mixin template Awesomium4D()
12 {
13     //interface IWebCoreD
14     //{
15     //    Awesomium.WebSession createWebSession_cpp(const WebString path, const(WebPreferences)* pref);
16     //    Awesomium.WebView createWebView_cpp(int width, int height, Awesomium.WebSession session, Awesomium.WebViewType type);
17     //    void setSurfaceFactory_cpp(Awesomium.SurfaceFactory factory);
18     //    Awesomium.SurfaceFactory surfaceFactory_cpp();
19     //    const(Awesomium.SurfaceFactory) surfaceFactory_cpp() const;
20     //    void setResourceInterceptor_cpp(Awesomium.ResourceInterceptor interceptor);
21     //    Awesomium.ResourceInterceptor resourceInterceptor_cpp() const;
22     //    const(Awesomium.ResourceInterceptor) resourceInterceptor_cpp();
23     //    void update_cpp();
24     //    void log_cpp(const Awesomium.WebString msg, Awesomium.LogSeverity s, const Awesomium.WebString file, int line);
25     //    const(char)* versionString_cpp() const;
26     //}
27 
28 
29     //interface WebCoreD2Cpp : Awesomium.WebCore {}
30     //extern(C++, WebCoreD2CppMember)
31     //{
32     //    WebCoreD2Cpp newCtor(IWebCoreD p, ulong mid);
33     //    void deleteDtor(WebCoreD2Cpp p);
34     //}
35 
36     extern(C++, WebCoreMember)
37     {
38         Awesomium.WebCore Initialize(const WebConfig* config);
39         void Shutdown();
40         Awesomium.WebCore instance();
41 
42         Awesomium.WebSession CreateWebSession(Awesomium.WebCore p,
43                                       const Awesomium.WebString path,
44                                       const WebPreferences* prefs);
45 
46         Awesomium.WebView CreateWebView(Awesomium.WebCore p,
47                                 int width, int height,
48                                 Awesomium.WebSession session,
49                                 WebViewType type);
50 
51         void set_surface_factory(Awesomium.WebCore p, Awesomium.SurfaceFactory factory);
52         Awesomium.SurfaceFactory surface_factory(const Awesomium.WebCore p);
53         void set_resource_interceptor(Awesomium.WebCore p, Awesomium.ResourceInterceptor interceptor);
54         Awesomium.ResourceInterceptor resource_interceptor(const Awesomium.WebCore p);
55         void Update(Awesomium.WebCore p);
56 
57         void Log(Awesomium.WebCore p, const Awesomium.WebString message,
58                  LogSeverity severity, const Awesomium.WebString file, int line);
59 
60         const(char)* version_string(const Awesomium.WebCore p);
61         uint used_memory();
62         uint allocated_memory();
63         void release_memory();
64     }
65 }