summaryrefslogtreecommitdiff
path: root/giscanner
Commit message (Collapse)AuthorAgeFilesLines
* Bug 575613 - Enum stripping with common prefix, also use "_" consistentlyColin Walters2009-03-173-15/+42
| | | | | | | | | | | | | Some enums have members which have a common prefix which doesn't match that of the enum name, but it also longer than the global namespace prefix. Instead, try stripping the common prefix first, and only if that fails fall back to the global strip. Also, for glib-registered enums we were using the nick, which typically has "-" as a separator. Replace that with "_" for consistency between unregistered enums and registered. utils.py:strip_common_prefix is now unused, delete.
* Bug 565147 - Add (type) annotation to override the C type definitionColin Walters2009-03-161-1/+6
| | | | | | We previously supported (type) on signals only, extend it to all cases. This is useful for a few cases where libraries use a superclass like GtkWidget* for C convenience, where the actual type is a subclass.
* Bug 574501 - Install giscanner Python module to private directoryColin Walters2009-03-162-1/+344
| | | | | | 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 574139 – There is no way to identify 'user_data' arguments in the ↵Andreas Rottmann2009-03-091-2/+9
| | | | | | | | | | | | callback signature Add a heuristic to the scanner that flags arguments of callbacks that are named 'user_data' (exact match) and have a 'any (void*) type. These arguments are marked by setting the 'closure' field of ArgBlob to the index of themselves. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 557383 - Virtual method supportColin Walters2009-03-054-56/+157
| | | | | | | | | | | | | | | | 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 573332 - Allow annotation of enums as bitfieldsAndreas Rottmann2009-03-041-0/+7
| | | | | | Add support for a `(type bitfield)' annotation for enums. Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Introduce documentation-block optionsAndreas Rottmann2009-03-041-7/+18
| | | | | | | | | | Allow a documentation block to have options, e.g.: /* * SomeType: (OPT-NAME VALUE) ... */ Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Bug 571548 - Generic attributesColin Walters2009-03-034-19/+59
| | | | | | | | 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.
* Revert "Bug 557383 - Virtual function support"Colin Walters2009-02-263-23/+10
| | | | | | | This reverts commit 4470a24e8cf3827efaddcfe240c3271cf1a0d6c0. Needs more work as it turns out, we need to figure out the binding story.
* Bug 573306 – Relax callback grouping detection rulesAndreas Rottmann2009-02-261-4/+4
| | | | | | | | Make the callback grouping heuristic more lax: consider all pointer parameters ending in 'data' to be the user_data parameter (instead of requiring an exact 'user_data' name). Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
* Merge branch 'bug557383-vfuncs'Colin Walters2009-02-263-10/+23
|\
| * Bug 557383 - Virtual function supportColin Walters2009-02-263-10/+23
| | | | | | | | | | | | | | In order to determine whether a method is virtual, by default we look at the class table to find a callback field. This should be fairly reliable, but we may also later need annotations to more finely control this in the case of a name clash with a signal.
* | Don't assume _pkgconfig_packages is set.Johan Dahlin2009-02-261-0/+4
|/ | | | | This fixes a cache issue where the pickle in the cache doesn't have self._pkgconfig_packages set in its instance
* Bug 572434 - Associate interfaces with their C structuresColin Walters2009-02-254-18/+36
| | | | | | | | 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 555964 - Parse floating-point #definesColin Walters2009-02-255-7/+42
| | | | | | Previously we just supported int and string, add double to this. Technically we should probably differentiate between float and double, but it's not likely to be very useful in practice to do so.
* Handle multiple arguments for $CCColin Walters2009-02-251-1/+2
| | | | This makes the dumper not fail for people who set $CC to e.g. "distcc gcc".
* Bug 572790 - Don't register #defines from .c files as constantsColin Walters2009-02-245-1/+30
| | | | | We keep track of the source filename for every symbol. This enables us to later filter symbols based on that name.
* Bug 561604 - Don't fail on va_list*Colin Walters2009-02-231-1/+1
| | | | | gvariant uses va_list *; we were previously skipping va_list, we should skip indirect variants as well.
* Do not include yyoutput in the generated lexerJohan Dahlin2009-02-211-0/+2
| | | | | Avoids a compilation warning (unused function) in the generated lexer output.
* Fix warnings pointed out by GCCJohan Dahlin2009-02-201-0/+2
|
* Be less verboseJohan Dahlin2009-02-201-7/+6
|
* Mention that we're generating a GIRJohan Dahlin2009-02-201-0/+1
|
* Disable a UTF-8 warning per defaultJohan Dahlin2009-02-201-0/+2
|
* Use shave to reduce compiling outputJohan Dahlin2009-02-201-2/+4
| | | | Which let's us focus on the important warnings.
* Bug 572423 - Support --c-include argument for specifying C headersColin Walters2009-02-201-3/+11
| | | | | 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).
* Send in an empty list instead of None.Johan Dahlin2009-02-201-0/+2
|
* giscanner: Set Python exceptions on type errors instead of g_assertColin Walters2009-02-191-7/+17
| | | | This gives us nice stack traces.
* Improve type checkingJohan Dahlin2009-02-191-0/+3
|
* Add a hall of shame commentJohan Dahlin2009-02-191-0/+3
|
* Bug 572075 - Make the scanner work with static and convenience librariesOwen W. Taylor2009-02-192-8/+38
| | | | | | | | | | | | | | | | | 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
* Bug 563382 - Define PATH_MAX if not availableColin Walters2009-02-191-0/+3
| | | | | This fixes the build on Hurd. If anyone ever actually uses Hurd with filenames longer than 4096, they can open a new bug.
* Bug 571483 - Sort toplevel .gir entriesColin Walters2009-02-172-1/+17
| | | | This ensures we're stable on a macro level.
* Merge branch 'master' of ssh://walters@git.gnome.org/git/gobject-introspectionColin Walters2009-02-171-5/+5
|\
| * Parse doc-comment tags case-insensitiveOwen W. Taylor2009-02-171-5/+5
| | | | | | | | | | | | | | | | | | gtk-doc treats tags like 'Return value:' or 'Since:' as case-insensitive, do the same to make things as predictable as possibe and avoid strange problems where a 'Return Value:' tag work with gtk-doc but not g-ir-scanner. http://bugzilla.gnome.org/show_bug.cgi?id=572086
* | Merge branch 'master' of ssh://walters@git.gnome.org/git/gobject-introspectionColin Walters2009-02-131-1/+1
|\ \ | |/
| * Add missing self parameterJohan Dahlin2009-02-111-1/+1
| | | | | | | | This is really why you shouldn't catch TypeError.
* | Bug 567906 - Put pkg-config dependencies in .gir filesColin Walters2009-02-113-10/+38
|/ | | | | | | | | | 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-063-16/+25
| | | | | | | | | | | | | | | | | | | | | 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
* Bug 561360 - If we can't resolve parent class, use GObjectColin Walters2009-02-051-1/+11
| | | | | | This enables us to support "hidden" parent classes. svn path=/trunk/; revision=1087
* Bug 555960 - Nested structs and unions (generation portion)Colin Walters2009-02-043-25/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Patch from Andreas Rottmann <a.rottmann@gmx.at>. * tests/scanner/utility.h (UtilityTaggedValue): Make the union member anonymous. (UtilityByte): New union typedef with an unnamed struct in it. * giscanner/transformer.py (Transformer._create_struct): Create unnamed structs for symbols with a None ident. (Transformer._create_union): Likewise. * giscanner/girwriter.py (GIRWriter._write_record): Allow name being None. (GIRWriter._write_union): Likewise. * girepository/girparser.c (start_struct): Allow a NULL name for non-toplevel structs. (start_union): Likewise. * tests/scanner/utility.h (UtilityTaggedValue): New struct typedef, which has a nested union member. * tests/scanner/utility-expected.gir: Adapted. * giscanner/transformer.py (Transformer._create_member): Create struct/union members if appropriate. (Transformer._create_struct, Transformer._create_union): Allow for structs/unions without a C type. * giscanner/glibtransformer.py (GLibTransformer._resolve_field): We don't need to resolve non-typef'd (GLibTransformer._resolve_field): Add cases for non-typedef'd struct/union "fields". * giscanner/girwriter.py (GIRWriter._write_record): Allow for records without a C type. (GIRWriter._write_field): structs and unions may appear in places where fields do. svn path=/trunk/; revision=1082
* Bug 569408, Bug 568680 - Scanner misses fields (at least in GObject.Object)Colin Walters2009-02-022-26/+26
| | | | | | | | The scanner misses all fields of the GObject struct -- there are no <field> children of the <class> element for GObject in the GIR. This of course yields wrong field offsets for all derived objects. svn path=/trunk/; revision=1079
* Misc warning fixesDan Winship2009-01-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | * 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
* Skip over both g_object_get_type and g_initially_unowned_get_typeColin Walters2009-01-221-0/+4
| | | | | | | g_object_get_type hasn't always been in GObject, we handle it internally elsewhere. svn path=/trunk/; revision=1065
* Bug 562622 – Errordomains missingJohan Dahlin2009-01-223-1/+28
| | | | | | | | | | | | | | | | | | 2009-01-21 Johan Dahlin <jdahlin@async.com.br> Bug 562622 – Errordomains missing * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * tests/scanner/Makefile.am: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: * tests/scanner/foo.c (foo_error_get_type), (foo_error_quark): * tests/scanner/foo.h: svn path=/trunk/; revision=1057
* Increase the buffer size to 1M, so gtkalias.h can be parsed.Johan Dahlin2009-01-201-1/+1
| | | | | | | | | | | 2009-01-20 Johan Dahlin <jdahlin@async.com.br> * giscanner/scannerlexer.l: Increase the buffer size to 1M, so gtkalias.h can be parsed. svn path=/trunk/; revision=1056
* When trying to map functions to structs, do not require a public structureJohan Dahlin2009-01-201-0/+2
| | | | | | | | | | | | 2009-01-20 Johan Dahlin <jdahlin@async.com.br> * giscanner/glibtransformer.py: When trying to map functions to structs, do not require a public structure to exist, should fix Gst gir generation in. svn path=/trunk/; revision=1055
* Bug 562615 – Struct methods missingJohan Dahlin2009-01-205-21/+29
| | | | | | | | | | | | | | | | | 2009-01-20 Johan Dahlin <jdahlin@async.com.br> Bug 562615 – Struct methods missing * giscanner/annotationparser.py: * giscanner/ast.py: * giscanner/girwriter.py: * giscanner/glibast.py: * giscanner/glibtransformer.py: * tests/scanner/foo-1.0-expected.gir: * tests/scanner/foo-1.0-expected.tgir: svn path=/trunk/; revision=1054
* Ugh, recurd->recordJohan Dahlin2009-01-201-11/+11
| | | | svn path=/trunk/; revision=1053
* Struct -> RecordJohan Dahlin2009-01-201-24/+24
| | | | svn path=/trunk/; revision=1052
* add FT_Int32 add XftFont Report errors when an invalid type is encounteredJohan Dahlin2009-01-161-1/+4
| | | | | | | | | | | | | | | | 2009-01-15 Johan Dahlin <jdahlin@async.com.br> * gir/freetype2-2.0.gir: add FT_Int32 * gir/xft-2.0.gir: add XftFont * girepository/gdump.c (g_irepository_dump): Report errors when an invalid type is encountered * giscanner/glibtransformer.py: Make the error message a bit nicer. Part of preparating for gir generating inside pango. svn path=/trunk/; revision=1050