| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Plain Old Data (POD) types with or without a representation in the GType
type system can still have a copy and/or a free function. We should
allow annotating these types with their corresponding functions for
copying their data into a new instance, and freeing their data.
From a language bindings perspective, POD types should have a boxed
GType wrapper around them, so they can use the generic GBoxed API to
copy and free instances; from a documentation perspective, though, it'd
be good to have a way to match a structured type, like a struct or a
union, with its copy and free functions.
In order to do that, we add two new header block annotations:
- (copy-func function_name)
- (free-func function_name)
These annotations work exactly like ref-func and unref-func for typed
instances:
/**
* GdkRGBA: (copy-func gdk_rgba_copy)
* (free-func gdk_rgba_free)
* @red: ...
* @green: ...
* @blue: ...
* @alpha: ...
*
* ...
*/
The function is stored in the GIR data as two new attributes for the
`<record>` and `<union>` elements:
<record name="RGBA"
c:type="GdkRGBA"
copy-function="gdk_rgba_copy"
free-function="gdk_rgba_free"
glib:type-name="GdkRGBA"
glib:get-type="gdk_rgba_get_type"
c:symbol-prefix="gdk_rgba">
The annotations are not mandatory.
See: #14
|
| |
|
|
|
|
|
|
|
| |
An escape hatch to specify a freeform string for the default value of a
property.
Fixes: #4
|
|
|
|
|
|
|
| |
If we can't transform a property default value to string, we are not
going to add a default-value attribute to the GIR. This is necessary
because non-transformable values may not always be pointers, so we
cannot default to "NULL".
|
|
|
|
|
|
|
|
|
| |
The default-value attribute for a property element is fundamentally
meant for documentation generators.
We only care about the GIR data, as the conversion from the default
value to a string is lossy by definition, and may very well not
roundtrip.
|
|
|
|
|
|
| |
We use g_param_spec_get_default_value() to get the default GValue of a
GParamSpec, and then we serialize it into a string according to the
value's own contents and type.
|
|
|
|
| |
The function is not usable for language bindings as no shared library name is defined in the gir file and the parameters do not match upstream function signature.
|
|
|
|
| |
Use GLib commit ec3b1bfc45216850c1a861055ad2fd9d9906813a (tag: 2.75.2)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The rules for binary expressions were entirely oblivious to the type of
the operand symbols and assumed they're integer constants.
This is very unfortunate, since it caused all sort of nonsense to end up
getting accepted. One such example is the following define from
NetworkManager's libnm:
#define NM_SETTING_PARAM_SECRET (1 << (2 + G_PARAM_USER_SHIFT))
As G_PARAM_USER_SHIFT is unknown, it was parsed as an invalid symbol.
The addition didn't care, treated it as:
#define NM_SETTING_PARAM_SECRET (1 << (2 + 0))
Let's just ensure we get CSYMBOL_TYPE_CONST only when both operands
actually have const_int_set. Otherwise just create CSYMBOL_TYPE_INVALID.
That will cause the symbol to be dropped on the floor eventually, but
that's probably much better than a having an invalid value.
|
|
|
|
|
|
|
|
| |
Add one expanding to an expression we can't get a constant value from and
another one for which we can.
Note that the bad on one currently does evaluate, and it does so to a
bad value. A separate commit with a diff to test suite will address that.
|
|
|
|
| |
GObject-introspection is meant to match GLib.
|
|
|
|
| |
New cycle, new version number.
|
|
|
|
|
|
|
|
|
|
|
| |
Now that GLib has separate version annotation macros, we need to define
GOBJECT_COMPILATION and parse gobject-visibility.h when generating the
introspection data for GLib.
This MR also requires:
- GNOME/glib!3184
- GNOME/glib!3185
|
|
|
|
|
| |
We need to define GMODULE_COMPILATION when building the introspection
data for GModule.
|
|
|
|
| |
We don't need wrap files for things we get from GLib or from the system.
|
|
|
|
|
| |
Ignore the typing import so that flake8 doesn't complain, and mypy keeps
working.
|
|
|
|
|
|
| |
This allows to perform more introspection tests in gjs and other
implementations when it comes to set/get fields or "cast" an union
member to the main union type
|
|
|
|
|
|
|
| |
Such kind of arrays can be easily be allocated as we know the size of
each array element.
See: https://gitlab.gnome.org/GNOME/gjs/-/merge_requests/806
|
|
|
|
| |
This is based on f64f88baaeaca277687e6231b3cea6d14a26996b
|
|
|
|
| |
This is based on 201c920cbd0b816f4e19b52c1b28746935fdcb00.
|
|
|
|
| |
Based on 86430a27d26b9b72b02ff0b81eeaa5df0525646c.
|
| |
|
| |
|
|
|
|
| |
Fixes clang builds
|
| |
|
| |
|
|
|
|
| |
GLib commit: 2.74.0
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
generated C file
When g-ir-scanner is used by another project, than that project might
have the GLIB_VERSION_* macros defined. This is useful to ensure that
only intended glib API is used.
The project might then also pass the CFLAGS to g-ir-scanner, without
filtering those defines out. This can lead to compiler warnings.
For example, NetworkManager sets the version macros to GLIB_VERSION_2_40
and thus gets these warnings
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c: In function ‘dump_object_type’:
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c:252:13: warning: Not available before 2.70
252 | if (G_TYPE_IS_FINAL (type))
| ^~~~~~~~~~~~~~~~~
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c: In function ‘dump_fundamental_type’:
/NetworkManager/tmp-introspect66917zc4/NM-1.0.c:370:13: warning: Not available before 2.70
370 | if (G_TYPE_IS_FINAL (type))
| ^~~~~~~~~~~~~~~~~
But these warnings are not correct. The installed g-ir-scanner knows for which
glib version to generate code. Undefine the macros to avoid the warning.
|
|
|
|
| |
GLib commit: 2.73.3-44-g66c4e35e2
|
|
|
|
|
| |
GLib has been requiring a C99 toolchain for a while, now. It makes no
sense to have gobject-introspection depend on C89.
|
| |
|
|
|
|
|
|
| |
This helps with gtk!4965.
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
|
|
|
|
|
|
| |
https://gcc.gnu.org/onlinedocs/gcc/Designated-Inits.html
Based on https://github.com/katef/kgt/blob/c9d8ad246855c6b65e42371be7898f4073c28d18/examples/c99-grammar.iso-ebnf#L247-L252
|
|
|
|
|
| |
The test returns a newly allocated GValue, so it should not be marked
transfer none.
|
|
|
|
|
|
| |
This parameter may not be NULL even if the function described by the
GIFunctionInfo has a void return type, so we should not say this in the
documentation.
|
| |
|
|
|
|
| |
The toolchain is different enough to warrant its own CI job imo.
|
|
|
|
|
| |
cmph is vendored and other one is bison/flex generated code.
Not much we can do here, so disable those warnings there.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The existing code tries to mirror how the linker finds DLLs by
searching for the import libs and then looking for the matching
shared lib name.
While llvm has a dlltool clone it doesn't provide the --identify
option to extract the shared lib name. Instead we use the fact that
llvm import libs include the dll name in the archive member name, so
we can use "nm" there to get the same result.
To decide which strategy to use we run dlltool and check if it contains
"llvm-dlltool" in the output.
This fixes the .gir and .typelib files containing bogus values for the
shared library names when building with clang + mingw-w64 on Windows.
I'm not quite sure if the libtool part is actually needed there,
but I left it in to keep the diff small.
|
|
|
|
|
|
|
| |
While gcc on Windows allows being passed -rpath and just ignores it,
llvm/lld will fail with "lld: error: unknown argument: -rpath".
There is no such thing as rpath on Windows, so just skip it.
|
| |
|
| |
|
|
|
|
| |
We require Meson 0.60, to match newer GLib.
|
|
|
|
| |
The `check` argument to `run_command()` is now mandatory.
|
|
|
|
|
|
| |
- Install pcre2, as it's a new GLib dependency.
- Do not use CFLAGS to inject -Werror
- Use idiomatic Meson subcommands
|
|
|
|
|
| |
GLib 2.58 has long since been released. We should always match GLib's
version, since we update the introspection data regularly.
|
|
|
|
| |
Rebased up to 2.73.2.
|
|
|
|
| |
Based on https://gitlab.gnome.org/GNOME/glib/-/commit/113d7263
|