platform/upstream/gobject-introspection.git
15 years agoRemove g_irepository_register_file in favor of g_irepository_require.
Colin Walters [Wed, 20 Aug 2008 23:56:40 +0000 (23:56 +0000)]
Remove g_irepository_register_file in favor of g_irepository_require.

2008-08-20  Colin Walters  <walters@verbum.org>

* girepository/girepository.c: Remove
g_irepository_register_file in favor of
g_irepository_require.  There are two
possible deployment scenarios for typelibs:
First, separate in $DATADIR/gitypelibs/.  Second,
they may be embedded in shlibs.  However since
the first is now the normal case, the API is
optimized around it.

Refactor internals to look up typelibs for
namespaces just-in-time, but we expect
consumers to call g_irepository_require.

Also, add some docs.  No one has died from that
before.
* gir/Makefile.am: Need --library for glib.
* giscanner/girwriter.py: Write out shared-library.
* tools/g-ir-writer: Take the first --library
argument as the target of shared-library.  In
the future we should make this nicer with pkg-config
probably.

svn path=/trunk/; revision=426

15 years agoAnd parse them.
Colin Walters [Wed, 20 Aug 2008 19:57:10 +0000 (19:57 +0000)]
And parse them.

2008-08-20  Colin Walters  <walters@verbum.org>

* girepository/girparser.py: And parse them.

svn path=/trunk/; revision=425

15 years agoAdd gshort/gushort types
Johan Dahlin [Wed, 20 Aug 2008 19:31:23 +0000 (19:31 +0000)]
Add gshort/gushort types

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * giscanner/glibast.py: Add gshort/gushort types

svn path=/trunk/; revision=424

15 years agoInstall GObject.typelib
Johan Dahlin [Wed, 20 Aug 2008 19:26:20 +0000 (19:26 +0000)]
Install GObject.typelib

svn path=/trunk/; revision=423

15 years agoRename .gir files using GI namespace. Use XDG_DATA_DIRS for looking up
Colin Walters [Wed, 20 Aug 2008 19:17:14 +0000 (19:17 +0000)]
Rename .gir files using GI namespace. Use XDG_DATA_DIRS for looking up

2008-08-20  Colin Walters  <walters@verbum.org>

* gir/Makefile.am: Rename .gir files using GI namespace.
* girepository/girepository.c: Use XDG_DATA_DIRS for
looking up typelibs.  Also typelibs are now suffixed
with .typelib.
* tests/invoke/Makefile.am: Only use metadata.
* girepository/Makefile.am: Remove unnecessary include.
* tests/scanner/Makefile.am: Update using GI namespaces
for scanner includes.

svn path=/trunk/; revision=422

15 years agoSuppress aliases whose name is a builtin. Define some more aliases.
Colin Walters [Wed, 20 Aug 2008 19:11:03 +0000 (19:11 +0000)]
Suppress aliases whose name is a builtin. Define some more aliases.

2008-08-20  Colin Walters  <walters@verbum.org>

* girepository/transformer.py: Suppress aliases whose
name is a builtin.
* girepository/ast.py: Define some more aliases.

svn path=/trunk/; revision=421

15 years agoAvoid alias infloops.
Colin Walters [Wed, 20 Aug 2008 19:01:20 +0000 (19:01 +0000)]
Avoid alias infloops.

2008-08-20  Colin Walters  <walters@verbum.org>

* girepository/girparser.c: Avoid alias infloops.

svn path=/trunk/; revision=420

15 years agoFix expected list type.
Colin Walters [Wed, 20 Aug 2008 18:16:04 +0000 (18:16 +0000)]
Fix expected list type.

2008-08-20  Colin Walters  <walters@verbum.org>

* tests/scanner/foo-expected.gir: Fix expected list type.

svn path=/trunk/; revision=419

15 years agoAdd a workaround for #548689. We can now compile gtk!
Johan Dahlin [Wed, 20 Aug 2008 15:57:22 +0000 (15:57 +0000)]
Add a workaround for #548689. We can now compile gtk!

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * giscanner/glibtransformer.py (GLibTransformer._resolve_type_name):
    Add a workaround for #548689.
    We can now compile gtk!

svn path=/trunk/; revision=418

15 years agoLook up aliases using c:type too
Colin Walters [Wed, 20 Aug 2008 15:30:58 +0000 (15:30 +0000)]
Look up aliases using c:type too

2008-08-20  Colin Walters  <walters@verbum.org>

* giscanner/glibtransformer.py: Try to look up
aliases using the c:type too.

svn path=/trunk/; revision=417

15 years agoUnion field parsing
Colin Walters [Wed, 20 Aug 2008 15:05:46 +0000 (15:05 +0000)]
Union field parsing

2008-08-20  Colin Walters  <walters@verbum.org>

* girepository/girparser.c: Parse union fields.

svn path=/trunk/; revision=416

15 years agoMake time_t an alias for long
Johan Dahlin [Wed, 20 Aug 2008 14:41:19 +0000 (14:41 +0000)]
Make time_t an alias for long

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * giscanner/ast.py: Make time_t an alias for long

svn path=/trunk/; revision=415

15 years agoRegnerate Do not delete Class structures, we need them in gdk/gtk.
Johan Dahlin [Wed, 20 Aug 2008 13:45:12 +0000 (13:45 +0000)]
Regnerate Do not delete Class structures, we need them in gdk/gtk.

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * gir/gio-2.0-good.gir:
    * gir/glib-2.0-good.gir:
    * gir/gobject-2.0-good.gir:
    Regnerate
    * giscanner/glibtransformer.py:
    Do not delete Class structures, we need them in gdk/gtk.
    * tests/scanner/drawable-expected.gir:
    * tests/scanner/foo-expected.gir:
    * tests/scanner/utility-expected.gir:
    Update tests.

