[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-10851-g50815da

andersca at apple.com andersca at apple.com
Wed Dec 22 18:04:19 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 8c8e48afb89365addd9bf17a841706c6abafe264
Author: andersca at apple.com <andersca at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Dec 6 20:58:19 2010 +0000

    Add a shim for GetCurrentEventButtonState
    https://bugs.webkit.org/show_bug.cgi?id=50583
    
    Reviewed by Adam Roben.
    
    * PluginProcess/mac/PluginProcessMac.mm:
    (WebKit::getCurrentEventButtonState):
    Get the event button state from the plug-in.
    
    (WebKit::PluginProcess::initializeShim):
    Add new shim callback.
    
    * PluginProcess/mac/PluginProcessShim.cpp:
    (WebKit::shimGetCurrentEventButtonState):
    Add shim.
    
    * PluginProcess/mac/PluginProcessShim.h:
    * WebProcess/Plugins/Netscape/NetscapePlugin.h:
    * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
    (WebKit::NetscapePlugin::buttonState):
    Return the button state.
    
    (WebKit::NetscapePlugin::platformHandleMouseEvent):
    Update the button state. Also, make sure to actually pass the modifiers to NPP_HandleEvent.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73391 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 3e4196c..0ae323b 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -2,6 +2,34 @@
 
         Reviewed by Adam Roben.
 
+        Add a shim for GetCurrentEventButtonState
+        https://bugs.webkit.org/show_bug.cgi?id=50583
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::getCurrentEventButtonState):
+        Get the event button state from the plug-in.
+
+        (WebKit::PluginProcess::initializeShim):
+        Add new shim callback.
+
+        * PluginProcess/mac/PluginProcessShim.cpp:
+        (WebKit::shimGetCurrentEventButtonState):
+        Add shim.
+
+        * PluginProcess/mac/PluginProcessShim.h:
+        * WebProcess/Plugins/Netscape/NetscapePlugin.h:
+        * WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm:
+        (WebKit::NetscapePlugin::buttonState):
+        Return the button state.
+
+        (WebKit::NetscapePlugin::platformHandleMouseEvent):
+        Update the button state. Also, make sure to actually pass the modifiers to NPP_HandleEvent.
+        
+
+2010-12-06  Anders Carlsson  <andersca at apple.com>
+
+        Reviewed by Adam Roben.
+
         Add a shim for IsWindowActive
         https://bugs.webkit.org/show_bug.cgi?id=50582
 
diff --git a/WebKit2/PluginProcess/mac/PluginProcessMac.mm b/WebKit2/PluginProcess/mac/PluginProcessMac.mm
index 01f0fd4..ccf444c 100644
--- a/WebKit2/PluginProcess/mac/PluginProcessMac.mm
+++ b/WebKit2/PluginProcess/mac/PluginProcessMac.mm
@@ -62,11 +62,22 @@ static bool isWindowActive(WindowRef windowRef, bool& result)
     return false;
 }
 
+static UInt32 getCurrentEventButtonState()
+{
+#ifndef NP_NO_CARBON
+    return NetscapePlugin::buttonState();
+#else
+    ASSERT_NOT_REACHED();
+    return 0;
+#endif
+}
+    
 void PluginProcess::initializeShim()
 {
     const PluginProcessShimCallbacks callbacks = {
         shouldCallRealDebugger,
         isWindowActive,
+        getCurrentEventButtonState
     };
 
     PluginProcessShimInitializeFunc initFunc = reinterpret_cast<PluginProcessShimInitializeFunc>(dlsym(RTLD_DEFAULT, "WebKitPluginProcessShimInitialize"));
diff --git a/WebKit2/PluginProcess/mac/PluginProcessShim.cpp b/WebKit2/PluginProcess/mac/PluginProcessShim.cpp
index 13fb7ce..346ead9 100644
--- a/WebKit2/PluginProcess/mac/PluginProcessShim.cpp
+++ b/WebKit2/PluginProcess/mac/PluginProcessShim.cpp
@@ -53,6 +53,11 @@ static void shimDebugger(void)
     Debugger();
 }
 
+static UInt32 shimGetCurrentEventButtonState()
+{
+    return pluginProcessShimCallbacks.getCurrentEventButtonState();
+}
+
 static Boolean shimIsWindowActive(WindowRef window)
 {
     bool result;
@@ -61,8 +66,9 @@ static Boolean shimIsWindowActive(WindowRef window)
     
     return IsWindowActive(window);
 }
-    
+
 DYLD_INTERPOSE(shimDebugger, Debugger);
+DYLD_INTERPOSE(shimGetCurrentEventButtonState, GetCurrentEventButtonState);
 DYLD_INTERPOSE(shimIsWindowActive, IsWindowActive);
     
 #endif
diff --git a/WebKit2/PluginProcess/mac/PluginProcessShim.h b/WebKit2/PluginProcess/mac/PluginProcessShim.h
index 33ad443..0fbee23 100644
--- a/WebKit2/PluginProcess/mac/PluginProcessShim.h
+++ b/WebKit2/PluginProcess/mac/PluginProcessShim.h
@@ -33,6 +33,7 @@ namespace WebKit {
 struct PluginProcessShimCallbacks {
     bool (*shouldCallRealDebugger)();
     bool (*isWindowActive)(WindowRef, bool& result);
+    UInt32 (*getCurrentEventButtonState)();
 };
 
 typedef void (*PluginProcessShimInitializeFunc)(const PluginProcessShimCallbacks&);
diff --git a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
index e85660d..e6d4972 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
+++ b/WebKit2/WebProcess/Plugins/Netscape/NetscapePlugin.h
@@ -61,7 +61,9 @@ public:
     bool isWindowActive() const { return m_isWindowActive; }
 
     static NetscapePlugin* netscapePluginFromWindow(WindowRef);
+    static unsigned buttonState();
 #endif
+
 #elif PLATFORM(WIN)
     HWND containingWindow() const;
 #endif
diff --git a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
index 8caf77b..daf1d1f 100644
--- a/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
+++ b/WebKit2/WebProcess/Plugins/Netscape/mac/NetscapePluginMac.mm
@@ -35,6 +35,9 @@ namespace WebKit {
 #ifndef NP_NO_CARBON
 static const double nullEventIntervalActive = 0.02;
 static const double nullEventIntervalNotActive = 0.25;
+
+static unsigned buttonStateFromLastMouseEvent;
+
 #endif
 
 NPError NetscapePlugin::setDrawingModel(NPDrawingModel drawingModel)
@@ -209,6 +212,11 @@ WindowRef NetscapePlugin::windowRef() const
     return reinterpret_cast<WindowRef>(m_npCGContext.window);
 }
 
+unsigned NetscapePlugin::buttonState()
+{
+    return buttonStateFromLastMouseEvent;
+}
+
 static inline EventRecord initializeEventRecord(EventKind eventKind)
 {
     EventRecord eventRecord;
@@ -402,9 +410,11 @@ bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& mouseEvent)
             switch (mouseEvent.type()) {
             case WebEvent::MouseDown:
                 eventKind = mouseDown;
+                buttonStateFromLastMouseEvent |= (1 << buttonNumber(mouseEvent.button()));
                 break;
             case WebEvent::MouseUp:
                 eventKind = mouseUp;
+                buttonStateFromLastMouseEvent &= ~(1 << buttonNumber(mouseEvent.button()));
                 break;
             case WebEvent::MouseMove:
                 eventKind = nullEvent;
@@ -414,8 +424,10 @@ bool NetscapePlugin::platformHandleMouseEvent(const WebMouseEvent& mouseEvent)
             }
 
             EventRecord event = initializeEventRecord(eventKind);
+            event.modifiers = modifiersForEvent(mouseEvent);
             event.where.h = mouseEvent.globalPosition().x();
             event.where.v = mouseEvent.globalPosition().y();
+
             return NPP_HandleEvent(&event);
         }
 #endif

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list