Search code examples
bindingdgnomeglibgobject

gobject/gnome/glib bindings for D using GIR?


Does anyone know if there are bindings for the gobject family of librares (glib, Gnome, clutter, etc) available for the D language that use the GIR introspection mechanism?

I would like to write an app targeting GTK 3 and Clutter. Unfortunately, I can't seem to find them. Given that GIR should allow bindings to be generated automatically for all libraries that have introspection information available, this surprises me. Does such a thing actually exist? (One big drawback of D is that it's practically impossible to search for on Google...)

(Incidentally, I do know about gtkD, but that only targets GTK 2 and doesn't do Clutter.)


Solution

  • Project giD (nicknamed "giddy") provides auto-generated bindings for most frequently used GNOME/GTK libraries.

    GitHub: https://github.com/Kymorphia/gid DUB: https://code.dlang.org/packages/gid

    At the moment of writing this text giddy provides bindings for the following libraries:

    • Arrow
    • ArrowDataset
    • ArrowFlight
    • Atk
    • Cairo
    • Gdk 4
    • GdkPixbuf
    • Gio 2
    • GLib 2
    • GObject
    • Gsk
    • Gtk 4
    • GtkSource 5
    • Pango
    • Parquet
    • RSvg 2
    • Soup 3
    • Vte 3

    We will soon have Gtk 3 too, and will also add Vte 2 as it depends on Gtk 3. Focus for the first stable release is on Gtk 4 and Gtk 3, and related libraries.

    All these bindings are generated using the "gidgen" project ( https://github.com/Kymorphia/gidgen ) so if giddy is missing a library, it is easy to generate binding for it if there is a Gir file for it. Most of the time it is as easy as having a one-line gidgen "def" file!

    The author also provides a separate GitHub project that demonstrates Gtk 4 binding - https://github.com/Kymorphia/gid-gtk4-examples

    Documentation: https://gid.dpldocs.info/index.html