2 * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
21 #include "gtktreemodel.h"
22 #include "gtkliststore.h"
23 #include "gtktreedatalist.h"
24 #include "gtksignal.h"
25 #include "gtktreednd.h"
26 #include <gobject/gvaluecollector.h>
28 #define G_SLIST(x) ((GSList *) x)
38 static guint list_store_signals[LAST_SIGNAL] = { 0 };
40 static void gtk_list_store_init (GtkListStore *list_store);
41 static void gtk_list_store_class_init (GtkListStoreClass *class);
42 static void gtk_list_store_tree_model_init (GtkTreeModelIface *iface);
43 static void gtk_list_store_drag_source_init(GtkTreeDragSourceIface *iface);
44 static void gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface);
45 static guint gtk_list_store_get_flags (GtkTreeModel *tree_model);
46 static gint gtk_list_store_get_n_columns (GtkTreeModel *tree_model);
47 static GType gtk_list_store_get_column_type (GtkTreeModel *tree_model,
49 static gboolean gtk_list_store_get_iter (GtkTreeModel *tree_model,
52 static GtkTreePath *gtk_list_store_get_path (GtkTreeModel *tree_model,
54 static void gtk_list_store_get_value (GtkTreeModel *tree_model,
58 static gboolean gtk_list_store_iter_next (GtkTreeModel *tree_model,
60 static gboolean gtk_list_store_iter_children (GtkTreeModel *tree_model,
63 static gboolean gtk_list_store_iter_has_child (GtkTreeModel *tree_model,
65 static gint gtk_list_store_iter_n_children (GtkTreeModel *tree_model,
67 static gboolean gtk_list_store_iter_nth_child (GtkTreeModel *tree_model,
71 static gboolean gtk_list_store_iter_parent (GtkTreeModel *tree_model,
75 static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
77 static gboolean gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source,
79 GtkSelectionData *selection_data);
80 static gboolean gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest,
82 GtkSelectionData *selection_data);
86 gtk_list_store_get_type (void)
88 static GtkType list_store_type = 0;
92 static const GTypeInfo list_store_info =
94 sizeof (GtkListStoreClass),
96 NULL, /* base_finalize */
97 (GClassInitFunc) gtk_list_store_class_init,
98 NULL, /* class_finalize */
99 NULL, /* class_data */
100 sizeof (GtkListStore),
102 (GInstanceInitFunc) gtk_list_store_init,
105 static const GInterfaceInfo tree_model_info =
107 (GInterfaceInitFunc) gtk_list_store_tree_model_init,
112 static const GInterfaceInfo drag_source_info =
114 (GInterfaceInitFunc) gtk_list_store_drag_source_init,
119 static const GInterfaceInfo drag_dest_info =
121 (GInterfaceInitFunc) gtk_list_store_drag_dest_init,
126 list_store_type = g_type_register_static (GTK_TYPE_OBJECT, "GtkListStore", &list_store_info, 0);
127 g_type_add_interface_static (list_store_type,
130 g_type_add_interface_static (list_store_type,
131 GTK_TYPE_TREE_DRAG_SOURCE,
133 g_type_add_interface_static (list_store_type,
134 GTK_TYPE_TREE_DRAG_DEST,
138 return list_store_type;
142 gtk_list_store_class_init (GtkListStoreClass *class)
144 GtkObjectClass *object_class;
146 object_class = (GtkObjectClass*) class;
148 list_store_signals[CHANGED] =
149 gtk_signal_new ("changed",
151 GTK_CLASS_TYPE (object_class),
152 GTK_SIGNAL_OFFSET (GtkListStoreClass, changed),
153 gtk_marshal_VOID__BOXED_BOXED,
157 list_store_signals[INSERTED] =
158 gtk_signal_new ("inserted",
160 GTK_CLASS_TYPE (object_class),
161 GTK_SIGNAL_OFFSET (GtkListStoreClass, inserted),
162 gtk_marshal_VOID__BOXED_BOXED,
166 list_store_signals[CHILD_TOGGLED] =
167 gtk_signal_new ("child_toggled",
169 GTK_CLASS_TYPE (object_class),
170 GTK_SIGNAL_OFFSET (GtkListStoreClass, child_toggled),
171 gtk_marshal_VOID__BOXED_BOXED,
175 list_store_signals[DELETED] =
176 gtk_signal_new ("deleted",
178 GTK_CLASS_TYPE (object_class),
179 GTK_SIGNAL_OFFSET (GtkListStoreClass, deleted),
180 gtk_marshal_VOID__BOXED,
186 gtk_list_store_tree_model_init (GtkTreeModelIface *iface)
188 iface->get_flags = gtk_list_store_get_flags;
189 iface->get_n_columns = gtk_list_store_get_n_columns;
190 iface->get_column_type = gtk_list_store_get_column_type;
191 iface->get_iter = gtk_list_store_get_iter;
192 iface->get_path = gtk_list_store_get_path;
193 iface->get_value = gtk_list_store_get_value;
194 iface->iter_next = gtk_list_store_iter_next;
195 iface->iter_children = gtk_list_store_iter_children;
196 iface->iter_has_child = gtk_list_store_iter_has_child;
197 iface->iter_n_children = gtk_list_store_iter_n_children;
198 iface->iter_nth_child = gtk_list_store_iter_nth_child;
199 iface->iter_parent = gtk_list_store_iter_parent;
203 gtk_list_store_drag_source_init (GtkTreeDragSourceIface *iface)
205 iface->drag_data_delete = gtk_list_store_drag_data_delete;
206 iface->drag_data_get = gtk_list_store_drag_data_get;
210 gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface)
212 iface->drag_data_received = gtk_list_store_drag_data_received;
216 gtk_list_store_init (GtkListStore *list_store)
218 list_store->root = NULL;
219 list_store->tail = NULL;
220 list_store->stamp = g_random_int ();
224 gtk_list_store_new (void)
226 return GTK_LIST_STORE (gtk_type_new (gtk_list_store_get_type ()));
230 gtk_list_store_new_with_types (gint n_columns,
233 GtkListStore *retval;
237 g_return_val_if_fail (n_columns > 0, NULL);
239 retval = gtk_list_store_new ();
240 gtk_list_store_set_n_columns (retval, n_columns);
242 va_start (args, n_columns);
244 for (i = 0; i < n_columns; i++)
245 gtk_list_store_set_column_type (retval, i, va_arg (args, GType));
253 gtk_list_store_set_n_columns (GtkListStore *list_store,
258 g_return_if_fail (list_store != NULL);
259 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
260 g_return_if_fail (n_columns > 0);
262 if (list_store->n_columns == n_columns)
265 new_columns = g_new0 (GType, n_columns);
266 if (list_store->column_headers)
268 /* copy the old header orders over */
269 if (n_columns >= list_store->n_columns)
270 memcpy (new_columns, list_store->column_headers, list_store->n_columns * sizeof (gchar *));
272 memcpy (new_columns, list_store->column_headers, n_columns * sizeof (GType));
274 g_free (list_store->column_headers);
277 list_store->column_headers = new_columns;
278 list_store->n_columns = n_columns;
282 gtk_list_store_set_column_type (GtkListStore *list_store,
286 g_return_if_fail (list_store != NULL);
287 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
288 g_return_if_fail (column >=0 && column < list_store->n_columns);
290 list_store->column_headers[column] = type;
293 /* Fulfill the GtkTreeModel requirements */
295 gtk_list_store_get_flags (GtkTreeModel *tree_model)
297 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), 0);
299 return GTK_TREE_MODEL_ITERS_PERSIST;
303 gtk_list_store_get_n_columns (GtkTreeModel *tree_model)
305 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), 0);
307 return GTK_LIST_STORE (tree_model)->n_columns;
311 gtk_list_store_get_column_type (GtkTreeModel *tree_model,
314 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), G_TYPE_INVALID);
315 g_return_val_if_fail (index < GTK_LIST_STORE (tree_model)->n_columns &&
316 index >= 0, G_TYPE_INVALID);
318 return GTK_LIST_STORE (tree_model)->column_headers[index];
322 gtk_list_store_get_iter (GtkTreeModel *tree_model,
326 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), FALSE);
327 g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
329 iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
330 iter->user_data = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root),
331 gtk_tree_path_get_indices (path)[0]);
333 return iter->user_data != NULL;
337 gtk_list_store_get_path (GtkTreeModel *tree_model,
344 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), NULL);
345 g_return_val_if_fail (iter->stamp == GTK_LIST_STORE (tree_model)->stamp, NULL);
347 for (list = G_SLIST (GTK_LIST_STORE (tree_model)->root); list; list = list->next)
349 if (list == G_SLIST (iter->user_data))
356 retval = gtk_tree_path_new ();
357 gtk_tree_path_append_index (retval, i);
362 gtk_list_store_get_value (GtkTreeModel *tree_model,
367 GtkTreeDataList *list;
368 gint tmp_column = column;
370 g_return_if_fail (GTK_IS_LIST_STORE (tree_model));
371 g_return_if_fail (column < GTK_LIST_STORE (tree_model)->n_columns);
372 g_return_if_fail (GTK_LIST_STORE (tree_model)->stamp == iter->stamp);
374 list = G_SLIST (iter->user_data)->data;
376 while (tmp_column-- > 0 && list)
380 g_value_init (value, GTK_LIST_STORE (tree_model)->column_headers[column]);
382 _gtk_tree_data_list_node_to_value (list,
383 GTK_LIST_STORE (tree_model)->column_headers[column],
388 gtk_list_store_iter_next (GtkTreeModel *tree_model,
391 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), FALSE);
392 g_return_val_if_fail (GTK_LIST_STORE (tree_model)->stamp == iter->stamp, FALSE);
394 iter->user_data = G_SLIST (iter->user_data)->next;
396 return (iter->user_data != NULL);
400 gtk_list_store_iter_children (GtkTreeModel *tree_model,
407 iter->user_data = NULL;
412 iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
413 iter->user_data = GTK_LIST_STORE (tree_model)->root;
419 gtk_list_store_iter_has_child (GtkTreeModel *tree_model,
426 gtk_list_store_iter_n_children (GtkTreeModel *tree_model,
430 return g_slist_length (G_SLIST (GTK_LIST_STORE (tree_model)->root));
436 gtk_list_store_iter_nth_child (GtkTreeModel *tree_model,
441 g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), FALSE);
445 g_return_val_if_fail (iter->stamp == GTK_LIST_STORE (tree_model)->stamp, FALSE);
447 iter->user_data = NULL;
452 iter->user_data = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root), n);
454 iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
458 return (iter->user_data != NULL);
462 gtk_list_store_iter_parent (GtkTreeModel *tree_model,
467 iter->user_data = NULL;
472 /* Public accessors */
473 /* This is a somewhat inelegant function that does a lot of list
474 * manipulations on it's own.
477 gtk_list_store_set_cell (GtkListStore *list_store,
482 GtkTreeDataList *list;
483 GtkTreeDataList *prev;
485 g_return_if_fail (list_store != NULL);
486 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
487 g_return_if_fail (iter != NULL);
488 g_return_if_fail (column >= 0 && column < list_store->n_columns);
490 prev = list = G_SLIST (iter->user_data)->data;
496 _gtk_tree_data_list_value_to_node (list, value);
497 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
508 if (G_SLIST (iter->user_data)->data == NULL)
510 G_SLIST (iter->user_data)->data = list = _gtk_tree_data_list_alloc ();
515 list = prev->next = _gtk_tree_data_list_alloc ();
521 list->next = _gtk_tree_data_list_alloc ();
526 _gtk_tree_data_list_value_to_node (list, value);
527 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
533 gtk_list_store_set_valist (GtkListStore *list_store,
539 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
541 column = va_arg (var_args, gint);
545 GValue value = { 0, };
548 if (column >= list_store->n_columns)
550 g_warning ("%s: Invalid column number %d added to iter (remember to end your list of columns with a -1)", G_STRLOC, column);
553 g_value_init (&value, list_store->column_headers[column]);
555 G_VALUE_COLLECT (&value, var_args, &error);
558 g_warning ("%s: %s", G_STRLOC, error);
561 /* we purposely leak the value here, it might not be
562 * in a sane state if an error condition occoured
567 gtk_list_store_set_cell (list_store,
572 g_value_unset (&value);
574 column = va_arg (var_args, gint);
579 * gtk_list_store_set:
580 * @list_store: a #GtkListStore
581 * @iter: row iterator
582 * @Varargs: pairs of column number and value, terminated with -1
584 * Sets the value of one or more cells in the row referenced by @iter.
585 * The variable argument list should contain integer column numbers,
586 * each column number followed by the value to be set. For example,
587 * The list is terminated by a -1. For example, to set column 0 with type
588 * %G_TYPE_STRING to "Foo", you would write gtk_list_store_set (store, iter,
592 gtk_list_store_set (GtkListStore *list_store,
598 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
600 va_start (var_args, iter);
601 gtk_list_store_set_valist (list_store, iter, var_args);
606 gtk_list_store_get_valist (GtkListStore *list_store,
612 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
614 column = va_arg (var_args, gint);
618 GValue value = { 0, };
621 if (column >= list_store->n_columns)
623 g_warning ("%s: Invalid column number %d accessed (remember to end your list of columns with a -1)", G_STRLOC, column);
627 gtk_list_store_get_value (GTK_TREE_MODEL (list_store), iter, column, &value);
629 G_VALUE_LCOPY (&value, var_args, &error);
632 g_warning ("%s: %s", G_STRLOC, error);
635 /* we purposely leak the value here, it might not be
636 * in a sane state if an error condition occoured
641 g_value_unset (&value);
643 column = va_arg (var_args, gint);
648 gtk_list_store_get (GtkListStore *list_store,
654 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
656 va_start (var_args, iter);
657 gtk_list_store_get_valist (list_store, iter, var_args);
662 remove_link_saving_prev (GSList *list,
677 prev->next = tmp->next;
695 gtk_list_store_remove_silently (GtkListStore *list_store,
699 if (G_SLIST (iter->user_data)->data)
701 _gtk_tree_data_list_free ((GtkTreeDataList *) G_SLIST (iter->user_data)->data,
702 list_store->column_headers);
703 G_SLIST (iter->user_data)->data = NULL;
709 list_store->root = remove_link_saving_prev (G_SLIST (list_store->root),
710 G_SLIST (iter->user_data),
713 if (iter->user_data == list_store->tail)
714 list_store->tail = prev;
717 list_store->stamp ++;
721 gtk_list_store_remove (GtkListStore *list_store,
726 g_return_if_fail (list_store != NULL);
727 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
728 g_return_if_fail (iter->user_data != NULL);
731 path = gtk_list_store_get_path (GTK_TREE_MODEL (list_store), iter);
733 gtk_list_store_remove_silently (list_store, iter, path);
735 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
738 gtk_tree_path_free (path);
742 insert_after (GtkListStore *list_store,
746 g_return_if_fail (sibling != NULL);
747 g_return_if_fail (new_list != NULL);
749 /* insert new node after list */
750 new_list->next = sibling->next;
751 sibling->next = new_list;
753 /* if list was the tail, the new node is the new tail */
754 if (sibling == list_store->tail)
755 list_store->tail = new_list;
759 gtk_list_store_insert (GtkListStore *list_store,
767 g_return_if_fail (list_store != NULL);
768 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
769 g_return_if_fail (iter != NULL);
770 g_return_if_fail (position >= 0);
774 gtk_list_store_prepend (list_store, iter);
778 new_list = g_slist_alloc ();
780 list = g_slist_nth (G_SLIST (list_store->root), position - 1);
784 g_warning ("%s: position %d is off the end of the list\n", G_STRLOC, position);
788 insert_after (list_store, list, new_list);
790 iter->stamp = list_store->stamp;
791 iter->user_data = new_list;
793 path = gtk_tree_path_new ();
794 gtk_tree_path_append_index (path, position);
795 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
798 gtk_tree_path_free (path);
802 gtk_list_store_insert_before (GtkListStore *list_store,
804 GtkTreeIter *sibling)
807 GSList *list, *prev, *new_list;
810 g_return_if_fail (list_store != NULL);
811 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
812 g_return_if_fail (iter != NULL);
816 gtk_list_store_append (list_store, iter);
820 new_list = g_slist_alloc ();
822 prev = list = list_store->root;
823 while (list && list != sibling->user_data)
830 if (list != sibling->user_data)
832 g_warning ("%s: sibling iterator invalid? not found in the list", G_STRLOC);
836 /* if there are no nodes, we become the list tail, otherwise we
837 * are inserting before any existing nodes so we can't change
841 if (list_store->root == NULL)
842 list_store->tail = new_list;
846 new_list->next = prev->next;
847 prev->next = new_list;
851 new_list->next = list_store->root;
852 list_store->root = new_list;
855 iter->stamp = list_store->stamp;
856 iter->user_data = new_list;
858 path = gtk_tree_path_new ();
859 gtk_tree_path_append_index (path, i);
860 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
863 gtk_tree_path_free (path);
867 gtk_list_store_insert_after (GtkListStore *list_store,
869 GtkTreeIter *sibling)
872 GSList *list, *new_list;
875 g_return_if_fail (list_store != NULL);
876 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
877 g_return_if_fail (iter != NULL);
879 g_return_if_fail (sibling->stamp == list_store->stamp);
883 gtk_list_store_prepend (list_store, iter);
887 for (list = list_store->root; list && list != sibling->user_data; list = list->next)
890 g_return_if_fail (list == sibling->user_data);
892 new_list = g_slist_alloc ();
894 insert_after (list_store, list, new_list);
896 iter->stamp = list_store->stamp;
897 iter->user_data = new_list;
899 path = gtk_tree_path_new ();
900 gtk_tree_path_append_index (path, i);
901 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
904 gtk_tree_path_free (path);
908 gtk_list_store_prepend (GtkListStore *list_store,
913 g_return_if_fail (list_store != NULL);
914 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
915 g_return_if_fail (iter != NULL);
917 iter->stamp = list_store->stamp;
918 iter->user_data = g_slist_alloc ();
920 if (list_store->root == NULL)
921 list_store->tail = iter->user_data;
923 G_SLIST (iter->user_data)->next = G_SLIST (list_store->root);
924 list_store->root = iter->user_data;
926 path = gtk_tree_path_new ();
927 gtk_tree_path_append_index (path, 0);
928 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
931 gtk_tree_path_free (path);
935 gtk_list_store_append (GtkListStore *list_store,
941 g_return_if_fail (list_store != NULL);
942 g_return_if_fail (GTK_IS_LIST_STORE (list_store));
943 g_return_if_fail (iter != NULL);
945 iter->stamp = list_store->stamp;
946 iter->user_data = g_slist_alloc ();
948 if (list_store->tail)
949 list_store->tail->next = iter->user_data;
951 list_store->root = iter->user_data;
953 list_store->tail = iter->user_data;
955 path = gtk_tree_path_new ();
956 gtk_tree_path_append_index (path, i);
957 gtk_signal_emit_by_name (GTK_OBJECT (list_store),
960 gtk_tree_path_free (path);
964 gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
968 g_return_val_if_fail (GTK_IS_LIST_STORE (drag_source), FALSE);
970 if (gtk_tree_model_get_iter (GTK_TREE_MODEL (drag_source),
974 gtk_list_store_remove (GTK_LIST_STORE (drag_source),
985 gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source,
987 GtkSelectionData *selection_data)
989 g_return_val_if_fail (GTK_IS_LIST_STORE (drag_source), FALSE);
991 /* Note that we don't need to handle the GTK_TREE_MODEL_ROW
992 * target, because the default handler does it for us, but
993 * we do anyway for the convenience of someone maybe overriding the
997 if (gtk_selection_data_set_tree_row (selection_data,
998 GTK_TREE_MODEL (drag_source),
1005 /* FIXME handle text targets at least. */
1012 gtk_list_store_drag_data_received (GtkTreeDragDest *drag_dest,
1014 GtkSelectionData *selection_data)
1016 GtkTreeModel *tree_model;
1017 GtkListStore *list_store;
1018 GtkTreeModel *src_model = NULL;
1019 GtkTreePath *src_path = NULL;
1020 gboolean retval = FALSE;
1022 g_return_val_if_fail (GTK_IS_LIST_STORE (drag_dest), FALSE);
1024 tree_model = GTK_TREE_MODEL (drag_dest);
1025 list_store = GTK_LIST_STORE (drag_dest);
1027 if (gtk_selection_data_get_tree_row (selection_data,
1030 src_model == tree_model)
1032 /* Copy the given row to a new position */
1033 GtkTreeIter src_iter;
1034 GtkTreeIter dest_iter;
1037 if (!gtk_tree_model_get_iter (src_model,
1042 /* Get the path to insert _after_ (dest is the path to insert _before_) */
1043 prev = gtk_tree_path_copy (dest);
1045 if (!gtk_tree_path_prev (prev))
1047 /* dest was the first spot in the list; which means we are supposed
1050 gtk_list_store_prepend (GTK_LIST_STORE (tree_model),
1057 if (gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model),
1061 GtkTreeIter tmp_iter = dest_iter;
1062 gtk_list_store_insert_after (GTK_LIST_STORE (tree_model),
1069 gtk_tree_path_free (prev);
1071 /* If we succeeded in creating dest_iter, copy data from src
1075 GtkTreeDataList *dl = G_SLIST (src_iter.user_data)->data;
1076 GtkTreeDataList *copy_head = NULL;
1077 GtkTreeDataList *copy_prev = NULL;
1078 GtkTreeDataList *copy_iter = NULL;
1084 copy_iter = _gtk_tree_data_list_node_copy (dl,
1085 list_store->column_headers[col]);
1087 g_print ("copied col %d type %s\n", col,
1088 g_type_name (list_store->column_headers[col]));
1090 if (copy_head == NULL)
1091 copy_head = copy_iter;
1094 copy_prev->next = copy_iter;
1096 copy_prev = copy_iter;
1102 G_SLIST (dest_iter.user_data)->data = copy_head;
1104 gtk_signal_emit_by_name (GTK_OBJECT (tree_model),
1111 /* FIXME maybe add some data targets eventually, or handle text
1112 * targets in the simple case.
1119 gtk_tree_path_free (src_path);