Source/WebCore: WebCore part of <rdar://problem/10262242> Add API for paginated display
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 01:19:46 +0000 (01:19 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Nov 2011 01:19:46 +0000 (01:19 +0000)
commitfb4c6b45465db64ab370aab18b022add0beebe33
tree439d38dccd082745589816f8b797b8a280327775
parent30ac20c6a6aefa5f6aa3a9417c91f784f578abc7
Source/WebCore: WebCore part of <rdar://problem/10262242> Add API for paginated display
https://bugs.webkit.org/show_bug.cgi?id=72537

Reviewed by Anders Carlsson.

* WebCore.exp.in: Exported Page::pageCount().
* page/Page.cpp:
(WebCore::Page::pageCount): Added this getter.
* page/Page.h:

Source/WebKit/mac: WebKit/mac part of <rdar://problem/10262242> Add API for paginated display
https://bugs.webkit.org/show_bug.cgi?id=72537

Reviewed by Anders Carlsson.

* WebView/WebView.mm:
(-[WebView _setPaginationMode:]): Added this accessor.
(-[WebView _paginationMode]): Ditto.
(-[WebView _setGapBetweenPages:]): Ditto.
(-[WebView _gapBetweenPages]): Ditto.
(-[WebView _pageCount]): Ditto.
* WebView/WebViewPrivate.h: Defined WebPaginationMode enum and values.

Source/WebKit2: WebKit2 part of <rdar://problem/10262242> Add API for paginated display
https://bugs.webkit.org/show_bug.cgi?id=72537

Reviewed by Anders Carlsson.

* Shared/WebPageCreationParameters.cpp:
(WebKit::WebPageCreationParameters::encode): Encode the pagination mode and gap between pages.
(WebKit::WebPageCreationParameters::decode): Decode the pagination mode and gap between pages.
* Shared/WebPageCreationParameters.h: Added paginationMode and gapBetweenPages members.
* UIProcess/API/C/WKPage.cpp:
(WKPageSetPaginationMode): Added this API wrapper.
(WKPageGetPaginationMode): Ditto.
(WKPageSetGapBetweenPages): Ditto.
(WKPageGetGapBetweenPages): Ditto.
(WKPageGetPageCount): Ditto.
* UIProcess/API/C/WKPagePrivate.h: Added an enum and a definition of WKPaginationMode and
accessors.
* UIProcess/API/mac/WKBrowsingContextController.mm:
(-[WKBrowsingContextController setPaginationMode:]): Added this API wrapper.
(-[WKBrowsingContextController paginationMode]): Ditto.
(-[WKBrowsingContextController setGapBetweenPages:]): Ditto.
(-[WKBrowsingContextController gapBetweenPages]): Ditto.
(-[WKBrowsingContextController pageCount]): Ditto.
* UIProcess/API/mac/WKBrowsingContextControllerPrivate.h: Added. Includes an enum and a definition
of WKBrowsingContextPaginationMode and property declarations.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy): Added intialization of m_paginationMode, m_gapBetweenPages,
and m_pageCount.
(WebKit::WebPageProxy::setPaginationMode): Added this accessor, which caches the value and sends
a message to the WebPage.
(WebKit::WebPageProxy::setGapBetweenPages): Ditto.
(WebKit::WebPageProxy::creationParameters): Set the pagination mode and gap between pages in the
creation parameters.
(WebKit::WebPageProxy::didChangePageCount): Added. Updates the cached page count.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::paginationMode): Added this getter that returns a cached value.
(WebKit::WebPageProxy::gapBetweenPages): Ditto.
(WebKit::WebPageProxy::pageCount): Ditto.
* UIProcess/WebPageProxy.messages.in: Added DidChangedPageCount, sent when the page count changes
after layout.
* WebKit2.xcodeproj/project.pbxproj: Added WKBrowsingContextControllerPrivate.h.
* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::dispatchDidLayout): Added a call to WebPage::mainFrameDidLayout(),
allowing the page to respond to changes in the column count.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage): Added initializer for m_cachedPageCount.
(WebKit::WebPage::setPaginationMode): Added.
(WebKit::WebPage::setGapBetweenPages): Added.
(WebKit::WebPage::mainFrameDidLayout): Added. Sends a DidChangePageCount message to the UI process
if the page count has changed.
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in: Added SetPaginationMode and SetGapBetweenPages messages.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100534 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewPrivate.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPageCreationParameters.cpp
Source/WebKit2/Shared/WebPageCreationParameters.h
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPagePrivate.h
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextController.mm
Source/WebKit2/UIProcess/API/mac/WKBrowsingContextControllerPrivate.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in