svn path=/trunk/; revision=414

15 years agoUpdate array tests
Johan Dahlin [Wed, 20 Aug 2008 12:40:39 +0000 (12:40 +0000)]
Update array tests

svn path=/trunk/; revision=413

15 years agoRe-wrap
Johan Dahlin [Wed, 20 Aug 2008 12:38:12 +0000 (12:38 +0000)]
Re-wrap

svn path=/trunk/; revision=412

15 years agoRe-run against new glib/gobject girs
Johan Dahlin [Wed, 20 Aug 2008 12:36:59 +0000 (12:36 +0000)]
Re-run against new glib/gobject girs

svn path=/trunk/; revision=411

15 years agoSplit out annotation tests out of foo
Johan Dahlin [Wed, 20 Aug 2008 12:33:40 +0000 (12:33 +0000)]
Split out annotation tests out of foo

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * tests/scanner/Makefile.am:
    * tests/scanner/annotation-expected.gir:
    * tests/scanner/annotation.c (annotation_object_class_init),
    (annotation_object_init), (annotation_object_method),
    (annotation_object_in), (annotation_object_out),
    (annotation_object_inout), (annotation_object_inout2),
    (annotation_object_inout3), (annotation_object_calleeowns),
    (annotation_object_calleesowns), (annotation_object_get_strings),
    (annotation_object_with_voidp), (annotation_object_get_objects),
    (annotation_object_create_object), (annotation_object_allow_none):
    * tests/scanner/annotation.h:
    * tests/scanner/foo-expected.gir:
    * tests/scanner/foo.c:
    * tests/scanner/foo.h:
    Split out annotation tests out of foo

svn path=/trunk/; revision=410

15 years agoFoo->foo, foo-object.h -> foo.h
Johan Dahlin [Wed, 20 Aug 2008 12:24:44 +0000 (12:24 +0000)]
Foo->foo, foo-object.h -> foo.h

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * tests/scanner/Foo-expected.gir:
    * tests/scanner/Makefile.am:
    * tests/scanner/foo-expected.gir:
    * tests/scanner/foo-object.h:
    * tests/scanner/foo.c:
    Foo->foo, foo-object.h -> foo.h

svn path=/trunk/; revision=409

15 years agoMove the drawable parts out of Foo to its own test.
Johan Dahlin [Wed, 20 Aug 2008 12:22:56 +0000 (12:22 +0000)]
Move the drawable parts out of Foo to its own test.

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * tests/scanner/Foo-expected.gir:
    * tests/scanner/Makefile.am:
    * tests/scanner/drawable-expected.gir:
    * tests/scanner/drawable.c (test_drawable_class_init),
    (test_drawable_init):
    * tests/scanner/drawable.h:
    * tests/scanner/foo-object.h:
    * tests/scanner/foo.c (foo_boxed_method):
    Move the drawable parts out of Foo to its own test.

svn path=/trunk/; revision=408

15 years agoAdd a based on GdkDrawable which generates a broken gir.
Johan Dahlin [Tue, 19 Aug 2008 22:53:14 +0000 (22:53 +0000)]
Add a based on GdkDrawable which generates a broken gir.

2008-08-20  Johan Dahlin  <johan@gnome.org>

    * tests/scanner/Foo-expected.gir:
    * tests/scanner/foo-object.h:
    * tests/scanner/foo.c (foo_drawable_class_init),
    (foo_drawable_init):
    Add a based on GdkDrawable which generates
    a broken gir.

svn path=/trunk/; revision=407

15 years agoDon't try to strip prefix before namespace.
Colin Walters [Tue, 19 Aug 2008 22:35:46 +0000 (22:35 +0000)]
Don't try to strip prefix before namespace.

2008-08-19  Colin Walters  <walters@verbum.org>

* giscanner/transformer.py: Don't try
to strip prefix before namespace.

svn path=/trunk/; revision=406

15 years agoAdd support for typedef void foo type of aliases.
Johan Dahlin [Tue, 19 Aug 2008 21:59:58 +0000 (21:59 +0000)]
Add support for typedef void foo type of aliases.

2008-08-19  Johan Dahlin  <johan@gnome.org>

    * giscanner/transformer.py:
    * tests/scanner/Foo-expected.gir:
    * tests/scanner/foo-object.h:
    Add support for typedef void foo type of
    aliases.

svn path=/trunk/; revision=405

15 years agoAdd basic support for union, base the code much on Struct. Add a testcase.
Johan Dahlin [Tue, 19 Aug 2008 21:55:26 +0000 (21:55 +0000)]
Add basic support for union, base the code much on Struct. Add a testcase.

2008-08-19  Johan Dahlin  <johan@gnome.org>

    * giscanner/ast.py:
    * giscanner/girwriter.py:
    * giscanner/glibtransformer.py:
    * giscanner/transformer.py:
    * tests/scanner/Foo-expected.gir:
    Add basic support for union, base the code much
    on Struct. Add a testcase.

svn path=/trunk/; revision=404

15 years agoAdd a union testcase which the compiler currently barfs at.
Johan Dahlin [Tue, 19 Aug 2008 21:44:25 +0000 (21:44 +0000)]
Add a union testcase which the compiler currently barfs at.

2008-08-19  Johan Dahlin  <johan@gnome.org>

    * tests/scanner/Foo-expected.gir:
    * tests/scanner/foo-object.h:
    Add a union testcase which the compiler currently
    barfs at.

