Age | Commit message (Collapse) | Author | Files | Lines |
|
Make sure that the linenumbers of the documentation blocks
and tags are preserved and accurate so they can be used in
warning messages. Also:
* Rename Options to DocOptions for consistency
* Add a reference to the docblock a tag and an option belong to
|
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=629708
|
|
|
|
One of the first big changes in this rewrite is changing the Type
object to have separate target_fundamental and target_giname properties,
rather than just being strings. Previously in the scanner, it was
awful because we used heuristics around strings.
The ast.py is refactored so that not everything is a Node - that
was a rather useless abstraction. Now, only things which can have
a GIName are Node. E.g. Type and Field are no longer Node.
More things were merged from glibast.py into ast.py, since it isn't
a very useful split.
transformer.py gains more intelligence and will e.g. turn GLib.List
into a List() object earlier. The namespace processing is a lot
cleaner now; since we parse the included .girs, we know the C
prefix for each namespace, and have functions to parse both
C type names (GtkFooBar) and symbols gtk_foo_bar into their
symbols cleanly. Type resolution is much, much saner because
we know Type(target_giname=Gtk.Foo) maps to the namespace Gtk.
glibtransformer.py now just handles the XML processing from the dump,
and a few miscellaneous things.
The major heavy lifting now lives in primarytransformer.py, which
is a combination of most of annotationparser.py and half of
glibtransformer.py.
annotationparser.py now literally just parses annotations; it's
no longer in the business of e.g. guessing transfer too.
finaltransformer.py is a new file which does post-analysis for
"introspectability" mainly.
girparser.c is fixed for some introspectable=0 processing.
|
|
Rather than have the scanner/parser handle both e.g. "glong" and
"long", simply use the GLib types everywhere.
This commit adds TYPE_LONG_LONG and TYPE_LONG_DOUBLE to the
scanner types; however, rather than add them to the typelib,
they're just marked as not-introspectable.
|
|
This patch adds support for instantiable fundamental object types,
which are not GObject based. This is mostly interesting for being
able to support GstMiniObject's which are extensivly used in GStreamer.
Includes a big test case to the Everything module (inspired by
GstMiniObject) which should be used by language bindings who wishes to
test this functionallity.
This patch increases the size of the typelib and breaks compatibility
with older typelibs.
https://bugzilla.gnome.org/show_bug.cgi?id=568913
|
|
|
|
The old parser tried to parse:
@foo: some text here (other text)
Reject this. We strictly require another colon at the end to parse
the text in between as (option) (other option).
Futher ensure we only attempt to do option parse if we find something
that matches the strict regexp ([A-Za-z]+). This could be tightened
further.
TODO: Have a warning for something that looks like an annotation,
but isn't.
https://bugzilla.gnome.org/show_bug.cgi?id=622659
|
|
Any annotation where the key has a dot in the name will go into the
attribute list. For example
* @arg: (foo.bar baz): some arg
the parameter @arg will get the attribute with key foo.bar and value
baz. This also works for.
* Returns: (foo.bar2 baz2): the return value
Also add tests for this new feature.
See https://bugzilla.gnome.org/show_bug.cgi?id=571548
Signed-off-by: David Zeuthen <davidz@redhat.com>
|
|
|
|
We typically expect people to annotate e.g. GList for virtuals
on the invoker, not on the virtual slot, since the invoker feels
like the public API.
https://bugzilla.gnome.org/show_bug.cgi?id=621570
|
|
* girepository/*: Add g_property_info_get_ownership_transfer() and write
the transfer attribute of properties into the typelib.
* giscanner/*: Parse the (transfer) annotation and write it into the .gir.
* tools/generate.c: Read the transfer annotation for properties and write
to the .tgir.
https://bugzilla.gnome.org/show_bug.cgi?id=620484
|
|
* gir/gimarshallingtests.[hc]: Add a test for GStrv in function args and
as struct fields.
* girepository/giroffsets.c: Correctly compute the size of structs with
array fields
* girepository/girparser.c: Set is_pointer to FALSE for arrays with
fixed size that are inside structs.
* giscanner/glibtransformer.py: Special case GStrv as arrays of utf8.
* giscanner/annotationparser.py: Make full transfer the default for
arrays of char* returned by functions.
https://bugzilla.gnome.org/show_bug.cgi?id=620170
|
|
|
|
Add type annotation syntax for GObject properties. This makes
it possible to override the type of a property. For instance,
this will allow function pointers with a G_TYPE_POINTER type set
to be used from a language binding which reads the typelib information
in addition g_object_class_find_property.
https://bugzilla.gnome.org/show_bug.cgi?id=618318
|
|
Add support for (element-type) annotations for G*Array
types.
https://bugzilla.gnome.org/show_bug.cgi?id=619545
|
|
|
|
People have wanted support for marking (out) on functions of the
form:
/**
* clutter_color_from_pixel:
* @pixel: A pixel
* @color: (out): Color to initialize with value of @pixel
*/
void
clutter_color_from_pixel (guint32 pixel, ClutterColor *color);
Where the caller is supposed to have allocated the argument; the
C function just initializes it. This patch adds support for this
argument passing style to introspection. In this case, we see the
(out), and notice that there's only a single indirection (*) on
the argument, and assume that this means (out caller-allocates).
https://bugzilla.gnome.org/show_bug.cgi?id=604749
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=619450
|
|
The function name and parameter name were backwards when warning
about bad parameter references.
|
|
When an annotation references another parameter, check that that
parameter actually exists.
Add a comment to the handling of (closure) for callbacks to explain
why we don't need the same handling there despite the use of
get_parameter_index().
https://bugzilla.gnome.org/show_bug.cgi?id=617978
|
|
Make sure that the value specified for scope in a callback
annotation is one of the legal values.
https://bugzilla.gnome.org/show_bug.cgi?id=617978
|
|
Don't assign None to closure and destroy indices in case of
collision, they are supposed to be numeric.
https://bugzilla.gnome.org/show_bug.cgi?id=617978
|
|
GArray args
Based on a previous patch by C. Scott Ananian <cscott@litl.com>
https://bugzilla.gnome.org/show_bug.cgi?id=581687
|
|
properly scan GArray args"
This reverts commit 87291e08b0fd34b62e1ad9811c174108b38311a9.
|
|
GArray args
Based on a previous patch by C. Scott Ananian <cscott@litl.com>
https://bugzilla.gnome.org/show_bug.cgi?id=581687
|
|
|
|
https://bugzilla.gnome.org/show_bug.cgi?id=615890
|
|
Previously crashed out, now just ignores the attribute
|
|
All GCancellables are allow-none, this allows us to remove a lot
of custom annotations.
https://bugzilla.gnome.org/show_bug.cgi?id=604658
|
|
default to 'call' as stated in the annotation documentation.
https://bugzilla.gnome.org/show_bug.cgi?id=607026
|
|
Various places that check hardcoded type names were not always handling
the case of the type being used from within its own library (in which
case it won't have a type prefix). Make them more consistent.
https://bugzilla.gnome.org/show_bug.cgi?id=602512
|
|
Makes sure we can parse empty tags such as '@foo:' without
adding a : in the end which the typelib compiler will complain
about
|
|
|
|
Telling file and line would be better, but alreday this way one atleast has a
chance to fix it actually.
|
|
This should have been included with f74823. Fixes
the async/notified scope annotation for glib/gio.
|
|
GAsyncReadyCallback should have use the async scope per
default and GDestroyNotify should be notified if the
previous parameters are a callback and user data.
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=602862
|
|
Adds a (skip) option that can be added to the header of any doc comment
to cause that symbol to be skipped in the .gir output
|
|
Plain fields (i.e. non-callbacks) may have a 'type' annotation now.
|
|
Annotation parser patch from: Tim Horton <hortont424@gmail.com>
If an explicit element type is specified, don't override it with
guint8.
|
|
You can now specify a nested parameterized type in annotations as
(for example):
@param: (type GLib.HashTable<utf8,GLib.HashTable<utf,utf>>)
or
@param: (element-type utf8 GLib.HashTable<utf,utf>)
New test functions for the Everything typelib show how it works.
|
|
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.
|
|
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.
|
|
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>
|
|
Add support for the 'Rename To:' annotation for functions and methods.
|
|
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.
|
|
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.
|
|
Add support for a `(type bitfield)' annotation for enums.
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|
|
Allow a documentation block to have options, e.g.:
/*
* SomeType: (OPT-NAME VALUE) ...
*/
Signed-off-by: Andreas Rottmann <a.rottmann@gmx.at>
|