1 module awebview.wrapper.cpp.platform;
2 
3 version(Windows)
4     import core.sys.windows.windows;
5 else
6     import core.sys.posix.sys.types;
7 
8 
9 enum OSM_VERSION = "1.7.5.0";
10 
11 
12 mixin template Awesomium()
13 {
14     enum Error
15     {
16         none,
17         badParameters,
18         objectGone,
19         connectionGone,
20         timeout,
21         webViewGone,
22         generic,
23     }
24 
25     version(Windows)
26         alias NativeWindow = core.sys.windows.windows.HWND;
27     else version(OSX)
28     {
29         struct NSEvent{}
30         struct NSView{}
31         alias NativeWindow = NSView*;
32     }
33     else
34         alias NativeWindow = void*;
35 
36 
37     version(Windows)
38         alias ProcessHandle = core.sys.windows.windows.HANDLE;
39     else
40         alias ProcessHandle = core.sys.posix.sys.types.pid_t;
41 
42 
43     align(1) struct Rect
44     {
45         int x;
46         int y;
47         int width;
48         int height;
49 
50         bool isEmpty() const
51         {
52             return awebview.wrapper.cpp.RectMember.IsEmpty(&this);
53         }
54     }
55 }
56 
57 
58 mixin template Awesomium4D()
59 {
60     extern(C++, RectMember)
61     {
62         bool IsEmpty(const(Awesomium.Rect)*);
63     }
64 }