void EventSender::reset() { // The test should have finished a drag and the mouse button state. ASSERT(currentDragData.isNull()); currentDragData.reset(); currentDragEffect = WebKit::WebDragOperationNone; currentDragEffectsAllowed = WebKit::WebDragOperationNone; pressedButton = WebMouseEvent::ButtonNone; dragMode.set(true); #if OS(WINDOWS) wmKeyDown.set(WM_KEYDOWN); wmKeyUp.set(WM_KEYUP); wmChar.set(WM_CHAR); wmDeadChar.set(WM_DEADCHAR); wmSysKeyDown.set(WM_SYSKEYDOWN); wmSysKeyUp.set(WM_SYSKEYUP); wmSysChar.set(WM_SYSCHAR); wmSysDeadChar.set(WM_SYSDEADCHAR); #endif lastMousePos = WebPoint(0, 0); lastClickTimeSec = 0; lastClickPos = WebPoint(0, 0); clickCount = 0; lastButtonType = WebMouseEvent::ButtonNone; timeOffsetMs = 0; touchModifiers = 0; touchPoints.clear(); m_taskList.revokeAll(); }
void EventSender::doMouseMove(const WebMouseEvent& e) { lastMousePos = WebPoint(e.x, e.y); webview()->handleInputEvent(e); if (pressedButton == WebMouseEvent::ButtonNone || currentDragData.isNull()) return; WebPoint clientPoint(e.x, e.y); WebPoint screenPoint(e.globalX, e.globalY); currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed); }
void EventSender::doMouseUp(const WebMouseEvent& e) { webview()->handleInputEvent(e); pressedButton = WebMouseEvent::ButtonNone; lastClickTimeSec = e.timeStampSeconds; lastClickPos = lastMousePos; // If we're in a drag operation, complete it. if (currentDragData.isNull()) return; WebPoint clientPoint(e.x, e.y); WebPoint screenPoint(e.globalX, e.globalY); currentDragEffect = webview()->dragTargetDragOver(clientPoint, screenPoint, currentDragEffectsAllowed); if (currentDragEffect) webview()->dragTargetDrop(clientPoint, screenPoint); else webview()->dragTargetDragLeave(); webview()->dragSourceEndedAt(clientPoint, screenPoint, currentDragEffect); webview()->dragSourceSystemDragEnded(); currentDragData.reset(); }