Bug 551738 - Associate classes with their structs
authorColin Walters <walters@src.gnome.org>
Fri, 6 Feb 2009 18:37:13 +0000 (18:37 +0000)
committerColin Walters <walters@src.gnome.org>
Fri, 6 Feb 2009 18:37:13 +0000 (18:37 +0000)
commitd1bf6a23c6fa14e918aa93e346237b1c832fb2ea
tree715bf149bfa948eed8a1da945e2c0984ea81df73
parent3ae9127e53032065df14be8539aba0cf50835386
Bug 551738 - Associate classes with their structs

Inside glibtransformer, we now look at structures ending in "Class" and
see if they have an associated GlibObject (i.e. a structure of the same
name without the "Class" suffix).  If found, pair them up.

The .gir file for <class> gains an attribute denoting its associated
class struct.  Any <record> many now have a glib:is-class-struct-for
annotation which tells which (if any) <class> for which it defines the
layout.

In the .typelib, we record the association between the class and
its structure.  Generic structures however just have a boolean
saying whether they're a class struct.  (Going from a generic class
struct to its class should not be necessary).

Finally, we expose GIRepository APIs to access both bits of information
from the .typelib.

svn path=/trunk/; revision=1088
23 files changed:
docs/typelib-format.txt
girepository/ginfo.c
girepository/girepository.h
girepository/girmodule.c
girepository/girnode.c
girepository/girnode.h
girepository/girparser.c
girepository/gtypelib.c
girepository/gtypelib.h
giscanner/ast.py
giscanner/girwriter.py
giscanner/glibtransformer.py
tests/scanner/BarApp-1.0-expected.gir
tests/scanner/BarApp-1.0-expected.tgir
tests/scanner/annotation-1.0-expected.gir
tests/scanner/annotation-1.0-expected.tgir
tests/scanner/drawable-1.0-expected.gir
tests/scanner/drawable-1.0-expected.tgir
tests/scanner/foo-1.0-expected.gir
tests/scanner/foo-1.0-expected.tgir
tests/scanner/utility-1.0-expected.gir
tests/scanner/utility-1.0-expected.tgir
tools/generate.c