[gtk/dnd-gestures-2: 175/242] Remove gtk_drop_target_get_target



commit 44cd2b9854a4e711241677964580b44345c76ec3
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jan 6 00:36:51 2020 -0500

    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          |  8 ++++----
 tests/testtoolbar.c        |  2 +-
 tests/testtreednd.c        |  2 +-
 6 files changed, 7 insertions(+), 26 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 5f1dfc48ac..556db516f8 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -3202,7 +3202,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;
@@ -3298,7 +3298,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);
@@ -3345,7 +3345,7 @@ gtk_notebook_armed (GtkDropTarget  *dest)
   GtkWidget *notebook;
   GdkAtom target, tab_target;
 
-  notebook = gtk_drop_target_get_target (dest);
+  notebook = gtk_event_controller_get_widget (GTK_EVENT_CONTROLLER (dest));
   target = gtk_drop_target_find_mimetype (dest);
   tab_target = g_intern_static_string ("GTK_NOTEBOOK_TAB");
 
@@ -3358,7 +3358,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;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]