From 08a80086fefbcec9f8715d51ad45d533cfcc4ef0 Mon Sep 17 00:00:00 2001 From: Grant Gayed Date: Wed, 7 Mar 2012 14:27:20 -0500 Subject: appease MozillaDelegate on the dead platforms --- .../org/eclipse/swt/browser/MozillaDelegate.java | 35 +++++++++++++------- .../org/eclipse/swt/browser/MozillaDelegate.java | 38 +++++++++++++++------- 2 files changed, 49 insertions(+), 24 deletions(-) (limited to 'bundles/org.eclipse.swt') 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 6f810fdbaf..29418234a4 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 @@ -45,6 +45,25 @@ static String getLibraryName () { return "libxpcom.dylib"; //$NON-NLS-1$ } +static String getJSLibraryName () { + return "libxpcom.dylib"; //$NON-NLS-1$ +} + +static String getJSLibraryName_Pre4 () { + return "libmozjs.dylib"; //$NON-NLS-1$ +} + +static String getSWTInitLibraryName () { + return "swt-xulrunner"; //$NON-NLS-1$ +} + +static void loadAdditionalLibraries (String mozillaPath) { + // workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=727616 +// String utilsPath = mozillaPath + Mozilla.SEPARATOR_OS + "libmozutils.dylib"; //$NON-NLS-1$ +// byte[] bytes = MozillaDelegate.wcsToMbcs (null, utilsPath, true); +// OS.NSAddImage (bytes, OS.NSADDIMAGE_OPTION_RETURN_ON_ERROR | OS.NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME); +} + static char[] mbcsToWcs (String codePage, byte [] buffer) { int encoding = OS.CFStringGetSystemEncoding (); int cfstring = OS.CFStringCreateWithBytes (OS.kCFAllocatorDefault, buffer, buffer.length, encoding, false); @@ -62,6 +81,10 @@ static char[] mbcsToWcs (String codePage, byte [] buffer) { return chars; } +static boolean needsSpinup () { + return false; +} + static byte[] wcsToMbcs (String codePage, String string, boolean terminate) { char[] chars = new char [string.length()]; string.getChars (0, chars.length, chars, 0); @@ -225,19 +248,11 @@ int getHandle () { return embedHandle; } -String getJSLibraryName () { - return "libmozjs.dylib"; //$NON-NLS-1$ -} - String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ } -static String GetSWTInitLibraryName () { - return "swt-xulrunner"; //$NON-NLS-1$ -} - void handleFocus () { if (hasFocus) return; hasFocus = true; @@ -268,10 +283,6 @@ boolean hookEnterExit () { void init () { } -boolean needsSpinup () { - return false; -} - void onDispose (int embedHandle) { handles.remove (new LONG (embedHandle)); if (listener != null) { 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 f008779912..a7c8a64f40 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 @@ -81,10 +81,36 @@ static String getLibraryName () { return "libxpcom.so"; //$NON-NLS-1$ } +static String getJSLibraryName () { + return "libmozjs.so"; //$NON-NLS-1$ +} + +static String getJSLibraryName_Pre4() { + return "libxpcom.so"; //$NON-NLS-1$ +} + +static String getSWTInitLibraryName () { + return "swt-xpcominit"; //$NON-NLS-1$ +} + +static void loadAdditionalLibraries (String mozillaPath) { +// the following is intentionally commented + +// if (!Mozilla.IsPre_4) { +// System.loadLibrary ("swt-xulrunner10"); // get it extracted +// byte[] bytes = Converter.wcsToMbcs (null, /* path to libswt-xulrunner10.so */ "", true); //$NON-NLS-1$ +// OS.dlopen (bytes, OS.RTLD_NOW | OS.RTLD_GLOBAL); +// } +} + static char[] mbcsToWcs (String codePage, byte [] buffer) { return Converter.mbcsToWcs (codePage, buffer); } +static boolean needsSpinup () { + return true; +} + static byte[] wcsToMbcs (String codePage, String string, boolean terminate) { return Converter.wcsToMbcs (codePage, string, terminate); } @@ -116,19 +142,11 @@ int getHandle() { return result; } -String getJSLibraryName () { - return "libmozjs.so"; //$NON-NLS-1$ -} - String getProfilePath () { String baseDir = System.getProperty ("user.home"); //$NON-NLS-1$ return baseDir + Mozilla.SEPARATOR_OS + ".mozilla" + Mozilla.SEPARATOR_OS + "eclipse"; //$NON-NLS-1$ //$NON-NLS-2$ } -static String GetSWTInitLibraryName () { - return "swt-xpcominit"; //$NON-NLS-1$ -} - void handleFocus () { if (hasFocus) return; hasFocus = true; @@ -166,10 +184,6 @@ boolean hookEnterExit () { void init () { } -boolean needsSpinup () { - return true; -} - void onDispose (int embedHandle) { if (listener != null) { browser.getDisplay ().removeFilter (SWT.FocusIn, listener); -- cgit