JavaXPCOM from C++
retrev <[email protected]> Mon, 14 Jan 2008 06:27:27 -0800 (PST)
| Newsgroups | gmane.comp.mozilla.devel.java |
|---|---|
| Organization | http://groups.google.com |
| Message-ID | <14da0fee-a998-4582-9920-53aead0608be__14318.9235394404$1200321051$gmane$org@d21g2000prf.googlegroups.com> |
I'm looking at JavaXPCOM and it looks as if it only supports running xpcom/xul from within a java app. I have a jvm embedded in my C++ app and I want to use XPCOM to create a cross-language API. I searched mozilla.dev.tech.java and found a couple of older posts related to this stating that this is not supported. I looked through the code and it seems that much of the needed infrastructure is in place to handle this. src/nsJavaWrapper.h defines GetNewOrUsedJavaWrapper() which seems to create/retrieve a proxy for an XPCOM object. nsJavaXPCOMBindingUtils.h has InitializeJavaGlobals()/ FreeJavaGlobals() which seems to handle the jni setup. Neither of these headers is included in a xulrunner download so I grabbed them separately. I can't include nsJavaXPCOMBindingUtils.h without a #define MOZILLA_INTERNAL_API first and those symbols are not available in a lib anywhere (I'm using windows xp for now, but will also run on solaris 10). First off, am I looking down the correct path to get this working? It seems that maybe I should do the Initiale/free globals in java code after I initialze the jvm. I'm not sure how to go about this (I see the initialize xul code but I've already initialized xpcom and I won't be using any xul components). I'm also not seeing an exported symbol for GetNewOrUsedJavaWrapper...maybe I just need to dllimport this? If you can point me in the correct direction and I'm able to get this working, I'd be happy to submit any patches I create.