drop: Remove unused convenience APIs

With the new event controllers, these are unused.
This commit is contained in:
Benjamin Otte 2020-03-02 04:15:39 +01:00
parent f5fda3ae58
commit 0e72adf6dd
3 changed files with 0 additions and 106 deletions

View File

@ -775,8 +775,6 @@ gdk_drop_read_async
gdk_drop_read_finish
gdk_drop_read_value_async
gdk_drop_read_value_finish
gdk_drop_read_text_async
gdk_drop_read_text_finish
<SUBSECTION Standard>
GDK_DRAG

View File

@ -892,70 +892,6 @@ gdk_drop_read_value_finish (GdkDrop *self,
return g_task_propagate_pointer (G_TASK (result), error);
}
/**
* gdk_drop_read_text_async:
* @self: a #GdkDrop
* @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
*
* Asynchronously request the drag operation's contents converted to a string.
* When the operation is finished @callback will be called. You can then
* call gdk_drop_read_text_finish() to get the result.
*
* This is a simple wrapper around gdk_drop_read_value_async(). Use
* that function or gdk_drop_read_async() directly if you need more
* control over the operation.
**/
void
gdk_drop_read_text_async (GdkDrop *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
g_return_if_fail (GDK_IS_DROP (self));
g_return_if_fail (cancellable == NULL || G_IS_CANCELLABLE (cancellable));
g_return_if_fail (callback != NULL);
gdk_drop_read_value_internal (self,
G_TYPE_STRING,
gdk_drop_read_text_async,
G_PRIORITY_DEFAULT,
cancellable,
callback,
user_data);
}
/**
* gdk_drop_read_text_finish:
* @self: a #GdkDrop
* @result: a #GAsyncResult
* @error: a #GError location to store the error occurring, or %NULL to
* ignore.
*
* Finishes an asynchronous read started with
* gdk_drop_read_text_async().
*
* Returns: (transfer full) (nullable): a new string or %NULL on error.
**/
char *
gdk_drop_read_text_finish (GdkDrop *self,
GAsyncResult *result,
GError **error)
{
const GValue *value;
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_text_async, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
value = g_task_propagate_pointer (G_TASK (result), error);
if (!value)
return NULL;
return g_value_dup_string (value);
}
static void
gdk_drop_do_emit_event (GdkEvent *event,
gboolean dont_queue)
@ -1063,30 +999,3 @@ gdk_drop_emit_drop_event (GdkDrop *self,
gdk_drop_do_emit_event (event, dont_queue);
}
/**
* gdk_drop_has_value:
* @self: a #GdkDrop
* @type: the type to check
*
* Returns whether calling gdk_drop_read_value_async() for @type
* can succeed.
*
* Returns: %TRUE if the data can be deserialized to the given type
*/
gboolean
gdk_drop_has_value (GdkDrop *self,
GType type)
{
GdkContentFormats *formats;
gboolean ret;
formats = gdk_content_formats_ref (gdk_drop_get_formats (self));
formats = gdk_content_formats_union_deserialize_gtypes (formats);
ret = gdk_content_formats_contain_gtype (formats, type);
gdk_content_formats_unref (formats);
return ret;
}

View File

@ -83,19 +83,6 @@ GDK_AVAILABLE_IN_ALL
const GValue * gdk_drop_read_value_finish (GdkDrop *self,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_ALL
void gdk_drop_read_text_async (GdkDrop *self,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data);
GDK_AVAILABLE_IN_ALL
char * gdk_drop_read_text_finish (GdkDrop *self,
GAsyncResult *result,
GError **error);
GDK_AVAILABLE_IN_ALL
gboolean gdk_drop_has_value (GdkDrop *self,
GType type);
G_END_DECLS