commit 8db8313c1b0d56875f78969bea52a05b12c51fe1
Author: Szilárd Pfeiffer <mailbox@pfeifferszilard.hu>
Date:   Mon Aug 16 12:57:36 2010 +0200

    Implemented iter_prev function for filter model.

diff --git a/gtk/gtktreemodelfilter.c b/gtk/gtktreemodelfilter.c
index 5530443..b6c7e4a 100644
--- a/gtk/gtktreemodelfilter.c
+++ b/gtk/gtktreemodelfilter.c
@@ -184,6 +184,8 @@ static void         gtk_tree_model_filter_get_value                       (GtkTr
                                                                            GValue                 *value);
 static gboolean     gtk_tree_model_filter_iter_next                       (GtkTreeModel           *model,
                                                                            GtkTreeIter            *iter);
+static gboolean     gtk_tree_model_filter_iter_prev                       (GtkTreeModel           *model,
+                                                                           GtkTreeIter            *iter);
 static gboolean     gtk_tree_model_filter_iter_children                   (GtkTreeModel           *model,
                                                                            GtkTreeIter            *iter,
                                                                            GtkTreeIter            *parent);
@@ -354,6 +356,7 @@ gtk_tree_model_filter_tree_model_init (GtkTreeModelIface *iface)
   iface->get_path = gtk_tree_model_filter_get_path;
   iface->get_value = gtk_tree_model_filter_get_value;
   iface->iter_next = gtk_tree_model_filter_iter_next;
+  iface->iter_prev = gtk_tree_model_filter_iter_prev;
   iface->iter_children = gtk_tree_model_filter_iter_children;
   iface->iter_has_child = gtk_tree_model_filter_iter_has_child;
   iface->iter_n_children = gtk_tree_model_filter_iter_n_children;
@@ -2484,6 +2487,41 @@ gtk_tree_model_filter_iter_next (GtkTreeModel *model,
 }
 
 static gboolean
+gtk_tree_model_filter_iter_prev (GtkTreeModel *model,
+                                 GtkTreeIter  *iter)
+{
+  int i;
+  FilterLevel *level;
+  FilterElt *elt;
+
+  g_return_val_if_fail (GTK_IS_TREE_MODEL_FILTER (model), FALSE);
+  g_return_val_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->child_model != NULL, FALSE);
+  g_return_val_if_fail (GTK_TREE_MODEL_FILTER (model)->priv->stamp == iter->stamp, FALSE);
+
+  level = iter->user_data;
+  elt = iter->user_data2;
+
+  i = elt - FILTER_ELT (level->array->data);
+
+  while (i > 0)
+    {
+      i--;
+      elt--;
+
+      if (elt->visible)
+        {
+          iter->user_data2 = elt;
+          return TRUE;
+        }
+    }
+
+  /* no previous visible iter */
+  iter->stamp = 0;
+
+  return FALSE;
+}
+
+static gboolean
 gtk_tree_model_filter_iter_children (GtkTreeModel *model,
                                      GtkTreeIter  *iter,
                                      GtkTreeIter  *parent)
