3 May 2009

gtk-doc is not listing your properties and signals?

I’ve got to share what I just found about gtk-doc.  I’ve been using it for months now to document libchamplain’s API.  It was complex to setup but the result is worth it.  Here is my experience about how to get your properties and signals to show up:

  • Is my_object_get_type listing in the .types file?
  • Is the section correctly identified in your doc and -docs.sgml?
  • And today’s discovery: is your object struct declared as a typedef?

To make that last point explicit:

typedef struct
{
  GObject parent;
} MyObject;

will produce minimalistic documentation while

typedef struct _MyObject MyObject;

struct _MyObject
{
  GObject parent;
};

will produce complete documentation with properties, signals and object hierarchy.

Consider yourself warned! :)

Comments (3)

  1. 4 May 2009
    James Henstridge said...

    Perhaps this should be considered a bug rather than a quirk of the tool?

  2. 4 May 2009
    Sven Neumann said...

    Thanks. I was wondering for quite a while now what’s wrong about the gtk-doc setup in two libraries that I set up recently. Apparently it was a bad idea to list the foo-types.h header file in IGNORE_HFILES. Without the typedefs in that file, gtk-doc was not producing complete object documentation.

  3. 4 May 2009
    Marc-Andre Lureau said...

    What about updating http://live.gnome.org/DocumentationProject/GtkDoc :)