This site has been retired. For up to date information, see handbook.gnome.org or gitlab.gnome.org.


[Home] [TitleIndex] [WordIndex

This page has been deprecated, see

/!\ Warning:
This page has been deprecated, see GObjectIntrospection/AutotoolsIntegration instead for the latest instructions

Guidelines for adding gobject-introspection support to libraries

From http://blogs.gnome.org/racarr/2009/06/07/making-your-library-introspectable/

"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."

Rough Guide to g-ir-scanner arguments

The following, at the moment, is a very rough guide based on limited and rough experience, not fact...

As you can see by looking through the patches to add introspection support to libchamplain, gnome-games (and part two), and clutter-gtk (this one is particularly smooth), there are quite a handful of arguments to g-ir-scanner that one needs to worry about when setting up GIR generation:

--namespace <packagename>

--nsversion=<api version>

--strip-prefix=<prefix>

--include=<included gir>

--pkg <pkgconfig package>

--library=<library name>

--c-include=<header.h>


2024-10-23 11:17