=== 0.6.1 === 2008-11-25 Johan Dahlin * NEWS: Release 0.6.1 2008-11-25 Colin Walters Bug 559705 – Missing association between static methods and classes * docs/typelib-format.txt: * girepository/ginfo.c (g_function_info_get_flags): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (g_ir_node_get_size), (g_ir_node_build_typelib): * girepository/girparser.c (start_function): * girepository/gtypelib.c (g_typelib_check_sanity), (validate_header), (validate_function_blob): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibtransformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: 2008-11-25 Johan Dahlin * giscanner/ast.py: Define socklen_t as an alias for int32. 2008-11-24 Johan Dahlin * girepository/gdump.c (dump_type): Remove a warning, be less verbose on error on fundamental types. 2008-11-23 Johan Dahlin * giscanner/dumper.py: Add license headers, refactor into a class, avoid some duplication and do some extra pedantic checks. 2008-11-23 Johan Dahlin Make it compilable with -Werror on my system by adding a couple of prototypes and including headers. 2008-11-23 Johan Dahlin Bug 562022 – gobject-introspection needs python headers * configure.ac: fail without python headers present. Patch by: Tom Parker 2008-11-21 Johan Dahlin Bug 561617 – Return value array annotations * giscanner/transformer.py: * tests/scanner/annotation.c (annotation_return_array): * tests/scanner/annotation.h: Add support for (array) for return value annotations as well. 2008-11-20 Johan Bilien * tests/everything/everything.[ch]: add a test function which calls a closure. 2008-11-19 Johan Dahlin * giscanner/cachestore.py: Catch ValueError exceptions. 2008-11-18 Tommi Komulainen * tests/scanner/Makefile.am (barapp_SOURCES): fix builddir != srcdir 2008-11-18 Andreas Rottmann * girepository/girnode.c (g_ir_node_build_typelib): Use sizeof() instead of hard-coding struct sizes. 2008-11-18 Owen Taylor Bug 561296 - Add "storage type" to the typelib data for enums 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. 2008-11-18 Owen Taylor Add enums to the Everything test module * tests/everything/everything.[ch]: Add TestEnum and TestFlags to the Everything test module and register them as GTypes. https://bugzilla.gnome.org/show_bug.cgi?id=561296 2008-11-18 Johan Dahlin * giscanner/cachestore.py: Catch BadPickleGet exceptions as well. 2008-11-17 Owen Taylor * tests/everything/everything.c: Fix doc comment annotations for test_struct_b_clone() to refer to the right function. 2008-11-17 Dan Winship * giscanner/glibtransformer.py (GLibTransformer.__init__): fix spelling of GHashTable. #561135 * tests/scanner/annotation.c (annotation_object_get_hash): * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: add a test of GHashTable annotations 2008-11-17 Andreas Rottmann * giscanner/ast.py: Change string array match type to be in terms of canonicalized type. * giscanner/transformer.py: Add canonicalize_ctype which gives us a version of a c:type without aliases, so we can deep canonicalize char** to utf8*. Update parse_ctype to use it. * tests/*: Add gtk_init like int*/char*** arg functions for testing. 2008-11-16 Colin Walters * girepository/girepository.c: Ensure we always call init_globals, even if passed a non-default repository. 2008-11-16 Colin Walters Bug 559706 - Interface prerequisites * common.mk: Dep on libgirepository.la for scanner libs so that we rebuild things even if just gdump.c changes. * girepository/gdump.c: Dump prerequisites. * giscanner/ast.py: Add prerequisite list. * giscanner/girparser.py: Parse them from gdump. * giscanner/girwriter.py: Write them. * giscanner/glibtransformer.py: Resolve them. * tests/*: Test. 2008-11-16 Owen Taylor Bug 561087 - Respect is_pointer in serialize_type() Add a '*' to the serialization for the cases where we set is_pointer in the type blob we write out depending on node->is_pointer. Don't add the '*' in the cases where is_pointer is set or not set in a fixed fashion. http://bugzilla.gnome.org/show_bug.cgi?id=561087 2008-11-16 Owen Taylor Bug 560825 – Add size and alignment to typelib 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. 2008-11-16 Owen Taylor Bug 552371 – implement struct field get/set * girepository/gfield.c girepository/girepository.h: Add convenience functions g_field_info_set_field() and g_field_info_get_field() to set and get fields based on the offsets in GIFieldInfo. 2008-11-16 Andreas Rottmann Bug 560241 - Out-arguments should not be marked as being pointers in all cases * girepository/girparser.c: Improved logic for out arguments. 2008-11-16 Andreas Rottmann Bug 559601 - Pointers in structs/unions unduly treated as arrays * giscanner/transformer.py: Differentiate type creation logic between parameters and struct components. 2008-11-15 Colin Walters * giscanner/dumper.py: Check return code from pkg-config invocations. 2008-11-14 Johan Dahlin * tests/everything/everything.c (test_array_int_in), (test_array_gtype_in): * tests/everything/everything.h: Rename the int/gtype array tests. Make the return value useful, an aggregation of the array input values. 2008-11-14 Johan Dahlin * tests/everything/Makefile.am: * tests/everything/everything.c: * tests/everything/everything.h: * tests/everything/gitesttypes.c: * tests/everything/gitesttypes.h: Rename gitesttypes.[ch] to everything.[ch] 2008-11-13 Andreas Rottmann Bug 560708 – Don't treat arrays that have a length specified as zero-terminated by default * giscanner/transformer.py: Default to non zero terminated for arrays with length. * tests/*: Update, add test for zero vs not. 2008-11-13 Andreas Rottmann Bug 557788 - Return types for constructors in generated typelib bogus * girepository/girnode.c: Namespace-qualify XREFs; not doing so is obviously broken in the face of duplicate names in different namespaces. * tests/scanner/*expected.gir: Fix up. 2008-11-13 Owen Taylor * girepository/girffi.c: Fix "Unexpected time for time_t" message. 2008-11-13 Colin Walters Bug 558436 - avoid having scanner load app code * giscanner/cgobject.py: Delete; we no longer load shared libraries directly. * giscanner/dumper.py: Support for linking a library to a stub binary for introspection. * giscanner/glibtransformer.py: Rewrite to use gdump XML from invocation of child binary. * giscanner/transformer.py: Fix up to use fully qualified name in parse tree. Make parse_ctype public so we can use it inside glibtransformer. * tests/scanner/barapp.c: New test, using --program arg for g-ir-scanner. * tests/*: Update to use common.mk for invoking scanner. * tools/g-ir-scanner: Add options --program, --program-arg, and --no-libtool. * docs/g-ir-scanner.1: Update. 2008-11-13 Colin Walters * configure.ac: Depend on Gio, we use it in gdump.c. * girepository/gdump.c: Code to dump GType data to XML. * girepository/girepository.c: Add option group for dumping. * girepository/girepository.h: Define API for the above. 2008-11-13 Colin Walters * common.mk: Add a file to include with Makefile fragments useful for scanner invocation. 2008-11-13 Tommi Komulainen * tests/everything/gitesttypes.c (test_filename_return): Return strings in filename encoding. 2008-11-13 Owen Taylor Bug 560253 – Add structure and boxed types to Everything test module * tests/everything/gitesttypes.[ch]: Add examples of: Plain old data structs Plain old data structs with nested fields Plain old data boxed Plain old data boxed with nested fields More complicated boxed types with internal state 2008-11-12 Johan Dahlin * tests/everything/gitesttypes.c (test_gtype_in): * tests/everything/gitesttypes.h: Add a test of GType arrays, a la gtk_list_store_set_columns. 2008-11-12 Owen Taylor Bug 560419 – Cache includes when parsing Keep track of all modules parsed within a GIrParser, and when a module is referenced a second time, use the existing parsed copy instead of reparsing. 2008-11-12 Owen Taylor Fix management of ParseContext.includes_modules (#560419) * girepository/girparser.c: Fix some trivial bugs in managing the list of include modules. (Add to module's list twice, not initialized to NULL, not freed.) 2008-11-12 Owen Taylor Keep aliases and disguised_structures local to each module (#560419) * girepository/girmodule.[ch]: When parsing, keep keep a separate hash tables of aliases and 'disguised' flags for each module, and store that on the module. After parsing an include merge the aliases/disguised flags to the including module. * girepository/girparser.c: Remove 'prefix_aliases' flag and always prefix aliases/disguised structure types when parsing; this simplifies the code considerably. 2008-11-12 Owen Taylor Fix mismatches between .gir name and 'name' attribute (#560419) * tests/boxed.gir tests/constant.gir tests/enum.gir tests/invoke/invoke.c tests/invoke/testfns-1.0.gir tests/object.gir tests/struct.gir: Fix places where the 'name' element of didn't match the filename of the gir, an assumption that the compiler has always expected and now enforces. 2008-11-12 Owen Taylor Only allow one element per (#560419) * girepository/girparser.c: The logic in girparser.c didn't work very well if there were multiple nodes within a single (context->namespace was always the overall filename and not the the name specified in the element for one thing; this would cause aliases to be mis-prefixed in include modules.) Also check that the "name" in the node matches the filename. 2008-11-12 Owen Taylor Add a GirParser object to hold the state of a compilation * girepository/girparser.[ch] tools/compiler.c: Add a toplevel GirParser object to hold state that is global across a compilation. Currently just holds the include path, but will eventually also keep a cached list of parsed modules. 2008-11-12 Tommi Komulainen * girepository/girepository.c (find_namespace_latest): Fix minor memory leak. 2008-11-12 Tommi Komulainen * configure.ac: use 'introspection' component for bugs 2008-11-12 Johan Dahlin * tests/everything/gitesttypes.c (test_filename_return): * tests/everything/gitesttypes.h: Add a filename return test. 2008-11-12 Tommi Komulainen * tests/offsets/Makefile.am (gitestoffsets.c): fix gen-gitestoffsets invocation with builddir != srcdir 2008-11-12 Johan Dahlin * 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. 2008-11-12 Johan Dahlin * gir/Makefile.am: Remove unused variables, add a dependency of girepository.ch, so when they change we rebuild the gir automatically. 2008-11-12 Johan Dahlin * girepository/girepository.c (g_irepository_get_search_path): * girepository/girepository.h: Add a g_irepository_get_search_path, so we can access the search paths from runtime. 2008-11-12 Johan Bilien Bug 560474 – g-ir-compiler crashes when compiling the glib gir * girepository/girparser.c: avoid freeing an uninitialized pointer 2008-11-12 Johan Dahlin * gir/Makefile.am: * giscanner/glibtransformer.py: * tools/g-ir-scanner: Add a GIRepository-2.0.gir. Change the libtool lookup slightly so we can just pass in --library=foo/bar/baz.la and the scanner does the right thing. Don't warn for _get_type() functions if they don't take any parameters 2008-11-11 Owen Taylor Bug 560404 – Prefix types when resolving aliases in included modules * girepository/girparser.c: When resolving aliases in an included module, prefix types before looking them up. 2008-11-11 Owen Taylor Compute field offsets and overall size for object structures Bug 560326 – Fails to build Gtk-2.0.typelib with "Unexpected non-pointer field of type object in structure" Do basic computation of field offsets for objects and interfaces; this doesn't attempt to address all of the "mess" for virtual functions described in Bug 560281. 2008-11-11 Tommi Komulainen Bug 560308 – g-ir-compiler goes in infinite loop on Gdk-2.0.gir Based on patch by Johan Bilien. * giscanner/transformer.py (_create_member, _create_parameter): Resolve types here as well. (_resolve_type_name_1): Try resolving using 'ctype' first since it's least ambiguous. Fixes struct member type resolution with similarly named types, e.g. Gdk.PangoRendererClass and Pango.RendererClass * tests/scanner/foo*: Add test. 2008-11-11 Owen Taylor * girepository/girparser.c: Search provided include dirs before the default directories. 2008-11-11 Owen Taylor * girepository/giroffsets.c: Include fully-qualified names in all error messages. 2008-11-11 Owen Taylor * girepository/giroffsets.c: Fail gracefully with an informative error message when recursion is encountered when computing a structure size. 2008-11-11 Owen Taylor * girepository/girparser.c: Remove an unused variable. 2008-11-10 Owen Taylor Add tests for field offset computations * tests/offsets/offsets.h: Header file with structure definitions to test * tests/offsets/gen-gitestoffsets: Generate a C program that computes field offsets for the structures in offsets.h two ways: using the information from a generated typelib, and as computed by the compiler. We diff these two versions to test that everything is OK. 2008-11-10 Owen Taylor Remove field offsets from g-ir-generate output and test inputs Field offsets are a) architecture dependent so they shouldn't be part of the architecture-independent gir format which is installed in datadir. b) Are architecture-dependent so they shouldn't be in test expected output. * girepository/girparser.c: Don't parse offset for fields * tools/generate.c: Don't parse offset for fields * tests/*.gir test/scanner/*.tgir: Remove offsets (Virtual function and discriminator offsets are not removed, as they aren't fully hooked up to the field-offset computation machinery yet.) 2008-11-10 Owen Taylor Bug 560252 - Compute field offsets before writing typelib * girepository/girnode.h: Store the total size and alignment for GIrNodeStruct/Boxed/Union. * girepository/giroffset.c: New file implementing computation of structure field offsets. * girepository/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. 2008-11-10 Owen Taylor Bug 560250 - Fully parse included modules 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. 2008-11-10 Owen Taylor Split g_ir_ffi_get_ffi_type() out from ginvoke.c Extract a function to convert GITypeTag to ffi_type from the internals of ginvoke.c. This will be useful in figure out structure alignment. Also fix handling of gsize and time_t to be portable. (Add a check to configure.ac to figure out the width of time_t.) 2008-11-10 Owen Taylor Bug 560248 – "disguised structures" Certain types like GIConv and GdkAtom are pointers internally but don't look like pointers when referenced. They have the form. typedef struct _X *X; Parse these as structures/records but mark them in the gir with a 'disguised' attribute so that we know that they need special handling. In the typelib treat them like any other structure. 2008-11-09 Jürg Billeter * giscanner/ast.py: * giscanner/girwriter.py: Write throws attribute for virtual functions, fixes bug 559703 2008-11-07 Johan Dahlin * giscanner/libtoolimporter.py (LibtoolImporter.find_module): Clear up some confusion about the second argument to find_module, it's actually the packages __path__ attribute which we can safely ignore for our purposes. (LibtoolImporter.load_module): Set module.__loader__ as per PEP 302. 2008-11-07 Owen Taylor Bug 559737 – Deal with continuations in macros * giscanner/giscannerlexer.l: Treat continuation lines the same as regular newlines. This makes the scanner not complain about #define foo(x) \ inside a C file. There's no attempt however to handle parsing macro definitions split across lines. 2008-11-07 Johan Dahlin * giscanner/cachestore.py: Handle broken cache entries, write only filesystems and running out of diskspace. 2008-11-07 Owen Taylor * giscanner/giscannermodule.c (pygi_source_scanner_lex_filename): Set current_filename before lexing the file so error messages are reported in the right file. 2008-11-06 Colin Walters * tests/everything/*: Add some tests for strv. 2008-11-05 Colin Walters * girepository/ginvoke.c (g_function_info_invoke): Don't use nested scope local variable for error which may go away after conditional is complete. 2008-11-05 Colin Walters * giscanner/scannerlexer.l: Avoid static 256 char buf which we manipulate hackily; just use GString. This avoids an uninitialized memory read pointed out by Havoc. 2008-11-04 Johan Dahlin * giscanner/__init__.py: * giscanner/ast.py: * giscanner/cachestore.py: * giscanner/cgobject.py: * giscanner/girparser.py: * giscanner/girwriter.py: * giscanner/giscannermodule.c: * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/libtoolimporter.py: * giscanner/minixpath.py: * giscanner/odict.py: * giscanner/sourcescanner.c: * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/utils.py: * giscanner/xmlwriter.py: * COPYING: Relicense the giscanner library under LGPLv2+. This has been approved by all contributors. 2008-11-01 Owen Taylor Bug 558848 giparser.py: shared library should be optional When parsing a .gir, allow the shared-library attribute of to be missing: this corresponds to the handling in libgirepository and elsewhere. 2008-11-01 Tommi Komulainen Bug 557898 – Fails to build on OSX 10.4 * configure.ac: Check for $shrext_cmds that should be implicitly available if you're using libtool >= 2.0. If undefined, call libtool --config explicitly to get its value. * girepository/gtypelib.c: Remove special case for (non-)Darwin systems as unneeded. 2008-10-31 Colin Walters * COPYING, COPYING.lib, COPYING.tools: Clarify licensing status. 2008-10-31 Johan Dahlin * configure.ac: Post release version bump