svn path=/trunk/; revision=403

15 years agoAdd a g_ir_compiler variable
Johan Dahlin [Tue, 19 Aug 2008 21:35:55 +0000 (21:35 +0000)]
Add a g_ir_compiler variable

2008-08-19  Johan Dahlin  <johan@gnome.org>

    * gobject-introspection-1.0.pc.in:
    Add a g_ir_compiler variable

svn path=/trunk/; revision=402

15 years agoRework types to be more closely based on GITypeTag. Parse more bits. Write
Colin Walters [Tue, 19 Aug 2008 21:20:14 +0000 (21:20 +0000)]
Rework types to be more closely based on GITypeTag. Parse more bits. Write

2008-08-19  Colin Walters  <walters@verbum.org>

* giscanner/ast.py: Rework types to be more closely
based on GITypeTag.
* giscanner/girparser.py: Parse more bits.
* giscanner/girwriter.py: Write sequences in a new
way that specifies container type.
* giscanner/glibast.py: Adjust for ast.py changes,
add 'ctype' property to GLibObject and GLibInterface
so we can look things up by it later.
* gicanner/transformer.py: Names is new class holding
the various namespaces we manage.  Do not confuse
with Namespace which is toplevel XML node effectively.
Rework all type resolution to go through
_resolve_type_name_1.
* giscanner/glibtransformer.py: Raise UnknownTypeError
instead of ValueError for cleanliness.  Add Unresolved
class to mark types whose parent we haven't seen yet.
Use new Names object from transformer.py.
Correctly look up parent=.
Fix type validation to handle sequences.
* tests/scanner/Foo-expected.gir: Update for sequence
work, int instead of int32.
* tools/g-ir-scanner: Add --noclosure option
* gir/Makefile.am: Use --noclosure by default for
GLib/GObject.

svn path=/trunk/; revision=401

15 years agoType checking rework
Colin Walters [Tue, 19 Aug 2008 21:20:10 +0000 (21:20 +0000)]
Type checking rework

svn path=/trunk/; revision=400

15 years agoRegenerate.
Johan Dahlin [Mon, 18 Aug 2008 20:43:48 +0000 (20:43 +0000)]
Regenerate.

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * gir/gio-2.0-good.gir:
    * gir/glib-2.0-good.gir:
    * gir/gobject-2.0-good.gir:
    Regenerate.

svn path=/trunk/; revision=399

15 years agoRedo type resolving and validation. Add a couple of new tests. Patch
Johan Dahlin [Mon, 18 Aug 2008 20:16:57 +0000 (20:16 +0000)]
Redo type resolving and validation. Add a couple of new tests. Patch

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * giscanner/ast.py:
    * giscanner/girparser.py:
    * giscanner/girwriter.py:
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    * giscanner/transformer.py:
    * tests/scanner/Foo-expected.gir:
    * tests/scanner/foo-object.h:
    * tests/scanner/utility-expected.gir:
    * tests/scanner/utility.h:
    Redo type resolving and validation.
    Add a couple of new tests.
    Patch mostly written by Colin.

svn path=/trunk/; revision=398

15 years agoSet ctype of enums Improve enum parsing for enums without a GType. Make
Johan Dahlin [Mon, 18 Aug 2008 18:01:21 +0000 (18:01 +0000)]
Set ctype of enums Improve enum parsing for enums without a GType. Make

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * gir/Makefile.am:
    * giscanner/girparser.py:
    Set ctype of enums
    * giscanner/transformer.py:
    Improve enum parsing for enums without a GType.
    Make flags/enum references to other girs work
    * giscanner/utils.py:
    Simplify this a bit
    * tests/scanner/Makefile.am:
    * tests/scanner/foo-object.h:
    * tests/scanner/utility-expected.gir:
    * tests/scanner/utility.h:
    Add a new test for external enum references

svn path=/trunk/; revision=397

15 years agoUpdate
Johan Dahlin [Mon, 18 Aug 2008 14:19:56 +0000 (14:19 +0000)]
Update

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * docs/global-module-registry.txt: Update

svn path=/trunk/; revision=396

15 years agoUpdate with new type proposal
Johan Dahlin [Mon, 18 Aug 2008 13:17:06 +0000 (13:17 +0000)]
Update with new type proposal

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * tests/array.gir: Update with new type proposal

svn path=/trunk/; revision=395

15 years agoMake enum serializing functions public. Clean up some whitespace.
Johan Dahlin [Mon, 18 Aug 2008 08:52:47 +0000 (08:52 +0000)]
Make enum serializing functions public. Clean up some whitespace.

2008-08-18  Johan Dahlin  <johan@gnome.org>

    * girepository/girepository.c (g_type_tag_to_string):
    * girepository/girepository.h:
    * girepository/girnode.c (g_ir_node_get_full_size_internal),
    (find_entry_node):
    * girepository/girnode.h:
    Make enum serializing functions public. Clean up some whitespace.

svn path=/trunk/; revision=394

15 years agoAdd a document for an on disk module registry format
Johan Dahlin [Sun, 17 Aug 2008 20:29:08 +0000 (20:29 +0000)]
Add a document for an on disk module registry format

2008-08-17  Johan Dahlin  <johan@gnome.org>

    * docs/global-module-registry.txt:
    Add a document for an on disk module registry format

svn path=/trunk/; revision=393

15 years agoAdd a gio gir.
Johan Dahlin [Sun, 17 Aug 2008 17:01:23 +0000 (17:01 +0000)]
Add a gio gir.

