[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 16:07:38 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit cc97ca135b258059fb36aca288cfc04d0350cb81
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Nov 18 21:21:36 2010 +0000
Page overlays should be able to handle mouse events
https://bugs.webkit.org/show_bug.cgi?id=49756
Reviewed by John Sullivan.
* Shared/API/c/WKSharedAPICast.h:
(WebKit::toAPI):
Add API cast function for converting an IntPoint to a WKPoint.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
(PageOverlayClientImpl::mouseEvent):
Call the appropriate callbacks.
* WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
Add new callbacks.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72328 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 115e372..1b804c7 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,5 +1,23 @@
2010-11-18 Anders Carlsson <andersca at apple.com>
+ Reviewed by John Sullivan.
+
+ Page overlays should be able to handle mouse events
+ https://bugs.webkit.org/show_bug.cgi?id=49756
+
+ * Shared/API/c/WKSharedAPICast.h:
+ (WebKit::toAPI):
+ Add API cast function for converting an IntPoint to a WKPoint.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp:
+ (PageOverlayClientImpl::mouseEvent):
+ Call the appropriate callbacks.
+
+ * WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h:
+ Add new callbacks.
+
+2010-11-18 Anders Carlsson <andersca at apple.com>
+
Reviewed by Sam Weinig.
Keep the web process alive if there are active downloads
diff --git a/WebKit2/Shared/API/c/WKSharedAPICast.h b/WebKit2/Shared/API/c/WKSharedAPICast.h
index e95fb8b..8a1a2c4 100644
--- a/WebKit2/Shared/API/c/WKSharedAPICast.h
+++ b/WebKit2/Shared/API/c/WKSharedAPICast.h
@@ -195,6 +195,14 @@ inline WKRect toAPI(const WebCore::IntRect& rect)
return wkRect;
}
+inline WKPoint toAPI(const WebCore::IntPoint& point)
+{
+ WKPoint wkPoint;
+ wkPoint.x = point.x();
+ wkPoint.y = point.y();
+ return wkPoint;
+}
+
/* Enum conversions */
inline WKTypeID toAPI(APIObject::Type type)
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
index bb9e240..7e9211e 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.cpp
@@ -79,9 +79,39 @@ private:
m_client.drawRect(toAPI(pageOverlay), graphicsContext.platformContext(), toAPI(dirtyRect), m_client.clientInfo);
}
- virtual bool mouseEvent(PageOverlay*, const WebMouseEvent&)
+ virtual bool mouseEvent(PageOverlay* pageOverlay, const WebMouseEvent& event)
{
- return false;
+ switch (event.type()) {
+ case WebEvent::MouseDown: {
+ if (!m_client.mouseDown)
+ return false;
+
+ return m_client.mouseDown(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.clientInfo);
+ }
+ case WebEvent::MouseUp: {
+ if (!m_client.mouseUp)
+ return false;
+
+ return m_client.mouseUp(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.clientInfo);
+ }
+ case WebEvent::MouseMove: {
+ if (event.button() == WebMouseEvent::NoButton) {
+ if (!m_client.mouseMoved)
+ return false;
+
+ return m_client.mouseMoved(toAPI(pageOverlay), toAPI(event.position()), m_client.clientInfo);
+ }
+
+ // This is a MouseMove event with a mouse button pressed. Call mouseDragged.
+ if (!m_client.mouseDragged)
+ return false;
+
+ return m_client.mouseDragged(toAPI(pageOverlay), toAPI(event.position()), toAPI(event.button()), m_client.clientInfo);
+ }
+
+ default:
+ return false;
+ }
}
WKBundlePageOverlayClient m_client;
diff --git a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
index af4299d..3b4f950 100644
--- a/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
+++ b/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePageOverlay.h
@@ -27,6 +27,7 @@
#define WKBundlePageOverlay_h
#include <WebKit2/WKBase.h>
+#include <WebKit2/WKEvent.h>
#include <WebKit2/WKGeometry.h>
#ifndef __cplusplus
@@ -40,9 +41,13 @@ extern "C" {
#endif
// Page overlay 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);
+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);
+typedef bool (*WKBundlePageOverlayMouseDownCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo);
+typedef bool (*WKBundlePageOverlayMouseUpCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo);
+typedef bool (*WKBundlePageOverlayMouseMovedCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, const void* clientInfo);
+typedef bool (*WKBundlePageOverlayMouseDraggedCallback)(WKBundlePageOverlayRef pageOverlay, WKPoint position, WKEventMouseButton mouseButton, const void* clientInfo);
struct WKBundlePageOverlayClient {
int version;
@@ -50,6 +55,10 @@ struct WKBundlePageOverlayClient {
WKBundlePageOverlayWillMoveToPageCallback willMoveToPage;
WKBundlePageOverlayDidMoveToPageCallback didMoveToPage;
WKBundlePageOverlayDrawRectCallback drawRect;
+ WKBundlePageOverlayMouseDownCallback mouseDown;
+ WKBundlePageOverlayMouseUpCallback mouseUp;
+ WKBundlePageOverlayMouseMovedCallback mouseMoved;
+ WKBundlePageOverlayMouseDraggedCallback mouseDragged;
};
typedef struct WKBundlePageOverlayClient WKBundlePageOverlayClient;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list