[Kde-java] QtJava api via Dynamic Proxies progress - part 1
Richard Dale
Richard_Dale at tipitina.demon.co.uk
Thu Aug 21 01:19:10 CEST 2003
Hi Marco
On Wednesday 20 August 2003 19:37, Marco Ladermann wrote:
> Hi Richard,
>
> On Wednesday 20 August 2003 05:36, Richard Dale wrote:
> > I've got kalyptus correctly auto-generating the QtJava sources so that
> > they compile without error, all 60000 lines! So there shouldn't be any
> > need to put the autogenerated code in the cvs anymore, it can be
> > generated on demand.
>
> Just tried your modifications. Long time ago I looked at Perl code ;-)
> It took me some time to figure out that one has to delete the "2" from the
> package name in kalyptusCxxToJava.pm to get it work, but after that little
> change everything worked fine! Very cool.
Ah.. oops - yes I was testing it with as '-fjava2' so I could easily compare
with the old code generation. Maybe it works well enough to put in the cvs
now, and get rid of the old version.
> One question: Why are you using the system classloader in the proxy
> creation statement? I'm not sure, but this could lead to problems with
> environments that use their own classloader (e.g. WebStart) to load classes
> dynamically. If the system classloader is hard coded, classes would not be
> found in such libraries. May be its better to use:
>
> public class Qxxx ... {
> ...
> static {
> _static_proxy = Proxy.newProxyInstance(Qxxx.class.getClassLoader(),
> new Class[] { ... },
> new SmokeInvocation() );
> }
> ...
> }
OK I'll change it to that.
It should be possible to build a qtjava.jar file and compile existing programs
against it after changing the package name from org.kde.qt to qt. - that
would be a good way of making sure it wasn't missing anything.
I assume the only thing that should need changing with juic generated code
will be the package name. BTW - hope that's going ok. I've just started on
doing an rbuic tool by hacking the perl puic C++ tool into ruby - which would
be quite hard to maintain to keep in track with the standard uic. It would be
interesting to try to adapt the XSLT in juic to generate ruby as an option -
maybe that would be easier?
-- Richard
More information about the Kde-java
mailing list