2008-08-17  Johan Dahlin  <johan@gnome.org>

    * gir/Makefile.am:
    * gir/gio-2.0-good.gir:
    Add a gio gir.

svn path=/trunk/; revision=392

15 years agoRegenerate GObject & GType. Avoid warnings when generating
Johan Dahlin [Sun, 17 Aug 2008 16:52:46 +0000 (16:52 +0000)]
Regenerate GObject & GType. Avoid warnings when generating

2008-08-17  Johan Dahlin  <johan@gnome.org>

    * gir/Makefile.am:
    * gir/glib-2.0-good.gir:
    * gir/gobject-2.0-good.gir:
    * giscanner/cgobject.py:
    * giscanner/glibtransformer.py:
    Regenerate GObject & GType.
    Avoid warnings when generating gobject-2.0.gir.
    Introspect a little more, and skip *_get_type functions.

svn path=/trunk/; revision=391

15 years agoMove .gir files to -good.gir, tweak build order.
Colin Walters [Sun, 17 Aug 2008 15:06:49 +0000 (15:06 +0000)]
Move .gir files to -good.gir, tweak build order.

* gir/glib-2.0.gir, gir/gobject-2.0.gir:
Rename to -good, always generate during build.
* gir/Makefile.am: Ensure .gir files dep on
all scanner sources.
* Makefile.am: Switch build order to ensure
the scanner is ready before we do gir/.
* tools/g-ir-scanner: Look for .git too.

svn path=/trunk/; revision=390

15 years agoRemove resolve_possible_typedefs, it was unused. Allow multiple enum
Johan Dahlin [Sat, 16 Aug 2008 22:26:55 +0000 (22:26 +0000)]
Remove resolve_possible_typedefs, it was unused. Allow multiple enum

2008-08-17  Johan Dahlin  <johan@gnome.org>

    * girepository/gtypelib.c (validate_enum_blob):
    * giscanner/glibtransformer.py:
    * giscanner/transformer.py:
    Remove resolve_possible_typedefs, it was unused.
    Allow multiple enum values of the sample value in an enum,
    since it's actually pretty common.
    Register enums so they can be resolved too.

svn path=/trunk/; revision=389

15 years agomake it compile again...
Johan Dahlin [Sat, 16 Aug 2008 21:57:59 +0000 (21:57 +0000)]
make it compile again...

svn path=/trunk/; revision=388

15 years agoReorder
Johan Dahlin [Sat, 16 Aug 2008 21:55:06 +0000 (21:55 +0000)]
Reorder

svn path=/trunk/; revision=387

15 years agoParse enumeration/bitfield.
Johan Dahlin [Sat, 16 Aug 2008 21:46:23 +0000 (21:46 +0000)]
Parse enumeration/bitfield.

2008-08-16  Johan Dahlin  <johan@gnome.org>

    * giscanner/girparser.py:
    Parse enumeration/bitfield.

svn path=/trunk/; revision=386

15 years agoParse boxed types.
Johan Dahlin [Sat, 16 Aug 2008 21:32:41 +0000 (21:32 +0000)]
Parse boxed types.

2008-08-16  Johan Dahlin  <johan@gnome.org>

    * giscanner/girparser.py:
    Parse boxed types.

svn path=/trunk/; revision=385

15 years agoResolve type names for alias targets Skip FILE* parameters fow now
Johan Dahlin [Sat, 16 Aug 2008 21:28:15 +0000 (21:28 +0000)]
Resolve type names for alias targets Skip FILE* parameters fow now

2008-08-16  Johan Dahlin  <johan@gnome.org>

    * giscanner/glibtransformer.py:
    Resolve type names for alias targets
    * giscanner/transformer.py:
    Skip FILE* parameters fow now

svn path=/trunk/; revision=384

15 years agoRegenerate
Johan Dahlin [Sat, 16 Aug 2008 10:04:06 +0000 (10:04 +0000)]
Regenerate

2008-08-16  Johan Dahlin  <johan@gnome.org>

    * gir/glib-2.0.gir:
    * gir/gobject-2.0.gir:
    Regenerate

    * tests/scanner/Makefile.am:
    parser -> scanner

svn path=/trunk/; revision=383

15 years agoExplicitly construct new list, since we're deleting as we iterate. Don't
Colin Walters [Fri, 15 Aug 2008 05:17:54 +0000 (05:17 +0000)]
Explicitly construct new list, since we're deleting as we iterate. Don't

2008-08-15  Colin Walters  <walters@verbum.org>

* giscanner/glibtransformer.py: Explicitly construct
new list, since we're deleting as we iterate.
Don't delete all structures which end in Class; just
ones which have a paired GObject.
Fix printing of type warning.
* giscanner/transformer.py: Make strip_namespace_object
be the identity function if it doesn't match the
namespace.

svn path=/trunk/; revision=382

15 years agoDefine yet more argument prototypes; fix prototype for g_type_fundamental.
Colin Walters [Fri, 15 Aug 2008 05:03:16 +0000 (05:03 +0000)]
Define yet more argument prototypes; fix prototype for g_type_fundamental.

2008-08-15  Colin Walters  <walters@verbum.org>

* giscanner/cgobject.py: Define yet more argument
prototypes; fix prototype for g_type_fundamental.

svn path=/trunk/; revision=381

15 years agoConvert two more tests, still not completely done though
Johan Dahlin [Thu, 14 Aug 2008 20:22:58 +0000 (20:22 +0000)]
Convert two more tests, still not completely done though

svn path=/trunk/; revision=380

