summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
* Regenerate GObject & GType. Avoid warnings when generatingJohan Dahlin2008-08-172-6/+18
| | | | | | | | | | | | | | | | 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
* Remove resolve_possible_typedefs, it was unused. Allow multiple enumJohan Dahlin2008-08-162-7/+5
| | | | | | | | | | | | | | | 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
* Parse enumeration/bitfield.Johan Dahlin2008-08-161-9/+29
| | | | | | | | | | 2008-08-16 Johan Dahlin <johan@gnome.org> * giscanner/girparser.py: Parse enumeration/bitfield. svn path=/trunk/; revision=386
* Parse boxed types.Johan Dahlin2008-08-161-2/+16
| | | | | | | | | | 2008-08-16 Johan Dahlin <johan@gnome.org> * giscanner/girparser.py: Parse boxed types. svn path=/trunk/; revision=385
* Resolve type names for alias targets Skip FILE* parameters fow nowJohan Dahlin2008-08-162-0/+11
| | | | | | | | | | | | 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
* Explicitly construct new list, since we're deleting as we iterate. Don'tColin Walters2008-08-152-18/+23
| | | | | | | | | | | | | | | | | 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
* Define yet more argument prototypes; fix prototype for g_type_fundamental.Colin Walters2008-08-151-10/+28
| | | | | | | | | | | 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
* New internal function for adding a new node.Johan Dahlin2008-08-141-6/+9
| | | | | | | | | | 2008-08-14 Johan Dahlin <johan@gnome.org> * giscanner/transformer.py: New internal function for adding a new node. svn path=/trunk/; revision=375
* Define an internal _H_ variable so we skip parsing both i18n headers, onlyJohan Dahlin2008-08-142-1/+12
| | | | | | | | | | | | | | | | | | 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
* Comment data structures. Also squash pointers in resolve_type_name toColin Walters2008-08-142-11/+27
| | | | | | | | | | | | | | | | | | 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
* Avoid importing two GObject symbols in transformer.pyJohan Dahlin2008-08-141-3/+4
| | | | svn path=/trunk/; revision=372
* Add pyflakes.py and run it in make check. Update the source code to fixJohan Dahlin2008-08-144-21/+12
| | | | | | | | | | | | | | | | | 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
* Refactor the parser a bit. Add parent type to interfaces and updateJohan Dahlin2008-08-144-77/+82
| | | | | | | | | | | | | | 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
* Clean up cgobject.py a little, fix pep8 errorsJohan Dahlin2008-08-142-20/+20
| | | | svn path=/trunk/; revision=368
* Refactor a bit, avoid isinstance and add a method for each type we parse.Johan Dahlin2008-08-142-85/+120
| | | | | | | | | | | | 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
* Run pep8.py in make check, fix old errors.Johan Dahlin2008-08-143-13/+9
| | | | | | | | | | | | | 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
* Parse records.Colin Walters2008-08-131-1/+4
| | | | | | | | | | 2008-08-13 Colin Walters <walters@verbum.org> * giscanner/girparser.py: Parse records. svn path=/trunk/; revision=365
* Use correct namespace, add GType. Handle aliases. Record aliases. MakeColin Walters2008-08-133-19/+44
| | | | | | | | | | | | | | | | 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
* Allow get_type to be None, set a get_type for GInitiallyUnowned too.Johan Dahlin2008-08-131-1/+3
| | | | | | | | | | | | 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
* remote two printsJohan Dahlin2008-08-131-2/+0
| | | | svn path=/trunk/; revision=361
* Register GInitiallyUnownedJohan Dahlin2008-08-133-1/+24
| | | | | | | | | | | | | 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
* Fix processing of functions from last commit.Colin Walters2008-08-131-6/+10
| | | | | | | | | | | 2008-08-13 Colin Walters <walters@verbum.org> * giscanner/girparser.py: Fix processing of functions from last commit. svn path=/trunk/; revision=358
* Parse more than just <class. Put aliases in a separate data structureColin Walters2008-08-133-31/+104
| | | | | | | | | | | | | | 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
* Allow multiple libraries Rename load_library to add_library, traverse overJohan Dahlin2008-08-131-7/+11
| | | | | | | | | | | | | 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
* Record typedefs as <alias> elements. Also attempt to look up types inColin Walters2008-08-134-12/+56
| | | | | | | | | | | | | | | | | | | | | | 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
* Also transform object properties.Colin Walters2008-08-121-2/+8
| | | | | | | | | | 2008-08-12 Colin Walters <walters@verbum.org> * giscanner/glibtransformer.py: Also transform object properties. svn path=/trunk/; revision=354
* pep8Colin Walters2008-08-121-2/+2
| | | | svn path=/trunk/; revision=353
* Also transform callbacks and structure field types. Update to expectColin Walters2008-08-121-3/+11
| | | | | | | | | | | | | 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
* We need to do type resolution in a second pass after we've seen all theColin Walters2008-08-121-6/+16
| | | | | | | | | | | | 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
* Add enum return value. Transform function return types too.Colin Walters2008-08-121-0/+1
| | | | | | | | | | | | | 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
* PEP-8*Johan Dahlin2008-08-101-0/+1
| | | | svn path=/trunk/; revision=345
* Add new decorator @gwrap which forces us to declare types for both returnColin Walters2008-08-101-18/+27
| | | | | | | | | | | | 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
* PEP8ifyJohan Dahlin2008-08-0914-50/+109
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* type -> ntypeJohan Dahlin2008-08-083-4/+4
| | | | | | | | | | | | | | 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
* Merge in the gir-compiler branch. Thanks to Philip and Colin for theirJohan Dahlin2008-08-083-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-08-08 Johan Dahlin <johan@gnome.org> * girepository/gtypelib.c (validate_header): * girepository/gtypelib.h: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/sourcescanner.c (gi_source_symbol_ref), (gi_source_symbol_unref): * 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/invoke/Makefile.am: * tests/invoke/testfns.xml: * tests/object.test: * tests/parser/Makefile.am: * tests/roundtrips.sh: * tests/struct.test: * tests/types.test: * tests/union.test: * tests/xref1.test: * tests/xref2.test: * tools/Makefile.am: * tools/compiler.c (main): * tools/generate.c (write_callable_info), (write_function_info), (write_repository): * tools/gidlmodule.c: * tools/gidlmodule.h: * tools/gidlnode.c: * tools/gidlnode.h: * tools/gidlparser.c: * tools/gidlparser.h: * tools/gidlwriter.c: * tools/gidlwriter.h: * tools/scanner.c (create_node_from_gtype), (create_node_from_ctype), (g_igenerator_process_properties), (g_igenerator_process_signals), (g_igenerator_create_object), (g_igenerator_create_interface), (g_igenerator_create_boxed), (g_igenerator_create_enum), (g_igenerator_create_flags), (g_igenerator_process_function_symbol), (g_igenerator_process_unregistered_struct_typedef), (g_igenerator_process_struct_typedef), (g_igenerator_process_union_typedef), (g_igenerator_process_enum_typedef), (g_igenerator_process_function_typedef), (g_igenerator_process_constant), (g_igenerator_process_symbols), (g_igenerator_add_module), (g_igenerator_add_include_idl): Merge in the gir-compiler branch. Thanks to Philip and Colin for their help. svn path=/trunk/; revision=325
* Fix typoJürg Billeter2008-07-081-1/+1
| | | | | | | | | | 2008-07-08 Jürg Billeter <j@bitron.ch> * giscanner/glibast.py: Fix typo svn path=/trunk/; revision=295
* Ignore a few more tagsJohan Dahlin2008-06-211-0/+3
| | | | | | | | | | 2008-06-21 Johan Dahlin <jdahlin@async.com.br> * giscanner/girparser.py (GIRParser._parse_api): Ignore a few more tags svn path=/trunk/; revision=292
* Add support for gtk-doc annotations for allow-none. Add test case.Johan Dahlin2008-06-203-0/+5
| | | | | | | | | | | | | | | | 2008-06-20 Johan Dahlin <jdahlin@async.com.br> * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/transformer.py: * tests/parser/Foo-expected.gir: * tests/parser/foo-object.h: * tests/parser/foo.c (foo_object_allow_none): Add support for gtk-doc annotations for allow-none. Add test case. svn path=/trunk/; revision=291
* Start using abstract type instead of the raw C types. Register a bunch ofJohan Dahlin2008-06-205-19/+76
| | | | | | | | | | | | | | | | 2008-06-19 Johan Dahlin <jdahlin@async.com.br> * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/transformer.py: * tests/parser/Foo-expected.gir: Start using abstract type instead of the raw C types. Register a bunch of glib types we care about. svn path=/trunk/; revision=290
* Improve line wrapping when > 79 charatersJohan Dahlin2008-06-071-7/+31
| | | | | | | | | | 2008-06-07 Johan Dahlin <jdahlin@async.com.br> * giscanner/xmlwriter.py: Improve line wrapping when > 79 charaters svn path=/trunk/; revision=286
* Use <type> element for field types Update testcaseJürg Billeter2008-06-053-6/+17
| | | | | | | | | | | | | 2008-06-05 Jürg Billeter <j@bitron.ch> * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/transformer.py: Use <type> element for field types * tests/parser/Foo-expected.gir: Update testcase svn path=/trunk/; revision=285
* Fix a bug which prevented GdkEvent from being generatedJohan Dahlin2008-06-041-1/+5
| | | | | | | | | | 2008-06-04 Johan Dahlin <jdahlin@async.com.br> * giscanner/glibtransformer.py: Fix a bug which prevented GdkEvent from being generated svn path=/trunk/; revision=284
* Improve enum member parsing and introspectionJohan Dahlin2008-06-037-36/+75
| | | | | | | | | | | | | | | | | 2008-06-03 Johan Dahlin <jdahlin@async.com.br> * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * giscanner/transformer.py: * giscanner/utils.py: * tests/parser/Foo-expected.gir: Improve enum member parsing and introspection svn path=/trunk/; revision=283
* Revert this part, it broke atkJohan Dahlin2008-05-311-1/+1
| | | | svn path=/trunk/; revision=282
* Add a new source type enum for member. Use __repr__ for improved debuggingJohan Dahlin2008-05-315-32/+59
| | | | | | | | | | | | | | | | | | | 2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/scannerparser.y: * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: Add a new source type enum for member. Use __repr__ for improved debugging * giscanner/girparser.py: Ignore some more * giscanner/transformer.py: Improve parsing of struct members. * tests/parser/foo-object.h: Add a new testcase svn path=/trunk/; revision=281
* Improve error reporting when trying to quote None. Do not print warningsJohan Dahlin2008-05-315-23/+57
| | | | | | | | | | | | | | | | | | | | | 2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/xmlwriter.py: Improve error reporting when trying to quote None. * giscanner/girparser.py: Do not print warnings when including more complete .gir files * giscanner/girwriter.py: Do not require a name for parameters, add a todo for singletons * giscanner/glibtransformer.py: Refactor the way structs are done, add a couple of hacks to allow us to get further. * giscanner/transformer.py: Add enough hacks so cairo, atk and pango.gir can be parsed properly * gobject-introspection-1.0.pc.in: Export girdir, so we can access gobject-2.0.gir from outside svn path=/trunk/; revision=280
* Prevent a crash when symbol->indent is NULL.Johan Dahlin2008-05-311-0/+7
| | | | | | | | | | 2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/giscannermodule.c (symbol_get_ident): Prevent a crash when symbol->indent is NULL. svn path=/trunk/; revision=276
* Add ctype_name, a function to convert a CTYPE symbol to a stringJohan Dahlin2008-05-311-0/+14
| | | | | | | | | | 2008-05-31 Johan Dahlin <jdahlin@async.com.br> * giscanner/sourcescanner.py (ctype_name): Add ctype_name, a function to convert a CTYPE symbol to a string svn path=/trunk/; revision=275
* Revert back to using temporary files to send in headers. Allow FunctionsJohan Dahlin2008-05-245-33/+65
| | | | | | | | | | | | | | | | | | | 2008-05-24 Johan Dahlin <jdahlin@async.com.br> * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/giscannermodule.c (pygi_source_scanner_append_filename), (pygi_source_scanner_parse_file): * giscanner/glibtransformer.py: * giscanner/sourcescanner.py: Revert back to using temporary files to send in headers. Allow Functions to be passed in as callbacks, add a couple of try/excepts missing features. We can now scan pango svn path=/trunk/; revision=274
* Clean up and refactor enum namespacingJohan Dahlin2008-05-095-20/+23
| | | | svn path=/trunk/; revision=273