mirror of https://github.com/GNOME/gimp.git
use the new dynamic GtkTargetList based API for changing the widget's drag
2004-04-15 Michael Natterer <mitch@gimp.org> * app/widgets/gimpdnd.c (gimp_dnd_data_source_add) (gimp_dnd_data_source_remove): use the new dynamic GtkTargetList based API for changing the widget's drag source types. * app/widgets/gimpdocumentview.c (gimp_document_view_new): simply call gimp_dnd_file_source_add() instead of duplicating the whole GtkTargetEntry array insanity just for adding one source type.
This commit is contained in:
parent
d5cf690a05
commit
957190d750
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
||||||
|
2004-04-15 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimpdnd.c (gimp_dnd_data_source_add)
|
||||||
|
(gimp_dnd_data_source_remove): use the new dynamic GtkTargetList
|
||||||
|
based API for changing the widget's drag source types.
|
||||||
|
|
||||||
|
* app/widgets/gimpdocumentview.c (gimp_document_view_new): simply
|
||||||
|
call gimp_dnd_file_source_add() instead of duplicating the whole
|
||||||
|
GtkTargetEntry array insanity just for adding one source type.
|
||||||
|
|
||||||
2004-04-15 Michael Natterer <mitch@gimp.org>
|
2004-04-15 Michael Natterer <mitch@gimp.org>
|
||||||
|
|
||||||
* plug-ins/FractalExplorer/Dialogs.c
|
* plug-ins/FractalExplorer/Dialogs.c
|
||||||
|
|
|
@ -768,6 +768,7 @@ gimp_dnd_data_source_add (GimpDndType data_type,
|
||||||
gpointer get_data_data)
|
gpointer get_data_data)
|
||||||
{
|
{
|
||||||
GimpDndDataDef *dnd_data;
|
GimpDndDataDef *dnd_data;
|
||||||
|
GtkTargetList *target_list;
|
||||||
gboolean drag_connected;
|
gboolean drag_connected;
|
||||||
|
|
||||||
dnd_data = dnd_data_defs + data_type;
|
dnd_data = dnd_data_defs + data_type;
|
||||||
|
@ -808,10 +809,6 @@ gimp_dnd_data_source_add (GimpDndType data_type,
|
||||||
g_object_set_data (G_OBJECT (widget), "gimp-dnd-get-data-type",
|
g_object_set_data (G_OBJECT (widget), "gimp-dnd-get-data-type",
|
||||||
GINT_TO_POINTER (data_type));
|
GINT_TO_POINTER (data_type));
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#warning FIXME: missing GTK+ dnd API
|
|
||||||
#endif
|
|
||||||
#if 0
|
|
||||||
target_list = gtk_drag_source_get_target_list (widget);
|
target_list = gtk_drag_source_get_target_list (widget);
|
||||||
|
|
||||||
if (target_list)
|
if (target_list)
|
||||||
|
@ -825,7 +822,6 @@ gimp_dnd_data_source_add (GimpDndType data_type,
|
||||||
gtk_drag_source_set_target_list (widget, target_list);
|
gtk_drag_source_set_target_list (widget, target_list);
|
||||||
gtk_target_list_unref (target_list);
|
gtk_target_list_unref (target_list);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -833,6 +829,7 @@ gimp_dnd_data_source_remove (GimpDndType data_type,
|
||||||
GtkWidget *widget)
|
GtkWidget *widget)
|
||||||
{
|
{
|
||||||
GimpDndDataDef *dnd_data;
|
GimpDndDataDef *dnd_data;
|
||||||
|
GtkTargetList *target_list;
|
||||||
gboolean drag_connected;
|
gboolean drag_connected;
|
||||||
|
|
||||||
drag_connected =
|
drag_connected =
|
||||||
|
@ -853,10 +850,6 @@ gimp_dnd_data_source_remove (GimpDndType data_type,
|
||||||
"gimp-dnd-get-data-type")))
|
"gimp-dnd-get-data-type")))
|
||||||
g_object_set_data (G_OBJECT (widget), "gimp-dnd-get-data-type", NULL);
|
g_object_set_data (G_OBJECT (widget), "gimp-dnd-get-data-type", NULL);
|
||||||
|
|
||||||
#ifdef __GNUC__
|
|
||||||
#warning FIXME: missing GTK+ dnd API
|
|
||||||
#endif
|
|
||||||
#if 0
|
|
||||||
target_list = gtk_drag_source_get_target_list (widget);
|
target_list = gtk_drag_source_get_target_list (widget);
|
||||||
|
|
||||||
if (target_list)
|
if (target_list)
|
||||||
|
@ -868,7 +861,6 @@ gimp_dnd_data_source_remove (GimpDndType data_type,
|
||||||
if (atom != GDK_NONE)
|
if (atom != GDK_NONE)
|
||||||
gtk_target_list_remove (target_list, atom);
|
gtk_target_list_remove (target_list, atom);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -218,22 +218,9 @@ gimp_document_view_new (GimpViewType view_type,
|
||||||
GIMP_TYPE_IMAGEFILE);
|
GIMP_TYPE_IMAGEFILE);
|
||||||
|
|
||||||
if (view_type == GIMP_VIEW_TYPE_LIST)
|
if (view_type == GIMP_VIEW_TYPE_LIST)
|
||||||
{
|
|
||||||
static const GtkTargetEntry document_view_target_entries[] =
|
|
||||||
{
|
|
||||||
GIMP_TARGET_IMAGEFILE,
|
|
||||||
GIMP_TARGET_URI_LIST
|
|
||||||
};
|
|
||||||
|
|
||||||
gtk_drag_source_set (editor->view->dnd_widget,
|
|
||||||
GDK_BUTTON1_MASK | GDK_BUTTON2_MASK,
|
|
||||||
document_view_target_entries,
|
|
||||||
G_N_ELEMENTS (document_view_target_entries),
|
|
||||||
GDK_ACTION_COPY | GDK_ACTION_MOVE);
|
|
||||||
gimp_dnd_file_source_add (editor->view->dnd_widget,
|
gimp_dnd_file_source_add (editor->view->dnd_widget,
|
||||||
gimp_document_view_drag_file,
|
gimp_document_view_drag_file,
|
||||||
editor);
|
editor);
|
||||||
}
|
|
||||||
|
|
||||||
return GTK_WIDGET (document_view);
|
return GTK_WIDGET (document_view);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue