Remove gtk_drop_target_get_target

Now that drop targets are event controllers,
we can just use gtk_event_controller_get_widget.
Update all callers.
This commit is contained in:
Matthias Clasen 2020-01-06 00:36:51 -05:00
parent 96c77b61c1
commit 508570864d
6 changed files with 6 additions and 25 deletions

View File

@ -441,22 +441,6 @@ gtk_drag_dest_hierarchy_changed (GtkWidget *widget,
gdk_surface_register_dnd (gtk_native_get_surface (native));
}
/**
* gtk_drop_target_get_target:
* @dest: a #GtkDropTarget
*
* Gets the widget that the drop target is attached to.
*
* Returns: (nullable): get the widget that @dest is attached to
*/
GtkWidget *
gtk_drop_target_get_target (GtkDropTarget *dest)
{
g_return_val_if_fail (GTK_IS_DROP_TARGET (dest), NULL);
return gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
}
/**
* gtk_drop_target_get_drop:
* @dest: a #GtkDropTarget

View File

@ -71,9 +71,6 @@ GdkDragAction gtk_drop_target_get_actions (GtkDropTarget *dest);
GDK_AVAILABLE_IN_ALL
GdkDrop *gtk_drop_target_get_drop (GtkDropTarget *dest);
GDK_AVAILABLE_IN_ALL
GtkWidget *gtk_drop_target_get_target (GtkDropTarget *dest);
GDK_AVAILABLE_IN_ALL
const char *gtk_drop_target_find_mimetype (GtkDropTarget *dest);

View File

@ -1989,7 +1989,7 @@ file_list_drag_data_received_cb (GObject *source,
GtkFileChooserWidget *impl = GTK_FILE_CHOOSER_WIDGET (user_data);
GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (impl);
GtkDropTarget *dest = GTK_DROP_TARGET (source);
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
GdkDrop *drop = gtk_drop_target_get_drop (dest);
GdkDrag *drag = gdk_drop_get_drag (drop);
gchar **uris;

View File

@ -3200,7 +3200,7 @@ gtk_notebook_drag_motion (GtkDropTarget *dest,
int x,
int y)
{
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
GdkDrop *drop = gtk_drop_target_get_drop (dest);
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GtkNotebookPrivate *priv = notebook->priv;
@ -3296,7 +3296,7 @@ gtk_notebook_drag_motion (GtkDropTarget *dest,
static void
gtk_notebook_drag_leave (GtkDropTarget *dest)
{
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
remove_switch_tab_timer (notebook);
@ -3342,7 +3342,7 @@ gtk_notebook_drag_drop (GtkDropTarget *dest,
int x,
int y)
{
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
GtkNotebook *notebook = GTK_NOTEBOOK (widget);
GdkDrop *drop = gtk_drop_target_get_drop (dest);
GdkDrag *drag = gdk_drop_get_drag (drop);

View File

@ -297,7 +297,7 @@ toolbar_drag_drop (GtkDropTarget *dest,
gint x, gint y,
GtkWidget *label)
{
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
gchar buf[32];
g_snprintf(buf, sizeof(buf), "%d",

View File

@ -94,7 +94,7 @@ got_text (GObject *source,
gpointer data)
{
GtkDropTarget *dest = GTK_DROP_TARGET (source);
GtkWidget *widget = gtk_drop_target_get_target (dest);
GtkWidget *widget = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
gchar *text;
GtkSelectionData *selda;