[gtk/async-api: 1/2] gdk: Change some async clipboard api
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/async-api: 1/2] gdk: Change some async clipboard api
- Date: Tue, 2 Apr 2019 15:14:07 +0000 (UTC)
commit 8e4e4401c5064fa7e794a5a68f71df747bdabc47
Author: Matthias Clasen <mclasen redhat com>
Date: Tue Apr 2 11:37:54 2019 +0000
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.
gdk/gdkclipboard.c | 12 ++++++------
gdk/gdkclipboard.h | 16 ++++++++--------
gdk/gdkclipboardprivate.h | 2 +-
gdk/wayland/gdkclipboard-wayland.c | 2 +-
gdk/win32/gdkclipboard-win32.c | 2 +-
gdk/x11/gdkclipboard-x11.c | 2 +-
6 files changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/gdk/gdkclipboard.c b/gdk/gdkclipboard.c
index d165b0fd79..224907ab36 100644
--- a/gdk/gdkclipboard.c
+++ b/gdk/gdkclipboard.c
@@ -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);
diff --git a/gdk/gdkclipboard.h b/gdk/gdkclipboard.h
index 3b470d18bb..5961378d8d 100644
--- a/gdk/gdkclipboard.h
+++ b/gdk/gdkclipboard.h
@@ -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,
diff --git a/gdk/gdkclipboardprivate.h b/gdk/gdkclipboardprivate.h
index 1a511a1031..5a774e4684 100644
--- a/gdk/gdkclipboardprivate.h
+++ b/gdk/gdkclipboardprivate.h
@@ -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);
};
diff --git a/gdk/wayland/gdkclipboard-wayland.c b/gdk/wayland/gdkclipboard-wayland.c
index bed53a71aa..46d90d9ea4 100644
--- a/gdk/wayland/gdkclipboard-wayland.c
+++ b/gdk/wayland/gdkclipboard-wayland.c
@@ -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;
diff --git a/gdk/win32/gdkclipboard-win32.c b/gdk/win32/gdkclipboard-win32.c
index 4544b3a080..87f83d1250 100644
--- a/gdk/win32/gdkclipboard-win32.c
+++ b/gdk/win32/gdkclipboard-win32.c
@@ -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;
diff --git a/gdk/x11/gdkclipboard-x11.c b/gdk/x11/gdkclipboard-x11.c
index aeea1af1fe..2d4326c699 100644
--- a/gdk/x11/gdkclipboard-x11.c
+++ b/gdk/x11/gdkclipboard-x11.c
@@ -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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]