summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam <lshanmug@in.ibm.com>2011-11-30 20:38:28 +0530
committerGrant Gayed <grant_gayed@ca.ibm.com>2012-03-06 16:45:15 -0500
commitce5bc5ccb4b7e34346accfd668928ba52a6f7a27 (patch)
tree160b4cd3d640729ba6cb2a5c294793093f7bc809
parenta87a0403ac3b9edf077183bd0f22ecbd0e7e4a59 (diff)
downloadeclipse.platform.swt-ce5bc5ccb4b7e34346accfd668928ba52a6f7a27.tar.gz
eclipse.platform.swt-ce5bc5ccb4b7e34346accfd668928ba52a6f7a27.tar.xz
eclipse.platform.swt-ce5bc5ccb4b7e34346accfd668928ba52a6f7a27.zip
xulrunner-work1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/cocoa/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp25
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp9
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory_2.java44
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_2.java49
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_2.java73
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java729
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java238
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptDialog.java17
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java115
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java16
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java627
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java23
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java57
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java8
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget_1_9.java55
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent_1_9.java89
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent_1_9.java299
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent_1_9.java87
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java56
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java68
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_1_9.java111
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_8.java111
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell_2.java318
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_2.java118
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_2.java87
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java2
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch_1_9.java123
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java46
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal_1_9.java143
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java78
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java48
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_2.java155
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITransfer_2.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI_1_9.java147
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser_1_9.java71
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2_2.java47
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/gtk/org/eclipse/swt/browser/MozillaDelegate.java4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/win32/org/eclipse/swt/browser/MozillaDelegate.java6
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak4
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak1
53 files changed, 4221 insertions, 179 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 716e1c34e9..c084b81204 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
@@ -103,6 +103,10 @@ int /*long*/ getHandle () {
}
String getJSLibraryName () {
+ return "libxpcom.dylib";
+}
+
+String getJSLibraryName_Pre2 () {
return "libmozjs.dylib"; //$NON-NLS-1$
}
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 22e2ae0a02..9ebb6ef8af 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
@@ -40,6 +40,31 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__J)(JNIEnv *env, jclass that, jintLon
}
#endif
+#if (!defined(NO__1Call__IIII) && !defined(JNI64)) || (!defined(NO__1Call__JJJJ) && defined(JNI64))
+#ifndef JNI64
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__IIII)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__IIII)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3)
+#else
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJ)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(_1Call__JJJJ)(JNIEnv *env, jclass that, jintLong arg0, jintLong arg1, jintLong arg2, jintLong arg3)
+#endif
+{
+ jint rc = 0;
+#ifndef JNI64
+ XPCOM_NATIVE_ENTER(env, that, _1Call__IIII_FUNC);
+#else
+ XPCOM_NATIVE_ENTER(env, that, _1Call__JJJJ_FUNC);
+#endif
+ rc = (jint)((SWT_XREInitEmbedding2)arg0)((nsILocalFile *)arg1, (nsILocalFile *)arg2, (nsIDirectoryServiceProvider *)arg3);
+#ifndef JNI64
+ XPCOM_NATIVE_EXIT(env, that, _1Call__IIII_FUNC);
+#else
+ XPCOM_NATIVE_EXIT(env, that, _1Call__JJJJ_FUNC);
+#endif
+ return rc;
+}
+#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);
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 5b0554c676..004d148439 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
@@ -40,6 +40,7 @@
#endif /* __APPLE__ */
#endif /* _WIN32 */
+#define SWT_XREInitEmbedding2 nsresult (*)(nsILocalFile *,nsILocalFile *,nsIDirectoryServiceProvider *)
#define SWT_XREInitEmbedding nsresult (*)(nsILocalFile *,nsILocalFile *,nsIDirectoryServiceProvider *,nsStaticModuleInfo const *,PRUint32)
#endif /* INC_xpcom_H */
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 f8427214ea..f9aa31b99d 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
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 231;
-int XPCOM_nativeFunctionCallCount[231];
+int XPCOM_nativeFunctionCount = 232;
+int XPCOM_nativeFunctionCallCount[232];
char * XPCOM_nativeFunctionNames[] = {
#ifndef JNI64
"_1Call__I",
@@ -23,6 +23,11 @@ char * XPCOM_nativeFunctionNames[] = {
"_1Call__J",
#endif
#ifndef JNI64
+ "_1Call__IIII",
+#else
+ "_1Call__JJJJ",
+#endif
+#ifndef JNI64
"_1Call__IIIIII",
#else
"_1Call__JJJJJI",
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 87e516ef5e..f3a130527f 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
@@ -31,6 +31,11 @@ typedef enum {
_1Call__J_FUNC,
#endif
#ifndef JNI64
+ _1Call__IIII_FUNC,
+#else
+ _1Call__JJJJ_FUNC,
+#endif
+#ifndef JNI64
_1Call__IIIIII_FUNC,
#else
_1Call__JJJJJI_FUNC,
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java
index 52f7d006fb..27e49c1f6c 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker.java
@@ -101,6 +101,11 @@ int QueryInterface (int /*long*/ riid, int /*long*/ ppvObject) {
AddRef ();
return XPCOM.NS_OK;
}
+ if (guid.Equals (nsIFilePicker_2.NS_IFILEPICKER_IID)) {
+ XPCOM.memmove(ppvObject, new int /*long*/[] {filePicker.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF);
return XPCOM.NS_ERROR_NO_INTERFACE;
@@ -114,8 +119,7 @@ int Release () {
Browser getBrowser (int /*long*/ aDOMWindow) {
if (aDOMWindow == 0) return null;
- nsIDOMWindow window = new nsIDOMWindow (aDOMWindow);
- return Mozilla.findBrowser (window);
+ return Mozilla.getBrowser (aDOMWindow);
}
/*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory_2.java
new file mode 100644
index 0000000000..2c968c7de5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePickerFactory_2.java
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.internal.C;
+import org.eclipse.swt.internal.mozilla.*;
+
+class FilePickerFactory_2 extends FilePickerFactory_1_8 {
+
+void createCOMInterfaces () {
+ /* Create each of the interfaces that this object implements */
+ supports = new XPCOMObject (new int[] {2, 0, 0}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ };
+
+ factory = new XPCOMObject (new int[] {2, 0, 0, 3, 1}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ public int /*long*/ method3 (int /*long*/[] args) {return CreateInstance (args[0], args[1], args[2]);}
+ public int /*long*/ method4 (int /*long*/[] args) {return LockFactory ((int)/*64*/args[0]);}
+ };
+}
+
+/* nsIFactory */
+
+int CreateInstance (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result) {
+ FilePicker_2 picker = new FilePicker_2 ();
+ picker.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {picker.getAddress ()}, C.PTR_SIZEOF);
+ return XPCOM.NS_OK;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_2.java
new file mode 100644
index 0000000000..28161c2c42
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/FilePicker_2.java
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2007 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.internal.mozilla.*;
+
+class FilePicker_2 extends FilePicker_1_8 {
+
+void createCOMInterfaces () {
+ /* Create each of the interfaces that this object implements */
+ supports = new XPCOMObject (new int[] {2, 0, 0}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ };
+
+ filePicker = new XPCOMObject (new int[] {2, 0, 0, 3, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ public int /*long*/ method3 (int /*long*/[] args) {return Init (args[0], args[1], (short)args[2]);}
+ public int /*long*/ method4 (int /*long*/[] args) {return AppendFilters ((int)/*64*/args[0]);}
+ public int /*long*/ method5 (int /*long*/[] args) {return AppendFilter (args[0], args[1]);}
+ public int /*long*/ method6 (int /*long*/[] args) {return GetDefaultString (args[0]);}
+ public int /*long*/ method7 (int /*long*/[] args) {return SetDefaultString (args[0]);}
+ public int /*long*/ method8 (int /*long*/[] args) {return GetDefaultExtension (args[0]);}
+ public int /*long*/ method9 (int /*long*/[] args) {return SetDefaultExtension (args[0]);}
+ public int /*long*/ method10 (int /*long*/[] args) {return GetFilterIndex (args[0]);}
+ public int /*long*/ method11 (int /*long*/[] args) {return SetFilterIndex ((int)/*64*/args[0]);}
+ public int /*long*/ method12 (int /*long*/[] args) {return GetDisplayDirectory (args[0]);}
+ public int /*long*/ method13 (int /*long*/[] args) {return SetDisplayDirectory (args[0]);}
+ public int /*long*/ method14 (int /*long*/[] args) {return GetFile (args[0]);}
+ public int /*long*/ method15 (int /*long*/[] args) {return GetFileURL (args[0]);}
+ public int /*long*/ method16 (int /*long*/[] args) {return GetFiles (args[0]);}
+ public int /*long*/ method17 (int /*long*/[] args) {return XPCOM.NS_ERROR_NOT_IMPLEMENTED;}
+ public int /*long*/ method18 (int /*long*/[] args) {return XPCOM.NS_ERROR_NOT_IMPLEMENTED;}
+ public int /*long*/ method19 (int /*long*/[] args) {return Show (args[0]);}
+ };
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java
index 21008f0ea9..ca531c3972 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialogFactory.java
@@ -92,10 +92,14 @@ int CreateInstance (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result)
HelperAppLauncherDialog helperAppLauncherDialog = new HelperAppLauncherDialog ();
helperAppLauncherDialog.AddRef ();
XPCOM.memmove (result, new int /*long*/[] {helperAppLauncherDialog.getAddress ()}, C.PTR_SIZEOF);
- } else {
+ } else if (Mozilla.IsPre_2){
HelperAppLauncherDialog_1_9 helperAppLauncherDialog = new HelperAppLauncherDialog_1_9 ();
helperAppLauncherDialog.AddRef ();
XPCOM.memmove (result, new int /*long*/[] {helperAppLauncherDialog.getAddress ()}, C.PTR_SIZEOF);
+ } else {
+ HelperAppLauncherDialog_2 helperAppLauncherDialog = new HelperAppLauncherDialog_2 ();
+ helperAppLauncherDialog.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {helperAppLauncherDialog.getAddress ()}, C.PTR_SIZEOF);
}
return XPCOM.NS_OK;
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_2.java
new file mode 100644
index 0000000000..72bfca3008
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/HelperAppLauncherDialog_2.java
@@ -0,0 +1,73 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.C;
+import org.eclipse.swt.internal.mozilla.*;
+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
+ * implemented by class HelperAppLauncherDialog_1_9. HelperAppLauncherDialogFactory
+ * determines at runtime which of these classes to instantiate.
+ */
+class HelperAppLauncherDialog_2 extends HelperAppLauncherDialog_1_9 {
+ XPCOMObject supports;
+ XPCOMObject helperAppLauncherDialog;
+ int refCount = 0;
+
+HelperAppLauncherDialog_2 () {
+ createCOMInterfaces ();
+}
+
+/* nsIHelperAppLauncherDialog */
+
+int Show (int /*long*/ aLauncher, int /*long*/ aContext, int aReason) {
+ nsIHelperAppLauncher_2 helperAppLauncher = new nsIHelperAppLauncher_2 (aLauncher);
+ return helperAppLauncher.SaveToDisk (0, 0);
+}
+
+int PromptForSaveToFile (int /*long*/ aLauncher, int /*long*/ aWindowContext, int /*long*/ aDefaultFileName, int /*long*/ aSuggestedFileExtension, int aForcePrompt, int /*long*/ _retval) {
+ int length = XPCOM.strlen_PRUnichar (aDefaultFileName);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, aDefaultFileName, length * 2);
+ String defaultFile = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aSuggestedFileExtension);
+ dest = new char[length];
+ XPCOM.memmove (dest, aSuggestedFileExtension, length * 2);
+ String suggestedFileExtension = new String (dest);
+
+ Shell shell = new Shell ();
+ FileDialog fileDialog = new FileDialog (shell, SWT.SAVE);
+ fileDialog.setFileName (defaultFile);
+ fileDialog.setFilterExtensions (new String[] {suggestedFileExtension});
+ String name = fileDialog.open ();
+ shell.close ();
+ if (name == null) {
+ nsIHelperAppLauncher_2 launcher = new nsIHelperAppLauncher_2 (aLauncher);
+ int rc = launcher.Cancel (XPCOM.NS_BINDING_ABORTED);
+ if (rc != XPCOM.NS_OK) Mozilla.error (rc);
+ return XPCOM.NS_ERROR_FAILURE;
+ }
+ nsEmbedString path = new nsEmbedString (name);
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_NewLocalFile (path.getAddress (), 1, result);
+ path.dispose ();
+ if (rc != XPCOM.NS_OK) Mozilla.error (rc);
+ if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+ /* Our own nsIDownload has been registered during the Browser initialization. It will be invoked by Mozilla. */
+ XPCOM.memmove (_retval, result, C.PTR_SIZEOF);
+ return XPCOM.NS_OK;
+}
+}
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 69e41c1c42..acb1167ef1 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
@@ -62,7 +62,7 @@ class Mozilla extends WebBrowser {
static int BrowserCount, NextJSFunctionIndex = 1;
static Hashtable AllFunctions = new Hashtable ();
static Listener DisplayListener;
- static boolean Initialized, IsPre_1_8, IsPre_1_9, IsXULRunner, PerformedVersionCheck, XPCOMWasGlued, XPCOMInitWasGlued;
+ static boolean Initialized, IsPre_1_8, IsPre_1_9, IsPre_2, IsXULRunner, PerformedVersionCheck, XPCOMWasGlued, XPCOMInitWasGlued;
static String MozillaPath;
static String oldProxyHostFTP, oldProxyHostHTTP, oldProxyHostSSL;
static int oldProxyPortFTP = -1, oldProxyPortHTTP = -1, oldProxyPortSSL = -1, oldProxyType = -1;
@@ -113,6 +113,7 @@ class Mozilla extends WebBrowser {
static final String TRUE = "true"; //$NON-NLS-1$
static final String URI_FILEROOT = "file:///"; //$NON-NLS-1$
static final String XULRUNNER_PATH = "org.eclipse.swt.browser.XULRunnerPath"; //$NON-NLS-1$
+ static final String XULRUNNER_VERSION = "org.eclipse.swt.browser.XULRunnerVersion"; //$NON-NLS-1$
// TEMPORARY CODE
static final String FACTORIES_REGISTERED = "org.eclipse.swt.browser.MozillaFactoriesRegistered"; //$NON-NLS-1$
@@ -794,8 +795,11 @@ public void create (Composite parent, int style) {
nsID NS_IWEBBROWSER_CID = new nsID ("F1EAC761-87E9-11d3-AF80-00A024FFC08C"); //$NON-NLS-1$
rc = componentManager.CreateInstance (NS_IWEBBROWSER_CID, 0, nsIWebBrowser.NS_IWEBBROWSER_IID, result);
if (rc != XPCOM.NS_OK) {
- browser.dispose ();
- error (rc);
+ rc = componentManager.CreateInstance (NS_IWEBBROWSER_CID, 0, nsIWebBrowser_1_9.NS_IWEBBROWSER_IID, result);
+ if (rc != XPCOM.NS_OK) {
+ browser.dispose ();
+ error (rc);
+ }
}
if (result[0] == 0) {
browser.dispose ();
@@ -836,18 +840,6 @@ public void create (Composite parent, int style) {
factoriesRegistered = true;
}
- if (!factoriesRegistered) {
- HelperAppLauncherDialogFactory dialogFactory = new HelperAppLauncherDialogFactory ();
- dialogFactory.AddRef ();
- byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID, true);
- byte[] aClassName = MozillaDelegate.wcsToMbcs (null, "swtHelperAppLauncherDialog", true); //$NON-NLS-1$
- rc = componentRegistrar.RegisterFactory (XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CID, aClassName, aContractID, dialogFactory.getAddress ());
- if (rc != XPCOM.NS_OK) {
- browser.dispose ();
- error (rc);
- }
- dialogFactory.Release ();
- }
/*
* Check for the availability of the pre-1.8 implementation of nsIDocShell
@@ -870,8 +862,9 @@ public void create (Composite parent, int style) {
IsPre_1_8 = true;
new nsISupports (result[0]).Release ();
}
- result[0] = 0;
IsPre_1_9 = true;
+ IsPre_2 = true;
+ result[0] = 0;
/*
* A Download factory for contract "Transfer" must be registered iff the GRE's version is 1.8.x.
@@ -902,12 +895,31 @@ public void create (Composite parent, int style) {
}
} else { /* >= 1.9 */
IsPre_1_9 = false;
+ result[0] = 0;
+ rc = interfaceRequestor.GetInterface(nsIDocShell_2.NS_IDOCSHELL_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) { /* >=2.0 */
+ IsPre_2 = false;
+ new nsISupports (result[0]).Release();
+ }
}
}
result[0] = 0;
interfaceRequestor.Release ();
componentRegistrar.Release ();
+ if (!factoriesRegistered) {
+ HelperAppLauncherDialogFactory dialogFactory = new HelperAppLauncherDialogFactory ();
+ dialogFactory.AddRef ();
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID, true);
+ byte[] aClassName = MozillaDelegate.wcsToMbcs (null, "swtHelperAppLauncherDialog", true); //$NON-NLS-1$
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_HELPERAPPLAUNCHERDIALOG_CID, aClassName, aContractID, dialogFactory.getAddress ());
+ if (rc != XPCOM.NS_OK) {
+ browser.dispose ();
+ error (rc);
+ }
+ dialogFactory.Release ();
+ }
+
System.setProperty (FACTORIES_REGISTERED, TRUE);
}
componentManager.Release ();
@@ -1271,7 +1283,7 @@ public boolean execute (String script) {
* exposed as of mozilla 1.9.
*/
int /*long*/[] result = new int /*long*/[1];
- if (!IsPre_1_9) {
+ if (!IsPre_2) {
int rc = XPCOM.NS_GetServiceManager (result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
@@ -1279,10 +1291,11 @@ public boolean execute (String script) {
nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
result[0] = 0;
nsIPrincipal principal = null;
+ nsIPrincipal_1_9 principal_1_9 = null;
byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_SCRIPTSECURITYMANAGER_CONTRACTID, true);
- rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9_1.NS_ISCRIPTSECURITYMANAGER_IID, result);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_2.NS_ISCRIPTSECURITYMANAGER_IID, result);
if (rc == XPCOM.NS_OK && result[0] != 0) {
- nsIScriptSecurityManager_1_9_1 securityManager = new nsIScriptSecurityManager_1_9_1 (result[0]);
+ nsIScriptSecurityManager_2 securityManager = new nsIScriptSecurityManager_2 (result[0]);
result[0] = 0;
rc = securityManager.GetSystemPrincipal (result);
if (rc != XPCOM.NS_OK) error (rc);
@@ -1291,32 +1304,49 @@ public boolean execute (String script) {
result[0] = 0;
securityManager.Release ();
} else {
- rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9.NS_ISCRIPTSECURITYMANAGER_IID, result);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9_1.NS_ISCRIPTSECURITYMANAGER_IID, result);
if (rc == XPCOM.NS_OK && result[0] != 0) {
- nsIScriptSecurityManager_1_9 securityManager = new nsIScriptSecurityManager_1_9 (result[0]);
+ nsIScriptSecurityManager_1_9_1 securityManager = new nsIScriptSecurityManager_1_9_1 (result[0]);
result[0] = 0;
rc = securityManager.GetSystemPrincipal (result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NULL_POINTER);
- principal = new nsIPrincipal (result[0]);
+ principal_1_9 = new nsIPrincipal_1_9 (result[0]);
result[0] = 0;
securityManager.Release ();
+ } else {
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIScriptSecurityManager_1_9.NS_ISCRIPTSECURITYMANAGER_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIScriptSecurityManager_1_9 securityManager = new nsIScriptSecurityManager_1_9 (result[0]);
+ result[0] = 0;
+ rc = securityManager.GetSystemPrincipal (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_ERROR_NULL_POINTER);
+ principal_1_9 = new nsIPrincipal_1_9 (result[0]);
+ result[0] = 0;
+ securityManager.Release ();
+ }
}
}
- if (principal != null) {
+ if (principal != null || principal_1_9 != null) {
rc = webBrowser.QueryInterface (nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
nsIInterfaceRequestor interfaceRequestor = new nsIInterfaceRequestor (result[0]);
result[0] = 0;
- nsID scriptGlobalObjectNSID_1_9 = new nsID ("6afecd40-0b9a-4cfd-8c42-0f645cd91829"); /* nsIScriptGlobalObject */ //$NON-NLS-1$
- rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_1_9, result);
+ nsID scriptGlobalObjectNSID_2 = new nsID ("4eb16819-4e81-406e-9305-6f30fcd2624a"); /* nsIScriptGlobalObject */ //$NON-NLS-1$
+ rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_2, result);
if (!(rc == XPCOM.NS_OK && result[0] != 0)) {
result[0] = 0;
nsID scriptGlobalObjectNSID_1_9_2 = new nsID ("e9f3f2c1-2d94-4722-bbd4-2bf6fdf42f48"); /* nsIScriptGlobalObject */ //$NON-NLS-1$
rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_1_9_2, result);
+ if (!(rc == XPCOM.NS_OK && result[0] != 0)) {
+ result[0] = 0;
+ nsID scriptGlobalObjectNSID_1_9 = new nsID ("6afecd40-0b9a-4cfd-8c42-0f645cd91829"); /* nsIScriptGlobalObject */ //$NON-NLS-1$
+ rc = interfaceRequestor.GetInterface (scriptGlobalObjectNSID_1_9, result);
+ }
}
interfaceRequestor.Release ();
@@ -1331,12 +1361,17 @@ public boolean execute (String script) {
if (scriptContext != 0 && globalJSObject != 0) {
/* ensure that the received nsIScriptContext implements the expected interface */
- nsID scriptContextNSID_1_9 = new nsID ("e7b9871d-3adc-4bf7-850d-7fb9554886bf"); /* nsIScriptContext */ //$NON-NLS-1$
- rc = new nsISupports (scriptContext).QueryInterface (scriptContextNSID_1_9, result);
+ nsID scriptContextNSID_2 = new nsID ("a7139c0e-962c-44b6-bec3-e4166bfe84eb"); /* nsIScriptContext */ //$NON-NLS-1$
+ rc = new nsISupports (scriptContext).QueryInterface (scriptContextNSID_2, result);
if (!(rc == XPCOM.NS_OK && result[0] != 0)) {
result[0] = 0;
nsID scriptContextNSID_1_9_2 = new nsID ("87482b5e-e019-4df5-9bc2-b2a51b1f2d28"); /* nsIScriptContext */ //$NON-NLS-1$
rc = new nsISupports (scriptContext).QueryInterface (scriptContextNSID_1_9_2, result);
+ if (!(rc == XPCOM.NS_OK && result[0] != 0)) {
+ result[0] = 0;
+ nsID scriptContextNSID_1_9 = new nsID ("e7b9871d-3adc-4bf7-850d-7fb9554886bf"); /* nsIScriptContext */ //$NON-NLS-1$
+ rc = new nsISupports (scriptContext).QueryInterface (scriptContextNSID_1_9, result);
+ }
}
if (rc == XPCOM.NS_OK && result[0] != 0) {
@@ -1349,13 +1384,21 @@ public boolean execute (String script) {
char[] scriptChars = new char[length];
script.getChars(0, length, scriptChars, 0);
byte[] urlbytes = MozillaDelegate.wcsToMbcs (null, getUrl (), true);
- rc = principal.GetJSPrincipals (nativeContext, result);
+ rc = (principal != null) ? principal.GetJSPrincipals (nativeContext, result)
+ : principal_1_9.GetJSPrincipals (nativeContext, result);
if (rc == XPCOM.NS_OK && result[0] != 0) {
int /*long*/ principals = result[0];
result[0] = 0;
- principal.Release ();
+ String jsLibraryName = null;
+ if (principal != null) {
+ principal.Release ();
+ jsLibraryName = delegate.getJSLibraryName();
+ } else {
+ principal_1_9.Release();
+ jsLibraryName = delegate.getJSLibraryName_Pre2();
+ }
if (pathBytes_JSEvaluateUCScriptForPrincipals == null) {
- String mozillaPath = getMozillaPath () + delegate.getJSLibraryName () + '\0';
+ String mozillaPath = getMozillaPath () + jsLibraryName + '\0';
try {
pathBytes_JSEvaluateUCScriptForPrincipals = mozillaPath.getBytes ("UTF-8"); //$NON-NLS-1$
} catch (UnsupportedEncodingException e) {
@@ -1385,7 +1428,8 @@ public boolean execute (String script) {
}
}
}
- principal.Release ();
+ if (principal != null) principal.Release ();
+ else principal_1_9.Release();
}
serviceManager.Release ();
}
@@ -1410,7 +1454,7 @@ static Browser findBrowser (int /*long*/ handle) {
return MozillaDelegate.findBrowser (handle);
}
-static Browser findBrowser (nsIDOMWindow aDOMWindow) {
+static Browser getBrowser (int /*long*/ aDOMWindow) {
int /*long*/[] result = new int /*long*/[1];
int rc = XPCOM.NS_GetServiceManager (result);
if (rc != XPCOM.NS_OK) Mozilla.error (rc);
@@ -1427,7 +1471,13 @@ static Browser findBrowser (nsIDOMWindow aDOMWindow) {
nsIWindowWatcher windowWatcher = new nsIWindowWatcher (result[0]);
result[0] = 0;
/* the chrome will only be answered for the top-level nsIDOMWindow */
- rc = aDOMWindow.GetTop (result);
+ if (!IsPre_2) {
+ nsIDOMWindow window = new nsIDOMWindow (aDOMWindow);
+ rc = window.GetTop (result);
+ } else {
+ nsIDOMWindow_1_9 window = new nsIDOMWindow_1_9 (aDOMWindow);
+ rc = window.GetTop (result);
+ }
if (rc != XPCOM.NS_OK) Mozilla.error (rc);
if (result[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE);
int /*long*/ topDOMWindow = result[0];
@@ -1531,13 +1581,22 @@ public String getText () {
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
- nsIDOMWindow window = new nsIDOMWindow (result[0]);
- result[0] = 0;
- rc = window.GetDocument (result);
- if (rc != XPCOM.NS_OK) error (rc);
- if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
- window.Release ();
-
+ if (!IsPre_2) {
+ nsIDOMWindow window = new nsIDOMWindow (result[0]);
+ result[0] = 0;
+ rc = window.GetDocument (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ window.Release ();
+ } else {
+ nsIDOMWindow_1_9 window = new nsIDOMWindow_1_9 (result[0]);
+ result[0] = 0;
+ rc = window.GetDocument (result);
+ 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);
@@ -1767,13 +1826,29 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon
factory.AddRef ();
byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_PROMPTSERVICE_CONTRACTID, true);
byte[] aClassName = MozillaDelegate.wcsToMbcs (null, "swtPromptService", true); //$NON-NLS-1$
- rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTSERVICE_CID, aClassName, aContractID, factory.getAddress ());
+// rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTSERVICE_CID, aClassName, aContractID, factory.getAddress());
if (rc != XPCOM.NS_OK) {
browser.dispose ();
error (rc);
}
- factory.Release ();
-
+ if (!IsPre_2) {
+ aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_PROMPTER_CONTRACTID, true);
+ aClassName = MozillaDelegate.wcsToMbcs (null, "swtPrompter", true); //$NON-NLS-1$
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_PROMPTER_CID, aClassName, aContractID, factory.getAddress());
+ if (rc != XPCOM.NS_OK) {
+ browser.dispose ();
+ error (rc);
+ }
+ aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_AUTHPROMPTER_CONTRACTID, true);
+ aClassName = MozillaDelegate.wcsToMbcs (null, "swtAuthPrompter", true); //$NON-NLS-1$
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_AUTHPROMPTER_CID, aClassName, aContractID, factory.getAddress());
+ if (rc != XPCOM.NS_OK) {
+ browser.dispose ();
+ error (rc);
+ }
+ }
+ factory.Release();
+
ExternalFactory externalFactory = new ExternalFactory ();
externalFactory.AddRef ();
aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.EXTERNAL_CONTRACTID, true);
@@ -1804,18 +1879,20 @@ void initFactories (nsIServiceManager serviceManager, nsIComponentManager compon
* If the GRE version is >= 1.9 then no Download factory is registered because this
* functionality is provided by the GRE.
*/
- DownloadFactory downloadFactory = new DownloadFactory ();
- downloadFactory.AddRef ();
- aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_DOWNLOAD_CONTRACTID, true);
- aClassName = MozillaDelegate.wcsToMbcs (null, "swtDownload", true); //$NON-NLS-1$
- rc = componentRegistrar.RegisterFactory (XPCOM.NS_DOWNLOAD_CID, aClassName, aContractID, downloadFactory.getAddress ());
- if (rc != XPCOM.NS_OK) {
- browser.dispose ();
- error (rc);
+ if (IsPre_2) {
+ DownloadFactory downloadFactory = new DownloadFactory ();
+ downloadFactory.AddRef ();
+ aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_DOWNLOAD_CONTRACTID, true);
+ aClassName = MozillaDelegate.wcsToMbcs (null, "swtDownload", true); //$NON-NLS-1$
+ rc = componentRegistrar.RegisterFactory (XPCOM.NS_DOWNLOAD_CID, aClassName, aContractID, downloadFactory.getAddress ());
+ if (rc != XPCOM.NS_OK) {
+ browser.dispose ();
+ error (rc);
+ }
+ downloadFactory.Release ();
}
- downloadFactory.Release ();
- FilePickerFactory pickerFactory = isXULRunner ? new FilePickerFactory_1_8 () : new FilePickerFactory ();
+ FilePickerFactory pickerFactory = !IsPre_2 ? new FilePickerFactory_2() : (isXULRunner ? new FilePickerFactory_1_8 () : new FilePickerFactory ());
pickerFactory.AddRef ();
aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_FILEPICKER_CONTRACTID, true);
aClassName = MozillaDelegate.wcsToMbcs (null, "swtFilePicker", true); //$NON-NLS-1$
@@ -1934,7 +2011,10 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) {
int /*long*/ ptr = C.malloc (size * 2);
C.memset (ptr, 0, size * 2);
nsDynamicFunctionLoad functionLoad = new nsDynamicFunctionLoad ();
- byte[] bytes = MozillaDelegate.wcsToMbcs (null, "XRE_InitEmbedding", true); //$NON-NLS-1$
+ int version = Integer.getInteger(XULRUNNER_VERSION, 0).intValue();
+ if (version < 2) IsPre_2 = true;
+ String initFunctionName = IsPre_2 ? "XRE_InitEmbedding" : "XRE_InitEmbedding2";
+ byte[] bytes = MozillaDelegate.wcsToMbcs (null, initFunctionName, true); //$NON-NLS-1$
functionLoad.functionName = C.malloc (bytes.length);
C.memmove (functionLoad.functionName, bytes, bytes.length);
functionLoad.function = C.malloc (C.PTR_SIZEOF);
@@ -1951,7 +2031,11 @@ void initXPCOM (String mozillaPath, boolean isXULRunner) {
browser.dispose ();
error (XPCOM.NS_ERROR_NULL_POINTER);
}
- rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress (), 0, 0);
+ if (IsPre_2) {
+ rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress (), 0, 0);
+ } else {
+ rc = XPCOM.Call (functionPtr, localFile.getAddress (), localFile.getAddress (), LocationProvider.getAddress ());
+ }
if (rc == XPCOM.NS_OK) {
System.setProperty (XULRUNNER_PATH, mozillaPath);
}
@@ -2549,7 +2633,7 @@ public boolean isForwardEnabled () {
}
static String error (int code) {
- throw new SWTError ("XPCOM error " + code); //$NON-NLS-1$
+ throw new SWTError ("XPCOM error " + Integer.toHexString(code)); //$NON-NLS-1$
}
void onDispose (Display display) {
@@ -3104,6 +3188,53 @@ public void stop () {
void hookDOMListeners (nsIDOMEventTarget target, boolean isTop) {
nsEmbedString string = new nsEmbedString (XPCOM.DOMEVENT_FOCUS);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_UNLOAD);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDOWN);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEUP);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEMOVE);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEWHEEL);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEDRAG);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+
+ /*
+ * Only hook mouseover and mouseout if the target is a top-level frame, so that mouse moves
+ * between frames will not generate events.
+ */
+ if (isTop && delegate.hookEnterExit ()) {
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOVER);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_MOUSEOUT);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ }
+
+ string = new nsEmbedString (XPCOM.DOMEVENT_KEYDOWN);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_KEYPRESS);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+ string = new nsEmbedString (XPCOM.DOMEVENT_KEYUP);
+ target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0, 1, 0);
+ string.dispose ();
+}
+
+void hookDOMListeners_1_9 (nsIDOMEventTarget_1_9 target, boolean isTop) {
+ nsEmbedString string = new nsEmbedString (XPCOM.DOMEVENT_FOCUS);
target.AddEventListener (string.getAddress (), domEventListener.getAddress (), 0);
string.dispose ();
string = new nsEmbedString (XPCOM.DOMEVENT_UNLOAD);
@@ -3154,19 +3285,27 @@ void unhookDOMListeners () {
int rc = webBrowser.GetContentDOMWindow (result);
if (rc != XPCOM.NS_OK || result[0] == 0) return;
- nsIDOMWindow window = new nsIDOMWindow (result[0]);
- result[0] = 0;
- rc = window.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ nsIDOMWindow_1_9 window_1_9 = null;
+ nsIDOMWindow window = null;
+ if (!IsPre_2) {
+ window = new nsIDOMWindow (result[0]);
+ result[0] = 0;
+ rc = window.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ } else {
+ window_1_9 = new nsIDOMWindow_1_9 (result[0]);
+ result[0] = 0;
+ rc = window_1_9.QueryInterface (nsIDOMEventTarget_1_9.NS_IDOMEVENTTARGET_IID, result);
+ }
+
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
-
nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
result[0] = 0;
unhookDOMListeners (target);
target.Release ();
/* Listeners must be unhooked in pages contained in frames */
- rc = window.GetFrames (result);
+ rc = !IsPre_2 ? window.GetFrames (result) : window_1_9.GetFrames(result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
nsIDOMWindowCollection frames = new nsIDOMWindowCollection (result[0]);
@@ -3184,7 +3323,7 @@ void unhookDOMListeners () {
nsIDOMWindow frame = new nsIDOMWindow (result[0]);
result[0] = 0;
- rc = frame.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ rc = frame.QueryInterface (!IsPre_2 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget_1_9.NS_IDOMEVENTTARGET_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
@@ -3196,7 +3335,8 @@ void unhookDOMListeners () {
}
}
frames.Release ();
- window.Release ();
+ if (!IsPre_2) window.Release ();
+ else window_1_9.Release();
}
void unhookDOMListeners (nsIDOMEventTarget target) {
@@ -3333,7 +3473,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_IID)) {
+ if (guid.Equals (nsIDOMWindow.NS_IDOMWINDOW_IID) || guid.Equals(nsIDOMWindow_1_9.NS_IDOMWINDOW_IID)) {
int /*long*/[] aContentDOMWindow = new int /*long*/[1];
int rc = webBrowser.GetContentDOMWindow (aContentDOMWindow);
if (rc != XPCOM.NS_OK) error (rc);
@@ -3474,32 +3614,48 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
* received for every window in a page, which is when these listeners
* are typically added.
*/
- int /*long*/[] result = new int /*long*/[1];
- nsIWebProgress progress = new nsIWebProgress (aWebProgress);
- int rc = progress.GetDOMWindow (result);
- if (rc != XPCOM.NS_OK) error (rc);
- if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
- nsIDOMWindow domWindow = new nsIDOMWindow (result[0]);
+ int /*long*/[] result = new int /*long*/[1];
+ int rc;
LONG ptrObject = new LONG (result[0]);
result[0] = 0;
int index = unhookedDOMWindows.indexOf (ptrObject);
if (index != -1) {
+ int /*long*/[] window = new int /*long*/[1];
+ nsIWebProgress progress = new nsIWebProgress (aWebProgress);
+ rc = progress.GetDOMWindow (window);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (window[0] == 0) error (XPCOM.NS_NOINTERFACE);
+
rc = webBrowser.GetContentDOMWindow (result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- boolean isTop = result[0] == domWindow.getAddress ();
+ boolean isTop = result[0] == window[0];
new nsISupports (result[0]).Release ();
result[0] = 0;
- rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ if (!IsPre_2) {
+ nsIDOMWindow domWindow = new nsIDOMWindow (window[0]);
+ rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ domWindow.Release();
+ } else {
+ nsIDOMWindow_1_9 domWindow = new nsIDOMWindow_1_9 (window[0]);
+ rc = domWindow.QueryInterface (nsIDOMEventTarget_1_9.NS_IDOMEVENTTARGET_IID, result);
+ 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]);
+ if (!IsPre_2) {
+ nsIDOMEventTarget_1_9 target = new nsIDOMEventTarget_1_9 (result[0]);
+ hookDOMListeners_1_9 (target, isTop);
+ target.Release ();
+ } else {
+ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+ hookDOMListeners (target, isTop);
+ target.Release ();
+ }
result[0] = 0;
- hookDOMListeners (target, isTop);
- target.Release ();
/*
* Remove and unreference the nsIDOMWindow from the collection of windows
@@ -3623,14 +3779,28 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
*/
deferCompleted = true;
+ int /*long*/[] window = new int /*long*/[1];
+ nsIWebProgress progress = new nsIWebProgress (aWebProgress);
+ rc = progress.GetDOMWindow (window);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (window[0] == 0) error (XPCOM.NS_NOINTERFACE);
+
rc = webBrowser.GetContentDOMWindow (result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- boolean isTop = result[0] == domWindow.getAddress ();
+ boolean isTop = result[0] == window[0];
new nsISupports (result[0]).Release ();
result[0] = 0;
- rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ if (!IsPre_2) {
+ nsIDOMWindow domWindow = new nsIDOMWindow (window[0]);
+ rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ domWindow.Release();
+ } else {
+ nsIDOMWindow_1_9 domWindow = new nsIDOMWindow_1_9 (window[0]);
+ rc = domWindow.QueryInterface (nsIDOMEventTarget_1_9.NS_IDOMEVENTTARGET_IID, result);
+ 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]);
@@ -3641,7 +3811,6 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
registerFunctionsOnState = 0;
}
}
- domWindow.Release ();
/*
* Feature in Mozilla. When a request is redirected (STATE_REDIRECTING),
@@ -3732,7 +3901,7 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF
new nsISupports (result[0]).Release ();
result[0] = 0;
- rc = domWindow.QueryInterface (nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID, result);
+ rc = domWindow.QueryInterface (!IsPre_2 ? nsIDOMEventTarget.NS_IDOMEVENTTARGET_IID : nsIDOMEventTarget_1_9.NS_IDOMEVENTTARGET_IID, result);
if (rc != XPCOM.NS_OK) error (rc);
if (result[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
@@ -3786,15 +3955,22 @@ int OnLocationChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int /*lo
if (rc != XPCOM.NS_OK) error (rc);
if (aDOMWindow[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- nsIDOMWindow domWindow = new nsIDOMWindow (aDOMWindow[0]);
int /*long*/[] aTop = new int /*long*/[1];
- rc = domWindow.GetTop (aTop);
- if (rc != XPCOM.NS_OK) error (rc);
- if (aTop[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
- domWindow.Release ();
-
- nsIDOMWindow topWindow = new nsIDOMWindow (aTop[0]);
- topWindow.Release ();
+ if (!IsPre_2) {
+ nsIDOMWindow domWindow = new nsIDOMWindow (aDOMWindow[0]);
+ rc = domWindow.GetTop (aTop);
+ domWindow.Release ();
+ nsIDOMWindow topWindow = new nsIDOMWindow (aTop[0]);
+ topWindow.Release ();
+ } else {
+ nsIDOMWindow_1_9 domWindow = new nsIDOMWindow_1_9 (aDOMWindow[0]);
+ rc = domWindow.GetTop (aTop);
+ domWindow.Release ();
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (aTop[0] == 0) error (XPCOM.NS_ERROR_NO_INTERFACE);
+ nsIDOMWindow_1_9 topWindow = new nsIDOMWindow_1_9 (aTop[0]);
+ topWindow.Release ();
+ }
nsIURI location = new nsIURI (aLocation);
int /*long*/ aSpec = XPCOM.nsEmbedCString_new ();
@@ -4387,10 +4563,8 @@ int OnHideTooltip () {
}
/* nsIDOMEventListener */
-
-int HandleEvent (int /*long*/ event) {
+int HandleEvent_2 (int /*long*/ event) {
nsIDOMEvent domEvent = new nsIDOMEvent (event);
-
int /*long*/ type = XPCOM.nsEmbedString_new ();
int rc = domEvent.GetType (type);
if (rc != XPCOM.NS_OK) error (rc);
@@ -4756,6 +4930,381 @@ int HandleEvent (int /*long*/ event) {
return XPCOM.NS_OK;
}
+int HandleEvent_1_9 (int /*long*/ event) {
+ nsIDOMEvent_1_9 domEvent = new nsIDOMEvent_1_9 (event);
+ int /*long*/ type = XPCOM.nsEmbedString_new ();
+ int rc = domEvent.GetType (type);
+ if (rc != XPCOM.NS_OK) error (rc);
+ int length = XPCOM.nsEmbedString_Length (type);
+ int /*long*/ buffer = XPCOM.nsEmbedString_get (type);
+ char[] chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ String typeString = new String (chars);
+ XPCOM.nsEmbedString_delete (type);
+
+ if (XPCOM.DOMEVENT_UNLOAD.equals (typeString)) {
+ int /*long*/[] result = new int /*long*/[1];
+ rc = domEvent.GetCurrentTarget (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+
+ nsIDOMEventTarget target = new nsIDOMEventTarget (result[0]);
+ unhookDOMListeners (target);
+ target.Release ();
+ return XPCOM.NS_OK;
+ }
+
+ if (XPCOM.DOMEVENT_FOCUS.equals (typeString)) {
+ delegate.handleFocus ();
+ return XPCOM.NS_OK;
+ }
+
+ if (XPCOM.DOMEVENT_KEYDOWN.equals (typeString)) {
+ int /*long*/[] result = new int /*long*/[1];
+ rc = domEvent.QueryInterface (nsIDOMKeyEvent_1_9.NS_IDOMKEYEVENT_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ nsIDOMKeyEvent_1_9 domKeyEvent = new nsIDOMKeyEvent_1_9 (result[0]);
+ result[0] = 0;
+
+ int[] aKeyCode = new int[1]; /* PRUint32 */
+ rc = domKeyEvent.GetKeyCode (aKeyCode);
+ if (rc != XPCOM.NS_OK) error (rc);
+ int keyCode = translateKey (aKeyCode[0]);
+
+ /*
+ * if keyCode == lastKeyCode then either a repeating key like Shift
+ * is being held or a key for which key events are not sent has been
+ * pressed. In both of these cases a KeyDown should not be sent.
+ */
+ if (keyCode != lastKeyCode) {
+ lastKeyCode = keyCode;
+ switch (keyCode) {
+ case SWT.SHIFT:
+ case SWT.CONTROL:
+ case SWT.ALT:
+ case SWT.CAPS_LOCK:
+ case SWT.NUM_LOCK:
+ case SWT.SCROLL_LOCK:
+ case SWT.COMMAND: {
+ /* keypress events will not be received for these keys, so send KeyDowns for them now */
+ int[] aAltKey = new int[1], aCtrlKey = new int[1], aShiftKey = new int[1], aMetaKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetAltKey (aAltKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetCtrlKey (aCtrlKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetShiftKey (aShiftKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetMetaKey (aMetaKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+
+ Event keyEvent = new Event ();
+ keyEvent.widget = browser;
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.keyCode = keyCode;
+ keyEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0 ? SWT.CTRL : 0) | (aShiftKey[0] != 0 ? SWT.SHIFT : 0) | (aMetaKey[0] != 0 ? SWT.COMMAND : 0);
+ keyEvent.stateMask &= ~keyCode; /* remove current keydown if it's a state key */
+ browser.notifyListeners (keyEvent.type, keyEvent);
+ if (!keyEvent.doit || browser.isDisposed ()) {
+ domEvent.PreventDefault ();
+ }
+ break;
+ }
+ default: {
+ /*
+ * If the keydown has Meta (but not Meta+Ctrl) as a modifier then send a KeyDown event for it here
+ * because a corresponding keypress event will not be received for it from the DOM. If the keydown
+ * does not have Meta as a modifier, or has Meta+Ctrl as a modifier, then then do nothing here
+ * because its KeyDown event will be sent from the keypress listener.
+ */
+ int[] aMetaKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetMetaKey (aMetaKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (aMetaKey[0] != 0) {
+ int[] aCtrlKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetCtrlKey (aCtrlKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (aCtrlKey[0] == 0) {
+ int[] aAltKey = new int[1], aShiftKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetAltKey (aAltKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetShiftKey (aShiftKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+
+ Event keyEvent = new Event ();
+ keyEvent.widget = browser;
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.keyCode = lastKeyCode;
+ keyEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0? SWT.CTRL : 0) | (aShiftKey[0] != 0? SWT.SHIFT : 0) | (aMetaKey[0] != 0? SWT.COMMAND : 0);
+ browser.notifyListeners (keyEvent.type, keyEvent);
+ if (!keyEvent.doit || browser.isDisposed ()) {
+ domEvent.PreventDefault ();
+ }
+ }
+ }
+ }
+ }
+ }
+
+ domKeyEvent.Release ();
+ return XPCOM.NS_OK;
+ }
+
+ if (XPCOM.DOMEVENT_KEYPRESS.equals (typeString)) {
+ /*
+ * if keydown could not determine a keycode for this key then it's a
+ * key for which key events are not sent (eg.- the Windows key)
+ */
+ if (lastKeyCode == 0) return XPCOM.NS_OK;
+
+ /*
+ * On linux only, unexpected keypress events are received for some
+ * modifier keys. The workaround is to ignore these events since
+ * KeyDown events are sent for these keys in the keydown listener.
+ */
+ switch (lastKeyCode) {
+ case SWT.CAPS_LOCK:
+ case SWT.NUM_LOCK:
+ case SWT.SCROLL_LOCK: return XPCOM.NS_OK;
+ }
+
+ int /*long*/[] result = new int /*long*/[1];
+ rc = domEvent.QueryInterface (nsIDOMKeyEvent_1_9.NS_IDOMKEYEVENT_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ nsIDOMKeyEvent_1_9 domKeyEvent = new nsIDOMKeyEvent_1_9 (result[0]);
+ result[0] = 0;
+
+ int[] aAltKey = new int[1], aCtrlKey = new int[1], aShiftKey = new int[1], aMetaKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetAltKey (aAltKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetCtrlKey (aCtrlKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetShiftKey (aShiftKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetMetaKey (aMetaKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ domKeyEvent.Release ();
+
+ int[] aCharCode = new int[1]; /* PRUint32 */
+ rc = domKeyEvent.GetCharCode (aCharCode);
+ if (rc != XPCOM.NS_OK) error (rc);
+ lastCharCode = aCharCode[0];
+ if (lastCharCode == 0) {
+ switch (lastKeyCode) {
+ case SWT.TAB: lastCharCode = SWT.TAB; break;
+ case SWT.CR: lastCharCode = SWT.CR; break;
+ case SWT.BS: lastCharCode = SWT.BS; break;
+ case SWT.ESC: lastCharCode = SWT.ESC; break;
+ case SWT.DEL: lastCharCode = SWT.DEL; break;
+ }
+ }
+ if (aCtrlKey[0] != 0 && (0 <= lastCharCode && lastCharCode <= 0x7F)) {
+ if ('a' <= lastCharCode && lastCharCode <= 'z') lastCharCode -= 'a' - 'A';
+ if (64 <= lastCharCode && lastCharCode <= 95) lastCharCode -= 64;
+ }
+
+ Event keyEvent = new Event ();
+ keyEvent.widget = browser;
+ keyEvent.type = SWT.KeyDown;
+ keyEvent.keyCode = lastKeyCode;
+ keyEvent.character = (char)lastCharCode;
+ keyEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0 ? SWT.CTRL : 0) | (aShiftKey[0] != 0 ? SWT.SHIFT : 0) | (aMetaKey[0] != 0 ? SWT.COMMAND : 0);
+ boolean doit = true;
+ if (delegate.sendTraverse ()) {
+ doit = sendKeyEvent (keyEvent);
+ } else {
+ browser.notifyListeners (keyEvent.type, keyEvent);
+ doit = keyEvent.doit;
+ }
+ if (!doit || browser.isDisposed ()) {
+ domEvent.PreventDefault ();
+ }
+ return XPCOM.NS_OK;
+ }
+
+ if (XPCOM.DOMEVENT_KEYUP.equals (typeString)) {
+ int /*long*/[] result = new int /*long*/[1];
+ rc = domEvent.QueryInterface (nsIDOMKeyEvent_1_9.NS_IDOMKEYEVENT_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ nsIDOMKeyEvent_1_9 domKeyEvent = new nsIDOMKeyEvent_1_9 (result[0]);
+ result[0] = 0;
+
+ int[] aKeyCode = new int[1]; /* PRUint32 */
+ rc = domKeyEvent.GetKeyCode (aKeyCode);
+ if (rc != XPCOM.NS_OK) error (rc);
+ int keyCode = translateKey (aKeyCode[0]);
+ if (keyCode == 0) {
+ /* indicates a key for which key events are not sent */
+ domKeyEvent.Release ();
+ return XPCOM.NS_OK;
+ }
+ if (keyCode != lastKeyCode) {
+ /* keyup does not correspond to the last keydown */
+ lastKeyCode = keyCode;
+ lastCharCode = 0;
+ }
+
+ int[] aAltKey = new int[1], aCtrlKey = new int[1], aShiftKey = new int[1], aMetaKey = new int[1]; /* PRBool */
+ rc = domKeyEvent.GetAltKey (aAltKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetCtrlKey (aCtrlKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetShiftKey (aShiftKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domKeyEvent.GetMetaKey (aMetaKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ domKeyEvent.Release ();
+
+ Event keyEvent = new Event ();
+ keyEvent.widget = browser;
+ keyEvent.type = SWT.KeyUp;
+ keyEvent.keyCode = lastKeyCode;
+ keyEvent.character = (char)lastCharCode;
+ keyEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0 ? SWT.CTRL : 0) | (aShiftKey[0] != 0 ? SWT.SHIFT : 0) | (aMetaKey[0] != 0 ? SWT.COMMAND : 0);
+ switch (lastKeyCode) {
+ case SWT.SHIFT:
+ case SWT.CONTROL:
+ case SWT.ALT:
+ case SWT.COMMAND: {
+ keyEvent.stateMask |= lastKeyCode;
+ }
+ }
+ browser.notifyListeners (keyEvent.type, keyEvent);
+ if (!keyEvent.doit || browser.isDisposed ()) {
+ domEvent.PreventDefault ();
+ }
+ lastKeyCode = lastCharCode = 0;
+ return XPCOM.NS_OK;
+ }
+
+ /* mouse event */
+
+ int /*long*/[] result = new int /*long*/[1];
+ rc = domEvent.QueryInterface (nsIDOMMouseEvent_1_9.NS_IDOMMOUSEEVENT_IID, result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] == 0) error (XPCOM.NS_NOINTERFACE);
+ nsIDOMMouseEvent_1_9 domMouseEvent = new nsIDOMMouseEvent_1_9 (result[0]);
+ result[0] = 0;
+
+ /*
+ * MouseOver and MouseOut events are fired any time the mouse enters or exits
+ * any element within the Browser. To ensure that SWT events are only
+ * fired for mouse movements into or out of the Browser, do not fire an
+ * event if the element being exited (on MouseOver) or entered (on MouseExit)
+ * is within the Browser.
+ */
+ if (XPCOM.DOMEVENT_MOUSEOVER.equals (typeString) || XPCOM.DOMEVENT_MOUSEOUT.equals (typeString)) {
+ rc = domMouseEvent.GetRelatedTarget (result);
+ if (rc != XPCOM.NS_OK) error (rc);
+ if (result[0] != 0) {
+ new nsISupports (result[0]).Release ();
+ domMouseEvent.Release ();
+ return XPCOM.NS_OK;
+ }
+ }
+
+ int[] aScreenX = new int[1], aScreenY = new int[1]; /* PRInt32 */
+
+ /*
+ * The position of mouse events is received in screen-relative coordinates
+ * in order to handle pages with frames, since frames express their event
+ * coordinates relative to themselves rather than relative to their top-
+ * level page. Convert screen-relative coordinates to be browser-relative.
+ */
+ rc = domMouseEvent.GetScreenX (aScreenX);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetScreenY (aScreenY);
+ if (rc != XPCOM.NS_OK) error (rc);
+ Point position = new Point (aScreenX[0], aScreenY[0]);
+ position = browser.getDisplay ().map (null, browser, position);
+
+ int[] aDetail = new int[1]; /* PRInt32 */
+ rc = domMouseEvent.GetDetail (aDetail);
+ if (rc != XPCOM.NS_OK) error (rc);
+ short[] aButton = new short[1]; /* PRUint16 */
+ rc = domMouseEvent.GetButton (aButton);
+ if (rc != XPCOM.NS_OK) error (rc);
+ int[] aAltKey = new int[1], aCtrlKey = new int[1], aShiftKey = new int[1], aMetaKey = new int[1]; /* PRBool */
+ rc = domMouseEvent.GetAltKey (aAltKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetCtrlKey (aCtrlKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetShiftKey (aShiftKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ rc = domMouseEvent.GetMetaKey (aMetaKey);
+ if (rc != XPCOM.NS_OK) error (rc);
+ domMouseEvent.Release ();
+
+ Event mouseEvent = new Event ();
+ mouseEvent.widget = browser;
+ mouseEvent.x = position.x; mouseEvent.y = position.y;
+ mouseEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0 ? SWT.CTRL : 0) | (aShiftKey[0] != 0 ? SWT.SHIFT : 0) | (aMetaKey[0] != 0 ? SWT.COMMAND : 0);
+
+ if (XPCOM.DOMEVENT_MOUSEDOWN.equals (typeString)) {
+ delegate.handleMouseDown ();
+ mouseEvent.type = SWT.MouseDown;
+ mouseEvent.button = aButton[0] + 1;
+ mouseEvent.count = aDetail[0];
+ } else if (XPCOM.DOMEVENT_MOUSEUP.equals (typeString)) {
+ /*
+ * Bug on OSX. For some reason multiple mouseup events come from the DOM
+ * when button 3 is released on OSX. The first of these events has a count
+ * detail and the others do not. The workaround is to not fire received
+ * button 3 mouseup events that do not have a count since mouse events
+ * without a click count are not valid.
+ */
+ int button = aButton[0] + 1;
+ int count = aDetail[0];
+ if (count == 0 && button == 3) return XPCOM.NS_OK;
+ mouseEvent.type = SWT.MouseUp;
+ mouseEvent.button = button;
+ mouseEvent.count = count;
+ } else if (XPCOM.DOMEVENT_MOUSEMOVE.equals (typeString)) {
+ mouseEvent.type = SWT.MouseMove;
+ } else if (XPCOM.DOMEVENT_MOUSEWHEEL.equals (typeString)) {
+ mouseEvent.type = SWT.MouseWheel;
+ mouseEvent.count = -aDetail[0];
+ } else if (XPCOM.DOMEVENT_MOUSEOVER.equals (typeString)) {
+ mouseEvent.type = SWT.MouseEnter;
+ } else if (XPCOM.DOMEVENT_MOUSEOUT.equals (typeString)) {
+ mouseEvent.type = SWT.MouseExit;
+ } else if (XPCOM.DOMEVENT_MOUSEDRAG.equals (typeString)) {
+ mouseEvent.type = SWT.DragDetect;
+ mouseEvent.button = aButton[0] + 1;
+ switch (mouseEvent.button) {
+ case 1: mouseEvent.stateMask |= SWT.BUTTON1; break;
+ case 2: mouseEvent.stateMask |= SWT.BUTTON2; break;
+ case 3: mouseEvent.stateMask |= SWT.BUTTON3; break;
+ case 4: mouseEvent.stateMask |= SWT.BUTTON4; break;
+ case 5: mouseEvent.stateMask |= SWT.BUTTON5; break;
+ }
+ }
+
+ browser.notifyListeners (mouseEvent.type, mouseEvent);
+ if (browser.isDisposed ()) return XPCOM.NS_OK;
+ if (aDetail[0] == 2 && XPCOM.DOMEVENT_MOUSEDOWN.equals (typeString)) {
+ mouseEvent = new Event ();
+ mouseEvent.widget = browser;
+ mouseEvent.x = position.x; mouseEvent.y = position.y;
+ mouseEvent.stateMask = (aAltKey[0] != 0 ? SWT.ALT : 0) | (aCtrlKey[0] != 0 ? SWT.CTRL : 0) | (aShiftKey[0] != 0 ? SWT.SHIFT : 0) | (aMetaKey[0] != 0 ? SWT.COMMAND : 0);
+ mouseEvent.type = SWT.MouseDoubleClick;
+ mouseEvent.button = aButton[0] + 1;
+ mouseEvent.count = aDetail[0];
+ browser.notifyListeners (mouseEvent.type, mouseEvent);
+ }
+ return XPCOM.NS_OK;
+}
+
+int HandleEvent (int /*long*/ event) {
+ if (!IsPre_2) {
+ return HandleEvent_2(event);
+ } else {
+ return HandleEvent_1_9(event);
+ }
+}
+
/* nsIBadCertListener2 */
int NotifyCertProblem (int /*long*/ socketInfo, int /*long*/ status, int /*long*/ targetSite, int /*long*/ _suppressError) {
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
new file mode 100644
index 0000000000..a0397e7c19
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptAuth2.java
@@ -0,0 +1,238 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2010 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.mozilla.*;
+import org.eclipse.swt.widgets.*;
+
+class PromptAuth2 {
+ XPCOMObject supports;
+ XPCOMObject promptAuth;
+ int refCount = 0;
+
+PromptAuth2 () {
+ createCOMInterfaces ();
+}
+
+int AddRef () {
+ refCount++;
+ return refCount;
+}
+
+void createCOMInterfaces () {
+ /* Create each of the interfaces that this object implements */
+ supports = new XPCOMObject (new int[] {2, 0, 0}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ };
+
+ promptAuth = new XPCOMObject (new int[] {2, 0, 0, 4, 6}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ public int /*long*/ method3 (int /*long*/[] args) {return PromptAuth (args[0], args[1], (int)/*64*/args[2], args[3]);}
+ public int /*long*/ method4 (int /*long*/[] args) {return AsyncPromptAuth (args[0], args[1], args[2], args[3], (int)/*64*/args[4], args[5]);}
+ };
+}
+
+void disposeCOMInterfaces () {
+ if (supports != null) {
+ supports.dispose ();
+ supports = null;
+ }
+ if (promptAuth != null) {
+ promptAuth.dispose ();
+ promptAuth = null;
+ }
+}
+
+int /*long*/ getAddress () {
+ return promptAuth.getAddress ();
+}
+
+int QueryInterface (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 (nsISupports.NS_ISUPPORTS_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {supports.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+ if (guid.Equals (nsIAuthPrompt2.NS_IAUTHPROMPT2_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {promptAuth.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+
+ XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF);
+ return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+int Release () {
+ refCount--;
+ if (refCount == 0) disposeCOMInterfaces ();
+ return refCount;
+}
+
+Browser getBrowser() {
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_GetComponentManager (result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIComponentManager componentManager = new nsIComponentManager (result[0]);
+ result[0] = 0;
+ componentManager.GetClassObject(XPCOM.NS_IWEBBROWSER_CID, nsIWebBrowser.NS_IWEBBROWSER_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIWebBrowser browser = new nsIWebBrowser(result[0]);
+ result[0] = 0;
+ rc = browser.GetContentDOMWindow(result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ return Mozilla.getBrowser(result[0]);
+ }
+ }
+ }
+ return null;
+}
+
+
+int PromptAuth(int /*long*/ aChannel, int level, int /*long*/ authInfo, int /*long*/ _retval) {
+ nsIAuthInformation auth = new nsIAuthInformation (authInfo);
+
+ Browser browser = getBrowser ();
+ if (browser != null) {
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ /*
+ * Do not invoke the listeners if this challenge has been failed too many
+ * times because a listener is likely giving incorrect credentials repeatedly
+ * and will do so indefinitely.
+ */
+ if (mozilla.authCount++ < 3) {
+ for (int i = 0; i < mozilla.authenticationListeners.length; i++) {
+ AuthenticationEvent event = new AuthenticationEvent (browser);
+ event.location = mozilla.lastNavigateURL;
+ mozilla.authenticationListeners[i].authenticate (event);
+ if (!event.doit) {
+ XPCOM.memmove (_retval, new int[] {0}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+ if (event.user != null && event.password != null) {
+ nsEmbedString string = new nsEmbedString (event.user);
+ int rc = auth.SetUsername (string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ string = new nsEmbedString (event.password);
+ rc = auth.SetPassword (string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ XPCOM.memmove (_retval, new int[] {1}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+ }
+ }
+ }
+
+ /* no listener handled the challenge, so show an authentication dialog */
+
+ String checkLabel = null;
+ int[] checkValue = new int[1];
+ String[] userLabel = new String[1], passLabel = new String[1];
+
+ String title = SWT.getMessage ("SWT_Authentication_Required"); //$NON-NLS-1$
+
+ /* get initial username and password values */
+
+ int /*long*/ ptr = XPCOM.nsEmbedString_new ();
+ int rc = auth.GetUsername (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ int length = XPCOM.nsEmbedString_Length (ptr);
+ int /*long*/ buffer = XPCOM.nsEmbedString_get (ptr);
+ char[] chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ userLabel[0] = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ ptr = XPCOM.nsEmbedString_new ();
+ rc = auth.GetPassword (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedString_Length (ptr);
+ buffer = XPCOM.nsEmbedString_get (ptr);
+ chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ passLabel[0] = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ /* compute the message text */
+
+ ptr = XPCOM.nsEmbedString_new ();
+ rc = auth.GetRealm (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedString_Length (ptr);
+ buffer = XPCOM.nsEmbedString_get (ptr);
+ chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ String realm = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ nsIChannel channel = new nsIChannel (aChannel);
+ int /*long*/[] uri = new int /*long*/[1];
+ rc = channel.GetURI (uri);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (uri[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE);
+
+ nsIURI nsURI = new nsIURI (uri[0]);
+ int /*long*/ host = XPCOM.nsEmbedCString_new ();
+ rc = nsURI.GetHost (host);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedCString_Length (host);
+ buffer = XPCOM.nsEmbedCString_get (host);
+ byte[] bytes = new byte[length];
+ XPCOM.memmove (bytes, buffer, length);
+ String hostString = new String (bytes);
+ XPCOM.nsEmbedCString_delete (host);
+ nsURI.Release ();
+
+ String message;
+ if (realm.length () > 0 && hostString.length () > 0) {
+ message = Compatibility.getMessage ("SWT_Enter_Username_and_Password", new String[] {realm, hostString}); //$NON-NLS-1$
+ } else {
+ message = ""; //$NON-NLS-1$
+ }
+
+ /* open the prompter */
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] result = new int[1];
+ dialog.promptUsernameAndPassword (title, message, checkLabel, userLabel, passLabel, checkValue, result);
+
+ XPCOM.memmove (_retval, result, 4); /* PRBool */
+ if (result[0] == 1) { /* User selected OK */
+ nsEmbedString string = new nsEmbedString (userLabel[0]);
+ rc = auth.SetUsername(string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+
+ string = new nsEmbedString (passLabel[0]);
+ rc = auth.SetPassword(string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ }
+
+ return XPCOM.NS_OK;
+}
+
+int AsyncPromptAuth(int /*long*/ aChannel, int /*long*/ aCallback, int /*long*/ aContext, int level, int /*long*/ authInfo, int /*long*/ _retval) {
+ return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+}
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 02e0946b2e..b0c515b513 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,19 @@ 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]);
+
+ if (Mozilla.IsPre_2) {
+ nsIDOMWindow_1_9 window = new nsIDOMWindow_1_9(result[0]);
+ rc = dialogs.ViewCert(window.getAddress(), cert.getAddress());
+ browser.getDisplay().timerExec(-1, runnable);
+ window.Release();
+ } else {
+ nsIDOMWindow window = new nsIDOMWindow(result[0]);
+ rc = dialogs.ViewCert(window.getAddress(), cert.getAddress());
+ browser.getDisplay().timerExec(-1, runnable);
+ window.Release();
+ }
result[0] = 0;
-
- rc = dialogs.ViewCert(window.getAddress(), cert.getAddress());
- browser.getDisplay().timerExec(-1, runnable);
- window.Release();
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
new file mode 100644
index 0000000000..ea4339d408
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptFactory.java
@@ -0,0 +1,115 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2008 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.internal.C;
+import org.eclipse.swt.internal.mozilla.*;
+
+class PromptFactory {
+ XPCOMObject supports;
+ XPCOMObject factory;
+ int refCount = 0;
+
+PromptFactory () {
+ createCOMInterfaces ();
+}
+
+int AddRef () {
+ refCount++;
+ return refCount;
+}
+
+void createCOMInterfaces () {
+ /* Create each of the interfaces that this object implements */
+ supports = new XPCOMObject (new int[] {2, 0, 0}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ };
+
+ factory = new XPCOMObject (new int[] {2, 0, 0, 3, 1}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ public int /*long*/ method3 (int /*long*/[] args) {return GetPrompt (args[0], args[1], args[2]);}
+ };
+}
+
+void disposeCOMInterfaces () {
+ if (supports != null) {
+ supports.dispose ();
+ supports = null;
+ }
+ if (factory != null) {
+ factory.dispose ();
+ factory = null;
+ }
+}
+
+int /*long*/ getAddress () {
+ return factory.getAddress ();
+}
+
+int QueryInterface (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 (nsISupports.NS_ISUPPORTS_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {supports.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+ if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {factory.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+
+ XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF);
+ return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+int Release () {
+ refCount--;
+ if (refCount == 0) disposeCOMInterfaces ();
+ return refCount;
+}
+
+/* nsIPromptFactory */
+
+int GetPrompt (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result) {
+ nsID guid = new nsID ();
+ XPCOM.memmove (guid, iid, nsID.sizeof);
+
+ if (guid.Equals (nsIPrompt.NS_IPROMPT_IID)) {
+ Prompter prompter = new Prompter ();
+ prompter.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {prompter.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+ if (guid.Equals (nsIAuthPrompt2.NS_IAUTHPROMPT2_IID)) {
+ PromptAuth2 promptAuth = new PromptAuth2();
+ promptAuth.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {promptAuth.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+
+ return XPCOM.NS_NOINTERFACE;
+}
+
+int LockFactory (int lock) {
+ return XPCOM.NS_OK;
+}
+
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
index c641a2409b..4de7cae2c6 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2.java
@@ -123,8 +123,7 @@ int Release () {
Browser getBrowser (int /*long*/ aDOMWindow) {
if (aDOMWindow == 0) return null;
- nsIDOMWindow window = new nsIDOMWindow (aDOMWindow);
- return Mozilla.findBrowser (window);
+ return Mozilla.getBrowser (aDOMWindow);
}
String getLabel (int buttonFlag, int index, int /*long*/ buttonTitle) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java
index 89fdc66a75..fe7051877a 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/PromptService2Factory.java
@@ -88,9 +88,19 @@ int Release () {
/* nsIFactory */
int CreateInstance (int /*long*/ aOuter, int /*long*/ iid, int /*long*/ result) {
- PromptService2 promptService = new PromptService2 ();
- promptService.AddRef ();
- XPCOM.memmove (result, new int /*long*/[] {promptService.getAddress ()}, C.PTR_SIZEOF);
+ nsID guid = new nsID ();
+ XPCOM.memmove (guid, iid, nsID.sizeof);
+ if (guid.Equals (nsIPromptService2.NS_IPROMPTSERVICE2_IID)) {
+ PromptService2 promptService = new PromptService2 ();
+ promptService.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {promptService.getAddress ()}, C.PTR_SIZEOF);
+ } else if (guid.Equals (nsIPromptFactory.NS_IPROMPTFACTORY_IID)) {
+ PromptFactory promptFactory = new PromptFactory();
+ promptFactory.AddRef ();
+ XPCOM.memmove (result, new int /*long*/[] {promptFactory.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
return XPCOM.NS_OK;
}
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
new file mode 100644
index 0000000000..2c3b5c9ba9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Prompter.java
@@ -0,0 +1,627 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2010 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.swt.browser;
+
+import org.eclipse.swt.*;
+import org.eclipse.swt.internal.*;
+import org.eclipse.swt.internal.mozilla.*;
+import org.eclipse.swt.widgets.*;
+
+class Prompter {
+ XPCOMObject supports;
+ XPCOMObject prompt;
+ int refCount = 0;
+
+Prompter () {
+ createCOMInterfaces ();
+}
+
+int AddRef () {
+ refCount++;
+ return refCount;
+}
+
+void createCOMInterfaces () {
+ /* Create each of the interfaces that this object implements */
+ supports = new XPCOMObject (new int[] {2, 0, 0}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ };
+
+ prompt = new XPCOMObject (new int[] {2, 0, 0, 2, 4, 3, 5, 9, 6, 6, 7, 6}) {
+ public int /*long*/ method0 (int /*long*/[] args) {return QueryInterface (args[0], args[1]);}
+ public int /*long*/ method1 (int /*long*/[] args) {return AddRef ();}
+ public int /*long*/ method2 (int /*long*/[] args) {return Release ();}
+ public int /*long*/ method3 (int /*long*/[] args) {return Alert (args[0], args[1] );}
+ public int /*long*/ method4 (int /*long*/[] args) {return AlertCheck (args[0], args[1], args[2], args[3]);}
+ public int /*long*/ method5 (int /*long*/[] args) {return Confirm (args[0], args[1], args[2]);}
+ public int /*long*/ method6 (int /*long*/[] args) {return ConfirmCheck (args[0], args[1], args[2], args[3], args[4]);}
+ public int /*long*/ method7 (int /*long*/[] args) {return ConfirmEx (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5], args[6], args[7], args[8]);}
+ public int /*long*/ method8 (int /*long*/[] args) {return Prompt (args[0], args[1], args[2], args[3], args[4], args[5]);}
+ public int /*long*/ method9 (int /*long*/[] args) {return PromptPassword (args[0], args[1], args[2], args[3], args[4], args[5]);}
+ public int /*long*/ method10 (int /*long*/[] args) {return PromptUsernameAndPassword (args[0], args[1], args[2], args[3], args[4], args[5], args[6]);}
+ public int /*long*/ method11 (int /*long*/[] args) {return Select (args[0], args[1], args[2], (int)/*64*/args[3], args[4], args[5]);}
+ };
+}
+
+void disposeCOMInterfaces () {
+ if (supports != null) {
+ supports.dispose ();
+ supports = null;
+ }
+ if (prompt != null) {
+ prompt.dispose ();
+ prompt = null;
+ }
+}
+
+int /*long*/ getAddress () {
+ return prompt.getAddress ();
+}
+
+int QueryInterface (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 (nsISupports.NS_ISUPPORTS_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {supports.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+ if (guid.Equals (nsIPrompt.NS_IPROMPT_IID)) {
+ XPCOM.memmove (ppvObject, new int /*long*/[] {prompt.getAddress ()}, C.PTR_SIZEOF);
+ AddRef ();
+ return XPCOM.NS_OK;
+ }
+ XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF);
+ return XPCOM.NS_ERROR_NO_INTERFACE;
+}
+
+int Release () {
+ refCount--;
+ if (refCount == 0) disposeCOMInterfaces ();
+ return refCount;
+}
+
+String getLabel (int buttonFlag, int index, int /*long*/ buttonTitle) {
+ String label = null;
+ int flag = (buttonFlag & (0xff * index)) / index;
+ switch (flag) {
+ case nsIPrompt.BUTTON_TITLE_CANCEL : label = SWT.getMessage ("SWT_Cancel"); break; //$NON-NLS-1$
+ case nsIPrompt.BUTTON_TITLE_NO : label = SWT.getMessage ("SWT_No"); break; //$NON-NLS-1$
+ case nsIPrompt.BUTTON_TITLE_OK : label = SWT.getMessage ("SWT_OK"); break; //$NON-NLS-1$
+ case nsIPrompt.BUTTON_TITLE_SAVE : label = SWT.getMessage ("SWT_Save"); break; //$NON-NLS-1$
+ case nsIPrompt.BUTTON_TITLE_YES : label = SWT.getMessage ("SWT_Yes"); break; //$NON-NLS-1$
+ case nsIPrompt.BUTTON_TITLE_IS_STRING : {
+ int length = XPCOM.strlen_PRUnichar (buttonTitle);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, buttonTitle, length * 2);
+ label = new String (dest);
+ }
+ }
+ return label;
+}
+
+/* nsIPrompt */
+
+int Alert ( int /*long*/ aDialogTitle, int /*long*/ aText) {
+ final Browser browser = getBrowser ();
+
+ int length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ String titleLabel = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ String textLabel = new String (dest);
+
+ /*
+ * If mozilla is re-navigating to a page with a bad certificate in order
+ * to get its certificate info then do not show cert error message alerts.
+ */
+ if (browser != null) {
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ if (mozilla.isRetrievingBadCert) return XPCOM.NS_OK;
+ }
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.ICON_WARNING);
+ messageBox.setText (titleLabel);
+ messageBox.setMessage (textLabel);
+ messageBox.open ();
+ return XPCOM.NS_OK;
+}
+
+Browser getBrowser() {
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_GetComponentManager (result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIComponentManager componentManager = new nsIComponentManager (result[0]);
+ result[0] = 0;
+ componentManager.GetClassObject(XPCOM.NS_IWEBBROWSER_CID, nsIWebBrowser.NS_IWEBBROWSER_IID, result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ nsIWebBrowser browser = new nsIWebBrowser(result[0]);
+ result[0] = 0;
+ rc = browser.GetContentDOMWindow(result);
+ if (rc == XPCOM.NS_OK && result[0] != 0) {
+ return Mozilla.getBrowser(result[0]);
+ }
+ }
+ }
+ return null;
+}
+
+int AlertCheck (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ aCheckMsg, int /*long*/ aCheckState) {
+ Browser browser = getBrowser ();
+
+ int length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ String titleLabel = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ String textLabel = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aCheckMsg);
+ dest = new char[length];
+ XPCOM.memmove (dest, aCheckMsg, length * 2);
+ String checkLabel = new String (dest);
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] check = new int[1];
+ if (aCheckState != 0) XPCOM.memmove (check, aCheckState, 4); /* PRBool */
+ dialog.alertCheck (titleLabel, textLabel, checkLabel, check);
+ if (aCheckState != 0) XPCOM.memmove (aCheckState, check, 4); /* PRBool */
+ return XPCOM.NS_OK;
+}
+
+int Confirm (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ _retval) {
+ Browser browser = getBrowser ();
+
+ if (browser != null && ((Mozilla)browser.webBrowser).ignoreAllMessages) {
+ XPCOM.memmove (_retval, new int[] {1}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+
+ int length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ String titleLabel = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ String textLabel = new String (dest);
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ MessageBox messageBox = new MessageBox (shell, SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION);
+ messageBox.setText (titleLabel);
+ messageBox.setMessage (textLabel);
+ int id = messageBox.open ();
+ int[] result = {id == SWT.OK ? 1 : 0};
+ XPCOM.memmove (_retval, result, 4); /* PRBool */
+ return XPCOM.NS_OK;
+}
+
+int ConfirmCheck (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ aCheckMsg, int /*long*/ aCheckState, int /*long*/ _retval) {
+ return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+int ConfirmEx (int /*long*/ aDialogTitle, int /*long*/ aText, int aButtonFlags, int /*long*/ aButton0Title, int /*long*/ aButton1Title, int /*long*/ aButton2Title, int /*long*/ aCheckMsg, int /*long*/ aCheckState, int /*long*/ _retval) {
+ Browser browser = getBrowser ();
+
+ int length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ char[] dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ String titleLabel = new String (dest);
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ String textLabel = new String (dest);
+
+ String checkLabel = null;
+ if (aCheckMsg != 0) {
+ length = XPCOM.strlen_PRUnichar (aCheckMsg);
+ dest = new char[length];
+ XPCOM.memmove (dest, aCheckMsg, length * 2);
+ checkLabel = new String (dest);
+ }
+
+ String button0Label = getLabel (aButtonFlags, nsIPrompt.BUTTON_POS_0, aButton0Title);
+ String button1Label = getLabel (aButtonFlags, nsIPrompt.BUTTON_POS_1, aButton1Title);
+ String button2Label = getLabel (aButtonFlags, nsIPrompt.BUTTON_POS_2, aButton2Title);
+
+ int defaultIndex = 0;
+ if ((aButtonFlags & nsIPrompt.BUTTON_POS_1_DEFAULT) != 0) {
+ defaultIndex = 1;
+ } else if ((aButtonFlags & nsIPrompt.BUTTON_POS_2_DEFAULT) != 0) {
+ defaultIndex = 2;
+ }
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] check = new int[1], result = new int[1];
+ if (aCheckState != 0) XPCOM.memmove (check, aCheckState, 4);
+ dialog.confirmEx (titleLabel, textLabel, checkLabel, button0Label, button1Label, button2Label, defaultIndex, check, result);
+ if (aCheckState != 0) XPCOM.memmove (aCheckState, check, 4);
+ XPCOM.memmove (_retval, result, 4);
+ return XPCOM.NS_OK;
+}
+
+int Prompt (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ aValue, int /*long*/ aCheckMsg, int /*long*/ aCheckState, int /*long*/ _retval) {
+ Browser browser = getBrowser ();
+ String titleLabel = null, textLabel, checkLabel = null;
+ String[] valueLabel = new String[1];
+ char[] dest;
+ int length;
+ if (aDialogTitle != 0) {
+ length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ titleLabel = new String (dest);
+ }
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ textLabel = new String (dest);
+
+ int /*long*/[] valueAddr = new int /*long*/[1];
+ XPCOM.memmove (valueAddr, aValue, C.PTR_SIZEOF);
+ if (valueAddr[0] != 0) {
+ length = XPCOM.strlen_PRUnichar (valueAddr[0]);
+ dest = new char[length];
+ XPCOM.memmove (dest, valueAddr[0], length * 2);
+ valueLabel[0] = new String (dest);
+ }
+
+ if (aCheckMsg != 0) {
+ length = XPCOM.strlen_PRUnichar (aCheckMsg);
+ if (length > 0) {
+ dest = new char[length];
+ XPCOM.memmove (dest, aCheckMsg, length * 2);
+ checkLabel = new String (dest);
+ }
+ }
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] check = new int[1], result = new int[1];
+ if (aCheckState != 0) XPCOM.memmove (check, aCheckState, 4);
+ dialog.prompt (titleLabel, textLabel, checkLabel, valueLabel, check, result);
+
+ XPCOM.memmove (_retval, result, 4);
+ if (result[0] == 1) {
+ /*
+ * User selected OK. User name and password are returned as PRUnichar values. Any default
+ * value that we override must be freed using the nsIMemory service.
+ */
+ if (valueLabel[0] != null) {
+ int /*long*/[] result2 = new int /*long*/[1];
+ int rc = XPCOM.NS_GetServiceManager (result2);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (result2[0] == 0) SWT.error (XPCOM.NS_NOINTERFACE);
+
+ nsIServiceManager serviceManager = new nsIServiceManager (result2[0]);
+ result2[0] = 0;
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIMemory.NS_IMEMORY_IID, result2);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (result2[0] == 0) SWT.error (XPCOM.NS_NOINTERFACE);
+ serviceManager.Release ();
+
+ nsIMemory memory = new nsIMemory (result2[0]);
+ result2[0] = 0;
+
+ int cnt = valueLabel[0].length ();
+ char[] buffer = new char[cnt + 1];
+ valueLabel[0].getChars (0, cnt, buffer, 0);
+ int size = buffer.length * 2;
+ int /*long*/ ptr = memory.Alloc (size);
+ XPCOM.memmove (ptr, buffer, size);
+ XPCOM.memmove (aValue, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+
+ if (valueAddr[0] != 0) {
+ memory.Free (valueAddr[0]);
+ }
+ memory.Release ();
+ }
+ }
+ if (aCheckState != 0) XPCOM.memmove (aCheckState, check, 4);
+ return XPCOM.NS_OK;
+}
+
+int PromptAuth(int /*long*/ aChannel, int level, int /*long*/ authInfo, int /*long*/ _retval) {
+ nsIAuthInformation auth = new nsIAuthInformation (authInfo);
+
+ Browser browser = getBrowser ();
+ if (browser != null) {
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ /*
+ * Do not invoke the listeners if this challenge has been failed too many
+ * times because a listener is likely giving incorrect credentials repeatedly
+ * and will do so indefinitely.
+ */
+ if (mozilla.authCount++ < 3) {
+ for (int i = 0; i < mozilla.authenticationListeners.length; i++) {
+ AuthenticationEvent event = new AuthenticationEvent (browser);
+ event.location = mozilla.lastNavigateURL;
+ mozilla.authenticationListeners[i].authenticate (event);
+ if (!event.doit) {
+ XPCOM.memmove (_retval, new int[] {0}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+ if (event.user != null && event.password != null) {
+ nsEmbedString string = new nsEmbedString (event.user);
+ int rc = auth.SetUsername (string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ string = new nsEmbedString (event.password);
+ rc = auth.SetPassword (string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ XPCOM.memmove (_retval, new int[] {1}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+ }
+ }
+ }
+
+ /* no listener handled the challenge, so show an authentication dialog */
+
+ String checkLabel = null;
+ int[] checkValue = new int[1];
+ String[] userLabel = new String[1], passLabel = new String[1];
+
+ String title = SWT.getMessage ("SWT_Authentication_Required"); //$NON-NLS-1$
+
+ /* get initial username and password values */
+
+ int /*long*/ ptr = XPCOM.nsEmbedString_new ();
+ int rc = auth.GetUsername (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ int length = XPCOM.nsEmbedString_Length (ptr);
+ int /*long*/ buffer = XPCOM.nsEmbedString_get (ptr);
+ char[] chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ userLabel[0] = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ ptr = XPCOM.nsEmbedString_new ();
+ rc = auth.GetPassword (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedString_Length (ptr);
+ buffer = XPCOM.nsEmbedString_get (ptr);
+ chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ passLabel[0] = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ /* compute the message text */
+
+ ptr = XPCOM.nsEmbedString_new ();
+ rc = auth.GetRealm (ptr);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedString_Length (ptr);
+ buffer = XPCOM.nsEmbedString_get (ptr);
+ chars = new char[length];
+ XPCOM.memmove (chars, buffer, length * 2);
+ String realm = new String (chars);
+ XPCOM.nsEmbedString_delete (ptr);
+
+ nsIChannel channel = new nsIChannel (aChannel);
+ int /*long*/[] uri = new int /*long*/[1];
+ rc = channel.GetURI (uri);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (uri[0] == 0) Mozilla.error (XPCOM.NS_NOINTERFACE);
+
+ nsIURI nsURI = new nsIURI (uri[0]);
+ int /*long*/ host = XPCOM.nsEmbedCString_new ();
+ rc = nsURI.GetHost (host);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ length = XPCOM.nsEmbedCString_Length (host);
+ buffer = XPCOM.nsEmbedCString_get (host);
+ byte[] bytes = new byte[length];
+ XPCOM.memmove (bytes, buffer, length);
+ String hostString = new String (bytes);
+ XPCOM.nsEmbedCString_delete (host);
+ nsURI.Release ();
+
+ String message;
+ if (realm.length () > 0 && hostString.length () > 0) {
+ message = Compatibility.getMessage ("SWT_Enter_Username_and_Password", new String[] {realm, hostString}); //$NON-NLS-1$
+ } else {
+ message = ""; //$NON-NLS-1$
+ }
+
+ /* open the prompter */
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] result = new int[1];
+ dialog.promptUsernameAndPassword (title, message, checkLabel, userLabel, passLabel, checkValue, result);
+
+ XPCOM.memmove (_retval, result, 4); /* PRBool */
+ if (result[0] == 1) { /* User selected OK */
+ nsEmbedString string = new nsEmbedString (userLabel[0]);
+ rc = auth.SetUsername(string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+
+ string = new nsEmbedString (passLabel[0]);
+ rc = auth.SetPassword(string.getAddress ());
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ string.dispose ();
+ }
+
+ return XPCOM.NS_OK;
+}
+
+int PromptUsernameAndPassword (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ aUsername, int /*long*/ aPassword, int /*long*/ aCheckMsg, int /*long*/ aCheckState, int /*long*/ _retval) {
+ Browser browser = getBrowser ();
+ String user = null, password = null;
+
+ if (browser != null) {
+ Mozilla mozilla = (Mozilla)browser.webBrowser;
+ /*
+ * Do not invoke the listeners if this challenge has been failed too many
+ * times because a listener is likely giving incorrect credentials repeatedly
+ * and will do so indefinitely.
+ */
+ if (mozilla.authCount++ < 3) {
+ for (int i = 0; i < mozilla.authenticationListeners.length; i++) {
+ AuthenticationEvent event = new AuthenticationEvent (browser);
+ event.location = mozilla.lastNavigateURL;
+ mozilla.authenticationListeners[i].authenticate (event);
+ if (!event.doit) {
+ XPCOM.memmove (_retval, new int[] {0}, 4); /* PRBool */
+ return XPCOM.NS_OK;
+ }
+ if (event.user != null && event.password != null) {
+ user = event.user;
+ password = event.password;
+ XPCOM.memmove (_retval, new int[] {1}, 4); /* PRBool */
+ break;
+ }
+ }
+ }
+ }
+
+ if (user == null) {
+ /* no listener handled the challenge, so show an authentication dialog */
+
+ String titleLabel, textLabel, checkLabel = null;
+ String[] userLabel = new String[1], passLabel = new String[1];
+ char[] dest;
+ int length;
+ if (aDialogTitle != 0) {
+ length = XPCOM.strlen_PRUnichar (aDialogTitle);
+ dest = new char[length];
+ XPCOM.memmove (dest, aDialogTitle, length * 2);
+ titleLabel = new String (dest);
+ } else {
+ titleLabel = SWT.getMessage ("SWT_Authentication_Required"); //$NON-NLS-1$
+ }
+
+ length = XPCOM.strlen_PRUnichar (aText);
+ dest = new char[length];
+ XPCOM.memmove (dest, aText, length * 2);
+ textLabel = new String (dest);
+
+ int /*long*/[] userAddr = new int /*long*/[1];
+ XPCOM.memmove (userAddr, aUsername, C.PTR_SIZEOF);
+ if (userAddr[0] != 0) {
+ length = XPCOM.strlen_PRUnichar (userAddr[0]);
+ dest = new char[length];
+ XPCOM.memmove (dest, userAddr[0], length * 2);
+ userLabel[0] = new String (dest);
+ }
+
+ int /*long*/[] passAddr = new int /*long*/[1];
+ XPCOM.memmove (passAddr, aPassword, C.PTR_SIZEOF);
+ if (passAddr[0] != 0) {
+ length = XPCOM.strlen_PRUnichar (passAddr[0]);
+ dest = new char[length];
+ XPCOM.memmove (dest, passAddr[0], length * 2);
+ passLabel[0] = new String (dest);
+ }
+
+ if (aCheckMsg != 0) {
+ length = XPCOM.strlen_PRUnichar (aCheckMsg);
+ if (length > 0) {
+ dest = new char[length];
+ XPCOM.memmove (dest, aCheckMsg, length * 2);
+ checkLabel = new String (dest);
+ }
+ }
+
+ Shell shell = browser == null ? new Shell () : browser.getShell ();
+ PromptDialog dialog = new PromptDialog (shell);
+ int[] check = new int[1], result = new int[1];
+ if (aCheckState != 0) XPCOM.memmove (check, aCheckState, 4); /* PRBool */
+ dialog.promptUsernameAndPassword (titleLabel, textLabel, checkLabel, userLabel, passLabel, check, result);
+
+ XPCOM.memmove (_retval, result, 4); /* PRBool */
+ if (result[0] == 1) {
+ /* User selected OK */
+ user = userLabel[0];
+ password = passLabel[0];
+ }
+ if (aCheckState != 0) XPCOM.memmove (aCheckState, check, 4); /* PRBool */
+ }
+
+ if (user != null) {
+ /*
+ * User name and password are returned as PRUnichar values. Any default
+ * value that we override must be freed using the nsIMemory service.
+ */
+ int /*long*/[] userAddr = new int /*long*/[1];
+ XPCOM.memmove (userAddr, aUsername, C.PTR_SIZEOF);
+ int /*long*/[] passAddr = new int /*long*/[1];
+ XPCOM.memmove (passAddr, aPassword, C.PTR_SIZEOF);
+
+ int /*long*/[] result = new int /*long*/[1];
+ int rc = XPCOM.NS_GetServiceManager (result);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (result[0] == 0) SWT.error (XPCOM.NS_NOINTERFACE);
+
+ nsIServiceManager serviceManager = new nsIServiceManager (result[0]);
+ result[0] = 0;
+ byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_MEMORY_CONTRACTID, true);
+ rc = serviceManager.GetServiceByContractID (aContractID, nsIMemory.NS_IMEMORY_IID, result);
+ if (rc != XPCOM.NS_OK) SWT.error (rc);
+ if (result[0] == 0) SWT.error (XPCOM.NS_NOINTERFACE);
+ serviceManager.Release ();
+
+ nsIMemory memory = new nsIMemory (result[0]);
+ result[0] = 0;
+ if (userAddr[0] != 0) memory.Free (userAddr[0]);
+ if (passAddr[0] != 0) memory.Free (passAddr[0]);
+ memory.Release ();
+
+ /* write the name and password values */
+
+ int cnt = user.length ();
+ char[] buffer = new char[cnt + 1];
+ user.getChars (0, cnt, buffer, 0);
+ int size = buffer.length * 2;
+ int /*long*/ ptr = C.malloc (size);
+ XPCOM.memmove (ptr, buffer, size);
+ XPCOM.memmove (aUsername, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+
+ cnt = password.length ();
+ buffer = new char[cnt + 1];
+ password.getChars (0, cnt, buffer, 0);
+ size = buffer.length * 2;
+ ptr = C.malloc (size);
+ XPCOM.memmove (ptr, buffer, size);
+ XPCOM.memmove (aPassword, new int /*long*/[] {ptr}, C.PTR_SIZEOF);
+ }
+
+ return XPCOM.NS_OK;
+}
+
+int PromptPassword (int /*long*/ aDialogTitle, int /*long*/ aText, int /*long*/ aPassword, int /*long*/ aCheckMsg, int /*long*/ aCheckState, int /*long*/ _retval) {
+ return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+int Select (int /*long*/ aDialogTitle, int /*long*/ aText, int aCount, int /*long*/ aSelectList, int /*long*/ aOutSelection, int /*long*/ _retval) {
+ return XPCOM.NS_ERROR_NOT_IMPLEMENTED;
+}
+
+}
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 a59b118957..a2bc0131e6 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
@@ -54,11 +54,14 @@ public class XPCOM extends C {
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$
- public static final nsID NS_HELPERAPPLAUNCHERDIALOG_CID = new nsID("f68578eb-6ec2-4169-ae19-8c6243f0abe1"); //$NON-NLS-1$
+ public static final nsID NS_HELPERAPPLAUNCHERDIALOG_CID = new nsID("e68578eb-6ec2-4169-ae19-8c6243f0abe1"); //$NON-NLS-1$
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_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_CERTOVERRIDE_CONTRACTID = "@mozilla.org/security/certoverride;1"; //$NON-NLS-1$
@@ -79,6 +82,8 @@ public class XPCOM extends C {
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_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$
@@ -562,6 +567,22 @@ public static final int Call(int /*long*/ ptr, int /*long*/ aLibXULDirectory, in
}
}
+/**
+ * @param ptr cast=(SWT_XREInitEmbedding2)
+ * @param aLibXULDirectory cast=(nsILocalFile *)
+ * @param aAppDirectory cast=(nsILocalFile *)
+ * @param aAppDirProvider cast=(nsIDirectoryServiceProvider *)
+ */
+public static final native int _Call(int /*long*/ ptr, int /*long*/ aLibXULDirectory, int /*long*/ aAppDirectory, int /*long*/ aAppDirProvider);
+public static final int Call(int /*long*/ ptr, int /*long*/ aLibXULDirectory, int /*long*/ aAppDirectory, int /*long*/ aAppDirProvider) {
+ lock.lock();
+ try {
+ return _Call(ptr, aLibXULDirectory, aAppDirectory, aAppDirProvider);
+ } finally {
+ lock.unlock();
+ }
+}
+
static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl);
static final int VtblCall(int fnNumber, int /*long*/ ppVtbl) {
lock.lock();
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
new file mode 100644
index 0000000000..ee29667925
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIAuthPrompt2.java
@@ -0,0 +1,57 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIAuthPrompt2 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2;
+
+ public static final String NS_IAUTHPROMPT2_IID_STR =
+ "651395eb-8612-4876-8ac0-a88d4dce9e1e";
+
+ public static final nsID NS_IAUTHPROMPT2_IID =
+ new nsID(NS_IAUTHPROMPT2_IID_STR);
+
+ public nsIAuthPrompt2(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int LEVEL_NONE = 0;
+
+ public static final int LEVEL_PW_ENCRYPTED = 1;
+
+ public static final int LEVEL_SECURE = 2;
+
+ public int PromptAuth(int /*long*/ aParent, int /*long*/ aChannel, int level, int /*long*/ authInfo, char[] checkboxLabel, int[] checkValue, int[] _retval) {
+ return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 1, getAddress(), aParent, aChannel, level, authInfo, checkboxLabel, checkValue, _retval);
+ }
+
+ public int AsyncPromptAuth(int /*long*/ aParent, int /*long*/ aChannel, int /*long*/ aCallback, int /*long*/ aContext, int level, int /*long*/ authInfo, char[] checkboxLabel, int[] checkValue, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIPromptService.LAST_METHOD_ID + 2, getAddress(), aParent, aChannel, aCallback, aContext, level, authInfo, checkboxLabel, checkValue, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java
index b07be67dc4..406eaf0de1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent.java
@@ -29,10 +29,10 @@ package org.eclipse.swt.internal.mozilla;
public class nsIDOMEvent extends nsISupports {
- static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 10;
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 11;
public static final String NS_IDOMEVENT_IID_STR =
- "a66b7b80-ff46-bd97-0080-5f8ae38add32";
+ "548137e8-fd2c-48c4-8635-3033f7db79e0";
public static final nsID NS_IDOMEVENT_IID =
new nsID(NS_IDOMEVENT_IID_STR);
@@ -86,4 +86,8 @@ public class nsIDOMEvent extends nsISupports {
public int InitEvent(int /*long*/ eventTypeArg, int canBubbleArg, int cancelableArg) {
return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), eventTypeArg, canBubbleArg, cancelableArg);
}
+
+ public int GetDefaultPrevented(int[] aDefaultPrevented) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aDefaultPrevented);
+ }
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java
index fd08c33bf4..45e8375d07 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget.java
@@ -32,7 +32,7 @@ public class nsIDOMEventTarget extends nsISupports {
static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3;
public static final String NS_IDOMEVENTTARGET_IID_STR =
- "1c773b30-d1cf-11d2-bd95-00805f8ae3f4";
+ "1797d5a4-b12a-428d-9eef-a0e13839728c";
public static final nsID NS_IDOMEVENTTARGET_IID =
new nsID(NS_IDOMEVENTTARGET_IID_STR);
@@ -41,8 +41,8 @@ public class nsIDOMEventTarget extends nsISupports {
super(address);
}
- public int AddEventListener(int /*long*/ type, int /*long*/ listener, int useCapture) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), type, listener, useCapture);
+ public int AddEventListener(int /*long*/ type, int /*long*/ listener, int useCapture, int wantsUntrusted, int _argc) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), type, listener, useCapture, wantsUntrusted, _argc);
}
public int RemoveEventListener(int /*long*/ type, int /*long*/ listener, int useCapture) {
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget_1_9.java
new file mode 100644
index 0000000000..8441ece789
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEventTarget_1_9.java
@@ -0,0 +1,55 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMEventTarget_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3;
+
+ public static final String NS_IDOMEVENTTARGET_IID_STR =
+ "1c773b30-d1cf-11d2-bd95-00805f8ae3f4";
+
+ public static final nsID NS_IDOMEVENTTARGET_IID =
+ new nsID(NS_IDOMEVENTTARGET_IID_STR);
+
+ public nsIDOMEventTarget_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int AddEventListener(int /*long*/ type, int /*long*/ listener, int useCapture) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), type, listener, useCapture);
+ }
+
+ public int RemoveEventListener(int /*long*/ type, int /*long*/ listener, int useCapture) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), type, listener, useCapture);
+ }
+
+ public int DispatchEvent(int /*long*/ evt, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), evt, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent_1_9.java
new file mode 100644
index 0000000000..341723d0c7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMEvent_1_9.java
@@ -0,0 +1,89 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMEvent_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 10;
+
+ public static final String NS_IDOMEVENT_IID_STR =
+ "a66b7b80-ff46-bd97-0080-5f8ae38add32";
+
+ public static final nsID NS_IDOMEVENT_IID =
+ new nsID(NS_IDOMEVENT_IID_STR);
+
+ public nsIDOMEvent_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int CAPTURING_PHASE = 1;
+
+ public static final int AT_TARGET = 2;
+
+ public static final int BUBBLING_PHASE = 3;
+
+ public int GetType(int /*long*/ aType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aType);
+ }
+
+ public int GetTarget(int /*long*/[] aTarget) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aTarget);
+ }
+
+ public int GetCurrentTarget(int /*long*/[] aCurrentTarget) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aCurrentTarget);
+ }
+
+ public int GetEventPhase(short[] aEventPhase) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aEventPhase);
+ }
+
+ public int GetBubbles(int[] aBubbles) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aBubbles);
+ }
+
+ public int GetCancelable(int[] aCancelable) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aCancelable);
+ }
+
+ public int GetTimeStamp(int /*long*/[] aTimeStamp) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aTimeStamp);
+ }
+
+ public int StopPropagation() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress());
+ }
+
+ public int PreventDefault() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress());
+ }
+
+ public int InitEvent(int /*long*/ eventTypeArg, int canBubbleArg, int cancelableArg) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), eventTypeArg, canBubbleArg, cancelableArg);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java
index 906c132f87..c0ef8c5cd4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent.java
@@ -32,7 +32,7 @@ public class nsIDOMKeyEvent extends nsIDOMUIEvent {
static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + 7;
public static final String NS_IDOMKEYEVENT_IID_STR =
- "028e0e6e-8b01-11d3-aae7-0010838a3123";
+ "e44d7977-20f2-442e-bc13-0f2f52992a4c";
public static final nsID NS_IDOMKEYEVENT_IID =
new nsID(NS_IDOMKEYEVENT_IID_STR);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent_1_9.java
new file mode 100644
index 0000000000..f83d4a6e93
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMKeyEvent_1_9.java
@@ -0,0 +1,299 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMKeyEvent_1_9 extends nsIDOMUIEvent_1_9 {
+
+ static final int LAST_METHOD_ID = nsIDOMUIEvent_1_9.LAST_METHOD_ID + 7;
+
+ public static final String NS_IDOMKEYEVENT_IID_STR =
+ "028e0e6e-8b01-11d3-aae7-0010838a3123";
+
+ public static final nsID NS_IDOMKEYEVENT_IID =
+ new nsID(NS_IDOMKEYEVENT_IID_STR);
+
+ public nsIDOMKeyEvent_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int DOM_VK_CANCEL = 3;
+
+ public static final int DOM_VK_HELP = 6;
+
+ public static final int DOM_VK_BACK_SPACE = 8;
+
+ public static final int DOM_VK_TAB = 9;
+
+ public static final int DOM_VK_CLEAR = 12;
+
+ public static final int DOM_VK_RETURN = 13;
+
+ public static final int DOM_VK_ENTER = 14;
+
+ public static final int DOM_VK_SHIFT = 16;
+
+ public static final int DOM_VK_CONTROL = 17;
+
+ public static final int DOM_VK_ALT = 18;
+
+ public static final int DOM_VK_PAUSE = 19;
+
+ public static final int DOM_VK_CAPS_LOCK = 20;
+
+ public static final int DOM_VK_ESCAPE = 27;
+
+ public static final int DOM_VK_SPACE = 32;
+
+ public static final int DOM_VK_PAGE_UP = 33;
+
+ public static final int DOM_VK_PAGE_DOWN = 34;
+
+ public static final int DOM_VK_END = 35;
+
+ public static final int DOM_VK_HOME = 36;
+
+ public static final int DOM_VK_LEFT = 37;
+
+ public static final int DOM_VK_UP = 38;
+
+ public static final int DOM_VK_RIGHT = 39;
+
+ public static final int DOM_VK_DOWN = 40;
+
+ public static final int DOM_VK_PRINTSCREEN = 44;
+
+ public static final int DOM_VK_INSERT = 45;
+
+ public static final int DOM_VK_DELETE = 46;
+
+ public static final int DOM_VK_0 = 48;
+
+ public static final int DOM_VK_1 = 49;
+
+ public static final int DOM_VK_2 = 50;
+
+ public static final int DOM_VK_3 = 51;
+
+ public static final int DOM_VK_4 = 52;
+
+ public static final int DOM_VK_5 = 53;
+
+ public static final int DOM_VK_6 = 54;
+
+ public static final int DOM_VK_7 = 55;
+
+ public static final int DOM_VK_8 = 56;
+
+ public static final int DOM_VK_9 = 57;
+
+ public static final int DOM_VK_SEMICOLON = 59;
+
+ public static final int DOM_VK_EQUALS = 61;
+
+ public static final int DOM_VK_A = 65;
+
+ public static final int DOM_VK_B = 66;
+
+ public static final int DOM_VK_C = 67;
+
+ public static final int DOM_VK_D = 68;
+
+ public static final int DOM_VK_E = 69;
+
+ public static final int DOM_VK_F = 70;
+
+ public static final int DOM_VK_G = 71;
+
+ public static final int DOM_VK_H = 72;
+
+ public static final int DOM_VK_I = 73;
+
+ public static final int DOM_VK_J = 74;
+
+ public static final int DOM_VK_K = 75;
+
+ public static final int DOM_VK_L = 76;
+
+ public static final int DOM_VK_M = 77;
+
+ public static final int DOM_VK_N = 78;
+
+ public static final int DOM_VK_O = 79;
+
+ public static final int DOM_VK_P = 80;
+
+ public static final int DOM_VK_Q = 81;
+
+ public static final int DOM_VK_R = 82;
+
+ public static final int DOM_VK_S = 83;
+
+ public static final int DOM_VK_T = 84;
+
+ public static final int DOM_VK_U = 85;
+
+ public static final int DOM_VK_V = 86;
+
+ public static final int DOM_VK_W = 87;
+
+ public static final int DOM_VK_X = 88;
+
+ public static final int DOM_VK_Y = 89;
+
+ public static final int DOM_VK_Z = 90;
+
+ public static final int DOM_VK_NUMPAD0 = 96;
+
+ public static final int DOM_VK_NUMPAD1 = 97;
+
+ public static final int DOM_VK_NUMPAD2 = 98;
+
+ public static final int DOM_VK_NUMPAD3 = 99;
+
+ public static final int DOM_VK_NUMPAD4 = 100;
+
+ public static final int DOM_VK_NUMPAD5 = 101;
+
+ public static final int DOM_VK_NUMPAD6 = 102;
+
+ public static final int DOM_VK_NUMPAD7 = 103;
+
+ public static final int DOM_VK_NUMPAD8 = 104;
+
+ public static final int DOM_VK_NUMPAD9 = 105;
+
+ public static final int DOM_VK_MULTIPLY = 106;
+
+ public static final int DOM_VK_ADD = 107;
+
+ public static final int DOM_VK_SEPARATOR = 108;
+
+ public static final int DOM_VK_SUBTRACT = 109;
+
+ public static final int DOM_VK_DECIMAL = 110;
+
+ public static final int DOM_VK_DIVIDE = 111;
+
+ public static final int DOM_VK_F1 = 112;
+
+ public static final int DOM_VK_F2 = 113;
+
+ public static final int DOM_VK_F3 = 114;
+
+ public static final int DOM_VK_F4 = 115;
+
+ public static final int DOM_VK_F5 = 116;
+
+ public static final int DOM_VK_F6 = 117;
+
+ public static final int DOM_VK_F7 = 118;
+
+ public static final int DOM_VK_F8 = 119;
+
+ public static final int DOM_VK_F9 = 120;
+
+ public static final int DOM_VK_F10 = 121;
+
+ public static final int DOM_VK_F11 = 122;
+
+ public static final int DOM_VK_F12 = 123;
+
+ public static final int DOM_VK_F13 = 124;
+
+ public static final int DOM_VK_F14 = 125;
+
+ public static final int DOM_VK_F15 = 126;
+
+ public static final int DOM_VK_F16 = 127;
+
+ public static final int DOM_VK_F17 = 128;
+
+ public static final int DOM_VK_F18 = 129;
+
+ public static final int DOM_VK_F19 = 130;
+
+ public static final int DOM_VK_F20 = 131;
+
+ public static final int DOM_VK_F21 = 132;
+
+ public static final int DOM_VK_F22 = 133;
+
+ public static final int DOM_VK_F23 = 134;
+
+ public static final int DOM_VK_F24 = 135;
+
+ public static final int DOM_VK_NUM_LOCK = 144;
+
+ public static final int DOM_VK_SCROLL_LOCK = 145;
+
+ public static final int DOM_VK_COMMA = 188;
+
+ public static final int DOM_VK_PERIOD = 190;
+
+ public static final int DOM_VK_SLASH = 191;
+
+ public static final int DOM_VK_BACK_QUOTE = 192;
+
+ public static final int DOM_VK_OPEN_BRACKET = 219;
+
+ public static final int DOM_VK_BACK_SLASH = 220;
+
+ public static final int DOM_VK_CLOSE_BRACKET = 221;
+
+ public static final int DOM_VK_QUOTE = 222;
+
+ public static final int DOM_VK_META = 224;
+
+ public int GetCharCode(int[] aCharCode) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 1, getAddress(), aCharCode);
+ }
+
+ public int GetKeyCode(int[] aKeyCode) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 2, getAddress(), aKeyCode);
+ }
+
+ public int GetAltKey(int[] aAltKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 3, getAddress(), aAltKey);
+ }
+
+ public int GetCtrlKey(int[] aCtrlKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 4, getAddress(), aCtrlKey);
+ }
+
+ public int GetShiftKey(int[] aShiftKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 5, getAddress(), aShiftKey);
+ }
+
+ public int GetMetaKey(int[] aMetaKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 6, getAddress(), aMetaKey);
+ }
+
+ public int InitKeyEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, int keyCodeArg, int charCodeArg) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 7, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, keyCodeArg, charCodeArg);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java
index 71b7a7347e..3420f7e577 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent.java
@@ -32,7 +32,7 @@ public class nsIDOMMouseEvent extends nsIDOMUIEvent {
static final int LAST_METHOD_ID = nsIDOMUIEvent.LAST_METHOD_ID + 11;
public static final String NS_IDOMMOUSEEVENT_IID_STR =
- "ff751edc-8b02-aae7-0010-8301838a3123";
+ "73558605-f479-493e-86d1-9794cd117fef";
public static final nsID NS_IDOMMOUSEEVENT_IID =
new nsID(NS_IDOMMOUSEEVENT_IID_STR);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent_1_9.java
new file mode 100644
index 0000000000..f3f9c83a05
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMMouseEvent_1_9.java
@@ -0,0 +1,87 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMMouseEvent_1_9 extends nsIDOMUIEvent_1_9 {
+
+ static final int LAST_METHOD_ID = nsIDOMUIEvent_1_9.LAST_METHOD_ID + 11;
+
+ public static final String NS_IDOMMOUSEEVENT_IID_STR =
+ "ff751edc-8b02-aae7-0010-8301838a3123";
+
+ public static final nsID NS_IDOMMOUSEEVENT_IID =
+ new nsID(NS_IDOMMOUSEEVENT_IID_STR);
+
+ public nsIDOMMouseEvent_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetScreenX(int[] aScreenX) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 1, getAddress(), aScreenX);
+ }
+
+ public int GetScreenY(int[] aScreenY) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 2, getAddress(), aScreenY);
+ }
+
+ public int GetClientX(int[] aClientX) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 3, getAddress(), aClientX);
+ }
+
+ public int GetClientY(int[] aClientY) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 4, getAddress(), aClientY);
+ }
+
+ public int GetCtrlKey(int[] aCtrlKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 5, getAddress(), aCtrlKey);
+ }
+
+ public int GetShiftKey(int[] aShiftKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 6, getAddress(), aShiftKey);
+ }
+
+ public int GetAltKey(int[] aAltKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 7, getAddress(), aAltKey);
+ }
+
+ public int GetMetaKey(int[] aMetaKey) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 8, getAddress(), aMetaKey);
+ }
+
+ public int GetButton(short[] aButton) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 9, getAddress(), aButton);
+ }
+
+ public int GetRelatedTarget(int /*long*/[] aRelatedTarget) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 10, getAddress(), aRelatedTarget);
+ }
+
+ public int InitMouseEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int detailArg, int screenXArg, int screenYArg, int clientXArg, int clientYArg, int ctrlKeyArg, int altKeyArg, int shiftKeyArg, int metaKeyArg, short buttonArg, int /*long*/ relatedTargetArg) {
+ return XPCOM.VtblCall(nsIDOMUIEvent_1_9.LAST_METHOD_ID + 11, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg, screenXArg, screenYArg, clientXArg, clientYArg, ctrlKeyArg, altKeyArg, shiftKeyArg, metaKeyArg, buttonArg, relatedTargetArg);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java
index 3a35f4b4da..a0540d9414 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent.java
@@ -32,7 +32,7 @@ public class nsIDOMUIEvent extends nsIDOMEvent {
static final int LAST_METHOD_ID = nsIDOMEvent.LAST_METHOD_ID + 3;
public static final String NS_IDOMUIEVENT_IID_STR =
- "a6cf90c3-15b3-11d2-932e-00805f8add32";
+ "25f28689-3f78-47e8-8d76-15b936faf8c1";
public static final nsID NS_IDOMUIEVENT_IID =
new nsID(NS_IDOMUIEVENT_IID_STR);
@@ -49,6 +49,7 @@ public class nsIDOMUIEvent extends nsIDOMEvent {
return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 2, getAddress(), aDetail);
}
+ //nsIDOMWindow - viewArg
public int InitUIEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int detailArg) {
return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 3, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java
new file mode 100644
index 0000000000..1b2816b4c1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMUIEvent_1_9.java
@@ -0,0 +1,56 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMUIEvent_1_9 extends nsIDOMEvent {
+
+ static final int LAST_METHOD_ID = nsIDOMEvent.LAST_METHOD_ID + 3;
+
+ public static final String NS_IDOMUIEVENT_IID_STR =
+ "a6cf906b-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMUIEVENT_IID =
+ new nsID(NS_IDOMUIEVENT_IID_STR);
+
+ public nsIDOMUIEvent_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetView(int /*long*/[] aView) {
+ return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 1, getAddress(), aView);
+ }
+
+ public int GetDetail(int[] aDetail) {
+ return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 2, getAddress(), aDetail);
+ }
+
+ //nsIDOMWindow - viewArg
+ public int InitUIEvent(int /*long*/ typeArg, int canBubbleArg, int cancelableArg, int /*long*/ viewArg, int detailArg) {
+ return XPCOM.VtblCall(nsIDOMEvent.LAST_METHOD_ID + 3, getAddress(), typeArg, canBubbleArg, cancelableArg, viewArg, detailArg);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java
index 514843aaae..29ccde9ca2 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow.java
@@ -29,10 +29,10 @@ package org.eclipse.swt.internal.mozilla;
public class nsIDOMWindow extends nsISupports {
- static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 17;
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 75;
public static final String NS_IDOMWINDOW_IID_STR =
- "a6cf906b-15b3-11d2-932e-00805f8add32";
+ "972cb379-6bdc-4544-8b46-8d721e12e906";
public static final nsID NS_IDOMWINDOW_IID =
new nsID(NS_IDOMWINDOW_IID_STR);
@@ -42,70 +42,70 @@ public class nsIDOMWindow extends nsISupports {
}
public int GetDocument(int /*long*/[] aDocument) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aDocument);
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aDocument);
}
- public int GetParent(int /*long*/[] aParent) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aParent);
+ public int GetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aName);
}
- public int GetTop(int /*long*/[] aTop) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aTop);
+ public int SetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aName);
}
-
+
public int GetScrollbars(int /*long*/[] aScrollbars) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aScrollbars);
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aScrollbars);
}
-
- public int GetFrames(int /*long*/[] aFrames) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aFrames);
+
+ public int GetTop(int /*long*/[] aTop) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aTop);
}
-
- public int GetName(int /*long*/ aName) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aName);
+
+ public int GetParent(int /*long*/[] aParent) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aParent);
}
- public int SetName(int /*long*/ aName) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aName);
+ public int GetScrollX(int[] aScrollX) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 45, getAddress(), aScrollX);
}
- public int GetTextZoom(float[] aTextZoom) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aTextZoom);
+ public int GetScrollY(int[] aScrollY) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 47, getAddress(), aScrollY);
}
- public int SetTextZoom(float aTextZoom) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aTextZoom);
+ public int ScrollTo(int xScroll, int yScroll) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 50, getAddress(), xScroll, yScroll);
}
- public int GetScrollX(int[] aScrollX) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aScrollX);
+ public int ScrollBy(int xScrollDif, int yScrollDif) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 51, getAddress(), xScrollDif, yScrollDif);
}
- public int GetScrollY(int[] aScrollY) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aScrollY);
+ public int GetSelection(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 38, getAddress(), _retval);
}
- public int ScrollTo(int xScroll, int yScroll) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), xScroll, yScroll);
+ public int GetFrames(int /*long*/[] aFrames) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 62, getAddress(), aFrames);
}
- public int ScrollBy(int xScrollDif, int yScrollDif) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), xScrollDif, yScrollDif);
+ public int GetTextZoom(float[] aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 63, getAddress(), aTextZoom);
}
- public int GetSelection(int /*long*/[] _retval) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), _retval);
+ public int SetTextZoom(float aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 64, getAddress(), aTextZoom);
}
public int ScrollByLines(int numLines) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), numLines);
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 65, getAddress(), numLines);
}
public int ScrollByPages(int numPages) {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), numPages);
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 66, getAddress(), numPages);
}
public int SizeToContent() {
- return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress());
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 68, getAddress());
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_1_9.java
new file mode 100644
index 0000000000..c8735aa3c1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_1_9.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2005 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMWindow_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 17;
+
+ public static final String NS_IDOMWINDOW_IID_STR =
+ "a6cf906b-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMWINDOW_IID =
+ new nsID(NS_IDOMWINDOW_IID_STR);
+
+ public nsIDOMWindow_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetDocument(int /*long*/[] aDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aDocument);
+ }
+
+ public int GetParent(int /*long*/[] aParent) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aParent);
+ }
+
+ public int GetTop(int /*long*/[] aTop) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aTop);
+ }
+
+ public int GetScrollbars(int /*long*/[] aScrollbars) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aScrollbars);
+ }
+
+ public int GetFrames(int /*long*/[] aFrames) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aFrames);
+ }
+
+ public int GetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aName);
+ }
+
+ public int SetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aName);
+ }
+
+ public int GetTextZoom(float[] aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aTextZoom);
+ }
+
+ public int SetTextZoom(float aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aTextZoom);
+ }
+
+ public int GetScrollX(int[] aScrollX) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aScrollX);
+ }
+
+ public int GetScrollY(int[] aScrollY) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aScrollY);
+ }
+
+ public int ScrollTo(int xScroll, int yScroll) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), xScroll, yScroll);
+ }
+
+ public int ScrollBy(int xScrollDif, int yScrollDif) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), xScrollDif, yScrollDif);
+ }
+
+ public int GetSelection(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), _retval);
+ }
+
+ public int ScrollByLines(int numLines) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), numLines);
+ }
+
+ public int ScrollByPages(int numPages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), numPages);
+ }
+
+ public int SizeToContent() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress());
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_8.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_8.java
new file mode 100644
index 0000000000..9cd5cf8e95
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMWindow_8.java
@@ -0,0 +1,111 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2005 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMWindow_8 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 75;
+
+ public static final String NS_IDOMWINDOW_IID_STR =
+ "972cb379-6bdc-4544-8b46-8d721e12e906";
+
+ public static final nsID NS_IDOMWINDOW_IID =
+ new nsID(NS_IDOMWINDOW_IID_STR);
+
+ public nsIDOMWindow_8(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetDocument(int /*long*/[] aDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aDocument);
+ }
+
+ public int GetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aName);
+ }
+
+ public int SetName(int /*long*/ aName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aName);
+ }
+
+ public int GetScrollbars(int /*long*/[] aScrollbars) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aScrollbars);
+ }
+
+ public int GetTop(int /*long*/[] aTop) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aTop);
+ }
+
+ public int GetParent(int /*long*/[] aParent) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aParent);
+ }
+
+ public int GetScrollX(int[] aScrollX) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 45, getAddress(), aScrollX);
+ }
+
+ public int GetScrollY(int[] aScrollY) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 47, getAddress(), aScrollY);
+ }
+
+ public int ScrollTo(int xScroll, int yScroll) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 50, getAddress(), xScroll, yScroll);
+ }
+
+ public int ScrollBy(int xScrollDif, int yScrollDif) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 51, getAddress(), xScrollDif, yScrollDif);
+ }
+
+ public int GetSelection(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 38, getAddress(), _retval);
+ }
+
+ public int GetFrames(int /*long*/[] aFrames) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 62, getAddress(), aFrames);
+ }
+
+ public int GetTextZoom(float[] aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 63, getAddress(), aTextZoom);
+ }
+
+ public int SetTextZoom(float aTextZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 64, getAddress(), aTextZoom);
+ }
+
+ public int ScrollByLines(int numLines) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 65, getAddress(), numLines);
+ }
+
+ public int ScrollByPages(int numPages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 66, getAddress(), numPages);
+ }
+
+ public int SizeToContent() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 68, getAddress());
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell_2.java
new file mode 100644
index 0000000000..e728dd7806
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDocShell_2.java
@@ -0,0 +1,318 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+//If this class is used then the methods have to be checked with IDL
+public class nsIDocShell_2 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 61;
+
+ public static final String NS_IDOCSHELL_IID_STR =
+ "0666adf8-8738-4ca7-a917-0348f47d2f40";
+
+ public static final nsID NS_IDOCSHELL_IID =
+ new nsID(NS_IDOCSHELL_IID_STR);
+
+ public nsIDocShell_2(int /*long*/ address) {
+ super(address);
+ }
+
+ public int LoadURI(int /*long*/ uri, int /*long*/ loadInfo, int aLoadFlags, int firstParty) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), uri, loadInfo, aLoadFlags, firstParty);
+ }
+
+ public int LoadStream(int /*long*/ aStream, int /*long*/ aURI, int /*long*/ aContentType, int /*long*/ aContentCharset, int /*long*/ aLoadInfo) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aStream, aURI, aContentType, aContentCharset, aLoadInfo);
+ }
+
+ public static final int INTERNAL_LOAD_FLAGS_NONE = 0;
+
+ public static final int INTERNAL_LOAD_FLAGS_INHERIT_OWNER = 1;
+
+ public static final int INTERNAL_LOAD_FLAGS_DONT_SEND_REFERRER = 2;
+
+ public int InternalLoad(int /*long*/ aURI, int /*long*/ aReferrer, int /*long*/ aOwner, int aFlags, char[] aWindowTarget, byte[] aTypeHint, int /*long*/ aPostDataStream, int /*long*/ aHeadersStream, int aLoadFlags, int /*long*/ aSHEntry, int firstParty, int /*long*/[] aDocShell, int /*long*/[] aRequest) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aURI, aReferrer, aOwner, aFlags, aWindowTarget, aTypeHint, aPostDataStream, aHeadersStream, aLoadFlags, aSHEntry, firstParty, aDocShell, aRequest);
+ }
+
+ public int CreateLoadInfo(int /*long*/[] loadInfo) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), loadInfo);
+ }
+
+ public int PrepareForNewContentModel() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress());
+ }
+
+ public int SetCurrentURI(int /*long*/ aURI) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aURI);
+ }
+
+ public int FirePageHideNotification(int isUnload) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), isUnload);
+ }
+
+ public int GetPresContext(int /*long*/[] aPresContext) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aPresContext);
+ }
+
+ public int GetPresShell(int /*long*/[] aPresShell) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aPresShell);
+ }
+
+ public int GetEldestPresShell(int /*long*/[] aEldestPresShell) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aEldestPresShell);
+ }
+
+ public int GetContentViewer(int /*long*/[] aContentViewer) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aContentViewer);
+ }
+
+ public int GetChromeEventHandler(int /*long*/[] aChromeEventHandler) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aChromeEventHandler);
+ }
+
+ public int SetChromeEventHandler(int /*long*/ aChromeEventHandler) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aChromeEventHandler);
+ }
+
+ public int GetDocumentCharsetInfo(int /*long*/[] aDocumentCharsetInfo) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aDocumentCharsetInfo);
+ }
+
+ public int SetDocumentCharsetInfo(int /*long*/ aDocumentCharsetInfo) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aDocumentCharsetInfo);
+ }
+
+ public int GetAllowPlugins(int[] aAllowPlugins) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aAllowPlugins);
+ }
+
+ public int SetAllowPlugins(int aAllowPlugins) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aAllowPlugins);
+ }
+
+ public int GetAllowJavascript(int[] aAllowJavascript) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aAllowJavascript);
+ }
+
+ public int SetAllowJavascript(int aAllowJavascript) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress(), aAllowJavascript);
+ }
+
+ public int GetAllowMetaRedirects(int[] aAllowMetaRedirects) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), aAllowMetaRedirects);
+ }
+
+ public int SetAllowMetaRedirects(int aAllowMetaRedirects) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aAllowMetaRedirects);
+ }
+
+ public int GetAllowSubframes(int[] aAllowSubframes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aAllowSubframes);
+ }
+
+ public int SetAllowSubframes(int aAllowSubframes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aAllowSubframes);
+ }
+
+ public int GetAllowImages(int[] aAllowImages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aAllowImages);
+ }
+
+ public int SetAllowImages(int aAllowImages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), aAllowImages);
+ }
+
+ public static final int ENUMERATE_FORWARDS = 0;
+
+ public static final int ENUMERATE_BACKWARDS = 1;
+
+ public int GetDocShellEnumerator(int aItemType, int aDirection, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aItemType, aDirection, _retval);
+ }
+
+ public static final int APP_TYPE_UNKNOWN = 0;
+
+ public static final int APP_TYPE_MAIL = 1;
+
+ public static final int APP_TYPE_EDITOR = 2;
+
+ public int GetAppType(int[] aAppType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 27, getAddress(), aAppType);
+ }
+
+ public int SetAppType(int aAppType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 28, getAddress(), aAppType);
+ }
+
+ public int GetAllowAuth(int[] aAllowAuth) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 29, getAddress(), aAllowAuth);
+ }
+
+ public int SetAllowAuth(int aAllowAuth) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 30, getAddress(), aAllowAuth);
+ }
+
+ public int GetZoom(float[] aZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 31, getAddress(), aZoom);
+ }
+
+ public int SetZoom(float aZoom) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 32, getAddress(), aZoom);
+ }
+
+ public int GetMarginWidth(int[] aMarginWidth) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 33, getAddress(), aMarginWidth);
+ }
+
+ public int SetMarginWidth(int aMarginWidth) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 34, getAddress(), aMarginWidth);
+ }
+
+ public int GetMarginHeight(int[] aMarginHeight) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 35, getAddress(), aMarginHeight);
+ }
+
+ public int SetMarginHeight(int aMarginHeight) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 36, getAddress(), aMarginHeight);
+ }
+
+ public int GetHasFocus(int[] aHasFocus) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 37, getAddress(), aHasFocus);
+ }
+
+ public int SetHasFocus(int aHasFocus) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 38, getAddress(), aHasFocus);
+ }
+
+ public int GetCanvasHasFocus(int[] aCanvasHasFocus) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 39, getAddress(), aCanvasHasFocus);
+ }
+
+ public int SetCanvasHasFocus(int aCanvasHasFocus) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 40, getAddress(), aCanvasHasFocus);
+ }
+
+ public int TabToTreeOwner(int forward, int[] tookFocus) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 41, getAddress(), forward, tookFocus);
+ }
+
+ public static final int BUSY_FLAGS_NONE = 0;
+
+ public static final int BUSY_FLAGS_BUSY = 1;
+
+ public static final int BUSY_FLAGS_BEFORE_PAGE_LOAD = 2;
+
+ public static final int BUSY_FLAGS_PAGE_LOADING = 4;
+
+ public static final int LOAD_CMD_NORMAL = 1;
+
+ public static final int LOAD_CMD_RELOAD = 2;
+
+ public static final int LOAD_CMD_HISTORY = 4;
+
+ public int GetBusyFlags(int[] aBusyFlags) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 42, getAddress(), aBusyFlags);
+ }
+
+ public int GetLoadType(int[] aLoadType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 43, getAddress(), aLoadType);
+ }
+
+ public int SetLoadType(int aLoadType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 44, getAddress(), aLoadType);
+ }
+
+ public int IsBeingDestroyed(int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 45, getAddress(), _retval);
+ }
+
+ public int GetIsExecutingOnLoadHandler(int[] aIsExecutingOnLoadHandler) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 46, getAddress(), aIsExecutingOnLoadHandler);
+ }
+
+ public int GetLayoutHistoryState(int /*long*/[] aLayoutHistoryState) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 47, getAddress(), aLayoutHistoryState);
+ }
+
+ public int SetLayoutHistoryState(int /*long*/ aLayoutHistoryState) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 48, getAddress(), aLayoutHistoryState);
+ }
+
+ public int GetShouldSaveLayoutState(int[] aShouldSaveLayoutState) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 49, getAddress(), aShouldSaveLayoutState);
+ }
+
+ public int GetSecurityUI(int /*long*/[] aSecurityUI) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 50, getAddress(), aSecurityUI);
+ }
+
+ public int SetSecurityUI(int /*long*/ aSecurityUI) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 51, getAddress(), aSecurityUI);
+ }
+
+ public int SuspendRefreshURIs() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 52, getAddress());
+ }
+
+ public int ResumeRefreshURIs() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 53, getAddress());
+ }
+
+ public int BeginRestore(int /*long*/ viewer, int top) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 54, getAddress(), viewer, top);
+ }
+
+ public int FinishRestore() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 55, getAddress());
+ }
+
+ public int GetRestoringDocument(int[] aRestoringDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 56, getAddress(), aRestoringDocument);
+ }
+
+ public int GetUseErrorPages(int[] aUseErrorPages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 57, getAddress(), aUseErrorPages);
+ }
+
+ public int SetUseErrorPages(int aUseErrorPages) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 58, getAddress(), aUseErrorPages);
+ }
+
+ public int GetPreviousTransIndex(int[] aPreviousTransIndex) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 59, getAddress(), aPreviousTransIndex);
+ }
+
+ public int GetLoadedTransIndex(int[] aLoadedTransIndex) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 60, getAddress(), aLoadedTransIndex);
+ }
+
+ public int HistoryPurged(int numEntries) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 61, getAddress(), numEntries);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_2.java
new file mode 100644
index 0000000000..223e9231b1
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFilePicker_2.java
@@ -0,0 +1,118 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIFilePicker_2 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 17;
+
+ public static final String NS_IFILEPICKER_IID_STR =
+ "f2c0e216-5d07-4df4-bbcb-37683077ae7e";
+
+ public static final nsID NS_IFILEPICKER_IID =
+ new nsID(NS_IFILEPICKER_IID_STR);
+
+ public nsIFilePicker_2(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int modeOpen = 0;
+ public static final int modeSave = 1;
+ public static final int modeGetFolder = 2;
+ public static final int modeOpenMultiple = 3;
+ public static final int returnOK = 0;
+ public static final int returnCancel = 1;
+ public static final int returnReplace = 2;
+ public static final int filterAll = 1;
+ public static final int filterHTML = 2;
+ public static final int filterText = 4;
+ public static final int filterImages = 8;
+ public static final int filterXML = 16;
+ public static final int filterXUL = 32;
+ public static final int filterApps = 64;
+
+ public int Init(int /*long*/ parent, int /*long*/ title, int mode) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), parent, title, mode);
+ }
+
+ public int AppendFilters(int filterMask) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), filterMask);
+ }
+
+ public int AppendFilter(int /*long*/ title, int /*long*/ filter) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), title, filter);
+ }
+
+ public int GetDefaultString(int /*long*/ aDefaultString) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aDefaultString);
+ }
+
+ public int SetDefaultString(int /*long*/ aDefaultString) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aDefaultString);
+ }
+
+ public int GetDefaultExtension(int /*long*/ aDefaultExtension) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aDefaultExtension);
+ }
+
+ public int SetDefaultExtension(int /*long*/ aDefaultExtension) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aDefaultExtension);
+ }
+
+ public int GetFilterIndex(int[] aFilterIndex) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aFilterIndex);
+ }
+
+ public int SetFilterIndex(int aFilterIndex) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aFilterIndex);
+ }
+
+ public int GetDisplayDirectory(int /*long*/[] aDisplayDirectory) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aDisplayDirectory);
+ }
+
+ public int SetDisplayDirectory(int /*long*/ aDisplayDirectory) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aDisplayDirectory);
+ }
+
+ public int GetFile(int /*long*/[] aFile) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aFile);
+ }
+
+ public int GetFileURL(int /*long*/[] aFileURL) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aFileURL);
+ }
+
+ public int GetFiles(int /*long*/[] aFiles) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aFiles);
+ }
+
+ public int Show(int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_2.java
new file mode 100644
index 0000000000..d90448a9dc
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_2.java
@@ -0,0 +1,87 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIHelperAppLauncher_2 extends nsICancelable {
+
+ static final int LAST_METHOD_ID = nsICancelable.LAST_METHOD_ID + 11;
+
+ public static final String NS_IHELPERAPPLAUNCHER_IID_STR =
+ "d9a19faf-497b-408c-b995-777d956b72c0";
+
+ public static final nsID NS_IHELPERAPPLAUNCHER_IID =
+ new nsID(NS_IHELPERAPPLAUNCHER_IID_STR);
+
+ public nsIHelperAppLauncher_2(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetMIMEInfo(int /*long*/[] aMIMEInfo) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 1, getAddress(), aMIMEInfo);
+ }
+
+ public int GetSource(int /*long*/[] aSource) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 2, getAddress(), aSource);
+ }
+
+ public int GetSuggestedFileName(int /*long*/ aSuggestedFileName) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 3, getAddress(), aSuggestedFileName);
+ }
+
+ public int SaveToDisk(int /*long*/ aNewFileLocation, int aRememberThisPreference) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 4, getAddress(), aNewFileLocation, aRememberThisPreference);
+ }
+
+ public int LaunchWithApplication(int /*long*/ aApplication, int aRememberThisPreference) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 5, getAddress(), aApplication, aRememberThisPreference);
+ }
+
+ public int SetWebProgressListener(int /*long*/ aWebProgressListener) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 6, getAddress(), aWebProgressListener);
+ }
+
+ public int CloseProgressWindow() {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 7, getAddress());
+ }
+
+ public int GetTargetFile(int /*long*/[] aTargetFile) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 8, getAddress(), aTargetFile);
+ }
+
+ public int GetTargetFileIsExecutable(int[] aTargetFileIsExecutable) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 9, getAddress(), aTargetFileIsExecutable);
+ }
+
+ public int GetTimeDownloadStarted(int /*long*/ aTimeDownloadStarted) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 10, getAddress(), aTimeDownloadStarted);
+ }
+
+ public int GetContentLength(int /*long*/ aContentLength) {
+ return XPCOM.VtblCall(nsICancelable.LAST_METHOD_ID + 11, getAddress(), aContentLength);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java
index 63ed2a3d1d..943870cfa5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch.java
@@ -32,7 +32,7 @@ public class nsIPrefBranch extends nsISupports {
static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 18;
public static final String NS_IPREFBRANCH_IID_STR =
- "56c35506-f14b-11d3-99d3-ddbfac2ccf65";
+ "e0b6e170-691b-11e0-ae3e-0800200c9a66";
public static final nsID NS_IPREFBRANCH_IID =
new nsID(NS_IPREFBRANCH_IID_STR);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch_1_9.java
new file mode 100644
index 0000000000..4e3ac43c18
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrefBranch_1_9.java
@@ -0,0 +1,123 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIPrefBranch_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 18;
+
+ public static final String NS_IPREFBRANCH_IID_STR =
+ "56c35506-f14b-11d3-99d3-ddbfac2ccf65";
+
+ public static final nsID NS_IPREFBRANCH_IID =
+ new nsID(NS_IPREFBRANCH_IID_STR);
+
+ public nsIPrefBranch_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int PREF_INVALID = 0;
+
+ public static final int PREF_STRING = 32;
+
+ public static final int PREF_INT = 64;
+
+ public static final int PREF_BOOL = 128;
+
+ public int GetRoot(int /*long*/[] aRoot) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aRoot);
+ }
+
+ public int GetPrefType(byte[] aPrefName, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aPrefName, _retval);
+ }
+
+ public int GetBoolPref(byte[] aPrefName, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aPrefName, _retval);
+ }
+
+ public int SetBoolPref(byte[] aPrefName, int aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aPrefName, aValue);
+ }
+
+ public int GetCharPref(byte[] aPrefName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aPrefName, _retval);
+ }
+
+ public int SetCharPref(byte[] aPrefName, byte[] aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aPrefName, aValue);
+ }
+
+ public int GetIntPref(byte[] aPrefName, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aPrefName, _retval);
+ }
+
+ public int SetIntPref(byte[] aPrefName, int aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aPrefName, aValue);
+ }
+
+ public int GetComplexValue(byte[] aPrefName, nsID aType, int /*long*/[] aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aPrefName, aType, aValue);
+ }
+
+ public int SetComplexValue(byte[] aPrefName, nsID aType, int /*long*/ aValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aPrefName, aType, aValue);
+ }
+
+ public int ClearUserPref(byte[] aPrefName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aPrefName);
+ }
+
+ public int LockPref(byte[] aPrefName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aPrefName);
+ }
+
+ public int PrefHasUserValue(byte[] aPrefName, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aPrefName, _retval);
+ }
+
+ public int PrefIsLocked(byte[] aPrefName, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aPrefName, _retval);
+ }
+
+ public int UnlockPref(byte[] aPrefName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aPrefName);
+ }
+
+ public int DeleteBranch(byte[] aStartingAt) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aStartingAt);
+ }
+
+ public int GetChildList(byte[] aStartingAt, int[] aCount, int /*long*/[] aChildArray) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aStartingAt, aCount, aChildArray);
+ }
+
+ public int ResetBranch(byte[] aStartingAt) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aStartingAt);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java
index d8c34191a1..4486b3cb27 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal.java
@@ -29,10 +29,10 @@ package org.eclipse.swt.internal.mozilla;
public class nsIPrincipal extends nsISerializable {
- static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + 23;
+ static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + 26;
public static final String NS_IPRINCIPAL_IID_STR =
- "b8268b9a-2403-44ed-81e3-614075c92034";
+ "b406a2db-e547-4c95-b8e2-ad09ecb54ce0";
public static final nsID NS_IPRINCIPAL_IID =
new nsID(NS_IPRINCIPAL_IID_STR);
@@ -58,86 +58,86 @@ public class nsIPrincipal extends nsISerializable {
}
public int GetHashValue(int[] aHashValue) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 3, getAddress(), aHashValue);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 4, getAddress(), aHashValue);
}
public int GetJSPrincipals(int /*long*/ cx, int /*long*/[] _retval) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 4, getAddress(), cx, _retval);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 5, getAddress(), cx, _retval);
}
public int GetSecurityPolicy(int /*long*/[] aSecurityPolicy) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 5, getAddress(), aSecurityPolicy);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 6, getAddress(), aSecurityPolicy);
}
public int SetSecurityPolicy(int /*long*/ aSecurityPolicy) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 6, getAddress(), aSecurityPolicy);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 7, getAddress(), aSecurityPolicy);
}
public int CanEnableCapability(byte[] capability, int /*long*/ _retval) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 7, getAddress(), capability, _retval);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 8, getAddress(), capability, _retval);
}
public int SetCanEnableCapability(byte[] capability, short canEnable) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 8, getAddress(), capability, canEnable);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 9, getAddress(), capability, canEnable);
}
public int IsCapabilityEnabled(byte[] capability, int /*long*/ annotation, int[] _retval) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 9, getAddress(), capability, annotation, _retval);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 10, getAddress(), capability, annotation, _retval);
}
public int EnableCapability(byte[] capability, int /*long*/[] annotation) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 10, getAddress(), capability, annotation);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 11, getAddress(), capability, annotation);
}
public int RevertCapability(byte[] capability, int /*long*/[] annotation) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 11, getAddress(), capability, annotation);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 12, getAddress(), capability, annotation);
}
public int DisableCapability(byte[] capability, int /*long*/[] annotation) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 12, getAddress(), capability, annotation);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 13, getAddress(), capability, annotation);
}
public int GetURI(int /*long*/[] aURI) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 13, getAddress(), aURI);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 14, getAddress(), aURI);
}
public int GetDomain(int /*long*/[] aDomain) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 14, getAddress(), aDomain);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 15, getAddress(), aDomain);
}
public int SetDomain(int /*long*/ aDomain) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 15, getAddress(), aDomain);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 16, getAddress(), aDomain);
}
public int GetOrigin(int /*long*/[] aOrigin) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 16, getAddress(), aOrigin);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 17, getAddress(), aOrigin);
}
public int GetHasCertificate(int[] aHasCertificate) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 17, getAddress(), aHasCertificate);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 18, getAddress(), aHasCertificate);
}
public int GetFingerprint(int /*long*/ aFingerprint) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 18, getAddress(), aFingerprint);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 19, getAddress(), aFingerprint);
}
public int GetPrettyName(int /*long*/ aPrettyName) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 19, getAddress(), aPrettyName);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 20, getAddress(), aPrettyName);
}
public int Subsumes(int /*long*/ other, int[] _retval) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 20, getAddress(), other, _retval);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 21, getAddress(), other, _retval);
}
public int CheckMayLoad(int /*long*/ uri, int report) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 21, getAddress(), uri, report);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 22, getAddress(), uri, report);
}
public int GetSubjectName(int /*long*/ aSubjectName) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 22, getAddress(), aSubjectName);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 23, getAddress(), aSubjectName);
}
public int GetCertificate(int /*long*/[] aCertificate) {
- return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 23, getAddress(), aCertificate);
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 24, getAddress(), aCertificate);
}
} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal_1_9.java
new file mode 100644
index 0000000000..87695da6cb
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrincipal_1_9.java
@@ -0,0 +1,143 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2009 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIPrincipal_1_9 extends nsISerializable {
+
+ static final int LAST_METHOD_ID = nsISerializable.LAST_METHOD_ID + 23;
+
+ public static final String NS_IPRINCIPAL_IID_STR =
+ "b406a2db-e547-4c95-b8e2-ad09ecb54ce0";
+
+ public static final nsID NS_IPRINCIPAL_IID =
+ new nsID(NS_IPRINCIPAL_IID_STR);
+
+ public nsIPrincipal_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int ENABLE_DENIED = 1;
+
+ public static final int ENABLE_UNKNOWN = 2;
+
+ public static final int ENABLE_WITH_USER_PERMISSION = 3;
+
+ public static final int ENABLE_GRANTED = 4;
+
+ public int GetPreferences(int /*long*/[] prefBranch, int /*long*/[] id, int /*long*/[] subjectName, int /*long*/[] grantedList, int /*long*/[] deniedList, int[] isTrusted) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 1, getAddress(), prefBranch, id, subjectName, grantedList, deniedList, isTrusted);
+ }
+
+ public int Equals(int /*long*/ other, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 2, getAddress(), other, _retval);
+ }
+
+ public int GetHashValue(int[] aHashValue) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 3, getAddress(), aHashValue);
+ }
+
+ public int GetJSPrincipals(int /*long*/ cx, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 4, getAddress(), cx, _retval);
+ }
+
+ public int GetSecurityPolicy(int /*long*/[] aSecurityPolicy) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 5, getAddress(), aSecurityPolicy);
+ }
+
+ public int SetSecurityPolicy(int /*long*/ aSecurityPolicy) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 6, getAddress(), aSecurityPolicy);
+ }
+
+ public int CanEnableCapability(byte[] capability, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 7, getAddress(), capability, _retval);
+ }
+
+ public int SetCanEnableCapability(byte[] capability, short canEnable) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 8, getAddress(), capability, canEnable);
+ }
+
+ public int IsCapabilityEnabled(byte[] capability, int /*long*/ annotation, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 9, getAddress(), capability, annotation, _retval);
+ }
+
+ public int EnableCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 10, getAddress(), capability, annotation);
+ }
+
+ public int RevertCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 11, getAddress(), capability, annotation);
+ }
+
+ public int DisableCapability(byte[] capability, int /*long*/[] annotation) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 12, getAddress(), capability, annotation);
+ }
+
+ public int GetURI(int /*long*/[] aURI) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 13, getAddress(), aURI);
+ }
+
+ public int GetDomain(int /*long*/[] aDomain) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 14, getAddress(), aDomain);
+ }
+
+ public int SetDomain(int /*long*/ aDomain) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 15, getAddress(), aDomain);
+ }
+
+ public int GetOrigin(int /*long*/[] aOrigin) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 16, getAddress(), aOrigin);
+ }
+
+ public int GetHasCertificate(int[] aHasCertificate) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 17, getAddress(), aHasCertificate);
+ }
+
+ public int GetFingerprint(int /*long*/ aFingerprint) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 18, getAddress(), aFingerprint);
+ }
+
+ public int GetPrettyName(int /*long*/ aPrettyName) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 19, getAddress(), aPrettyName);
+ }
+
+ public int Subsumes(int /*long*/ other, int[] _retval) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 20, getAddress(), other, _retval);
+ }
+
+ public int CheckMayLoad(int /*long*/ uri, int report) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 21, getAddress(), uri, report);
+ }
+
+ public int GetSubjectName(int /*long*/ aSubjectName) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 22, getAddress(), aSubjectName);
+ }
+
+ public int GetCertificate(int /*long*/[] aCertificate) {
+ return XPCOM.VtblCall(nsISerializable.LAST_METHOD_ID + 23, getAddress(), aCertificate);
+ }
+} \ No newline at end of file
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
new file mode 100644
index 0000000000..11d9397c60
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPrompt.java
@@ -0,0 +1,78 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIPrompt extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 9;
+
+ public static final String NS_IPROMPT_IID_STR =
+ "a63f70c0-148b-11d3-9333-00104ba0fd40";
+
+ public static final nsID NS_IPROMPT_IID =
+ new nsID(NS_IPROMPT_IID_STR);
+
+ public nsIPrompt(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int BUTTON_POS_0 = 1;
+
+ public static final int BUTTON_POS_1 = 256;
+
+ public static final int BUTTON_POS_2 = 65536;
+
+ public static final int BUTTON_TITLE_OK = 1;
+
+ public static final int BUTTON_TITLE_CANCEL = 2;
+
+ public static final int BUTTON_TITLE_YES = 3;
+
+ public static final int BUTTON_TITLE_NO = 4;
+
+ public static final int BUTTON_TITLE_SAVE = 5;
+
+ public static final int BUTTON_TITLE_DONT_SAVE = 6;
+
+ public static final int BUTTON_TITLE_REVERT = 7;
+
+ public static final int BUTTON_TITLE_IS_STRING = 127;
+
+ public static final int BUTTON_POS_0_DEFAULT = 0;
+
+ public static final int BUTTON_POS_1_DEFAULT = 16777216;
+
+ public static final int BUTTON_POS_2_DEFAULT = 33554432;
+
+ public static final int BUTTON_DELAY_ENABLE = 67108864;
+
+ public static final int STD_OK_CANCEL_BUTTONS = 513;
+
+ public static final int STD_YES_NO_BUTTONS = 1027;
+
+}
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
new file mode 100644
index 0000000000..89990b5897
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIPromptFactory.java
@@ -0,0 +1,48 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIPromptFactory extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1;
+
+ public static final String NS_IPROMPTFACTORY_IID_STR =
+ "2532b748-75db-4732-9173-78d3bf34f694";
+
+ public static final nsID NS_IPROMPTFACTORY_IID =
+ new nsID(NS_IPROMPTFACTORY_IID_STR);
+
+ public nsIPromptFactory(int /*long*/ address) {
+ super(address);
+ }
+
+ public int Alert(char[] aDialogTitle, char[] aText) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aDialogTitle, aText);
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_2.java
new file mode 100644
index 0000000000..47abf3b0f7
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIScriptSecurityManager_2.java
@@ -0,0 +1,155 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIScriptSecurityManager_2 extends nsIXPCSecurityManager {
+
+ static final int LAST_METHOD_ID = nsIXPCSecurityManager.LAST_METHOD_ID + 29;
+
+ public static final String NS_ISCRIPTSECURITYMANAGER_IID_STR =
+ "50eda256-4dd2-4c7c-baed-96983910af9f";
+
+ public static final nsID NS_ISCRIPTSECURITYMANAGER_IID =
+ new nsID(NS_ISCRIPTSECURITYMANAGER_IID_STR);
+
+ public nsIScriptSecurityManager_2(int /*long*/ address) {
+ super(address);
+ }
+
+// public int CheckPropertyAccess(int /*long*/ aJSContext, int /*long*/ aJSObject, byte[] aClassName, !ERROR UNKNOWN C TYPE <jsval >! aProperty, int aAction) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 1, getAddress(), aJSContext, aJSObject, aClassName, aProperty, aAction);
+// }
+
+ public int CheckLoadURIFromScript(int /*long*/ cx, int /*long*/ uri) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 2, getAddress(), cx, uri);
+ }
+
+ public static final int STANDARD = 0;
+
+ public static final int LOAD_IS_AUTOMATIC_DOCUMENT_REPLACEMENT = 1;
+
+ public static final int ALLOW_CHROME = 2;
+
+ public static final int DISALLOW_INHERIT_PRINCIPAL = 4;
+
+ public static final int DISALLOW_SCRIPT_OR_DATA = 4;
+
+ public static final int DISALLOW_SCRIPT = 8;
+
+ public int CheckLoadURIWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 3, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURI(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 4, getAddress(), from, uri, flags);
+ }
+
+ public int CheckLoadURIStrWithPrincipal(int /*long*/ aPrincipal, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 5, getAddress(), aPrincipal, uri, flags);
+ }
+
+ public int CheckLoadURIStr(int /*long*/ from, int /*long*/ uri, int flags) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 6, getAddress(), from, uri, flags);
+ }
+
+ public int CheckFunctionAccess(int /*long*/ cx, int /*long*/ funObj, int /*long*/ targetObj) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 7, getAddress(), cx, funObj, targetObj);
+ }
+
+// public int CanExecuteScripts(int /*long*/ cx, int /*long*/ principal, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 8, getAddress(), cx, principal, _retval NS_OUTPARAM);
+// }
+
+// public int GetSubjectPrincipal(int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 9, getAddress(), _retval NS_OUTPARAM);
+// }
+
+ public int GetSystemPrincipal(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 10, getAddress(), _retval);
+ }
+
+// public int GetCertificatePrincipal(int /*long*/ aCertFingerprint, int /*long*/ aSubjectName, int /*long*/ aPrettyName, int /*long*/ aCert, int /*long*/ aURI, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 11, getAddress(), aCertFingerprint, aSubjectName, aPrettyName, aCert, aURI, _retval NS_OUTPARAM);
+// }
+
+// public int GetCodebasePrincipal(int /*long*/ aURI, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 12, getAddress(), aURI, _retval NS_OUTPARAM);
+// }
+
+// public int RequestCapability(int /*long*/ principal, byte[] capability, int /*long*/ _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 13, getAddress(), principal, capability, _retval NS_OUTPARAM);
+// }
+
+// public int IsCapabilityEnabled(byte[] capability, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 14, getAddress(), capability, _retval NS_OUTPARAM);
+// }
+
+ public int EnableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 15, getAddress(), capability);
+ }
+
+ public int RevertCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 16, getAddress(), capability);
+ }
+
+ public int DisableCapability(byte[] capability) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 17, getAddress(), capability);
+ }
+
+// public int SetCanEnableCapability(int /*long*/ certificateFingerprint, byte[] capability, !ERROR UNKNOWN C TYPE <PRInt16 >! canEnable) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 18, getAddress(), certificateFingerprint, capability, canEnable);
+// }
+
+// public int GetObjectPrincipal(int /*long*/ cx, int /*long*/ obj, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 19, getAddress(), cx, obj, _retval NS_OUTPARAM);
+// }
+
+// public int SubjectPrincipalIsSystem(int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 20, getAddress(), _retval NS_OUTPARAM);
+// }
+
+ public int CheckSameOrigin(int /*long*/ aJSContext, int /*long*/ aTargetURI) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 21, getAddress(), aJSContext, aTargetURI);
+ }
+
+ public int CheckSameOriginURI(int /*long*/ aSourceURI, int /*long*/ aTargetURI, int reportError) {
+ return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 22, getAddress(), aSourceURI, aTargetURI, reportError);
+ }
+
+// public int GetPrincipalFromContext(int /*long*/ cx, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 23, getAddress(), cx, _retval NS_OUTPARAM);
+// }
+
+// public int GetChannelPrincipal(int /*long*/ aChannel, int /*long*/[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 24, getAddress(), aChannel, _retval NS_OUTPARAM);
+// }
+
+// public int IsSystemPrincipal(int /*long*/ aPrincipal, int[] _retval NS_OUTPARAM) {
+// return XPCOM.VtblCall(nsIXPCSecurityManager.LAST_METHOD_ID + 25, getAddress(), aPrincipal, _retval NS_OUTPARAM);
+// }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITransfer_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITransfer_2.java
new file mode 100644
index 0000000000..a38e586130
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsITransfer_2.java
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsITransfer_2 extends nsIWebProgressListener2_2 {
+
+ static final int LAST_METHOD_ID = nsIWebProgressListener2_2.LAST_METHOD_ID + 1;
+
+ public static final String NS_ITRANSFER_IID_STR =
+ "3a982955-dc44-422e-8734-8462bf8d2121";
+
+ public static final nsID NS_ITRANSFER_IID =
+ new nsID(NS_ITRANSFER_IID_STR);
+
+ public nsITransfer_2(int /*long*/ address) {
+ super(address);
+ }
+
+ public int Init(int /*long*/ aSource, int /*long*/ aTarget, int /*long*/ aDisplayName, int /*long*/ aMIMEInfo, long startTime, int /*long*/ aTempFile, int /*long*/ aCancelable) {
+ return XPCOM.VtblCall(nsIWebProgressListener2_2.LAST_METHOD_ID + 1, getAddress(), aSource, aTarget, aDisplayName, aMIMEInfo, startTime, aTempFile, aCancelable);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java
index 6c4bc12033..9f550e50c5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI.java
@@ -29,10 +29,10 @@ package org.eclipse.swt.internal.mozilla;
public class nsIURI extends nsISupports {
- static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 26;
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 30;
public static final String NS_IURI_IID_STR =
- "07a22cc0-0ce5-11d3-9331-00104ba0fd40";
+ "12120b20-0929-40e9-88cf-6e08766e8b23";
public static final nsID NS_IURI_IID =
new nsID(NS_IURI_IID_STR);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI_1_9.java
new file mode 100644
index 0000000000..cafdf24ce5
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIURI_1_9.java
@@ -0,0 +1,147 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2008 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIURI_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 26;
+
+ public static final String NS_IURI_IID_STR =
+ "07a22cc0-0ce5-11d3-9331-00104ba0fd40";
+
+ public static final nsID NS_IURI_IID =
+ new nsID(NS_IURI_IID_STR);
+
+ public nsIURI_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetSpec(int /*long*/ aSpec) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aSpec);
+ }
+
+ public int SetSpec(int /*long*/ aSpec) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aSpec);
+ }
+
+ public int GetPrePath(int /*long*/ aPrePath) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aPrePath);
+ }
+
+ public int GetScheme(int /*long*/ aScheme) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aScheme);
+ }
+
+ public int SetScheme(int /*long*/ aScheme) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aScheme);
+ }
+
+ public int GetUserPass(int /*long*/ aUserPass) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aUserPass);
+ }
+
+ public int SetUserPass(int /*long*/ aUserPass) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aUserPass);
+ }
+
+ public int GetUsername(int /*long*/ aUsername) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aUsername);
+ }
+
+ public int SetUsername(int /*long*/ aUsername) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aUsername);
+ }
+
+ public int GetPassword(int /*long*/ aPassword) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aPassword);
+ }
+
+ public int SetPassword(int /*long*/ aPassword) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aPassword);
+ }
+
+ public int GetHostPort(int /*long*/ aHostPort) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aHostPort);
+ }
+
+ public int SetHostPort(int /*long*/ aHostPort) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aHostPort);
+ }
+
+ public int GetHost(int /*long*/ aHost) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aHost);
+ }
+
+ public int SetHost(int /*long*/ aHost) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aHost);
+ }
+
+ public int GetPort(int[] aPort) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aPort);
+ }
+
+ public int SetPort(int aPort) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aPort);
+ }
+
+ public int GetPath(int /*long*/ aPath) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), aPath);
+ }
+
+ public int SetPath(int /*long*/ aPath) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress(), aPath);
+ }
+
+ public int Equals(int /*long*/ other, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), other, _retval);
+ }
+
+ public int SchemeIs(byte[] scheme, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), scheme, _retval);
+ }
+
+ public int Clone(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), _retval);
+ }
+
+ public int Resolve(int /*long*/ relativePath, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), relativePath, _retval);
+ }
+
+ public int GetAsciiSpec(int /*long*/ aAsciiSpec) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aAsciiSpec);
+ }
+
+ public int GetAsciiHost(int /*long*/ aAsciiHost) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), aAsciiHost);
+ }
+
+ public int GetOriginCharset(int /*long*/ aOriginCharset) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 26, getAddress(), aOriginCharset);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java
index 22113bdafd..dbc1852ad4 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser.java
@@ -29,10 +29,10 @@ package org.eclipse.swt.internal.mozilla;
public class nsIWebBrowser extends nsISupports {
- static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 7;
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 9;
public static final String NS_IWEBBROWSER_IID_STR =
- "69e5df00-7b8b-11d3-af61-00a024ffc08c";
+ "33e9d001-caab-4ba9-8961-54902f197202";
public static final nsID NS_IWEBBROWSER_IID =
new nsID(NS_IWEBBROWSER_IID_STR);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser_1_9.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser_1_9.java
new file mode 100644
index 0000000000..c6d94a69af
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebBrowser_1_9.java
@@ -0,0 +1,71 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003, 2005 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIWebBrowser_1_9 extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 7;
+
+ public static final String NS_IWEBBROWSER_IID_STR =
+ "69e5df00-7b8b-11d3-af61-00a024ffc08c";
+
+ public static final nsID NS_IWEBBROWSER_IID =
+ new nsID(NS_IWEBBROWSER_IID_STR);
+
+ public nsIWebBrowser_1_9(int /*long*/ address) {
+ super(address);
+ }
+
+ public int AddWebBrowserListener(int /*long*/ aListener, nsID aIID) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aListener, aIID);
+ }
+
+ public int RemoveWebBrowserListener(int /*long*/ aListener, nsID aIID) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aListener, aIID);
+ }
+
+ public int GetContainerWindow(int /*long*/[] aContainerWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aContainerWindow);
+ }
+
+ public int SetContainerWindow(int /*long*/ aContainerWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aContainerWindow);
+ }
+
+ public int GetParentURIContentListener(int /*long*/[] aParentURIContentListener) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParentURIContentListener);
+ }
+
+ public int SetParentURIContentListener(int /*long*/ aParentURIContentListener) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aParentURIContentListener);
+ }
+
+ public int GetContentDOMWindow(int /*long*/[] aContentDOMWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aContentDOMWindow);
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2_2.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2_2.java
new file mode 100644
index 0000000000..775f302ee9
--- /dev/null
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIWebProgressListener2_2.java
@@ -0,0 +1,47 @@
+/* ***** BEGIN LICENSE BLOCK *****
+ * Version: MPL 1.1
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Original Code is Mozilla Communicator client code, released March 31, 1998.
+ *
+ * The Initial Developer of the Original Code is
+ * Netscape Communications Corporation.
+ * Portions created by Netscape are Copyright (C) 1998-1999
+ * Netscape Communications Corporation. All Rights Reserved.
+ *
+ * Contributor(s):
+ *
+ * IBM
+ * - Binding to permit interfacing between Mozilla and SWT
+ * - Copyright (C) 2003 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIWebProgressListener2_2 extends nsIWebProgressListener {
+
+ static final int LAST_METHOD_ID = nsIWebProgressListener.LAST_METHOD_ID + 2;
+
+ public static final String NS_IWEBPROGRESSLISTENER2_IID_STR =
+ "dde39de0-e4e0-11da-8ad9-0800200c9a66";
+
+ public static final nsID NS_IWEBPROGRESSLISTENER2_IID =
+ new nsID(NS_IWEBPROGRESSLISTENER2_IID_STR);
+
+ public nsIWebProgressListener2_2(int /*long*/ address) {
+ super(address);
+ }
+
+ public int OnProgressChange64(int /*long*/ aWebProgress, int /*long*/ aRequest, long aCurSelfProgress, long aMaxSelfProgress, long aCurTotalProgress, long aMaxTotalProgress) {
+ return XPCOM.VtblCall(nsIWebProgressListener.LAST_METHOD_ID + 1, getAddress(), aWebProgress, aRequest, aCurSelfProgress, aMaxSelfProgress, aCurTotalProgress, aMaxTotalProgress);
+ }
+}
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 230aacb629..38bc595a0b 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,6 +73,10 @@ static String getLibraryName () {
return "libxpcom.so"; //$NON-NLS-1$
}
+String getJSLibraryName_Pre2() {
+ return "libxpcom.so";
+}
+
static char[] mbcsToWcs (String codePage, byte [] buffer) {
return Converter.mbcsToWcs (codePage, buffer);
}
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 aee87e76c1..67e33a157e 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
@@ -90,10 +90,14 @@ int /*long*/ getHandle () {
return browser.handle;
}
-String getJSLibraryName () {
+String getJSLibraryName_Pre2 () {
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 */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
index 3173424d0a..ed7f08d1cc 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/library/make_macosx.mak
@@ -40,8 +40,8 @@ SWT_OBJECTS = swt.o c.o c_stats.o callback.o
SWTPI_OBJECTS = swt.o os.o os_structs.o os_stats.o os_custom.o
XULRUNNER_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o xpcominit.o xpcominit_structs.o xpcominit_stats.o
-XULRUNNERCFLAGS = -c -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -I /System/Library/Frameworks/JavaVM.framework/Headers \
- -Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include
+XULRUNNERCFLAGS = -c -fshort-wchar -Wall $(ARCHS) -DSWT_VERSION=$(SWT_VERSION) $(NATIVE_STATS) $(SWT_DEBUG) -DUSE_ASSEMBLER -DCOCOA -I /System/Library/Frameworks/JavaVM.framework/Headers \
+ -Wno-non-virtual-dtor -include ${XULRUNNER_SDK}/include/mozilla-config.h -I${XULRUNNER_SDK}/include
XULRUNNERLFLAGS = $(LFLAGS)
all: $(SWT_LIB) $(SWTPI_LIB) $(AWT_LIB) $(XULRUNNER_LIB)
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 ad5b1cae27..90a332ded5 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,6 +67,7 @@ GLXLIBS = -lGL -lGLU -lm
#NATIVE_STATS = -DNATIVE_STATS
MOZILLACFLAGS = -O \
+ -std=gnu++0x \
-DSWT_VERSION=$(SWT_VERSION) \
$(NATIVE_STATS) \
-DMOZILLA_STRICT_API=1 \
diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
index 43c88c8b45..46bdd84071 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
+++ b/bundles/org.eclipse.swt/Eclipse SWT PI/win32/library/make_win32.mak
@@ -58,6 +58,7 @@ XULRUNNER_LIBS = Advapi32.lib $(XULRUNNER_SDK)\lib\xpcomglue.lib
XULRUNNER_OBJS = xpcom.obj xpcom_custom.obj xpcom_structs.obj xpcom_stats.obj xpcominit.obj xpcominit_structs.obj xpcominit_stats.obj
MOZILLACFLAGS = -c \
+ -Zc:wchar_t \
-O1 \
-DSWT_VERSION=$(SWT_VERSION) \
$(NATIVE_STATS) \