gtkdoc, Bonobo, and struct parsing



It looks like the way that gtkdoc-scan parses struct definitions is
allowing a number of structs to fall through the cracks, so to speak.
For example, the familiar declaration style, like in
bonobo-embeddable.h, work fine:

  typedef struct _BonoboEmbeddableClass   BonoboEmbeddableClass;

However, quite a few header files in Bonobo aren't using this format,
e.g., bonobo-selector.h:

  typedef struct {
          GnomeDialogClass parent_class;

          void (* ok)     (BonoboSelector *sel);
          void (* cancel) (BonoboSelector *sel);
  } BonoboSelectorClass;

These declarations don't end up in bonobo-decl.txt, and thus cause
warnings when gtkdoc-mkdb is run:

  WARNING: No declaration for: BonoboSelectorClass

The HTML output of each (embeddable vs. selector) is pretty similar,
though, and mostly correct, so it's not a critical bug.  Both have the
actual Class struct (and contents) in the HTML, but the synopsis
contains slightly different output:

  struct      BonoboEmbeddable;
  typedef     BonoboSelector;

The main issue, I guess, is the spew of warnings.  There may be other
subtle issues from the structs not being flagged by gtkdoc-scan (i.e.,
AddSymbolToList () isn't called on BonoboSelectorClass).

So, would it be better to fix this in gtkdoc-scan, or should we just
tweak the Bonobo header files to match the style in the rest of Bonobo
(not to mention GNOME & GTK+)?  Not sure how clean the fix to
gtkdoc-scan would be, since the actual struct name isn't on the same
text line as the 'typedef' (have to maintain state info between
successive lines when you hit one of these structs...?).

I'd be happy to whip up a patch to "fix" the Bonobo header files to
use the more common style.

John

-- 
dusk ravendusk org                            http://www.gnome.org
jsheets codeweavers com                  http://www.worldforge.org
jsheets users sourceforge net     http://openbooks.sourceforge.net
               http://advogato.org/person/jsheets

                   Writing Gnome Applications
          http://www.aw.com/cseng/titles/0-201-65791-0/




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