| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Signals that have an emitter function should have an annotation to allow
consumers of the introspection XML to effectively pair signals to their
corresponding emitter functions that share the same prototype.
|
|
|
|
|
|
|
| |
If a property is not introspectable we need to decouple it from its
accessors; the property data will not be compiled into the typelib,
and when the compiler will try to resolve the offsets into the binary
blob we'll get a fatal exception.
|
|
|
|
|
|
|
| |
Some readonly boolean properties in the form of 'has-foo' or 'is-bar'
expose a getter function in the form of `get_has_foo()` or
`get_is_bar()`, according to extant coding practices. We should ensure
we still check for those.
|
|
|
|
|
|
| |
If the (set-property) and (get-property) annotations on methods do not
round trip with the (setter) and (getter) annotations on the
corresponding property, we want to emit a warning.
|
|
|
|
|
|
|
|
| |
If a property is boolean and read-only, the getter method can be the
same as the property name, for instance:
- gtk_widget_has_focus()
- gtk_media_stream_has_audio()
|
|
|
|
|
|
|
| |
The heuristic is pretty trivial: for any given non-construct-only,
writable property, we check if there's a `set_<property>` method; for
any given readable property, we check if there's a `get_<property>`
method.
|
|
|
|
|
| |
We need new annotations to allow library developers to associate a
setter and a getter functions to a property definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We introduce two new annotations:
- (set-property PROPERTY_NAME)
- (get-property PROPERTY_NAME)
These annotations are valid inside function blocks for methods on
objects and interfaces, and define whether a function is a property
accessor, e.g.:
/**
* gtk_widget_set_name: (set-property name)
* @self: ...
* @name: ...
*
* ...
*/
/**
* gtk_widget_get_name: (get-property name)
* @self: ...
*
* ...
*
* Returns: ...
*/
The annotations are transformed into the GIR data as attributes:
- glib:set-property="PROPERTY_NAME"
- glib:get-property="PROPERTY_NAME"
The underlying typelib data has had flags for setter and getter
functions for a while, but they have never been plugged into the GIR
data or the introspection scanner. Now they are; you can retrieve the
GIPropertyInfo from a GIFunctionInfo that has the GI_FUNCTION_IS_SETTER
or GI_FUNCTION_IS_GETTER flags set.
Fixes: #13
|
|
|
|
|
|
|
|
| |
A "final" class is a leaf node in a derivable type hierarchy, and cannot
be derived any further.
This matches the changes in libgobject that introduced G_TYPE_FLAG_FINAL
to the type flags.
|
|
|
|
|
|
|
| |
The GNOME developers documentation website has been updated, and we're
in the process of moving API references elsewhere. The old documentation
is still available under developer-old.gnome.org, so let's update the
URLs we have in our documentation.
|
|
|
|
|
|
|
| |
This member will contain the string from the GEnumValue/GFlagsValue
'value_name' introspection dump.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
Don't rely on runtime name, but on C header parsed symbol.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
|
|
|
| |
Check for errors during g_file_open_tmp() and fdopen(). Make sure to
free tmp_name and error as needed.
Found with Coverity.
https://bugzilla.redhat.com/show_bug.cgi?id=1938731
|
|
|
|
|
|
|
|
|
|
| |
Because of skepticism I received in #224, I made this PR which keeps the
testsuite and CI improvements but doesn't add any new build options. I
hope this would be less controversial:
- no new knobs
- tests for those using existing build options
- CI tests `build_introspection_data = false`
|
|
|
|
|
|
|
|
|
| |
The scanner is chocking on the `__float80` and `__float128` types that
are provided by GCC as extensions to ISO/IEC TS 18661-3:2015:
https://gcc.gnu.org/onlinedocs/gcc/Floating-Types.html
Fixes: #384
|
|\
| |
| |
| |
| | |
Add basic mypy support; Require Python 3.5
See merge request GNOME/gobject-introspection!251
|
| |
| |
| |
| |
| |
| | |
Silence some errors, run mypy in CI
Adding annotations to functions/classes will make mypy check them.
|
|\ \
| | |
| | |
| | |
| | | |
giscanner: always define PY_SSIZE_T_CLEAN
See merge request GNOME/gobject-introspection!244
|
| | |
| | |
| | |
| | | |
This is required for Python 3.10 and always a good idea anyway.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Don't assume Py_TYPE being a macro
Closes #358
See merge request GNOME/gobject-introspection!243
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | | |
It got changed to a function in Python 3.10. Use the Py_SET_TYPE macro
suggested at https://docs.python.org/3.10/whatsnew/3.10.html instead.
Fixes #358
|
|\ \ \
| | | |
| | | |
| | | |
| | | | |
open cleanup: explicit encoding, close fds
See merge request GNOME/gobject-introspection!250
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This means flushing changes and closing the fd. Otherwise this is done
by the GC eventually..
Detected using PYTHONTRACEMALLOC=1 PYTHONDEVMODE=1
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | | |
Otherwise we'll end up using the locale encoding. While it's usually utf-8,
that's not the case on Windows.
There is one place where a file with filenames is passed, not sure there
so I left it and passed a explicit None.
|
|/ /
| |
| |
| |
| | |
From what I can see this was used for importing the C ext in an uninstalled
libtool build of g-i. We no longer use libtool, so this is no longer needed.
|
|/ |
|
|
|
|
|
|
|
|
|
| |
This reverts commit de6512b31b614567bf1800406303d1ccfb6d9455.
This was causing naming conflicts when the SECTION documentation
was picked over the class documentation.
See https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/360
|
|
|
|
|
|
|
|
|
| |
os.path.relpath() will throw a ValueError when the two paths that
are fed to it are on different drives, at least when running under
cmd.exe consoles.
Fix this by falling back to the full path when this ValueError is
thrown.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When writing documentation to the GIR files, GIR tries to match
classes with their matching SECTION: comment in the source code. Some codebases
use kebab-case or CamelCase for their section names, but GIR always expects
them to be flatcase or the matching will fail.
This commit converts all section names to flatcase (by removing "-" and
converting to lowercase) while they are being parsed, so that they are matched
properly later on.
Fixes #350.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This adds quick support for using 'clang-cl' (CLang's emulation of the Visual
Studio compiler) to run giscanner.
This will still initialize things mostly in the MSVC fashion, except that it
will also check whether both 'CC' and 'CXX' envvars are set to
'clang-cl [args]', as per the way that Meson supports using 'clang-cl'.
Since we are using distutils to set up the compiler instance, when we enable
'clang-cl' support, we trick distutils that we have already initialized the
MSVCCompiler parameters as needed. We just leave out the compiler flags as
we don't really care about debug symbols nor optimization with the built
dumper binary, as it is gone as soon as the .gir file is generated.
This will build G-I successfully with all the tests passed.
|
|\
| |
| |
| |
| | |
Add the notion of standalone doc sections.
See merge request GNOME/gobject-introspection!226
|
| |
| |
| |
| |
| |
| |
| |
| | |
Up to now, section annotations had to match a class or interface
name in order to be serialized in the gir.
With this commit, they now get serialized as docsection nodes,
for potential use by documentation tools.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was previously no mechanism for tagging enum members
and struct fields with Since tags (or other, eg deprecation tags).
While the customary place to add Since tags for these symbols
is inline in the parent symbol's documentation eg:
/**
* Foo:
*
* @FOO_BAR: some bar. Since X.Y
*/
And variations on that theme, implementing parsing for that scheme
would result in a pretty ambiguous grammar, especially if we also
want support for multiple tags.
Instead, the solution implemented here is to allow providing
documentation for individual members and fields through their
own separate block, as is done for virtual functions already.
Inline comments are still used, with a lower precedence.
Fixes #348
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
settings
In case a user had a combination of -fvisibility=hidden, -Wl,--as-needed, -flto, -O2
in the CFLAGS the linker would sometimes detect that all the referenced gtype functions
weren't actually used and throw them out with their providing libraries.
Instead of hoping that the user's CFLAGS don't mess without our symbol visibility just use
G_MODULE_EXPORT on the two symbols which reference all other gtype and gquark symbols.
This fixes errors such as:
Invalid GType function: 'gtk_accel_group_get_type'
Failed to find symbol 'gtk_accel_group_get_type'
during the g-ir-scanner execution.
Fixes #280
|
|
|
|
| |
The newest flake8 has started to detect this.
|
| |
|
|
|
|
|
|
| |
Breaks vapigen and changes GListModel definition in Gio-2.0.gir
This reverts commit a9f45431684e6be3623e272e54d481e4c5d9423d.
|
|
|
|
|
|
|
|
| |
GListModel is an interface for creating typed, list-like containers. The
data stored is GObject instances, but it's useful to be able to annotate
the actual type, for both documentation and code generation purposes.
The annotation should be optional, to maintain backward compatibility.
|
|
|
|
|
|
| |
This reverts commit b4c058bba4d95ae10e1e4238f9417fe954f97795.
See: #336
|
|
|
|
|
|
| |
This reverts commit ffe3e435e0b7943a0872034223b5f6ea02258ffa.
See: #336
|
|
|
|
|
|
| |
We need to special case the ListModel container type in the
documentation writer so that we don't fall back into array/list
automatic conversion in the code snippets.
|
|
|
|
|
|
|
|
| |
GListModel is an interface for creating typed, list-like containers. The
data stored is GObject instances, but it's useful to be able to annotate
the actual type, for both documentation and code generation purposes.
Fixes: #328
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
GTK4 allows adding widget-related actions to the documentation with the
newly defined syntax:
<class_name> '|' <action_name> ':'
This means g-ir-scanner needs to detect this new format, to avoid
emitting unnecessary warnings.
Currently, we don't do anything with the actions; in the future we might
want to add them to the documentation in the GIR, but for that we'd need
a new element.
See also: GNOME/gtk-doc!30
|
|
|
|
|
|
|
|
|
| |
cElementTree was removed in Python 3.9 in favor of ElementTree,
which has used a fast, native implementation since Python 3.3.
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1817649
Signed-off-by: Stephen Gallagher <sgallagh@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Python 3.8.x and later changed the way how dependent DLLs can be found for a
given Python module that depends on the presence of external, non-system DLLs,
for more fine-grained DLLs searching and loading, as well as for security
purposes, which required the use of os.add_dll_directory().
Thus, the scripts in scanner/ must be updated such that:
-We are able to find and load the GObject and GLib DLLs, at least, on
initialization, via the use of 'pkg-config --variable bindir', as we already
depend on the GLib DLLs. Note that since the gobject-2.0.pc file does not
have a 'bindir' entry, we use gio-2.0.pc instead to discover the bindir of the
GObject and GLib DLLs. Likewise, we use the same technique for pkg-config
files that are dependent upon when using g-ir-scanner (or friends) on items
that are higher up in the stack.
-We are able to find any other DLLs (e.g. non-GNOME DLLs such as ZLib) that
are dependent but are not found in the path(s) given by 'pkg-config --variable
bindir' with the envvar GI_EXTRA_BASE_DLL_DIRS, as needed. Note that
GI_EXTRA_BASE_DLL_DIRS can be multiple paths, and that the results from
'pkg-config --variable bindir' takes precendence, in a LIFO manner.
|
|
|
|
|
|
|
|
|
| |
The XML elements are implicitly iterable in all Python versions including
at least 2.7 and 3.2+.
The .getchildren() method is deprecated since 2.7 and 3.2, removed in 3.9.
Fixes https://gitlab.gnome.org/GNOME/gobject-introspection/issues/325
|
|
|
|
|
|
|
|
|
|
| |
By default LD_LIBRARY_PATH is set to the list of target library paths;
this breaks down in cross-compilation environment, as we need to run a
native emulation wrapper rather than the target binary itself. This patch
allows exporting those paths to a different environment variable
which can be picked up and used by the wrapper.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
| |
This is useful in cross-compile environments where system's ldd
command does not work on binaries built for a different architecture
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
|
|
|
|
| |
With this option, giscanner will use a wrapper executable to run
binaries it's producing, instead of running them directly. This
is useful when binaries are cross-compiled and cannot be run directly,
but they can be run using for example QEMU emulation.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
| |
warning: deprecated directive, use ‘%define parse.error verbose’
|