From 40e24cdab6d294af61ca54a96b0b901181dc7751 Mon Sep 17 00:00:00 2001 From: Christopher James Lahey Date: Mon, 3 Jul 2000 22:25:47 +0000 Subject: New list class with iterators. 2000-07-03 Christopher James Lahey * e-iterator.c, e-iterator.h, e-list-iterator.c, e-list-iterator.h, e-list.c, e-list.h: New list class with iterators. * e-canvas.c: Made it so that you don't get the same selection in the selection list more than once. svn path=/trunk/; revision=3871 --- e-util/e-canvas.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'e-util/e-canvas.c') diff --git a/e-util/e-canvas.c b/e-util/e-canvas.c index 0da4dade28..4cb912283e 100644 --- a/e-util/e-canvas.c +++ b/e-util/e-canvas.c @@ -583,6 +583,7 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id) ECanvas *canvas; ECanvasSelectionInfo *info; ECanvasItemSelectionFunc func; + GList *list; g_return_if_fail(item != NULL); g_return_if_fail(GNOME_IS_CANVAS_ITEM(item)); @@ -602,6 +603,24 @@ e_canvas_item_add_selection (GnomeCanvasItem *item, gpointer id) flags = E_CANVAS_ITEM_SELECTION_SELECT | E_CANVAS_ITEM_SELECTION_CURSOR; + for (list = canvas->selection; list; list = g_list_next(list)) { + ECanvasSelectionInfo *search; + search = list->data; + + if (search->item == item) { + ECanvasItemSelectionCompareFunc compare_func; + compare_func = gtk_object_get_data(GTK_OBJECT(search->item), "ECanvasItem::selection_compare_callback"); + + if (compare_func(search->item, search->id, id, 0) == 0) { + canvas->cursor = search; + func = gtk_object_get_data(GTK_OBJECT(item), "ECanvasItem::selection_callback"); + if (func) + func(item, flags, search->id); + return; + } + } + } + info = g_new(ECanvasSelectionInfo, 1); info->item = item; info->id = id; -- cgit v1.2.3