Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [platform-swt-dev] swt, gtk and gcj

Title: RE: [platform-swt-dev] swt, gtk and gcj

> From: Havoc Pennington [mailto:hp@xxxxxxxxxx]
>
> > If people are working on gtk bindings, it would be really nice to
> > provide both JNI and CNI bindings.  gcj supports JNI, but CNI is
> > pretty zippy.  It should be possible to do this with careful
> > planning up front.
>
> Do JNI and CNI result in the same Java API, just different C stubs?

They can both use the same Java API.  If you would compare the two
C stubs CNI is easier to understand and write than JNI.  The only
problem with CNI is that you cannot use the commercial JDK/JRE provided
by IBM and Sun.  CNI is the right solution if you only intend to compile
native code with gcj.  JNI gives you the flexibility to compile natively
or compile to bytecode and run in the JRE.

At some time in the future I plan to provide CNI stubs for the java-gnome
project.  This is not a high priority for the project and will not begin
until I have complete support for GNOME 2, Bonobo, etc.


> GTK 2 comes with "defs" files that spec all the functions and types in
> easy-to-parse form, so we could probably autogenerate 90% of the C
> code, making it easy to change the between stub formats. The other
> idea mentioned so far is to just use java-gnome (once it's moved to
> GTK 2).

I now have java-gnome working with GLIB/GDK/GTK 2.0.  I will be checking
the code into cvs over the next two days.  There are still a few things
missing and broken.  I have no support for Pango or ATK at this time.  Also,
the signal handling is broken.  I need to study the new signal code in the
GLIB library over the next day or two to fix this problem.


Back to the top