Safe Haskell | None |
---|---|
Language | Haskell2010 |
Data.GI.CodeGen.Fixups
Description
Various fixups in the introspection data.
Synopsis
- dropMovedItems :: API -> Maybe API
- guessPropertyNullability :: (Name, API) -> (Name, API)
- detectGObject :: (Name, API) -> (Name, API)
- dropDuplicatedFields :: (Name, API) -> (Name, API)
- checkClosureDestructors :: (Name, API) -> (Name, API)
- fixClosures :: (Name, API) -> (Name, API)
- fixCallbackUserData :: (Name, API) -> (Name, API)
- fixSymbolNaming :: (Name, API) -> (Name, API)
Documentation
guessPropertyNullability :: (Name, API) -> (Name, API) Source #
GObject-introspection does not currently support nullability annotations, so we try to guess the nullability from the nullability annotations of the curresponding get/set methods, which in principle should be reliable.
detectGObject :: (Name, API) -> (Name, API) Source #
Not every interface that provides signals/properties is marked as requiring GObject, but this is necessarily the case, so fix the introspection data accordingly.
dropDuplicatedFields :: (Name, API) -> (Name, API) Source #
Some libraries include duplicated flags by mistake, drop those.
checkClosureDestructors :: (Name, API) -> (Name, API) Source #
Sometimes arguments are marked as being a user_data destructor, but there is no associated user_data argument. In this case we drop the annotation.
fixClosures :: (Name, API) -> (Name, API) Source #
Closures are often incorrectly assigned, with the closure annotation on the callback, instead of in the closure (user_data) parameter itself. The following makes sure that things are as they should.
fixCallbackUserData :: (Name, API) -> (Name, API) Source #
The last argument of callbacks is often a user_data
argument,
but currently gobject-introspection does not have an annotation
representing this. This is generally OK, since the gir generator
will mark these arguments as (closure)
if they are named
user_data
, and we do the right things in this case, but recently
there has been a push to "fix" these annotations by removing them
without providing any replacement, which breaks the bindings. See
https://gitlab.gnome.org/GNOME/gobject-introspection/-/issues/450
Here we try to guess which arguments in callbacks are user_data
arguments.