From 508570864dea3b857a0f62c3f2a1ace141be9806 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 6 Jan 2020 00:36:51 -0500 Subject: [PATCH] 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. --- gtk/gtkdragdest.c | 16 ---------------- gtk/gtkdragdest.h | 3 --- gtk/gtkfilechooserwidget.c | 2 +- gtk/gtknotebook.c | 6 +++--- tests/testtoolbar.c | 2 +- tests/testtreednd.c | 2 +- 6 files changed, 6 insertions(+), 25 deletions(-) diff --git a/gtk/gtkdragdest.c b/gtk/gtkdragdest.c index ce57dd93ec..93158c70bf 100644 --- a/gtk/gtkdragdest.c +++ b/gtk/gtkdragdest.c @@ -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 diff --git a/gtk/gtkdragdest.h b/gtk/gtkdragdest.h index 11271c46b4..37cd2ef89e 100644 --- a/gtk/gtkdragdest.h +++ b/gtk/gtkdragdest.h @@ -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); diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c index 23f7ed0b93..f6288e40e2 100644 --- a/gtk/gtkfilechooserwidget.c +++ b/gtk/gtkfilechooserwidget.c @@ -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; diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 5127e7c177..d316a45e0f 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -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); diff --git a/tests/testtoolbar.c b/tests/testtoolbar.c index d585bde96c..60c92ae79c 100644 --- a/tests/testtoolbar.c +++ b/tests/testtoolbar.c @@ -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", diff --git a/tests/testtreednd.c b/tests/testtreednd.c index 7de29236bc..47272c116c 100644 --- a/tests/testtreednd.c +++ b/tests/testtreednd.c @@ -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;