diff options
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org')
11 files changed, 1156 insertions, 66 deletions
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 150635f476..69e41c1c42 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 @@ -46,7 +46,7 @@ class Mozilla extends WebBrowser { int chromeFlags = nsIWebBrowserChrome.CHROME_DEFAULT; int registerFunctionsOnState = 0; int refCount, lastKeyCode, lastCharCode, authCount; - int /*long*/ request; + int /*long*/ request, badCertRequest; Point location, size; boolean visible, isChild, ignoreDispose, isRetrievingBadCert, isViewingErrorPage, ignoreAllMessages, untrustedText; boolean updateLastNavigateUrl; @@ -83,7 +83,8 @@ class Mozilla extends WebBrowser { static final char SEPARATOR_OS = System.getProperty ("file.separator").charAt (0); //$NON-NLS-1$ static final String ABOUT_BLANK = "about:blank"; //$NON-NLS-1$ static final String DISPOSE_LISTENER_HOOKED = "org.eclipse.swt.browser.Mozilla.disposeListenerHooked"; //$NON-NLS-1$ - static final String HEADER_CONTENTTYPE = "Content-Type"; //$NON-NLS-1 + static final String HEADER_CONTENTLENGTH = "content-length"; //$NON-NLS-1 + static final String HEADER_CONTENTTYPE = "content-type"; //$NON-NLS-1 static final String MIMETYPE_FORMURLENCODED = "application/x-www-form-urlencoded"; //$NON-NLS-1$ static final String PREFIX_JAVASCRIPT = "javascript:"; //$NON-NLS-1$ static final String PREFERENCE_CHARSET = "intl.charset.default"; //$NON-NLS-1$ @@ -953,7 +954,56 @@ public void create (Composite parent, int style) { break; } case SWT.Resize: onResize (); break; - case SWT.FocusIn: Activate (); break; + case SWT.FocusIn: { + Activate (); + + /* if tabbing onto a page for the first time then full-Browser focus ring should be shown */ + + int /*long*/[] result = new int /*long*/[1]; + int rc = XPCOM.NS_GetServiceManager (result); + if (rc != XPCOM.NS_OK) error (rc); + if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); + nsIServiceManager serviceManager = new nsIServiceManager (result[0]); + result[0] = 0; + byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_FOCUSMANAGER_CONTRACTID, true); + rc = serviceManager.GetServiceByContractID (aContractID, nsIFocusManager.NS_IFOCUSMANAGER_IID, result); + serviceManager.Release (); + + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIFocusManager focusManager = new nsIFocusManager (result[0]); + result[0] = 0; + rc = focusManager.GetFocusedElement (result); + if (rc == XPCOM.NS_OK) { + if (result[0] != 0) { + new nsISupports (result[0]).Release (); + result[0] = 0; + } else { + /* show full browser focus ring */ + rc = webBrowser.GetContentDOMWindow (result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIDOMWindow domWindow = new nsIDOMWindow (result[0]); + result[0] = 0; + rc = domWindow.GetDocument (result); + domWindow.Release (); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIDOMDocument domDocument = new nsIDOMDocument (result[0]); + result[0] = 0; + rc = domDocument.GetDocumentElement (result); + domDocument.Release (); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIDOMElement domElement = new nsIDOMElement (result[0]); + result[0] = 0; + rc = focusManager.SetFocus (domElement.getAddress (), nsIFocusManager.FLAG_BYKEY); + domElement.Release (); + } + } + } + } + } + focusManager.Release (); + } + break; + } case SWT.Activate: Activate (); break; case SWT.Deactivate: { Display display = event.display; @@ -2513,6 +2563,10 @@ void onDispose (Display display) { locationListeners = oldLocationListeners; } + if (badCertRequest != 0) { + new nsISupports (badCertRequest).Release (); + } + int rc = webBrowser.RemoveWebBrowserListener (weakReference.getAddress (), nsIWebProgressListener.NS_IWEBPROGRESSLISTENER_IID); if (rc != XPCOM.NS_OK) error (rc); @@ -2592,6 +2646,150 @@ void Deactivate () { webBrowserFocus.Release (); } +void navigate (int /*long*/ requestHandle) { + nsIRequest request = new nsIRequest (requestHandle); + + /* get the request post data, if any */ + int /*long*/[] result = new int /*long*/[1]; + byte[] postData = null; + final Vector headers = new Vector (); + int rc = request.QueryInterface (nsIUploadChannel.NS_IUPLOADCHANNEL_IID, result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIUploadChannel uploadChannel = new nsIUploadChannel (result[0]); + result[0] = 0; + rc = uploadChannel.GetUploadStream (result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIInputStream inputStream = new nsIInputStream (result[0]); + result[0] = 0; + rc = inputStream.QueryInterface (nsISeekableStream.NS_ISEEKABLESTREAM_IID, result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsISeekableStream seekableStream = new nsISeekableStream (result[0]); + result[0] = 0; + long[] initialOffset = new long[1]; + rc = seekableStream.Tell (initialOffset); + if (rc == XPCOM.NS_OK) { + rc = seekableStream.Seek (nsISeekableStream.NS_SEEK_SET, 0); + if (rc == XPCOM.NS_OK) { + int[] available = new int[1]; + rc = inputStream.Available (available); + if (rc == XPCOM.NS_OK) { + int length = available[0]; + byte[] bytes = new byte[length]; + int[] retVal = new int[1]; + rc = inputStream.Read (bytes, length, retVal); + if (rc == XPCOM.NS_OK) { + int start = 0; + for (int i = 0; i < length; i++) { + if (bytes[i] == 13) { + byte[] current = new byte[i - start]; + System.arraycopy (bytes, start, current, 0, i - start); + String string = new String (current).trim (); + if (string.length () != 0) { + headers.add (string); + } else { + start = i + 2; /* skip \r\n */ + postData = new byte[length - start]; + System.arraycopy (bytes, start, postData, 0, length - start); + break; + } + start = i; + } + } + } + } + } + seekableStream.Seek (nsISeekableStream.NS_SEEK_SET, initialOffset[0]); + } + seekableStream.Release (); + } + inputStream.Release (); + } + uploadChannel.Release (); + } + + /* get the request headers */ + XPCOMObject visitor = new XPCOMObject (new int[] {2, 0, 0, 2}) { + int refCount = 0; + public int /*long*/ method0 (int /*long*/[] args) { + /* QueryInterface */ + int /*long*/ riid = args[0]; + int /*long*/ ppvObject = args[1]; + 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) || guid.Equals (nsIHttpHeaderVisitor.NS_IHTTPHEADERVISITOR_IID)) { + XPCOM.memmove (ppvObject, new int /*long*/[] {getAddress ()}, C.PTR_SIZEOF); + refCount++; + return XPCOM.NS_OK; + } + XPCOM.memmove (ppvObject, new int /*long*/[] {0}, C.PTR_SIZEOF); + return XPCOM.NS_ERROR_NO_INTERFACE; + } + public int /*long*/ method1 (int /*long*/[] args) { + /* AddRef */ + return ++refCount; + } + public int /*long*/ method2 (int /*long*/[] args) { + /* Release */ + if (--refCount == 0) dispose (); + return refCount; + } + public int /*long*/ method3 (int /*long*/[] args) { + /* VisitHeader */ + int /*long*/ aHeader = args[0]; + int /*long*/ aValue = args[1]; + + int length = XPCOM.nsEmbedCString_Length (aHeader); + int /*long*/ buffer = XPCOM.nsEmbedCString_get (aHeader); + byte[] dest = new byte[length]; + XPCOM.memmove (dest, buffer, length); + String header = new String (dest); + + length = XPCOM.nsEmbedCString_Length (aValue); + buffer = XPCOM.nsEmbedCString_get (aValue); + dest = new byte[length]; + XPCOM.memmove (dest, buffer, length); + String value = new String (dest); + + headers.add(header + ':' + value); + return XPCOM.NS_OK; + } + }; + + new nsISupports (visitor.getAddress ()).AddRef (); + rc = request.QueryInterface (nsIHttpChannel.NS_IHTTPCHANNEL_IID, result); + if (rc == XPCOM.NS_OK && result[0] != 0) { + nsIHttpChannel httpChannel = new nsIHttpChannel (result[0]); + result[0] = 0; + httpChannel.VisitRequestHeaders (visitor.getAddress ()); + httpChannel.Release (); + } + new nsISupports (visitor.getAddress ()).Release (); + + String[] headersArray = null; + int size = headers.size (); + if (size > 0) { + headersArray = new String[size]; + headers.copyInto (headersArray); + } + + /* a request's name often (but not always) is its url */ + String url = lastNavigateURL; + int /*long*/ name = XPCOM.nsEmbedCString_new (); + rc = request.GetName (name); + if (rc == XPCOM.NS_OK) { + int length = XPCOM.nsEmbedCString_Length (name); + int /*long*/ buffer = XPCOM.nsEmbedCString_get (name); + byte[] bytes = new byte[length]; + XPCOM.memmove (bytes, buffer, length); + String value = new String (bytes); + if (value.indexOf (":/") != -1) url = value; //$NON-NLS-1$ + } + XPCOM.nsEmbedCString_delete (name); + + setUrl (url, postData, headersArray); +} + void onResize () { Rectangle rect = browser.getClientArea (); int width = Math.max (1, rect.width); @@ -2781,6 +2979,14 @@ public boolean setText (String html, boolean trusted) { } public boolean setUrl (String url, String postData, String[] headers) { + byte[] postDataBytes = null; + if (postData != null) { + postDataBytes = MozillaDelegate.wcsToMbcs (null, postData, false); + } + return setUrl (url, postDataBytes, headers); +} + +boolean setUrl (String url, byte[] postData, String[] headers) { htmlBytes = null; int /*long*/[] result = new int /*long*/[1]; @@ -2813,18 +3019,35 @@ public boolean setUrl (String url, String postData, String[] headers) { componentManager.Release(); if (rc == XPCOM.NS_OK && result[0] != 0) { /* nsIMIMEInputStream is not in mozilla 1.4 */ - byte[] bytes = MozillaDelegate.wcsToMbcs (null, postData, false); - dataStream = new InputStream (bytes); + dataStream = new InputStream (postData); dataStream.AddRef (); postDataStream = new nsIMIMEInputStream (result[0]); rc = postDataStream.SetData (dataStream.getAddress ()); if (rc != XPCOM.NS_OK) error (rc); - rc = postDataStream.SetAddContentLength (1); - if (rc != XPCOM.NS_OK) error (rc); - byte[] name = MozillaDelegate.wcsToMbcs (null, HEADER_CONTENTTYPE, true); - byte[] value = MozillaDelegate.wcsToMbcs (null, MIMETYPE_FORMURLENCODED, true); - rc = postDataStream.AddHeader (name, value); + + boolean foundLength = false; + boolean foundType = false; + if (headers != null) { + for (int i = 0; i < headers.length; i++) { + int index = headers[i].indexOf (':'); + if (index != -1) { + String name = headers[i].substring (0, index).trim ().toLowerCase (); + if (name.equals (HEADER_CONTENTLENGTH)) { + foundLength = true; + } else if (name.equals (HEADER_CONTENTTYPE)) { + foundType = true; + } + } + } + } + rc = postDataStream.SetAddContentLength (foundLength ? 0 : 1); if (rc != XPCOM.NS_OK) error (rc); + if (!foundType) { + byte[] name = MozillaDelegate.wcsToMbcs (null, HEADER_CONTENTTYPE, true); + byte[] value = MozillaDelegate.wcsToMbcs (null, MIMETYPE_FORMURLENCODED, true); + rc = postDataStream.AddHeader (name, value); + if (rc != XPCOM.NS_OK) error (rc); + } } result[0] = 0; } @@ -3182,7 +3405,6 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF * callbacks on the channel so that our nsIBadCertListener2 will be invoked. */ if (isRetrievingBadCert) { - isRetrievingBadCert = false; nsIRequest request = new nsIRequest (aRequest); int rc = request.QueryInterface (nsIChannel.NS_ICHANNEL_IID, result); if (rc != XPCOM.NS_OK) error (rc); @@ -3214,6 +3436,37 @@ int OnStateChange (int /*long*/ aWebProgress, int /*long*/ aRequest, int aStateF registerFunctionsOnState = nsIWebProgressListener.STATE_TRANSFERRING; updateLastNavigateUrl = true; } else if ((aStateFlags & nsIWebProgressListener.STATE_STOP) != 0) { + if (isRetrievingBadCert) { + isRetrievingBadCert = false; + return XPCOM.NS_OK; + } + + /* + * If a site with a bad certificate is being encountered for the first time + * then store the request for future reference, set the isRetrievingBadCert + * flag and re-navigate to the site so that notification callbacks can be + * hooked on it to get its certificate info. + */ + switch (aStatus) { + case XPCOM.SSL_ERROR_BAD_CERT_DOMAIN: + case XPCOM.SEC_ERROR_CA_CERT_INVALID: + case XPCOM.SEC_ERROR_EXPIRED_CERTIFICATE: + case XPCOM.SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE: + case XPCOM.SEC_ERROR_INADEQUATE_KEY_USAGE: + case XPCOM.SEC_ERROR_UNKNOWN_ISSUER: + case XPCOM.SEC_ERROR_UNTRUSTED_CERT: + case XPCOM.SEC_ERROR_UNTRUSTED_ISSUER: { + new nsISupports (aRequest).AddRef (); + if (badCertRequest != 0) { + new nsISupports (badCertRequest).Release (); + } + badCertRequest = aRequest; + isRetrievingBadCert = true; + navigate (aRequest); + return XPCOM.NS_OK; + } + } + /* * If this page's nsIDOMWindow handle is still in unhookedDOMWindows then * add its DOM listeners now. It's possible for this to happen since @@ -3954,7 +4207,7 @@ int OnStartURIOpen (int /*long*/ aURI, int /*long*/ retval) { if (value.indexOf ("aboutCertError.xhtml") != -1 || (isViewingErrorPage && value.indexOf ("javascript:showSecuritySection") != -1)) { //$NON-NLS-1$ //$NON-NLS-2$ XPCOM.memmove (retval, new int[] {1}, 4); /* PRBool */ isRetrievingBadCert = true; - setUrl (lastNavigateURL, null, null); + setUrl (lastNavigateURL, (byte[])null, null); return XPCOM.NS_OK; } isViewingErrorPage = value.indexOf ("netError.xhtml") != -1; //$NON-NLS-1$ @@ -4616,33 +4869,35 @@ int NotifyCertProblem (int /*long*/ socketInfo, int /*long*/ status, int /*long* browser.getDisplay().asyncExec(new Runnable() { public void run() { if (browser.isDisposed ()) return; - if (!url.equals (lastNavigateURL)) return; /* user has navigated elsewhere */ - - String message = Compatibility.getMessage ("SWT_InvalidCert_Message", new String[] {urlPort}); //$NON-NLS-1$ - if (new PromptDialog (browser.getShell ()).invalidCert (browser, message, finalProblems, cert)) { - int /*long*/[] result = new int /*long*/[1]; - int rc = XPCOM.NS_GetServiceManager (result); - if (rc != XPCOM.NS_OK) error (rc); - if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); - - nsIServiceManager serviceManager = new nsIServiceManager (result[0]); - result[0] = 0; - byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CERTOVERRIDE_CONTRACTID, true); - rc = serviceManager.GetServiceByContractID (aContractID, nsICertOverrideService.NS_ICERTOVERRIDESERVICE_IID, result); - if (rc != XPCOM.NS_OK) error (rc); - if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); - serviceManager.Release (); - - nsICertOverrideService overrideService = new nsICertOverrideService (result[0]); - result[0] = 0; - byte[] hostBytes = MozillaDelegate.wcsToMbcs (null, host, false); - int /*long*/ hostString = XPCOM.nsEmbedCString_new (hostBytes, hostBytes.length); - rc = overrideService.RememberValidityOverride (hostString, port, cert.getAddress (), finalFlags, 1); - browser.setUrl (url); - XPCOM.nsEmbedCString_delete (hostString); - overrideService.Release (); + if (url.equals (lastNavigateURL)) { + String message = Compatibility.getMessage ("SWT_InvalidCert_Message", new String[] {urlPort}); //$NON-NLS-1$ + if (new PromptDialog (browser.getShell ()).invalidCert (browser, message, finalProblems, cert)) { + int /*long*/[] result = new int /*long*/[1]; + int rc = XPCOM.NS_GetServiceManager (result); + if (rc != XPCOM.NS_OK) error (rc); + if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); + + nsIServiceManager serviceManager = new nsIServiceManager (result[0]); + result[0] = 0; + byte[] aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CERTOVERRIDE_CONTRACTID, true); + rc = serviceManager.GetServiceByContractID (aContractID, nsICertOverrideService.NS_ICERTOVERRIDESERVICE_IID, result); + if (rc != XPCOM.NS_OK) error (rc); + if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); + serviceManager.Release (); + + nsICertOverrideService overrideService = new nsICertOverrideService (result[0]); + result[0] = 0; + byte[] hostBytes = MozillaDelegate.wcsToMbcs (null, host, false); + int /*long*/ hostString = XPCOM.nsEmbedCString_new (hostBytes, hostBytes.length); + rc = overrideService.RememberValidityOverride (hostString, port, cert.getAddress (), finalFlags, 1); + navigate (badCertRequest); + XPCOM.nsEmbedCString_delete (hostString); + overrideService.Release (); + } } cert.Release (); + new nsISupports (badCertRequest).Release (); + badCertRequest = 0; } }); 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 7f1d718a43..c641a2409b 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 @@ -21,17 +21,6 @@ class PromptService2 { XPCOMObject promptService2; int refCount = 0; - static final String[] certErrorCodes = new String[] { - "ssl_error_bad_cert_domain", - "sec_error_ca_cert_invalid", - "sec_error_expired_certificate", - "sec_error_expired_issuer_certificate", - "sec_error_inadequate_key_usage", - "sec_error_unknown_issuer", - "sec_error_untrusted_cert", - "sec_error_untrusted_issuer", - }; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$ //$NON-NLS-6$ //$NON-NLS-7$ //$NON-NLS-8$ - PromptService2 () { createCOMInterfaces (); } @@ -173,22 +162,12 @@ int Alert (int /*long*/ aParent, int /*long*/ aDialogTitle, int /*long*/ aText) String textLabel = new String (dest); /* - * If mozilla is showing its errors with dialogs (as opposed to pages) then the only - * opportunity to detect that a page has an invalid certificate, without receiving - * all notification callbacks on the channel, is to detect the displaying of an alert - * whose message contains an internal cert error code. If a such a message is - * detected then instead of showing it, re-navigate to the page with the invalid - * certificate so that the browser's nsIBadCertListener2 will be invoked. + * 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) { - for (int i = 0; i < certErrorCodes.length; i++) { - if (textLabel.indexOf (certErrorCodes[i]) != -1) { - Mozilla mozilla = (Mozilla)browser.webBrowser; - mozilla.isRetrievingBadCert = true; - browser.setUrl (mozilla.lastNavigateURL); - return XPCOM.NS_OK; - } - } + Mozilla mozilla = (Mozilla)browser.webBrowser; + if (mozilla.isRetrievingBadCert) return XPCOM.NS_OK; } Shell shell = browser == null ? new Shell () : browser.getShell (); 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 3d8d084526..a59b118957 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 @@ -70,6 +70,7 @@ public class XPCOM extends C { public static final String NS_DOMSERIALIZER_CONTRACTID = "@mozilla.org/xmlextras/xmlserializer;1"; //$NON-NLS-1$ public static final String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;1"; //$NON-NLS-1$ public static final String NS_FILEPICKER_CONTRACTID = "@mozilla.org/filepicker;1"; //$NON-NLS-1$ + public static final String NS_FOCUSMANAGER_CONTRACTID = "@mozilla.org/focus-manager;1"; //$NON-NLS-1$ public static final String NS_HELPERAPPLAUNCHERDIALOG_CONTRACTID = "@mozilla.org/helperapplauncherdialog;1"; //$NON-NLS-1$ public static final String NS_MEMORY_CONTRACTID = "@mozilla.org/xpcom/memory-service;1"; //$NON-NLS-1$ public static final String NS_MIMEINPUTSTREAM_CONTRACTID = "@mozilla.org/network/mime-input-stream;1"; //$NON-NLS-1$ @@ -132,6 +133,14 @@ public class XPCOM extends C { public static final int NS_ERROR_HTMLPARSER_UNRESOLVEDDTD = 0x804e03f3; public static final int NS_ERROR_FILE_NOT_FOUND = 0x80520012; public static final int NS_ERROR_FILE_UNRECOGNIZED_PATH = 0x80520001; + public static final int SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE = 0x805A1FE2; + public static final int SEC_ERROR_CA_CERT_INVALID = 0x805A1FDC; + public static final int SEC_ERROR_EXPIRED_CERTIFICATE = 0x805A1FF5; + public static final int SEC_ERROR_INADEQUATE_KEY_USAGE = 0x805A1FA6; + public static final int SEC_ERROR_UNKNOWN_ISSUER = 0x805A1FF3; + public static final int SEC_ERROR_UNTRUSTED_CERT = 0x805A1FEB; + public static final int SEC_ERROR_UNTRUSTED_ISSUER = 0x805A1FEC; + public static final int SSL_ERROR_BAD_CERT_DOMAIN = 0x805A2FF4; public static final native int nsDynamicFunctionLoad_sizeof (); @@ -663,6 +672,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1) lock.unlock(); } } +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long arg1) { + lock.lock(); + try { + return _VtblCall(fnNumber, ppVtbl, arg0, arg1); + } finally { + lock.unlock(); + } +} static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1); static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1) { lock.lock(); @@ -690,8 +708,17 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg lock.unlock(); } } -static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long [] arg1); -static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long [] arg1) { +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long[] arg1); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, long[] arg1) { + lock.lock(); + try { + return _VtblCall(fnNumber, ppVtbl, arg0, arg1); + } finally { + lock.unlock(); + } +} +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long[] arg1); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long[] arg1) { lock.lock(); try { return _VtblCall(fnNumber, ppVtbl, arg0, arg1); @@ -1116,8 +1143,8 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg lock.unlock(); } } -static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long [] arg2); -static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long [] arg2) { +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2) { lock.lock(); try { return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2); @@ -1639,6 +1666,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, lock.unlock(); } } +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2, long[] arg3); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1, long[] arg2, long[] arg3) { + lock.lock(); + try { + return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3); + } finally { + lock.unlock(); + } +} static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int[] arg2, int[] arg3); static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int[] arg2, int[] arg3) { lock.lock(); @@ -1685,6 +1721,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, lock.unlock(); } } +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int[] arg4); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int arg1, int arg2, int arg3, int[] arg4) { + lock.lock(); + try { + return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4); + } finally { + lock.unlock(); + } +} static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4); static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, int[] arg1, int[] arg2, int[] arg3, int[] arg4) { lock.lock(); @@ -1776,6 +1821,15 @@ static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, int arg1 lock.unlock(); } } +static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int arg2, int arg3, long[] arg4); +static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, long arg0, long arg1, int arg2, int arg3, long[] arg4) { + lock.lock(); + try { + return _VtblCall(fnNumber, ppVtbl, arg0, arg1, arg2, arg3, arg4); + } finally { + lock.unlock(); + } +} static final native int _VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5); static final int VtblCall(int fnNumber, int /*long*/ ppVtbl, int arg0, byte[] arg1, byte[] arg2, byte[] arg3, int arg4, int[] arg5) { diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.java new file mode 100644 index 0000000000..662613c0b7 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMDocument.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) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMDocument extends nsIDOMNode {
+
+ static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + 17;
+
+ public static final String NS_IDOMDOCUMENT_IID_STR =
+ "a6cf9075-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMDOCUMENT_IID =
+ new nsID(NS_IDOMDOCUMENT_IID_STR);
+
+ public nsIDOMDocument(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetDoctype(int /*long*/[] aDoctype) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aDoctype);
+ }
+
+ public int GetImplementation(int /*long*/[] aImplementation) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), aImplementation);
+ }
+
+ public int GetDocumentElement(int /*long*/[] aDocumentElement) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), aDocumentElement);
+ }
+
+ public int CreateElement(int /*long*/ tagName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), tagName, _retval);
+ }
+
+ public int CreateDocumentFragment(int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), _retval);
+ }
+
+ public int CreateTextNode(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), data, _retval);
+ }
+
+ public int CreateComment(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), data, _retval);
+ }
+
+ public int CreateCDATASection(int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), data, _retval);
+ }
+
+ public int CreateProcessingInstruction(int /*long*/ target, int /*long*/ data, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), target, data, _retval);
+ }
+
+ public int CreateAttribute(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), name, _retval);
+ }
+
+ public int CreateEntityReference(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), name, _retval);
+ }
+
+ public int GetElementsByTagName(int /*long*/ tagname, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), tagname, _retval);
+ }
+
+ public int ImportNode(int /*long*/ importedNode, int deep, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), importedNode, deep, _retval);
+ }
+
+ public int CreateElementNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 14, getAddress(), namespaceURI, qualifiedName, _retval);
+ }
+
+ public int CreateAttributeNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 15, getAddress(), namespaceURI, qualifiedName, _retval);
+ }
+
+ public int GetElementsByTagNameNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 16, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int GetElementById(int /*long*/ elementId, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 17, getAddress(), elementId, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java new file mode 100644 index 0000000000..2116d320d4 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMElement.java @@ -0,0 +1,107 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMElement extends nsIDOMNode {
+
+ static final int LAST_METHOD_ID = nsIDOMNode.LAST_METHOD_ID + 16;
+
+ public static final String NS_IDOMELEMENT_IID_STR =
+ "a6cf9078-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMELEMENT_IID =
+ new nsID(NS_IDOMELEMENT_IID_STR);
+
+ public nsIDOMElement(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetTagName(int /*long*/ aTagName) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 1, getAddress(), aTagName);
+ }
+
+ public int GetAttribute(int /*long*/ name, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 2, getAddress(), name, _retval);
+ }
+
+ public int SetAttribute(int /*long*/ name, int /*long*/ value) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 3, getAddress(), name, value);
+ }
+
+ public int RemoveAttribute(int /*long*/ name) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 4, getAddress(), name);
+ }
+
+ public int GetAttributeNode(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 5, getAddress(), name, _retval);
+ }
+
+ public int SetAttributeNode(int /*long*/ newAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 6, getAddress(), newAttr, _retval);
+ }
+
+ public int RemoveAttributeNode(int /*long*/ oldAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 7, getAddress(), oldAttr, _retval);
+ }
+
+ public int GetElementsByTagName(int /*long*/ name, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 8, getAddress(), name, _retval);
+ }
+
+ public int GetAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/ _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 9, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int SetAttributeNS(int /*long*/ namespaceURI, int /*long*/ qualifiedName, int /*long*/ value) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 10, getAddress(), namespaceURI, qualifiedName, value);
+ }
+
+ public int RemoveAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 11, getAddress(), namespaceURI, localName);
+ }
+
+ public int GetAttributeNodeNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 12, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int SetAttributeNodeNS(int /*long*/ newAttr, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 13, getAddress(), newAttr, _retval);
+ }
+
+ public int GetElementsByTagNameNS(int /*long*/ namespaceURI, int /*long*/ localName, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 14, getAddress(), namespaceURI, localName, _retval);
+ }
+
+ public int HasAttribute(int /*long*/ name, int[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 15, getAddress(), name, _retval);
+ }
+
+ public int HasAttributeNS(int /*long*/ namespaceURI, int /*long*/ localName, int[] _retval) {
+ return XPCOM.VtblCall(nsIDOMNode.LAST_METHOD_ID + 16, getAddress(), namespaceURI, localName, _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java new file mode 100644 index 0000000000..9ec806a3ad --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIDOMNode.java @@ -0,0 +1,167 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIDOMNode extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 25;
+
+ public static final String NS_IDOMNODE_IID_STR =
+ "a6cf907c-15b3-11d2-932e-00805f8add32";
+
+ public static final nsID NS_IDOMNODE_IID =
+ new nsID(NS_IDOMNODE_IID_STR);
+
+ public nsIDOMNode(int /*long*/ address) {
+ super(address);
+ }
+
+ public static final int ELEMENT_NODE = 1;
+
+ public static final int ATTRIBUTE_NODE = 2;
+
+ public static final int TEXT_NODE = 3;
+
+ public static final int CDATA_SECTION_NODE = 4;
+
+ public static final int ENTITY_REFERENCE_NODE = 5;
+
+ public static final int ENTITY_NODE = 6;
+
+ public static final int PROCESSING_INSTRUCTION_NODE = 7;
+
+ public static final int COMMENT_NODE = 8;
+
+ public static final int DOCUMENT_NODE = 9;
+
+ public static final int DOCUMENT_TYPE_NODE = 10;
+
+ public static final int DOCUMENT_FRAGMENT_NODE = 11;
+
+ public static final int NOTATION_NODE = 12;
+
+ public int GetNodeName(int /*long*/ aNodeName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aNodeName);
+ }
+
+ public int GetNodeValue(int /*long*/ aNodeValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aNodeValue);
+ }
+
+ public int SetNodeValue(int /*long*/ aNodeValue) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aNodeValue);
+ }
+
+ public int GetNodeType(short[] aNodeType) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aNodeType);
+ }
+
+ public int GetParentNode(int /*long*/[] aParentNode) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aParentNode);
+ }
+
+ public int GetChildNodes(int /*long*/[] aChildNodes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), aChildNodes);
+ }
+
+ public int GetFirstChild(int /*long*/[] aFirstChild) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aFirstChild);
+ }
+
+ public int GetLastChild(int /*long*/[] aLastChild) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aLastChild);
+ }
+
+ public int GetPreviousSibling(int /*long*/[] aPreviousSibling) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aPreviousSibling);
+ }
+
+ public int GetNextSibling(int /*long*/[] aNextSibling) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aNextSibling);
+ }
+
+ public int GetAttributes(int /*long*/[] aAttributes) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aAttributes);
+ }
+
+ public int GetOwnerDocument(int /*long*/[] aOwnerDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aOwnerDocument);
+ }
+
+ public int InsertBefore(int /*long*/ newChild, int /*long*/ refChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), newChild, refChild, _retval);
+ }
+
+ public int ReplaceChild(int /*long*/ newChild, int /*long*/ oldChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), newChild, oldChild, _retval);
+ }
+
+ public int RemoveChild(int /*long*/ oldChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), oldChild, _retval);
+ }
+
+ public int AppendChild(int /*long*/ newChild, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), newChild, _retval);
+ }
+
+ public int HasChildNodes(int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), _retval);
+ }
+
+ public int CloneNode(int deep, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 18, getAddress(), deep, _retval);
+ }
+
+ public int Normalize() {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 19, getAddress());
+ }
+
+ public int IsSupported(int /*long*/ feature, int /*long*/ version, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 20, getAddress(), feature, version, _retval);
+ }
+
+ public int GetNamespaceURI(int /*long*/ aNamespaceURI) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 21, getAddress(), aNamespaceURI);
+ }
+
+ public int GetPrefix(int /*long*/ aPrefix) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 22, getAddress(), aPrefix);
+ }
+
+ public int SetPrefix(int /*long*/ aPrefix) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 23, getAddress(), aPrefix);
+ }
+
+ public int GetLocalName(int /*long*/ aLocalName) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 24, getAddress(), aLocalName);
+ }
+
+ public int HasAttributes(int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 25, getAddress(), _retval);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java new file mode 100644 index 0000000000..cf15868a10 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIFocusManager.java @@ -0,0 +1,139 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved.
+ *
+ * ***** END LICENSE BLOCK ***** */
+package org.eclipse.swt.internal.mozilla;
+
+public class nsIFocusManager extends nsISupports {
+
+ static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 17;
+
+ public static final String NS_IFOCUSMANAGER_IID_STR =
+ "cd6040a8-243f-412a-8a16-0bf2aa1083b9";
+
+ public static final nsID NS_IFOCUSMANAGER_IID =
+ new nsID(NS_IFOCUSMANAGER_IID_STR);
+
+ public nsIFocusManager(int /*long*/ address) {
+ super(address);
+ }
+
+ public int GetActiveWindow(int /*long*/[] aActiveWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aActiveWindow);
+ }
+
+ public int SetActiveWindow(int /*long*/ aActiveWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aActiveWindow);
+ }
+
+ public int GetFocusedWindow(int /*long*/[] aFocusedWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress(), aFocusedWindow);
+ }
+
+ public int SetFocusedWindow(int /*long*/ aFocusedWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 4, getAddress(), aFocusedWindow);
+ }
+
+ public int GetFocusedElement(int /*long*/[] aFocusedElement) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 5, getAddress(), aFocusedElement);
+ }
+
+ public int GetLastFocusMethod(int /*long*/ window, int[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 6, getAddress(), window, _retval);
+ }
+
+ public int SetFocus(int /*long*/ aElement, int aFlags) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 7, getAddress(), aElement, aFlags);
+ }
+
+ public int MoveFocus(int /*long*/ aWindow, int /*long*/ aStartElement, int aType, int aFlags, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 8, getAddress(), aWindow, aStartElement, aType, aFlags, _retval);
+ }
+
+ public int ClearFocus(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 9, getAddress(), aWindow);
+ }
+
+ public int GetFocusedElementForWindow(int /*long*/ aWindow, int aDeep, int /*long*/[] aFocusedWindow, int /*long*/[] _retval) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 10, getAddress(), aWindow, aDeep, aFocusedWindow, _retval);
+ }
+
+ public int MoveCaretToFocus(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 11, getAddress(), aWindow);
+ }
+
+ public static final int FLAG_RAISE = 1;
+
+ public static final int FLAG_NOSCROLL = 2;
+
+ public static final int FLAG_NOSWITCHFRAME = 4;
+
+ public static final int FLAG_BYMOUSE = 4096;
+
+ public static final int FLAG_BYKEY = 8192;
+
+ public static final int FLAG_BYMOVEFOCUS = 16384;
+
+ public static final int MOVEFOCUS_FORWARD = 1;
+
+ public static final int MOVEFOCUS_BACKWARD = 2;
+
+ public static final int MOVEFOCUS_FORWARDDOC = 3;
+
+ public static final int MOVEFOCUS_BACKWARDDOC = 4;
+
+ public static final int MOVEFOCUS_FIRST = 5;
+
+ public static final int MOVEFOCUS_LAST = 6;
+
+ public static final int MOVEFOCUS_ROOT = 7;
+
+ public static final int MOVEFOCUS_CARET = 8;
+
+ public int WindowRaised(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 12, getAddress(), aWindow);
+ }
+
+ public int WindowLowered(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 13, getAddress(), aWindow);
+ }
+
+ public int ContentRemoved(int /*long*/ aDocument, int /*long*/ aElement) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 14, getAddress(), aDocument, aElement);
+ }
+
+ public int WindowShown(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 15, getAddress(), aWindow);
+ }
+
+ public int WindowHidden(int /*long*/ aWindow) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 16, getAddress(), aWindow);
+ }
+
+ public int FireDelayedEvents(int /*long*/ aDocument) {
+ return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 17, getAddress(), aDocument);
+ }
+}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java new file mode 100644 index 0000000000..eb19f2a696 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpChannel.java @@ -0,0 +1,119 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved. + * + * ***** END LICENSE BLOCK ***** */ +package org.eclipse.swt.internal.mozilla; + +public class nsIHttpChannel extends nsIChannel { + + static final int LAST_METHOD_ID = nsIChannel.LAST_METHOD_ID + 19; + + public static final String NS_IHTTPCHANNEL_IID_STR = + "9277fe09-f0cc-4cd9-bbce-581dd94b0260"; + + public static final nsID NS_IHTTPCHANNEL_IID = + new nsID(NS_IHTTPCHANNEL_IID_STR); + + public nsIHttpChannel(int /*long*/ address) { + super(address); + } + + public int GetRequestMethod(int /*long*/ aRequestMethod) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 1, getAddress(), aRequestMethod); + } + + public int SetRequestMethod(int /*long*/ aRequestMethod) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 2, getAddress(), aRequestMethod); + } + + public int GetReferrer(int /*long*/[] aReferrer) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 3, getAddress(), aReferrer); + } + + public int SetReferrer(int /*long*/ aReferrer) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 4, getAddress(), aReferrer); + } + + public int GetRequestHeader(int /*long*/ aHeader, int /*long*/ _retval) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 5, getAddress(), aHeader, _retval); + } + + public int SetRequestHeader(int /*long*/ aHeader, int /*long*/ aValue, int aMerge) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 6, getAddress(), aHeader, aValue, aMerge); + } + + public int VisitRequestHeaders(int /*long*/ aVisitor) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 7, getAddress(), aVisitor); + } + + public int GetAllowPipelining(int[] aAllowPipelining) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 8, getAddress(), aAllowPipelining); + } + + public int SetAllowPipelining(int aAllowPipelining) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 9, getAddress(), aAllowPipelining); + } + + public int GetRedirectionLimit(int[] aRedirectionLimit) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 10, getAddress(), aRedirectionLimit); + } + + public int SetRedirectionLimit(int aRedirectionLimit) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 11, getAddress(), aRedirectionLimit); + } + + public int GetResponseStatus(int[] aResponseStatus) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 12, getAddress(), aResponseStatus); + } + + public int GetResponseStatusText(int /*long*/ aResponseStatusText) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 13, getAddress(), aResponseStatusText); + } + + public int GetRequestSucceeded(int[] aRequestSucceeded) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 14, getAddress(), aRequestSucceeded); + } + + public int GetResponseHeader(int /*long*/ header, int /*long*/ _retval) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 15, getAddress(), header, _retval); + } + + public int SetResponseHeader(int /*long*/ header, int /*long*/ value, int merge) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 16, getAddress(), header, value, merge); + } + + public int VisitResponseHeaders(int /*long*/ aVisitor) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 17, getAddress(), aVisitor); + } + + public int IsNoStoreResponse(int[] _retval) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 18, getAddress(), _retval); + } + + public int IsNoCacheResponse(int[] _retval) { + return XPCOM.VtblCall(nsIChannel.LAST_METHOD_ID + 19, getAddress(), _retval); + } +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.java new file mode 100644 index 0000000000..556a5e22c8 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHttpHeaderVisitor.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) 2011 IBM Corp. All Rights Reserved. + * + * ***** END LICENSE BLOCK ***** */ +package org.eclipse.swt.internal.mozilla; + +public class nsIHttpHeaderVisitor extends nsISupports { + + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 1; + + public static final String NS_IHTTPHEADERVISITOR_IID_STR = + "0cf40717-d7c1-4a94-8c1e-d6c9734101bb"; + + public static final nsID NS_IHTTPHEADERVISITOR_IID = + new nsID(NS_IHTTPHEADERVISITOR_IID_STR); + + public nsIHttpHeaderVisitor(int /*long*/ address) { + super(address); + } + + public int VisitHeader(int /*long*/ aHeader, int /*long*/ aValue) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aHeader, aValue); + } +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java new file mode 100644 index 0000000000..32a49203cf --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsISeekableStream.java @@ -0,0 +1,61 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved. + * + * ***** END LICENSE BLOCK ***** */ +package org.eclipse.swt.internal.mozilla; + +public class nsISeekableStream extends nsISupports { + + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 3; + + public static final String NS_ISEEKABLESTREAM_IID_STR = + "8429d350-1040-4661-8b71-f2a6ba455980"; + + public static final nsID NS_ISEEKABLESTREAM_IID = + new nsID(NS_ISEEKABLESTREAM_IID_STR); + + public nsISeekableStream(int /*long*/ address) { + super(address); + } + + public static final int NS_SEEK_SET = 0; + + public static final int NS_SEEK_CUR = 1; + + public static final int NS_SEEK_END = 2; + + public int Seek(int whence, long offset) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), whence, offset); + } + + public int Tell(long[] _retval) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), _retval); + } + + public int SetEOF() { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 3, getAddress()); + } +} diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java new file mode 100644 index 0000000000..08807366f7 --- /dev/null +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIUploadChannel.java @@ -0,0 +1,51 @@ +/* ***** 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) 2011 IBM Corp. All Rights Reserved. + * + * ***** END LICENSE BLOCK ***** */ +package org.eclipse.swt.internal.mozilla; + +public class nsIUploadChannel extends nsISupports { + + static final int LAST_METHOD_ID = nsISupports.LAST_METHOD_ID + 2; + + public static final String NS_IUPLOADCHANNEL_IID_STR = + "ddf633d8-e9a4-439d-ad88-de636fd9bb75"; + + public static final nsID NS_IUPLOADCHANNEL_IID = + new nsID(NS_IUPLOADCHANNEL_IID_STR); + + public nsIUploadChannel(int /*long*/ address) { + super(address); + } + + public int SetUploadStream(int /*long*/ aStream, int /*long*/ aContentType, int aContentLength) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 1, getAddress(), aStream, aContentType, aContentLength); + } + + public int GetUploadStream(int /*long*/[] aUploadStream) { + return XPCOM.VtblCall(nsISupports.LAST_METHOD_ID + 2, getAddress(), aUploadStream); + } +} |