Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Cornu2005-01-19 20:21:30 +0000
committerChristophe Cornu2005-01-19 20:21:30 +0000
commit977861c61bc7bc0808170b19ff4787d865de7d4a (patch)
treeb01f878962e05e31857153a59f6f89f88d56fd51
parent8cfffe7a73723fb6adf7d6ac64da8609b6e8f40a (diff)
downloadeclipse.platform.swt-977861c61bc7bc0808170b19ff4787d865de7d4a.tar.gz
eclipse.platform.swt-977861c61bc7bc0808170b19ff4787d865de7d4a.tar.xz
eclipse.platform.swt-977861c61bc7bc0808170b19ff4787d865de7d4a.zip
61384 backport from 3.1 HEADv3063d
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/AppFileLocProvider.java198
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java26
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/AppFileLocProvider.java198
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java11
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/PromptService.java22
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp123
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT PI/gtk/library/make_linux.mak33
9 files changed, 73 insertions, 570 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/AppFileLocProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/AppFileLocProvider.java
deleted file mode 100644
index 12f8f62a55..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/AppFileLocProvider.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.mozilla.*;
-
-class AppFileLocProvider {
- XPCOMObject supports;
- XPCOMObject directoryServiceProvider;
- XPCOMObject directoryServiceProvider2;
- int refCount = 0;
- String mozillaPath;
- String grePath;
-
-public AppFileLocProvider() {
- mozillaPath = GRE.mozillaPath;
- grePath = GRE.grePath;
- if (mozillaPath == null) Browser.error(XPCOM.NS_ERROR_FAILURE);
- 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 method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- };
-
- directoryServiceProvider = new XPCOMObject(new int[]{2, 0, 0, 3}){
- public int method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- public int method3(int[] args) {return getFile(args[0], args[1], args[2]);}
- };
-
- directoryServiceProvider2 = new XPCOMObject(new int[]{2, 0, 0, 3, 2}){
- public int method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- public int method3(int[] args) {return getFile(args[0], args[1], args[2]);}
- public int method4(int[] args) {return getFiles(args[0], args[1]);}
- };
-}
-
-void disposeCOMInterfaces() {
- if (supports != null) {
- supports.dispose();
- supports = null;
- }
- if (directoryServiceProvider != null) {
- directoryServiceProvider.dispose();
- directoryServiceProvider = null;
- }
- if (directoryServiceProvider2 != null) {
- directoryServiceProvider2.dispose();
- directoryServiceProvider2 = null;
- }
-}
-
-int getAddress() {
- return directoryServiceProvider.getAddress();
-}
-
-int queryInterface(int riid, int 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[] {supports.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
- if (guid.Equals(nsIDirectoryServiceProvider.NS_IDIRECTORYSERVICEPROVIDER_IID)) {
- XPCOM.memmove(ppvObject, new int[] {directoryServiceProvider.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
- if (guid.Equals(nsIDirectoryServiceProvider2.NS_IDIRECTORYSERVICEPROVIDER2_IID)) {
- XPCOM.memmove(ppvObject, new int[] {directoryServiceProvider2.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
-
- XPCOM.memmove(ppvObject, new int[] {0}, 4);
- return XPCOM.NS_ERROR_NO_INTERFACE;
-}
-
-int Release() {
- refCount--;
- if (refCount == 0) disposeCOMInterfaces();
- return refCount;
-}
-
-/* nsIDirectoryServiceProvider2 implementation */
-
-int getFiles(int str, int nsISimpleEnumerator) {
- int rc = XPCOM.NS_ERROR_FAILURE;
- int length = XPCOM.strlen(str);
- byte[] dest = new byte[length];
- XPCOM.memmove(dest, str, length);
- String prop = new String(dest);
- XPCOM.memmove(nsISimpleEnumerator, new int[] {0}, 4);
- nsILocalFile localFile = null;
- if (XPCOM.NS_APP_PLUGINS_DIR_LIST.equals(prop)) {
- if (mozillaPath == null) return XPCOM.NS_ERROR_FAILURE;
- if (mozillaPath.length() <= 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(mozillaPath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) localFile = new nsILocalFile(result[0]);
- nsString node = new nsString(XPCOM.PLUGINS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- if (rc == XPCOM.NS_OK) {
- int[] retVal = new int[1];
- rc = XPCOM.NS_NewSingletonEnumerator(localFile.getAddress(), retVal);
- if (rc == XPCOM.NS_OK && retVal[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) XPCOM.memmove(nsISimpleEnumerator, retVal, 4);
- }
- if (localFile != null) localFile.Release();
- return rc;
-}
-
-/* nsIDirectoryServiceProvider implementation */
-
-int getFile(int str, int persistent, int nsFile) {
- int rc = XPCOM.NS_ERROR_FAILURE;
- int length = XPCOM.strlen(str);
- byte[] dest = new byte[length];
- XPCOM.memmove(dest, str, length);
- String prop = new String(dest);
- XPCOM.memmove(persistent, new int[] {1}, 4);
- XPCOM.memmove(nsFile, new int[] {0}, 4);
- nsILocalFile localFile = null;
- if (XPCOM.NS_GRE_DIR.equals(prop) || XPCOM.NS_GRE_COMPONENT_DIR.equals(prop)) {
- if (grePath == null || grePath.length() == 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(grePath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) {
- localFile = new nsILocalFile(result[0]);
- if (XPCOM.NS_GRE_COMPONENT_DIR.equals(prop)) {
- nsString node = new nsString(XPCOM.COMPONENTS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- }
- }
- else if (XPCOM.NS_XPCOM_INIT_CURRENT_PROCESS_DIR.equals(prop) ||
- XPCOM.NS_OS_CURRENT_PROCESS_DIR.equals(prop) ||
- XPCOM.NS_XPCOM_COMPONENT_DIR.equals(prop) ||
- XPCOM.NS_APP_USER_PROFILE_50_DIR.equals(prop)) {
- if (mozillaPath == null || mozillaPath.length() == 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(mozillaPath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) {
- localFile = new nsILocalFile(result[0]);
- if (XPCOM.NS_XPCOM_COMPONENT_DIR.equals(prop)) {
- nsString node = new nsString(XPCOM.COMPONENTS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- }
- }
- if (localFile != null && XPCOM.NS_OK == rc) {
- int[] result = new int[1];
- int rc1 = localFile.QueryInterface(nsIFile.NS_IFILE_IID, result);
- if (rc1 != XPCOM.NS_OK || result[0] == 0) rc1 = XPCOM.NS_NOINTERFACE;
- else XPCOM.memmove(nsFile, result, 4);
- }
- if (localFile != null) localFile.Release();
-
- return rc;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
index 43b0136055..f046b9766b 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/Browser.java
@@ -67,7 +67,6 @@ public class Browser extends Composite {
VisibilityWindowListener[] visibilityWindowListeners = new VisibilityWindowListener[0];
static nsIAppShell AppShell;
- static AppFileLocProvider LocProvider;
static PromptService PromptService;
static WindowCreator WindowCreator;
static int BrowserCount;
@@ -144,26 +143,11 @@ public Browser(Composite parent, int style) {
path.dispose();
if (rc != XPCOM.NS_OK) error(rc);
if (retVal[0] == 0) error(XPCOM.NS_ERROR_NULL_POINTER);
-
- /*
- * Feature on Mozilla. On Windows, the mozilla libraries are split
- * up into 2 locations indicated by the GRE and Mozilla paths. The
- * default nsIDirectoryServiceProvider only works when the libraries
- * are in the same folder. The workaround is to provide a custom
- * nsIDirectoryServiceProvider on this platform. It provides the
- * 2 locations set by Mozilla in the Windows registry.
- */
- if (IsWindows) {
- LocProvider = new AppFileLocProvider();
- LocProvider.AddRef();
- }
nsILocalFile localFile = new nsILocalFile(retVal[0]);
- rc = XPCOM.NS_InitEmbedding(localFile.getAddress(), IsWindows ? LocProvider.getAddress() : 0);
+ rc = XPCOM.NS_InitEmbedding(localFile.getAddress(), 0);
localFile.Release();
if (rc != XPCOM.NS_OK) {
- if (LocProvider != null) LocProvider.Release();
- LocProvider = null;
dispose();
SWT.error(SWT.ERROR_NO_HANDLES, null, " [NS_InitEmbedding "+mozillaPath+" error "+rc+"]");
}
@@ -1715,7 +1699,7 @@ int OnStatusChange(int aWebProgress, int aRequest, int aStatus, int aMessage) {
StatusTextEvent event = new StatusTextEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(aMessage);
+ int length = XPCOM.strlen_PRUnichar(aMessage);
char[] dest = new char[length];
XPCOM.memmove(dest, aMessage, length * 2);
event.text = new String(dest);
@@ -1735,7 +1719,7 @@ int SetStatus(int statusType, int status) {
StatusTextEvent event = new StatusTextEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(status);
+ int length = XPCOM.strlen_PRUnichar(status);
char[] dest = new char[length];
XPCOM.memmove(dest, status, length * 2);
String string = new String(dest);
@@ -1855,7 +1839,7 @@ int SetTitle(int aTitle) {
TitleEvent event = new TitleEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(aTitle);
+ int length = XPCOM.strlen_PRUnichar(aTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, aTitle, length * 2);
event.title = new String(dest);
@@ -1982,7 +1966,7 @@ int SetParentContentListener(int aParentContentListener) {
/* nsITooltipListener */
int OnShowTooltip(int aXCoords, int aYCoords, int aTipText) {
- int length = XPCOM.nsCRT_strlen_PRUnichar(aTipText);
+ int length = XPCOM.strlen_PRUnichar(aTipText);
char[] dest = new char[length];
XPCOM.memmove(dest, aTipText, length * 2);
String text = new String(dest);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java
index d7d50c0f8f..6643c3b146 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/motif/org/eclipse/swt/browser/PromptService.java
@@ -150,7 +150,7 @@ String getLabel(int buttonFlag, int index, int buttonTitle) {
case nsIPromptService.BUTTON_TITLE_SAVE : label = SWT.getMessage("SWT_Save"); break; //$NON-NLS-1$
case nsIPromptService.BUTTON_TITLE_YES : label = SWT.getMessage("SWT_Yes"); break; //$NON-NLS-1$
case nsIPromptService.BUTTON_TITLE_IS_STRING : {
- int length = XPCOM.nsCRT_strlen_PRUnichar(buttonTitle);
+ int length = XPCOM.strlen_PRUnichar(buttonTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, buttonTitle, length * 2);
label = new String(dest);
@@ -164,12 +164,12 @@ String getLabel(int buttonFlag, int index, int buttonTitle) {
public int Alert(int parent, int dialogTitle, int text) {
Browser browser = getBrowser(parent);
- int length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ int length = XPCOM.strlen_PRUnichar(dialogTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
String titleLabel = new String(dest);
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
String textLabel = new String(dest);
@@ -196,19 +196,19 @@ public int ConfirmCheck(int parent, int dialogTitle, int text, int checkMsg, int
public int ConfirmEx(int parent, int dialogTitle, int text, int buttonFlags, int button0Title, int button1Title, int button2Title, int checkMsg, int checkValue, int _retval) {
Browser browser = getBrowser(parent);
- int length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ int length = XPCOM.strlen_PRUnichar(dialogTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
String titleLabel = new String(dest);
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
String textLabel = new String(dest);
String checkLabel = null;
if (checkMsg != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(checkMsg);
+ length = XPCOM.strlen_PRUnichar(checkMsg);
dest = new char[length];
XPCOM.memmove(dest, checkMsg, length * 2);
checkLabel = new String(dest);
@@ -238,7 +238,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
char[] dest;
int length;
if (dialogTitle != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ length = XPCOM.strlen_PRUnichar(dialogTitle);
dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
titleLabel = new String(dest);
@@ -246,7 +246,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
titleLabel = SWT.getMessage("SWT_Prompt"); //$NON-NLS-1$
}
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
textLabel = new String(dest);
@@ -254,7 +254,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
int[] userAddr = new int[1];
XPCOM.memmove(userAddr, username, 4);
if (userAddr[0] != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(userAddr[0]);
+ length = XPCOM.strlen_PRUnichar(userAddr[0]);
dest = new char[length];
XPCOM.memmove(dest, userAddr[0], length * 2);
userLabel[0] = new String(dest);
@@ -263,14 +263,14 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
int[] passAddr = new int[1];
XPCOM.memmove(passAddr, password, 4);
if (passAddr[0] != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(passAddr[0]);
+ length = XPCOM.strlen_PRUnichar(passAddr[0]);
dest = new char[length];
XPCOM.memmove(dest, passAddr[0], length * 2);
passLabel[0] = new String(dest);
}
if (checkMsg != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(checkMsg);
+ length = XPCOM.strlen_PRUnichar(checkMsg);
dest = new char[length];
XPCOM.memmove(dest, checkMsg, length * 2);
checkLabel = new String(dest);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/AppFileLocProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/AppFileLocProvider.java
deleted file mode 100644
index 12f8f62a55..0000000000
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/AppFileLocProvider.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Common Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/cpl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.swt.browser;
-
-import org.eclipse.swt.internal.mozilla.*;
-
-class AppFileLocProvider {
- XPCOMObject supports;
- XPCOMObject directoryServiceProvider;
- XPCOMObject directoryServiceProvider2;
- int refCount = 0;
- String mozillaPath;
- String grePath;
-
-public AppFileLocProvider() {
- mozillaPath = GRE.mozillaPath;
- grePath = GRE.grePath;
- if (mozillaPath == null) Browser.error(XPCOM.NS_ERROR_FAILURE);
- 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 method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- };
-
- directoryServiceProvider = new XPCOMObject(new int[]{2, 0, 0, 3}){
- public int method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- public int method3(int[] args) {return getFile(args[0], args[1], args[2]);}
- };
-
- directoryServiceProvider2 = new XPCOMObject(new int[]{2, 0, 0, 3, 2}){
- public int method0(int[] args) {return queryInterface(args[0], args[1]);}
- public int method1(int[] args) {return AddRef();}
- public int method2(int[] args) {return Release();}
- public int method3(int[] args) {return getFile(args[0], args[1], args[2]);}
- public int method4(int[] args) {return getFiles(args[0], args[1]);}
- };
-}
-
-void disposeCOMInterfaces() {
- if (supports != null) {
- supports.dispose();
- supports = null;
- }
- if (directoryServiceProvider != null) {
- directoryServiceProvider.dispose();
- directoryServiceProvider = null;
- }
- if (directoryServiceProvider2 != null) {
- directoryServiceProvider2.dispose();
- directoryServiceProvider2 = null;
- }
-}
-
-int getAddress() {
- return directoryServiceProvider.getAddress();
-}
-
-int queryInterface(int riid, int 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[] {supports.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
- if (guid.Equals(nsIDirectoryServiceProvider.NS_IDIRECTORYSERVICEPROVIDER_IID)) {
- XPCOM.memmove(ppvObject, new int[] {directoryServiceProvider.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
- if (guid.Equals(nsIDirectoryServiceProvider2.NS_IDIRECTORYSERVICEPROVIDER2_IID)) {
- XPCOM.memmove(ppvObject, new int[] {directoryServiceProvider2.getAddress()}, 4);
- AddRef();
- return XPCOM.NS_OK;
- }
-
- XPCOM.memmove(ppvObject, new int[] {0}, 4);
- return XPCOM.NS_ERROR_NO_INTERFACE;
-}
-
-int Release() {
- refCount--;
- if (refCount == 0) disposeCOMInterfaces();
- return refCount;
-}
-
-/* nsIDirectoryServiceProvider2 implementation */
-
-int getFiles(int str, int nsISimpleEnumerator) {
- int rc = XPCOM.NS_ERROR_FAILURE;
- int length = XPCOM.strlen(str);
- byte[] dest = new byte[length];
- XPCOM.memmove(dest, str, length);
- String prop = new String(dest);
- XPCOM.memmove(nsISimpleEnumerator, new int[] {0}, 4);
- nsILocalFile localFile = null;
- if (XPCOM.NS_APP_PLUGINS_DIR_LIST.equals(prop)) {
- if (mozillaPath == null) return XPCOM.NS_ERROR_FAILURE;
- if (mozillaPath.length() <= 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(mozillaPath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) localFile = new nsILocalFile(result[0]);
- nsString node = new nsString(XPCOM.PLUGINS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- if (rc == XPCOM.NS_OK) {
- int[] retVal = new int[1];
- rc = XPCOM.NS_NewSingletonEnumerator(localFile.getAddress(), retVal);
- if (rc == XPCOM.NS_OK && retVal[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) XPCOM.memmove(nsISimpleEnumerator, retVal, 4);
- }
- if (localFile != null) localFile.Release();
- return rc;
-}
-
-/* nsIDirectoryServiceProvider implementation */
-
-int getFile(int str, int persistent, int nsFile) {
- int rc = XPCOM.NS_ERROR_FAILURE;
- int length = XPCOM.strlen(str);
- byte[] dest = new byte[length];
- XPCOM.memmove(dest, str, length);
- String prop = new String(dest);
- XPCOM.memmove(persistent, new int[] {1}, 4);
- XPCOM.memmove(nsFile, new int[] {0}, 4);
- nsILocalFile localFile = null;
- if (XPCOM.NS_GRE_DIR.equals(prop) || XPCOM.NS_GRE_COMPONENT_DIR.equals(prop)) {
- if (grePath == null || grePath.length() == 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(grePath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) {
- localFile = new nsILocalFile(result[0]);
- if (XPCOM.NS_GRE_COMPONENT_DIR.equals(prop)) {
- nsString node = new nsString(XPCOM.COMPONENTS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- }
- }
- else if (XPCOM.NS_XPCOM_INIT_CURRENT_PROCESS_DIR.equals(prop) ||
- XPCOM.NS_OS_CURRENT_PROCESS_DIR.equals(prop) ||
- XPCOM.NS_XPCOM_COMPONENT_DIR.equals(prop) ||
- XPCOM.NS_APP_USER_PROFILE_50_DIR.equals(prop)) {
- if (mozillaPath == null || mozillaPath.length() == 0) return XPCOM.NS_ERROR_FAILURE;
- int[] result = new int[1];
- nsString path = new nsString(mozillaPath);
- rc = XPCOM.NS_NewLocalFile(path.getAddress(), true, result);
- path.dispose();
- if (rc == XPCOM.NS_OK && result[0] == 0) rc = XPCOM.NS_ERROR_NULL_POINTER;
- if (rc == XPCOM.NS_OK) {
- localFile = new nsILocalFile(result[0]);
- if (XPCOM.NS_XPCOM_COMPONENT_DIR.equals(prop)) {
- nsString node = new nsString(XPCOM.COMPONENTS_DIR_NAME);
- rc = localFile.Append(node.getAddress());
- node.dispose();
- }
- }
- }
- if (localFile != null && XPCOM.NS_OK == rc) {
- int[] result = new int[1];
- int rc1 = localFile.QueryInterface(nsIFile.NS_IFILE_IID, result);
- if (rc1 != XPCOM.NS_OK || result[0] == 0) rc1 = XPCOM.NS_NOINTERFACE;
- else XPCOM.memmove(nsFile, result, 4);
- }
- if (localFile != null) localFile.Release();
-
- return rc;
-}
-}
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java
index 7f88fc5788..ba7724e236 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/Browser.java
@@ -66,7 +66,6 @@ public class Browser extends Composite {
VisibilityWindowListener[] visibilityWindowListeners = new VisibilityWindowListener[0];
static nsIAppShell AppShell;
- static AppFileLocProvider LocProvider;
static PromptService PromptService;
static WindowCreator WindowCreator;
static int BrowserCount;
@@ -136,8 +135,6 @@ public Browser(Composite parent, int style) {
rc = XPCOM.NS_InitEmbedding(localFile.getAddress(), 0);
localFile.Release();
if (rc != XPCOM.NS_OK) {
- if (LocProvider != null) LocProvider.Release();
- LocProvider = null;
dispose();
SWT.error(SWT.ERROR_NO_HANDLES, null, " [NS_InitEmbedding "+mozillaPath+" error "+rc+"]");
}
@@ -1719,7 +1716,7 @@ int OnStatusChange(int aWebProgress, int aRequest, int aStatus, int aMessage) {
StatusTextEvent event = new StatusTextEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(aMessage);
+ int length = XPCOM.strlen_PRUnichar(aMessage);
char[] dest = new char[length];
XPCOM.memmove(dest, aMessage, length * 2);
event.text = new String(dest);
@@ -1739,7 +1736,7 @@ int SetStatus(int statusType, int status) {
StatusTextEvent event = new StatusTextEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(status);
+ int length = XPCOM.strlen_PRUnichar(status);
char[] dest = new char[length];
XPCOM.memmove(dest, status, length * 2);
String string = new String(dest);
@@ -1869,7 +1866,7 @@ int SetTitle(int aTitle) {
TitleEvent event = new TitleEvent(this);
event.display = getDisplay();
event.widget = this;
- int length = XPCOM.nsCRT_strlen_PRUnichar(aTitle);
+ int length = XPCOM.strlen_PRUnichar(aTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, aTitle, length * 2);
event.title = new String(dest);
@@ -2020,7 +2017,7 @@ int SetParentContentListener(int aParentContentListener) {
/* nsITooltipListener */
int OnShowTooltip(int aXCoords, int aYCoords, int aTipText) {
- int length = XPCOM.nsCRT_strlen_PRUnichar(aTipText);
+ int length = XPCOM.strlen_PRUnichar(aTipText);
char[] dest = new char[length];
XPCOM.memmove(dest, aTipText, length * 2);
String text = new String(dest);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/PromptService.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/PromptService.java
index 7c96f20873..d735495643 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/PromptService.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/mozilla/org/eclipse/swt/browser/PromptService.java
@@ -143,7 +143,7 @@ String getLabel(int buttonFlag, int index, int buttonTitle) {
case nsIPromptService.BUTTON_TITLE_SAVE : label = SWT.getMessage("SWT_Save"); break; //$NON-NLS-1$
case nsIPromptService.BUTTON_TITLE_YES : label = SWT.getMessage("SWT_Yes"); break; //$NON-NLS-1$
case nsIPromptService.BUTTON_TITLE_IS_STRING : {
- int length = XPCOM.nsCRT_strlen_PRUnichar(buttonTitle);
+ int length = XPCOM.strlen_PRUnichar(buttonTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, buttonTitle, length * 2);
label = new String(dest);
@@ -157,12 +157,12 @@ String getLabel(int buttonFlag, int index, int buttonTitle) {
public int Alert(int parent, int dialogTitle, int text) {
Browser browser = getBrowser(parent);
- int length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ int length = XPCOM.strlen_PRUnichar(dialogTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
String titleLabel = new String(dest);
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
String textLabel = new String(dest);
@@ -189,19 +189,19 @@ public int ConfirmCheck(int parent, int dialogTitle, int text, int checkMsg, int
public int ConfirmEx(int parent, int dialogTitle, int text, int buttonFlags, int button0Title, int button1Title, int button2Title, int checkMsg, int checkValue, int _retval) {
Browser browser = getBrowser(parent);
- int length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ int length = XPCOM.strlen_PRUnichar(dialogTitle);
char[] dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
String titleLabel = new String(dest);
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
String textLabel = new String(dest);
String checkLabel = null;
if (checkMsg != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(checkMsg);
+ length = XPCOM.strlen_PRUnichar(checkMsg);
dest = new char[length];
XPCOM.memmove(dest, checkMsg, length * 2);
checkLabel = new String(dest);
@@ -231,7 +231,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
char[] dest;
int length;
if (dialogTitle != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(dialogTitle);
+ length = XPCOM.strlen_PRUnichar(dialogTitle);
dest = new char[length];
XPCOM.memmove(dest, dialogTitle, length * 2);
titleLabel = new String(dest);
@@ -239,7 +239,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
titleLabel = SWT.getMessage("SWT_Prompt"); //$NON-NLS-1$
}
- length = XPCOM.nsCRT_strlen_PRUnichar(text);
+ length = XPCOM.strlen_PRUnichar(text);
dest = new char[length];
XPCOM.memmove(dest, text, length * 2);
textLabel = new String(dest);
@@ -247,7 +247,7 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
int[] userAddr = new int[1];
XPCOM.memmove(userAddr, username, 4);
if (userAddr[0] != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(userAddr[0]);
+ length = XPCOM.strlen_PRUnichar(userAddr[0]);
dest = new char[length];
XPCOM.memmove(dest, userAddr[0], length * 2);
userLabel[0] = new String(dest);
@@ -256,14 +256,14 @@ public int PromptUsernameAndPassword(int parent, int dialogTitle, int text, int
int[] passAddr = new int[1];
XPCOM.memmove(passAddr, password, 4);
if (passAddr[0] != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(passAddr[0]);
+ length = XPCOM.strlen_PRUnichar(passAddr[0]);
dest = new char[length];
XPCOM.memmove(dest, passAddr[0], length * 2);
passLabel[0] = new String(dest);
}
if (checkMsg != 0) {
- length = XPCOM.nsCRT_strlen_PRUnichar(checkMsg);
+ length = XPCOM.strlen_PRUnichar(checkMsg);
dest = new char[length];
XPCOM.memmove(dest, checkMsg, length * 2);
checkLabel = new String(dest);
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 48f8e85a4a..ec7a0a9b1b 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
@@ -29,14 +29,13 @@
/* Defines the entry point for the DLL application. */
-#include "nsCRT.h"
+#include "nsXPCOM.h"
#include "nsEmbedAPI.h"
+#include "nsEmbedString.h"
+#include "nsIInputStream.h"
+#include "nsISupportsUtils.h"
#include "prmem.h"
#include "prenv.h"
-#include "nsString.h"
-#include "nsEnumeratorUtils.h"
-#include "nsIInputStream.h"
-#include "nsRect.h"
#include "jni.h"
extern "C" {
@@ -136,10 +135,8 @@ JNIEXPORT jboolean JNICALL XPCOM_NATIVE(nsID_1Equals)
{
nsID *lparg0 = NULL;
nsID *lparg1 = NULL;
- if (arg0 != 0)
- lparg0 = (nsID*)arg0;
- if (arg1 != 0)
- lparg1 = (nsID*)arg1;
+ if (arg0 != 0) lparg0 = (nsID*)arg0;
+ if (arg1 != 0) lparg1 = (nsID*)arg1;
return lparg0->Equals((nsID&)(*lparg1));
}
@@ -154,41 +151,37 @@ JNIEXPORT jboolean JNICALL XPCOM_NATIVE(nsID_1Parse)
{
nsID *lparg0 = NULL;
const char *lparg1 = NULL;
- if (arg0 != 0)
- lparg0 = (nsID*)arg0;
- if (arg1 != 0)
- lparg1 = (const char *)env->GetStringUTFChars(arg1, NULL);
- return lparg0->Parse(lparg1);
+ if (arg0 != 0) lparg0 = (nsID*)arg0;
+ if (arg1 != 0) lparg1 = (const char *)env->GetStringUTFChars(arg1, NULL);
+ return lparg0->Parse(lparg1);
}
JNIEXPORT void JNICALL XPCOM_NATIVE(nsCString_1delete)
(JNIEnv *, jclass, jint arg0)
{
- delete (nsCString *)arg0;
+ delete (nsEmbedCString *)arg0;
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCString_1get)
(JNIEnv *env, jclass, jint arg0)
{
- nsCString *lparg0 = NULL;
- if (arg0 != 0)
- lparg0 = (nsCString *)arg0;
+ nsEmbedCString *lparg0 = NULL;
+ if (arg0 != 0) lparg0 = (nsEmbedCString *)arg0;
return (jint)lparg0->get();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCString_1Length)
(JNIEnv *env, jclass, jint arg0)
{
- nsCString *lparg0 = NULL;
- if (arg0 != 0)
- lparg0 = (nsCString *)arg0;
+ nsEmbedCString *lparg0 = NULL;
+ if (arg0 != 0) lparg0 = (nsEmbedCString *)arg0;
return (jint)lparg0->Length();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCString_1new__)
(JNIEnv *env, jclass)
{
- return (jint)new nsCString();
+ return (jint)new nsEmbedCString();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCString_1new___3BI)
@@ -197,51 +190,37 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCString_1new___3BI)
jbyte *lparg0=NULL;
jint rc;
if (arg0) lparg0 = env->GetByteArrayElements(arg0, NULL);
- rc = (jint)new nsCString((const char *)lparg0, length);
+ rc = (jint)new nsEmbedCString((const char *)lparg0, length);
if (arg0) env->ReleaseByteArrayElements(arg0, lparg0, 0);
return rc;
}
-JNIEXPORT void JNICALL XPCOM_NATIVE(nsRect_1delete)
- (JNIEnv *, jclass, jint arg0)
-{
- delete (nsRect*)arg0;
-}
-
-JNIEXPORT jint JNICALL XPCOM_NATIVE(nsRect_1new)
- (JNIEnv *env, jclass, int arg0, int arg1, int arg2, int arg3)
-{
- return (jint)new nsRect(arg0, arg1, arg2, arg3);
-}
-
JNIEXPORT void JNICALL XPCOM_NATIVE(nsString_1delete)
(JNIEnv *, jclass, jint arg0)
{
- delete (nsString *)arg0;
+ delete (nsEmbedString *)arg0;
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1get)
(JNIEnv *env, jclass, jint arg0)
{
- nsString *lparg0 = NULL;
- if (arg0 != 0)
- lparg0 = (nsString *)arg0;
+ nsEmbedString *lparg0 = NULL;
+ if (arg0 != 0) lparg0 = (nsEmbedString *)arg0;
return (jint)lparg0->get();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1Length)
(JNIEnv *env, jclass, jint arg0)
{
- nsString *lparg0 = NULL;
- if (arg0 != 0)
- lparg0 = (nsString *)arg0;
+ nsEmbedString *lparg0 = NULL;
+ if (arg0 != 0) lparg0 = (nsEmbedString *)arg0;
return (jint)lparg0->Length();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1new__)
(JNIEnv *env, jclass)
{
- return (jint)new nsString();
+ return (jint)new nsEmbedString();
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1new___3C)
@@ -250,7 +229,7 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1new___3C)
jchar *lparg0=NULL;
jint rc;
if (arg0) lparg0 = env->GetCharArrayElements(arg0, NULL);
- rc = (jint)new nsString(lparg0);
+ rc = (jint)new nsEmbedString(lparg0);
if (arg0) env->ReleaseCharArrayElements(arg0, lparg0, 0);
return rc;
}
@@ -258,35 +237,20 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(nsString_1new___3C)
JNIEXPORT jboolean JNICALL XPCOM_NATIVE(nsString_1Equals)
(JNIEnv *env, jclass, jint arg0, jint arg1)
{
- nsString *lparg0 = NULL;
- nsString *lparg1 = NULL;
- if (arg0 != 0)
- lparg0 = (nsString*)arg0;
- if (arg1 != 0)
- lparg1 = (nsString*)arg1;
+ nsEmbedString *lparg0 = NULL;
+ nsEmbedString *lparg1 = NULL;
+ if (arg0 != 0) lparg0 = (nsEmbedString*)arg0;
+ if (arg1 != 0) lparg1 = (nsEmbedString*)arg1;
return lparg0->Equals(*lparg1);
}
-JNIEXPORT void JNICALL XPCOM_NATIVE(nsString_1AssignWithConversion)
- (JNIEnv *env, jclass, jint arg0, jbyteArray arg1)
-{
- nsString *lparg0 = NULL;
- jbyte *lparg1 = NULL;
- if (arg0) lparg0 = (nsString*)arg0;
- if (arg1) lparg1 = env->GetByteArrayElements(arg1, NULL);
- lparg0->AssignWithConversion((const char *)lparg1);
- if (arg1) env->ReleaseByteArrayElements(arg1, lparg1, 0);
-}
-
JNIEXPORT jstring JNICALL XPCOM_NATIVE(PR_1GetEnv)
(JNIEnv *env, jclass, jstring arg0)
{
const char* name = (const char *)env->GetStringUTFChars(arg0,NULL);
char* var = PR_GetEnv(name);
env->ReleaseStringUTFChars(arg0, name);
- if (NULL == var)
- return NULL;
-
+ if (var == NULL) return NULL;
return env->NewStringUTF(var);
}
@@ -301,26 +265,6 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1NewLocalFile)
return rc;
}
-JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1NewSingletonEnumerator)
- (JNIEnv *env, jclass, jint nsFile, jintArray arg1)
-{
- nsISimpleEnumerator *pEnum = NULL;
- nsresult rc = NS_NewSingletonEnumerator(&pEnum,(nsISupports *)nsFile);
-
- if (NS_SUCCEEDED(rc)) {
- jint *arg11 = NULL;
- if (arg1)
- arg11 = env->GetIntArrayElements(arg1, NULL);
-
- arg11[0] = (jint)pEnum;
-
- if (arg1)
- env->ReleaseIntArrayElements(arg1, arg11, 0);
- }
-
- return rc;
-}
-
JNIEXPORT jint JNICALL XPCOM_NATIVE(NS_1GetComponentManager)
(JNIEnv *env, jclass that, jintArray arg0)
{
@@ -2932,13 +2876,16 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(VtblCall__II_3B_3B_3I)
return rc;
}
-JNIEXPORT jint JNICALL XPCOM_NATIVE(nsCRT_1strlen_1PRUnichar)
+JNIEXPORT jint JNICALL XPCOM_NATIVE(strlen_1PRUnichar)
(JNIEnv *env, jclass, jint arg0)
{
- PRUnichar* lparg0 = NULL;
- if (arg0) lparg0 = (PRUnichar *)arg0;
+ const PRUnichar* lparg0 = NULL;
+ if (arg0) lparg0 = (const PRUnichar *)arg0;
- return nsCRT::strlen(lparg0);
+ /* custom */
+ PRUint32 len = 0;
+ if (lparg0 != NULL) while (*lparg0++ != 0) len++;
+ return len;
}
JNIEXPORT jint JNICALL XPCOM_NATIVE(strlen)
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 d0ee64b0f1..3edbf0038a 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
@@ -49,12 +49,16 @@ public class XPCOM {
/* CID constants */
public static final nsID NS_APPSHELL_CID = new nsID("2d96b3df-c051-11d1-a827-0040959a28c9"); //$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_HELPERAPPLAUNCHERDIALOG_CID = new nsID("f68578eb-6ec2-4169-ae19-8c6243f0abe1"); //$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_INPUTSTREAMCHANNEL_CID = new nsID("6ddb050c-0d04-11d4-986e-00c04fa0cf4a"); //$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 String NS_CATEGORYMANAGER_CONTRACTID = "@mozilla.org/categorymanager;1"; //$NON-NLS-1$
+ public static final String NS_DOWNLOAD_CONTRACTID = "@mozilla.org/download;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_PROMPTSERVICE_CONTRACTID = "@mozilla.org/embedcomp/prompt-service;1"; //$NON-NLS-1$
public static final String NS_WINDOWWATCHER_CONTRACTID = "@mozilla.org/embedcomp/window-watcher;1"; //$NON-NLS-1$
@@ -98,9 +102,8 @@ public static final native int NS_GetComponentManager(int[] result);
public static final native int NS_GetServiceManager(int[] result);
public static final native int NS_InitEmbedding(int aMozBinDirectory, int aAppFileLocProvider);
public static final native int NS_NewLocalFile(int path, boolean followLinks, int[] result);
-public static final native int NS_NewSingletonEnumerator(int localFile,int[] enum);
public static final native int NS_TermEmbedding();
-public static final native int nsCRT_strlen_PRUnichar(int s);
+public static final native int strlen_PRUnichar(int s);
public static final native int nsCString_new();
public static final native int nsCString_new(byte[] aString, int length);
public static final native void nsCString_delete(int ptr);
@@ -110,15 +113,12 @@ public static final native void nsID_delete(int ptr);
public static final native int nsID_new();
public static final native boolean nsID_Parse(int ptr, String aIDStr);
public static final native boolean nsID_Equals(int ptr, int other);
-public static final native int nsRect_new(int aX, int aY, int aWidth, int aHeight);
-public static final native void nsRect_delete(int ptr);
public static final native int nsString_new();
public static final native int nsString_new(char[] aString);
public static final native void nsString_delete(int ptr);
public static final native int nsString_Length(int ptr);
public static final native int nsString_get(int ptr);
public static final native boolean nsString_Equals(int ptr, int other);
-public static final native void nsString_AssignWithConversion(int ptr, byte[] aString);
public static final native void PR_Free(int ptr);
public static final native String PR_GetEnv(String name);
public static final native int PR_Malloc(int Length);
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 db1def952b..7dd1c6f5d7 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
@@ -21,7 +21,6 @@ SWT_PREFIX = swt
AWT_PREFIX = swt-awt
SWTPI_PREFIX = swt-pi
ATK_PREFIX = swt-atk
-KDE_PREFIX = swt-kde
GNOME_PREFIX = swt-gnome
MOZILLA_PREFIX = swt-mozilla
SWT_LIB = lib$(SWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
@@ -29,7 +28,6 @@ AWT_LIB = lib$(AWT_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
SWTPI_LIB = lib$(SWTPI_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
ATK_LIB = lib$(ATK_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
GNOME_LIB = lib$(GNOME_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
-KDE_LIB = lib$(KDE_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
MOZILLA_LIB = lib$(MOZILLA_PREFIX)-$(WS_PREFIX)-$(SWT_VERSION).so
# Do not use pkg-config to get libs because it includes unnecessary dependencies (i.e. pangoxft-1.0)
@@ -44,9 +42,6 @@ ATKLIBS = `pkg-config --libs-only-L atk gtk+-2.0`-latk-1.0 -lgtk-x11-2.0
GNOMECFLAGS = `pkg-config --cflags gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0`
GNOMELIBS = `pkg-config --libs-only-L gnome-vfs-module-2.0 libgnome-2.0 libgnomeui-2.0` -lgnomevfs-2 -lgnome-2 -lgnomeui-2
-KDE_LIBS = -L/usr/lib -L$(QT_HOME)/lib -shared -lkdecore -lqt -lkparts
-KDE_CFLAGS = -fno-rtti -c -O -I/usr/include/kde -I$(QT_HOME)/include -I$(JAVA_HOME)/include
-
# Uncomment for Native Stats tool
#NATIVE_STATS = -DNATIVE_STATS
@@ -78,8 +73,7 @@ AWT_OBJECTS = swt_awt.o
SWTPI_OBJECTS = swt.o os.o os_structs.o os_custom.o os_stats.o
ATK_OBJECTS = swt.o atk.o atk_structs.o atk_custom.o atk_stats.o
GNOME_OBJECTS = swt.o gnome.o gnome_structs.o gnome_stats.o
-KDE_OBJS = swt.o kde.o kde_stats.o
-MOZILLA_OBJECTS = swt.o xpcom.o xpcom_custom.o xpcom_structs.o xpcom_stats.o
+MOZILLA_OBJECTS = swt.o xpcom.o
CFLAGS = -O -Wall \
-DSWT_VERSION=$(SWT_VERSION) \
@@ -91,7 +85,7 @@ CFLAGS = -O -Wall \
LIBS = -shared -fpic
-all: make_swt make_atk make_gnome make_awt make_kde
+all: make_swt make_atk make_gnome make_awt
#
# SWT libs
@@ -161,20 +155,6 @@ gnome_stats.o: gnome_stats.c gnome_stats.h
$(CC) $(CFLAGS) $(GNOMECFLAGS) -c gnome_stats.c
#
-# KDE lib
-#
-make_kde: $(KDE_LIB)
-
-$(KDE_LIB): $(KDE_OBJS)
- $(LD) -o $@ $(KDE_OBJS) $(KDE_LIBS)
-
-kde.o: kde.cpp
- $(CXX) $(CFLAGS) $(KDE_CFLAGS) -o kde.o kde.cpp
-
-kde_stats.o: kde_stats.cpp
- $(CXX) $(CFLAGS) $(KDE_CFLAGS) -o kde_stats.o kde_stats.cpp
-
-#
# Mozilla lib
#
make_mozilla:$(MOZILLA_LIB)
@@ -185,15 +165,6 @@ $(MOZILLA_LIB): $(MOZILLA_OBJECTS)
xpcom.o: xpcom.cpp
$(CXX) $(MOZILLACFLAGS) -c xpcom.cpp
-xpcom_structs.o: xpcom_structs.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_structs.cpp
-
-xpcom_custom.o: xpcom_custom.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_custom.cpp
-
-xpcom_stats.o: xpcom_stats.cpp
- $(CXX) $(MOZILLACFLAGS) -c xpcom_stats.cpp
-
#
# Install
#

Back to the top