Colin Walters [Tue, 9 Jun 2009 19:51:57 +0000 (15:51 -0400)]
Bug 577546 - More annotations for GLib, GObject, Gio
Patch modified from one by Norbert Freese <nf2.email@gmail.com>.
Colin Walters [Tue, 9 Jun 2009 18:03:47 +0000 (14:03 -0400)]
Bug 577534 - Use rename to write new typelibs, instead of in-place overwrite
This avoids having processes with the typelibs currently open exploding
immediately.
Colin Walters [Thu, 4 Jun 2009 17:51:26 +0000 (13:51 -0400)]
Bug 584453 - Handle char ** correctly (and const variation)
This patch fixes our default handling of char **. We add Return
node types as a case where we test for array handling.
Remove the hardcoded assumption of array = "no transfer", just
use the separate Parameter/Return cases. This change causes
inout char ** to be transfer="full", but that seems more correct.
Colin Walters [Thu, 4 Jun 2009 16:40:41 +0000 (12:40 -0400)]
Add a test_strv_out which is unannotated, rename current to test_strv_out_container
We need a test case for a plain unannotated char ** return value, which
should be an array.
Keep the old annotated test as a test case for the container transfer.
Simon van der Linden [Mon, 8 Jun 2009 16:51:33 +0000 (12:51 -0400)]
Bug 585081 - Correct everything linkage
We need to link with gobject.
Colin Walters [Thu, 4 Jun 2009 19:35:01 +0000 (15:35 -0400)]
Move Everything into gir/, since it's a public library
Everything isn't a test for quite a while now, it's a public library.
So move it to gir/.
Colin Walters [Thu, 4 Jun 2009 16:42:11 +0000 (12:42 -0400)]
Add an Everything-1.0-expected.gir, test Everything versus it
We should be testing the Everything library as well.
Emmanuele Bassi [Thu, 4 Jun 2009 12:15:31 +0000 (13:15 +0100)]
Add GLclampf to the GL GIR
The GLclampf type is missing from the GL definitions.
http://bugzilla.gnome.org/show_bug.cgi?id=584816
C. Scott Ananian [Mon, 18 May 2009 21:10:14 +0000 (17:10 -0400)]
Annotations for g_option_context_parse.
These annotations match those for gtk_init(), which takes the same
types of arguments.
Andreas Rottmann [Fri, 29 May 2009 20:35:07 +0000 (22:35 +0200)]
A few transfer-related tests for "Everything"
Chris Rivera [Wed, 20 May 2009 23:29:33 +0000 (19:29 -0400)]
Fix pep8.py and its invocation.
pep8.py:input_file() normally returns the number of errors found in a
given file, but it returns an empty dict if the file is excluded. Change
it to return 0 instead.
config.py is auto-generated with a prefix that may be longer than
80 characters. Exclude config.py in the pep8.py check. This fixes
4042.
C. Scott Ananian [Wed, 20 May 2009 00:17:08 +0000 (20:17 -0400)]
Better handle classes with non-standard to_underscore names.
Previously we tried to guess what the "underscore version" of a class name
would be, but for classes like NMSetting8021x we'd guess "nm_setting8021x"
instead of "nm_setting_802_1x". All such guesses are subject to error:
instead let's try to use the prefix of the _get_type() method instead, and
only guess if that doesn't work.
We do this for both class names and when detecting methods. An additional
type with a "non-standard" underscored version (TestWi8021x) added to the
everything.[ch] test suite to test proper conversion.
GdkWindow and GObject have unusual get_type methods; add special quirks
to handle these (at least until the methods are renamed upstream).
(Slightly modified for PEP8 compliance by Colin Walters)
Signed-off-by: Colin Walters <walters@verbum.org>
C. Scott Ananian [Tue, 5 May 2009 17:06:37 +0000 (13:06 -0400)]
Update doc comments.
The enumeration values cited here were out of date. Rewrite to eliminate
the explicit mention of the enumeration value, to prevent it from
drifting out of date again in the future.
C. Scott Ananian [Fri, 1 May 2009 17:36:28 +0000 (13:36 -0400)]
Add GHash tests to Everything test GI library.
C. Scott Ananian [Fri, 1 May 2009 22:20:06 +0000 (18:20 -0400)]
Fix the list comparison assertions.
We weren't checking the length of the input list, and we were erroneously
comparing every element in the test sequence against the *first* element
of the passed-in list.
C. Scott Ananian [Fri, 1 May 2009 20:32:33 +0000 (16:32 -0400)]
Everything: more tests for integer array parameters.
C. Scott Ananian [Fri, 1 May 2009 17:33:04 +0000 (13:33 -0400)]
Fix annotations for GList and GSList tests.
C. Scott Ananian [Fri, 1 May 2009 16:00:45 +0000 (12:00 -0400)]
Enable the utf8 tests in the everything module.
We needed to tweak a couple of the tests for correctness.
C. Scott Ananian [Mon, 27 Apr 2009 14:48:12 +0000 (10:48 -0400)]
Allow the use of the "Rename To" annotation for literal method renaming.
As originally implemented, this annotation was only used for method
overloading (argument signature polymorphism). Allow it to be used to
clean up historically poorly-named methods as well.
C. Scott Ananian [Mon, 27 Apr 2009 14:47:40 +0000 (10:47 -0400)]
Remove orphan text, left over from parent document.
Colin Walters [Thu, 7 May 2009 18:41:30 +0000 (14:41 -0400)]
Remove (out) annotation for now from Everything structs
Right now these annotations don't work; (out) is for callee-allocates.
For more information see
http://bugzilla.gnome.org/show_bug.cgi?id=573314
Tomeu Vizoso [Wed, 6 May 2009 13:18:36 +0000 (15:18 +0200)]
Fix typo in the TestInterface gtype name
Tomeu Vizoso [Tue, 5 May 2009 16:33:55 +0000 (18:33 +0200)]
Add an interface to Everything
Marina Zhurakhinskaya [Fri, 1 May 2009 22:13:39 +0000 (18:13 -0400)]
Add element type annotations for GList arguments
g_app_info_launch and g_app_info_launch_uris needed element type annotations
for their GList arguments.
Colin Walters [Fri, 3 Apr 2009 19:12:04 +0000 (15:12 -0400)]
Avoid writing out empty array if we have no _get_type functions
Zero length arrays are a GNU C extension, so this way we don't
fail on non-GCC.
Dan Winship [Sat, 28 Mar 2009 12:34:36 +0000 (08:34 -0400)]
Fix 'Could not find GIR file ...' error to use right filename.
Also plug a leak; girname was previously only freed on error.
Andreas Rottmann [Fri, 27 Mar 2009 18:31:55 +0000 (19:31 +0100)]
Bug 576605 - Get rid of GI_SCOPE_TYPE_OBJECT
Remove support for (scope object) as it lacks a real use case.
Johan Dahlin [Thu, 26 Mar 2009 01:18:04 +0000 (22:18 -0300)]
Annotate g_filename_completer_get_completions
Andreas Rottmann [Tue, 24 Mar 2009 19:33:53 +0000 (20:33 +0100)]
Remove spurious addition of 'GSList *handlers' in last commit
Andreas Rottmann [Tue, 24 Mar 2009 19:26:36 +0000 (20:26 +0100)]
Additions to the 'Everything' namespace
- Make the destroy-notfied callback test harder by retaining the
callbacks until test_callback_thaw_notifications() is called.
Didier 'Ptitjes [Sun, 22 Mar 2009 20:50:40 +0000 (21:50 +0100)]
Bug 576323 - Fix inner constant parsing Signed-off-by: Didier 'Ptitjes <ptitjes@free.fr>
Signed-off-by: Colin Walters <walters@verbum.org>
Johan Bilien [Tue, 24 Mar 2009 18:36:18 +0000 (18:36 +0000)]
Include g-ir-scanner.in in the distribution
and other make distcheck fixes.
Johan Bilien [Tue, 24 Mar 2009 11:12:38 +0000 (11:12 +0000)]
Add a test signal with an argument flagged as G_SIGNAL_TYPE_STATIC_SCOPE
Andreas Rottmann [Mon, 23 Mar 2009 23:19:03 +0000 (00:19 +0100)]
Add several GLib annotations
Andreas Rottmann [Mon, 23 Mar 2009 22:19:24 +0000 (23:19 +0100)]
Bug 574284 - Add support for a 'closure' and 'destroy' annotations
This allows to annotate cases where the heuristics don't work.
TODO: According to Juerbi, there are cases where two callbacks refer
to the same user_data, which is prohibited by the current
implementation.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Andreas Rottmann [Thu, 19 Mar 2009 00:25:09 +0000 (01:25 +0100)]
Some small cosmetic tweaks
* Fix compiler warnings:
- Missing return value in annotation-testing code
- Fix two function declarations to have a (void) parameter list --
this is not C++ ;-)
* Add tools/g-ir-scanner to .gitignore, as it's now generated
Andreas Rottmann [Thu, 19 Mar 2009 00:01:58 +0000 (01:01 +0100)]
Bug 556475 – support Shadows: annotation
Add support for the 'Rename To:' annotation for functions and methods.
Colin Walters [Thu, 12 Feb 2009 23:42:47 +0000 (18:42 -0500)]
Bug 564016 - Include c:prefix in typelib, use it to optimize find_by_gtype
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.
Colin Walters [Thu, 12 Feb 2009 22:40:08 +0000 (17:40 -0500)]
Bug 564016 - Add c:prefix to .gir
This has a few use cases; the main one in mind right now is that
when we place this in the .typelib as well, we can use it to optimize
lookups based on GType names, by skipping entirely typelibs whose
c:prefix is not a prefix of the target type lookup.
Colin Walters [Mon, 16 Mar 2009 22:25:19 +0000 (18:25 -0400)]
Bug 575613 - Enum stripping with common prefix, also use "_" consistently
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.
Colin Walters [Mon, 16 Mar 2009 19:36:21 +0000 (15:36 -0400)]
Substitute g-ir-scanner in Makefile, not in configure.ac
This avoids issues with unexpanded variables, i.e. ${exec_prefix}/libdir
Colin Walters [Thu, 19 Feb 2009 17:16:17 +0000 (12:16 -0500)]
Bug 565147 - Add (type) annotation to override the C type definition
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.
Colin Walters [Mon, 9 Mar 2009 19:08:50 +0000 (15:08 -0400)]
Bug 574501 - Install giscanner Python module to private directory
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.
Andreas Rottmann [Mon, 9 Mar 2009 17:33:00 +0000 (18:33 +0100)]
Bug 574139 – There is no way to identify 'user_data' arguments in the 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>
Colin Walters [Sat, 28 Feb 2009 00:02:48 +0000 (19:02 -0500)]
Bug 557383 - Virtual method support
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.
Andreas Rottmann [Wed, 4 Mar 2009 14:59:28 +0000 (15:59 +0100)]
Bug 573332 - Allow annotation of enums as bitfields
Add support for a `(type bitfield)' annotation for enums.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Andreas Rottmann [Wed, 4 Mar 2009 14:59:28 +0000 (15:59 +0100)]
Introduce documentation-block options
Allow a documentation block to have options, e.g.:
/*
* SomeType: (OPT-NAME VALUE) ...
*/
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Colin Walters [Tue, 3 Mar 2009 23:14:28 +0000 (18:14 -0500)]
Add XftGlyphSpec to xft-2.0.gir
For PangoXft.
Colin Walters [Tue, 3 Mar 2009 23:00:16 +0000 (18:00 -0500)]
Add XTrapezoid to xlib-2.0.gir
This is necessary for PangoXft.
Colin Walters [Fri, 20 Feb 2009 02:48:51 +0000 (21:48 -0500)]
Bug 571548 - Generic attributes
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.
Colin Walters [Tue, 3 Mar 2009 21:44:36 +0000 (16:44 -0500)]
Keep TestStructA as simple by moving GObject member to a new structure
The change in commit 2912b broke the gjs test suite which was relying
on TestStructA being "simple" (i.e. only having primitive fields as members).
Colin Walters [Tue, 3 Mar 2009 19:55:39 +0000 (14:55 -0500)]
Remove hand-written .gir files, move PEP-8 inquisition into top Makefile.am
We have more comprehensive testing in tests/scanner and tests/everything,
and these tests were designed from a time when we were trying to make
the g-ir-generate output exactly match the .gir, which has not been true
for some time and will not be in the future.
Colin Walters [Sat, 28 Feb 2009 00:11:26 +0000 (19:11 -0500)]
Add a parent parmeter to g_ir_node_build_typelib
This will be useful for later changes which need to inspect the parent.
Johan Dahlin [Fri, 27 Feb 2009 16:50:06 +0000 (13:50 -0300)]
Add srcdir, so distcheck passes
Johan Dahlin [Fri, 27 Feb 2009 16:49:56 +0000 (13:49 -0300)]
Dist m4 files
Johan Dahlin [Fri, 27 Feb 2009 16:32:48 +0000 (13:32 -0300)]
Add GObject-2.0.xpath to EXTRA_DIST
Johan Dahlin [Fri, 27 Feb 2009 14:39:14 +0000 (11:39 -0300)]
Disable more of the build if gtk-doc is disabled
Andreas Rottmann [Thu, 26 Feb 2009 23:17:16 +0000 (00:17 +0100)]
Add --all option to g-ir-generate
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>
Andreas Rottmann [Thu, 26 Feb 2009 23:12:19 +0000 (00:12 +0100)]
Additions to "Everything" test namespace
Add a signal and a "bare" member (i.e. a member without getter/setter)
to TestObj.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
Colin Walters [Thu, 26 Feb 2009 21:52:42 +0000 (16:52 -0500)]
Revert "Bug 557383 - Virtual function support"
This reverts commit
4470a24e8cf3827efaddcfe240c3271cf1a0d6c0.
Needs more work as it turns out, we need to figure out the binding
story.
Andreas Rottmann [Thu, 26 Feb 2009 20:17:39 +0000 (21:17 +0100)]
Bug 573306 – Relax callback grouping detection rules
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>
Colin Walters [Thu, 26 Feb 2009 19:44:24 +0000 (14:44 -0500)]
Merge branch 'bug557383-vfuncs'
Colin Walters [Wed, 25 Feb 2009 23:43:14 +0000 (18:43 -0500)]
Bug 557383 - Virtual function support
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.
Johan Dahlin [Thu, 26 Feb 2009 13:21:40 +0000 (10:21 -0300)]
Don't assume _pkgconfig_packages is set.
This fixes a cache issue where the pickle in the cache doesn't
have self._pkgconfig_packages set in its instance
Colin Walters [Fri, 20 Feb 2009 22:34:20 +0000 (17:34 -0500)]
Bug 572434 - Associate interfaces with their C structures
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.
Colin Walters [Wed, 25 Feb 2009 20:25:36 +0000 (15:25 -0500)]
Bug 555964 - Parse floating-point #defines
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.
Johan Dahlin [Wed, 25 Feb 2009 17:38:39 +0000 (14:38 -0300)]
Merge commit 'origin'
Johan Dahlin [Wed, 25 Feb 2009 17:38:20 +0000 (14:38 -0300)]
Fix a typo, reel -> real
Colin Walters [Wed, 25 Feb 2009 17:25:28 +0000 (12:25 -0500)]
Handle multiple arguments for $CC
This makes the dumper not fail for people who set $CC to e.g. "distcc gcc".
Colin Walters [Tue, 24 Feb 2009 04:04:35 +0000 (23:04 -0500)]
Bug 572790 - Don't register #defines from .c files as constants
We keep track of the source filename for every symbol. This enables
us to later filter symbols based on that name.
Johan Bilien [Tue, 24 Feb 2009 15:19:07 +0000 (15:19 +0000)]
Bug 572965 – Allow generic marshaller to be called without parameters
girepository/ginvoke.c: handle the case where n_param_values == 0.
tests/invoke/genericmarshaller.c: add a test case for this.
Colin Walters [Mon, 23 Feb 2009 21:14:02 +0000 (16:14 -0500)]
Bug 561604 - Don't fail on va_list*
gvariant uses va_list *; we were previously skipping va_list, we should
skip indirect variants as well.
Colin Walters [Mon, 23 Feb 2009 21:58:12 +0000 (16:58 -0500)]
Punt on building with older gtk-doc; version skew in gtk-doc.make makes patching hard
We'll just require 1.12, which is the version fixed to work with shave.
Colin Walters [Mon, 23 Feb 2009 20:19:01 +0000 (15:19 -0500)]
shave fix: Patch gtk-doc.make if we don't have it yet
This fixes the build with gtk-doc enabled.
Johan Dahlin [Sat, 21 Feb 2009 03:00:34 +0000 (00:00 -0300)]
Do not include yyoutput in the generated lexer
Avoids a compilation warning (unused function)
in the generated lexer output.
Johan Dahlin [Sat, 21 Feb 2009 02:58:22 +0000 (23:58 -0300)]
Handle the return value to fwrite properly
Johan Dahlin [Sat, 21 Feb 2009 02:54:11 +0000 (23:54 -0300)]
Fix warnings pointed out by GCC
Johan Dahlin [Sat, 21 Feb 2009 02:53:38 +0000 (23:53 -0300)]
Be less verbose
Johan Dahlin [Sat, 21 Feb 2009 02:52:51 +0000 (23:52 -0300)]
Mention that we're generating a GIR
Johan Dahlin [Sat, 21 Feb 2009 02:52:10 +0000 (23:52 -0300)]
Reformat the output to fit shave
Johan Dahlin [Sat, 21 Feb 2009 02:35:45 +0000 (23:35 -0300)]
Disable a UTF-8 warning per default
Johan Dahlin [Sat, 21 Feb 2009 02:34:08 +0000 (23:34 -0300)]
Update .gitignore for gtk-doc
Johan Dahlin [Sat, 21 Feb 2009 02:32:26 +0000 (23:32 -0300)]
Use shave to reduce compiling output
Which let's us focus on the important warnings.
Colin Walters [Fri, 20 Feb 2009 16:05:53 +0000 (11:05 -0500)]
typelib building: Compress 5 arguments for g_ir_node_build_typelib
This makes it easier to add more over time without changing lots
of unrelated code.
Colin Walters [Thu, 19 Feb 2009 22:52:22 +0000 (17:52 -0500)]
Bug 572423 - Support --c-include argument for specifying C headers
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).
Johan Dahlin [Fri, 20 Feb 2009 12:50:01 +0000 (09:50 -0300)]
Send in an empty list instead of None.
Colin Walters [Thu, 19 Feb 2009 23:38:27 +0000 (18:38 -0500)]
giscanner: Set Python exceptions on type errors instead of g_assert
This gives us nice stack traces.
Johan Dahlin [Thu, 19 Feb 2009 23:25:04 +0000 (20:25 -0300)]
Improve type checking
Johan Dahlin [Thu, 19 Feb 2009 22:50:36 +0000 (19:50 -0300)]
Add a hall of shame comment
Owen W. Taylor [Mon, 16 Feb 2009 21:52:52 +0000 (16:52 -0500)]
Bug 572075 - Make the scanner work with static and convenience libraries
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
Colin Walters [Thu, 19 Feb 2009 16:23:32 +0000 (11:23 -0500)]
Remove gtk-doc.m4, should be installed by autogen
Colin Walters [Thu, 19 Feb 2009 16:18:48 +0000 (11:18 -0500)]
Further cleanup for commented-out Union discriminator handling
Colin Walters [Fri, 13 Feb 2009 20:10:21 +0000 (15:10 -0500)]
Bug 563382 - Define PATH_MAX if not available
This fixes the build on Hurd. If anyone ever actually uses Hurd with
filenames longer than 4096, they can open a new bug.
Colin Walters [Thu, 19 Feb 2009 14:56:20 +0000 (09:56 -0500)]
Fix bad merge introduced in commit
b006d50
Colin Walters [Thu, 12 Feb 2009 20:17:25 +0000 (15:17 -0500)]
Bug 571373 - Add padding to typelib objects
Expand various typelib objects to ensure we have at least 16 bits
left for each one to add another string indirection or directory offset,
and also that we have at least a few bits for more flags.
Colin Walters [Thu, 12 Feb 2009 04:53:05 +0000 (23:53 -0500)]
Bug 571373 - Remove hardcoded sizes/offsets in girnode.c
Where appropriate we now use G_STRUCT_OFFSET and sizeof()
instead of hardcoded integers. Add comments for some special
cases.
Colin Walters [Thu, 12 Feb 2009 04:51:28 +0000 (23:51 -0500)]
Bug 571373 - Remove hardcoded offsets in ginfo.c
In a few places we had hardcoded sizes for accessing structure members
and computing into variable size arrays. Remove those.
Colin Walters [Thu, 12 Feb 2009 04:36:31 +0000 (23:36 -0500)]
Bug 571373 - Consistently use sizeof () inside gtypelib and girmodule
This not only makes it easier to change these structures, it becomes
clearer exactly what each magic number is just for reference.
Colin Walters [Thu, 12 Feb 2009 01:46:59 +0000 (20:46 -0500)]
Bug 571373 - Move typelib docs from typelib-format.txt into girepository.h
typelib-format.txt was growing out of date; a good solution to this is
to move it closer to the code it's documenting. By doing this we also
gain the ability to use gtk-doc on it.
Colin Walters [Thu, 19 Feb 2009 02:35:04 +0000 (21:35 -0500)]
Fix SUBDIRS order, call gnome-autogen.sh with COMMON_DOC_BUILD
The latter option seems to be what others are doing, so we do too.