[gtk/dnd-cleanups] dnd: Rename gtk_drag_begin_with_coordinates



commit 752cd0808451d93033ec8bb83eff72beb1c44672
Author: Matthias Clasen <mclasen redhat com>
Date:   Tue Jul 3 20:37:31 2018 +0200

    dnd: Rename gtk_drag_begin_with_coordinates
    
    Now that the coordiate-less variant is gone,
    rename this back to the shorter gtk_drag_begin.

 docs/reference/gtk/gtk4-sections.txt |  4 +++-
 gtk/gtkcalendar.c                    |  8 ++++----
 gtk/gtkdnd.c                         | 32 ++++++++++++++------------------
 gtk/gtkdnd.h                         | 12 ++++++------
 gtk/gtkentry.c                       | 20 ++++++++++----------
 gtk/gtkiconview.c                    | 12 ++++++------
 gtk/gtklabel.c                       | 12 ++++++------
 gtk/gtknotebook.c                    |  8 ++++----
 gtk/gtkplacessidebar.c               |  8 ++++----
 gtk/gtktextview.c                    | 10 +++++-----
 gtk/gtktreeview.c                    | 10 +++++-----
 11 files changed, 67 insertions(+), 69 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 3ed1105e33..dcd80317fc 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -5013,6 +5013,7 @@ gtk_selection_data_get_type
 <TITLE>Drag and Drop</TITLE>
 GtkDestDefaults
 GtkDragResult
+
 <SUBSECTION Destination Side>
 gtk_drag_dest_set
 gtk_drag_dest_unset
@@ -5028,8 +5029,9 @@ gtk_drag_get_data
 gtk_drag_get_source_widget
 gtk_drag_highlight
 gtk_drag_unhighlight
+
 <SUBSECTION Source Side>
-gtk_drag_begin_with_coordinates
+gtk_drag_begin
 gtk_drag_cancel
 gtk_drag_set_icon_widget
 gtk_drag_set_icon_paintable
