gdk: Change some async clipboard api

The pattern we generally follow is to put the
async result right after the source object, in
finish functions. Do this for gdk_clipboard_read_finish.
This commit is contained in:
Matthias Clasen 2019-04-02 11:37:54 +00:00
parent 5b6031f7e4
commit 8e4e4401c5
6 changed files with 18 additions and 18 deletions

View File

@ -331,8 +331,8 @@ gdk_clipboard_read_local_async (GdkClipboard *clipboard,
static GInputStream *
gdk_clipboard_read_local_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
g_return_val_if_fail (g_task_is_valid (result, clipboard), NULL);
@ -673,9 +673,9 @@ gdk_clipboard_read_async (GdkClipboard *clipboard,
/**
* gdk_clipboard_read_finish:
* @clipboard: a #GdkClipboard
* @result: a #GAsyncResult
* @out_mime_type: (out) (allow-none) (transfer none): pointer to store
* the chosen mime type in or %NULL
* @result: a #GAsyncResult
* @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
@ -685,8 +685,8 @@ gdk_clipboard_read_async (GdkClipboard *clipboard,
**/
GInputStream *
gdk_clipboard_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
g_return_val_if_fail (GDK_IS_CLIPBOARD (clipboard), NULL);
@ -696,11 +696,11 @@ gdk_clipboard_read_finish (GdkClipboard *clipboard,
* read was ongoing */
if (g_async_result_is_tagged (result, gdk_clipboard_read_local_async))
{
return gdk_clipboard_read_local_finish (clipboard, out_mime_type, result, error);
return gdk_clipboard_read_local_finish (clipboard, result, out_mime_type, error);
}
else
{
return GDK_CLIPBOARD_GET_CLASS (clipboard)->read_finish (clipboard, out_mime_type, result, error);
return GDK_CLIPBOARD_GET_CLASS (clipboard)->read_finish (clipboard, result, out_mime_type, error);
}
}
@ -733,7 +733,7 @@ gdk_clipboard_read_value_got_stream (GObject *source,
GTask *task = data;
const char *mime_type;
stream = gdk_clipboard_read_finish (GDK_CLIPBOARD (source), &mime_type, result, &error);
stream = gdk_clipboard_read_finish (GDK_CLIPBOARD (source), result, &mime_type, &error);
if (stream == NULL)
{
g_task_return_error (task, error);

View File

@ -66,8 +66,8 @@ void gdk_clipboard_read_async (GdkClipboard *
gpointer user_data);
GDK_AVAILABLE_IN_ALL
GInputStream * gdk_clipboard_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error);
GDK_AVAILABLE_IN_ALL
void gdk_clipboard_read_value_async (GdkClipboard *clipboard,
@ -81,14 +81,14 @@ const GValue * gdk_clipboard_read_value_finish (GdkClipboard *
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_ALL
void gdk_clipboard_read_texture_async(GdkClipboard *clipboard,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
void gdk_clipboard_read_texture_async (GdkClipboard *clipboard,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
GdkTexture * gdk_clipboard_read_texture_finish (GdkClipboard *clipboard,
GAsyncResult *result,
GError **error);
GdkTexture * gdk_clipboard_read_texture_finish (GdkClipboard *clipboard,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_ALL
void gdk_clipboard_read_text_async (GdkClipboard *clipboard,
GCancellable *cancellable,

View File

@ -60,8 +60,8 @@ struct _GdkClipboardClass
GAsyncReadyCallback callback,
gpointer user_data);
GInputStream * (* read_finish) (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error);
};

View File

@ -250,8 +250,8 @@ gdk_wayland_clipboard_read_async (GdkClipboard *clipboard,
static GInputStream *
gdk_wayland_clipboard_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;

View File

@ -234,8 +234,8 @@ gdk_win32_clipboard_read_async (GdkClipboard *clipboard,
static GInputStream *
gdk_win32_clipboard_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;

View File

@ -776,8 +776,8 @@ gdk_x11_clipboard_read_async (GdkClipboard *clipboard,
static GInputStream *
gdk_x11_clipboard_read_finish (GdkClipboard *clipboard,
const char **out_mime_type,
GAsyncResult *result,
const char **out_mime_type,
GError **error)
{
GTask *task;