+ validate_tree (tree_store);
+}
+
+/**
+ * gtk_tree_store_insert_with_values:
+ * @tree_store: A #GtkTreeStore
+ * @iter: (out) (allow-none): An unset #GtkTreeIter to set the new row, or %NULL.
+ * @parent: (allow-none): A valid #GtkTreeIter, or %NULL
+ * @position: position to insert the new row, or -1 to append after existing rows
+ * @...: pairs of column number and value, terminated with -1
+ *
+ * Creates a new row at @position. @iter will be changed to point to this
+ * new row. If @position is -1, or larger than the number of rows on the list, then
+ * the new row will be appended to the list. The row will be filled with
+ * the values given to this function.
+ *
+ * Calling
+ * <literal>gtk_tree_store_insert_with_values (tree_store, iter, position, ...)</literal>
+ * has the same effect as calling
+ * |[
+ * gtk_tree_store_insert (tree_store, iter, position);
+ * gtk_tree_store_set (tree_store, iter, ...);
+ * ]|
+ * with the different that the former will only emit a row_inserted signal,
+ * while the latter will emit row_inserted, row_changed and if the tree store
+ * is sorted, rows_reordered. Since emitting the rows_reordered signal
+ * repeatedly can affect the performance of the program,
+ * gtk_tree_store_insert_with_values() should generally be preferred when
+ * inserting rows in a sorted tree store.
+ *
+ * Since: 2.10
+ */
+void
+gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent,
+ gint position,
+ ...)
+{
+ GtkTreeStorePrivate *priv = tree_store->priv;
+ GtkTreePath *path;
+ GNode *parent_node;
+ GNode *new_node;
+ GtkTreeIter tmp_iter;
+ va_list var_args;
+ gboolean changed = FALSE;
+ gboolean maybe_need_sort = FALSE;
+
+ g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
+
+ if (!iter)
+ iter = &tmp_iter;
+
+ if (parent)
+ g_return_if_fail (VALID_ITER (parent, tree_store));
+
+ if (parent)
+ parent_node = parent->user_data;
+ else
+ parent_node = priv->root;
+
+ priv->columns_dirty = TRUE;
+
+ new_node = g_node_new (NULL);
+
+ iter->stamp = priv->stamp;
+ iter->user_data = new_node;
+ g_node_insert (parent_node, position, new_node);
+
+ va_start (var_args, position);
+ gtk_tree_store_set_valist_internal (tree_store, iter,
+ &changed, &maybe_need_sort,
+ var_args);
+ va_end (var_args);
+
+ if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
+ gtk_tree_store_sort_iter_changed (tree_store, iter, priv->sort_column_id, FALSE);
+
+ path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
+ gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
+
+ if (parent_node != priv->root)
+ {
+ if (new_node->prev == NULL && new_node->next == NULL)
+ {
+ gtk_tree_path_up (path);
+ gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
+ }
+ }
+
+ gtk_tree_path_free (path);
+
+ validate_tree ((GtkTreeStore *)tree_store);
+}
+
+/**
+ * gtk_tree_store_insert_with_valuesv:
+ * @tree_store: A #GtkTreeStore
+ * @iter: (out) (allow-none): An unset #GtkTreeIter to set the new row, or %NULL.
+ * @parent: (allow-none): A valid #GtkTreeIter, or %NULL
+ * @position: position to insert the new row, or -1 for last
+ * @columns: (array length=n_values): an array of column numbers
+ * @values: (array length=n_values): an array of GValues
+ * @n_values: the length of the @columns and @values arrays
+ *
+ * A variant of gtk_tree_store_insert_with_values() which takes
+ * the columns and values as two arrays, instead of varargs. This
+ * function is mainly intended for language bindings.
+ *
+ * Since: 2.10
+ * Rename to: gtk_tree_store_insert_with_values
+ */
+void
+gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
+ GtkTreeIter *iter,
+ GtkTreeIter *parent,
+ gint position,
+ gint *columns,
+ GValue *values,
+ gint n_values)
+{
+ GtkTreeStorePrivate *priv = tree_store->priv;
+ GtkTreePath *path;
+ GNode *parent_node;
+ GNode *new_node;
+ GtkTreeIter tmp_iter;
+ gboolean changed = FALSE;
+ gboolean maybe_need_sort = FALSE;
+
+ g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
+
+ if (!iter)
+ iter = &tmp_iter;
+
+ if (parent)
+ g_return_if_fail (VALID_ITER (parent, tree_store));
+
+ if (parent)
+ parent_node = parent->user_data;
+ else
+ parent_node = priv->root;
+
+ priv->columns_dirty = TRUE;
+
+ new_node = g_node_new (NULL);
+
+ iter->stamp = priv->stamp;
+ iter->user_data = new_node;
+ g_node_insert (parent_node, position, new_node);
+
+ gtk_tree_store_set_vector_internal (tree_store, iter,
+ &changed, &maybe_need_sort,
+ columns, values, n_values);
+
+ if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
+ gtk_tree_store_sort_iter_changed (tree_store, iter, priv->sort_column_id, FALSE);
+
+ path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
+ gtk_tree_model_row_inserted (GTK_TREE_MODEL (tree_store), path, iter);
+
+ if (parent_node != priv->root)
+ {
+ if (new_node->prev == NULL && new_node->next == NULL)
+ {
+ gtk_tree_path_up (path);
+ gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
+ }
+ }
+
+ gtk_tree_path_free (path);
+
+ validate_tree ((GtkTreeStore *)tree_store);