WebKit2: Add Trackpoint driver hack to support IBM trackpads
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Mar 2011 20:47:49 +0000 (20:47 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 24 Mar 2011 20:47:49 +0000 (20:47 +0000)
commit4ff677f8e2926d94a3ead6b7952262dc4206df8f
treeb417ca5602b092694c03412f5cc48f35064f272e
parentb8241509d529fd678a4f54843ebd535cab1f2fed
WebKit2: Add Trackpoint driver hack to support IBM trackpads
https://bugs.webkit.org/show_bug.cgi?id=49830
<rdar://problem/8705951>

Reviewed by Adam Roben.

Copy code from WebKit1 to WebKit2 to handle initializing fake scrollbars so
IBM machines with a trackpad send us WM_VSCROLL and WM_HSCROLL messages.

Listen for the WM_VSCROLL and WM_HSCROLL messages, and turn the values into
ScrollDirection and ScrollGranularity, and send a scroll command to the
WebProcess.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::scrollBy): Send a message to the WebProcess.
* UIProcess/WebPageProxy.h:
* UIProcess/win/WebView.cpp:
(WebKit::WebView::wndProc): Add WM_VSCROLL and WM_HSCROLL message handling.
(WebKit::WebView::initialize): Call shouldInitializeTrackPointHack.
(WebKit::WebView::onHorizontalScroll): Turn wParam into a ScrollDirection and ScrollGranularity.
(WebKit::WebView::onVerticalScroll): Ditto.
(WebKit::WebView::shouldInitializeTrackPointHack): Check the registry for keys that indicate
    the machine has a IBM Trackpoint driver.
* UIProcess/win/WebView.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::scrollBy): Call scroll method.
(WebKit::WebPage::scroll): Moved from WebPageMac and WebPageWin.
(WebKit::WebPage::logicalScroll): Ditto.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Add a new scrollBy message.
* WebProcess/WebPage/mac/WebPageMac.mm: Remove scroll and logicalScroll, they are now in WebPage.cpp.
* WebProcess/WebPage/win/WebPageWin.cpp: Ditto.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@81895 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/win/WebView.cpp
Source/WebKit2/UIProcess/win/WebView.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm
Source/WebKit2/WebProcess/WebPage/win/WebPageWin.cpp