mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-26 13:41:07 +00:00
gdk: Change some async dnd api
The pattern we generally follow is to put the async result right after the source object, in finish functions. Do this for gdk_drop_read_finish.
This commit is contained in:
parent
8e4e4401c5
commit
64fd5158bf
@ -149,8 +149,8 @@ gdk_drop_read_local_async (GdkDrop *self,
|
||||
|
||||
static GInputStream *
|
||||
gdk_drop_read_local_finish (GdkDrop *self,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (g_task_is_valid (result, self), NULL);
|
||||
@ -622,8 +622,8 @@ gdk_drop_read_async (GdkDrop *self,
|
||||
/**
|
||||
* gdk_drop_read_finish:
|
||||
* @self: a #GdkDrop
|
||||
* @out_mime_type: (out) (type utf8): return location for the used mime type
|
||||
* @result: a #GAsyncResult
|
||||
* @out_mime_type: (out) (type utf8): return location for the used mime type
|
||||
* @error: (allow-none): location to store error information on failure, or %NULL
|
||||
*
|
||||
* Finishes an async drop read operation, see gdk_drop_read_async().
|
||||
@ -632,8 +632,8 @@ gdk_drop_read_async (GdkDrop *self,
|
||||
*/
|
||||
GInputStream *
|
||||
gdk_drop_read_finish (GdkDrop *self,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
g_return_val_if_fail (GDK_IS_DROP (self), NULL);
|
||||
@ -641,11 +641,11 @@ gdk_drop_read_finish (GdkDrop *self,
|
||||
|
||||
if (g_async_result_is_tagged (result, gdk_drop_read_local_async))
|
||||
{
|
||||
return gdk_drop_read_local_finish (self, out_mime_type, result, error);
|
||||
return gdk_drop_read_local_finish (self, result, out_mime_type, error);
|
||||
}
|
||||
else
|
||||
{
|
||||
return GDK_DROP_GET_CLASS (self)->read_finish (self, out_mime_type, result, error);
|
||||
return GDK_DROP_GET_CLASS (self)->read_finish (self, result, out_mime_type, error);
|
||||
}
|
||||
}
|
||||
|
||||
@ -678,7 +678,7 @@ gdk_drop_read_value_got_stream (GObject *source,
|
||||
GTask *task = data;
|
||||
const char *mime_type;
|
||||
|
||||
stream = gdk_drop_read_finish (GDK_DROP (source), &mime_type, result, &error);
|
||||
stream = gdk_drop_read_finish (GDK_DROP (source), result, &mime_type, &error);
|
||||
if (stream == NULL)
|
||||
{
|
||||
g_task_return_error (task, error);
|
||||
|
@ -68,8 +68,8 @@ void gdk_drop_read_async (GdkDrop
|
||||
gpointer user_data);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GInputStream * gdk_drop_read_finish (GdkDrop *self,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gdk_drop_read_value_async (GdkDrop *self,
|
||||
|
@ -51,8 +51,8 @@ struct _GdkDropClass {
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data);
|
||||
GInputStream * (* read_finish) (GdkDrop *self,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error);
|
||||
};
|
||||
|
||||
|
@ -224,8 +224,8 @@ gdk_wayland_drop_read_async (GdkDrop *drop,
|
||||
|
||||
static GInputStream *
|
||||
gdk_wayland_drop_read_finish (GdkDrop *drop,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
GTask *task;
|
||||
|
@ -331,8 +331,8 @@ gdk_wayland_primary_read_async (GdkClipboard *clipboard,
|
||||
|
||||
static GInputStream *
|
||||
gdk_wayland_primary_read_finish (GdkClipboard *clipboard,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
GInputStream *stream;
|
||||
|
@ -1382,8 +1382,8 @@ gdk_win32_drop_read_async (GdkDrop *drop,
|
||||
|
||||
static GInputStream *
|
||||
gdk_win32_drop_read_finish (GdkDrop *drop,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
GTask *task;
|
||||
|
@ -211,8 +211,8 @@ gdk_x11_drop_read_async (GdkDrop *drop,
|
||||
|
||||
static GInputStream *
|
||||
gdk_x11_drop_read_finish (GdkDrop *drop,
|
||||
const char **out_mime_type,
|
||||
GAsyncResult *result,
|
||||
const char **out_mime_type,
|
||||
GError **error)
|
||||
{
|
||||
GTask *task;
|
||||
|
@ -244,7 +244,7 @@ gtk_drag_get_data_got_stream (GObject *source,
|
||||
GInputStream *input_stream;
|
||||
GOutputStream *output_stream;
|
||||
|
||||
input_stream = gdk_drop_read_finish (GDK_DROP (source), &data->mime_type, result, NULL);
|
||||
input_stream = gdk_drop_read_finish (GDK_DROP (source), result, &data->mime_type, NULL);
|
||||
if (input_stream == NULL)
|
||||
{
|
||||
gtk_drag_get_data_finish (data, NULL, 0);
|
||||
|
Loading…
Reference in New Issue
Block a user