diff --git a/gtk/gtkcalendar.c b/gtk/gtkcalendar.c
index 9273969028..643b86e5b9 100644
--- a/gtk/gtkcalendar.c
+++ b/gtk/gtkcalendar.c
@@ -2675,10 +2675,10 @@ gtk_calendar_drag_update (GtkGestureDrag *gesture,
 
   targets = gdk_content_formats_new (NULL, 0);
   targets = gtk_content_formats_add_text_targets (targets);
-  drag = gtk_drag_begin_with_coordinates (widget,
-                                          gtk_gesture_get_device (GTK_GESTURE (gesture)),
-                                          targets, GDK_ACTION_COPY,
-                                          start_x, start_y);
+  drag = gtk_drag_begin (widget,
+                         gtk_gesture_get_device (GTK_GESTURE (gesture)),
+                         targets, GDK_ACTION_COPY,
+                         start_x, start_y);
 
   priv->in_drag = 0;
   gdk_content_formats_unref (targets);
diff --git a/gtk/gtkdnd.c b/gtk/gtkdnd.c
index f00a213da7..25cc9e659d 100644
--- a/gtk/gtkdnd.c
+++ b/gtk/gtkdnd.c
@@ -961,17 +961,13 @@ gtk_drag_begin_internal (GtkWidget          *widget,
 }
 
 /**
- * gtk_drag_begin_with_coordinates: (method)
+ * gtk_drag_begin: (method)
  * @widget: the source widget
- * @device: (nullable): the device that starts the drag or %NULL to use the default
- *    pointer.
- * @targets: The targets (data formats) in which the
- *    source can provide the data
+ * @device: (nullable): the device that starts the drag or %NULL to use the default pointer
+ * @targets: The targets (data formats) in which the source can provide the data
  * @actions: A bitmask of the allowed drag actions for this drag
- * @x: The initial x coordinate to start dragging from, in the coordinate space
- *    of @widget.
- * @y: The initial y coordinate to start dragging from, in the coordinate space
- *    of @widget.
+ * @x: The initial x coordinate to start dragging from, in the coordinate space of @widget.
+ * @y: The initial y coordinate to start dragging from, in the coordinate space of @widget.
  *
  * Initiates a drag on the source side. The function only needs to be used
  * when the application is starting drags itself, and is not needed when
@@ -980,12 +976,12 @@ gtk_drag_begin_internal (GtkWidget          *widget,
  * Returns: (transfer none): the context for this drag
  */
 GdkDrag *
-gtk_drag_begin_with_coordinates (GtkWidget         *widget,
-                                 GdkDevice         *device,
-                                 GdkContentFormats *targets,
-                                 GdkDragAction      actions,
-                                 gint               x,
-                                 gint               y)
+gtk_drag_begin (GtkWidget         *widget,
+                GdkDevice         *device,
+                GdkContentFormats *targets,
+                GdkDragAction      actions,
+                gint               x,
+                gint               y)
 {
   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
   g_return_val_if_fail (device == NULL || GDK_IS_DEVICE (device), NULL);
@@ -1411,14 +1407,14 @@ gtk_drag_check_threshold (GtkWidget *widget,
 
 /**
  * gtk_drag_cancel:
- * @drag: a drag context, as e.g. returned by gtk_drag_begin_with_coordinates()
+ * @drag: a drag context, as e.g. returned by gtk_drag_begin()
  *
  * Cancels an ongoing drag operation on the source side.
  *
  * If you want to be able to cancel a drag operation in this way,
  * you need to keep a pointer to the drag context, either from an
- * explicit call to gtk_drag_begin_with_coordinates(), or by
- * connecting to #GtkWidget::drag-begin.
+ * explicit call to gtk_drag_begin(), or by connecting to
+ * #GtkWidget::drag-begin.
  *
  * If @context does not refer to an ongoing drag operation, this
  * function does nothing.
diff --git a/gtk/gtkdnd.h b/gtk/gtkdnd.h
index 2db8978c24..2c81f9d689 100644
--- a/gtk/gtkdnd.h
+++ b/gtk/gtkdnd.h
@@ -55,12 +55,12 @@ void gtk_drag_unhighlight (GtkWidget  *widget);
 /* Source side */
 
 GDK_AVAILABLE_IN_ALL
-GdkDrag *gtk_drag_begin_with_coordinates (GtkWidget         *widget,
-                                          GdkDevice         *device,
-                                          GdkContentFormats *targets,
-                                          GdkDragAction      actions,
-                                          gint               x,
-                                          gint               y);
+GdkDrag *gtk_drag_begin (GtkWidget         *widget,
+                         GdkDevice         *device,
+                         GdkContentFormats *targets,
+                         GdkDragAction      actions,
+                         gint               x,
+                         gint               y);
 
 GDK_AVAILABLE_IN_ALL
 void gtk_drag_cancel           (GdkDrag *drag);
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 8ad735129e..bbed89d601 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3029,11 +3029,11 @@ icon_drag_update_cb (GtkGestureDrag *gesture,
                                 x, y))
     {
       icon_info->in_drag = TRUE;
-      gtk_drag_begin_with_coordinates (GTK_WIDGET (entry),
-                                       gtk_gesture_get_device (GTK_GESTURE (gesture)),
-                                       icon_info->target_list,
-                                       icon_info->actions,
-                                       start_x, start_y);
+      gtk_drag_begin (GTK_WIDGET (entry),
+                      gtk_gesture_get_device (GTK_GESTURE (gesture)),
+                      icon_info->target_list,
+                      icon_info->actions,
+                      start_x, start_y);
     }
 }
 
@@ -3893,11 +3893,11 @@ gtk_entry_drag_gesture_update (GtkGestureDrag *gesture,
 
           gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
 
-          gtk_drag_begin_with_coordinates (widget,
-                                           gdk_event_get_device ((GdkEvent*) event),
-                                           target_list, actions,
-                                           priv->drag_start_x + ranges[0],
-                                           priv->drag_start_y);
+          gtk_drag_begin (widget,
+                          gdk_event_get_device ((GdkEvent*) event),
+                          target_list, actions,
+                          priv->drag_start_x + ranges[0],
+                          priv->drag_start_y);
           g_free (ranges);
 
           priv->in_drag = FALSE;
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index 680ddb61de..160bd6b2c8 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -6064,12 +6064,12 @@ gtk_icon_view_maybe_begin_drag (GtkIconView *icon_view,
 
   retval = TRUE;
 
-  drag = gtk_drag_begin_with_coordinates (widget,
-                                          device,
-                                          gtk_drag_source_get_target_list (widget),
-                                          icon_view->priv->source_actions,
-                                          icon_view->priv->press_start_x,
-                                          icon_view->priv->press_start_y);
+  drag = gtk_drag_begin (widget,
+                         device,
+                         gtk_drag_source_get_target_list (widget),
+                         icon_view->priv->source_actions,
+                         icon_view->priv->press_start_x,
+                         icon_view->priv->press_start_y);
 
   set_source_row (drag, model, path);
 
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 86661a8d36..967e4f46ab 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -4722,12 +4722,12 @@ gtk_label_drag_gesture_update (GtkGestureDrag *gesture,
 
           g_signal_connect (widget, "drag-begin",
                             G_CALLBACK (drag_begin_cb), NULL);
-         gtk_drag_begin_with_coordinates (widget,
-                                           gtk_gesture_get_device (GTK_GESTURE (gesture)),
-                                           target_list,
-                                           GDK_ACTION_COPY,
-                                           info->drag_start_x,
-                                           info->drag_start_y);
+         gtk_drag_begin (widget,
+                          gtk_gesture_get_device (GTK_GESTURE (gesture)),
+                          target_list,
+                          GDK_ACTION_COPY,
+                          info->drag_start_x,
+                          info->drag_start_y);
 
          info->in_drag = FALSE;
 
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index c371de0128..6ea21028b1 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -2654,10 +2654,10 @@ gtk_notebook_motion (GtkEventController *controller,
     {
       priv->detached_tab = priv->cur_page;
 
-      gtk_drag_begin_with_coordinates (widget,
-                                       gtk_get_current_event_device (),
-                                       priv->source_targets, GDK_ACTION_MOVE,
-                                       priv->drag_begin_x, priv->drag_begin_y);
+      gtk_drag_begin (widget,
+                      gtk_get_current_event_device (),
+                      priv->source_targets, GDK_ACTION_MOVE,
+                      priv->drag_begin_x, priv->drag_begin_y);
       return;
     }
 
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 5ec8408ee9..090d1d0aa7 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -3793,10 +3793,10 @@ on_row_dragged (GtkGestureDrag *gesture,
 
       sidebar->dragging_over = TRUE;
 
-      gtk_drag_begin_with_coordinates (GTK_WIDGET (sidebar),
-                                       gtk_gesture_get_device (GTK_GESTURE (gesture)),
-                                       sidebar->source_targets, GDK_ACTION_MOVE,
-                                       drag_x, drag_y);
+      gtk_drag_begin (GTK_WIDGET (sidebar),
+                      gtk_gesture_get_device (GTK_GESTURE (gesture)),
+                      sidebar->source_targets, GDK_ACTION_MOVE,
+                      drag_x, drag_y);
     }
 
   g_object_unref (sidebar);
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 1c6aa8f2db..e7440badb0 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -7623,11 +7623,11 @@ gtk_text_view_start_selection_dnd (GtkTextView       *text_view,
 
   g_signal_connect (text_view, "drag-begin",
                     G_CALLBACK (drag_begin_cb), NULL);
-  gtk_drag_begin_with_coordinates (GTK_WIDGET (text_view),
-                                   gdk_event_get_device (event),
-                                   formats,
-                                   GDK_ACTION_COPY | GDK_ACTION_MOVE,
-                                   x, y);
+  gtk_drag_begin (GTK_WIDGET (text_view),
+                  gdk_event_get_device (event),
+                  formats,
+                  GDK_ACTION_COPY | GDK_ACTION_MOVE,
+                  x, y);
 }
 
 static void
diff --git a/gtk/gtktreeview.c b/gtk/gtktreeview.c
index 95a96a111e..6ca4cc829c 100644
--- a/gtk/gtktreeview.c
+++ b/gtk/gtktreeview.c
@@ -7361,11 +7361,11 @@ gtk_tree_view_maybe_begin_dragging_row (GtkTreeView *tree_view)
   gtk_gesture_set_state (GTK_GESTURE (tree_view->priv->drag_gesture),
                          GTK_EVENT_SEQUENCE_CLAIMED);
 
-  drag = gtk_drag_begin_with_coordinates (widget,
-                                          gtk_gesture_get_device (GTK_GESTURE 
(tree_view->priv->drag_gesture)),
-                                          gtk_drag_source_get_target_list (widget),
-                                          di->source_actions,
-                                          start_x, start_y);
+  drag = gtk_drag_begin (widget,
+                         gtk_gesture_get_device (GTK_GESTURE (tree_view->priv->drag_gesture)),
+                         gtk_drag_source_get_target_list (widget),
+                         di->source_actions,
+                         start_x, start_y);
 
   set_source_row (drag, model, path);
 


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