| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
We need it for close(), especially when unistd.h is not available, such as in
the case of Visual Studio-style builds.
|
|
|
|
|
|
|
|
| |
We can just update the for loop condition to be >0 for all builds, which
is actually equivilant to >=1 as we are essentially comparing an
unsigned 32-bit int, so that we don't need to worry about fixing the
VS2012 bug invasively, as Visual Studio 2012 x64 is more sensitive about
sizes of variables (e.g. pointer sizes in this case)
|
|
|
|
|
|
|
|
|
|
|
| |
The __ia64 and __x86_64__ macros are defined for GCC but not Visual
Studio, but actually this code path should also be taken for Visual
Studio when doing a 64-bit build (x86_64/x64 and aarch64/arm64, _WIN64
will be defined for these cases), since Windows is an LLP64 platform.
This will avoid C4311/C4312 warnings on Visual Studio builds, which are
often warnings of concern as we are dealing with pointers with differing
sizes on 32-bit and 64-bit Windows builds.
|
|
|
|
|
|
|
|
|
| |
Later GLib versions assume that warning C4715 is an error as we want ot
be sure that functions that return a value do indeed return one by all
means.
Avoid this warning by adding a 'return 0' in brz_search_packed(), it
might be pointless but does indeed avoid the warning.
|
| |
|
|
|
|
|
|
|
| |
GLib 2.70 has just been released, so let's sync up the documentation and
annotations.
Fixes: #402
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For historical reasons, we have boxed types that do not follow the
typical conversion from CamelCase to snake_case when it comes to their
get_type function.
The introspection scanner will correctly detect that a type is matched
to that get_type function, but then it will default to tokenize the
get_type function to set the c_symbol_prefix of the given type.
The method pairing code in the main transformation path takes that
mismatch into consideration, but the constructor pairing code does not.
This leads to interesting cases, like GString.
GString is correctly detected as GLib.String, and correctly matched to
its `g_gstring_get_type()` type function, but its c_symbol_prefix is set
to `gstring` after the tokenization. While methods like
`g_string_append()` are correctly paired to the `GLib.String` node,
constructors like `g_string_new()` do not, and end up being turned into
function nodes, like `GLib.string_new`, even if they are annotated as
constructors.
I'm not entirely confident that changing the c_symbol_prefix
tokenization this late in the game is going to be free of regressions;
instead, we provide a way for pairing constructors if they are annotated
as such.
In other words: non-annotated constructors of types that have a
different symbol prefix than the one of the get_type function will stay
as they are today—a global function. To enforce the matching, we rely on
an explicit `(constructor)` annotation; at least, this should ensure
that we have explicit buy in from the maintainers of the API.
Fixes: #399
|
|
|
|
|
|
| |
The "final" attribute is not namespaced. Like "abstract", the "final"
flag is shared across type systems, it's not strongly related to GObject
types.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Use the parent type and the function symbol when erroring out if we
can't find a property accessor.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
| |
The `set-property` and `get-property` identifier annotations only apply
to methods.
The `setter` and `getter` identifier annotations only apply to
properties.
|
|
|
|
| |
Easier to read than `0x3ff`.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
Public accessor functions are the functions typically called through
g_object_set_property() and g_object_get_property().
|
| |
|
| |
|
|
|
|
|
| |
We need new annotations to allow library developers to associate a
setter and a getter functions to a property definition.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A GObject property can be accessed generically through the GObject API,
e.g. g_object_set_property() and g_object_get_property(). Properties
typically also have public accessor functions, which are (according to
our own best practices) called through the generic API.
The introspection data is currently missing the relation between a
property and its public accessor functions. With this information, a
language binding could, for instance, avoid exposing the C API entirely,
thus minimizing the chances of collisions between property names and
accessor functions; alternatively, a binding could call the C API
directly instead of going through the generic GObject API, thus avoiding
the boxing and unboxing from a native type to a GIArgument and finally
into a GValue, and vice versa.
In the GIR, we add two new attributes to the `property` element:
- setter="SYMBOL"
- getter="SYMBOL"
where "symbol" is the C function identifier of the setter and getter
functions, respectively. The `setter` attribute is only applied to
writable, non-construct-only properties; the `getter` attribute is only
applied to readable properties.
We maintain the ABI compatibility of the typelib data by using 20 bits
of the 25 reserved bits inside the PropertyBlob structure. The data is
exposed through two new GIPropertyInfo methods:
- g_property_info_get_setter()
- g_property_info_get_getter()
which return the GIFunctionInfo for the setter and getter functions,
respectively.
|
|
|
|
|
| |
Mention them in the annotations list, and add the new attributes to the
GIR schema.
|
|
|
|
| |
Add an accessors pair to Regress.TestObj and annotate them.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
| |
We need to check the container type before trying to obtain a
GIPropertyInfo for GIFunctionInfos that have a SETTER or a GETTER flag
set.
|
| |
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
| |
We are going to introduce new API.
|
|
|
|
| |
Up to the 2.69.1 tag.
|
|
|
|
|
|
|
| |
This is so that GJS can use these variables in its own build files when
including gobject-introspection as a Meson subproject. Previously we
took the approach of using the files in their installed locations, but
that doesn't work as a subproject.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
The (out caller-allocates) and (out callee-allocates) annotations are
meant for structured or pointer types. Plain old data types are just
regular out parameters and don't need the annotation about who allocates
them.
See: https://gitlab.gnome.org/GNOME/glib/-/merge_requests/2005
|
|
|
|
|
|
| |
Make the variable names intelligible, and include a bunch of built files
that are necessary to ensure that the generated GIR data actually
matches the GLib API.
|
| |
|
|
|
|
|
| |
GLib has dropped the internal copy libpcre, so we need to promote
libpcre's subproject to the top level.
|
|
|
|
|
|
|
| |
GLib dropped the internal libpcre copy, which means we end up with a
subproject inside a subproject.
Since libpcre is frozen, we can rely on using the installed copy.
|
|
|
|
| |
Don't install them as part of the CI job. It's pointless repetition.
|
|
|
|
| |
Avoid a "maybe uninitialized" compiler warning.
|
|
|
|
|
|
|
|
|
| |
Drop explicit `-Wall` and `-Wextra` from the compiler flags.
Meson adds `-Wall` with `warning_level=1`, and `-Wextra` with
`warning_level=2`.
Fixes: #319
|
|
|
|
|
|
|
| |
Don't call Ninja directly, and don't enter the build directory.
Also move shared options to environment variables, so we don't have to
copy and paste them everywhere.
|
| |
|
|
|
|
| |
Not every Linux distro ships with Docker, and Podman is nicer.
|
| |
|
|
|
|
| |
Fedora 29 was EOL'ed in 2019.
|
| |
|
|
|
|
|
|
|
| |
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>
|