In order to set and get enum and flag fields in structures, we need
to know the integral type that the enumeration is stored as. We are already
computing that at compile time in order to compute struct offsets, so the
easiest thing to do is to save that in the typelib.
* docs/typelib-format.txt girepository/girnode.[ch] girepository/giroffsets.c
girepository/gtypelib.h: Add 'storage_type' to the typelib format for EnumBlob
and compute and save it at compile time.
* girepository/girepository.h girepository/ginfo.c:
Add g_enum_info_get_storage_type().
* girepository/gfield.c: Implement reading and writing enum and flags fields
based on the storage type.
http://bugzilla.gnome.org/show_bug.cgi?id=561296
svn path=/trunk/; revision=944
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-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
* girepository/gtypelib.h (BLOB_IS_REGISTERED_TYPE): added
* girepository/girepository.c (find_interface): Fix
find_by_gtype case to get the type name from right offset
svn path=/trunk/; revision=686
2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi>
* girepository/gtypelib.h (RegisteredTypeBlob): make
'unregistered' one bit wide as everywhere else
svn path=/trunk/; revision=684
This is a big patch. You should probably remove your installation
tree to be cleaner.
* docs/typelib-format.txt: Add nsversion entry which holds
version of namespace.
* girepository/girepository.h: Add 'version' parameter to
g_irepository_require. This may be NULL. Normally
bindings should pass an explicit version though.
* girepository/girepository.c: Lots of infrastructure to
support versioning. Add some more documentation. Disallow
some usage of NULL namespaces.
* girepository/girmodule.c: Add version parameter.
* girepository/gtypelib.c: Update header size.
* giscanner/ast.py: Add version to Namespace.
* giscanner/girparser.py: Parse version attribute from
XML, pass to Namespace.
* giscanner/girwriter.py: Write out version parameter.
* giscanner/transformer.py: Clean up include registration.
* tests/*: Add version attribute.
* tests/invoke/invoke.c: Don't try looking up test before
it's loaded in repository.
* tools/generate.c: Output version parameter.
* gir/Makefile.am: Add 2.0 version to .gir files.
svn path=/trunk/; revision=677
2008-10-06 Lucas Rocha <lucasr@gnome.org>
Bug 555294: Add support for multiple shared libraries per typelib.
* girepository/ginvoke.c (g_function_info_invoke),
girepository/ginfo.c(g_registered_type_info_get_g_type): use
g_typelib_symbol instead of g_module_symbol.
* girepository/girepository.h: remove g_typelib_set_module and add
g_typelib_symbol.
* girepository/gtypelib.[ch] (find_some_symbol, _g_typelib_init,
g_typelib_new_from_memory, g_typelib_new_from_const_memory,
g_typelib_free, g_typelib_symbol): chnage GTypeLib to hold a list of
modules instead of just one. The symbol lookup is now abstracted
behind g_typelib_symbol which tries to find the passed symbol name in
one of its modules.
* giscanner/girwriter.py, tools/g-ir-scanner: change scanner to read
and write shared_library attribute as a comma-separated list of libs.
svn path=/trunk/; revision=660
* gir/Makefile.am: Dep on Makefile
* girepository/ginfo.c: Print out a nicer error
message if we failed to load something.
* girepository/girepository.c: Clean up
default typelib handling; remove global
default_typelib variable. Ensure we handle
NULL repository in more places.
Support dependency resolution.
* tests/Makefile.am: Kill off gobject.gir,
it conflicts with the real one.
* tests/Object.gir: Depend on GObject.
* tools/generate.c: Take --includedir
argument to say which directories to search
for typelibs. Print out dependencies.
svn path=/trunk/; revision=541
2008-08-28 Tor Lillqvist <tml@novell.com>
* girepository/gtypelib.h: Change type of bitfield fields from
guint to the most suitable smaller type. This makes the struct
sizes match the ones on Linux that the sanity check expects when
using gcc -mms-bitfields on Windows.
svn path=/trunk/; revision=508
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