summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Bug 567813 – Everything should be versionedJohan Dahlin2009-01-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | 2009-01-15 Johan Dahlin <jdahlin@async.com.br> Bug 567813 – Everything should be versioned * gir/Makefile.am: * girepository/Makefile.am: * girepository/girepository.c (init_globals): * girepository/girparser.c (locate_gir): * giscanner/dumper.py: * giscanner/transformer.py: * gobject-introspection-1.0.pc.in: * tests/everything/Makefile.am: * tests/invoke/Makefile.am: * tests/offsets/Makefile.am: * tests/repository/Makefile.am: * tests/scanner/Makefile.am: * tools/Makefile.am: svn path=/trunk/; revision=1046
* Bug 563794 - Redo annotation parsing & applyingJohan Dahlin2009-01-121-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2009-01-12 Johan Dahlin <jdahlin@async.com.br> Bug 563794 - Redo annotation parsing & applying Thanks to Colin for helping out considerably in landing this. * giscanner/Makefile.am: * giscanner/ast.py: * giscanner/dumper.py: * giscanner/girparser.py: * giscanner/giscannermodule.c (pygi_source_scanner_get_comments), (calc_attrs_length), (pygi_collect_attributes), (init_giscanner): * giscanner/glibtransformer.py: * giscanner/scannerlexer.l: * giscanner/sourcescanner.c (gi_source_symbol_unref), (gi_source_scanner_new), (gi_source_scanner_free), (gi_source_scanner_get_comments): * giscanner/sourcescanner.h: * giscanner/sourcescanner.py: * giscanner/transformer.py: * giscanner/xmlwriter.py: * tests/scanner/annotation-1.0-expected.gir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/annotation.c: * tests/scanner/annotation.h: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.h: * tools/g-ir-scanner: This commit merges the annotation parser rewrite branch. It'll change the annotation parsing to be done completely in python code which will make it easier to do further annotation parsing easier. svn path=/trunk/; revision=1017
* Bug 556489 – callback annotationsAndreas Rottmann2009-01-031-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-01-03 Andreas Rottmann <a.rottmann@gmx.at> Bug 556489 – callback annotations * giscanner/transformer.py * tools/generate.c (write_callable_info): Write out the new scope, closure and destroy attributes. * giscanner/transformer.py (Transformer._type_is_callback): New method, checking if a given type is a callback. (Transformer._augment_callback_params): New method; adds information (closure, destroy) to callback parameters. (Transformer._handle_closure, Transformer._handle_destroy): New methods, auxiliary to _augment_callback_params. (Transformer._create_function): Call _augment_callback_params(). (Transformer._create_parameter): Handle scope option. (Transformer._create_typedef_callback): New method, creates a callback, and registers it in the typedef namespace (Transformer._create_typedef): Use _create_typedef_callback() instead of the plain _create_callback(). * giscanner/ast.py (Parameter): Added callback-related fields. * giscanner/girwriter.py: Write out new Parameter fields. * girepository/girnode.h (GIrNodeParam): Added fields scope, closure and destroy. * girepository/gtypelib.h (ArgBlob): Ditto. * girepository/girparser.c (start_parameter): Handle new fields. * girepository/girmodule.c (g_ir_module_build_typelib): Adjust arg_blob_size, bump major version due to this change. * girepository/girnode.c (g_ir_node_get_full_size_internal) (g_ir_node_build_typelib) * girepository/gtypelib.c (g_typelib_check_sanity): ArgBlob size adjustments. (g_ir_node_build_typelib): Fill in new ArgBlob flags from param. * girepository/girepository.h (GIScope): New enumeration, listing the different possible scopes for callbacks. * girepository/ginfo.c (g_arg_info_get_scope) (g_arg_info_get_closure, g_arg_info_get_destroy): Accessors for callback-related argument indices (callback scope, closure for a callback, destroy notification for a callback). * tests/scanner/: Added testcases for new features. svn path=/trunk/; revision=998
* Add --libtool option which we expect Automake-using people to passColin Walters2008-11-261-0/+3
| | | | svn path=/trunk/; revision=977
* Revert earlier libtool change, there's no needJohan Dahlin2008-11-251-2/+1
| | | | | | | to execute through libtool since libtool would have created a wrapper if it was found at link time svn path=/trunk/; revision=969
* Execute the dumper program through libtool if it's installed, so we avoidJohan Dahlin2008-11-251-1/+3
| | | | | | | | | | | | 2008-11-25 Johan Dahlin <jdahlin@async.com.br> * giscanner/glibtransformer.py: * tools/g-ir-scanner: Execute the dumper program through libtool if it's installed, so we avoid loading the installed version. svn path=/trunk/; revision=964
* Also generate new syntaxColin Walters2008-11-171-8/+3
| | | | svn path=/trunk/; revision=933
* Bug 558436 - avoid having scanner load app codeColin Walters2008-11-131-9/+23
| | | | svn path=/trunk/; revision=912
* Add a GirParser object to hold the state of a compilationOwen Taylor2008-11-121-1/+11
| | | | | | | | 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. svn path=/trunk/; revision=901
* Add a GIRepository-2.0.gir. Change the libtool lookup slightly so we canJohan Dahlin2008-11-121-3/+2
| | | | | | | | | | | | | | | | 2008-11-12 Johan Dahlin <jdahlin@async.com.br> * 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 svn path=/trunk/; revision=890
* Remove field offsets from g-ir-generate output and test inputsOwen Taylor2008-11-111-2/+0
| | | | | | | | | | | 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. Remove field offsets from girs. (Virtual function and discriminator offsets are not removed, as they aren't fully hooked up to the field-offset computation machinery yet.) svn path=/trunk/; revision=877
* If any of the path parts in sys.path contains lib64, use lib64 as a libdir ↵Johan Dahlin2008-11-021-1/+7
| | | | | | instead of lib svn path=/trunk/; revision=861
* Remove arguments from the constructor, move them to separate accessors.Johan Dahlin2008-10-301-8/+16
| | | | | | | | | | | | | | | | | | | | 2008-10-30 Johan Dahlin <jdahlin@async.com.br> * giscanner/girparser.py: Remove arguments from the constructor, move them to separate accessors. Add a new parse_tree method which takes an element tree instance. * tools/g-ir-scanner: Update callsite for this * giscanner/Makefile.am: * giscanner/cachestore.py: * giscanner/transformer.py: Cache the include parsing. Saves ~25% time when creating vte (which includes everything up to gtk+). svn path=/trunk/; revision=842
* Rewrap and reorder includesJohan Dahlin2008-10-301-5/+9
| | | | svn path=/trunk/; revision=839
* add LD_LIBRARY_PATH to LPATH before calling ld.Johan Bilien2008-10-281-0/+5
| | | | | | | | | 2008-10-28 Johan Bilien <jobi@via.ecp.fr> * tools/g-ir-scanner: add LD_LIBRARY_PATH to LPATH before calling ld. svn path=/trunk/; revision=822
* Bug 557786 - support fixed size arraysColin Walters2008-10-251-4/+7
| | | | svn path=/trunk/; revision=814
* Bug 556739 – transfer-ownership attribute should be mandatory in .girTommi Komulainen2008-10-231-14/+13
| | | | | | | | | | | | | | | | | | | | | | | 2008-10-23 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer): * giscanner/transformer.py (_create_parameter, _create_return): * giscanner/girwriter.py (_write_return, _write_parameter): * tools/generate.c (write_callable_info): always write and require "transfer-ownership" for return-values and parameters * tests/boxed.gir: * tests/invoke/testfns-1.0.gir: * tests/object.gir: * tests/scanner/DrawableAdditions.xml: * tests/scanner/GtkFrob-1.0-expected.tgir: * tests/scanner/annotation-1.0-expected.tgir: * tests/scanner/drawable-1.0-expected.tgir: * tests/scanner/drawable-injected-1.0-expected.gir: * tests/scanner/drawable-injected-1.0-expected.tgir: * tests/scanner/foo-1.0-expected.tgir: Updated svn path=/trunk/; revision=797
* Bug 557379 – g-ir-generate not writing the 'abstract' attributeTommi Komulainen2008-10-221-0/+5
| | | | | | | | | | | | 2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * tests/scanner/drawable-1.0-expected.tgir: * tests/scanner/drawable-injected-1.0-expected.tgir: * tests/scanner/foo-1.0-expected.tgir: * tools/generate.c (write_object_info): write 'abstract' attribute for classes svn path=/trunk/; revision=785
* Bug 557405 – Use 'allow-none' consistentlyTommi Komulainen2008-10-221-2/+2
| | | | | | | | | | | | | | | | | | 2008-10-22 Tommi Komulainen <tommi.komulainen@iki.fi> * docs/typelib-format.txt: * girepository/ginfo.c (g_arg_info_may_be_null): * girepository/girnode.c (g_ir_node_build_typelib): * girepository/girnode.h (struct _GIrNodeParam): * girepository/girparser.c (start_parameter): * girepository/girwriter.c (function_generate): * girepository/gtypelib.h (ArgBlob): * tests/errors.gir: * tests/function.gir: * tools/generate.c (write_callable_info): Use 'allow-none' consistently throughout svn path=/trunk/; revision=782
* Write out throws attributeColin Walters2008-10-211-0/+5
| | | | svn path=/trunk/; revision=776
* Bug 556783 - namespace/prefix reworkColin Walters2008-10-181-4/+7
| | | | svn path=/trunk/; revision=746
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-2/+2
| | | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * girepository/girparser.c (start_parameter): * tests/boxed.gir: * tests/invoke/testfns-1.0.gir: * tools/generate.c (write_callable_info): write 'transfer-ownership' attribute consistently with both return-value and parameter elements svn path=/trunk/; revision=745
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-5/+2
| | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * tools/generate.c (write_callable_info): write 'direction' attribute only if other than 'in' to be consistent with girwriter.py * tests/boxed.gir: * tests/object.gir: remove direction="in" which is the default svn path=/trunk/; revision=744
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * giscanner/ast.py (Field): add readable and writable properties * giscanner/girparser.py (_parse_field): copy 'readable' and 'writable' attributes * giscanner/transformer.py (_create_member): create fields as read-write * giscanner/glibtransformer.py (_introspect_object, _pair_class_struct): make object instance and class fields read-only * giscanner/girwriter.py (_write_field): * tools/generate.c (write_field_info): write field 'readable' and 'writable' attributes only if non-default (read-only) * girepository/girparser.c (start_field): in the absence of attributes assume fields are read-only * tests/boxed.gir: * tests/struct.gir: remove redundant readable="1" from fields * tests/scanner/foo-1.0-expected.gir: * tests/scanner/utility-1.0-expected.gir: add writable="1" to all record and union fields svn path=/trunk/; revision=743
* Bug 556732 – generate gir files consistentlyTommi Komulainen2008-10-171-7/+3
| | | | | | | | | | | | | | | 2008-10-17 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556732 – generate gir files consistently * giscanner/girwriter.py (_write_property): write properties 'construct' attribute if set * tools/generate.c (write_property_info): write properties 'readable' and 'writable' attributes only if non-default * tests/object.gir: add writable="0" * tests/scanner/foo-1.0-expected.gir: add construct="1" svn path=/trunk/; revision=742
* Bug 556543 – reduce compiler warningsTommi Komulainen2008-10-162-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2008-10-16 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556543 – reduce compiler warnings * girepository/ginfo.c: * girepository/girepository.c (register_internal, count_interfaces, find_interface, find_namespace_version, parse_version, g_irepository_require): * girepository/girmodule.c (g_ir_module_build_typelib): * girepository/girnode.c (init_stats, dump_stats, _g_irnode_init_stats, _g_irnode_dump_stats, g_ir_node_can_have_member): * girepository/girparser.c (firstpass_end_element_handler, locate_gir, parse_basic, parse_type_internal, resolve_aliases, start_alias, start_type, end_type_top, parse_include, cleanup, post_filter): * girepository/gtypelib.c (validate_function_blob, validate_enum_blob): * giscanner/giscannermodule.c (directive_get_options, type_get_child_list): * giscanner/scannerlexer.l (parse_gtkdoc): * giscanner/scannerparser.y (ctype_free): * giscanner/sourcescanner.c: * giscanner/sourcescanner.h (gi_source_scanner_parse_macros): * tests/types/gitesttypes.c: * tools/compiler.c (main): * tools/generate.c (write_repository): Remove unused variables and code, add missing includes, declarations and case statements. svn path=/trunk/; revision=730
* Fix up g-ir-generate for new include= syntaxColin Walters2008-10-161-1/+3
| | | | svn path=/trunk/; revision=726
* Merge branch 'bug556331-includecleanup'Colin Walters2008-10-161-1/+10
| | | | svn path=/trunk/; revision=724
* reduce code duplicationTommi Komulainen2008-10-151-16/+18
| | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (write_type_name, write_type_info, write_type_info, write_object_info, write_object_info, write_interface_info, write_error_domain_info): reduce code duplication svn path=/trunk/; revision=718
* Bug 556174 – parse types for lists etc.Tommi Komulainen2008-10-151-64/+41
| | | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> Bug 556174 – parse types for lists etc. * girepository/girparser.c (end_type_recurse): * tests/boxed.gir: * tools/generate.c (write_type_info, write_field_info, write_callable_info, write_callable_info, write_constant_info, write_property_info): use nested <type>s for lists and hashes svn path=/trunk/; revision=717
* quote printf arguments so that we don't generate invalid XML by writingTommi Komulainen2008-10-151-1/+4
| | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (xml_printf): quote printf arguments so that we don't generate invalid XML by writing unescaped double quotes and such in attributes svn path=/trunk/; revision=715
* remove unused indent parameters, xmlwriter keeps track of necessaryTommi Komulainen2008-10-151-21/+17
| | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (write_field_info, write_callable_info, write_function_info, write_callback_info, write_struct_info, write_constant_value, write_signal_info, write_vfunc_info, write_object_info, write_interface_info, write_union_info, write_repository): remove unused indent parameters, xmlwriter keeps track of necessary indentation svn path=/trunk/; revision=714
* Keep track of generated XML tree and handle indentation and closing tagsTommi Komulainen2008-10-151-94/+179
| | | | | | | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (xml_element_new, xml_element_free, xml_start_element, xml_end_element, xml_end_element_unchecked, xml_open, xml_close): Keep track of generated XML tree and handle indentation and closing tags properly. (write_field_info, write_callable_info, write_function_info, write_callback_info, write_struct_info, write_value_info, write_constant_info, write_enum_info, write_signal_info, write_vfunc_info, write_property_info, write_object_info, write_interface_info, write_error_domain_info, write_union_info, write_repository): Use xml_start_element and xml_end_element to open/close tags. svn path=/trunk/; revision=713
* wrap all FILE access to go through simple xmlwriterTommi Komulainen2008-10-151-212/+259
| | | | | | | | | | | | | | | 2008-10-15 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (xml_printf, xml_open, xml_close, xml_free): (write_type_name, write_type_info, write_field_info, write_callable_info, write_function_info, write_callback_info, write_struct_info, write_value_info, write_constant_value, write_constant_info, write_enum_info, write_signal_info, write_vfunc_info, write_property_info, write_object_info, write_interface_info, write_error_domain_info, write_union_info, write_repository): wrap all FILE access to go through simple xmlwriter svn path=/trunk/; revision=712
* use "transfer-ownership" attribute for return valuesTommi Komulainen2008-10-121-2/+2
| | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (write_callable_info): use "transfer-ownership" attribute for return values svn path=/trunk/; revision=692
* move "transfer" and "null-ok" attributes from <function> to <return-value>Tommi Komulainen2008-10-121-4/+6
| | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * tools/generate.c (write_callable_info): move "transfer" and "null-ok" attributes from <function> to <return-value> element svn path=/trunk/; revision=691
* use "container" for container/shallow ownership transfer (not "shallow")Tommi Komulainen2008-10-121-2/+2
| | | | | | | | | | 2008-10-12 Tommi Komulainen <tommi.komulainen@iki.fi> * girepository/girparser.c (parse_param_transfer): * tools/generate.c (write_callable_info): use "container" for container/shallow ownership transfer (not "shallow") svn path=/trunk/; revision=689
* Bug 552858: versioningColin Walters2008-10-122-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ignore non-UTF-8 string constantsJohan Bilien2008-10-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | 2008-10-11 Johan Bilien <jobi@litl.com> * giscanner/scannerparser.y: ignore non-UTF-8 string constants 2008-10-11 Johan Bilien <jobi@litl.com> Bug 552347: Parse #defines constants * girepository/gtypelib.c: update the list of value_size with recently defined type tags * giscanner/scannerparser.y: brought back parsing of #defined, as present in older version * giscanner/giscannermodule.c: bind gi_source_scanner_append_filename * giscanner/girwriter.py: write out constant tags in the gir * giscanner/sourcescanner.py: add accessor for const_string * giscanner/transformer.py, giscanner/glibtransformer.py: handle constant svn path=/trunk/; revision=673
* Bug 554854: The --typelib-xml and --inject options should reuse giscannerLucas Rocha2008-10-111-6/+19
| | | | | | | | | | | | | | | | | | | 2008-10-11 Lucas Rocha <lucasr@gnome.org> Bug 554854: The --typelib-xml and --inject options should reuse giscanner parser/writer. * giscanner/ast.py: add constructor list to Struct and Union. Add new param in Return's contructor to define transfer. * giscanner/girparser.py: several additions to the parser in order to have parsing all nodes of the gir xml files. * tools/g-ir-scanner (typelib_xml_strip, inject): use gir parser and writer in --inject and --typelib-xml options. * giscanner/xmlwriter.py: ignore empty attributes instead of raising an error as this basically exposes a bug in GIRParser. This should be reverted as soon as the parser is fixed. svn path=/trunk/; revision=665
* WhitespaceJohan Dahlin2008-10-111-2/+2
| | | | svn path=/trunk/; revision=663
* Bug 555293: append library_paths to LPATH env variable to work around aLucas Rocha2008-10-101-0/+10
| | | | | | | | | | | 2008-10-10 Lucas Rocha <lucasr@gnome.org> Bug 555293: append library_paths to LPATH env variable to work around a bug in find_library when using ldconfig. * tools/g-ir-scanner (main): ditto. svn path=/trunk/; revision=662
* Bug 555294: Add support for multiple shared libraries per typelib.Lucas Rocha2008-10-071-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* Bug 554632: Create type tag for GTypeColin Walters2008-10-021-26/+2
| | | | svn path=/trunk/; revision=641
* Add g-ir-scanner --injectColin Walters2008-09-271-1/+26
| | | | svn path=/trunk/; revision=631
* Use symbolic names for type tags instead of hardcoded integersColin Walters2008-09-231-8/+11
| | | | svn path=/trunk/; revision=626
* Merge branch 'bug552566-timet/wip'Colin Walters2008-09-231-0/+1
| | | | svn path=/trunk/; revision=624
* Explode immediately if we don't recognize a typeColin Walters2008-09-191-0/+2
| | | | svn path=/trunk/; revision=619
* Fix indentationColin Walters2008-09-191-6/+8
| | | | svn path=/trunk/; revision=618
* Add check to make sure we're not hitting out unresolved typesColin Walters2008-09-191-0/+12
| | | | svn path=/trunk/; revision=616