| 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 14 matching lines...) Expand all Loading... |
| 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" | 34 #include "platform/PlatformMouseEvent.h" |
| 35 #include "platform/PlatformTouchEvent.h" | |
| 36 #include "platform/scroll/ScrollTypes.h" | 35 #include "platform/scroll/ScrollTypes.h" |
| 37 #include "public/platform/WebInputEvent.h" | 36 #include "public/platform/WebInputEvent.h" |
| 38 #include "public/platform/WebKeyboardEvent.h" | 37 #include "public/platform/WebKeyboardEvent.h" |
| 39 #include "public/platform/WebMouseWheelEvent.h" | 38 #include "public/platform/WebMouseWheelEvent.h" |
| 40 #include "public/platform/WebTouchEvent.h" | 39 #include "public/platform/WebTouchEvent.h" |
| 41 #include "web/WebExport.h" | 40 #include "web/WebExport.h" |
| 42 #include "wtf/Compiler.h" | 41 #include "wtf/Compiler.h" |
| 43 #include <vector> | 42 #include <vector> |
| 44 | 43 |
| 45 namespace blink { | 44 namespace blink { |
| (...skipping 10 matching lines...) Expand all Loading... |
| 56 | 55 |
| 57 // These classes are used to convert from WebInputEvent subclasses to | 56 // These classes are used to convert from WebInputEvent subclasses to |
| 58 // corresponding WebCore events. | 57 // corresponding WebCore events. |
| 59 | 58 |
| 60 class WEB_EXPORT PlatformMouseEventBuilder | 59 class WEB_EXPORT PlatformMouseEventBuilder |
| 61 : NON_EXPORTED_BASE(public PlatformMouseEvent) { | 60 : NON_EXPORTED_BASE(public PlatformMouseEvent) { |
| 62 public: | 61 public: |
| 63 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&); | 62 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&); |
| 64 }; | 63 }; |
| 65 | 64 |
| 66 // Converts a WebTouchPoint to a PlatformTouchPoint. | |
| 67 class WEB_EXPORT PlatformTouchPointBuilder | |
| 68 : NON_EXPORTED_BASE(public PlatformTouchPoint) { | |
| 69 public: | |
| 70 PlatformTouchPointBuilder(Widget*, const WebTouchPoint&); | |
| 71 }; | |
| 72 | |
| 73 // Converts a WebTouchEvent to a PlatformTouchEvent. | |
| 74 class WEB_EXPORT PlatformTouchEventBuilder | |
| 75 : NON_EXPORTED_BASE(public PlatformTouchEvent) { | |
| 76 public: | |
| 77 PlatformTouchEventBuilder(Widget*, const WebTouchEvent&); | |
| 78 }; | |
| 79 | |
| 80 class WEB_EXPORT WebMouseEventBuilder | 65 class WEB_EXPORT WebMouseEventBuilder |
| 81 : NON_EXPORTED_BASE(public WebMouseEvent) { | 66 : NON_EXPORTED_BASE(public WebMouseEvent) { |
| 82 public: | 67 public: |
| 83 // Converts a MouseEvent to a corresponding WebMouseEvent. | 68 // Converts a MouseEvent to a corresponding WebMouseEvent. |
| 84 // NOTE: This is only implemented for mousemove, mouseover, mouseout, | 69 // NOTE: This is only implemented for mousemove, mouseover, mouseout, |
| 85 // mousedown and mouseup. If the event mapping fails, the event type will | 70 // mousedown and mouseup. If the event mapping fails, the event type will |
| 86 // be set to Undefined. | 71 // be set to Undefined. |
| 87 WebMouseEventBuilder(const Widget*, const LayoutItem, const MouseEvent&); | 72 WebMouseEventBuilder(const Widget*, const LayoutItem, const MouseEvent&); |
| 88 WebMouseEventBuilder(const Widget*, const LayoutItem, const TouchEvent&); | 73 WebMouseEventBuilder(const Widget*, const LayoutItem, const TouchEvent&); |
| 89 }; | 74 }; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 107 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); | 92 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); |
| 108 }; | 93 }; |
| 109 | 94 |
| 110 // Return a new transformed WebGestureEvent by applying the Widget's scale | 95 // Return a new transformed WebGestureEvent by applying the Widget's scale |
| 111 // and translation. | 96 // and translation. |
| 112 WEB_EXPORT WebGestureEvent TransformWebGestureEvent(Widget*, | 97 WEB_EXPORT WebGestureEvent TransformWebGestureEvent(Widget*, |
| 113 const WebGestureEvent&); | 98 const WebGestureEvent&); |
| 114 WEB_EXPORT WebMouseWheelEvent | 99 WEB_EXPORT WebMouseWheelEvent |
| 115 TransformWebMouseWheelEvent(Widget*, const WebMouseWheelEvent&); | 100 TransformWebMouseWheelEvent(Widget*, const WebMouseWheelEvent&); |
| 116 | 101 |
| 102 WEB_EXPORT WebTouchEvent TransformWebTouchEvent(Widget*, const WebTouchEvent&); |
| 103 |
| 117 Vector<PlatformMouseEvent> WEB_EXPORT | 104 Vector<PlatformMouseEvent> WEB_EXPORT |
| 118 createPlatformMouseEventVector(Widget*, | 105 createPlatformMouseEventVector(Widget*, |
| 119 const std::vector<const WebInputEvent*>&); | 106 const std::vector<const WebInputEvent*>&); |
| 120 Vector<PlatformTouchEvent> WEB_EXPORT | 107 Vector<WebTouchEvent> WEB_EXPORT |
| 121 createPlatformTouchEventVector(Widget*, | 108 TransformWebTouchEventVector(Widget*, const std::vector<const WebInputEvent*>&); |
| 122 const std::vector<const WebInputEvent*>&); | |
| 123 | 109 |
| 124 } // namespace blink | 110 } // namespace blink |
| 125 | 111 |
| 126 #endif | 112 #endif |
| OLD | NEW |