| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
We only support 3.4+ now.
|
|
|
|
|
|
|
| |
... When we are building in a drive that is different from the drive
that we are acquiring the depedencies from. For example,
os.path.relpath() does not like it when we we are building G-I on D:\foo
while the GLib headers are found are C:\glib.
|
|
|
|
|
|
|
|
|
|
|
| |
Some documentation tool (as hotdoc[0]) need to have information about
symbol declaration and documentation positions in the source files
to be able to do smart indexing (automatically build the documenation
index).
[0] https://hotdoc.github.io/
Fixes #175
|
|
|
|
|
|
|
|
|
|
|
| |
We now reuse _create_type_from_base instead of reimplementing
it in a semi-broken way in transformer, and use complete_ctype
when writing it out if available.
This incidentally allows us to remove a test where the comment
acknowledged the non-optimal behaviour.
https://bugzilla.gnome.org/show_bug.cgi?id=779959
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
gpointer parameters and return types should be marked as nullable by
default, unless:
• also annotated with (type) and not with (nullable); or
• explicitly annotated with (not nullable).
This introduces the (not nullable) annotation as a direct opposite to
(nullable). In future, (not) could be extended to invert other
annotations.
https://bugzilla.gnome.org/show_bug.cgi?id=729660
|
|
|
|
|
|
|
|
|
|
| |
Add lt, le, gt, ge, eq, ne, and hash dunder methods to all classes that
implement custom comparisons with __cmp__. This is needed to support Python 3
compatible sorting of instances of these classes.
Avoid using @functools.total_ordering which does not work for some of these
classes and also is not available in Python 2.6.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add unicode_literals future import which turns any string literal
into a unicode string. Return unicode strings from the Python C extension
module. Force writing of annotations (g-ir-annotation-tool) to output utf8
encoded data to stdout.
This is an initial pass at following the "unicode sandwich"
model of programming (http://nedbatchelder.com/text/unipain.html)
needed for supporting Python 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Use future import "print_function" and update relevant uses of print
as a function call. See: PEP 3105
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
| |
Import Python 3 compatible "true division" from the future (PEP 238).
This changes the Python 2 classic division which uses floor division
on integers to true division. Verfied we don't actually use the
division operator anywhere in the code base so this a safety for
supporting both Python 2 and 3.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
| |
Use absolute_import to ensure Python 3 compatibility of the code base.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
| |
Replace usage of iteritems() and itervalues() with items() and values()
respectively.
https://bugzilla.gnome.org/show_bug.cgi?id=679438
|
|
|
|
|
|
|
|
|
|
| |
Promote the 'nullable' field to the TypeContainer base class (which is
shared by Return and Parameter types).
Add .gir support for nullability on return values, both in the writer
and in the (scanner's) parser.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Record our internal 'nullable' and 'optional' attributes into the
written .gir file. It is now theoretically possible to express the
concept of an out parameter with a nullable type (although presently
there is no way to do this).
Modify our own internal parser (in the scanner) to understand the
newly-written attributes.
Update the expected output of the 'Regress-1.0.gir' test to account for
the new attributes.
Nothing else understands 'nullable' yet, but the girparser in the
typelib compiler already understands 'optional' and records a bit for it
in the typelib.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace the 'allow_none' field on parameters with two separate fields:
'nullable' and 'optional'.
Currently, we use 'nullable' to mean the same thing as 'allow-none' for
normal (non-out) parameters. For out parameters, we use the 'optional'
field instead.
Note that the special case for GCancellable and GAsyncReadyCallback is
already guarded by a check for being an in parameter, so we always use
'nullable' here.
On the .gir writer side, we decide which variable to consult when
writing the allow-none attribute depending on the parameter direction.
https://bugzilla.gnome.org/show_bug.cgi?id=660879
|
|
|
|
|
|
|
|
| |
A hidden exception was being thrown (which we now log), due to fields
being treated as function parameters. Fixed to make field array
annotations be transformed and written out to the gir correctly.
https://bugzilla.gnome.org/show_bug.cgi?id=710561
|
|
|
|
|
|
| |
_write_class() is only ever called with ast.Class
and ast.Interface nodes so the check served no purpose
other than contribute to global warming...
|
| |
|
|
|
|
|
|
| |
annotationparser.py already stores attributes in a mapping so
it makes little sense using a list of tuples (suggesting
multiple duplicate keys would be allowed) on the ast side.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GTK-Doc description fields for tags can contain multiple lines and
even multiple paragraphs. Whitespace cannot be preserved in XML
attributes, so we move the "deprecated" description text into
a "<doc-deprecated />" element right next to where we already have
the "<doc />" element. Keep the "deprecated" attribute around for
backwards compatibility though, but set its value to "1" (analogous
to the "writable", "contruct", etc attributes) if the annotated
symbol is marked as deprecated.
While at it, add <doc-version /> and <doc-stability /> which
was not yet available in the .gir files...
This takes care of the "Since:", "Stability:" and "Deprecated:"
GTK-Doc tags. Nothing needs to be done for the "Returns:" tag as
as we already write a "<doc />" child element on "<return-value />".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Version in our tree is a wee bit outdated. For example,
later work will introduce an utf8 encoded python source
file which our old pep8.py does not yet understand (yeah,
it really was *that* ancient)...
Updated from:
https://raw.github.com/jcrocholl/pep8/1.4.5/pep8.py
Takes 552c1f1525e37a30376790151c1ba437776682c5,
f941537d1c0a40f0906490ed160db6c79af572d3,
5a4afe2a77d0ff7d9fea13dd93c3304a6ca993de and
a17f157e19bd6792c00321c8020dca5e5a281f45 into account...
https://bugzilla.gnome.org/show_bug.cgi?id=699535
|
|
|
|
|
|
|
| |
The XML specification clearly states it's xml:space
http://www.w3.org/TR/xml/#sec-white-space
https://bugzilla.gnome.org/show_bug.cgi?id=628739
|
|
|
|
| |
Continuation of previous work.
|
|
|
|
| |
Continuation of previous work.
|
|
|
|
| |
Continuing on with previous commit.
|
|
|
|
|
|
|
|
|
|
|
| |
The .gir format has a weird legacy where stuff like the includes are
outside of the <namespace>. But conceptually they're tied together,
so let's start reflecting this in the code.
This way we can just pass around and look at a Namespace object
instead of a 4-tuple of (namespace, includes, c_includes, pkg_config).
https://bugzilla.gnome.org/show_bug.cgi?id=694593
|
|
|
|
|
|
|
|
|
| |
The eventual model I want to have is that .parent is the "container"
of the node. In all the cases where we don't explicitly set the parent,
this is the namespace, but having this under one field name would be
a big cleanup for the docwriter.
https://bugzilla.gnome.org/show_bug.cgi?id=693876
|
|
|
|
|
|
|
|
| |
Instead of modifying the namespace while we are iterating over it, which
leads to nodes not being tested, set an 'internal_skipped' property on the
function and read it in the GIR writer.
https://bugzilla.gnome.org/show_bug.cgi?id=660698
|
|
|
|
|
|
|
|
| |
g-ir-doc-tool wants to use the instance parameter to read docs
and the parameter name, so it needs to be shuttled through the
GIR.
https://bugzilla.gnome.org/show_bug.cgi?id=693040
|
|
|
|
|
|
|
|
|
|
| |
While there's no particular reason I need to do this, there
really isn't any reason to not do this, and it helps with doctool
or whatever in the future if we want to document when a constant
showed up. g-ir-compiler also keeps track of constant deprecations,
so this fixes constants not ever being deprecated.
https://bugzilla.gnome.org/show_bug.cgi?id=693040
|
|
|
|
|
|
|
|
| |
Enum members were Annotated in the AST, and most code already assumed
they could have docs. What was missing was reading the docs from the
comment blocks and writing them in the XML.
https://bugzilla.gnome.org/show_bug.cgi?id=683046
|
|
|
|
| |
This is not what format_type is for.
|
|
|
|
| |
https://bugzilla.gnome.org/show_bug.cgi?id=679160
|
|
|
|
|
|
|
|
| |
That is - write also type qualifiers (const and volatile here). Update
existing tests and add a new struct to regress.h having members with
type qualifiers.
https://bugzilla.gnome.org/show_bug.cgi?id=656445
|
|
|
|
|
| |
Add an annotation tag "Value:" which can be used on
constants to override the value.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This uses the same backcompat machinery that was introduced for static
methods for non-class types, so this change does not break users of the
existing presentations.
New libgirepository API:
g_enum_info_get_n_methods
g_enum_info_get_method
https://bugzilla.gnome.org/show_bug.cgi?id=656499
|
| |
|
|
|
|
|
|
| |
This adds all GSignalFlags into the gir.
https://bugzilla.gnome.org/show_bug.cgi?id=656457
|
|
|
|
|
|
|
| |
Use it to remove backcompat copies of functions that non introspectable
anyway.
https://bugzilla.gnome.org/show_bug.cgi?id=572408
|
|
|
|
|
|
| |
For generating documentation, we actually want to preserve these.
https://bugzilla.gnome.org/show_bug.cgi?id=656389
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of storing the name of the function to call to get the
error quark, store the string form of the error quark, which
we derive from the introspection binary during scanning.
Update EnumBlob and GIEnumInfo to include the new information.
This will allow determining a back-mapping from error quark
to error domain without having to dlsym() and call all the
known error quark functions.
Based on earlier patches from Owen Taylor and Maxim Ermilov.
https://bugzilla.gnome.org/show_bug.cgi?id=602516
|
|
|
|
|
|
|
|
|
|
|
|
| |
g-ir-compiler assumes that an array is zero terminated when the
attribute is absent and there is no other attribute (length and
fixed-size), but g-ir-scanner only added the attribute when it is 0.
This means that an explicit zero-terminated=1 annotation would have
had no effect.
Fix that and at the same time ensure that all other arrays are not
zero-terminated by default.
https://bugzilla.gnome.org/show_bug.cgi?id=646635
|
|
|
|
|
|
|
|
| |
This was discussed in bug 649657.
https://bugzilla.gnome.org/show_bug.cgi?id=649657
Signed-off-by: David Zeuthen <davidz@redhat.com>
|
|
|
|
|
| |
* Fix use of tabs
* Update for correct signal parameters
|
|
|
|
|
|
|
|
|
|
|
| |
Inside an alias definition, we only need the name of the alias target
type. Add a method to GIRWriter to write out a type reference rather
than full type definition and use it when writing out an alias.
Determine introspectableness of aliases in IntrospectablePass so functions
using aliases can be marked not-introspectable if the alias itself is not.
https://bugzilla.gnome.org/show_bug.cgi?id=629682
|
|
|
|
| |
Fixes https://bugzilla.gnome.org/show_bug.cgi?id=594125
|
|
|
|
|
|
|
| |
We weren't doing this consistently, which broke nsname != cprefix
cases.
https://bugzilla.gnome.org/show_bug.cgi?id=629683
|
|
|
|
|
|
|
|
| |
* Explicitly check for ast.Alias in annotation pass
* Add "generic" attribs handling for aliases like docs, introspectable=0
etc.
https://bugzilla.gnome.org/show_bug.cgi?id=629668
|
|
|
|
|
|
|
|
|
|
|
|
| |
It was a stupid abstraction split, we only support GObject.
* Clean up how we handle c:type - we only set it if we've actually
seen a corresponding structure.
* Add a warning if we don't see the structure typedef for an
interface, since that's pretty bogus. (And fix regress.h to have
one)
* Rename the "type_name" attribute internally to "gtype_name"
for clarity.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previous to the scanner rewrite, static methods were only handled
for GObject subclasses. Go back to that for full compatibility
with existing bindings and code. See bug 572408 for the topic
of changing the API.
The code for writing out static methods for records and boxed is
left as future proofing, and the same handling is added for
interfaces.
https://bugzilla.gnome.org/show_bug.cgi?id=628967
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|