15 years agoFix generator for constant/gobject/struct
Johan Dahlin [Thu, 14 Aug 2008 19:45:37 +0000 (19:45 +0000)]
Fix generator for constant/gobject/struct

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    * tests/constant.gir:
    * tests/gobject.gir:
    * tests/struct.gir:
    * tools/generate.c (write_struct_info):
    Fix generator for constant/gobject/struct

svn path=/trunk/; revision=379

15 years agoFix generation of enum/bitfields
Johan Dahlin [Thu, 14 Aug 2008 19:35:36 +0000 (19:35 +0000)]
Fix generation of enum/bitfields

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    * tests/enum.gir:
    * tools/generate.c (write_enum_info):
    Fix generation of enum/bitfields

svn path=/trunk/; revision=378

15 years agoClear up constant parsing
Johan Dahlin [Thu, 14 Aug 2008 19:32:26 +0000 (19:32 +0000)]
Clear up constant parsing

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * girepository/girparser.c (start_field), (start_constant),
    (start_type), (end_element_handler):
    Clear up constant parsing

    * tests/object.gir:
    Update

    * tools/generate.c (write_callable_info), (write_function_info),
    (write_callback_info), (write_constant_info), (write_signal_info),
    (write_vfunc_info), (write_property_info), (write_object_info),
    (write_interface_info):
    Constants/Signals are handled now.

svn path=/trunk/; revision=377

15 years agoDon't require c:type. Test boxed.gir Update, remove parts we don't support
Johan Dahlin [Thu, 14 Aug 2008 19:07:34 +0000 (19:07 +0000)]
Don't require c:type. Test boxed.gir Update, remove parts we don't support

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * girepository/girparser.c (start_type):
    Don't require c:type.
    * tests/Makefile.am:
    Test boxed.gir
    * tests/boxed.gir:
    Update, remove parts we don't support yet
    * tests/roundtrips.sh:
    Remove
    * tools/generate.c (write_type_info), (write_field_info),
    (write_callable_info), (write_struct_info):
    Make it emit proper gir.

svn path=/trunk/; revision=376

15 years agoNew internal function for adding a new node.
Johan Dahlin [Thu, 14 Aug 2008 16:56:47 +0000 (16:56 +0000)]
New internal function for adding a new node.

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * giscanner/transformer.py:
    New internal function for adding a new node.

svn path=/trunk/; revision=375

15 years agoDefine an internal _H_ variable so we skip parsing both i18n headers, only
Johan Dahlin [Thu, 14 Aug 2008 16:30:01 +0000 (16:30 +0000)]
Define an internal _H_ variable so we skip parsing both i18n headers, only

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * gir/Makefile.am:
    Define an internal _H_ variable so we skip parsing both
    i18n headers, only one is needed.
    * gir/glib-2.0.gir:
    Add the glib-2.0.gir too.
    * giscanner/glibast.py:
    Add gconstpointer as an alias for ANY
    * giscanner/transformer.py:
    Do not lower case enumeration names per se.
    Skip functions which has parameters called 'va_list'

svn path=/trunk/; revision=374

15 years agoComment data structures. Also squash pointers in resolve_type_name to
Colin Walters [Thu, 14 Aug 2008 16:09:06 +0000 (16:09 +0000)]
Comment data structures. Also squash pointers in resolve_type_name to

2008-08-14  Colin Walters  <walters@verbum.org>

* giscanner/transformer.py: Comment data structures.
Also squash pointers in resolve_type_name to correspond
with what we do for params.
* giscanner/glibtransformer.py: Print warnings in more
situations.  Rework checks for method/constructor to
look up in our GType database instead of just checking
for *.   Avoid generating <record> for GObject which
duplicate the <class>.
* gir/Makefile.am: Generate glib-2.0.gir and gobject-2.0.gir
in here.

svn path=/trunk/; revision=373

15 years agoAvoid importing two GObject symbols in transformer.py
Johan Dahlin [Thu, 14 Aug 2008 11:31:24 +0000 (11:31 +0000)]
Avoid importing two GObject symbols in transformer.py

svn path=/trunk/; revision=372

15 years agoMake pyflakes.py conform to pep8.py
Johan Dahlin [Thu, 14 Aug 2008 11:30:01 +0000 (11:30 +0000)]
Make pyflakes.py conform to pep8.py

svn path=/trunk/; revision=371

15 years agoAdd pyflakes.py and run it in make check. Update the source code to fix
Johan Dahlin [Thu, 14 Aug 2008 11:23:26 +0000 (11:23 +0000)]
Add pyflakes.py and run it in make check. Update the source code to fix

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * giscanner/girwriter.py:
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    * giscanner/transformer.py:
    * misc/pyflakes.py:
    * tests/Makefile.am:
    Add pyflakes.py and run it in make check.
    Update the source code to fix the errors reported by
    pyflakes.

svn path=/trunk/; revision=370

15 years agoRefactor the parser a bit. Add parent type to interfaces and update
Johan Dahlin [Thu, 14 Aug 2008 11:13:51 +0000 (11:13 +0000)]
Refactor the parser a bit. Add parent type to interfaces and update

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * giscanner/ast.py:
    * giscanner/girparser.py:
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    Refactor the parser a bit.
    Add parent type to interfaces and update callsites.

svn path=/trunk/; revision=369

15 years agoClean up cgobject.py a little, fix pep8 errors
Johan Dahlin [Thu, 14 Aug 2008 09:54:09 +0000 (09:54 +0000)]
Clean up cgobject.py a little, fix pep8 errors

svn path=/trunk/; revision=368

