| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Apply the logic of previous commit to the array gvariant container
function, so that bindings can test better the memory handling of those
cases.
|
|
|
|
|
|
|
|
|
|
| |
We marked GVariant arrays containing floating references as
transfer-full and this is leading bindings (i.e. gjs) to misleading
behavior (see https://gitlab.gnome.org/GNOME/gjs/-/issues/499).
This was definitely wrong, in fact a function returning a floating
reference should have been transfer none, and so in this case the actual
function transfer would have been container.
|
|
|
|
|
|
|
|
| |
No need to go through all the possible blob types, while we can use an
inline function to check it.
Use an attribute to ensure the function will be inlined, when this is
not available just fallback to the previous definition
|
|
|
|
| |
Required to test how gjs handles this case.
|
|
|
|
| |
We were leaking this, and so it was a false positive for the bindings
|
|
|
|
|
|
|
| |
These are part of the array that we return, so there's no need to
allocate a new structure.
And this was leading to false positive leaks in bindings.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
| |
GValues containing pointer-sized things can hold a NULL value, and
various transformation functions in the wild are not NULL safe.
Fixes: #457
See also: https://gitlab.gnome.org/GNOME/mutter/-/issues/2625
|
|
|
|
|
| |
If the GParamSpec does not have a default value, we should not try to
turn it into a string.
|
|
|
|
| |
We overtook GLib, once again.
|
|
|
| |
These suggestions came up in code review.
|
|
|
|
|
|
|
| |
APIs such as the Gio.AppInfo.get_id vfunc which contravene this advice,
can cause memory leaks. (See
https://gitlab.gnome.org/GNOME/gjs/-/issues/519)
Document it here so that it hopefully happens less often in the future.
|
|
|
|
|
|
| |
This includes the new points from Emmanuele's recent blog post
https://www.bassi.io/articles/2023/02/20/bindable-api-2023/
into the "Writing Bindable APIs" doc.
|
| |
|
|
|
|
| |
Sync up to GLib 2.76.0
|
|
|
|
| |
Signed-off-by: Simon McVittie <smcv@debian.org>
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Add a disambiguation of what to return and do with the out values in case an
error is thrown.
|
|
|
|
| |
Use GLib 2.75.3.
|
|
|
|
|
|
|
|
| |
We don't need to compile or run GLib's test suite as part of building
GObject-Introspection: any failures there are not GObject-Introspection
issues. This should make CI somewhat quicker.
Signed-off-by: Simon McVittie <smcv@debian.org>
|
|
|
|
|
|
| |
There's something broken in the MSYS2 jobs, and nobody is actually
looking at them. We can't let this block forever, so we temporarily
allow them to fail until somebody can diagnose the issue.
|
|
|
|
| |
Use GLib commit f499e37979c09409d553a49562c6a0a9a65267af
|
|
|
|
| |
This is based on GLib ce876ab28bb81ac0b1c313223284de722d8208a1.
|
|
|
|
|
|
|
|
| |
https://github.com/mesonbuild/meson/pull/10275 introduced
support in meson to use uninstalled .pc files in the meson-uninstalled
directory to resolve dependencies built with subprojects.
Replicate the same solution while all the custom_target
are migrated to gnome.generate_dir
|
| |
|
| |
|
|
|
|
| |
We don't need it any more.
|
|
|
|
| |
We passed GLib's own version, so we need to reset the requirement.
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
- assertEqual(value, None) → assertIsNone(value)
- assertTrue(value is not None) → assertIsNotNone(value)
- assertTrue(isinstance(value, Type)) → assertIsInstance(value, Type)
|
|
|
|
|
|
| |
The "disguised" attribute is there only for backward compatibility; we
use the "pointer" attribute as the authoritative way to indicate a
typedef to a struct pointer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The disguised attribute started off as a way to indicate a typedef to a
structure pointer, e.g.
typedef struct Foo* FooPtr;
Over the years, though, it started to include opaque structure types,
e.g.
typedef struct _FooObject FooObject;
typedef struct _FooObjectClass FooObjectClass;
This has led to issues in language bindings, code generators, and
documentation generators, which now have issues when dealing with both
pointer aliases and opaque types.
An initial attempt at fixing this mess in commit f606183a ended up
breaking Vala, and had to be reverted.
To avoid breaking existing users we can follow a similar approach to the
allow-none/nullable/optional solution:
1. introduce a new pair of attributes: "pointer" and "opaque"
2. deprecate the "disguised" attribute
The "pointer" attribute covers the case of pointer types.
The "opaque" attribute covers the case of opaque structured types.
See also: https://gitlab.gnome.org/GNOME/vala/-/issues/735
Fixes: #101
|
|
|
|
| |
This reverts commit b37f24b7e27a77c398f41cc331608aff806f0d42.
|
|
|
|
|
| |
A GIMarshallingTestsBoxedStruct includes a GStrv, but we don't copy or
free it properly.
|
|
|
|
|
| |
Add the (copy-func) and (free-func) annotations to the documentation,
and the copy-function and free-function attributes to the GIR schema.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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)
|