JGIR (java-gobject-introspection)

The JGIR project is a Java bytecode-based compiler using GObjectIntrospection. It converts the .typelib files that come with libraries into .jar files. It also includes a custom GLib/GObject interface layer adapted from gstreamer-java.

Take a look at a screenshot and JGIR Sample Code.

Design

The overriding goals of java-gobject-introspection are to be complete and correct. We want you to never get blocked writing an application because some bit of the C isn't bound. Today, you can reach out and use GStreamer, hippo-canvas, Gio, virtually all of GTK+, libnotify, and plenty more from the comfort and power of Eclipse and the JVM. For more, see JGIR Desing.

Contact

Join irc.gimp.net#introspection. Bug tracker/mailing list coming soon.

Code

Currently in http://git.gnome.org/browse/java-gobject-introspection:

  git clone git://git.gnome.org/java-gobject-introspection

Building

  • (Temporary note: you will need to use JNA from from SVN, at least r700)

You must have gobject-introspection, gir-repository and Python >= 2.3 installed. Additionally, the project depends on the ASM, JNA and gnu-getopt Java libraries. Internally, the waf http://code.google.com/p/waf/ build system is used, but a simple "configure" and "Makefile" wrapper is provided. You may use the standard:

./configure --prefix=...
make 
sudo make install

After installation, you can run the script:

jgir-compile-all

This will generate .jar files for each .typelib file you have installed. Here's a snapshot of my system, 20080902:

-rw-rw-r-- 1 walters walters   84569 2008-09-02 17:53 /src/build/gi/share/girepository/Atk.jar
-rw-rw-r-- 1 walters walters    9644 2008-09-02 17:53 /src/build/gi/share/girepository/cairo.jar
-rw-rw-r-- 1 walters walters    4922 2008-09-02 17:53 /src/build/gi/share/girepository/ClutterCairo.jar
-rw-rw-r-- 1 walters walters    6290 2008-09-02 17:53 /src/build/gi/share/girepository/ClutterGtk.jar
-rw-rw-r-- 1 walters walters  178134 2008-09-02 17:53 /src/build/gi/share/girepository/Clutter.jar
-rw-rw-r-- 1 walters walters   19587 2008-09-02 17:53 /src/build/gi/share/girepository/ClutterJson.jar
-rw-rw-r-- 1 walters walters    4176 2008-09-02 17:53 /src/build/gi/share/girepository/fontconfig.jar
-rw-rw-r-- 1 walters walters    4123 2008-09-02 17:53 /src/build/gi/share/girepository/freetype2.jar
-rw-rw-r-- 1 walters walters  151304 2008-09-02 17:53 /src/build/gi/share/girepository/Gdk.jar
-rw-rw-r-- 1 walters walters   26721 2008-09-02 17:53 /src/build/gi/share/girepository/GdkPixbuf.jar
-rw-rw-r-- 1 walters walters  146993 2008-09-02 17:53 /src/build/gi/share/girepository/Gio.jar
-rw-rw-r-- 1 walters walters    5850 2008-09-02 17:53 /src/build/gi/share/girepository/GL.jar
-rw-rw-r-- 1 walters walters    5245 2008-09-02 17:53 /src/build/gi/share/girepository/GModule.jar
-rw-rw-r-- 1 walters walters  192600 2008-09-02 17:53 /src/build/gi/share/girepository/Gst.jar
-rw-rw-r-- 1 walters walters 1054485 2008-09-02 17:53 /src/build/gi/share/girepository/Gtk.jar
-rw-rw-r-- 1 walters walters   99622 2008-09-02 17:53 /src/build/gi/share/girepository/HippoCanvas.jar
-rw-rw-r-- 1 walters walters    1995 2008-09-02 17:53 /src/build/gi/share/girepository/JSCore.jar
-rw-rw-r-- 1 walters walters    4075 2008-09-02 17:53 /src/build/gi/share/girepository/libxml2.jar
-rw-rw-r-- 1 walters walters    8775 2008-09-02 17:53 /src/build/gi/share/girepository/Notify.jar
-rw-rw-r-- 1 walters walters    5172 2008-09-02 17:53 /src/build/gi/share/girepository/PangoCairo.jar
-rw-rw-r-- 1 walters walters   13562 2008-09-02 17:53 /src/build/gi/share/girepository/PangoFT2.jar
-rw-rw-r-- 1 walters walters   70116 2008-09-02 17:53 /src/build/gi/share/girepository/Pango.jar
-rw-rw-r-- 1 walters walters    8689 2008-09-02 17:53 /src/build/gi/share/girepository/PangoXft.jar
-rw-rw-r-- 1 walters walters    5845 2008-09-02 17:53 /src/build/gi/share/girepository/PangoX.jar
-rw-rw-r-- 1 walters walters   41275 2008-09-02 17:53 /src/build/gi/share/girepository/WebKit.jar
-rw-rw-r-- 1 walters walters    3912 2008-09-02 17:53 /src/build/gi/share/girepository/xft.jar
-rw-rw-r-- 1 walters walters   14114 2008-09-02 17:53 /src/build/gi/share/girepository/xlib.jar

Status

JGIR can currently do:

  • Load a Repository and generate Java bytecode for:
  • A Java class hierarchy reflecting the GObject classes
  • Constructors and methods with just IN parameters
  • Enumerations (but not yet fields)
  • Interfaces
  • Beginning of boxed type support
  • Signals

Tasklist

  • Support INOUT/OUT parameters
  • Support custom subclassing with vfunc overrides
  • Lists
  • Out arguments
  • Double check memory management

Projects/JGIR (last edited 2014-06-19 22:56:33 by DanielEspinosaOrtiz)