Re: Creating GObject/GTK bindings for language



----- "Tristin Celestin" <tristin_celestin yahoo com> wrote:

> I want to be able to use GObject and GObject based libraries from an
> object oriented scripting language with no bindings for GObject and
> GObject based libraries currently.
> 
> 
> How does one go about creating GObject bindings for another language?
> I've read the GObject-Introspection pages at gnome.org and looked at
> the
> PyGobject binding, but I still don't have a clear idea of where to
> start.

Which language?  Have you ever done bindings in that language before?  Usually you would wrap a library by making equivalent API calls in that language and marshaling API parameters and results using the glue C/C++ libraries that the language provides for creating modules.  More complex libraries usually have some sort of automation for this and some languages have generic automated 
binding tools like SWiG.  With the advent of GObject-Introspection you can now write a minimal interface module that reads in the gir files and routes and marshals method calls based on the gir data structure.  PyGObject is a poor library to look at because it does not yet use GObject-Introspect and does the wrapping with its own targeted tool.  It is better to look at the Gjs or Seed javascript bindings.  Every language is going to be different as they all have their own API for creating C extension modules so again, you need to know how to wrap a simple library in your language before tackling GTK+.

--
John (J5) Palmieri
Software Engineer
Red Hat, Inc.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]