[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

cblu cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 05:56:32 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 24c4b5c45c4a48e34bfe87f04f8510afb87373b7
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Mon Mar 4 17:58:50 2002 +0000

    - Treating Java.plugin like a CFM plug-in until it exports the correct mach-o symbols
    - Enabled AppleScript in Alexander
    - Fixed a partial URL problem with WCJavaAppletWidget
    
    Modified Files:
        WebBrowser/WebBrowser.pbproj/project.pbxproj
        WebCore/src/kdelibs/khtml/rendering/render_applet.cpp
        WebCore/src/kwq/WCJavaAppletWidget.mm
        WebCore/src/kwq/WCPlugin.h WebCore/src/kwq/WCPlugin.mm
        WebCore/src/kwq/npapi.h
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@684 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/khtml/rendering/render_applet.cpp b/WebCore/khtml/rendering/render_applet.cpp
index 90b8a1e..47c4dd7 100644
--- a/WebCore/khtml/rendering/render_applet.cpp
+++ b/WebCore/khtml/rendering/render_applet.cpp
@@ -102,7 +102,11 @@ void RenderApplet::layout()
 
     calcWidth();
     calcHeight();
-
+    
+#ifdef _KWQ_
+    m_widget->resize(m_width-marginLeft()-marginRight()-paddingLeft()-paddingRight(),
+        m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
+#else
     KJavaAppletWidget *tmp = static_cast<KJavaAppletWidget*>(m_widget);
     if ( tmp ) {
         NodeImpl *child = m_applet->firstChild();
@@ -121,7 +125,7 @@ void RenderApplet::layout()
                          m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
         tmp->showApplet();
     }
-
+#endif
     setLayouted();
 }
 
diff --git a/WebCore/kwq/WCJavaAppletWidget.mm b/WebCore/kwq/WCJavaAppletWidget.mm
index d56692d..197df3e 100644
--- a/WebCore/kwq/WCJavaAppletWidget.mm
+++ b/WebCore/kwq/WCJavaAppletWidget.mm
@@ -57,16 +57,17 @@ WCJavaAppletWidget::WCJavaAppletWidget(QMap<QString, QString> args)
     for( it = args.begin(); it != args.end(); ++it ){
         [arguments setObject:QSTRING_TO_NSSTRING(it.data()) forKey:QSTRING_TO_NSSTRING(it.key())];
         if(it.key().contains("codebase", FALSE)){
-            codebase = QSTRING_TO_NSSTRING(it.data());
-            NSLog(codebase);
+            codebase = [NSString stringWithString:QSTRING_TO_NSSTRING(it.data())];
         }
         else if(it.key().contains("code", FALSE)){
-            code = QSTRING_TO_NSSTRING(it.data());
+            code = [NSString stringWithString:QSTRING_TO_NSSTRING(it.data())];
         }
     }
-    
-    URL = [codebase stringByAppendingPathComponent:code];
-    NSLog(URL);
+    if([codebase characterAtIndex:[codebase length]-1] != '/'){
+        URL = [[codebase stringByAppendingString:@"/"] stringByAppendingString:code];
+    }else{
+        URL = [codebase stringByAppendingString:code];
+    }
     setView(WCIFPluginMake(NSMakeRect(0,0,0,0), plugin, URL, @"application/x-java-applet", arguments, NP_EMBED));
 }
 
diff --git a/WebCore/kwq/WCPlugin.h b/WebCore/kwq/WCPlugin.h
index 7640e24..a0b3536 100644
--- a/WebCore/kwq/WCPlugin.h
+++ b/WebCore/kwq/WCPlugin.h
@@ -50,7 +50,7 @@
     NPP_URLNotifyProcPtr NPP_URLNotify;
     NPP_GetValueProcPtr NPP_GetValue;
     NPP_SetValueProcPtr NPP_SetValue;
-    NPP_ShutdownProcPtr NPP_Shutdown; 
+    NPP_ShutdownProcPtr NPP_Shutdown;
 }
 
 - (BOOL)initializeWithPath:(NSString *)pluginPath;
diff --git a/WebCore/kwq/WCPlugin.mm b/WebCore/kwq/WCPlugin.mm
index 3a3530b..cc30c5d 100644
--- a/WebCore/kwq/WCPlugin.mm
+++ b/WebCore/kwq/WCPlugin.mm
@@ -135,6 +135,8 @@
     FSSpec spec;
     FSRef fref; 
     mainFuncPtr pluginMainFunc;
