WebCore:
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2008 19:23:50 +0000 (19:23 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 2 May 2008 19:23:50 +0000 (19:23 +0000)
2008-05-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        Name the event union so it will work in plain C.

        * bridge/npapi.h:
        (_NPCocoaEvent::):

WebKit/mac:

2008-05-02  Anders Carlsson  <andersca@apple.com>

        Reviewed by Sam.

        The event union is now named.

        * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
        (WebNetscapePluginEventHandlerCocoa::drawRect):
        (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
        (WebNetscapePluginEventHandlerCocoa::flagsChanged):
        (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
        (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
        (WebNetscapePluginEventHandlerCocoa::focusChanged):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@32821 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/bridge/npapi.h
WebKit/mac/ChangeLog
WebKit/mac/Plugins/WebNetscapePluginEventHandlerCocoa.mm

index 6b220da..8548948 100644 (file)
@@ -1,3 +1,12 @@
+2008-05-02  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Sam.
+
+        Name the event union so it will work in plain C.
+
+        * bridge/npapi.h:
+        (_NPCocoaEvent::):
+
 2008-05-02  Dan Bernstein  <mitz@apple.com>
 
         Reviewed by John Sullivan.
index a787718..eb24fa4 100644 (file)
@@ -468,7 +468,7 @@ typedef struct _NPCocoaEvent {
         struct {
             NPBool hasFocus;
         } focus;        
-    };
+    } event;
 } NPCocoaEvent;
 
 #endif
index 5af9560..34e8fdf 100644 (file)
@@ -1,5 +1,19 @@
 2008-05-02  Anders Carlsson  <andersca@apple.com>
 
+        Reviewed by Sam.
+
+        The event union is now named.
+        
+        * Plugins/WebNetscapePluginEventHandlerCocoa.mm:
+        (WebNetscapePluginEventHandlerCocoa::drawRect):
+        (WebNetscapePluginEventHandlerCocoa::sendMouseEvent):
+        (WebNetscapePluginEventHandlerCocoa::flagsChanged):
+        (WebNetscapePluginEventHandlerCocoa::sendKeyEvent):
+        (WebNetscapePluginEventHandlerCocoa::windowFocusChanged):
+        (WebNetscapePluginEventHandlerCocoa::focusChanged):
+
+2008-05-02  Anders Carlsson  <andersca@apple.com>
+
         Reviewed by Mark.
 
         Make sure that 32-bit only plug-ins aren't shown when running as 64-bit.
index 3b91ba0..1ac01bf 100644 (file)
@@ -39,10 +39,10 @@ void WebNetscapePluginEventHandlerCocoa::drawRect(const NSRect& rect)
     NPCocoaEvent event;
     
     event.type = NPCocoaEventDrawRect;
-    event.draw.x = rect.origin.x;
-    event.draw.y = rect.origin.y;
-    event.draw.width = rect.size.width;
-    event.draw.height = rect.size.height;
+    event.event.draw.x = rect.origin.x;
+    event.event.draw.y = rect.origin.y;
+    event.event.draw.width = rect.size.width;
+    event.event.draw.height = rect.size.height;
     
     sendEvent(&event);
 }
@@ -89,13 +89,13 @@ bool WebNetscapePluginEventHandlerCocoa::sendMouseEvent(NSEvent *nsEvent, NPCoco
     NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
     
     event.type = type;
-    event.mouse.modifierFlags = [nsEvent modifierFlags];
-    event.mouse.buttonNumber = [nsEvent buttonNumber];
-    event.mouse.pluginX = point.x;
-    event.mouse.pluginY = point.y;
-    event.mouse.deltaX = [nsEvent deltaX];
-    event.mouse.deltaY = [nsEvent deltaY];
-    event.mouse.deltaZ = [nsEvent deltaZ];
+    event.event.mouse.modifierFlags = [nsEvent modifierFlags];
+    event.event.mouse.buttonNumber = [nsEvent buttonNumber];
+    event.event.mouse.pluginX = point.x;
+    event.event.mouse.pluginY = point.y;
+    event.event.mouse.deltaX = [nsEvent deltaX];
+    event.event.mouse.deltaY = [nsEvent deltaY];
+    event.event.mouse.deltaZ = [nsEvent deltaZ];
     
     return sendEvent(&event);
 }
@@ -117,13 +117,13 @@ void WebNetscapePluginEventHandlerCocoa::flagsChanged(NSEvent *nsEvent)
     NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
     
     event.type = NPCocoaEventFlagsChanged;
-    event.key.modifierFlags = [nsEvent modifierFlags];
-    event.key.pluginX = point.x;
-    event.key.pluginY = point.y;
-    event.key.keyCode = [nsEvent keyCode];
-    event.key.isARepeat = false;
-    event.key.characters = 0;
-    event.key.charactersIgnoringModifiers = 0;
+    event.event.key.modifierFlags = [nsEvent modifierFlags];
+    event.event.key.pluginX = point.x;
+    event.event.key.pluginY = point.y;
+    event.event.key.keyCode = [nsEvent keyCode];
+    event.event.key.isARepeat = false;
+    event.event.key.characters = 0;
+    event.event.key.charactersIgnoringModifiers = 0;
     
     sendEvent(&event);
 }
@@ -135,13 +135,13 @@ void WebNetscapePluginEventHandlerCocoa::sendKeyEvent(NSEvent* nsEvent, NPCocoaE
     NSPoint point = [m_pluginView convertPoint:[nsEvent locationInWindow] fromView:nil];
     
     event.type = type;
-    event.key.modifierFlags = [nsEvent modifierFlags];
-    event.key.pluginX = point.x;
-    event.key.pluginY = point.y;
-    event.key.keyCode = [nsEvent keyCode];
-    event.key.isARepeat = [nsEvent isARepeat];
-    event.key.characters = (NPNSString *)[nsEvent characters];
-    event.key.charactersIgnoringModifiers = (NPNSString *)[nsEvent charactersIgnoringModifiers];
+    event.event.key.modifierFlags = [nsEvent modifierFlags];
+    event.event.key.pluginX = point.x;
+    event.event.key.pluginY = point.y;
+    event.event.key.keyCode = [nsEvent keyCode];
+    event.event.key.isARepeat = [nsEvent isARepeat];
+    event.event.key.characters = (NPNSString *)[nsEvent characters];
+    event.event.key.charactersIgnoringModifiers = (NPNSString *)[nsEvent charactersIgnoringModifiers];
      
     sendEvent(&event);
 }
@@ -151,7 +151,7 @@ void WebNetscapePluginEventHandlerCocoa::windowFocusChanged(bool hasFocus)
     NPCocoaEvent event;
     
     event.type = NPCocoaEventWindowFocusChanged;
-    event.focus.hasFocus = hasFocus;
+    event.event.focus.hasFocus = hasFocus;
     
     sendEvent(&event);
 }
@@ -161,7 +161,7 @@ void WebNetscapePluginEventHandlerCocoa::focusChanged(bool hasFocus)
     NPCocoaEvent event;
     
     event.type = NPCocoaEventFocusChanged;
-    event.focus.hasFocus = hasFocus;
+    event.event.focus.hasFocus = hasFocus;
     
     sendEvent(&event);
 }