зеркало из https://github.com/mozilla/pjs.git
* not part of the build*
Fixed 71951, 74511, 74525
This commit is contained in:
Родитель
69989eab13
Коммит
1045669168
|
@ -27,6 +27,6 @@ srcdir = @srcdir@
|
|||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
DIRS= xpidl src loader classes components
|
||||
DIRS= xpidl src loader import classes components test
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
|
|
@ -1,58 +0,0 @@
|
|||
/* -*- Mode: java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Igor Kushnirskiy <idk@eng.sun.com>
|
||||
*/
|
||||
package org.mozilla.xpcom;
|
||||
|
||||
public class IID {
|
||||
public IID(String iid) {
|
||||
this.iid = ((iid == null) ? "" : iid).toLowerCase();;
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
if (! (obj instanceof IID)) {
|
||||
return false;
|
||||
}
|
||||
boolean res = iid.equals(((IID)obj).iid);
|
||||
return res;
|
||||
}
|
||||
public String toString() {
|
||||
return "org.mozilla.xpcom.IID@"+iid;
|
||||
}
|
||||
public int hashCode() {
|
||||
int h = iid.hashCode();
|
||||
return h;
|
||||
}
|
||||
public String getString() {
|
||||
return iid;
|
||||
}
|
||||
private String iid;
|
||||
public static Class TYPE;
|
||||
static {
|
||||
try {
|
||||
TYPE = Class.forName("org.mozilla.xpcom.Proxy");
|
||||
} catch (Exception e) { //it could not happen
|
||||
TYPE = null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -1,244 +0,0 @@
|
|||
/* -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
||||
* 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.org code.
|
||||
*
|
||||
* The Initial Developer of the Original Code is Sun Microsystems,
|
||||
* Inc. Portions created by Sun are
|
||||
* Copyright (C) 1999 Sun Microsystems, Inc. All
|
||||
* Rights Reserved.
|
||||
*
|
||||
* Contributor(s):
|
||||
* Denis Sharypov <sdv@sparc.spb.su>
|
||||
*/
|
||||
|
||||
package org.mozilla.xpcom;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Hashtable;
|
||||
import java.lang.reflect.*;
|
||||
|
||||
public class InterfaceRegistry {
|
||||
|
||||
private static String IID_STRING = "IID";
|
||||
private static Hashtable interfaces = null;
|
||||
private static Hashtable iMethods = null;
|
||||
private static HashSet keywords = null;
|
||||
private static boolean debug = true;
|
||||
|
||||
private InterfaceRegistry() {
|
||||
}
|
||||
|
||||
public static void register(nsISupports obj) {
|
||||
if (obj == null) {
|
||||
return;
|
||||
}
|
||||
Class cl = obj.getClass();
|
||||
register(cl);
|
||||
}
|
||||
|
||||
public static void register(String name) {
|
||||
try {
|
||||
register(Class.forName(name));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public static void register(Class cl) {
|
||||
if (cl == null) {
|
||||
return;
|
||||
}
|
||||
if (interfaces == null) {
|
||||
interfaces = new Hashtable();
|
||||
}
|
||||
if (iMethods == null) {
|
||||
iMethods = new Hashtable();
|
||||
}
|
||||
if (keywords == null) {
|
||||
keywords = new HashSet(javaKeywords.length);
|
||||
for (int i = 0; i < javaKeywords.length; i++) {
|
||||
keywords.add(javaKeywords[i]);
|
||||
}
|
||||
}
|
||||
if (!cl.isInterface()) {
|
||||
Class[] ifaces = cl.getInterfaces();
|
||||
for (int i = 0; i < ifaces.length; i++) {
|
||||
registerInterfaces(ifaces[i]);
|
||||
}
|
||||
} else {
|
||||
registerInterfaces(cl);
|
||||
}
|
||||
}
|
||||
|
||||
public static void unregister(IID iid) {
|
||||
interfaces.remove(iid);
|
||||
iMethods.remove(iid);
|
||||
}
|
||||
|
||||
private static Hashtable registerInterfaces(Class cl) {
|
||||
try {
|
||||
Object iidStr = cl.getField(IID_STRING).get(cl);
|
||||
if (iidStr instanceof String) {
|
||||
IID iid = new IID((String)iidStr);
|
||||
// if this iface hasn't been registered, yet
|
||||
if (interfaces.get(iid) == null) {
|
||||
String[] methodNames = Utilities.getInterfaceMethodNames((String)iidStr);
|
||||
if (methodNames != null) {
|
||||
Method[] rmethods = new Method[methodNames.length];
|
||||
Class[] ifaces = cl.getInterfaces();
|
||||
// check for single inheritance (xpcom)
|
||||
if (ifaces.length < 2) {
|
||||
// recursively get all parent interface methods
|
||||
Hashtable mhash = null;
|
||||
Method[] methods = cl.getDeclaredMethods();
|
||||
// the very super iface
|
||||
if (ifaces.length == 0) {
|
||||
mhash = new Hashtable(methods.length);
|
||||
} else {
|
||||
mhash = new Hashtable(registerInterfaces(ifaces[0]));
|
||||
}
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
mhash.put(methods[i].getName(), methods[i]);
|
||||
}
|
||||
|
||||
for (int j = methodNames.length - 1; j >= 0; j--) {
|
||||
rmethods[j] = (Method)mhash.get(subscriptMethodName(methodNames[j]));
|
||||
}
|
||||
|
||||
interfaces.put(iid, cl);
|
||||
iMethods.put(iid, new MethodArray(rmethods, mhash));
|
||||
|
||||
debug(cl.getName() + ": " + iid + " ( " + cl + " )");
|
||||
printMethods(rmethods);
|
||||
|
||||
return mhash;
|
||||
}
|
||||
}
|
||||
// simply pass iface methods
|
||||
} else {
|
||||
MethodArray m = (MethodArray)iMethods.get(iid);
|
||||
if (m != null) {
|
||||
return m.names;
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (NoSuchFieldException e) {
|
||||
// the interface doesn't define IID field
|
||||
debug("no such field...");
|
||||
} catch (IllegalAccessException e1) {
|
||||
debug("can't access field...");
|
||||
}
|
||||
return new Hashtable();
|
||||
}
|
||||
|
||||
public static Class getInterface(IID iid) {
|
||||
Object obj = null;
|
||||
if (interfaces != null) {
|
||||
obj = interfaces.get(iid);
|
||||
}
|
||||
if (obj == null || !(obj instanceof Class)) {
|
||||
return null;
|
||||
}
|
||||
return (Class)obj;
|
||||
}
|
||||
|
||||
public static Method getMethodByIndex(int index, IID iid) {
|
||||
Method result = null;
|
||||
MethodArray m = (MethodArray)iMethods.get(iid);
|
||||
if (m != null && m.methods !=null) {
|
||||
try {
|
||||
result = m.methods[index];
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public static int getIndexByMethod(Method method, IID iid) {
|
||||
int result = -1;
|
||||
MethodArray m = (MethodArray)iMethods.get(iid);
|
||||
if (m != null && m.methods != null) {
|
||||
for (int i = 0; i < m.methods.length; i++) {
|
||||
if (m.methods[i] != null && method.equals(m.methods[i])) {
|
||||
result = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private static String subscriptMethodName(String str) {
|
||||
if (keywords.contains(str)) {
|
||||
return str + "_";
|
||||
}
|
||||
return str;
|
||||
}
|
||||
|
||||
// methods for debugging
|
||||
|
||||
private static void printMethods(Method[] methods) {
|
||||
if (debug) {
|
||||
for (int i = 0; i < methods.length; i++) {
|
||||
printMethod(methods[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void printMethod(Method m) {
|
||||
if (m == null) {
|
||||
Debug.log("<null>");
|
||||
return;
|
||||
}
|
||||
Class retType = m.getReturnType();
|
||||
Class[] paramTypes = m.getParameterTypes();
|
||||
String name = m.getName();
|
||||
System.out.print(Modifier.toString(m.getModifiers()));
|
||||
System.out.print(" " + retType.getName() + " " + name
|
||||
+ "(");
|
||||
for (int j = 0; j < paramTypes.length; j++) {
|
||||
if (j > 0) System.out.print(", ");
|
||||
System.out.print(paramTypes[j].getName());
|
||||
}
|
||||
Debug.log(");");
|
||||
}
|
||||
|
||||
private static void debug(String str) {
|
||||
if (debug) {
|
||||
Debug.log(str);
|
||||
}
|
||||
}
|
||||
|
||||
private static String[] javaKeywords = {
|
||||
"abstract", "default", "if" , "private" , "this" ,
|
||||
"boolean" , "do" , "implements", "protected" , "throw" ,
|
||||
"break" , "double" , "import", "public" , "throws" ,
|
||||
"byte" , "else" , "instanceof", "return" , "transient",
|
||||
"case" , "extends", "int" , "short" , "try" ,
|
||||
"catch" , "final" , "interface" , "static" , "void" ,
|
||||
"char" , "finally", "long" , "strictfp" , "volatile" ,
|
||||
"class" , "float" , "native" , "super" , "while" ,
|
||||
"const" , "for" , "new" , "switch" ,
|
||||
"continue", "goto" , "package" , "synchronized",
|
||||
// non-final method names of Object class
|
||||
"toString", "clone" , "finalize" , "hashCode" , "equals"};
|
||||
}
|
||||
|
||||
class MethodArray {
|
||||
Method[] methods;
|
||||
Hashtable names;
|
||||
MethodArray(Method[] _methods, Hashtable _names) {
|
||||
methods = _methods;
|
||||
names = _names;
|
||||
}
|
||||
}
|
|
@ -37,6 +37,7 @@ XPIDLSRCS = bcIBlackConnectInit.idl
|
|||
CPPSRCS = bcBlackConnectInit.cpp
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
include ../config/rules.mk
|
||||
|
||||
COMPONENT=bcBlackConnectInit
|
||||
CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
|
||||
|
@ -44,7 +45,10 @@ CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
|
|||
$(COMPONENT).jar.comp: manifest $(CLASSES)
|
||||
$(JDKHOME)/bin/jar cvfm $(COMPONENT).jar.comp manifest *.class
|
||||
.java.class:
|
||||
$(JDKHOME)/bin/javac -classpath .:../classes $<
|
||||
$(JDKHOME)/bin/javac -classpath .:../classes:$(DIST)/classes $<
|
||||
|
||||
bcIBlackConnectInit.java : bcIBlackConnectInit.idl
|
||||
|
||||
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info
|
||||
cp $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DEPTH)/dist/bin/components/
|
||||
clobber-java:
|
||||
|
|
|
@ -26,8 +26,8 @@ public class bcBlackConnectInit implements bcIBlackConnectInit {
|
|||
}
|
||||
public Object queryInterface(IID iid) {
|
||||
Object result;
|
||||
if ( nsISupportsIID.equals(iid)
|
||||
|| bcIBlackConnectInitIID.equals(iid)) {
|
||||
if ( nsISupports.IID.equals(iid)
|
||||
|| bcIBlackConnectInit.IID.equals(iid)) {
|
||||
result = this;
|
||||
} else {
|
||||
result = null;
|
||||
|
@ -39,9 +39,6 @@ public class bcBlackConnectInit implements bcIBlackConnectInit {
|
|||
Components.setComponentManager(cm);
|
||||
Debug.log("Components.setComponentManager(cm);");
|
||||
}
|
||||
|
||||
static IID bcIBlackConnectInitIID = new IID(bcIBlackConnectInit.IID);
|
||||
static IID nsISupportsIID = new IID(nsISupports.IID);
|
||||
static {
|
||||
InterfaceRegistry.register(nsIComponentManager.class);
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsIComponentManager.idl"
|
||||
|
||||
#pragma prefix
|
||||
[scriptable, uuid(d4867a7e-1dd1-11b2-a009-b111ab5d7639)]
|
||||
|
||||
interface bcIBlackConnectInit : nsISupports
|
||||
|
|
|
@ -1,66 +0,0 @@
|
|||
#!gmake
|
||||
#
|
||||
# The contents of this file are subject to the Netscape 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/NPL/
|
||||
#
|
||||
# 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.org code.
|
||||
#
|
||||
# The Initial Developer of the Original Code is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All
|
||||
# Rights Reserved.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Igor Kushnirskiy <idk@eng.sun.com>
|
||||
#
|
||||
|
||||
|
||||
DEPTH = ..\..\..\..
|
||||
topsrcdir = ..\..\..\..
|
||||
srcdir = .
|
||||
VPATH = .
|
||||
|
||||
MAKE_OBJ_TYPE=DLL
|
||||
MODULE=bcBlackConnectInit
|
||||
COMPONENT=1
|
||||
DLLNAME=$(MODULE)
|
||||
DLL=.\$(OBJDIR)\$(DLLNAME).dll
|
||||
|
||||
XPIDLSRCS = \
|
||||
.\bcIBlackConnectInit.idl \
|
||||
$(NULL)
|
||||
|
||||
OBJS = .\$(OBJDIR)\bcBlackConnectInit.obj
|
||||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
|
||||
COMPONENT=bcBlackConnectInit
|
||||
CLASSES=bcIBlackConnectInit.class bcBlackConnectInit.class
|
||||
|
||||
$(COMPONENT).jar.comp: manifest $(CLASSES)
|
||||
$(JDKHOME)\bin\jar cvfm $(COMPONENT).jar.comp manifest *.class
|
||||
|
||||
.SUFFIXES: .java .class
|
||||
|
||||
.java.class:
|
||||
$(JDKHOME)\bin\javac -classpath .;..\classes $<
|
||||
|
||||
install-component: $(COMPONENT).jar.comp $(COMPONENT).jar.info $(DLL)
|
||||
copy $(COMPONENT).jar* $(DIST)\bin\components
|
||||
copy $(DLL) $(DIST)\bin\components
|
||||
|
||||
clobber-java:
|
||||
-del *.class *.jar.comp
|
||||
clobber:: clobber-java
|
||||
rm -f "$(DIST)\bin\components\$(DLLNAME).dll"
|
||||
rm -f "$(DIST)\bin\components\$(COMPONENT).jar.*"
|
||||
clobber_all:: clobber-java
|
||||
install:: install-component
|
|
@ -454,14 +454,12 @@ UnregisterJavaLoader(nsIComponentManager *aCompMgr, nsIFile *aPath,
|
|||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(bcJavaComponentLoader);
|
||||
|
||||
static nsModuleComponentInfo components[] = {
|
||||
static nsModuleComponentInfo components_loader[] = {
|
||||
{ "Java component loader", BC_JAVACOMPONENTLOADER_CID,
|
||||
BC_JAVACOMPONENTLOADER_ContractID,
|
||||
bcJavaComponentLoaderConstructor,
|
||||
RegisterJavaLoader, UnregisterJavaLoader },
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE("Java component loader", components);
|
||||
|
||||
|
||||
NS_IMPL_NSGETMODULE("Java component loader", components_loader);
|
||||
|
||||
|
|
|
@ -27,6 +27,7 @@ DIRS= \
|
|||
xpidl \
|
||||
loader \
|
||||
src \
|
||||
import \
|
||||
classes \
|
||||
# test \
|
||||
components \
|
||||
|
|
|
@ -48,12 +48,32 @@ static nsModuleComponentInfo components[] =
|
|||
{
|
||||
"Black Connect Java stubs and proxies",
|
||||
BC_JAVASTUBSANDPROXIES_CID,
|
||||
BC_JAVASTUBSANDPROXIES_PROGID,
|
||||
BC_JAVASTUBSANDPROXIES_ContractID,
|
||||
bcJavaStubsAndProxiesConstructor
|
||||
}
|
||||
};
|
||||
|
||||
NS_IMPL_NSGETMODULE("BlackConnect Java stubs and proxies",components);
|
||||
//NS_IMPL_NSGETMODULE("BlackConnect Java stubs and proxies",components_stubs);
|
||||
|
||||
|
||||
PRUint32 NSGetModule_components_count =
|
||||
sizeof(components) / sizeof(components[0]);
|
||||
|
||||
nsModuleComponentInfo* NSGetModule_components_idk = (components);
|
||||
|
||||
extern "C" NS_EXPORT nsresult NSGetModule(nsIComponentManager *servMgr,
|
||||
nsIFile* location,
|
||||
nsIModule** result)
|
||||
{
|
||||
return NS_NewGenericModule("BlackConnect Java stubs and proxies",
|
||||
NSGetModule_components_count,
|
||||
NSGetModule_components_idk,
|
||||
nsnull, result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
NS_IMPL_ISUPPORTS(bcJavaStubsAndProxies,NS_GET_IID(bcJavaStubsAndProxies));
|
||||
|
||||
|
@ -81,10 +101,14 @@ public:
|
|||
|
||||
bcJavaStubsAndProxies::bcJavaStubsAndProxies() {
|
||||
NS_INIT_REFCNT();
|
||||
PR_LOG(bcJavaGlobal::GetLog(),PR_LOG_DEBUG,
|
||||
("--[c++] bcJavaStubsAndProxies::bcJavaStubsAndProxies\n"));
|
||||
oid2objectMap = new nsHashtable(256,PR_TRUE);
|
||||
}
|
||||
|
||||
bcJavaStubsAndProxies::~bcJavaStubsAndProxies() {
|
||||
PR_LOG(bcJavaGlobal::GetLog(),PR_LOG_DEBUG,
|
||||
("--[c++] bcJavaStubsAndProxies::~bcJavaStubsAndProxies\n"));
|
||||
delete oid2objectMap;
|
||||
}
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
{0x58034ea6, 0x1dd2, 0x11b2, \
|
||||
{0x9b, 0x58, 0x86, 0x30, 0xab, 0xb8, 0xaf,0x47}}
|
||||
|
||||
#define BC_JAVASTUBSANDPROXIES_PROGID "component://netscape/blackwood/blackconnect/java-stubs-and-proxies"
|
||||
#define BC_JAVASTUBSANDPROXIES_ContractID "@mozilla.org/blackwood/blackconnect/java-stubs-and-proxies"
|
||||
|
||||
/* 7cadf6e8-1dd2-11b2-9a6e-b1c37844e004 */
|
||||
#define BC_JAVASTUBSANDPROXIES_CID \
|
||||
|
|
|
@ -36,11 +36,15 @@ XPIDL_MODULE = javaSample
|
|||
XPIDLSRCS = bcIJavaSample.idl
|
||||
CPPSRCS = bcJavaSample.cpp
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
include ../config/rules.mk
|
||||
|
||||
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
|
||||
$(JDKHOME)/bin/jar cvfm bcJavaSample.jar.comp manifest *.class
|
||||
.java.class:
|
||||
$(JDKHOME)/bin/javac -classpath .:../classes $<
|
||||
$(JDKHOME)/bin/javac -classpath .:../classes:$(DIST)/classes $<
|
||||
|
||||
bcIJavaSample.java : bcIJavaSample.idl
|
||||
|
||||
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info
|
||||
cp bcJavaSample.jar.comp bcJavaSample.jar.info $(DEPTH)/dist/bin/components/
|
||||
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include "nsISupports.idl"
|
||||
#include "nsIComponentManager.idl"
|
||||
|
||||
#pragma prefix
|
||||
[scriptable, uuid(ca1e2656-1dd1-11b2-9c4e-f49ea557abde)]
|
||||
interface bcIJavaSample : nsISupports
|
||||
{
|
||||
|
|
|
@ -29,8 +29,8 @@ public class bcJavaSample implements bcIJavaSample {
|
|||
public Object queryInterface(IID iid) {
|
||||
System.out.println("--[java]bcJavaSample::queryInterface iid="+iid);
|
||||
Object result;
|
||||
if ( iid.equals(nsISupportsIID)
|
||||
|| iid.equals(bcIJavaSampleIID)) {
|
||||
if ( iid.equals(nsISupports.IID)
|
||||
|| iid.equals(bcIJavaSample.IID)) {
|
||||
result = this;
|
||||
} else {
|
||||
result = null;
|
||||
|
@ -99,7 +99,7 @@ public class bcJavaSample implements bcIJavaSample {
|
|||
|| counter > 300) {
|
||||
break;
|
||||
}
|
||||
strObj = (nsISupportsString) obj.queryInterface(nsISupportsStringIID);
|
||||
strObj = (nsISupportsString) obj.queryInterface(nsISupportsString.IID);
|
||||
str = strObj.getData();
|
||||
System.out.println("--[java] bcJavaSample.Test5 string "+str);
|
||||
enumerator.next(); counter++;
|
||||
|
@ -124,11 +124,6 @@ public class bcJavaSample implements bcIJavaSample {
|
|||
count[0] = retValue.length;
|
||||
valueArray[0] = retValue;
|
||||
}
|
||||
|
||||
static IID bcIJavaSampleIID = new IID(bcIJavaSample.IID);
|
||||
static IID nsISupportsIID = new IID(nsISupports.IID);
|
||||
static IID nsIComponenstManagerIID = new IID(nsIComponentManager.IID);
|
||||
static IID nsISupportsStringIID = new IID(nsISupportsString.IID);
|
||||
static {
|
||||
try {
|
||||
Class nsIComponentManagerClass =
|
||||
|
|
|
@ -41,14 +41,16 @@ OBJS = .\$(OBJDIR)\bcJavaSample.obj
|
|||
LLIBS=$(LLIBS) $(LIBNSPR) $(DIST)\lib\xpcom.lib
|
||||
|
||||
include <$(DEPTH)\config\rules.mak>
|
||||
include ..\config\rules.mak
|
||||
|
||||
bcJavaSample.jar.comp: manifest bcIJavaSample.class bcJavaSample.class
|
||||
$(JDKHOME)\bin\jar cvfm bcJavaSample.jar.comp manifest *.class
|
||||
|
||||
.SUFFIXES: .java .class
|
||||
|
||||
.java.class:
|
||||
$(JDKHOME)\bin\javac -classpath .;..\classes $<
|
||||
$(JDKHOME)\bin\javac -classpath .;..\classes;$(DEPTH)\dist\classes $<
|
||||
|
||||
bcIJavaSample.java : bcIJavaSample.idl
|
||||
|
||||
install-component: bcJavaSample.jar.comp bcJavaSample.jar.info $(DLL)
|
||||
copy bcJavaSample.jar* $(DIST)\bin\components
|
||||
|
|
|
@ -20,6 +20,8 @@
|
|||
* Contributor(s):
|
||||
* Michael Allen (michael.allen@sun.com)
|
||||
* Frank Mitchell (frank.mitchell@sun.com)
|
||||
* Denis Sharypov (sdv@sparc.spb.su)
|
||||
* Igor Kushnirskiy (idk@eng.sun.com)
|
||||
*/
|
||||
|
||||
/*
|
||||
|
@ -255,7 +257,7 @@ interface_declaration(TreeState *state)
|
|||
/* } */
|
||||
|
||||
/* fprintf(FILENAME(state), " =\n new nsID(\"%s\");\n\n", iid); */
|
||||
fprintf(FILENAME(state), " public static final String IID =\n \"%s\";\n\n", iid);
|
||||
fprintf(FILENAME(state), " public static final IID IID =\n new IID(\"%s\");\n\n", iid);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -370,18 +372,21 @@ xpcom_to_java_type (TreeState *state)
|
|||
IDL_NODE_TYPE(IDL_NODE_UP(state->tree)) == IDLN_NATIVE) {
|
||||
const char *user_type = IDL_NATIVE(IDL_NODE_UP(state->tree)).user_type;
|
||||
const char *ident_str = IDL_IDENT(IDL_NATIVE(IDL_NODE_UP(state->tree)).ident).str;
|
||||
if (strcmp(user_type, "void") == 0) {
|
||||
if (strcmp(user_type, "void") == 0) { /*it should not happend for scriptable methods*/
|
||||
fputs("Object", FILENAME(state));
|
||||
}
|
||||
else if (strcmp(user_type, "nsID") == 0 ||
|
||||
strcmp(user_type, "nsIID") == 0 ||
|
||||
strcmp(user_type, "nsCID") == 0) {
|
||||
/* XXX: s.b test for "iid" attribute */
|
||||
/* XXX: s.b test for "id" attribute */
|
||||
/* XXX: special class for nsIDs */
|
||||
else if (strcmp(user_type, "nsID") == 0) {
|
||||
fputs("ID", FILENAME(state));
|
||||
} else if (strcmp(user_type, "nsIID") == 0) {
|
||||
fputs("IID", FILENAME(state));
|
||||
} else if (strcmp(user_type, "nsCID") == 0) {
|
||||
fputs("CID", FILENAME(state));
|
||||
}
|
||||
else {
|
||||
/* XXX: special class for opaque types */
|
||||
/*it should not happend for scriptable methods*/
|
||||
fputs("OpaqueValue", FILENAME(state));
|
||||
}
|
||||
} else {
|
||||
|
|
Загрузка…
Ссылка в новой задаче