Include the size and alignment of structures and unions in the typelib,
and add getter methods to retrieve them from GIStructInfo/GIUnionInfo.
* docs/typelib-format.txt girepository/gtypelib.h girepository/girnode.c
girepository/girmodule.c girepository/gtypelib.c: Add size and alignment
to StructBlob and UnionBlob.
* girepository/ginfo.c girepository/girepository.h:
Add g_[struct|union]_get[size|alignment]().
* test/offsets/gen-gitestoffsets: Test overall structure size and alignment.
svn path=/trunk/; revision=930
2008-11-12 Johan Dahlin <jdahlin@async.com.br>
* girepository/girepository.c:
Change the element type from utf8 to filename
* girepository/girnode.c (g_ir_node_build_typelib):
Special case filename equally to utf8 here.
svn path=/trunk/; revision=895
girnode.h: Store the total size and alignment for
GIrNodeStruct/Boxed/Union.
giroffset.c: New file implementing computation of structure
field offsets.
girnode.c: Compute structure field offsets before writing types
into the typelib.
docs/typelib-format.txt: Document that a field offset of 0xFFFF
means "unknown". Also fix description of the discriminator_offset
field for unions.
svn path=/trunk/; revision=876
For some things, like computing structure offsets to put into the typelib
we need more than just the aliases from included modules. Do a completel
parse of included modules and store in module->included_modules.
Also add g_ir_find_node() to find node information from within the
active set of modules and their includes.
svn path=/trunk/; revision=874
2008-10-24 Johan Dahlin <johan@gnome.org>
* girepository/girnode.c (g_ir_node_check_unhandled_members):
Be quiet, do not warn about unhandled members.
svn path=/trunk/; revision=811
2008-10-21 Johan Bilien <jobi@via.ecp.fr>
Bug 557241 – "throws" flag for functions
* tests/scanner/drawable-1.0-expected.gir,
tests/scanner/drawable-injected-1.0-expected.gir,
tests/scanner/drawable.[ch]: add simple test for throwing
function (has GError ** as last argument)
* giscanner/ast.py: add a 'throws' flag to Function
* giscanner/glibtransformer.py: if a function's last paramerter is
a GError, set the 'throws' flag and remove that parameter
* giscanner/girwriter.py: write out the 'throws' attribute
* giscanner/girparser.py: support parsing the 'throws' attribute
* tests/repository/gitestthrows.c: add a simple test to check the
throws flag in a typelib and invoke the function
* girepository/ginfo.c, girepository/girnode.[ch],
girepository/girnode.h, girepository/girparser.c,
girepository/girepository.h: Add and parse the GI_FUNCTION_THROWS flag
* girepository/ginvoke.c: if a function throws, add a GError as last
arguments, and propagate the error to the invoker.
svn path=/trunk/; revision=773
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
Bug 556434 – unhandled interface/object/... member types
* girepository/girnode.c (g_ir_node_check_unhandled_members,
g_ir_node_build_typelib): Check all
interface/object/boxed/struct/union members are processed and
abort if they are not. (Mostly callbacks in structs, but also
fields in interfaces.)
svn path=/trunk/; revision=722
2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi>
* a/girepository/girnode.c (g_ir_node_build_members,
g_ir_node_build_typelib): refactor common code for processing
members to a function
svn path=/trunk/; revision=721
* girepository/girnode.c: Allow gtype_name
and gtype_init in struct and union.
* girepository/girparser.c: Parse glib:
boxed bits for both structure and union.
* girepository/gtypelib.c: Don't barf
if structure is boxed.
* giscanner/girparser.py: Parse new XML
format.
* giscanner/girwriter.py: Write out new
XML format.
* giscanner/glibast.py: Define new classes
which are both Boxed and Struct/Union, as
well as an "Other" for everything else.
* giscanner/glibtransformer.py: Handle
boxed types specially; we try to merge
them with a struct/union if one exists,
otherwise fall back to generic boxed.
* tests/*: Update.
* tools/generate.c: Write out new format.
svn path=/trunk/; revision=575
2008-08-28 Tor Lillqvist <tml@novell.com>
* tools/compiler.c (write_out_typelib): Use binary mode for output
file on Windows.
* girepository/girnode.c: Don't print NULL strings.
* tests/invoke/Makefile.am
* tests/scanner/Makefile.am: Use -no-undefined on Windows to
convince libtool to build shared libraries.
* tests/invoke/invoke.c: Don't needlessly include <dlfcn.h>. Use
g_assert() instead of printing out expected errors.
svn path=/trunk/; revision=509
2008-08-21 Colin Walters <walters@verbum.org>
* girepository/girnode.c (write_string): Tweak to
use UINT instead of INT. Not likely to matter.
* girepository/girmodule.c (g_ir_module_build_typelib):
Add to header_offset as well for header strings
to match what write_string does.
* girepository/gtypelib.c: Replace is_name with
validate_name, which more strongly validates and
handles errors in a better way. Update all callers.
* giscanner/glibtransformer.py: Handle constructors
better.
svn path=/trunk/; revision=439
2008-08-13 Johan Dahlin <johan@gnome.org>
* girepository/girnode.c (g_ir_node_get_full_size_internal):
* girepository/girparser.c (start_class):
* giscanner/glibtransformer.py:
Allow get_type to be None, set a get_type for GInitiallyUnowned too.
svn path=/trunk/; revision=362
2008-08-12 Colin Walters <walters@verbum.org>
* giscanner/transformer.py: Record typedefs as <alias> elements.
Also attempt to look up types in external namespaces.
* giscanner/girwriter.py: Write them.
* giscanner/glibtransformer.py: Rework resolver using real instanceof
checks. Resolve interface methods and properties.
* tests/scanner/foo-object.h: Add a method with typedef.
* tests/scanner/Foo-expected.gir: Update.
* girepository/girnode.c: Debug tweaks.
* girepository/girparser.c: Make a first pass through the XML where we
record all the aliases. This lets us resolve them as we go through the
second pass.
* gir/Makefile.am: Don't install gobject-2.0.gir; we want that to come
from gir-repository.
svn path=/trunk/; revision=355
2008-08-12 Colin Walters <walters@verbum.org>
* girepository/girparser.c, girepository/gtypelib.c,
girepository/gtypelib.h, girepository/girnode.c:
Remove usage of (GAPI-oriented) TypeTag in favor of
GITypeTag from girepository.h.
svn path=/trunk/; revision=347