mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 02:40:11 +00:00
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:
parent
7030e08f9c
commit
b94c3166bf
@ -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
|
||||
|
@ -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);
|
||||
|
32
gtk/gtkdnd.c
32
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.
|
||||
|
12
gtk/gtkdnd.h
12
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);
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user