diff options
author | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-04-11 11:45:19 -0400 |
---|---|---|
committer | Grant Gayed <grant_gayed@ca.ibm.com> | 2013-04-11 11:49:04 -0400 |
commit | 0e8780fecdad08e13acf40e49af437762eff1854 (patch) | |
tree | 19cacc07436d438904069e79c5298104fa0560ba /bundles/org.eclipse.swt/Eclipse SWT Mozilla | |
parent | 650deb026c998b07523a6424f11db72ac0bd1b3a (diff) | |
download | eclipse.platform.swt-0e8780fecdad08e13acf40e49af437762eff1854.tar.gz eclipse.platform.swt-0e8780fecdad08e13acf40e49af437762eff1854.tar.xz eclipse.platform.swt-0e8780fecdad08e13acf40e49af437762eff1854.zip |
finish support of 64-bit XULRunner on win32
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Mozilla')
14 files changed, 72 insertions, 28 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java index 6fd353132b..c8006353e0 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/carbon/org/eclipse/swt/browser/MozillaDelegate.java @@ -50,8 +50,8 @@ static String getLibraryName () { return "libxpcom.dylib"; //$NON-NLS-1$ } -static String getJSLibraryName () { - return "libxpcom.dylib"; //$NON-NLS-1$ +static String[] getJSLibraryNames () { + return new String[] {"libxpcom.dylib"}; //$NON-NLS-1$ } static String getJSLibraryName_Pre4 () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java index f699239e83..64baf3ee96 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java @@ -47,8 +47,8 @@ static String getCacheParentPath () { return baseDir + "/Library/Caches/eclipse"; //$NON-NLS-1$ } -static String getJSLibraryName () { - return "libxpcom.dylib"; //$NON-NLS-1$ +static String[] getJSLibraryNames () { + return new String[] {"libxpcom.dylib"}; //$NON-NLS-1$ } static String getJSLibraryName_Pre4 () { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext-2.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h index 783cf3d34f..783cf3d34f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext-2.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptContext.h diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject-2.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h index 276d40f4d5..276d40f4d5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject-2.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/nsIScriptGlobalObject.h diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp index 580fb4b1f6..026e178742 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp @@ -67,6 +67,31 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJ)(JNIEnv *env, jclass that, jint } #endif +#if (!defined(NO__1Call__IIIIII) && !defined(JNI64)) || (!defined(NO__1Call__JJJJJI) && defined(JNI64)) +#ifndef JNI64 +extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__IIIIII)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jint arg5); +JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__IIIIII)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jint arg5) +#else +extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJJI)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jint arg5); +JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJJI)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3, jintLong arg4, jint arg5) +#endif +{ + jint rc = 0; +#ifndef JNI64 + XPCOM_NATIVE_ENTER(env, that, _1Call__IIIIII_FUNC); +#else + XPCOM_NATIVE_ENTER(env, that, _1Call__JJJJJI_FUNC); +#endif + rc = (jint)((SWT_XREInitEmbedding)arg0)((nsILocalFile *)arg1, (nsILocalFile *)arg2, (nsIDirectoryServiceProvider *)arg3, (nsStaticModuleInfo const *)arg4, arg5); +#ifndef JNI64 + XPCOM_NATIVE_EXIT(env, that, _1Call__IIIIII_FUNC); +#else + XPCOM_NATIVE_EXIT(env, that, _1Call__JJJJJI_FUNC); +#endif + return rc; +} +#endif + #if (!defined(NO__1Call__III_3BII_3I) && !defined(JNI64)) || (!defined(NO__1Call__JJJ_3BII_3I) && defined(JNI64)) #ifndef JNI64 extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(_1Call__III_3BII_3I)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jbyteArray arg3, jint arg4, jint arg5, jintArray arg6); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h index c41e06466f..c6ee93e808 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h @@ -31,6 +31,9 @@ #define XPCOM_LOAD_FUNCTION LOAD_FUNCTION #ifdef _WIN32 +#if !(defined(__i386__) || defined(_M_IX86) || defined(_X86_)) +#define NO__1Call__JJJJJI /* exclude on 64-bit win32 due to use of XULRunner 10 SDK */ +#endif #define STDMETHODCALLTYPE __stdcall #define NO__1NS_1InitXPCOM2 #else /* _WIN32 */ diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp index 09c20b4402..9aec0912a1 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_custom.cpp @@ -246,7 +246,7 @@ fail: #ifndef NO_CALLBACK_1JSNative extern "C" JNIEXPORT jintLong JNICALL XPCOM_NATIVE(CALLBACK_1JSNative)(JNIEnv *env, jclass that, jintLong arg0); static jintLong CALLBACK_1JSNative; -static jint proc_CALLBACK_1JSNative(jintLong arg0, jint arg1, jintLong arg2) { +static jintLong proc_CALLBACK_1JSNative(jintLong arg0, jint arg1, jintLong arg2) { return ((jintLong (CALLING_CONVENTION*)(jintLong, jintLong, jintLong))CALLBACK_1JSNative)(arg0, arg1, arg2); } static jintLong CALLBACK_JSNative(jintLong func) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp index f1e52b40b3..c51c1689e3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp @@ -27,6 +27,11 @@ char * XPCOM_nativeFunctionNames[] = { "_1Call__JJJJ", #endif #ifndef JNI64 + "_1Call__IIIIII", +#else + "_1Call__JJJJJI", +#endif +#ifndef JNI64 "_1Call__III_3BII_3I", #else "_1Call__JJJ_3BII_3I", diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h index afa3bb90c8..ff1e3a0e5a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h @@ -37,6 +37,11 @@ typedef enum { _1Call__JJJJ_FUNC, #endif #ifndef JNI64 + _1Call__IIIIII_FUNC, +#else + _1Call__JJJJJI_FUNC, +#endif +#ifndef JNI64 _1Call__III_3BII_3I_FUNC, #else _1Call__JJJ_3BII_3I_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java index 7002315ecb..41f621ef80 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java @@ -1500,12 +1500,18 @@ public String getBrowserType () { static byte[] getJSLibPathBytes () { if (jsLibPathBytes == null) { - String jsLibraryName = IsPre_4 ? MozillaDelegate.getJSLibraryName_Pre4 () : MozillaDelegate.getJSLibraryName (); - String mozillaPath = getMozillaPath () + jsLibraryName + '\0'; - try { - jsLibPathBytes = mozillaPath.getBytes ("UTF-8"); //$NON-NLS-1$ - } catch (UnsupportedEncodingException e) { - jsLibPathBytes = mozillaPath.getBytes (); + String[] names = IsPre_4 ? new String[] {MozillaDelegate.getJSLibraryName_Pre4 ()} : MozillaDelegate.getJSLibraryNames (); + for (int i = 0; i < names.length; i++) { + File file = new File (getMozillaPath (), names[i]); + if (file.exists ()) { + String pathString = file.getAbsolutePath () + '\0'; + try { + jsLibPathBytes = pathString.getBytes ("UTF-8"); //$NON-NLS-1$ + } catch (UnsupportedEncodingException e) { + jsLibPathBytes = pathString.getBytes (); + } + break; + } } } return jsLibPathBytes; @@ -2036,7 +2042,7 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) { error (XPCOM.NS_ERROR_NULL_POINTER); } if (IsPre_4) { -// rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress (), 0, 0); + rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress (), 0, 0); } else { rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress ()); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java index e513e3a823..b5c7f2751a 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java @@ -607,15 +607,15 @@ public static final long /*int*/ Call(long /*int*/ ptr, long /*int*/ aInStream, * @param aAppDirProvider cast=(nsIDirectoryServiceProvider *) * @param aStaticComponents cast=(nsStaticModuleInfo const *) */ -//public static final native int _Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, long /*int*/ aAppDirectory, long /*int*/ aAppDirProvider, long /*int*/ aStaticComponents, int aStaticComponentsCount); -//public static final int Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, long /*int*/ aAppDirectory, long /*int*/ aAppDirProvider, long /*int*/ aStaticComponents, int aStaticComponentsCount) { -// lock.lock(); -// try { -// return _Call(ptr, aLibXULDirectory, aAppDirectory, aAppDirProvider, aStaticComponents, aStaticComponentsCount); -// } finally { -// lock.unlock(); -// } -//} +public static final native int _Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, long /*int*/ aAppDirectory, long /*int*/ aAppDirProvider, long /*int*/ aStaticComponents, int aStaticComponentsCount); +public static final int Call(long /*int*/ ptr, long /*int*/ aLibXULDirectory, long /*int*/ aAppDirectory, long /*int*/ aAppDirProvider, long /*int*/ aStaticComponents, int aStaticComponentsCount) { + lock.lock(); + try { + return _Call(ptr, aLibXULDirectory, aAppDirectory, aAppDirProvider, aStaticComponents, aStaticComponentsCount); + } finally { + lock.unlock(); + } +} /** * @param ptr cast=(SWT_XREInitEmbedding2) diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java index a8e70e1654..4c13d7393e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java @@ -75,8 +75,8 @@ static String getCacheParentPath () { return getProfilePath (); } -static String getJSLibraryName () { - return "libxul.so"; //$NON-NLS-1$ +static String[] getJSLibraryNames () { + return new String[] {"libxul.so"}; //$NON-NLS-1$ } static String getJSLibraryName_Pre4() { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java index 7089b380ab..4188e402c7 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/motif/org/eclipse/swt/browser/MozillaDelegate.java @@ -86,8 +86,8 @@ static String getLibraryName () { return "libxpcom.so"; //$NON-NLS-1$ } -static String getJSLibraryName () { - return "libmozjs.so"; //$NON-NLS-1$ +static String[] getJSLibraryNames () { + return new String[] {"libmozjs.so"}; //$NON-NLS-1$ } static String getJSLibraryName_Pre4() { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java index 7df2de4fd2..a9d7bbbf4c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java @@ -14,7 +14,7 @@ import java.util.*; import org.eclipse.swt.SWT; import org.eclipse.swt.browser.Browser; -import org.eclipse.swt.internal.Callback; +import org.eclipse.swt.internal.*; import org.eclipse.swt.internal.mozilla.*; import org.eclipse.swt.internal.win32.*; import org.eclipse.swt.widgets.*; @@ -44,8 +44,8 @@ static String getCacheParentPath () { return getProfilePath (); } -static String getJSLibraryName () { - return "mozjs.dll"; //$NON-NLS-1$ +static String[] getJSLibraryNames () { + return new String[] {"mozjs.dll", "xul.dll"}; //$NON-NLS-1$ //$NON-NLS-2$ } static String getJSLibraryName_Pre4 () { |