? gail-treeview-patch.diff
? stamp-h1
? docs/reference/libgail-util/gail-libgail-util.interfaces
? docs/reference/libgail-util/gail-libgail-util.prerequisites
? gail/gailtreeview.c.debug
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gail/ChangeLog,v
retrieving revision 1.796
diff -u -r1.796 ChangeLog
--- ChangeLog	23 Apr 2005 05:47:27 -0000	1.796
+++ ChangeLog	25 Apr 2005 10:12:35 -0000
@@ -1,3 +1,16 @@
+2005-04-25  Bill Haneman <bill.haneman@sun.com>
+
+	* configure.in: Revved to 1.8.4.
+
+	* gail/gailtreeview.c: 
+	(GailTreeViewCellInfo): Added gboolean in_use.
+	(clean_cell_info): Mark in_use=FALSE on GailTreeViewCell when 
+	cleaning; don't free the cell_info or remove the link at this
+	point, wait for garbage_collect_cell_data pass.
+	(garbage_collect_cell_data): New, traverse the cellinfo list and
+	remove links that aren't in use, freeing them.
+	(traverse_cells): Only operate on cells that are in_use.
+
 2005-04-23  Guntupalli Karunakar <karunakar@freedomink.org>
 
 	* configure.in: Added "as" for Assamese in ALL_LINGUAS
Index: configure.in
===================================================================
RCS file: /cvs/gnome/gail/configure.in,v
retrieving revision 1.140
diff -u -r1.140 configure.in
--- configure.in	23 Apr 2005 05:47:27 -0000	1.140
+++ configure.in	25 Apr 2005 10:12:35 -0000
@@ -5,11 +5,11 @@
 AM_CONFIG_HEADER(config.h)
 
 
-AM_INIT_AUTOMAKE(gail, 1.8.3)
+AM_INIT_AUTOMAKE(gail, 1.8.4)
 
 # libtool versioning
 LT_CURRENT=17
-LT_REVISION=2
+LT_REVISION=3
 LT_AGE=0
 LT_CURRENT_MINUS_AGE=`expr $LT_CURRENT - $LT_AGE`
 AC_SUBST(LT_CURRENT)
Index: gail/gailtreeview.c
===================================================================
RCS file: /cvs/gnome/gail/gail/gailtreeview.c,v
retrieving revision 1.175
diff -u -r1.175 gailtreeview.c
--- gail/gailtreeview.c	7 Dec 2004 09:28:35 -0000	1.175
+++ gail/gailtreeview.c	25 Apr 2005 10:12:48 -0000
@@ -38,8 +38,7 @@
 static void             gail_tree_view_finalize         (GObject                *object);
 
 static void             gail_tree_view_connect_widget_destroyed 
-                                                        (GtkAccessible        
-*accessible);
+                                                        (GtkAccessible          *accessible);
 static void             gail_tree_view_destroyed        (GtkWidget              *widget,
                                                          GtkAccessible          *accessible); 
 /* atkobject.h */
@@ -353,6 +352,7 @@
   GailCell *cell;
   GtkTreeRowReference *cell_row_ref;
   GtkTreeViewColumn *cell_col_ref;
+  gboolean in_use;
 };
 
 typedef struct _GailTreeViewIdleData   GailTreeViewIdleData;
@@ -1038,6 +1038,7 @@
       g_object_unref (relation_set);
     }
   gtk_tree_path_free (path);
