forked from AuroraMiddleware/gtk
dnd: Get rid of gtk_drag_finish()
It's just a wrapper around gdk_drag_finish(), so use that one instead.
This commit is contained in:
parent
13ae11ee01
commit
5b0a6a52c1
@ -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
|
||||
|
@ -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));
|
||||
|
23
gtk/gtkdnd.c
23
gtk/gtkdnd.c
@ -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
|
||||
|
@ -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);
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -6422,7 +6422,7 @@ gtk_icon_view_drag_data_received (GtkWidget *widget,
|
||||
accepted = TRUE;
|
||||
}
|
||||
|
||||
gtk_drag_finish (context,
|
||||
gdk_drag_finish (context,
|
||||
accepted,
|
||||
time);
|
||||
|
||||
|
@ -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 :
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -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 &&
|
||||
|
@ -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);
|
||||
* }
|
||||
* ]|
|
||||
*/
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user