+    initializeFuncPtr NPP_Initialize;
+    getEntryPointsFuncPtr NPP_GetEntryPoints;
     NPError npErr;
     Boolean didLoad;
     NSBundle *tempBundle;
@@ -151,14 +153,20 @@
         if(!memcmp([data bytes], "Joy!peff", 8)){
             isCFM = TRUE;
         }else{
-            isCFM = FALSE;
+            isCFM = TRUE; //FIXME
         }
         [executableFile closeFile];
         didLoad = CFBundleLoadExecutable(bundle);
         if (!didLoad) {
             return;
         }
-        pluginMainFunc = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("main") );
+        if(isCFM){
+            pluginMainFunc = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("main") );
+        }else{
+            NPP_Initialize = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_Initialize") );
+            NPP_GetEntryPoints = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_GetEntryPoints") );
+            NPP_Shutdown = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_Shutdown") );
+        }
     }else{ // single CFM file
         err = FSPathMakeRef((UInt8 *)[path cString], &fref, NULL);
         if(err != noErr){
@@ -243,11 +251,11 @@
         browserFuncs.invalidateregion = NPN_InvalidateRegion;
         browserFuncs.forceredraw = NPN_ForceRedraw;
         
-        npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &NPP_Shutdown);
+        NPP_Initialize(&browserFuncs);
+        NPP_GetEntryPoints(&pluginFuncs);
         
         pluginSize = pluginFuncs.size;
         pluginVersion = pluginFuncs.version;
-        KWQDebug("pluginMainFunc: %d, size=%d, version=%d\n", npErr, pluginSize, pluginVersion);
         
         NPP_New = pluginFuncs.newp;
         NPP_Destroy = pluginFuncs.destroy;
diff --git a/WebCore/kwq/npapi.h b/WebCore/kwq/npapi.h
index e73a667..af86dc2 100644
--- a/WebCore/kwq/npapi.h
+++ b/WebCore/kwq/npapi.h
@@ -338,6 +338,9 @@ extern "C" {
 
 typedef NPError (* mainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
 
+typedef NPError (* initializeFuncPtr)(NPNetscapeFuncs*);
+typedef NPError (* getEntryPointsFuncPtr)(NPPluginFuncs*);
+
 void *functionPointerForTVector(void *);
 void *tVectorForFunctionPointer(void *);
 
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_applet.cpp b/WebCore/src/kdelibs/khtml/rendering/render_applet.cpp
index 90b8a1e..47c4dd7 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_applet.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_applet.cpp
@@ -102,7 +102,11 @@ void RenderApplet::layout()
 
     calcWidth();
     calcHeight();
-
+    
+#ifdef _KWQ_
+    m_widget->resize(m_width-marginLeft()-marginRight()-paddingLeft()-paddingRight(),
+        m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
+#else
     KJavaAppletWidget *tmp = static_cast<KJavaAppletWidget*>(m_widget);
     if ( tmp ) {
         NodeImpl *child = m_applet->firstChild();
@@ -121,7 +125,7 @@ void RenderApplet::layout()
                          m_height-marginTop()-marginBottom()-paddingTop()-paddingBottom());
         tmp->showApplet();
     }
-
+#endif
     setLayouted();
 }
 
diff --git a/WebCore/src/kwq/WCJavaAppletWidget.mm b/WebCore/src/kwq/WCJavaAppletWidget.mm
index d56692d..197df3e 100644
--- a/WebCore/src/kwq/WCJavaAppletWidget.mm
+++ b/WebCore/src/kwq/WCJavaAppletWidget.mm
@@ -57,16 +57,17 @@ WCJavaAppletWidget::WCJavaAppletWidget(QMap<QString, QString> args)
     for( it = args.begin(); it != args.end(); ++it ){
         [arguments setObject:QSTRING_TO_NSSTRING(it.data()) forKey:QSTRING_TO_NSSTRING(it.key())];
         if(it.key().contains("codebase", FALSE)){
-            codebase = QSTRING_TO_NSSTRING(it.data());
-            NSLog(codebase);
+            codebase = [NSString stringWithString:QSTRING_TO_NSSTRING(it.data())];
         }
         else if(it.key().contains("code", FALSE)){
-            code = QSTRING_TO_NSSTRING(it.data());
+            code = [NSString stringWithString:QSTRING_TO_NSSTRING(it.data())];
         }
     }
-    
-    URL = [codebase stringByAppendingPathComponent:code];
-    NSLog(URL);
+    if([codebase characterAtIndex:[codebase length]-1] != '/'){
+        URL = [[codebase stringByAppendingString:@"/"] stringByAppendingString:code];
+    }else{
+        URL = [codebase stringByAppendingString:code];
+    }
     setView(WCIFPluginMake(NSMakeRect(0,0,0,0), plugin, URL, @"application/x-java-applet", arguments, NP_EMBED));
 }
 
diff --git a/WebCore/src/kwq/WCPlugin.h b/WebCore/src/kwq/WCPlugin.h
index 7640e24..a0b3536 100644
--- a/WebCore/src/kwq/WCPlugin.h
+++ b/WebCore/src/kwq/WCPlugin.h
@@ -50,7 +50,7 @@
     NPP_URLNotifyProcPtr NPP_URLNotify;
     NPP_GetValueProcPtr NPP_GetValue;
     NPP_SetValueProcPtr NPP_SetValue;
-    NPP_ShutdownProcPtr NPP_Shutdown; 
+    NPP_ShutdownProcPtr NPP_Shutdown;
 }
 
 - (BOOL)initializeWithPath:(NSString *)pluginPath;
