OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #ifndef WebInputEventConversion_h | 31 #ifndef WebInputEventConversion_h |
32 #define WebInputEventConversion_h | 32 #define WebInputEventConversion_h |
33 | 33 |
34 #include "platform/PlatformMouseEvent.h" | |
35 #include "platform/scroll/ScrollTypes.h" | 34 #include "platform/scroll/ScrollTypes.h" |
36 #include "public/platform/WebInputEvent.h" | 35 #include "public/platform/WebInputEvent.h" |
37 #include "public/platform/WebKeyboardEvent.h" | 36 #include "public/platform/WebKeyboardEvent.h" |
38 #include "public/platform/WebMouseWheelEvent.h" | 37 #include "public/platform/WebMouseWheelEvent.h" |
39 #include "public/platform/WebTouchEvent.h" | 38 #include "public/platform/WebTouchEvent.h" |
40 #include "web/WebExport.h" | 39 #include "web/WebExport.h" |
41 #include "wtf/Compiler.h" | 40 #include "wtf/Compiler.h" |
42 #include <vector> | 41 #include <vector> |
43 | 42 |
44 namespace blink { | 43 namespace blink { |
45 | 44 |
46 class KeyboardEvent; | 45 class KeyboardEvent; |
47 class MouseEvent; | 46 class MouseEvent; |
48 class LayoutItem; | 47 class LayoutItem; |
49 class TouchEvent; | 48 class TouchEvent; |
50 class WebGestureEvent; | 49 class WebGestureEvent; |
51 class WebMouseEvent; | |
52 class WebKeyboardEvent; | 50 class WebKeyboardEvent; |
53 class WebTouchEvent; | |
54 class Widget; | 51 class Widget; |
55 | 52 |
56 // These classes are used to convert from WebInputEvent subclasses to | 53 // These classes are used to convert from WebInputEvent subclasses to |
57 // corresponding WebCore events. | 54 // corresponding WebCore events. |
58 | 55 |
59 class WEB_EXPORT PlatformMouseEventBuilder | |
60 : NON_EXPORTED_BASE(public PlatformMouseEvent) { | |
61 public: | |
62 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&); | |
63 }; | |
64 | 56 |
65 class WEB_EXPORT WebMouseEventBuilder | 57 class WEB_EXPORT WebMouseEventBuilder |
66 : NON_EXPORTED_BASE(public WebMouseEvent) { | 58 : NON_EXPORTED_BASE(public WebMouseEvent) { |
67 public: | 59 public: |
68 // Converts a MouseEvent to a corresponding WebMouseEvent. | 60 // Converts a MouseEvent to a corresponding WebMouseEvent. |
69 // NOTE: This is only implemented for mousemove, mouseover, mouseout, | 61 // NOTE: This is only implemented for mousemove, mouseover, mouseout, |
70 // mousedown and mouseup. If the event mapping fails, the event type will | 62 // mousedown and mouseup. If the event mapping fails, the event type will |
71 // be set to Undefined. | 63 // be set to Undefined. |
72 WebMouseEventBuilder(const Widget*, const LayoutItem, const MouseEvent&); | 64 WebMouseEventBuilder(const Widget*, const LayoutItem, const MouseEvent&); |
73 WebMouseEventBuilder(const Widget*, const LayoutItem, const TouchEvent&); | 65 WebMouseEventBuilder(const Widget*, const LayoutItem, const TouchEvent&); |
(...skipping 15 matching lines...) Expand all Loading... |
89 class WEB_EXPORT WebTouchEventBuilder | 81 class WEB_EXPORT WebTouchEventBuilder |
90 : NON_EXPORTED_BASE(public WebTouchEvent) { | 82 : NON_EXPORTED_BASE(public WebTouchEvent) { |
91 public: | 83 public: |
92 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); | 84 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); |
93 }; | 85 }; |
94 | 86 |
95 // Return a new transformed WebGestureEvent by applying the Widget's scale | 87 // Return a new transformed WebGestureEvent by applying the Widget's scale |
96 // and translation. | 88 // and translation. |
97 WEB_EXPORT WebGestureEvent TransformWebGestureEvent(Widget*, | 89 WEB_EXPORT WebGestureEvent TransformWebGestureEvent(Widget*, |
98 const WebGestureEvent&); | 90 const WebGestureEvent&); |
| 91 WEB_EXPORT WebMouseEvent TransformWebMouseEvent(Widget*, const WebMouseEvent&); |
| 92 |
99 WEB_EXPORT WebMouseWheelEvent | 93 WEB_EXPORT WebMouseWheelEvent |
100 TransformWebMouseWheelEvent(Widget*, const WebMouseWheelEvent&); | 94 TransformWebMouseWheelEvent(Widget*, const WebMouseWheelEvent&); |
101 | 95 |
102 WEB_EXPORT WebTouchEvent TransformWebTouchEvent(Widget*, const WebTouchEvent&); | 96 WEB_EXPORT WebTouchEvent TransformWebTouchEvent(Widget*, const WebTouchEvent&); |
103 | 97 |
104 Vector<PlatformMouseEvent> WEB_EXPORT | 98 Vector<WebMouseEvent> WEB_EXPORT |
105 createPlatformMouseEventVector(Widget*, | 99 TransformWebMouseEventVector(Widget*, const std::vector<const WebInputEvent*>&); |
106 const std::vector<const WebInputEvent*>&); | |
107 Vector<WebTouchEvent> WEB_EXPORT | 100 Vector<WebTouchEvent> WEB_EXPORT |
108 TransformWebTouchEventVector(Widget*, const std::vector<const WebInputEvent*>&); | 101 TransformWebTouchEventVector(Widget*, const std::vector<const WebInputEvent*>&); |
109 | 102 |
110 } // namespace blink | 103 } // namespace blink |
111 | 104 |
112 #endif | 105 #endif |
OLD | NEW |