st: Fix closure annotations

Quoting Ebassi https://www.bassi.io/articles/2023/02/20/bindable-api-2023/:

    Whenever you’re describing a function that takes a callback, you
    should always annotate the callback argument with the argument that
    contains the user data using the (closure argument) annotation

    You should not annotate the data argument with a unary (closure).

    The unary (closure) is meant to be used when annotating the callback
    type

Recently gobject-introspection became a bit more strict with this and
that generated some warnings:

    Warning: St: invalid "closure" annotation: only valid on callback
    parameters

This commit fix all the closure annotations.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3535>
This commit is contained in:
Florian Müllner 2024-11-06 14:46:31 +01:00
parent d92f8daf62
commit 411fe9c42f

View File

@ -3494,9 +3494,9 @@ load_icon_thread (GTask *task,
* st_icon_info_load_icon_async: * st_icon_info_load_icon_async:
* @icon_info: a #StIconInfo * @icon_info: a #StIconInfo
* @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call when the * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the
* request is satisfied * request is satisfied
* @user_data: (closure): the data to pass to callback function * @user_data: the data to pass to callback function
* *
* Asynchronously load, render and scale an icon previously looked up * Asynchronously load, render and scale an icon previously looked up
* from the icon theme using [method@St.IconTheme.lookup_icon]. * from the icon theme using [method@St.IconTheme.lookup_icon].
@ -4039,9 +4039,9 @@ load_symbolic_icon_thread (GTask *task,
* success colors of the icon * success colors of the icon
* @cancellable: (allow-none): optional #GCancellable object, * @cancellable: (allow-none): optional #GCancellable object,
* %NULL to ignore * %NULL to ignore
* @callback: (scope async): a #GAsyncReadyCallback to call when the * @callback: (scope async) (closure user_data): a #GAsyncReadyCallback to call when the
* request is satisfied * request is satisfied
* @user_data: (closure): the data to pass to callback function * @user_data: the data to pass to callback function
* *
* Asynchronously load, render and scale a symbolic icon previously looked up * Asynchronously load, render and scale a symbolic icon previously looked up
* from the icon theme using [method@St.IconTheme.lookup_icon]. * from the icon theme using [method@St.IconTheme.lookup_icon].