|
Lines 79-84
WebKit/win/WebView.cpp_sec1
|
| 79 |
#include <WebCore/GDIObjectCounter.h> |
79 |
#include <WebCore/GDIObjectCounter.h> |
| 80 |
#include <WebCore/GraphicsContext.h> |
80 |
#include <WebCore/GraphicsContext.h> |
| 81 |
#include <WebCore/HistoryItem.h> |
81 |
#include <WebCore/HistoryItem.h> |
|
|
82 |
#include <WebCore/HitTestRequest.h> |
| 82 |
#include <WebCore/HitTestResult.h> |
83 |
#include <WebCore/HitTestResult.h> |
| 83 |
#include <WebCore/IntRect.h> |
84 |
#include <WebCore/IntRect.h> |
| 84 |
#include <WebCore/KeyboardEvent.h> |
85 |
#include <WebCore/KeyboardEvent.h> |
|
Lines 95-100
WebKit/win/WebView.cpp_sec2
|
| 95 |
#include <WebCore/PluginView.h> |
96 |
#include <WebCore/PluginView.h> |
| 96 |
#include <WebCore/ProgressTracker.h> |
97 |
#include <WebCore/ProgressTracker.h> |
| 97 |
#include <WebCore/RenderTheme.h> |
98 |
#include <WebCore/RenderTheme.h> |
|
|
99 |
#include <WebCore/RenderView.h> |
| 98 |
#include <WebCore/ResourceHandle.h> |
100 |
#include <WebCore/ResourceHandle.h> |
| 99 |
#include <WebCore/ResourceHandleClient.h> |
101 |
#include <WebCore/ResourceHandleClient.h> |
| 100 |
#include <WebCore/ScriptValue.h> |
102 |
#include <WebCore/ScriptValue.h> |
|
Lines 1348-1360
bool WebView::gestureNotify(WPARAM wPara
WebKit/win/WebView.cpp_sec3
|
| 1348 |
ASSERT(SetGestureConfigPtr()); |
1350 |
ASSERT(SetGestureConfigPtr()); |
| 1349 |
|
1351 |
|
| 1350 |
DWORD dwPanWant; |
1352 |
DWORD dwPanWant; |
| 1351 |
DWORD dwPanBlock; |
1353 |
DWORD dwPanBlock; |
| 1352 |
|
1354 |
|
| 1353 |
// Translate gesture location to client to hit test on scrollbars |
1355 |
// Translate gesture location to client to hit test on scrollbars |
| 1354 |
POINT gestureBeginPoint = {gn->ptsLocation.x, gn->ptsLocation.y}; |
1356 |
POINT gestureBeginPoint = {gn->ptsLocation.x, gn->ptsLocation.y}; |
| 1355 |
ScreenToClient(m_viewWindow, &gestureBeginPoint); |
1357 |
IntPoint eventHandlerPoint = m_page->mainFrame()->view()->screenToContents(gestureBeginPoint); |
| 1356 |
|
1358 |
|
| 1357 |
if (gestureBeginPoint.x > view->visibleWidth()) { |
1359 |
HitTestResult scrollbarTest = m_page->mainFrame()->eventHandler()->hitTestResultAtPoint(eventHandlerPoint, true, false, ShouldHitTestScrollbars); |
|
|
1360 |
|
| 1361 |
if (eventHandlerPoint.x() > view->visibleWidth() || scrollbarTest.scrollbar()) { |
| 1358 |
// We are in the scrollbar, turn off panning, need to be able to drag the scrollbar |
1362 |
// We are in the scrollbar, turn off panning, need to be able to drag the scrollbar |
| 1359 |
dwPanWant = GC_PAN | GC_PAN_WITH_INERTIA | GC_PAN_WITH_GUTTER; |
1363 |
dwPanWant = GC_PAN | GC_PAN_WITH_INERTIA | GC_PAN_WITH_GUTTER; |
| 1360 |
dwPanBlock = GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY | GC_PAN_WITH_SINGLE_FINGER_VERTICALLY; |
1364 |
dwPanBlock = GC_PAN_WITH_SINGLE_FINGER_HORIZONTALLY | GC_PAN_WITH_SINGLE_FINGER_VERTICALLY; |
|
Lines 1389-1412
bool WebView::gesture(WPARAM wParam, LPA
WebKit/win/WebView.cpp_sec4
|
| 1389 |
CloseGestureInfoHandlePtr()(gestureHandle); |
1393 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1390 |
break; |
1394 |
break; |
| 1391 |
case GID_PAN: { |
1395 |
case GID_PAN: { |
| 1392 |
Frame* coreFrame = core(m_mainFrame); |
|
|
| 1393 |
if (!coreFrame) { |
| 1394 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1395 |
return false; |
| 1396 |
} |
| 1397 |
|
| 1398 |
ScrollView* view = coreFrame->view(); |
| 1399 |
if (!view) { |
| 1400 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1401 |
return false; |
| 1402 |
} |
| 1403 |
|
| 1404 |
Scrollbar* vertScrollbar = view->verticalScrollbar(); |
| 1405 |
if (!vertScrollbar) { |
| 1406 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1407 |
return true; //No panning of any kind when no vertical scrollbar, matches IE8 |
| 1408 |
} |
| 1409 |
|
| 1410 |
// Where are the fingers currently? |
1396 |
// Where are the fingers currently? |
| 1411 |
long currentX = gi.ptsLocation.x; |
1397 |
long currentX = gi.ptsLocation.x; |
| 1412 |
long currentY = gi.ptsLocation.y; |
1398 |
long currentY = gi.ptsLocation.y; |
|
Lines 1414-1420
bool WebView::gesture(WPARAM wParam, LPA
WebKit/win/WebView.cpp_sec5
|
| 1414 |
// How far did we pan in each direction? |
1400 |
// How far did we pan in each direction? |
| 1415 |
long deltaX = currentX - m_lastPanX; |
1401 |
long deltaX = currentX - m_lastPanX; |
| 1416 |
long deltaY = currentY - m_lastPanY; |
1402 |
long deltaY = currentY - m_lastPanY; |
| 1417 |
|
1403 |
|
| 1418 |
// Calculate the overpan for window bounce |
1404 |
// Calculate the overpan for window bounce |
| 1419 |
m_yOverpan -= m_lastPanY - currentY; |
1405 |
m_yOverpan -= m_lastPanY - currentY; |
| 1420 |
m_xOverpan -= m_lastPanX - currentX; |
1406 |
m_xOverpan -= m_lastPanX - currentX; |
|
Lines 1423-1430
bool WebView::gesture(WPARAM wParam, LPA
WebKit/win/WebView.cpp_sec6
|
| 1423 |
m_lastPanX = currentX; |
1409 |
m_lastPanX = currentX; |
| 1424 |
m_lastPanY = currentY; |
1410 |
m_lastPanY = currentY; |
| 1425 |
|
1411 |
|
|
|
1412 |
Frame* coreFrame = core(m_mainFrame); |
| 1413 |
if (!coreFrame) { |
| 1414 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1415 |
return false; |
| 1416 |
} |
| 1426 |
// Represent the pan gesture as a mouse wheel event |
1417 |
// Represent the pan gesture as a mouse wheel event |
| 1427 |
PlatformWheelEvent wheelEvent(m_viewWindow, deltaX, deltaY, currentX, currentY); |
1418 |
PlatformWheelEvent wheelEvent(m_viewWindow, FloatSize(deltaX, deltaY), FloatPoint(currentX, currentY)); |
| 1428 |
coreFrame->eventHandler()->handleWheelEvent(wheelEvent); |
1419 |
coreFrame->eventHandler()->handleWheelEvent(wheelEvent); |
| 1429 |
|
1420 |
|
| 1430 |
if (!(UpdatePanningFeedbackPtr() && BeginPanningFeedbackPtr() && EndPanningFeedbackPtr())) { |
1421 |
if (!(UpdatePanningFeedbackPtr() && BeginPanningFeedbackPtr() && EndPanningFeedbackPtr())) { |
|
Lines 1432-1443
bool WebView::gesture(WPARAM wParam, LPA
WebKit/win/WebView.cpp_sec7
|
| 1432 |
return true; |
1423 |
return true; |
| 1433 |
} |
1424 |
} |
| 1434 |
|
1425 |
|
| 1435 |
// FIXME: Support Horizontal Window Bounce |
|
|
| 1436 |
if (vertScrollbar->currentPos() == 0) |
| 1437 |
UpdatePanningFeedbackPtr()(m_viewWindow, 0, m_yOverpan, gi.dwFlags & GF_INERTIA); |
| 1438 |
else if (vertScrollbar->currentPos() >= vertScrollbar->maximum()) |
| 1439 |
UpdatePanningFeedbackPtr()(m_viewWindow, 0, m_yOverpan, gi.dwFlags & GF_INERTIA); |
| 1440 |
|
| 1441 |
if (gi.dwFlags & GF_BEGIN) { |
1426 |
if (gi.dwFlags & GF_BEGIN) { |
| 1442 |
BeginPanningFeedbackPtr()(m_viewWindow); |
1427 |
BeginPanningFeedbackPtr()(m_viewWindow); |
| 1443 |
m_yOverpan = 0; |
1428 |
m_yOverpan = 0; |
|
Lines 1446-1451
bool WebView::gesture(WPARAM wParam, LPA
WebKit/win/WebView.cpp_sec8
|
| 1446 |
m_yOverpan = 0; |
1431 |
m_yOverpan = 0; |
| 1447 |
} |
1432 |
} |
| 1448 |
|
1433 |
|
|
|
1434 |
ScrollView* view = coreFrame->view(); |
| 1435 |
if (!view) { |
| 1436 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1437 |
return false; |
| 1438 |
} |
| 1439 |
Scrollbar* vertScrollbar = view->verticalScrollbar(); |
| 1440 |
if (!vertScrollbar) { |
| 1441 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1442 |
return true; |
| 1443 |
} |
| 1444 |
|
| 1445 |
// FIXME: Support Horizontal Window Bounce |
| 1446 |
if (vertScrollbar->currentPos() == 0) |
| 1447 |
UpdatePanningFeedbackPtr()(m_viewWindow, 0, m_yOverpan, gi.dwFlags & GF_INERTIA); |
| 1448 |
else if (vertScrollbar->currentPos() >= vertScrollbar->maximum()) |
| 1449 |
UpdatePanningFeedbackPtr()(m_viewWindow, 0, m_yOverpan, gi.dwFlags & GF_INERTIA); |
| 1450 |
|
| 1449 |
CloseGestureInfoHandlePtr()(gestureHandle); |
1451 |
CloseGestureInfoHandlePtr()(gestureHandle); |
| 1450 |
break; |
1452 |
break; |
| 1451 |
} |
1453 |
} |