return ret;
}
+GType
+*solipa_gtktreemodel_get_gtypes (GtkTreeModel *model, guint *cols)
+{
+ GType *ret;
+
+ guint _cols;
+ guint _col;
+
+ ret = NULL;
+
+ _cols = gtk_tree_model_get_n_columns (model);
+ if (_cols > 0)
+ {
+ if (cols != NULL)
+ {
+ *cols = _cols;
+ }
+
+ ret = (GType *)g_malloc0 (_cols * sizeof (GType));
+ for (_col = 0; _col < _cols; _col++)
+ {
+ ret[_col] = gtk_tree_model_get_column_type (model, _col);
+ }
+ }
+
+ return ret;
+}
+
+GtkTreeModel
+*solipa_gtktreemodel_copy (GtkTreeModel *model, gboolean only_schema)
+{
+ GtkTreeModel *ret;
+
+ GType *gtypes;
+ guint cols;
+ guint col;
+
+ GtkTreeIter iter;
+ GtkTreeIter iter_new;
+
+ ret = NULL;
+
+ gtypes = solipa_gtktreemodel_get_gtypes (model, &cols);
+ if (gtypes != NULL)
+ {
+ if (GTK_IS_LIST_STORE (model))
+ {
+ ret = GTK_TREE_MODEL (gtk_list_store_newv (cols, gtypes));
+
+ if (!only_schema)
+ {
+ if (gtk_tree_model_get_iter_first (model, &iter))
+ {
+ do
+ {
+ gtk_list_store_append (GTK_LIST_STORE (ret), &iter_new);
+ for (col = 0; col < cols; col++)
+ {
+ GValue gval = {0};
+ gtk_tree_model_get_value (model, &iter, col, &gval);
+ gtk_list_store_set_value (GTK_LIST_STORE (ret), &iter_new, col, &gval);
+ g_value_unset (&gval);
+ }
+ } while (gtk_tree_model_iter_next (model, &iter));
+ }
+ }
+ }
+ else if (GTK_IS_TREE_MODEL (model))
+ {
+ ret = GTK_TREE_MODEL (gtk_tree_store_newv (cols, gtypes));
+
+ if (!only_schema)
+ {
+
+ }
+ }
+ else
+ {
+ g_warning ("GtkTreeModel type not expected.");
+ }
+ }
+
+ return ret;
+}
+
gchar
*solipa_string_replace (const gchar *string,
const gchar *origin,
gchar **columns_title,
guint n_columns);
+GType *solipa_gtktreemodel_get_gtypes (GtkTreeModel *model, guint *cols);
+GtkTreeModel *solipa_gtktreemodel_copy (GtkTreeModel *model, gboolean only_schema);
+
gchar *solipa_string_replace (const gchar *string,
const gchar *origin,
const gchar *replace);