15 years agoRefactor a bit, avoid isinstance and add a method for each type we parse.
Johan Dahlin [Thu, 14 Aug 2008 09:47:58 +0000 (09:47 +0000)]
Refactor a bit, avoid isinstance and add a method for each type we parse.

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * giscanner/glibtransformer.py:
    * giscanner/utils.py:
    Refactor a bit, avoid isinstance and add a method
    for each type we parse.

svn path=/trunk/; revision=367

15 years agoRun pep8.py in make check, fix old errors.
Johan Dahlin [Thu, 14 Aug 2008 09:28:38 +0000 (09:28 +0000)]
Run pep8.py in make check, fix old errors.

2008-08-14  Johan Dahlin  <johan@gnome.org>

    * giscanner/ast.py:
    * giscanner/girparser.py:
    * giscanner/glibtransformer.py:
    * tests/Makefile.am:
    Run pep8.py in make check, fix old errors.

svn path=/trunk/; revision=366

15 years agoParse records.
Colin Walters [Wed, 13 Aug 2008 22:23:06 +0000 (22:23 +0000)]
Parse records.

2008-08-13  Colin Walters  <walters@verbum.org>

* giscanner/girparser.py: Parse records.

svn path=/trunk/; revision=365

15 years agoInstall again. Add some more bits.
Colin Walters [Wed, 13 Aug 2008 22:19:04 +0000 (22:19 +0000)]
Install again. Add some more bits.

2008-08-13  Colin Walters  <walters@verbum.org>

* gir/Makefile.am: Install again.
* gir/gobject-2.0.gir: Add some more bits.

svn path=/trunk/; revision=364

15 years agoUse correct namespace, add GType. Handle aliases. Record aliases. Make
Colin Walters [Wed, 13 Aug 2008 22:06:59 +0000 (22:06 +0000)]
Use correct namespace, add GType. Handle aliases. Record aliases. Make

2008-08-13  Colin Walters  <walters@verbum.org>

* gir/gobject-2.0.gir: Use correct namespace, add GType.
* giscanner/girparser.py: Handle aliases.
* giscanner/transformer.py: Record aliases.  Make resolver
functions public; we now call into these explicitly from
glibtransformer.  Handle resolving aliases.
* giscanner/glibtransformer.py: Separate our internal namespace
from included ones.  Call up into transformer's resolver functions.

svn path=/trunk/; revision=363

15 years agoAllow get_type to be None, set a get_type for GInitiallyUnowned too.
Johan Dahlin [Wed, 13 Aug 2008 21:44:38 +0000 (21:44 +0000)]
Allow get_type to be None, set a get_type for GInitiallyUnowned too.

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

15 years agoremote two prints
Johan Dahlin [Wed, 13 Aug 2008 21:26:16 +0000 (21:26 +0000)]
remote two prints

svn path=/trunk/; revision=361

15 years agoRegister GInitiallyUnowned
Johan Dahlin [Wed, 13 Aug 2008 21:25:15 +0000 (21:25 +0000)]
Register GInitiallyUnowned

2008-08-13  Johan Dahlin  <johan@gnome.org>

    * giscanner/cgobject.py:
    Register GInitiallyUnowned
    * giscanner/girwriter.py:
    * giscanner/glibtransformer.py:
    Special case GObject/GInitially owned as they are a bit special to use.

svn path=/trunk/; revision=360

15 years agoObject is in GObject namespace.
Colin Walters [Wed, 13 Aug 2008 21:02:15 +0000 (21:02 +0000)]
Object is in GObject namespace.

2008-08-13  Colin Walters  <walters@verbum.org>

* tests/scanner/Foo-expected.gir, tests/scanner/utility-expected.gir:
Object is in GObject namespace.

svn path=/trunk/; revision=359

15 years agoFix processing of functions from last commit.
Colin Walters [Wed, 13 Aug 2008 20:44:58 +0000 (20:44 +0000)]
Fix processing of functions from last commit.

2008-08-13  Colin Walters  <walters@verbum.org>

* giscanner/girparser.py: Fix processing of functions
from last commit.

svn path=/trunk/; revision=358

15 years agoParse more than just <class. Put aliases in a separate data structure
Colin Walters [Wed, 13 Aug 2008 20:36:15 +0000 (20:36 +0000)]
Parse more than just <class. Put aliases in a separate data structure

2008-08-13  Colin Walters  <walters@verbum.org>

* giscanner/girparser.py: Parse more than just <class.
* giscanner/glibtransformer.py: Put aliases in a separate
data structure since their name is not canonicall.
* giscanner/transformer.py: Handle resolving type names
from includes.

svn path=/trunk/; revision=357

15 years agoAllow multiple libraries Rename load_library to add_library, traverse over
Johan Dahlin [Wed, 13 Aug 2008 20:24:10 +0000 (20:24 +0000)]
Allow multiple libraries Rename load_library to add_library, traverse over

2008-08-13  Johan Dahlin  <johan@gnome.org>

    * tools/g-ir-scanner:
    Allow multiple libraries
    * giscanner/glibtransformer.py:
    Rename load_library to add_library, traverse over all libraries
    when trying to resolve a function

svn path=/trunk/; revision=356

15 years agoRecord typedefs as <alias> elements. Also attempt to look up types in
Colin Walters [Wed, 13 Aug 2008 16:10:09 +0000 (16:10 +0000)]
Record typedefs as <alias> elements. Also attempt to look up types in

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

15 years agoAlso transform object properties.
Colin Walters [Tue, 12 Aug 2008 19:20:43 +0000 (19:20 +0000)]
Also transform object properties.

