David posted recently on his experiences adding introspection to GUdev (cool!), and this reminded me to bring up something which I think is very useful.

If you are a maintainer of a library, or an application which exposes an API (to plugins, etc…), please consider adding introspection to your build system! Essentially, what works in the various introspection based bindings, is what we’ve had an opportunity to test, and every new library shows a few new corner cases, finding these is very useful (this is why in the Seed source tree, there are a large number of examples, trying to get an idea of how well introspection works with various libraries).

If you are looking for an example of how to do this, Clutter is a very good one I think. Essentially you first need introspection.m4, and then GOBJECT_INTROSPECTION_CHECK([0.6.3]) in configure.ac. Then, to the appropriate Makefile.am, you need to add the actual calls to the scanner and the compiler. See libclutter’s Makefile.am (around line 248). In most cases it will actually be a little simpler than it is in Clutter.

If you’d like introspection in your library/app, also feel free to email me, and assuming it’s not a complicated case, I’m perfectly willing to cook up a quick patch, and test some things out.

2 Responses to “Making your library introspectable.”

  1. nacho Says:

    I was investigating some time ago to add introspection to gedit, but the problem I found was that for now this is only good if you want javascript support on your application, and as we need python on gedit this is not a good idea. Any news on the python support with pybank?

  2. [...] related to your search Robert Carr: Making your library introspectable. is now available in this link…: News [...]

Comments are closed.