Commit 3bee2462 authored by andersca@apple.com's avatar andersca@apple.com

WebCore:

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

        Reviewed by Mark.

        Enable 64-bit NPAPI plugins.
        
        * WebCore.xcodeproj/project.pbxproj:
        Don't remove NPAPI related symbols from the 64-bit .exp file.
        
        * bridge/npruntime.h:
        Remove now unnecessary #error.

WebKit/mac:

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

        Reviewed by Mark.

        64-bit NPAPI plugin build fixes.
        
        * Plugins/WebBaseNetscapePluginView.mm:
        (-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
        (-[WebBaseNetscapePluginView updateAndSetWindow]):
        (-[WebBaseNetscapePluginView start]):
        (-[WebBaseNetscapePluginView windowBecameKey:]):
        * Plugins/WebNetscapeDeprecatedFunctions.c:
        * Plugins/WebNetscapeDeprecatedFunctions.h:
        * Plugins/WebNetscapePluginEventHandler.mm:
        (WebNetscapePluginEventHandler::create):
        * Plugins/WebNetscapePluginEventHandlerCarbon.h:
        * Plugins/WebNetscapePluginEventHandlerCarbon.mm:
        * Plugins/WebPluginDatabase.m:
        (-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@32790 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 277d259f
2008-05-01 Anders Carlsson <andersca@apple.com>
Reviewed by Mark.
Enable 64-bit NPAPI plugins.
* WebCore.xcodeproj/project.pbxproj:
Don't remove NPAPI related symbols from the 64-bit .exp file.
* bridge/npruntime.h:
Remove now unnecessary #error.
2008-05-01 Maciej Stachowiak <mjs@apple.com>
Reviewed by Oliver (a while ago)
......@@ -15111,7 +15111,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "# Corrections for 64-bit\n# 1) Exclude _NPN_ symbols as NPAPI support is disabled in 64-bit\n# 2) Switch NSRect, NSSize and NSPoint with their CG counterparts\n# 3) Append any 64-bit only symbols from WebCore.LP64.exp\ngrep -v \"^__NPN_\" \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.exp\" | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ -e s/^__ZN7WebCore5Frame20windowScriptNPObjectEv$// > \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.LP64.exp\"\ncat \"${SRCROOT}/WebCore.LP64.exp\" >> \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.LP64.exp\"\n";
shellScript = "# Corrections for 64-bit\n# 1) Switch NSRect, NSSize and NSPoint with their CG counterparts\n# 2) Append any 64-bit only symbols from WebCore.LP64.exp\ncat \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.exp\" | sed -e s/7_NSRect/6CGRect/ -e s/7_NSSize/6CGSize/ -e s/8_NSPoint/7CGPoint/ > \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.LP64.exp\"\ncat \"${SRCROOT}/WebCore.LP64.exp\" >> \"${BUILT_PRODUCTS_DIR}/DerivedSources/WebCore/WebCore.LP64.exp\"\n";
};
1CC93C640DAE929600E4BC3A /* Copy Forwarding and ICU Headers */ = {
isa = PBXShellScriptBuildPhase;
......@@ -75,10 +75,6 @@ extern "C" {
#include <stdint.h>
#include "npapi.h"
#if defined(XP_MACOSX) && defined(__LP64__)
#error 64-bit Netscape plug-ins are not supported on Mac OS X
#endif
/*
This API is used to facilitate binding code written in C to script
objects. The API in this header does not assume the presence of a
......
2008-05-01 Anders Carlsson <andersca@apple.com>
Reviewed by Mark.
64-bit NPAPI plugin build fixes.
* Plugins/WebBaseNetscapePluginView.mm:
(-[WebBaseNetscapePluginView saveAndSetNewPortStateForUpdate:]):
(-[WebBaseNetscapePluginView updateAndSetWindow]):
(-[WebBaseNetscapePluginView start]):
(-[WebBaseNetscapePluginView windowBecameKey:]):
* Plugins/WebNetscapeDeprecatedFunctions.c:
* Plugins/WebNetscapeDeprecatedFunctions.h:
* Plugins/WebNetscapePluginEventHandler.mm:
(WebNetscapePluginEventHandler::create):
* Plugins/WebNetscapePluginEventHandlerCarbon.h:
* Plugins/WebNetscapePluginEventHandlerCarbon.mm:
* Plugins/WebPluginDatabase.m:
(-[WebPluginDatabase pluginForKey:withEnumeratorSelector:]):
2008-05-01 Anders Carlsson <andersca@apple.com>
Reviewed by Tim.
......
......@@ -539,7 +539,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
cgPortState->context = context;
// Update the plugin's window/context
#ifdef NP_NO_CARBON
nPort.cgPort.window = (NPNSWindow *)[self currentWindow];
#else
nPort.cgPort.window = eventHandler->platformWindow([self currentWindow]);
#endif /* NP_NO_CARBON */
nPort.cgPort.context = context;
window.window = &nPort.cgPort;
......@@ -576,7 +580,11 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
}
// Update the plugin's window/context
nPort.aglPort.window = eventHandler->platformWindow([self currentWindow]);;
#ifdef NP_NO_CARBON
nPort.aglPort.window = (NPNSWindow *)[self currentWindow];
#else
nPort.aglPort.window = eventHandler->platformWindow([self currentWindow]);
#endif // NP_NO_CARBON
nPort.aglPort.context = [self _cglContext];
window.window = &nPort.aglPort;
......@@ -989,8 +997,13 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
// NPP_SetWindow() with an empty NPWindow struct.
if (!isStarted)
return;
#ifdef NP_NO_QUICKDRAW
if (![self canDraw])
return;
#else
if (drawingModel != NPDrawingModelQuickDraw && ![self canDraw])
return;
#endif // NP_NO_QUICKDRAW
BOOL didLockFocus = [NSView focusView] != self && [self lockFocusIfCanDraw];
PortState portState = [self saveAndSetNewPortState];
......@@ -1203,9 +1216,10 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
eventModel = NPEventModelCarbon;
#else
eventModel = NPEventModelCocoa;
#endif
#endif // NP_NO_CARBON
}
#ifndef NP_NO_CARBON
if (eventModel == NPEventModelCocoa &&
drawingModel == NPDrawingModelQuickDraw) {
LOG(Plugins, "Plugin can't use use Cocoa event model with QuickDraw drawing model: %@", pluginPackage);
......@@ -1214,6 +1228,7 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
return NO;
}
#endif // NP_NO_CARBON
// Create the event handler
eventHandler = WebNetscapePluginEventHandler::create(self);
......@@ -1693,7 +1708,9 @@ static inline void getNPRect(const NSRect& nr, NPRect& npr)
[self sendActivateEvent:YES];
[self setNeedsDisplay:YES];
[self restartTimers];
#ifndef NP_NO_CARBON
SetUserFocusWindow((WindowRef)[[self window] windowRef]);
#endif // NP_NO_CARBON
}
- (void)windowResignedKey:(NSNotification *)notification
......
......@@ -25,7 +25,7 @@
#include "WebNetscapeDeprecatedFunctions.h"
#if ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
OSErr WebGetDiskFragment(const FSSpec *fileSpec, UInt32 offset, UInt32 length, ConstStr63Param fragName, CFragLoadOptions options, CFragConnectionID *connID, Ptr *mainAddr, Str255 errMessage)
{
......@@ -47,4 +47,4 @@ extern void WebLMSetCurApRefNum(SInt16 value)
LMSetCurApRefNum(value);
}
#endif /* ENABLE(NETSCAPE_PLUGIN_API) */
#endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
#import <CoreServices/CoreServices.h>
......@@ -32,4 +32,4 @@ extern OSErr WebCloseConnection(CFragConnectionID *connID);
extern SInt16 WebLMGetCurApRefNum(void);
extern void WebLMSetCurApRefNum(SInt16 value);
#endif /* ENABLE(NETSCAPE_PLUGIN_API) */
#endif /* ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__) */
......@@ -35,8 +35,10 @@
WebNetscapePluginEventHandler* WebNetscapePluginEventHandler::create(WebBaseNetscapePluginView* pluginView)
{
switch ([pluginView eventModel]) {
#ifndef NP_NO_CARBON
case NPEventModelCarbon:
return new WebNetscapePluginEventHandlerCarbon(pluginView);
#endif // NP_NO_CARBON
case NPEventModelCocoa:
return new WebNetscapePluginEventHandlerCocoa(pluginView);
default:
......
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
#ifndef WebNetscapePluginEventHandlerCarbon_h
#define WebNetscapePluginEventHandlerCarbon_h
......@@ -77,5 +77,5 @@ private:
#endif // WebNetscapePluginEventHandlerCarbon_h
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
......@@ -23,7 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if ENABLE(NETSCAPE_PLUGIN_API)
#if ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
#import "WebNetscapePluginEventHandlerCarbon.h"
......@@ -406,4 +406,4 @@ bool WebNetscapePluginEventHandlerCarbon::sendEvent(EventRecord* event)
return result;
}
#endif // ENABLE(NETSCAPE_PLUGIN_API)
#endif // ENABLE(NETSCAPE_PLUGIN_API) && !defined(__LP64__)
......@@ -86,10 +86,10 @@ - (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(S
{
WebBasePluginPackage *plugin = nil;
WebBasePluginPackage *webPlugin = nil;
#ifndef __LP64__
#ifdef SUPPORT_CFM
WebBasePluginPackage *CFMPlugin = nil;
WebBasePluginPackage *machoPlugin = nil;
#endif
WebBasePluginPackage *machoPlugin = nil;
NSEnumerator *pluginEnumerator = [plugins objectEnumerator];
key = [key lowercaseString];
......@@ -101,9 +101,12 @@ - (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(S
#if ENABLE(NETSCAPE_PLUGIN_API)
else if([plugin isKindOfClass:[WebNetscapePluginPackage class]]) {
WebExecutableType executableType = [(WebNetscapePluginPackage *)plugin executableType];
#ifdef SUPPORT_CFM
if (executableType == WebCFMExecutableType) {
checkCandidate(&CFMPlugin, &plugin);
} else if (executableType == WebMachOExecutableType) {
} else
#endif // SUPPORT_CFM
if (executableType == WebMachOExecutableType) {
checkCandidate(&machoPlugin, &plugin);
} else {
ASSERT_NOT_REACHED();
......@@ -120,17 +123,17 @@ - (WebBasePluginPackage *)pluginForKey:(NSString *)key withEnumeratorSelector:(S
if (webPlugin && ![webPlugin isQuickTimePlugIn])
return webPlugin;
#ifndef __LP64__
else if (machoPlugin && ![machoPlugin isQuickTimePlugIn])
return machoPlugin;
#ifdef SUPPORT_CFM
else if (CFMPlugin && ![CFMPlugin isQuickTimePlugIn])
return CFMPlugin;
#endif
#endif // SUPPORT_CFM
else if (webPlugin)
return webPlugin;
#ifndef __LP64__
else if (machoPlugin)
return machoPlugin;
#ifdef SUPPORT_CFM
else if (CFMPlugin)
return CFMPlugin;
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment