dnd: Get rid of gtk_drag_finish()
authorBenjamin Otte <otte@redhat.com>
Mon, 14 May 2018 14:44:43 +0000 (16:44 +0200)
committerBenjamin Otte <otte@redhat.com>
Mon, 18 Jun 2018 21:49:20 +0000 (23:49 +0200)
It's just a wrapper around gdk_drag_finish(), so use that one instead.

15 files changed:
docs/reference/gtk/gtk4-sections.txt
gtk/gtkcalendar.c
gtk/gtkdnd.c
gtk/gtkdnd.h
gtk/gtkdragdest.c
gtk/gtkdragdest.h
gtk/gtkentry.c
gtk/gtkfilechooserbutton.c
gtk/gtkiconview.c
gtk/gtknotebook.c
gtk/gtkplacessidebar.c
gtk/gtktextview.c
gtk/gtktreeview.c
gtk/gtkwidget.c
tests/testdnd.c

index 0ddedb183c4a50337dd3433f52455a87417502ba..a09f54192a6d9e1f98469e01433c75ab44c5d3c0 100644 (file)
@@ -5024,7 +5024,6 @@ gtk_drag_dest_add_image_targets
 gtk_drag_dest_add_uri_targets
 gtk_drag_dest_set_track_motion
 gtk_drag_dest_get_track_motion
-gtk_drag_finish
 gtk_drag_get_data
 gtk_drag_get_source_widget
 gtk_drag_highlight
index e7546b90f31bab1e78477c2b2f85293a9a102244..7d01a1e55f405bc9c9874c25893ff9df94cdc034 100644 (file)
@@ -3058,7 +3058,7 @@ gtk_calendar_drag_data_received (GtkWidget        *widget,
     {
       g_warning ("Received invalid date data");
       g_date_free (date);
-      gtk_drag_finish (context, FALSE, time);
+      gdk_drag_finish (context, FALSE, time);
       return;
     }
 
@@ -3067,7 +3067,7 @@ gtk_calendar_drag_data_received (GtkWidget        *widget,
   year = g_date_get_year (date);
   g_date_free (date);
 
-  gtk_drag_finish (context, TRUE, time);
+  gdk_drag_finish (context, TRUE, time);
 
 
   g_object_freeze_notify (G_OBJECT (calendar));
index 748c191d29af4b061df16bc0bf6c962650eb2090..515b8f6bad0d04fccf7761f214f0cd535f440fdb 100644 (file)
@@ -202,7 +202,7 @@ gtk_drag_get_data_finish (GtkDragGetData *data,
   if (site && site->flags & GTK_DEST_DEFAULT_DROP)
     {
 
-      gtk_drag_finish (data->context, 
+      gdk_drag_finish (data->context, 
                        size > 0,
                        data->time);
     }
@@ -336,25 +336,6 @@ gtk_drag_get_source_widget (GdkDragContext *context)
   return NULL;
 }
 
-/**
- * gtk_drag_finish:
- * @context: the drag context
- * @success: a flag indicating whether the drop was successful
- * @time_: the timestamp from the #GtkWidget::drag-drop signal
- *
- * Informs the drag source that the drop is finished, and
- * that the data of the drag will no longer be required.
- */
-void 
-gtk_drag_finish (GdkDragContext *context,
-                 gboolean        success,
-                 guint32         time)
-{
-  g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
-
-  gdk_drag_finish (context, success, time);
-}
-
 /**
  * gtk_drag_highlight: (method)
  * @widget: a widget to highlight
@@ -751,7 +732,7 @@ gtk_drag_dest_drop (GtkWidget      *widget,
 
       if (target == NULL)
         {
-          gtk_drag_finish (context, FALSE, time);
+          gdk_drag_finish (context, FALSE, time);
           return TRUE;
         }
       else 
index c6aa57743bbb5e7143dab83a1aaa8ea7e02d302e..df791ba6be0d534e6116d7763c526741c32623e3 100644 (file)
@@ -44,10 +44,6 @@ void gtk_drag_get_data (GtkWidget      *widget,
                        GdkDragContext *context,
                        GdkAtom         target,
                        guint32         time_);
-GDK_AVAILABLE_IN_ALL
-void gtk_drag_finish   (GdkDragContext *context,
-                       gboolean        success,
-                       guint32         time_);
 
 GDK_AVAILABLE_IN_ALL
 GtkWidget *gtk_drag_get_source_widget (GdkDragContext *context);
index ade77fb8db250f31a3bced66b0714e11ee15a5fe..e5b65b398f87d2b5d272c4d63c28c20b94f6d6cc 100644 (file)
@@ -115,7 +115,7 @@ gtk_drag_dest_set_internal (GtkWidget       *widget,
  * behaviors described by @flags make some assumptions, that can conflict
  * with your own signal handlers. For instance #GTK_DEST_DEFAULT_DROP causes
  * invokations of gdk_drag_status() in the context of #GtkWidget::drag-motion,
- * and invokations of gtk_drag_finish() in #GtkWidget::drag-data-received.
+ * and invokations of gdk_drag_finish() in #GtkWidget::drag-data-received.
  * Especially the later is dramatic, when your own #GtkWidget::drag-motion
  * handler calls gtk_drag_get_data() to inspect the dragged data.
  *
index 9fc1d3ee319cbc84c37221415f3b15f12c0577a0..b8c958715210e0b4627c7bba282c425c19bff546 100644 (file)
@@ -49,9 +49,9 @@ G_BEGIN_DECLS
  * @GTK_DEST_DEFAULT_DROP: If set for a widget, when a drop occurs, GTK+ will
  *   will check if the drag matches this widget’s list of possible formats and
  *   actions. If so, GTK+ will call gtk_drag_get_data() on behalf of the widget.
- *   Whether or not the drop is successful, GTK+ will call gtk_drag_finish(). If
+ *   Whether or not the drop is successful, GTK+ will call gdk_drag_finish(). If
  *   the action was a move, then if the drag was successful, then %TRUE will be
- *   passed for the @delete parameter to gtk_drag_finish().
+ *   passed for the @delete parameter to gdk_drag_finish().
  * @GTK_DEST_DEFAULT_ALL: If set, specifies that all default actions should
  *   be taken.
  *
index 7a7ce7268eb85a80e6aeaf1aad9d859bbf780f0f..f6a05f3d2709924fe4d7d9c6f5dcbd2f67e95d6a 100644 (file)
@@ -8623,7 +8623,7 @@ gtk_entry_drag_drop  (GtkWidget        *widget,
       gtk_drag_get_data (widget, context, target, time);
     }
   else
-    gtk_drag_finish (context, FALSE, time);
+    gdk_drag_finish (context, FALSE, time);
   
   return TRUE;
 }
@@ -8730,12 +8730,12 @@ gtk_entry_drag_data_received (GtkWidget        *widget,
           end_change (entry);
        }
       
-      gtk_drag_finish (context, TRUE, time);
+      gdk_drag_finish (context, TRUE, time);
     }
   else
     {
       /* Drag and drop didn't happen! */
-      gtk_drag_finish (context, FALSE, time);
+      gdk_drag_finish (context, FALSE, time);
     }
 
   g_free (str);
index 2da9fb0c3f8f0209612748dee19a11d929ac81aa..782b620e057004714ad6271f70883f3209de0f9e 100644 (file)
@@ -1255,7 +1255,7 @@ gtk_file_chooser_button_drag_data_received (GtkWidget          *widget,
       g_signal_emit (button, file_chooser_button_signals[FILE_SET], 0);
     }
 
-  gtk_drag_finish (context, TRUE, drag_time);
+  gdk_drag_finish (context, TRUE, drag_time);
 }
 
 static void
index bcd42a02b0a7f633e052d8aca4b3deb0f66346f2..f9ef4712004d089fe20f8c2636882999db0ab010 100644 (file)
@@ -6422,7 +6422,7 @@ gtk_icon_view_drag_data_received (GtkWidget        *widget,
         accepted = TRUE;
     }
 
-  gtk_drag_finish (context,
+  gdk_drag_finish (context,
                    accepted,
                    time);
 
index 1d1cda8e1f9699c1660743336638facfea1909e1..4953f33e4418dc680864f945ec2feb917ee178ff 100644 (file)
@@ -3265,10 +3265,10 @@ gtk_notebook_drag_data_received (GtkWidget        *widget,
       child = (void*) gtk_selection_data_get_data (data);
 
       do_detach_tab (GTK_NOTEBOOK (source_widget), notebook, *child);
-      gtk_drag_finish (context, TRUE, time);
+      gdk_drag_finish (context, TRUE, time);
     }
   else
-    gtk_drag_finish (context, FALSE, time);
+    gdk_drag_finish (context, FALSE, time);
 }
 
 /* Private GtkContainer Methods :
index 64e5e3c7206604e47c9ea580bbcfbce8177fc6fd..0d298cdfb23cfc47d322d90d238fe78de9accc4b 100644 (file)
@@ -2094,7 +2094,7 @@ drag_data_received_callback (GtkWidget        *list_box,
 
 out:
   sidebar->drop_occurred = FALSE;
-  gtk_drag_finish (context, success, time);
+  gdk_drag_finish (context, success, time);
   stop_drop_feedback (sidebar);
   g_free (target_uri);
 }
index 2c2e773ab78f485fd44c41e364957a09dd84253d..07f76b3926e33e42353b40e7209023aa878ff7e4 100644 (file)
@@ -7859,7 +7859,7 @@ gtk_text_view_drag_drop (GtkWidget        *widget,
   if (target != NULL)
     gtk_drag_get_data (widget, context, target, time);
   else
-    gtk_drag_finish (context, FALSE, time);
+    gdk_drag_finish (context, FALSE, time);
 
   return TRUE;
 }
@@ -7965,7 +7965,7 @@ gtk_text_view_drag_data_received (GtkWidget        *widget,
     insert_text_data (text_view, &drop_point, selection_data);
 
  done:
-  gtk_drag_finish (context, success, time);
+  gdk_drag_finish (context, success, time);
 
   if (success)
     {
index 7364a2dab09adbf9f36ea6ec94f7cf40a717a758..43a43523cb4de12824d70a245ad7166e9adf7ffa 100644 (file)
@@ -7793,7 +7793,7 @@ gtk_tree_view_drag_data_received (GtkWidget        *widget,
         accepted = TRUE;
     }
 
-  gtk_drag_finish (context, accepted, time);
+  gdk_drag_finish (context, accepted, time);
 
   if (gtk_tree_path_get_depth (dest_row) == 1 &&
       gtk_tree_path_get_indices (dest_row)[0] == 0 &&
index 69a5d2219b0bc8d54219615335809b457f9af4b9..7dbed089fbea4e55684a148dd5db1145fb1a778b 100644 (file)
@@ -1951,8 +1951,8 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * the cursor position is in a drop zone or not. If it is not in a drop
    * zone, it returns %FALSE and no further processing is necessary.
    * Otherwise, the handler returns %TRUE. In this case, the handler must
-   * ensure that gtk_drag_finish() is called to let the source know that
-   * the drop is done. The call to gtk_drag_finish() can be done either
+   * ensure that gdk_drag_finish() is called to let the source know that
+   * the drop is done. The call to gdk_drag_finish() can be done either
    * directly or in a #GtkWidget::drag-data-received handler which gets
    * triggered by calling gtk_drag_get_data() to receive the data for one
    * or more of the supported targets.
@@ -2015,15 +2015,15 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    * If the data was received in response to a #GtkWidget::drag-drop signal
    * (and this is the last target to be received), the handler for this
    * signal is expected to process the received data and then call
-   * gtk_drag_finish(), setting the @success parameter depending on
+   * gdk_drag_finish(), setting the @success parameter depending on
    * whether the data was processed successfully.
    *
    * Applications must create some means to determine why the signal was emitted 
-   * and therefore whether to call gdk_drag_status() or gtk_drag_finish(). 
+   * and therefore whether to call gdk_drag_status() or gdk_drag_finish(). 
    *
    * The handler may inspect the selected action with
    * gdk_drag_context_get_selected_action() before calling
-   * gtk_drag_finish(), e.g. to implement %GDK_ACTION_ASK as
+   * gdk_drag_finish(), e.g. to implement %GDK_ACTION_ASK as
    * shown in the following example:
    * |[<!-- language="C" -->
    * void
@@ -2062,10 +2062,10 @@ gtk_widget_class_init (GtkWidgetClass *klass)
    *             action = GDK_ACTION_COPY;
    *          }
    *
-   *       gtk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
+   *       gdk_drag_finish (context, TRUE, action == GDK_ACTION_MOVE, time);
    *     }
    *   else
-   *     gtk_drag_finish (context, FALSE, FALSE, time);
+   *     gdk_drag_finish (context, FALSE, FALSE, time);
    *  }
    * ]|
    */
index 462ef141929dd8c3d9c4137415d1232321a87c0c..a819a8f824bcaa7f2d7ee954b9a304ac3a09028c 100644 (file)
@@ -375,11 +375,11 @@ target_drag_data_received  (GtkWidget          *widget,
       gtk_selection_data_get_format (selection_data) == 8)
     {
       g_print ("Received \"%s\" in trashcan\n", (gchar *) gtk_selection_data_get_data (selection_data));
-      gtk_drag_finish (context, TRUE, time);
+      gdk_drag_finish (context, TRUE, time);
       return;
     }
   
-  gtk_drag_finish (context, FALSE, time);
+  gdk_drag_finish (context, FALSE, time);
 }
   
 void  
@@ -393,11 +393,11 @@ label_drag_data_received  (GtkWidget          *widget,
       gtk_selection_data_get_format (selection_data) == 8)
     {
       g_print ("Received \"%s\" in label\n", (gchar *) gtk_selection_data_get_data (selection_data));
-      gtk_drag_finish (context, TRUE, time);
+      gdk_drag_finish (context, TRUE, time);
       return;
     }
   
-  gtk_drag_finish (context, FALSE, time);
+  gdk_drag_finish (context, FALSE, time);
 }
 
 void