summaryrefslogtreecommitdiff
path: root/tools
Commit message (Collapse)AuthorAgeFilesLines
* Implement callbacks as part of struct fields. Fixes #557383Tomeu Vizoso2009-11-111-2/+16
| | | | | | gir: embed <callback> inside <field> typelib: if a field contains a callback, store it just after the FieldBlob girepository API: no additions
* Bug 593162 - Use built scanner from tarball buildsColin Walters2009-09-041-4/+3
| | | | | Looking for .git/.svn breaks in tarball scenarios; instead just see if our source directory is named 'tools'.
* Bug 578200 - Substitute $(PYTHON) in g-ir-scanner.inColin Walters2009-08-242-2/+2
| | | | This lets us pick up non-default /usr/bin/python2.6 correctly.
* Bug 585584: Fix warnings in girparser backtrace functionality and compiler.cC. Scott Ananian2009-06-121-0/+2
|
* Bug 577534 - Use rename to write new typelibs, instead of in-place overwriteColin Walters2009-06-091-11/+27
| | | | | This avoids having processes with the typelibs currently open exploding immediately.
* Bug 576605 - Get rid of GI_SCOPE_TYPE_OBJECTAndreas Rottmann2009-03-271-3/+0
| | | | Remove support for (scope object) as it lacks a real use case.
* Include g-ir-scanner.in in the distributionJohan Bilien2009-03-241-1/+3
| | | | and other make distcheck fixes.
* Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtypeColin Walters2009-03-171-0/+4
| | | | | | | Parse the c:prefix from the .gir, include it in the header. Armed with this information, we can now optimize lookups of GTypes because we have the requirement that GTypes must start with the c:prefix. We do fall back though if a lookup fails.
* Substitute g-ir-scanner in Makefile, not in configure.acColin Walters2009-03-161-0/+4
| | | | This avoids issues with unexpanded variables, i.e. ${exec_prefix}/libdir
* Bug 574501 - Install giscanner Python module to private directoryColin Walters2009-03-162-360/+39
| | | | | | We don't want to pollute the global namespace with our private libraries. Also, this sidesteps all the craziness that is happening with OS vendors changing how Python installs modules.
* Bug 557383 - Virtual method supportColin Walters2009-03-051-2/+7
| | | | | | | | | | | | | | | | Broadly speaking, this change adds the concept of <vfunc> to the .gir. The typelib already had most of the infrastructure for virtual functions, though there is one API addition. The scanner assumes that any class callback slot that doesn't match a signal name is a virtual. In the .gir, we write out *both* the <method> wrapper and a <vfunc>. If we can determine an association between them (based on the names matching, or a new Virtual: annotation), then we notate that in the .gir. The typelib gains an association from the vfunc to the function, if it exists. This will be useful for bindings since they already know how to consume FunctionInfo.
* Bug 571548 - Generic attributesColin Walters2009-03-031-4/+38
| | | | | | | | We now support an extensible mechanism where arbitrary key-value pairs may be associated with almost all items, including objects, methods, and properties. These attributes appear in both the .gir and the .typelib.
* Add --all option to g-ir-generateAndreas Rottmann2009-02-271-1/+18
| | | | | | | | | Add --all option, which is intended to show some information not usually included in the GIR. Currently, it shows the size of structs and unions. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-251-5/+13
| | | | | | | | Similar to GObject class structs, we pair up GInterfaces with their C structures. Also, move some GLib-specific things into glibast.py, and make the naming more generic.
* Bug 572790 - Don't register #defines from .c files as constantsColin Walters2009-02-241-1/+3
| | | | | We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
* Handle the return value to fwrite properlyJohan Dahlin2009-02-211-1/+9
|
* Be less verboseJohan Dahlin2009-02-201-3/+0
|
* Bug 572423 - Support --c-include argument for specifying C headersColin Walters2009-02-201-1/+4
| | | | | This option is for specifying inside the .gir what C header files should be included by C consumers (as opposed to parsed by the scanner).
* Bug 572075 - Make the scanner work with static and convenience librariesOwen W. Taylor2009-02-191-5/+11
| | | | | | | | | | | | | | | | | We need to reference the get_type() functions we are going to dlsym or otherwise the linker may not include them in the introspection binary. giscanner/dumper.py: Accept a list of _get_type() functions and write an array referencing them into the introspection binary. giscanner/glibtransformer.py: Break parsing into too stages - the stage where we compute the _get_type() functions and the stage where we invoke the introspection binary. tools/g-ir-scanner: Pass _get_type() functions from the scanner when creating the introspection binary. http://bugzilla.gnome.org/show_bug.cgi?id=572075
* Followup to bug 567906 - Redo option filtering logic to be a bit cleanerColin Walters2009-02-171-10/+11
| | | | | This was suggested during a refactoring of the affected code for bug 567906.
* Bug 567906 - Put pkg-config dependencies in .gir filesColin Walters2009-02-111-39/+56
| | | | | | | | | | When generating a .gir file, we now first parse all of our .gir includes to pick up their <package> headers. Then, we merge that with the set of --pkg arguments passed to us, run pkg-config to gather the arguments, and finally save the merged pkg-config list to our new .gir file. This is useful for software which needs to map from .gir to pkg-config in a programmatic way.
* Bug 551738 - Associate classes with their structsColin Walters2009-02-061-0/+13
| | | | | | | | | | | | | | | | | | | | | Inside glibtransformer, we now look at structures ending in "Class" and see if they have an associated GlibObject (i.e. a structure of the same name without the "Class" suffix). If found, pair them up. The .gir file for <class> gains an attribute denoting its associated class struct. Any <record> many now have a glib:is-class-struct-for annotation which tells which (if any) <class> for which it defines the layout. In the .typelib, we record the association between the class and its structure. Generic structures however just have a boolean saying whether they're a class struct. (Going from a generic class struct to its class should not be necessary). Finally, we expose GIRepository APIs to access both bits of information from the .typelib. svn path=/trunk/; revision=1088
* Misc warning fixesDan Winship2009-01-271-1/+4
| | | | | | | | | | | | | | | | | | | | | | | * giscanner/scannerparser.y: Fix the "Ignoring non-UTF-8 constant string" error to print the right value. * tests/scanner/annotation.c (backslash_parsing_tester) (backslash_parsing_tester_2): make these non-static to avoid a warning. (annotation_object_string_out) (annotation_string_zero_terminated): fix return values * tests/scanner/annotation.h (annotation_object_with_voidp): prototype this * tests/scanner/gtkfrob.c: * tests/scanner/gtkfrob.h (gtk_frob_language_manager_get_default): fix prototype. (s/()/(void)/). * tools/compiler.c (format_output): fix signed/unsigned warning. Output a prototype for register_typelib() to avoid warnings later. svn path=/trunk/; revision=1071
* 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