1 module awebview.wrapper.cpp.webtouchevent;
2 
3 mixin template Awesomium()
4 {
5     enum WebTouchPointState { undefined, released, pressed, moved, stationary, cancelled, }
6 
7     align(1) struct WebTouchPoint {
8         int id;
9         WebTouchPointState state;
10         int screen_position_x;
11         int screen_position_y;
12         int position_x;
13         int position_y;
14         int radius_x;
15         int radius_y;
16         float rotation_angle;
17         float force;
18     }
19 
20     enum WebTouchEventType { start, move, end, cancel }
21 
22     align(1) struct WebTouchEvent {
23         WebTouchEventType type;
24         uint touches_length;
25         WebTouchPoint[8] touches;
26         uint changed_touches_length;
27         WebTouchPoint[8] changed_touches;
28         uint target_touches_length;
29         WebTouchPoint[8] target_touches;
30     }
31 }
32 
33 
34 mixin template Awesomium4D()
35 {
36     extern(C++, WebTouchPointMember)
37     {
38         size_t sizeOfInstance();
39         void ctor(WebTouchPoint * p);
40         WebTouchPoint * newCtor();
41         void deleteDtor(WebTouchPoint *);
42     }
43 
44     unittest {
45         assert(WebTouchPointMember.sizeOfInstance()
46             == Awesomium.WebTouchPoint.sizeof);
47     }
48 
49     extern(C++, WebTouchEventMember)
50     {
51         size_t sizeOfInstance();
52         void ctor(WebTouchEvent * p);
53         WebTouchEvent * newCtor();
54         void deleteDtor(WebTouchEvent *);
55     }
56 
57     unittest {
58         assert(WebTouchEventMember.sizeOfInstance()
59             == Awesomium.WebTouchEvent.sizeof);
60     }
61 }