2008-08-12  Colin Walters  <walters@verbum.org>

* giscanner/glibtransformer.py: Also transform object properties.

svn path=/trunk/; revision=354

15 years agopep8
Colin Walters [Tue, 12 Aug 2008 19:07:40 +0000 (19:07 +0000)]
pep8

svn path=/trunk/; revision=353

15 years agoAlso transform callbacks and structure field types. Update to expect
Colin Walters [Tue, 12 Aug 2008 19:06:34 +0000 (19:06 +0000)]
Also transform callbacks and structure field types. Update to expect

2008-08-12  Colin Walters  <walters@verbum.org>

* giscanner/glibtransformer.py: Also transform callbacks
and structure field types.
* tests/scanner/Fooe-expected.gir: Update to expect correct
names for callbacks and structs.

svn path=/trunk/; revision=352

15 years agoHandle 'any'. Add test for void *.
Colin Walters [Tue, 12 Aug 2008 18:49:16 +0000 (18:49 +0000)]
Handle 'any'. Add test for void *.

2008-08-12  Colin Walters  <walters@verbum.org>

* girepository/girparser.c: Handle 'any'.
* tests/scanner/Foo-expected.gir, tests/scanner/foo-object.h:
Add test for void *.

svn path=/trunk/; revision=351

15 years agoWe need to do type resolution in a second pass after we've seen all the
Colin Walters [Tue, 12 Aug 2008 18:36:33 +0000 (18:36 +0000)]
We need to do type resolution in a second pass after we've seen all the

2008-08-12  Colin Walters  <walters@verbum.org>

* giscanner/glibtransformer.py: We need to do type
resolution in a second pass after we've seen all the
enums, records, etc.

svn path=/trunk/; revision=350

15 years agoAdd enum return value. Transform function return types too.
Colin Walters [Tue, 12 Aug 2008 17:31:50 +0000 (17:31 +0000)]
Add enum return value. Transform function return types too.

2008-08-12  Colin Walters  <walters@verbum.org>

* tests/scanner/Foo-expected.gir, tests/scanner/foo-object.h:
Add enum return value.
* giscanner/glibtransformer.py: Transform function return types
too.

svn path=/trunk/; revision=349

15 years agoDep .gir files on scanner sources too. Also remove @ so we see scanner
Colin Walters [Tue, 12 Aug 2008 17:13:59 +0000 (17:13 +0000)]
Dep .gir files on scanner sources too. Also remove @ so we see scanner

2008-08-12  Colin Walters  <walters@verbum.org>

* tests/scanner/Makefile.am: Dep .gir files on scanner
sources too.  Also remove @ so we see scanner invocations.

svn path=/trunk/; revision=348

15 years agoRemove usage of (GAPI-oriented) TypeTag in favor of GITypeTag from
Colin Walters [Tue, 12 Aug 2008 15:34:27 +0000 (15:34 +0000)]
Remove usage of (GAPI-oriented) TypeTag in favor of GITypeTag from

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

15 years agoUse the correct tests.
Colin Walters [Sun, 10 Aug 2008 20:54:00 +0000 (20:54 +0000)]
Use the correct tests.

2008-08-10  Colin Walters  <walters@verbum.org>

* tests/roundtrip.sh: Use the correct tests.

svn path=/trunk/; revision=346

15 years agoPEP-8*
Johan Dahlin [Sun, 10 Aug 2008 20:37:03 +0000 (20:37 +0000)]
PEP-8*

svn path=/trunk/; revision=345

15 years agoAdd new decorator @gwrap which forces us to declare types for both return
Colin Walters [Sun, 10 Aug 2008 20:34:18 +0000 (20:34 +0000)]
Add new decorator @gwrap which forces us to declare types for both return

2008-08-10  Colin Walters  <walters@verbum.org>

* giscanner/cgobject.py: Add new decorator @gwrap which forces
us to declare types for both return value and parameters.  The
ctypes default of 'int' is bad because it hides 32/64 bit
problems.  Convert all existing functions to use it.

svn path=/trunk/; revision=344

15 years agoadd a pep8 script
Johan Dahlin [Sun, 10 Aug 2008 20:20:41 +0000 (20:20 +0000)]
add a pep8 script

svn path=/trunk/; revision=343

15 years agoClean up gcov integration a bit
Johan Dahlin [Sat, 9 Aug 2008 13:17:00 +0000 (13:17 +0000)]
Clean up gcov integration a bit

svn path=/trunk/; revision=342

15 years agoPEP8ify
Johan Dahlin [Sat, 9 Aug 2008 13:07:11 +0000 (13:07 +0000)]
PEP8ify

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * giscanner/__init__.py:
    * giscanner/ast.py:
    * giscanner/cgobject.py:
    * giscanner/gidlparser.py:
    * giscanner/gidlwriter.py:
    * giscanner/girparser.py:
    * giscanner/girwriter.py:
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    * giscanner/odict.py:
    * giscanner/sourcescanner.py:
    * giscanner/transformer.py:
    * giscanner/utils.py:
    * giscanner/xmlwriter.py:
    * tools/g-ir-scanner:

    PEP8ify

svn path=/trunk/; revision=341

15 years agoRemove outdated relaxng schemas.
Johan Dahlin [Sat, 9 Aug 2008 12:59:52 +0000 (12:59 +0000)]
Remove outdated relaxng schemas.

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * relaxng/api.xml:
    * relaxng/c-types.xml:
    * relaxng/g-types.xml:
    * relaxng/relaxng.rng:
    * relaxng/util.xml:
    Remove outdated relaxng schemas.

