From fa42081556a19bd0a040ff06e1135f7315301712 Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Wed, 3 Jul 2024 16:57:47 +0100 Subject: [PATCH] Use the appropriate annotations for callback closures The unary (closure) annotation is for function pointer types; function arguments that represent the user data to be passed to the callback are annotated on the callback argument itself, with (closure arg-name). --- gdk/gdkclipboard.c | 20 ++++++++++---------- gdk/gdkcontentdeserializer.c | 4 ++-- gdk/gdkcontentprovider.c | 4 ++-- gdk/gdkcontentserializer.c | 4 ++-- gdk/gdkdrop.c | 8 ++++---- gdk/wayland/gdktoplevel-wayland.c | 4 ++-- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/gdk/gdkclipboard.c b/gdk/gdkclipboard.c index a7827ed7ed..87b57b0ffe 100644 --- a/gdk/gdkclipboard.c +++ b/gdk/gdkclipboard.c @@ -515,8 +515,8 @@ gdk_clipboard_get_content (GdkClipboard *clipboard) * @clipboard: a `GdkClipboard` * @io_priority: the I/O priority of the request * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data:: the data to pass to callback function * * Asynchronously instructs the @clipboard to store its contents remotely. * @@ -630,8 +630,8 @@ gdk_clipboard_read_internal (GdkClipboard *clipboard, * @mime_types: (array zero-terminated=1): a %NULL-terminated array of mime types to choose from * @io_priority: the I/O priority of the request * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously requests an input stream to read the @clipboard's * contents from. @@ -823,8 +823,8 @@ gdk_clipboard_read_value_internal (GdkClipboard *clipboard, * @type: a `GType` to read * @io_priority: the I/O priority of the request * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously request the @clipboard contents converted to the given * @type. @@ -882,8 +882,8 @@ gdk_clipboard_read_value_finish (GdkClipboard *clipboard, * gdk_clipboard_read_texture_async: * @clipboard: a `GdkClipboard` * @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore. - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously request the @clipboard contents converted to a `GdkPixbuf`. * @@ -944,8 +944,8 @@ gdk_clipboard_read_texture_finish (GdkClipboard *clipboard, * gdk_clipboard_read_text_async: * @clipboard: a `GdkClipboard` * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously request the @clipboard contents converted to a string. * diff --git a/gdk/gdkcontentdeserializer.c b/gdk/gdkcontentdeserializer.c index 440b2e6bcf..aec6e6ef57 100644 --- a/gdk/gdkcontentdeserializer.c +++ b/gdk/gdkcontentdeserializer.c @@ -533,8 +533,8 @@ deserialize_not_found (GdkContentDeserializer *deserializer) * @type: the GType to deserialize from * @io_priority: the I/O priority of the operation * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the operation is done - * @user_data: (closure): data to pass to the callback function + * @callback: (scope async) (closure user_data): callback to call when the operation is done + * @user_data: data to pass to the callback function * * Read content from the given input stream and deserialize it, asynchronously. * diff --git a/gdk/gdkcontentprovider.c b/gdk/gdkcontentprovider.c index d22990534a..846e0a09ce 100644 --- a/gdk/gdkcontentprovider.c +++ b/gdk/gdkcontentprovider.c @@ -273,8 +273,8 @@ gdk_content_provider_content_changed (GdkContentProvider *provider) * @stream: the `GOutputStream` to write to * @io_priority: I/O priority of the request. * @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore. - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously writes the contents of @provider to @stream in the given * @mime_type. diff --git a/gdk/gdkcontentserializer.c b/gdk/gdkcontentserializer.c index 46267cbb40..8f5223ccea 100644 --- a/gdk/gdkcontentserializer.c +++ b/gdk/gdkcontentserializer.c @@ -539,8 +539,8 @@ serialize_not_found (GdkContentSerializer *serializer) * @value: the content to serialize * @io_priority: the I/O priority of the operation * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): callback to call when the operation is done - * @user_data: (closure): data to pass to the callback function + * @callback: (scope async) (closure): callback to call when the operation is done + * @user_data: data to pass to the callback function * * Serialize content and write it to the given output stream, asynchronously. * diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c index 208f11595a..4623830693 100644 --- a/gdk/gdkdrop.c +++ b/gdk/gdkdrop.c @@ -651,9 +651,9 @@ gdk_drop_read_internal (GdkDrop *self, * pointer to an array of mime types * @io_priority: the I/O priority for the read operation * @cancellable: (nullable): optional `GCancellable` object - * @callback: (scope async): a `GAsyncReadyCallback` to call when + * @callback: (scope async) (closure user_data): a `GAsyncReadyCallback` to call when * the request is satisfied - * @user_data: (closure): the data to pass to @callback + * @user_data: the data to pass to @callback * * Asynchronously read the dropped data from a `GdkDrop` * in a format that complies with one of the mime types. @@ -843,8 +843,8 @@ gdk_drop_read_value_internal (GdkDrop *self, * @type: a `GType` to read * @io_priority: the I/O priority of the request. * @cancellable: (nullable): optional `GCancellable` object, %NULL to ignore. - * @callback: (scope async): callback to call when the request is satisfied - * @user_data: (closure): the data to pass to callback function + * @callback: (scope async) (closure user_data): callback to call when the request is satisfied + * @user_data: the data to pass to callback function * * Asynchronously request the drag operation's contents converted * to the given @type. diff --git a/gdk/wayland/gdktoplevel-wayland.c b/gdk/wayland/gdktoplevel-wayland.c index 9105c2f589..a8d15bc208 100644 --- a/gdk/wayland/gdktoplevel-wayland.c +++ b/gdk/wayland/gdktoplevel-wayland.c @@ -2575,8 +2575,8 @@ export_handle_done (GObject *source, /** * gdk_wayland_toplevel_export_handle: * @toplevel: (type GdkWaylandToplevel): the `GdkToplevel` to obtain a handle for - * @callback: callback to call with the handle - * @user_data: (closure): user data for @callback + * @callback: (scope notified) (closure user_data) (destroy destroy_func): callback to call with the handle + * @user_data: user data for @callback * @destroy_func: destroy notify for @user_data * * Asynchronously obtains a handle for a surface that can be passed