diff --git a/WebCore/src/kwq/WCPlugin.mm b/WebCore/src/kwq/WCPlugin.mm
index 3a3530b..cc30c5d 100644
--- a/WebCore/src/kwq/WCPlugin.mm
+++ b/WebCore/src/kwq/WCPlugin.mm
@@ -135,6 +135,8 @@
     FSSpec spec;
     FSRef fref; 
     mainFuncPtr pluginMainFunc;
+    initializeFuncPtr NPP_Initialize;
+    getEntryPointsFuncPtr NPP_GetEntryPoints;
     NPError npErr;
     Boolean didLoad;
     NSBundle *tempBundle;
@@ -151,14 +153,20 @@
         if(!memcmp([data bytes], "Joy!peff", 8)){
             isCFM = TRUE;
         }else{
-            isCFM = FALSE;
+            isCFM = TRUE; //FIXME
         }
         [executableFile closeFile];
         didLoad = CFBundleLoadExecutable(bundle);
         if (!didLoad) {
             return;
         }
-        pluginMainFunc = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("main") );
+        if(isCFM){
+            pluginMainFunc = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("main") );
+        }else{
+            NPP_Initialize = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_Initialize") );
+            NPP_GetEntryPoints = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_GetEntryPoints") );
+            NPP_Shutdown = (void*)CFBundleGetFunctionPointerForName(bundle, CFSTR("NPP_Shutdown") );
+        }
     }else{ // single CFM file
         err = FSPathMakeRef((UInt8 *)[path cString], &fref, NULL);
         if(err != noErr){
@@ -243,11 +251,11 @@
         browserFuncs.invalidateregion = NPN_InvalidateRegion;
         browserFuncs.forceredraw = NPN_ForceRedraw;
         
-        npErr = pluginMainFunc(&browserFuncs, &pluginFuncs, &NPP_Shutdown);
+        NPP_Initialize(&browserFuncs);
+        NPP_GetEntryPoints(&pluginFuncs);
         
         pluginSize = pluginFuncs.size;
         pluginVersion = pluginFuncs.version;
-        KWQDebug("pluginMainFunc: %d, size=%d, version=%d\n", npErr, pluginSize, pluginVersion);
         
         NPP_New = pluginFuncs.newp;
         NPP_Destroy = pluginFuncs.destroy;
diff --git a/WebCore/src/kwq/npapi.h b/WebCore/src/kwq/npapi.h
index e73a667..af86dc2 100644
--- a/WebCore/src/kwq/npapi.h
+++ b/WebCore/src/kwq/npapi.h
@@ -338,6 +338,9 @@ extern "C" {
 
 typedef NPError (* mainFuncPtr)(NPNetscapeFuncs*, NPPluginFuncs*, NPP_ShutdownProcPtr*);
 
+typedef NPError (* initializeFuncPtr)(NPNetscapeFuncs*);
+typedef NPError (* getEntryPointsFuncPtr)(NPPluginFuncs*);
+
 void *functionPointerForTVector(void *);
 void *tVectorForFunctionPointer(void *);
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list