Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2008-08-21 14:17:52 -0400
committerGrant Gayed2008-08-21 14:17:52 -0400
commitfa4dfef3c26d3ca87162170c85daacd89680beb9 (patch)
treedfa382441d03304eb7e8b482b2f81aea6c970d9f
parent44efb8e7eb796293a09dff33329e54074288f821 (diff)
downloadeclipse.platform.swt-fa4dfef3c26d3ca87162170c85daacd89680beb9.tar.gz
eclipse.platform.swt-fa4dfef3c26d3ca87162170c85daacd89680beb9.tar.xz
eclipse.platform.swt-fa4dfef3c26d3ca87162170c85daacd89680beb9.zip
nsID.toString()
-rw-r--r--bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties3
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom.cpp13
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp5
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/XPCOM.java1
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsID.java26
6 files changed, 39 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
index d0ebcb280b..496175c137 100644
--- a/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
+++ b/bundles/org.eclipse.swt.tools/JNI Generation/org/eclipse/swt/tools/internal/org.eclipse.swt.internal.mozilla.XPCOM.properties
@@ -1313,6 +1313,9 @@ XPCOM_nsID_Equals=flags=cpp
XPCOM_nsID_Equals_0=cast=(nsID *)
XPCOM_nsID_Equals_1=cast=(nsID *),flags=struct
+XPCOM_nsID_ToString=flags=cpp
+XPCOM_nsID_ToString_0=cast=(nsID *)
+
XPCOM_nsID_delete=flags=delete
XPCOM_nsID_delete_0=cast=(nsID *)
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 07b9dce31f..de0eb98552 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
@@ -3246,6 +3246,19 @@ JNIEXPORT jint JNICALL XPCOM_NATIVE(nsID_1Equals)
}
#endif
+#ifndef NO_nsID_1ToString
+extern "C" JNIEXPORT jint JNICALL XPCOM_NATIVE(nsID_1ToString)(JNIEnv *env, jclass that, jint arg0);
+JNIEXPORT jint JNICALL XPCOM_NATIVE(nsID_1ToString)
+ (JNIEnv *env, jclass that, jint arg0)
+{
+ jint rc = 0;
+ XPCOM_NATIVE_ENTER(env, that, nsID_1ToString_FUNC);
+ rc = (jint)((nsID *)arg0)->ToString();
+ XPCOM_NATIVE_EXIT(env, that, nsID_1ToString_FUNC);
+ return rc;
+}
+#endif
+
#ifndef NO_nsID_1delete
extern "C" JNIEXPORT void JNICALL XPCOM_NATIVE(nsID_1delete)(JNIEnv *env, jclass that, jint arg0);
JNIEXPORT void JNICALL XPCOM_NATIVE(nsID_1delete)
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
index b276290c48..9792dcedef 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.cpp
@@ -14,8 +14,8 @@
#ifdef NATIVE_STATS
-int XPCOM_nativeFunctionCount = 170;
-int XPCOM_nativeFunctionCallCount[170];
+int XPCOM_nativeFunctionCount = 171;
+int XPCOM_nativeFunctionCallCount[171];
char * XPCOM_nativeFunctionNames[] = {
"Call",
"NS_1GetComponentManager",
@@ -184,6 +184,7 @@ char * XPCOM_nativeFunctionNames[] = {
"nsEmbedString_1new__",
"nsEmbedString_1new___3C",
"nsID_1Equals",
+ "nsID_1ToString",
"nsID_1delete",
"nsID_1new",
"strlen_1PRUnichar",
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
index 11990c6ae7..9096c24f45 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/library/xpcom_stats.h
@@ -192,6 +192,7 @@ typedef enum {
nsEmbedString_1new___FUNC,
nsEmbedString_1new___3C_FUNC,
nsID_1Equals_FUNC,
+ nsID_1ToString_FUNC,
nsID_1delete_FUNC,
nsID_1new_FUNC,
strlen_1PRUnichar_FUNC,
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 a2f889c443..b072592c81 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
@@ -140,6 +140,7 @@ public static final native int /*long*/ nsEmbedCString_get(int /*long*/ ptr);
public static final native void nsID_delete(int /*long*/ ptr);
public static final native int /*long*/ nsID_new();
public static final native int nsID_Equals(int /*long*/ ptr, int /*long*/ other);
+public static final native int /*long*/ nsID_ToString(int /*long*/ ptr);
public static final native int /*long*/ nsEmbedString_new();
public static final native int /*long*/ nsEmbedString_new(char[] aString);
public static final native void nsEmbedString_delete(int /*long*/ ptr);
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsID.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsID.java
index d92dbcf199..0dc566872d 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsID.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsID.java
@@ -43,18 +43,18 @@ public nsID(String id) {
}
public boolean Equals(nsID other) {
- int /*long*/ ptr = XPCOM.nsID_new();
- XPCOM.memmove(ptr, this, nsID.sizeof);
- int /*long*/ otherPtr = XPCOM.nsID_new();
- XPCOM.memmove(otherPtr, other, nsID.sizeof);
- boolean result = XPCOM.nsID_Equals(ptr, otherPtr) != 0;
- XPCOM.nsID_delete(ptr);
- XPCOM.nsID_delete(otherPtr);
+ int /*long*/ ptr = XPCOM.nsID_new ();
+ XPCOM.memmove (ptr, this, nsID.sizeof);
+ int /*long*/ otherPtr = XPCOM.nsID_new ();
+ XPCOM.memmove (otherPtr, other, nsID.sizeof);
+ boolean result = XPCOM.nsID_Equals (ptr, otherPtr) != 0;
+ XPCOM.nsID_delete (ptr);
+ XPCOM.nsID_delete (otherPtr);
return result;
}
public void Parse (String aIDStr) {
- if(aIDStr == null) throw new Error ();
+ if (aIDStr == null) throw new Error ();
int i = 0;
for (; i < 8; i++) m0 = (m0 << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16);
if (aIDStr.charAt (i++) != '-') throw new Error ();
@@ -73,4 +73,14 @@ public void Parse (String aIDStr) {
for (; i < 36; i++) m3[7] = (byte)((m3[7] << 4) + Integer.parseInt (aIDStr.substring (i, i + 1), 16));
}
+public String toString () {
+ int /*long*/ ptr = XPCOM.nsID_new ();
+ XPCOM.memmove (ptr, this, nsID.sizeof);
+ int /*long*/ string = XPCOM.nsID_ToString (ptr);
+ XPCOM.nsID_delete (ptr);
+ int size = XPCOM.strlen (string);
+ byte[] bytes = new byte[size];
+ XPCOM.memmove (bytes, string, size);
+ return new String (bytes);
+}
} \ No newline at end of file

Back to the top