dnd: Rename gtk_drag_begin_with_coordinates

Now that the coordiate-less variant is gone,
rename this back to the shorter gtk_drag_begin.
This commit is contained in:
Matthias Clasen 2018-07-03 20:37:31 +02:00
parent 7030e08f9c
commit b94c3166bf
11 changed files with 67 additions and 69 deletions

View File

@ -5012,6 +5012,7 @@ gtk_selection_data_get_type
<TITLE>Drag and Drop</TITLE>
GtkDestDefaults
GtkDragResult
<SUBSECTION Destination Side>
gtk_drag_dest_set
gtk_drag_dest_unset
@ -5027,8 +5028,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

View File

@ -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);

View File

@ -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.

View File

@ -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);

View File

@ -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;

View File

@ -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);

View File

@ -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;

View File

@ -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;
}

View File

@ -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);

View File

@ -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

View File

@ -7385,11 +7385,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);