summaryrefslogtreecommitdiff
path: root/Source/WebKit/chromium/src/WebInputEventConversion.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
committerSimon Hausmann <simon.hausmann@nokia.com>2012-08-12 09:27:39 +0200
commit3749d61e1f7a59f5ec5067e560af1eb610c82015 (patch)
tree73dc228333948738bbe02976cacca8cd382bc978 /Source/WebKit/chromium/src/WebInputEventConversion.cpp
parentb32b4dcd9a51ab8de6afc53d9e17f8707e1f7a5e (diff)
downloadqtwebkit-3749d61e1f7a59f5ec5067e560af1eb610c82015.tar.gz
Imported WebKit commit a77350243e054f3460d1137301d8b3faee3d2052 (http://svn.webkit.org/repository/webkit/trunk@125365)
New snapshot with build fixes for latest API changes in Qt and all WK1 Win MSVC fixes upstream
Diffstat (limited to 'Source/WebKit/chromium/src/WebInputEventConversion.cpp')
-rw-r--r--Source/WebKit/chromium/src/WebInputEventConversion.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/Source/WebKit/chromium/src/WebInputEventConversion.cpp b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
index 207d81ca3..0391c285b 100644
--- a/Source/WebKit/chromium/src/WebInputEventConversion.cpp
+++ b/Source/WebKit/chromium/src/WebInputEventConversion.cpp
@@ -32,6 +32,7 @@
#include "WebInputEventConversion.h"
#include "EventNames.h"
+#include "GestureEvent.h"
#include "KeyboardCodes.h"
#include "KeyboardEvent.h"
#include "MouseEvent.h"
@@ -151,7 +152,7 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W
break;
case WebInputEvent::GestureTap:
m_type = PlatformEvent::GestureTap;
- m_area = IntSize(e.deltaX * 2, e.deltaY * 2);
+ m_area = IntSize(e.boundingBox.width, e.boundingBox.height);
break;
case WebInputEvent::GestureTapDown:
m_type = PlatformEvent::GestureTapDown;
@@ -164,6 +165,7 @@ PlatformGestureEventBuilder::PlatformGestureEventBuilder(Widget* widget, const W
break;
case WebInputEvent::GestureLongPress:
m_type = PlatformEvent::GestureLongPress;
+ m_area = IntSize(e.boundingBox.width, e.boundingBox.height);
break;
case WebInputEvent::GesturePinchBegin:
m_type = PlatformEvent::GesturePinchBegin;
@@ -462,6 +464,7 @@ WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event)
text[i] = event.keyEvent()->text()[i];
unmodifiedText[i] = event.keyEvent()->unmodifiedText()[i];
}
+ memcpy(keyIdentifier, event.keyIdentifier().ascii().data(), event.keyIdentifier().length());
}
#if ENABLE(TOUCH_EVENTS)
@@ -512,4 +515,31 @@ WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const TouchEven
#endif // ENABLE(TOUCH_EVENTS)
+#if ENABLE(GESTURE_EVENTS)
+WebGestureEventBuilder::WebGestureEventBuilder(const Widget* widget, const GestureEvent& event)
+{
+ if (event.type() == eventNames().gesturetapEvent)
+ type = GestureTap;
+ else if (event.type() == eventNames().gesturetapdownEvent)
+ type = GestureTapDown;
+ else if (event.type() == eventNames().gesturescrollstartEvent)
+ type = GestureScrollBegin;
+ else if (event.type() == eventNames().gesturescrollendEvent)
+ type = GestureScrollEnd;
+ else if (event.type() == eventNames().gesturescrollupdateEvent)
+ type = GestureScrollUpdate;
+
+ timeStampSeconds = event.timeStamp() / millisPerSecond;
+ modifiers = getWebInputModifiers(event);
+
+ globalX = event.screenX();
+ globalY = event.screenY();
+ x = event.absoluteLocation().x() - widget->location().x();
+ y = event.absoluteLocation().y() - widget->location().y();
+
+ deltaX = event.deltaX();
+ deltaY = event.deltaY();
+}
+#endif // ENABLE(GESTURE_EVENTS)
+
} // namespace WebKit