From 5c466a9f39ea04f7ab8940519d9e2d44d1a04d04 Mon Sep 17 00:00:00 2001 From: Murray Cumming Date: Tue, 14 Jan 2003 22:57:37 +0000 Subject: [PATCH] Fixes #102168. 2002-12-29 Murray Cumming Fixes #102168. * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: Actually implement the GtkTreeDragSource::row_draggable virtual function in GtkListStore and GtkTreeStore instead of just checking whether it's implemented at all. This means that DnD isn't broken by gtkmm's virtual function wrappers. The alternative would be to hard-code the TRUE return value into gtkmm's wrappers, but that's part of GTK+'s implementation, not it's API. --- ChangeLog | 12 ++++++++++++ ChangeLog.pre-2-10 | 12 ++++++++++++ ChangeLog.pre-2-4 | 12 ++++++++++++ ChangeLog.pre-2-6 | 12 ++++++++++++ ChangeLog.pre-2-8 | 12 ++++++++++++ gtk/gtkliststore.c | 9 +++++++++ gtk/gtktreednd.c | 3 +++ gtk/gtktreestore.c | 9 +++++++++ 8 files changed, 81 insertions(+) diff --git a/ChangeLog b/ChangeLog index f28106e3d5..d6e80395da 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-12-29 Murray Cumming + + Fixes #102168. + + * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: + Actually implement the GtkTreeDragSource::row_draggable virtual + function in GtkListStore and GtkTreeStore instead of just checking + whether it's implemented at all. This means that DnD isn't broken by + gtkmm's virtual function wrappers. The alternative would be to + hard-code the TRUE return value into gtkmm's wrappers, but that's + part of GTK+'s implementation, not it's API. + Tue Jan 14 23:42:29 2002 Kristian Rietveld * gtk/gtktreeview.c: fix compiler warning. diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index f28106e3d5..d6e80395da 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,15 @@ +2002-12-29 Murray Cumming + + Fixes #102168. + + * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: + Actually implement the GtkTreeDragSource::row_draggable virtual + function in GtkListStore and GtkTreeStore instead of just checking + whether it's implemented at all. This means that DnD isn't broken by + gtkmm's virtual function wrappers. The alternative would be to + hard-code the TRUE return value into gtkmm's wrappers, but that's + part of GTK+'s implementation, not it's API. + Tue Jan 14 23:42:29 2002 Kristian Rietveld * gtk/gtktreeview.c: fix compiler warning. diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index f28106e3d5..d6e80395da 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,15 @@ +2002-12-29 Murray Cumming + + Fixes #102168. + + * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: + Actually implement the GtkTreeDragSource::row_draggable virtual + function in GtkListStore and GtkTreeStore instead of just checking + whether it's implemented at all. This means that DnD isn't broken by + gtkmm's virtual function wrappers. The alternative would be to + hard-code the TRUE return value into gtkmm's wrappers, but that's + part of GTK+'s implementation, not it's API. + Tue Jan 14 23:42:29 2002 Kristian Rietveld * gtk/gtktreeview.c: fix compiler warning. diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index f28106e3d5..d6e80395da 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,15 @@ +2002-12-29 Murray Cumming + + Fixes #102168. + + * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: + Actually implement the GtkTreeDragSource::row_draggable virtual + function in GtkListStore and GtkTreeStore instead of just checking + whether it's implemented at all. This means that DnD isn't broken by + gtkmm's virtual function wrappers. The alternative would be to + hard-code the TRUE return value into gtkmm's wrappers, but that's + part of GTK+'s implementation, not it's API. + Tue Jan 14 23:42:29 2002 Kristian Rietveld * gtk/gtktreeview.c: fix compiler warning. diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index f28106e3d5..d6e80395da 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,15 @@ +2002-12-29 Murray Cumming + + Fixes #102168. + + * gtk/gtkliststore.c, gtktreednd.c, gtktreestore.c: + Actually implement the GtkTreeDragSource::row_draggable virtual + function in GtkListStore and GtkTreeStore instead of just checking + whether it's implemented at all. This means that DnD isn't broken by + gtkmm's virtual function wrappers. The alternative would be to + hard-code the TRUE return value into gtkmm's wrappers, but that's + part of GTK+'s implementation, not it's API. + Tue Jan 14 23:42:29 2002 Kristian Rietveld * gtk/gtktreeview.c: fix compiler warning. diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index 4fe7fa1fec..c23abfe663 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -74,6 +74,8 @@ static void gtk_list_store_set_column_type (GtkListStore *list_store, /* Drag and Drop */ +static gboolean real_gtk_list_store_row_draggable (GtkTreeDragSource *drag_source, + GtkTreePath *path); static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *path); static gboolean gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source, @@ -228,6 +230,7 @@ gtk_list_store_tree_model_init (GtkTreeModelIface *iface) static void gtk_list_store_drag_source_init (GtkTreeDragSourceIface *iface) { + iface->row_draggable = real_gtk_list_store_row_draggable; iface->drag_data_delete = gtk_list_store_drag_data_delete; iface->drag_data_get = gtk_list_store_drag_data_get; } @@ -1400,6 +1403,12 @@ gtk_list_store_iter_is_valid (GtkListStore *list_store, return FALSE; } +static gboolean real_gtk_list_store_row_draggable (GtkTreeDragSource *drag_source, + GtkTreePath *path) +{ + return TRUE; +} + static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *path) diff --git a/gtk/gtktreednd.c b/gtk/gtktreednd.c index 09718a799b..7d9c13677e 100644 --- a/gtk/gtktreednd.c +++ b/gtk/gtktreednd.c @@ -97,6 +97,9 @@ gtk_tree_drag_source_row_draggable (GtkTreeDragSource *drag_source, return (* iface->row_draggable) (drag_source, path); else return TRUE; + /* Returning TRUE if row_draggable is not implemented is a fallback. + Interface implementations such as GtkTreeStore and GtkListStore really should + implement row_draggable. */ } diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 33190f2b7a..be3a15af05 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -74,6 +74,8 @@ static void gtk_tree_store_set_column_type (GtkTreeStore *tree_store, /* DND interfaces */ +static gboolean real_gtk_tree_store_row_draggable (GtkTreeDragSource *drag_source, + GtkTreePath *path); static gboolean gtk_tree_store_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *path); static gboolean gtk_tree_store_drag_data_get (GtkTreeDragSource *drag_source, @@ -231,6 +233,7 @@ gtk_tree_store_tree_model_init (GtkTreeModelIface *iface) static void gtk_tree_store_drag_source_init (GtkTreeDragSourceIface *iface) { + iface->row_draggable = real_gtk_tree_store_row_draggable; iface->drag_data_delete = gtk_tree_store_drag_data_delete; iface->drag_data_get = gtk_tree_store_drag_data_get; } @@ -1561,6 +1564,12 @@ gtk_tree_store_iter_is_valid (GtkTreeStore *tree_store, /* DND */ +static gboolean real_gtk_tree_store_row_draggable (GtkTreeDragSource *drag_source, + GtkTreePath *path) +{ + return TRUE; +} + static gboolean gtk_tree_store_drag_data_delete (GtkTreeDragSource *drag_source, GtkTreePath *path)