Re: HELP!!! swt + mozilla (adtional questions)

Doug Turner <[email protected]> Tue, 31 Dec 2002 10:51:28 -0800
Newsgroups gmane.comp.mozilla.devel.java,gmane.comp.mozilla.devel.embedding,gmane.comp.mozilla.devel.xpcom
Organization Another Netscape Collabra Server User
Message-ID <[email protected]>
jml wrote:

> Now I get mozilla to run inside swt! Great experience.
>
> With the help from Doug, I am now using the gecko-sdk -- only for the 
> "string" part. Using's the swt technology I described in previous 
> emails, now I only have about 400 lines of C++ code, all other code 
> are in Java, so even though I only support Windows now, I expect that 
> easy to support other platform later (there is a problem: I use the 
> binary format of xpcom vtbl, so when it change from 32bit to 64bit, I 
> don't know what will happen, maybe change all usage of int in java to 
> long).
>
> Currently, only have the mozilla to appear inside a swt widget, not 
> handling all kinds of events and other stuff, yet. Since in my 
> approach, for each xpcom interface, I need to write a "wrapper" class 
> in Java. Currently I am writing all the "wrapper" class manually, 
> which is tedious and easy to make error, so I want to auto-generate 
> those java codes. I have no experience with XPIDL (and even never 
> compiled the mozilla on my computer before, so trying to avoid that), 
> can anyone help to tell me how can I customize xpidl to generate the 
> java code I want?


Good to hear that your embedding is on it feet!

The code to the XPIDL compiler is here:

http://lxr.mozilla.org/seamonkey/source/xpcom/typelib/xpidl/

You may be interested in:

http://lxr.mozilla.org/seamonkey/source/xpcom/typelib/xpidl/xpidl_java.c

Which is suppose to generate java interfaces based on the IDL file. 

> BTW, though ToNewUnicode() is not in the gecko-sdk API, it is in the 
> xpcom.lib, so I can still use it in my C++ code.


Note that you probably want to minimize your linking to xpcom and other 
Gecko libraries.  Most of the symbols exported are not "frozen" and 
therefore subject to change.  If you need a conversion unicode->UTF8, 
you might just wanna lift the code from XPCOM.  If you want something 
more involve,write up a bug in bugzilla (bugzilla.mozilla.org).  Let see 
if we can talk to the i18n folks about getting something frozen for you.

Happy New Year,

-- 
Doug Turner
[email protected]