gtk/gtkdnd.c: Use accessor functions to access GtkSelectionData
This commit is contained in:
28
gtk/gtkdnd.c
28
gtk/gtkdnd.c
@ -1720,6 +1720,7 @@ gtk_drag_selection_received (GtkWidget *widget,
|
|||||||
GdkDragContext *context;
|
GdkDragContext *context;
|
||||||
GtkDragDestInfo *info;
|
GtkDragDestInfo *info;
|
||||||
GtkWidget *drop_widget;
|
GtkWidget *drop_widget;
|
||||||
|
GdkAtom target;
|
||||||
|
|
||||||
drop_widget = data;
|
drop_widget = data;
|
||||||
|
|
||||||
@ -1727,23 +1728,24 @@ gtk_drag_selection_received (GtkWidget *widget,
|
|||||||
info = gtk_drag_get_dest_info (context, FALSE);
|
info = gtk_drag_get_dest_info (context, FALSE);
|
||||||
|
|
||||||
if (info->proxy_data &&
|
if (info->proxy_data &&
|
||||||
info->proxy_data->target == selection_data->target)
|
gtk_selection_data_get_target (info->proxy_data) == gtk_selection_data_get_target (selection_data))
|
||||||
{
|
{
|
||||||
gtk_selection_data_set (info->proxy_data,
|
gtk_selection_data_set (info->proxy_data,
|
||||||
selection_data->type,
|
gtk_selection_data_get_data_type (selection_data),
|
||||||
selection_data->format,
|
gtk_selection_data_get_format (selection_data),
|
||||||
selection_data->data,
|
gtk_selection_data_get_data (selection_data),
|
||||||
selection_data->length);
|
gtk_selection_data_get_length (selection_data));
|
||||||
gtk_main_quit ();
|
gtk_main_quit ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selection_data->target == gdk_atom_intern_static_string ("DELETE"))
|
target = gtk_selection_data_get_target (selection_data);
|
||||||
|
if (target == gdk_atom_intern_static_string ("DELETE"))
|
||||||
{
|
{
|
||||||
gtk_drag_finish (context, TRUE, FALSE, time);
|
gtk_drag_finish (context, TRUE, FALSE, time);
|
||||||
}
|
}
|
||||||
else if ((selection_data->target == gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS")) ||
|
else if ((target == gdk_atom_intern_static_string ("XmTRANSFER_SUCCESS")) ||
|
||||||
(selection_data->target == gdk_atom_intern_static_string ("XmTRANSFER_FAILURE")))
|
(target == gdk_atom_intern_static_string ("XmTRANSFER_FAILURE")))
|
||||||
{
|
{
|
||||||
/* Do nothing */
|
/* Do nothing */
|
||||||
}
|
}
|
||||||
@ -1758,11 +1760,11 @@ gtk_drag_selection_received (GtkWidget *widget,
|
|||||||
guint target_info;
|
guint target_info;
|
||||||
|
|
||||||
if (gtk_target_list_find (site->target_list,
|
if (gtk_target_list_find (site->target_list,
|
||||||
selection_data->target,
|
target,
|
||||||
&target_info))
|
&target_info))
|
||||||
{
|
{
|
||||||
if (!(site->flags & GTK_DEST_DEFAULT_DROP) ||
|
if (!(site->flags & GTK_DEST_DEFAULT_DROP) ||
|
||||||
selection_data->length >= 0)
|
gtk_selection_data_get_length (selection_data) >= 0)
|
||||||
g_signal_emit_by_name (drop_widget,
|
g_signal_emit_by_name (drop_widget,
|
||||||
"drag-data-received",
|
"drag-data-received",
|
||||||
context, info->drop_x, info->drop_y,
|
context, info->drop_x, info->drop_y,
|
||||||
@ -1783,7 +1785,7 @@ gtk_drag_selection_received (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
|
|
||||||
gtk_drag_finish (context,
|
gtk_drag_finish (context,
|
||||||
(selection_data->length >= 0),
|
(gtk_selection_data_get_length (selection_data) >= 0),
|
||||||
(gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
|
(gdk_drag_context_get_selected_action (context) == GDK_ACTION_MOVE),
|
||||||
time);
|
time);
|
||||||
}
|
}
|
||||||
@ -3796,7 +3798,7 @@ gtk_drag_selection_get (GtkWidget *widget,
|
|||||||
info->proxy_dest->proxy_data = selection_data;
|
info->proxy_dest->proxy_data = selection_data;
|
||||||
gtk_drag_get_data (info->widget,
|
gtk_drag_get_data (info->widget,
|
||||||
info->proxy_dest->context,
|
info->proxy_dest->context,
|
||||||
selection_data->target,
|
gtk_selection_data_get_target (selection_data),
|
||||||
time);
|
time);
|
||||||
gtk_main ();
|
gtk_main ();
|
||||||
info->proxy_dest->proxy_data = NULL;
|
info->proxy_dest->proxy_data = NULL;
|
||||||
@ -3804,7 +3806,7 @@ gtk_drag_selection_get (GtkWidget *widget,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (gtk_target_list_find (info->target_list,
|
if (gtk_target_list_find (info->target_list,
|
||||||
selection_data->target,
|
gtk_selection_data_get_target (selection_data),
|
||||||
&target_info))
|
&target_info))
|
||||||
{
|
{
|
||||||
g_signal_emit_by_name (info->widget, "drag-data-get",
|
g_signal_emit_by_name (info->widget, "drag-data-get",
|
||||||
|
|||||||
Reference in New Issue
Block a user