svn path=/trunk/; revision=340

15 years agoRename metadata to typelib in variable names, comments and apis.
Johan Dahlin [Sat, 9 Aug 2008 12:55:32 +0000 (12:55 +0000)]
Rename metadata to typelib in variable names, comments and apis.

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * *.[ch]:
    Rename metadata to typelib in variable names,
    comments and apis.

svn path=/trunk/; revision=339

15 years agoRemove old C scanner, which got rewritten in python.
Johan Dahlin [Sat, 9 Aug 2008 12:48:02 +0000 (12:48 +0000)]
Remove old C scanner, which got rewritten in python.

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * tools/scanner.c:
    * tools/scanner.h:
    Remove old C scanner, which got rewritten in python.

svn path=/trunk/; revision=338

15 years agoMove shared *.[ch] files to girepository from tools
Johan Dahlin [Sat, 9 Aug 2008 12:46:48 +0000 (12:46 +0000)]
Move shared *.[ch] files to girepository from tools

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * girepository/Makefile.am:
    * tools/Makefile.am:
    * tools/girmodule.c:
    * tools/girmodule.h:
    * tools/girnode.c:
    * tools/girnode.h:
    * tools/girparser.c:
    * tools/girparser.h:
    * tools/girwriter.c:
    * tools/girwriter.h:
    Move shared *.[ch] files to girepository from tools

svn path=/trunk/; revision=337

15 years agoRename *.test to *.gir
Johan Dahlin [Sat, 9 Aug 2008 12:37:06 +0000 (12:37 +0000)]
Rename *.test to *.gir

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    * tests/array.test:
    * tests/boxed.test:
    * tests/constant.test:
    * tests/enum.test:
    * tests/errors.test:
    * tests/function.test:
    * tests/gobject.test:
    * tests/interface.test:
    * tests/object.test:
    * tests/struct.test:
    * tests/types.test:
    * tests/union.test:
    * tests/xref1.test:
    * tests/xref2.test:
    Rename *.test to *.gir

svn path=/trunk/; revision=335

15 years agoRename tests/parser to test/scanner
Johan Dahlin [Sat, 9 Aug 2008 12:34:29 +0000 (12:34 +0000)]
Rename tests/parser to test/scanner

2008-08-09  Johan Dahlin  <johan@gnome.org>

    * configure.ac:
    * tests/Makefile.am:
    * tests/parser/Foo-expected.gir:
    * tests/parser/Makefile.am:
    * tests/parser/foo-object.h:
    * tests/parser/foo.c:
    * tests/parser/utility-expected.gir:
    * tests/parser/utility.c:
    * tests/parser/utility.h:
    * tests/scanner/Makefile.am:
    Rename tests/parser to test/scanner

svn path=/trunk/; revision=334

15 years agoUse local .gir files again.
Colin Walters [Sat, 9 Aug 2008 00:18:17 +0000 (00:18 +0000)]
Use local .gir files again.

2008-08-08  Colin Walters  <walters@verbum.org>

* tests/roundtrips.sh: Use local .gir files again.

svn path=/trunk/; revision=333

15 years ago.gir file depends on libtool library.
Colin Walters [Sat, 9 Aug 2008 00:16:59 +0000 (00:16 +0000)]
.gir file depends on libtool library.

2008-08-08  Colin Walters  <walters@verbum.org>

* tests/invoke/Makefile.am: .gir file depends on libtool
library.

svn path=/trunk/; revision=332

15 years agoPass through parent node so we can print the node whose child is NULL, if
Colin Walters [Sat, 9 Aug 2008 00:15:29 +0000 (00:15 +0000)]
Pass through parent node so we can print the node whose child is NULL, if

2008-08-08  Colin Walters  <walters@verbum.org>

* tools/girnode.c: Pass through parent node so we can
print the node whose child is NULL, if that occurs.

svn path=/trunk/; revision=331

15 years agoRemove debug print
Colin Walters [Sat, 9 Aug 2008 00:14:31 +0000 (00:14 +0000)]
Remove debug print

svn path=/trunk/; revision=330

15 years agoSay explicitly which node was NULL
Colin Walters [Sat, 9 Aug 2008 00:13:34 +0000 (00:13 +0000)]
Say explicitly which node was NULL

svn path=/trunk/; revision=329

15 years agodisable a test
Johan Dahlin [Fri, 8 Aug 2008 20:18:19 +0000 (20:18 +0000)]
disable a test

svn path=/trunk/; revision=328

15 years agoDisable roundtrip tests which are not yet working Rewrite as gir.
Johan Dahlin [Fri, 8 Aug 2008 20:16:56 +0000 (20:16 +0000)]
Disable roundtrip tests which are not yet working Rewrite as gir.

2008-08-08  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    Disable roundtrip tests which are not yet working
    * tests/invoke/testfns.gir:
    Rewrite as gir.
2008-08-08  Johan Dahlin  <johan@gnome.org>

    * tests/Makefile.am:
    Disable roundtrip tests which are not yet working
    * tests/invoke/testfns.gir:
    Rewrite as gir.

svn path=/trunk/; revision=327

15 years agotype -> ntype
Johan Dahlin [Fri, 8 Aug 2008 20:05:49 +0000 (20:05 +0000)]
type -> ntype

2008-08-08  Johan Dahlin  <johan@gnome.org>

    * giscanner/girwriter.py:
    type -> ntype
    * giscanner/glibast.py:
    * giscanner/glibtransformer.py:
    Swap order of members, to keep it consistent with
    base enum class

svn path=/trunk/; revision=326