[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
andersca at apple.com
andersca at apple.com
Wed Dec 22 15:38:56 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ad9d26dc307d8241ad1fdf76c4a3994af81c1a4e
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 9 23:19:11 2010 +0000
Add injected bundle API for creating page overlays
https://bugs.webkit.org/show_bug.cgi?id=49282
Reviewed by Sam Weinig.
* Shared/API/c/WKBase.h:
Add WKBundlePageOverlayRef.
* Shared/APIObject.h:
Add TypeBundlePageOverlay.
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
Add new files.
* WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
Add WKBundlePageOverlayRef mapping.
* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageInstallPageOverlay):
Install the passed in page overlay.
(WKBundlePageUninstallPageOverlay):
Uninstall the passed in page overlay.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: Added.
(PageOverlayClientImpl::create):
(PageOverlayClientImpl::PageOverlayClientImpl):
(PageOverlayClientImpl::pageOverlayDestroyed):
(PageOverlayClientImpl::willMoveToWebPage):
(PageOverlayClientImpl::didMoveToWebPage):
(PageOverlayClientImpl::drawRect):
(PageOverlayClientImpl::mouseEvent):
Add a PageOverlay::Client subclass that forwards everything to its client.
(WKBundlePageOverlayGetTypeID):
(WKBundlePageOverlayCreate):
Create a page overlay.
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::pageOverlayDestroyed):
* WebProcess/WebPage/FindController.h:
Add stub.
* WebProcess/WebPage/PageOverlay.h:
Inherit from APIObject.
(WebKit::PageOverlay::type):
return TypeBundlePageOverlay.
* win/WebKit2.vcproj:
Add new files.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@71685 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 8394436..037d260 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -135,6 +135,61 @@
Reviewed by Sam Weinig.
+ Add injected bundle API for creating page overlays
+ https://bugs.webkit.org/show_bug.cgi?id=49282
+
+ * Shared/API/c/WKBase.h:
+ Add WKBundlePageOverlayRef.
+
+ * Shared/APIObject.h:
+ Add TypeBundlePageOverlay.
+
+ * WebKit2.pro:
+ * WebKit2.xcodeproj/project.pbxproj:
+ Add new files.
+
+ * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h:
+ Add WKBundlePageOverlayRef mapping.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+ (WKBundlePageInstallPageOverlay):
+ Install the passed in page overlay.
+
+ (WKBundlePageUninstallPageOverlay):
+ Uninstall the passed in page overlay.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp: Added.
+ (PageOverlayClientImpl::create):
+ (PageOverlayClientImpl::PageOverlayClientImpl):
+ (PageOverlayClientImpl::pageOverlayDestroyed):
+ (PageOverlayClientImpl::willMoveToWebPage):
+ (PageOverlayClientImpl::didMoveToWebPage):
+ (PageOverlayClientImpl::drawRect):
+ (PageOverlayClientImpl::mouseEvent):
+ Add a PageOverlay::Client subclass that forwards everything to its client.
+
+ (WKBundlePageOverlayGetTypeID):
+ (WKBundlePageOverlayCreate):
+ Create a page overlay.
+
+ * WebProcess/WebPage/FindController.cpp:
+ (WebKit::FindController::pageOverlayDestroyed):
+ * WebProcess/WebPage/FindController.h:
+ Add stub.
+
+ * WebProcess/WebPage/PageOverlay.h:
+ Inherit from APIObject.
+
+ (WebKit::PageOverlay::type):
+ return TypeBundlePageOverlay.
+
+ * win/WebKit2.vcproj:
+ Add new files.
+
+2010-11-09 Anders Carlsson <andersca at apple.com>
+
+ Reviewed by Sam Weinig.
+
Get rid of FindPageOverlay
https://bugs.webkit.org/show_bug.cgi?id=49268
diff --git a/WebKit2/Shared/API/c/WKBase.h b/WebKit2/Shared/API/c/WKBase.h
index 21229b4..c220eac 100644
--- a/WebKit2/Shared/API/c/WKBase.h
+++ b/WebKit2/Shared/API/c/WKBase.h
@@ -80,6 +80,7 @@ typedef const struct OpaqueWKBundleFrame* WKBundleFrameRef;
typedef const struct OpaqueWKBundleHitTestResult* WKBundleHitTestResultRef;
typedef const struct OpaqueWKBundleNodeHandle* WKBundleNodeHandleRef;
typedef const struct OpaqueWKBundlePage* WKBundlePageRef;
+typedef const struct OpaqueWKBundlePageOverlay* WKBundlePageOverlayRef;
typedef const struct OpaqueWKBundleRangeHandle* WKBundleRangeHandleRef;
typedef const struct OpaqueWKBundleScriptWorld* WKBundleScriptWorldRef;
typedef const struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef;
diff --git a/WebKit2/Shared/APIObject.h b/WebKit2/Shared/APIObject.h
index dd626a5..b53c9d5 100644
--- a/WebKit2/Shared/APIObject.h
+++ b/WebKit2/Shared/APIObject.h
@@ -75,6 +75,7 @@ public:
TypeBundleHitTestResult,
TypeBundleNodeHandle,
TypeBundlePage,
+ TypeBundlePageOverlay,
TypeBundleRangeHandle,
TypeBundleScriptWorld,
diff --git a/WebKit2/WebKit2.pro b/WebKit2/WebKit2.pro
index ee66c42..58f571c 100644
--- a/WebKit2/WebKit2.pro
+++ b/WebKit2/WebKit2.pro
@@ -316,6 +316,7 @@ HEADERS += \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.h \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandlePrivate.h \
WebProcess/InjectedBundle/API/c/WKBundlePage.h \
+ WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.h \
WebProcess/InjectedBundle/InjectedBundle.h \
@@ -485,6 +486,7 @@ SOURCES += \
WebProcess/InjectedBundle/API/c/WKBundleHitTestResult.cpp \
WebProcess/InjectedBundle/API/c/WKBundleNodeHandle.cpp \
WebProcess/InjectedBundle/API/c/WKBundlePage.cpp \
+ WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp \
WebProcess/InjectedBundle/API/c/WKBundleScriptWorld.cpp \
WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.cpp \
WebProcess/InjectedBundle/DOM/InjectedBundleRangeHandle.cpp \
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index fcfeb12..f7e207f 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -77,6 +77,7 @@
1A2161B111F37664008AD0F5 /* NPRuntimeObjectMap.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2161AF11F37664008AD0F5 /* NPRuntimeObjectMap.cpp */; };
1A2162B011F38971008AD0F5 /* NPRuntimeUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */; };
1A2162B111F38971008AD0F5 /* NPRuntimeUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */; };
+ 1A22F1011289FCD90085E74F /* WKBundlePageOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */; };
1A24B5F211F531E800C38269 /* MachUtilities.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A24B5F011F531E800C38269 /* MachUtilities.cpp */; };
1A24B5F311F531E800C38269 /* MachUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A24B5F111F531E800C38269 /* MachUtilities.h */; };
1A24BED5120894D100FBB059 /* SharedMemory.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A24BED3120894D100FBB059 /* SharedMemory.h */; };
@@ -620,6 +621,8 @@
1A2161AF11F37664008AD0F5 /* NPRuntimeObjectMap.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeObjectMap.cpp; sourceTree = "<group>"; };
1A2162AE11F38971008AD0F5 /* NPRuntimeUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NPRuntimeUtilities.cpp; sourceTree = "<group>"; };
1A2162AF11F38971008AD0F5 /* NPRuntimeUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NPRuntimeUtilities.h; sourceTree = "<group>"; };
+ 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKBundlePageOverlay.h; sourceTree = "<group>"; };
+ 1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKBundlePageOverlay.cpp; sourceTree = "<group>"; };
1A24B5F011F531E800C38269 /* MachUtilities.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = MachUtilities.cpp; sourceTree = "<group>"; };
1A24B5F111F531E800C38269 /* MachUtilities.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MachUtilities.h; sourceTree = "<group>"; };
1A24BED3120894D100FBB059 /* SharedMemory.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SharedMemory.h; sourceTree = "<group>"; };
@@ -1876,6 +1879,8 @@
BC57450B1263B155006F0F12 /* WKBundleNodeHandlePrivate.h */,
BC20528011C94284008F3375 /* WKBundlePage.cpp */,
BC20527F11C94284008F3375 /* WKBundlePage.h */,
+ 1A22F1001289FCD90085E74F /* WKBundlePageOverlay.cpp */,
+ 1A22F0FF1289FCD90085E74F /* WKBundlePageOverlay.h */,
BC1B419711D41D570011E8DD /* WKBundlePagePrivate.h */,
BCF049E511FE20F600F86A58 /* WKBundlePrivate.h */,
BC60C5781240A546008C5E29 /* WKBundleRangeHandle.cpp */,
@@ -2491,6 +2496,7 @@
1A6FA31111E3921E00DB1371 /* MainMac.cpp in Sources */,
1A1FA285127A13BC0050E709 /* NPObjectProxy.cpp in Sources */,
1A1FA35D127A45BF0050E709 /* NPObjectMessageReceiver.cpp in Sources */,
+ 1A22F1011289FCD90085E74F /* WKBundlePageOverlay.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
index 100a197..43c307e 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
@@ -48,6 +48,7 @@ class InjectedBundleHitTestResult;
class InjectedBundleNodeHandle;
class InjectedBundleRangeHandle;
class InjectedBundleScriptWorld;
+class PageOverlay;
class WebFrame;
class WebPage;
@@ -57,6 +58,7 @@ WK_ADD_API_MAPPING(WKBundleCSSStyleDeclarationRef, WebCore::CSSStyleDeclaration)
WK_ADD_API_MAPPING(WKBundleFrameRef, WebFrame)
WK_ADD_API_MAPPING(WKBundleHitTestResultRef, InjectedBundleHitTestResult)
WK_ADD_API_MAPPING(WKBundleNodeHandleRef, InjectedBundleNodeHandle)
+WK_ADD_API_MAPPING(WKBundlePageOverlayRef, PageOverlay)
WK_ADD_API_MAPPING(WKBundlePageRef, WebPage)
WK_ADD_API_MAPPING(WKBundleRangeHandleRef, InjectedBundleRangeHandle)
WK_ADD_API_MAPPING(WKBundleRef, InjectedBundle)
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
index 474ebf7..ccf3131 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp
@@ -132,3 +132,13 @@ WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef pageRe
{
return toAPI(toImpl(pageRef)->backForwardList());
}
+
+void WKBundlePageInstallPageOverlay(WKBundlePageRef pageRef, WKBundlePageOverlayRef pageOverlayRef)
+{
+ toImpl(pageRef)->installPageOverlay(toImpl(pageOverlayRef));
+}
+
+void WKBundlePageUninstallPageOverlay(WKBundlePageRef pageRef)
+{
+ toImpl(pageRef)->uninstallPageOverlay();
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
index 6ca58a7..8dcb257 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
@@ -203,6 +203,9 @@ WK_EXPORT WKBundleFrameRef WKBundlePageGetMainFrame(WKBundlePageRef page);
WK_EXPORT WKBundleBackForwardListRef WKBundlePageGetBackForwardList(WKBundlePageRef page);
+WK_EXPORT void WKBundlePageInstallPageOverlay(WKBundlePageRef page, WKBundlePageOverlayRef pageOverlay);
+WK_EXPORT void WKBundlePageUninstallPageOverlay(WKBundlePageRef page);
+
#ifdef __cplusplus
}
#endif
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
new file mode 100644
index 0000000..0ee81d9
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
@@ -0,0 +1,103 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKBundlePageOverlay.h"
+
+#include "PageOverlay.h"
+#include "WKAPICast.h"
+#include "WKBundleAPICast.h"
+#include <WebCore/GraphicsContext.h>
+#include <wtf/PassOwnPtr.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+class PageOverlayClientImpl : public PageOverlay::Client {
+public:
+ static PassOwnPtr<PageOverlayClientImpl> create(WKBundlePageOverlayClient* client)
+ {
+ return adoptPtr(new PageOverlayClientImpl(client));
+ }
+
+private:
+ explicit PageOverlayClientImpl(WKBundlePageOverlayClient* client)
+ : m_client()
+ {
+ if (client)
+ m_client = *client;
+ }
+
+ // PageOverlay::Client.
+ virtual void pageOverlayDestroyed(PageOverlay*)
+ {
+ delete this;
+ }
+
+ virtual void willMoveToWebPage(PageOverlay* pageOverlay, WebPage* page)
+ {
+ if (!m_client.willMoveToPage)
+ return;
+
+ m_client.willMoveToPage(toAPI(pageOverlay), toAPI(page), m_client.clientInfo);
+ }
+
+ virtual void didMoveToWebPage(PageOverlay* pageOverlay, WebPage* page)
+ {
+ if (!m_client.didMoveToPage)
+ return;
+
+ m_client.didMoveToPage(toAPI(pageOverlay), toAPI(page), m_client.clientInfo);
+ }
+
+ virtual void drawRect(PageOverlay* pageOverlay, GraphicsContext& graphicsContext, const IntRect& dirtyRect)
+ {
+ if (!m_client.drawRect)
+ return;
+
+ m_client.drawRect(toAPI(pageOverlay), graphicsContext.platformContext(), toAPI(dirtyRect), m_client.clientInfo);
+ }
+
+ virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&)
+ {
+ return false;
+ }
+
+ WKBundlePageOverlayClient m_client;
+};
+
+WKTypeID WKBundlePageOverlayGetTypeID()
+{
+ return toAPI(PageOverlay::APIType);
+}
+
+WKBundlePageOverlayRef WKBundlePageOverlayCreate(WKBundlePageOverlayClient* wkClient)
+{
+ if (wkClient && wkClient->version)
+ return 0;
+
+ OwnPtr<PageOverlayClientImpl> clientImpl = PageOverlayClientImpl::create(wkClient);
+
+ return toAPI(PageOverlay::create(clientImpl.leakPtr()).leakRef());
+}
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
new file mode 100644
index 0000000..194039e
--- /dev/null
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKBundlePageOverlay_h
+#define WKBundlePageOverlay_h
+
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKGeometry.h>
+
+#ifndef __cplusplus
+#include <stdbool.h>
+#endif
+
+#include <stdint.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+// Page overload client.
+typedef void (*WKBundlePageOverlayWillMoveToPageCallback)(WKBundlePageOverlayRef pageOverlay, WKBundlePageRef page, const void *clientInfo);
+typedef void (*WKBundlePageOverlayDidMoveToPageCallback)(WKBundlePageOverlayRef pageOverlay, WKBundlePageRef page, const void *clientInfo);
+typedef void (*WKBundlePageOverlayDrawRectCallback)(WKBundlePageOverlayRef pageOverlay, void* graphicsContext, WKRect dirtyRect, const void *clientInfo);
+
+struct WKBundlePageOverlayClient {
+ int version;
+ const void * clientInfo;
+ WKBundlePageOverlayWillMoveToPageCallback willMoveToPage;
+ WKBundlePageOverlayDidMoveToPageCallback didMoveToPage;
+ WKBundlePageOverlayDrawRectCallback drawRect;
+};
+typedef struct WKBundlePageOverlayClient WKBundlePageOverlayClient;
+
+WK_EXPORT WKTypeID WKBundlePageOverlayGetTypeID();
+
+WK_EXPORT WKBundlePageOverlayRef WKBundlePageOverlayCreate(WKBundlePageOverlayClient* client);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif // WKBundlePageOverlay_h
diff --git a/WebKit2/WebProcess/WebPage/FindController.cpp b/WebKit2/WebProcess/WebPage/FindController.cpp
index c762ed6..e7c6ff4 100644
--- a/WebKit2/WebProcess/WebPage/FindController.cpp
+++ b/WebKit2/WebProcess/WebPage/FindController.cpp
@@ -216,6 +216,10 @@ Vector<IntRect> FindController::rectsForTextMatches()
return rects;
}
+void FindController::pageOverlayDestroyed(PageOverlay*)
+{
+}
+
void FindController::willMoveToWebPage(PageOverlay*, WebPage* webPage)
{
if (webPage)
diff --git a/WebKit2/WebProcess/WebPage/FindController.h b/WebKit2/WebProcess/WebPage/FindController.h
index c5bad25..14bfbb0 100644
--- a/WebKit2/WebProcess/WebPage/FindController.h
+++ b/WebKit2/WebProcess/WebPage/FindController.h
@@ -56,6 +56,7 @@ public:
private:
// PageOverlay::Client.
+ virtual void pageOverlayDestroyed(PageOverlay*);
virtual void willMoveToWebPage(PageOverlay*, WebPage*);
virtual void didMoveToWebPage(PageOverlay*, WebPage*);
virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&);
diff --git a/WebKit2/WebProcess/WebPage/PageOverlay.h b/WebKit2/WebProcess/WebPage/PageOverlay.h
index 849ff35..012cf22 100644
--- a/WebKit2/WebProcess/WebPage/PageOverlay.h
+++ b/WebKit2/WebProcess/WebPage/PageOverlay.h
@@ -26,8 +26,8 @@
#ifndef PageOverlay_h
#define PageOverlay_h
+#include "APIObject.h"
#include <wtf/PassRefPtr.h>
-#include <wtf/RefCounted.h>
namespace WebCore {
class GraphicsContext;
@@ -39,19 +39,22 @@ namespace WebKit {
class WebMouseEvent;
class WebPage;
-class PageOverlay : public RefCounted<PageOverlay> {
+class PageOverlay : public APIObject {
public:
class Client {
protected:
virtual ~Client() { }
public:
+ virtual void pageOverlayDestroyed(PageOverlay*) = 0;
virtual void willMoveToWebPage(PageOverlay*, WebPage*) = 0;
virtual void didMoveToWebPage(PageOverlay*, WebPage*) = 0;
virtual void drawRect(PageOverlay*, WebCore::GraphicsContext&, const WebCore::IntRect& dirtyRect) = 0;
virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&) = 0;
};
+ static const Type APIType = TypeBundlePageOverlay;
+
static PassRefPtr<PageOverlay> create(Client*);
virtual ~PageOverlay();
@@ -67,6 +70,9 @@ protected:
WebPage* webPage() const { return m_webPage; }
private:
+ // APIObject
+ virtual Type type() const { return APIType; }
+
WebCore::IntRect bounds() const;
Client* m_client;
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index fa71ea7..8e3944a 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1486,6 +1486,14 @@
>
</File>
<File
+ RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePageOverlay.cpp"
+ >
+ </File>
+ <File
+ RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePageOverlay.h"
+ >
+ </File>
+ <File
RelativePath="..\WebProcess\InjectedBundle\API\c\WKBundlePrivate.h"
>
</File>
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list