+
   /*
    * We do not increase the reference count here; when g_object_unref() is 
    * called for the cell then cell_destroyed() is called and
@@ -1879,7 +1880,6 @@
         {
           row_info = g_array_index (array, GailTreeViewRowInfo*, i);
           row_path = gtk_tree_row_reference_get_path (row_info->row_ref);
-
           if (row_path != NULL)
             {
               if (gtk_tree_path_compare (row_path, path) == 0)
@@ -2197,7 +2197,6 @@
       renderer = g_list_nth_data (renderers, index);
       g_list_free (renderers);
     }
-
   path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
   if (path)
     {
@@ -2698,7 +2697,6 @@
           if (tv_col == this_col)
             {
               GtkTreePath *row_path;
-      
               row_path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
               if (GAIL_IS_RENDERER_CELL (cell_info->cell))
                 {
@@ -3423,8 +3421,7 @@
   if (cell_info->cell_row_ref != NULL)
     gtk_tree_row_reference_free (cell_info->cell_row_ref);
   g_object_weak_unref (obj, (GWeakNotify) cell_destroyed, obj);
-  gailview->cell_data = g_list_remove_link (gailview->cell_data, list);
-  g_free (cell_info); 
+  cell_info->in_use = FALSE; 
 }
 
 static void 
@@ -3527,6 +3524,26 @@
     }
 }
 
+static void
+garbage_collect_cell_data (GailTreeView *tree_view)
+{
+      GList *temp_list = tree_view->cell_data;
+      GailTreeViewCellInfo *cell_info;
+
+      /* Must loop through them all */
+      while (temp_list != NULL)
+      {
+          cell_info = temp_list->data;
+	  if (!cell_info->in_use)
+	  {
+	      tree_view->cell_data = g_list_remove_link (tree_view->cell_data, 
+							 temp_list);
+	      g_free (cell_info);
+	  }
+          temp_list = temp_list->next;
+      }
+}
+
 /**
  * If tree_path is passed in as NULL, then all cells are acted on.
  * Otherwise, just act on those cells that are on a row greater than 
@@ -3569,32 +3586,36 @@
           cell_info = temp_list->data;
           temp_list = temp_list->next;
 
-          row_path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
-          g_assert (row_path != NULL);
-          if (tree_path == NULL)
-            act_on_cell = TRUE;
-          else 
-            {
-              gint comparison;
-
-              comparison =  gtk_tree_path_compare (row_path, tree_path);
-              if ((comparison > 0) ||
-                  (comparison == 0 && inc_row))
-                act_on_cell = TRUE;
-              else
-                act_on_cell = FALSE;
-            }
-          if (act_on_cell)
-            {
-              if (set_stale)
-                gail_cell_add_state (cell_info->cell, ATK_STATE_STALE, TRUE);
-              set_cell_visibility (gtk_tree_view,
-                                   cell_info->cell,
-                                   cell_info->cell_col_ref,
-                                   row_path, TRUE);
-            }
-          gtk_tree_path_free (row_path);
-        }
+	  if (cell_info->in_use)
+	  {
+	      row_path = gtk_tree_row_reference_get_path (cell_info->cell_row_ref);
+	      g_assert (row_path != NULL);
+	      if (tree_path == NULL)
+		  act_on_cell = TRUE;
+	      else 
+	      {
+		  gint comparison;
+		  
+		  comparison =  gtk_tree_path_compare (row_path, tree_path);
+		  if ((comparison > 0) ||
+		      (comparison == 0 && inc_row))
+		      act_on_cell = TRUE;
+		  else
+		      act_on_cell = FALSE;
+	      }
+	      if (act_on_cell)
+	      {
+		  if (set_stale)
+		      gail_cell_add_state (cell_info->cell, ATK_STATE_STALE, TRUE);
+		  set_cell_visibility (gtk_tree_view,
+				       cell_info->cell,
+				       cell_info->cell_col_ref,
+				       row_path, TRUE);
+	      }
+	      gtk_tree_path_free (row_path);
+	  }
+	}
+      garbage_collect_cell_data (tree_view);
     }
   g_signal_emit_by_name (tree_view, "visible-data-changed");
 }
@@ -3984,6 +4005,7 @@
 
   cell_info->cell_col_ref = tv_col;
   cell_info->cell = cell;
+  cell_info->in_use = TRUE; /* if we've created it, assume it's in use */
   gailview->cell_data = g_list_append (gailview->cell_data, cell_info);
       
   /* Setup weak reference notification */
