OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef WebMouseEvent_h | 5 #ifndef WebMouseEvent_h |
6 #define WebMouseEvent_h | 6 #define WebMouseEvent_h |
7 | 7 |
8 #include "WebInputEvent.h" | 8 #include "WebInputEvent.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
11 | 11 |
12 class WebGestureEvent; | 12 class WebGestureEvent; |
13 | 13 |
14 // See WebInputEvent.h for details why this pack is here. | 14 // See WebInputEvent.h for details why this pack is here. |
15 #pragma pack(push, 4) | 15 #pragma pack(push, 4) |
16 | 16 |
17 // WebMouseEvent -------------------------------------------------------------- | 17 // WebMouseEvent -------------------------------------------------------------- |
18 | 18 |
19 class WebMouseEvent : public WebInputEvent, public WebPointerProperties { | 19 class WebMouseEvent : public WebInputEvent, public WebPointerProperties { |
20 public: | 20 public: |
21 // Renderer coordinates. Similar to viewport coordinates but without | 21 // Renderer coordinates. Similar to viewport coordinates but without |
22 // DevTools emulation transform or overscroll applied. i.e. the coordinates | 22 // DevTools emulation transform or overscroll applied. i.e. the coordinates |
23 // in Chromium's RenderView bounds. | 23 // in Chromium's RenderView bounds. |
24 int x; | 24 WebFloatPoint position; |
dtapuska
2017/03/29 20:19:15
I think we really should move these to be accessor
mustaq
2017/03/30 21:01:35
Done, all done, phew!
| |
25 int y; | |
26 | 25 |
27 // Screen coordinate | 26 // Screen coordinate |
28 int globalX; | 27 WebFloatPoint screenPosition; |
29 int globalY; | |
30 | 28 |
31 int clickCount; | 29 int clickCount; |
32 | 30 |
33 WebMouseEvent(Type typeParam, | 31 WebMouseEvent(Type typeParam, |
34 int xParam, | 32 int xParam, |
35 int yParam, | 33 int yParam, |
36 int globalXParam, | 34 int globalXParam, |
37 int globalYParam, | 35 int globalYParam, |
38 int modifiersParam, | 36 int modifiersParam, |
39 double timeStampSecondsParam) | 37 double timeStampSecondsParam) |
40 : WebInputEvent(sizeof(WebMouseEvent), | 38 : WebInputEvent(sizeof(WebMouseEvent), |
41 typeParam, | 39 typeParam, |
42 modifiersParam, | 40 modifiersParam, |
43 timeStampSecondsParam), | 41 timeStampSecondsParam), |
44 WebPointerProperties(), | 42 WebPointerProperties(), |
45 x(xParam), | 43 position(xParam, yParam), |
46 y(yParam), | 44 screenPosition(WebFloatPoint(globalXParam, globalYParam)) {} |
47 globalX(globalXParam), | |
48 globalY(globalYParam) {} | |
49 | 45 |
50 WebMouseEvent(Type typeParam, | 46 WebMouseEvent(Type typeParam, |
51 WebFloatPoint position, | 47 WebFloatPoint position, |
52 WebFloatPoint globalPosition, | 48 WebFloatPoint globalPosition, |
53 Button buttonParam, | 49 Button buttonParam, |
54 int clickCountParam, | 50 int clickCountParam, |
55 int modifiersParam, | 51 int modifiersParam, |
56 double timeStampSecondsParam) | 52 double timeStampSecondsParam) |
57 : WebInputEvent(sizeof(WebMouseEvent), | 53 : WebInputEvent(sizeof(WebMouseEvent), |
58 typeParam, | 54 typeParam, |
59 modifiersParam, | 55 modifiersParam, |
60 timeStampSecondsParam), | 56 timeStampSecondsParam), |
61 WebPointerProperties(buttonParam, PointerType::Mouse), | 57 WebPointerProperties(buttonParam, PointerType::Mouse), |
62 x(position.x), | 58 position(position), |
63 y(position.y), | 59 screenPosition(globalPosition), |
64 globalX(globalPosition.x), | |
65 globalY(globalPosition.y), | |
66 clickCount(clickCountParam) {} | 60 clickCount(clickCountParam) {} |
67 | 61 |
68 WebMouseEvent(Type typeParam, | 62 WebMouseEvent(Type typeParam, |
69 int modifiersParam, | 63 int modifiersParam, |
70 double timeStampSecondsParam) | 64 double timeStampSecondsParam) |
71 : WebMouseEvent(sizeof(WebMouseEvent), | 65 : WebMouseEvent(sizeof(WebMouseEvent), |
72 typeParam, | 66 typeParam, |
73 modifiersParam, | 67 modifiersParam, |
74 timeStampSecondsParam) {} | 68 timeStampSecondsParam) {} |
75 | 69 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
107 WebPointerProperties() {} | 101 WebPointerProperties() {} |
108 | 102 |
109 void flattenTransformSelf(); | 103 void flattenTransformSelf(); |
110 }; | 104 }; |
111 | 105 |
112 #pragma pack(pop) | 106 #pragma pack(pop) |
113 | 107 |
114 } // namespace blink | 108 } // namespace blink |
115 | 109 |
116 #endif // WebMouseEvent_h | 110 #endif // WebMouseEvent_h |
OLD | NEW |