diff options
author | Grant Gayed | 2012-03-07 17:17:00 +0000 |
---|---|---|
committer | Grant Gayed | 2012-03-07 17:17:00 +0000 |
commit | c43e19b0166fbda0cdae05f1e6761cf9fdcf6304 (patch) | |
tree | fdb69bcfa0004c1f7e787966b5185cb5355b82d1 | |
parent | a44261ef7ad91b3d8ffc177d976044172a616213 (diff) | |
download | eclipse.platform.swt-c43e19b0166fbda0cdae05f1e6761cf9fdcf6304.tar.gz eclipse.platform.swt-c43e19b0166fbda0cdae05f1e6761cf9fdcf6304.tar.xz eclipse.platform.swt-c43e19b0166fbda0cdae05f1e6761cf9fdcf6304.zip |
XULRunner 10
21 files changed, 119 insertions, 75 deletions
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 bcf75c06f5..ee67b531a3 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 @@ -37,6 +37,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); @@ -56,6 +75,10 @@ static char[] mbcsToWcs (String codePage, byte [] buffer) { return new String(buffer).toCharArray(); } +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); @@ -102,23 +125,11 @@ int /*long*/ getHandle () { return browser.view.id; } -String getJSLibraryName () { - return "libxpcom.dylib"; -} - -String getJSLibraryName_Pre4 () { - 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; @@ -155,10 +166,6 @@ boolean hookEnterExit () { void init () { } -boolean needsSpinup () { - return false; -} - void onDispose (int /*long*/ embedHandle) { if (listener != null) { eventShell.getDisplay ().removeFilter (SWT.FocusIn, listener); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_10.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_10.java index ff1dcb6406..4affcfc61e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_10.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_10.java @@ -1,5 +1,5 @@ /*******************************************************************************
- * Copyright (c) 2011 IBM Corporation and others.
+ * Copyright (c) 2012 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_10.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_10.java index c0f4088494..fd30ea1527 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_10.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_10.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -17,7 +17,7 @@ import org.eclipse.swt.widgets.*; /** * This class implements the nsIHelperAppLauncherDialog interface for mozilla - * versions >=2.0. For mozilla versions >= 1.9, < 2.0 this interface is + * versions >= 4. For mozilla versions >= 1.9, < 4 this interface is * implemented by class HelperAppLauncherDialog_1_9. HelperAppLauncherDialogFactory * determines at runtime which of these classes to instantiate. */ 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 acbbd8a21c..34b3105d24 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 @@ -576,7 +576,7 @@ static void LoadLibraries () { if (MozillaPath == null) { try { - String libName = MozillaDelegate.GetSWTInitLibraryName (); + String libName = MozillaDelegate.getSWTInitLibraryName (); Library.loadLibrary (libName); initLoaded = true; } catch (UnsatisfiedLinkError e) { @@ -885,7 +885,7 @@ public void create (Composite parent, int style) { IsPre_1_9 = false; result[0] = 0; rc = interfaceRequestor.GetInterface(nsIDocShell_1_8.NS_IDOCSHELL_10_IID, result); - if (rc == XPCOM.NS_OK && result[0] != 0) { /* >=2.0 */ + if (rc == XPCOM.NS_OK && result[0] != 0) { /* >= 4.0 */ IsPre_4 = false; new nsISupports (result[0]).Release(); } @@ -1550,7 +1550,7 @@ public String getText () { if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); window.Release (); - + int /*long*/ document = result[0]; result[0] = 0; rc = XPCOM.NS_GetComponentManager (result); @@ -1802,7 +1802,7 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon } } factory.Release(); - + ExternalFactory externalFactory = new ExternalFactory (); externalFactory.AddRef (); aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.EXTERNAL_CONTRACTID, true); @@ -2603,7 +2603,7 @@ public boolean isForwardEnabled () { } static String error (int code) { - throw new SWTError ("XPCOM error " + Integer.toHexString(code)); //$NON-NLS-1$ + throw new SWTError ("XPCOM error 0x" + Integer.toHexString(code)); //$NON-NLS-1$ } void onDispose (Display display) { @@ -3392,7 +3392,7 @@ int GetInterface (int /*long*/ riid, int /*long*/ ppvObject) { if (riid == 0 || ppvObject == 0) return XPCOM.NS_ERROR_NO_INTERFACE; nsID guid = new nsID (); XPCOM.memmove (guid, riid, nsID.sizeof); - if (guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_10_IID) || guid.Equals(nsIDOMWindow.NS_IDOMWINDOW_IID)) { + if (guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_10_IID) || guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_IID)) { int /*long*/[] aContentDOMWindow = new int /*long*/[1]; int rc = webBrowser.GetContentDOMWindow (aContentDOMWindow); if (rc != XPCOM.NS_OK) error (rc); @@ -3707,7 +3707,7 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF domWindow.Release(); if (rc != XPCOM.NS_OK) error (rc); if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE); - + nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]); hookDOMListeners (target, isTop); target.Release (); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java index 69813f2261..2f450c2752 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptDialog.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptDialog.java index 8db4f5ac1b..ff0135761c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptDialog.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptDialog.java @@ -171,12 +171,12 @@ class PromptDialog extends Dialog { rc = ((Mozilla)localBrowser.webBrowser).webBrowser.GetContentDOMWindow(result); if (rc != XPCOM.NS_OK) Mozilla.error (rc); if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE); - + nsIDOMWindow window = new nsIDOMWindow(result[0]); + result[0] = 0; rc = dialogs.ViewCert(window.getAddress(), cert.getAddress()); browser.getDisplay().timerExec(-1, runnable); window.Release(); - result[0] = 0; dialogs.Release(); } }); diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java index f2b4c70d8b..001bd1b085 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2008 IBM Corporation and others. + * Copyright (c) 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java index 1541d1fdc1..0daefbd1b9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2003, 2010 IBM Corporation and others. + * Copyright (c) 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at 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 af4064b37d..1b772ad87f 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 @@ -51,6 +51,7 @@ public class XPCOM extends C { /* CID constants */ public static final nsID EXTERNAL_CID = new nsID ("f2c59ad0-bd76-11dd-ad8b-0800200c9a66"); //$NON-NLS-1$ public static final nsID NS_APPSHELL_CID = new nsID("2d96b3df-c051-11d1-a827-0040959a28c9"); //$NON-NLS-1$ + public static final nsID NS_AUTHPROMPTER_CID = new nsID("e2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ public static final nsID NS_CATEGORYMANAGER_CID = new nsID("16d222a6-1dd2-11b2-b693-f38b02c021b2"); //$NON-NLS-1$ public static final nsID NS_DOWNLOAD_CID = new nsID("e3fa9D0a-1dd1-11b2-bdef-8c720b597445"); //$NON-NLS-1$ public static final nsID NS_FILEPICKER_CID = new nsID("54ae32f8-1dd2-11b2-a209-df7c505370f8"); //$NON-NLS-1$ @@ -58,12 +59,12 @@ public class XPCOM extends C { public static final nsID NS_INPUTSTREAMCHANNEL_CID = new nsID("6ddb050c-0d04-11d4-986e-00c04fa0cf4a"); //$NON-NLS-1$ public static final nsID NS_IOSERVICE_CID = new nsID("9ac9e770-18bc-11d3-9337-00104ba0fd40"); //$NON-NLS-1$ public static final nsID NS_LOADGROUP_CID = new nsID("e1c61582-2a84-11d3-8cce-0060b0fc14a3"); //$NON-NLS-1$ - public static final nsID NS_PROMPTSERVICE_CID = new nsID("a2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ public static final nsID NS_PROMPTER_CID = new nsID("f2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ - public static final nsID NS_AUTHPROMPTER_CID = new nsID("e2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ + public static final nsID NS_PROMPTSERVICE_CID = new nsID("a2112d6a-0e28-421f-b46a-25c0b308cbd0"); //$NON-NLS-1$ public static final nsID NS_IWEBBROWSER_CID = new nsID ("F1EAC761-87E9-11d3-AF80-00A024FFC08C"); //$NON-NLS-1$ public static final String EXTERNAL_CONTRACTID = "@eclipse.org/external;1"; //$NON-NLS-1$ + public static final String NS_AUTHPROMPTER_CONTRACTID = "@mozilla.org/passwordmanager/authpromptfactory;1"; //$NON-NLS-1$ public static final String NS_CERTOVERRIDE_CONTRACTID = "@mozilla.org/security/certoverride;1"; //$NON-NLS-1$ public static final String NS_CERTIFICATEDIALOGS_CONTRACTID = "@mozilla.org/nsCertificateDialogs;1"; //$NON-NLS-1$ public static final String NS_CONTEXTSTACK_CONTRACTID = "@mozilla.org/js/xpc/ContextStack;1"; //$NON-NLS-1$ @@ -81,9 +82,8 @@ public class XPCOM extends C { public static final String NS_OBSERVER_CONTRACTID = "@mozilla.org/observer-service;1"; //$NON-NLS-1$ public static final String NS_PREFLOCALIZEDSTRING_CONTRACTID = "@mozilla.org/pref-localizedstring;1"; //$NON-NLS-1$ public static final String NS_PREFSERVICE_CONTRACTID = "@mozilla.org/preferences-service;1"; //$NON-NLS-1$ - public static final String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$ public static final String NS_PROMPTER_CONTRACTID = "@mozilla.org/prompter;1"; //$NON-NLS-1$ - public static final String NS_AUTHPROMPTER_CONTRACTID = "@mozilla.org/passwordmanager/authpromptfactory;1"; //$NON-NLS-1$ + public static final String NS_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$ public static final String NS_TRANSFER_CONTRACTID = "@mozilla.org/transfer;1"; //$NON-NLS-1$ public static final String NS_VARIANT_CONTRACTID = "@mozilla.org/variant;1"; //$NON-NLS-1$ public static final String NS_WEBNAVIGATIONINFO_CONTRACTID = "@mozilla.org/webnavigation-info;1"; //$NON-NLS-1$ diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java index 7eccae58a0..a1b88d8c62 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java @@ -22,7 +22,7 @@ * * IBM * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2011 IBM Corp. All Rights Reserved. + * - Copyright (C) 2012 IBM Corp. All Rights Reserved. * * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_8.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_8.java index e8e9b9332d..ac10eead2d 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_8.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_8.java @@ -22,7 +22,7 @@ *
* IBM
* - Binding to permit interfacing between Mozilla and SWT
- * - Copyright (C) 2011 IBM Corp. All Rights Reserved.
+ * - Copyright (C) 2012 IBM Corp. All Rights Reserved.
*
* ***** END LICENSE BLOCK ***** */
package org.eclipse.swt.internal.mozilla;
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java index 1b87a3d975..e94737a32c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java @@ -22,7 +22,7 @@ * * IBM * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. + * - Copyright (C) 2012 IBM Corp. All Rights Reserved. * * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java index 6f692c923a..4ee01295ae 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java @@ -22,7 +22,7 @@ * * IBM * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved. + * - Copyright (C) 2012 IBM Corp. All Rights Reserved. * * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java index 0151fbffc3..7a36f9f35e 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager.java @@ -22,7 +22,7 @@ * * IBM * - Binding to permit interfacing between Mozilla and SWT - * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved. + * - Copyright (C) 2012 IBM Corp. All Rights Reserved. * * ***** END LICENSE BLOCK ***** */ package org.eclipse.swt.internal.mozilla; 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 1d91ff169d..a656875e9b 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 @@ -73,14 +73,36 @@ static String getLibraryName () { return "libxpcom.so"; //$NON-NLS-1$ } -String getJSLibraryName_Pre4() { - return "libxpcom.so"; +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); } @@ -109,19 +131,11 @@ int /*long*/ getHandle () { return embedHandle; } -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$ -} - int /*long*/ gtk_event (int /*long*/ handle, int /*long*/ gdkEvent, int /*long*/ pointer) { GdkEvent event = new GdkEvent (); OS.memmove (event, gdkEvent, GdkEvent.sizeof); @@ -216,10 +230,6 @@ void init () { } } -boolean needsSpinup () { - return true; -} - void onDispose (int /*long*/ embedHandle) { if (listener != null) { eventShell.getDisplay ().removeFilter (SWT.FocusIn, listener); 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 93d231b06b..87b0c1ae0b 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 @@ -35,6 +35,21 @@ static String getLibraryName () { return "xpcom.dll"; //$NON-NLS-1$ } +static String getJSLibraryName_Pre4 () { + return "js3250.dll"; //$NON-NLS-1$ +} + +static String getJSLibraryName () { + return "mozjs.dll"; //$NON-NLS-1$ +} + +static String getSWTInitLibraryName () { + return "swt-xulrunner"; //$NON-NLS-1$ +} + +static void loadAdditionalLibraries (String mozillaPath) { +} + static char[] mbcsToWcs (String codePage, byte[] buffer) { char[] chars = new char[buffer.length]; int charCount = OS.MultiByteToWideChar (OS.CP_ACP, OS.MB_PRECOMPOSED, buffer, buffer.length, chars, chars.length); @@ -44,6 +59,10 @@ static char[] mbcsToWcs (String codePage, byte[] buffer) { return result; } +static boolean needsSpinup () { + return false; +} + static byte[] wcsToMbcs (String codePage, String string, boolean terminate) { int byteCount; char[] chars = new char[string.length()]; @@ -90,14 +109,6 @@ int /*long*/ getHandle () { return browser.handle; } -String getJSLibraryName_Pre4 () { - return "js3250.dll"; //$NON-NLS-1$ -} - -String getJSLibraryName () { - return "mozjs.dll"; //$NON-NLS-1$ -} - String getProfilePath () { String baseDir; /* Use the character encoding for the default locale */ @@ -110,10 +121,6 @@ String getProfilePath () { 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 () { } @@ -127,10 +134,6 @@ boolean hookEnterExit () { void init () { } -boolean needsSpinup () { - return false; -} - void onDispose (int /*long*/ embedHandle) { removeWindowSubclass (); browser = null; diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c index d3910ed203..8b859befa3 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os.c @@ -4415,6 +4415,22 @@ JNIEXPORT jintLong JNICALL OS_NATIVE(NSAccessibilityWindowRole) } #endif +#ifndef NO_NSAddImage +JNIEXPORT jintLong JNICALL OS_NATIVE(NSAddImage) + (JNIEnv *env, jclass that, jbyteArray arg0, jint arg1) +{ + jbyte *lparg0=NULL; + jintLong rc = 0; + OS_NATIVE_ENTER(env, that, NSAddImage_FUNC); + if (arg0) if ((lparg0 = (*env)->GetByteArrayElements(env, arg0, NULL)) == NULL) goto fail; + rc = (jintLong)NSAddImage((const char*)lparg0, (uint32_t)arg1); +fail: + if (arg0 && lparg0) (*env)->ReleaseByteArrayElements(env, arg0, lparg0, 0); + OS_NATIVE_EXIT(env, that, NSAddImage_FUNC); + return rc; +} +#endif + #ifndef NO_NSAffineTransformStruct_1sizeof JNIEXPORT jint JNICALL OS_NATIVE(NSAffineTransformStruct_1sizeof) (JNIEnv *env, jclass that) diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c index 95d94153c2..a8fae8b591 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.c @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -14,8 +14,8 @@ #ifdef NATIVE_STATS -int OS_nativeFunctionCount = 630; -int OS_nativeFunctionCallCount[630]; +int OS_nativeFunctionCount = 631; +int OS_nativeFunctionCallCount[631]; char * OS_nativeFunctionNames[] = { "ATSFontActivateFromFileReference", "AcquireRootMenu", @@ -332,6 +332,7 @@ char * OS_nativeFunctionNames[] = { "NSAccessibilityVisibleRowsAttribute", "NSAccessibilityWindowAttribute", "NSAccessibilityWindowRole", + "NSAddImage", "NSAffineTransformStruct_1sizeof", "NSApplicationDidChangeScreenParametersNotification", "NSAttachmentAttributeName", diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h index 4a3efdb762..fa14656ec9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/os_stats.h @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2011 IBM Corporation and others. + * Copyright (c) 2000, 2012 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -340,6 +340,7 @@ typedef enum { NSAccessibilityVisibleRowsAttribute_FUNC, NSAccessibilityWindowAttribute_FUNC, NSAccessibilityWindowRole_FUNC, + NSAddImage_FUNC, NSAffineTransformStruct_1sizeof_FUNC, NSApplicationDidChangeScreenParametersNotification_FUNC, NSAttachmentAttributeName_FUNC, diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 99529e2293..d70304cca2 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -2250,6 +2250,8 @@ public static final int /*long*/ sel_yearOfCommonEra = sel_registerName("yearOfC public static final int /*long*/ sel_zoom_ = sel_registerName("zoom:"); /** Constants */ +public static final int NSADDIMAGE_OPTION_RETURN_ON_ERROR = 0x1; +public static final int NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME = 0x8; public static final int NSAlertFirstButtonReturn = 1000; public static final int NSAlertSecondButtonReturn = 1001; public static final int NSAlertThirdButtonReturn = 1002; @@ -3168,6 +3170,11 @@ public static final native void NSBeep(); */ public static final native int /*long*/ NSBitsPerPixelFromDepth(int depth); /** + * @param image_name cast=(const char*) + * @param options cast=(uint32_t) + */ +public static final native int /*long*/ NSAddImage(byte[] image_name, int options); +/** * @param srcGState cast=(NSInteger) * @param srcRect flags=struct * @param destPoint flags=struct diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak index 90a332ded5..ad5b1cae27 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak @@ -67,7 +67,6 @@ GLXLIBS = -lGL -lGLU -lm #NATIVE_STATS = -DNATIVE_STATS MOZILLACFLAGS = -O \ - -std=gnu++0x \ -DSWT_VERSION=$(SWT_VERSION) \ $(NATIVE_STATS) \ -DMOZILLA_STRICT_API=1 \ |