summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-05-08 00:47:26 +0200
committerBenjamin Otte <otte@redhat.com>2018-06-18 23:49:19 +0200
commit6919d8c532f6db48d320e348d55934a537547f01 (patch)
tree3d3d340a67de3dfec6d31548dd64a66b52795445
parentf247d268d4aa02c945ed7297080b685d9df79464 (diff)
downloadgtk+-6919d8c532f6db48d320e348d55934a537547f01.tar.gz
drop: Move gdk_drop_read_async() to GdkDrop class
-rw-r--r--gdk/gdkdnd.c103
-rw-r--r--gdk/gdkdnd.h13
-rw-r--r--gdk/gdkdndprivate.h10
-rw-r--r--gdk/gdkdrop.c108
-rw-r--r--gdk/gdkdrop.h13
-rw-r--r--gdk/gdkdropprivate.h11
-rw-r--r--gdk/wayland/gdkdnd-wayland.c22
-rw-r--r--gdk/win32/gdkdrop-win32.c26
-rw-r--r--gdk/x11/gdkdnd-x11.c24
-rw-r--r--gtk/gtkdnd.c4
10 files changed, 172 insertions, 162 deletions
diff --git a/gdk/gdkdnd.c b/gdk/gdkdnd.c
index 083adf9a5a..debefb0796 100644
--- a/gdk/gdkdnd.c
+++ b/gdk/gdkdnd.c
@@ -373,40 +373,6 @@ gdk_drag_context_finalize (GObject *object)
}
static void
-gdk_drag_context_read_local_async (GdkDragContext *context,
- GdkContentFormats *formats,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GTask *task;
-
- task = g_task_new (context, cancellable, callback, user_data);
- g_task_set_priority (task, io_priority);
- g_task_set_source_tag (task, gdk_drag_context_read_local_async);
-
- g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
- _("Reading not implemented."));
- g_object_unref (task);
-}
-
-static GInputStream *
-gdk_drag_context_read_local_finish (GdkDragContext *context,
- const char **out_mime_type,
- GAsyncResult *result,
- GError **error)
-{
- g_return_val_if_fail (g_task_is_valid (result, context), NULL);
- g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gdk_drag_context_read_local_async, NULL);
-
- if (out_mime_type)
- *out_mime_type = g_task_get_task_data (G_TASK (result));
-
- return g_task_propagate_pointer (G_TASK (result), error);
-}
-
-static void
gdk_drag_context_class_init (GdkDragContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -743,75 +709,6 @@ gdk_drag_context_write_finish (GdkDragContext *context,
}
/**
- * gdk_drop_read_async:
- * @context: a #GdkDragContext
- * @mime_types: (array zero-terminated=1) (element-type utf8): pointer to an array of mime types
- * @io_priority: the io priority for the read operation
- * @cancellable: (allow-none): optional #GCancellable object, %NULL to ignore
- * @callback: (scope async): a #GAsyncReadyCallback to call when the request is satisfied
- * @user_data: (closure): the data to pass to @callback
- *
- * Asynchronously read the dropped data from a DND context
- * in a format that complies with one of the mime types.
- */
-void
-gdk_drop_read_async (GdkDragContext *context,
- const char **mime_types,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
-{
- GdkContentFormats *formats;
-
- g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
- g_return_if_fail (mime_types != NULL && mime_types[0] != NULL);
- g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
- g_return_if_fail (callback != NULL);
-
- formats = gdk_content_formats_new (mime_types, g_strv_length ((char **) mime_types));
-
- GDK_DRAG_CONTEXT_GET_CLASS (context)->read_async (context,
- formats,
- io_priority,
- cancellable,
- callback,
- user_data);
-
- gdk_content_formats_unref (formats);
-}
-
-/**
- * gdk_drop_read_finish:
- * @context: a #GdkDragContext
- * @out_mime_type: (out) (type utf8): return location for the used mime type
- * @result: a #GAsyncResult
- * @error: (allow-none): location to store error information on failure, or %NULL
- *
- * Finishes an async drop read operation, see gdk_drop_read_async().
- *
- * Returns: (nullable) (transfer full): the #GInputStream, or %NULL
- */
-GInputStream *
-gdk_drop_read_finish (GdkDragContext *context,
- const char **out_mime_type,
- GAsyncResult *result,
- GError **error)
-{
- g_return_val_if_fail (GDK_IS_DRAG_CONTEXT (context), NULL);
- g_return_val_if_fail (error == NULL || *error == NULL, NULL);
-
- if (g_async_result_is_tagged (result, gdk_drag_context_read_local_async))
- {
- return gdk_drag_context_read_local_finish (context, out_mime_type, result, error);
- }
- else
- {
- return GDK_DRAG_CONTEXT_GET_CLASS (context)->read_finish (context, out_mime_type, result, error);
- }
-}
-
-/**
* gdk_drag_context_get_drag_surface:
* @context: a #GdkDragContext
*
diff --git a/gdk/gdkdnd.h b/gdk/gdkdnd.h
index 3babca2307..205d7151d2 100644
--- a/gdk/gdkdnd.h
+++ b/gdk/gdkdnd.h
@@ -112,19 +112,6 @@ void gdk_drop_finish (GdkDragContext *context,
gboolean success,
guint32 time_);
-GDK_AVAILABLE_IN_ALL
-void gdk_drop_read_async (GdkDragContext *context,
- const char **mime_types,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
-GDK_AVAILABLE_IN_ALL
-GInputStream * gdk_drop_read_finish (GdkDragContext *context,
- const char **out_mime_type,
- GAsyncResult *result,
- GError **error);
-
/* Source side */
GDK_AVAILABLE_IN_ALL
diff --git a/gdk/gdkdndprivate.h b/gdk/gdkdndprivate.h
index 9c240f084a..4018632d3c 100644
--- a/gdk/gdkdndprivate.h
+++ b/gdk/gdkdndprivate.h
@@ -45,16 +45,6 @@ struct _GdkDragContextClass {
void (*drop_finish) (GdkDragContext *context,
gboolean success,
guint32 time_);
- void (* read_async) (GdkDragContext *context,
- GdkContentFormats *formats,
- int io_priority,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data);
- GInputStream * (* read_finish) (GdkDragContext *context,
- const char **out_mime_type,
- GAsyncResult *result,
- GError **error);
GdkSurface* (*get_drag_surface) (GdkDragContext *context);
void (*set_hotspot) (GdkDragContext *context,
gint hot_x,
diff --git a/gdk/gdkdrop.c b/gdk/gdkdrop.c
index 0e7bb8f262..c11383eb24 100644
--- a/gdk/gdkdrop.c
+++ b/gdk/gdkdrop.c
@@ -57,8 +57,37 @@ G_DEFINE_TYPE_WITH_PRIVATE (GdkDrop, gdk_drop, G_TYPE_OBJECT)
*/
static void
-gdk_drop_init (GdkDrop *self)
+gdk_drop_read_local_async (GdkDrop *self,
+ GdkContentFormats *formats,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GTask *task;
+
+ task = g_task_new (self, cancellable, callback, user_data);
+ g_task_set_priority (task, io_priority);
+ g_task_set_source_tag (task, gdk_drop_read_local_async);
+
+ g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
+ _("Reading not implemented."));
+ g_object_unref (task);
+}
+
+static GInputStream *
+gdk_drop_read_local_finish (GdkDrop *self,
+ const char **out_mime_type,
+ GAsyncResult *result,
+ GError **error)
{
+ g_return_val_if_fail (g_task_is_valid (result, self), NULL);
+ g_return_val_if_fail (g_task_get_source_tag (G_TASK (result)) == gdk_drop_read_local_async, NULL);
+
+ if (out_mime_type)
+ *out_mime_type = g_task_get_task_data (G_TASK (result));
+
+ return g_task_propagate_pointer (G_TASK (result), error);
}
static void
@@ -185,6 +214,11 @@ gdk_drop_class_init (GdkDropClass *klass)
g_object_class_install_properties (object_class, N_PROPERTIES, properties);
}
+static void
+gdk_drop_init (GdkDrop *self)
+{
+}
+
/**
* gdk_drop_get_display:
* @self: a #GdkDrop
@@ -240,3 +274,75 @@ gdk_drop_get_formats (GdkDrop *self)
return priv->formats;
}
+/**
+ * gdk_drop_read_async:
+ * @self: a #GdkDrop
+ * @mime_types: (array zero-terminated=1) (element-type utf8):
+ * pointer to an array of mime types
+ * @io_priority: the io priority for the read operation
+ * @cancellable: (allow-none): optional #GCancellable object,
+ * %NULL to ignore
+ * @callback: (scope async): a #GAsyncReadyCallback to call when
+ * the request is satisfied
+ * @user_data: (closure): 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.
+ */
+void
+gdk_drop_read_async (GdkDrop *self,
+ const char **mime_types,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
+{
+ GdkContentFormats *formats;
+
+ g_return_if_fail (GDK_IS_DROP (self));
+ g_return_if_fail (mime_types != NULL && mime_types[0] != NULL);
+ g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
+ g_return_if_fail (callback != NULL);
+
+ formats = gdk_content_formats_new (mime_types, g_strv_length ((char **) mime_types));
+
+ GDK_DROP_GET_CLASS (self)->read_async (self,
+ formats,
+ io_priority,
+ cancellable,
+ callback,
+ user_data);
+
+ gdk_content_formats_unref (formats);
+}
+
+/**
+ * gdk_drop_read_finish:
+ * @self: a #GdkDrop
+ * @out_mime_type: (out) (type utf8): return location for the used mime type
+ * @result: a #GAsyncResult
+ * @error: (allow-none): location to store error information on failure, or %NULL
+ *
+ * Finishes an async drop read operation, see gdk_drop_read_async().
+ *
+ * Returns: (nullable) (transfer full): the #GInputStream, or %NULL
+ */
+GInputStream *
+gdk_drop_read_finish (GdkDrop *self,
+ const char **out_mime_type,
+ GAsyncResult *result,
+ GError **error)
+{
+ g_return_val_if_fail (GDK_IS_DROP (self), NULL);
+ g_return_val_if_fail (error == NULL || *error == NULL, NULL);
+
+ if (g_async_result_is_tagged (result, gdk_drop_read_local_async))
+ {
+ return gdk_drop_read_local_finish (self, out_mime_type, result, error);
+ }
+ else
+ {
+ return GDK_DROP_GET_CLASS (self)->read_finish (self, out_mime_type, result, error);
+ }
+}
+
diff --git a/gdk/gdkdrop.h b/gdk/gdkdrop.h
index e8a5423e91..b1b4488d6b 100644
--- a/gdk/gdkdrop.h
+++ b/gdk/gdkdrop.h
@@ -46,6 +46,19 @@ GdkDevice * gdk_drop_get_device (GdkDrop
GDK_AVAILABLE_IN_ALL
GdkContentFormats * gdk_drop_get_formats (GdkDrop *self);
+GDK_AVAILABLE_IN_ALL
+void gdk_drop_read_async (GdkDrop *self,
+ const char **mime_types,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+GDK_AVAILABLE_IN_ALL
+GInputStream * gdk_drop_read_finish (GdkDrop *self,
+ const char **out_mime_type,
+ GAsyncResult *result,
+ GError **error);
+
G_END_DECLS
#endif /* __GDK_DROP_H__ */
diff --git a/gdk/gdkdropprivate.h b/gdk/gdkdropprivate.h
index 6ddcfb45e9..ebe95e76cb 100644
--- a/gdk/gdkdropprivate.h
+++ b/gdk/gdkdropprivate.h
@@ -38,6 +38,17 @@ struct _GdkDrop {
struct _GdkDropClass {
GObjectClass parent_class;
+
+ void (* read_async) (GdkDrop *self,
+ GdkContentFormats *formats,
+ int io_priority,
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data);
+ GInputStream * (* read_finish) (GdkDrop *self,
+ const char **out_mime_type,
+ GAsyncResult *result,
+ GError **error);
};
diff --git a/gdk/wayland/gdkdnd-wayland.c b/gdk/wayland/gdkdnd-wayland.c
index e23a8185e8..9c9e77f9c7 100644
--- a/gdk/wayland/gdkdnd-wayland.c
+++ b/gdk/wayland/gdkdnd-wayland.c
@@ -253,14 +253,14 @@ gdk_wayland_drag_context_drop_finish (GdkDragContext *context,
}
static void
-gdk_wayland_drag_context_read_async (GdkDragContext *context,
+gdk_wayland_drag_context_read_async (GdkDrop *drop,
GdkContentFormats *formats,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (context);
+ GdkWaylandDragContext *wayland_context = GDK_WAYLAND_DRAG_CONTEXT (drop);
GdkDisplay *display;
GInputStream *stream;
const char *mime_type;
@@ -268,16 +268,16 @@ gdk_wayland_drag_context_read_async (GdkDragContext *context,
GError *error = NULL;
GTask *task;
- display = gdk_drag_context_get_display (context),
- task = g_task_new (context, cancellable, callback, user_data);
+ display = gdk_drop_get_display (drop),
+ task = g_task_new (drop, cancellable, callback, user_data);
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_wayland_drag_context_read_async);
GDK_DISPLAY_NOTE (display, DND, char *s = gdk_content_formats_to_string (formats);
- g_message ("%p: read for %s", context, s);
+ g_message ("%p: read for %s", drop, s);
g_free (s); );
mime_type = gdk_content_formats_match_mime_type (formats,
- gdk_drag_context_get_formats (context));
+ gdk_drop_get_formats (drop));
if (mime_type == NULL)
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_NOT_SUPPORTED,
@@ -300,14 +300,14 @@ gdk_wayland_drag_context_read_async (GdkDragContext *context,
}
static GInputStream *
-gdk_wayland_drag_context_read_finish (GdkDragContext *context,
+gdk_wayland_drag_context_read_finish (GdkDrop *drop,
const char **out_mime_type,
GAsyncResult *result,
GError **error)
{
GTask *task;
- g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (context)), NULL);
+ g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (drop)), NULL);
task = G_TASK (result);
g_return_val_if_fail (g_task_get_source_tag (task) == gdk_wayland_drag_context_read_async, NULL);
@@ -407,17 +407,19 @@ static void
gdk_wayland_drag_context_class_init (GdkWaylandDragContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GdkDropClass *drop_class = GDK_DROP_CLASS (klass);
GdkDragContextClass *context_class = GDK_DRAG_CONTEXT_CLASS (klass);
object_class->finalize = gdk_wayland_drag_context_finalize;
+ drop_class->read_async = gdk_wayland_drag_context_read_async;
+ drop_class->read_finish = gdk_wayland_drag_context_read_finish;
+
context_class->drag_status = gdk_wayland_drag_context_drag_status;
context_class->drag_abort = gdk_wayland_drag_context_drag_abort;
context_class->drag_drop = gdk_wayland_drag_context_drag_drop;
context_class->drop_finish = gdk_wayland_drag_context_drop_finish;
context_class->drop_finish = gdk_wayland_drag_context_drop_finish;
- context_class->read_async = gdk_wayland_drag_context_read_async;
- context_class->read_finish = gdk_wayland_drag_context_read_finish;
context_class->get_drag_surface = gdk_wayland_drag_context_get_drag_surface;
context_class->set_hotspot = gdk_wayland_drag_context_set_hotspot;
context_class->drop_done = gdk_wayland_drag_context_drop_done;
diff --git a/gdk/win32/gdkdrop-win32.c b/gdk/win32/gdkdrop-win32.c
index 23d95d1824..1b2d19930c 100644
--- a/gdk/win32/gdkdrop-win32.c
+++ b/gdk/win32/gdkdrop-win32.c
@@ -1052,14 +1052,14 @@ grab_data_from_hdata (GTask *task,
}
static void
-gdk_win32_drop_context_read_async (GdkDragContext *context,
+gdk_win32_drop_context_read_async (GdkDrop *drop,
GdkContentFormats *formats,
int io_priority,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
- GdkWin32DropContext *context_win32 = GDK_WIN32_DROP_CONTEXT (context);
+ GdkWin32DropContext *context_win32 = GDK_WIN32_DROP_CONTEXT (drop);
GTask *task;
target_drag_context *tctx;
const char * const *mime_types;
@@ -1072,16 +1072,16 @@ gdk_win32_drop_context_read_async (GdkDragContext *context,
gsize data_len;
GInputStream *stream;
- task = g_task_new (context, cancellable, callback, user_data);
+ task = g_task_new (drop, cancellable, callback, user_data);
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_win32_drop_context_read_async);
- tctx = find_droptarget_for_target_context (context);
+ tctx = find_droptarget_for_target_context (GDK_DRAG_CONTEXT (drop));
if (tctx == NULL)
{
g_task_return_new_error (task, G_IO_ERROR, G_IO_ERROR_FAILED,
- _("Failed to find target context record for context 0x%p"), context);
+ _("Failed to find target context record for context 0x%p"), drop);
return;
}
@@ -1170,15 +1170,15 @@ gdk_win32_drop_context_read_async (GdkDragContext *context,
}
static GInputStream *
-gdk_win32_drop_context_read_finish (GdkDragContext *context,
- const char **out_mime_type,
- GAsyncResult *result,
- GError **error)
+gdk_win32_drop_context_read_finish (GdkDrop *drop,
+ const char **out_mime_type,
+ GAsyncResult *result,
+ GError **error)
{
GTask *task;
GInputStream *stream;
- g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (context)), NULL);
+ g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (drop)), NULL);
task = G_TASK (result);
g_return_val_if_fail (g_task_get_source_tag (task) == gdk_win32_drop_context_read_async, NULL);
@@ -1194,14 +1194,16 @@ static void
gdk_win32_drop_context_class_init (GdkWin32DropContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GdkDropClass *drop_class = GDK_DROP_CLASS (klass);
GdkDragContextClass *context_class = GDK_DRAG_CONTEXT_CLASS (klass);
object_class->finalize = gdk_win32_drop_context_finalize;
+ drop_class->read_async = gdk_win32_drop_context_read_async;
+ drop_class->read_finish = gdk_win32_drop_context_read_finish;
+
context_class->drag_status = gdk_win32_drop_context_drag_status;
context_class->drop_finish = gdk_win32_drop_context_drop_finish;
- context_class->read_async = gdk_win32_drop_context_read_async;
- context_class->read_finish = gdk_win32_drop_context_read_finish;
}
void
diff --git a/gdk/x11/gdkdnd-x11.c b/gdk/x11/gdkdnd-x11.c
index befcaf6591..8922944459 100644
--- a/gdk/x11/gdkdnd-x11.c
+++ b/gdk/x11/gdkdnd-x11.c
@@ -279,13 +279,13 @@ gdk_x11_drag_context_read_got_stream (GObject *source,
next = targets->next;
if (next)
{
- GdkDragContext *context = GDK_DRAG_CONTEXT (g_task_get_source_object (task));
+ GdkDrop *drop = GDK_DROP (g_task_get_source_object (task));
- GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("reading %s failed, trying %s next\n",
+ GDK_DISPLAY_NOTE (gdk_drop_get_display (drop), DND, g_printerr ("reading %s failed, trying %s next\n",
(char *) targets->data, (char *) next->data));
targets->next = NULL;
g_task_set_task_data (task, next, (GDestroyNotify) g_slist_free);
- gdk_x11_selection_input_stream_new_async (gdk_drag_context_get_display (context),
+ gdk_x11_selection_input_stream_new_async (gdk_drop_get_display (drop),
"XdndSelection",
next->data,
CurrentTime,
@@ -330,7 +330,7 @@ gdk_x11_drag_context_read_got_stream (GObject *source,
}
static void
-gdk_x11_drag_context_read_async (GdkDragContext *context,
+gdk_x11_drag_context_read_async (GdkDrop *drop,
GdkContentFormats *formats,
int io_priority,
GCancellable *cancellable,
@@ -340,7 +340,7 @@ gdk_x11_drag_context_read_async (GdkDragContext *context,
GSList *targets;
GTask *task;
- task = g_task_new (context, cancellable, callback, user_data);
+ task = g_task_new (drop, cancellable, callback, user_data);
g_task_set_priority (task, io_priority);
g_task_set_source_tag (task, gdk_x11_drag_context_read_async);
@@ -353,9 +353,9 @@ gdk_x11_drag_context_read_async (GdkDragContext *context,
return;
}
- GDK_DISPLAY_NOTE (gdk_drag_context_get_display (context), DND, g_printerr ("new read for %s (%u other options)\n",
+ GDK_DISPLAY_NOTE (gdk_drop_get_display (drop), DND, g_printerr ("new read for %s (%u other options)\n",
(char *) targets->data, g_slist_length (targets->next)));
- gdk_x11_selection_input_stream_new_async (gdk_drag_context_get_display (context),
+ gdk_x11_selection_input_stream_new_async (gdk_drop_get_display (drop),
"XdndSelection",
targets->data,
CurrentTime,
@@ -366,14 +366,14 @@ gdk_x11_drag_context_read_async (GdkDragContext *context,
}
static GInputStream *
-gdk_x11_drag_context_read_finish (GdkDragContext *context,
+gdk_x11_drag_context_read_finish (GdkDrop *drop,
const char **out_mime_type,
GAsyncResult *result,
GError **error)
{
GTask *task;
- g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (context)), NULL);
+ g_return_val_if_fail (g_task_is_valid (result, G_OBJECT (drop)), NULL);
task = G_TASK (result);
g_return_val_if_fail (g_task_get_source_tag (task) == gdk_x11_drag_context_read_async, NULL);
@@ -392,16 +392,18 @@ static void
gdk_x11_drag_context_class_init (GdkX11DragContextClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GdkDropClass *drop_class = GDK_DROP_CLASS (klass);
GdkDragContextClass *context_class = GDK_DRAG_CONTEXT_CLASS (klass);
object_class->finalize = gdk_x11_drag_context_finalize;
+ drop_class->read_async = gdk_x11_drag_context_read_async;
+ drop_class->read_finish = gdk_x11_drag_context_read_finish;
+
context_class->drag_status = gdk_x11_drag_context_drag_status;
context_class->drag_abort = gdk_x11_drag_context_drag_abort;
context_class->drag_drop = gdk_x11_drag_context_drag_drop;
context_class->drop_finish = gdk_x11_drag_context_drop_finish;
- context_class->read_async = gdk_x11_drag_context_read_async;
- context_class->read_finish = gdk_x11_drag_context_read_finish;
context_class->get_drag_surface = gdk_x11_drag_context_get_drag_surface;
context_class->set_hotspot = gdk_x11_drag_context_set_hotspot;
context_class->drop_done = gdk_x11_drag_context_drop_done;
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index 883f9affc1..f84659306b 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -241,7 +241,7 @@ gtk_drag_get_data_got_stream (GObject *source,
GInputStream *input_stream;
GOutputStream *output_stream;
- input_stream = gdk_drop_read_finish (GDK_DRAG_CONTEXT (source), &data->mime_type, result, NULL);
+ input_stream = gdk_drop_read_finish (GDK_DROP (source), &data->mime_type, result, NULL);
if (input_stream == NULL)
{
gtk_drag_get_data_finish (data, NULL, 0);
@@ -297,7 +297,7 @@ gtk_drag_get_data (GtkWidget *widget,
data->mime_type = target;
data->time = time_;
- gdk_drop_read_async (context,
+ gdk_drop_read_async (GDK_DROP (context),
(const gchar *[2]) { target, NULL },
G_PRIORITY_DEFAULT,
NULL,