[gtk+] Remove sealed members from GtkTreeStore
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Remove sealed members from GtkTreeStore
- Date: Sat, 18 Dec 2010 02:45:55 +0000 (UTC)
commit 881ea2881df5e4a252ef1ddd0739f100a8f86711
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Dec 17 21:45:20 2010 -0500
Remove sealed members from GtkTreeStore
gtk/gtktreestore.c | 399 +++++++++++++++++++++++++++++----------------------
gtk/gtktreestore.h | 18 +--
2 files changed, 231 insertions(+), 186 deletions(-)
---
diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c
index 0556739..d2f69aa 100644
--- a/gtk/gtktreestore.c
+++ b/gtk/gtktreestore.c
@@ -62,10 +62,26 @@
* </refsect2>
*/
+struct _GtkTreeStorePrivate
+{
+ gint stamp;
+ gpointer root;
+ gpointer last;
+ gint n_columns;
+ gint sort_column_id;
+ GList *sort_list;
+ GtkSortType order;
+ GType *column_headers;
+ GtkTreeIterCompareFunc default_sort_func;
+ gpointer default_sort_data;
+ GDestroyNotify default_sort_destroy;
+ guint columns_dirty : 1;
+};
+
#define G_NODE(node) ((GNode *)node)
-#define GTK_TREE_STORE_IS_SORTED(tree) (((GtkTreeStore*)(tree))->sort_column_id != GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
-#define VALID_ITER(iter, tree_store) ((iter)!= NULL && (iter)->user_data != NULL && ((GtkTreeStore*)(tree_store))->stamp == (iter)->stamp)
+#define GTK_TREE_STORE_IS_SORTED(tree) (((GtkTreeStore*)(tree))->priv->sort_column_id != GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
+#define VALID_ITER(iter, tree_store) ((iter)!= NULL && (iter)->user_data != NULL && ((GtkTreeStore*)(tree_store))->priv->stamp == (iter)->stamp)
static void gtk_tree_store_tree_model_init (GtkTreeModelIface *iface);
static void gtk_tree_store_drag_source_init(GtkTreeDragSourceIface *iface);
@@ -180,9 +196,9 @@ validate_tree (GtkTreeStore *tree_store)
{
if (gtk_get_debug_flags () & GTK_DEBUG_TREE)
{
- g_assert (G_NODE (tree_store->root)->parent == NULL);
+ g_assert (G_NODE (tree_store->priv->root)->parent == NULL);
- validate_gnode (G_NODE (tree_store->root));
+ validate_gnode (G_NODE (tree_store->priv->root));
}
}
@@ -260,18 +276,23 @@ gtk_tree_store_buildable_init (GtkBuildableIface *iface)
static void
gtk_tree_store_init (GtkTreeStore *tree_store)
{
- tree_store->root = g_node_new (NULL);
- /* While the odds are against us getting 0...
- */
+ GtkTreeStorePrivate *priv;
+
+ priv = G_TYPE_INSTANCE_GET_PRIVATE (tree_store,
+ GTK_TYPE_TREE_STORE,
+ GtkTreeStorePrivate);
+ tree_store->priv = priv;
+ priv->root = g_node_new (NULL);
+ /* While the odds are against us getting 0... */
do
{
- tree_store->stamp = g_random_int ();
+ priv->stamp = g_random_int ();
}
- while (tree_store->stamp == 0);
+ while (priv->stamp == 0);
- tree_store->sort_list = NULL;
- tree_store->sort_column_id = GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID;
- tree_store->columns_dirty = FALSE;
+ priv->sort_list = NULL;
+ priv->sort_column_id = GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID;
+ priv->columns_dirty = FALSE;
}
/**
@@ -375,7 +396,7 @@ gtk_tree_store_set_column_types (GtkTreeStore *tree_store,
gint i;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
- g_return_if_fail (tree_store->columns_dirty == 0);
+ g_return_if_fail (tree_store->priv->columns_dirty == 0);
gtk_tree_store_set_n_columns (tree_store, n_columns);
for (i = 0; i < n_columns; i++)
@@ -393,20 +414,21 @@ static void
gtk_tree_store_set_n_columns (GtkTreeStore *tree_store,
gint n_columns)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
int i;
- if (tree_store->n_columns == n_columns)
+ if (priv->n_columns == n_columns)
return;
- tree_store->column_headers = g_renew (GType, tree_store->column_headers, n_columns);
- for (i = tree_store->n_columns; i < n_columns; i++)
- tree_store->column_headers[i] = G_TYPE_INVALID;
- tree_store->n_columns = n_columns;
+ priv->column_headers = g_renew (GType, priv->column_headers, n_columns);
+ for (i = priv->n_columns; i < n_columns; i++)
+ priv->column_headers[i] = G_TYPE_INVALID;
+ priv->n_columns = n_columns;
- if (tree_store->sort_list)
- _gtk_tree_data_list_header_free (tree_store->sort_list);
+ if (priv->sort_list)
+ _gtk_tree_data_list_header_free (priv->sort_list);
- tree_store->sort_list = _gtk_tree_data_list_header_new (n_columns, tree_store->column_headers);
+ priv->sort_list = _gtk_tree_data_list_header_new (n_columns, priv->column_headers);
}
/**
@@ -426,12 +448,14 @@ gtk_tree_store_set_column_type (GtkTreeStore *tree_store,
gint column,
GType type)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
+
if (!_gtk_tree_data_list_check_type (type))
{
g_warning ("%s: Invalid type %s\n", G_STRLOC, g_type_name (type));
return;
}
- tree_store->column_headers[column] = type;
+ priv->column_headers[column] = type;
}
static gboolean
@@ -448,20 +472,21 @@ static void
gtk_tree_store_finalize (GObject *object)
{
GtkTreeStore *tree_store = GTK_TREE_STORE (object);
+ GtkTreeStorePrivate *priv = tree_store->priv;
- g_node_traverse (tree_store->root, G_POST_ORDER, G_TRAVERSE_ALL, -1,
- node_free, tree_store->column_headers);
- g_node_destroy (tree_store->root);
- _gtk_tree_data_list_header_free (tree_store->sort_list);
- g_free (tree_store->column_headers);
+ g_node_traverse (priv->root, G_POST_ORDER, G_TRAVERSE_ALL, -1,
+ node_free, priv->column_headers);
+ g_node_destroy (priv->root);
+ _gtk_tree_data_list_header_free (priv->sort_list);
+ g_free (priv->column_headers);
- if (tree_store->default_sort_destroy)
+ if (priv->default_sort_destroy)
{
- GDestroyNotify d = tree_store->default_sort_destroy;
+ GDestroyNotify d = priv->default_sort_destroy;
- tree_store->default_sort_destroy = NULL;
- d (tree_store->default_sort_data);
- tree_store->default_sort_data = NULL;
+ priv->default_sort_destroy = NULL;
+ d (priv->default_sort_data);
+ priv->default_sort_data = NULL;
}
/* must chain up */
@@ -485,10 +510,11 @@ static gint
gtk_tree_store_get_n_columns (GtkTreeModel *tree_model)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
- return tree_store->n_columns;
+ return priv->n_columns;
}
static GType
@@ -496,12 +522,13 @@ gtk_tree_store_get_column_type (GtkTreeModel *tree_model,
gint index)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
- g_return_val_if_fail (index < tree_store->n_columns, G_TYPE_INVALID);
+ g_return_val_if_fail (index < priv->n_columns, G_TYPE_INVALID);
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
- return tree_store->column_headers[index];
+ return priv->column_headers[index];
}
static gboolean
@@ -510,19 +537,20 @@ gtk_tree_store_get_iter (GtkTreeModel *tree_model,
GtkTreePath *path)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreeIter parent;
gint *indices;
gint depth, i;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
indices = gtk_tree_path_get_indices (path);
depth = gtk_tree_path_get_depth (path);
g_return_val_if_fail (depth > 0, FALSE);
- parent.stamp = tree_store->stamp;
- parent.user_data = tree_store->root;
+ parent.stamp = priv->stamp;
+ parent.user_data = priv->root;
if (!gtk_tree_store_iter_nth_child (tree_model, iter, &parent, indices[0]))
return FALSE;
@@ -542,24 +570,25 @@ gtk_tree_store_get_path (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *retval;
GNode *tmp_node;
gint i = 0;
g_return_val_if_fail (iter->user_data != NULL, NULL);
- g_return_val_if_fail (iter->stamp == tree_store->stamp, NULL);
+ g_return_val_if_fail (iter->stamp == priv->stamp, NULL);
validate_tree (tree_store);
if (G_NODE (iter->user_data)->parent == NULL &&
- G_NODE (iter->user_data) == tree_store->root)
+ G_NODE (iter->user_data) == priv->root)
return gtk_tree_path_new ();
g_assert (G_NODE (iter->user_data)->parent != NULL);
- if (G_NODE (iter->user_data)->parent == G_NODE (tree_store->root))
+ if (G_NODE (iter->user_data)->parent == G_NODE (priv->root))
{
retval = gtk_tree_path_new ();
- tmp_node = G_NODE (tree_store->root)->children;
+ tmp_node = G_NODE (priv->root)->children;
}
else
{
@@ -608,10 +637,11 @@ gtk_tree_store_get_value (GtkTreeModel *tree_model,
GValue *value)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreeDataList *list;
gint tmp_column = column;
- g_return_if_fail (column < tree_store->n_columns);
+ g_return_if_fail (column < priv->n_columns);
g_return_if_fail (VALID_ITER (iter, tree_store));
list = G_NODE (iter->user_data)->data;
@@ -622,13 +652,13 @@ gtk_tree_store_get_value (GtkTreeModel *tree_model,
if (list)
{
_gtk_tree_data_list_node_to_value (list,
- tree_store->column_headers[column],
+ priv->column_headers[column],
value);
}
else
{
/* We want to return an initialized but empty (default) value */
- g_value_init (value, tree_store->column_headers[column]);
+ g_value_init (value, priv->column_headers[column]);
}
}
@@ -637,7 +667,7 @@ gtk_tree_store_iter_next (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
g_return_val_if_fail (iter->user_data != NULL, FALSE);
- g_return_val_if_fail (iter->stamp == GTK_TREE_STORE (tree_model)->stamp, FALSE);
+ g_return_val_if_fail (iter->stamp == GTK_TREE_STORE (tree_model)->priv->stamp, FALSE);
if (G_NODE (iter->user_data)->next)
{
@@ -657,6 +687,7 @@ gtk_tree_store_iter_children (GtkTreeModel *tree_model,
GtkTreeIter *parent)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *children;
if (parent)
@@ -665,11 +696,11 @@ gtk_tree_store_iter_children (GtkTreeModel *tree_model,
if (parent)
children = G_NODE (parent->user_data)->children;
else
- children = G_NODE (tree_store->root)->children;
+ children = G_NODE (priv->root)->children;
if (children)
{
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = children;
return TRUE;
}
@@ -700,7 +731,7 @@ gtk_tree_store_iter_n_children (GtkTreeModel *tree_model,
g_return_val_if_fail (iter == NULL || iter->user_data != NULL, 0);
if (iter == NULL)
- node = G_NODE (GTK_TREE_STORE (tree_model)->root)->children;
+ node = G_NODE (GTK_TREE_STORE (tree_model)->priv->root)->children;
else
node = G_NODE (iter->user_data)->children;
@@ -720,13 +751,14 @@ gtk_tree_store_iter_nth_child (GtkTreeModel *tree_model,
gint n)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *parent_node;
GNode *child;
g_return_val_if_fail (parent == NULL || parent->user_data != NULL, FALSE);
if (parent == NULL)
- parent_node = tree_store->root;
+ parent_node = priv->root;
else
parent_node = parent->user_data;
@@ -735,7 +767,7 @@ gtk_tree_store_iter_nth_child (GtkTreeModel *tree_model,
if (child)
{
iter->user_data = child;
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
return TRUE;
}
else
@@ -751,6 +783,7 @@ gtk_tree_store_iter_parent (GtkTreeModel *tree_model,
GtkTreeIter *child)
{
GtkTreeStore *tree_store = (GtkTreeStore *) tree_model;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *parent;
g_return_val_if_fail (iter != NULL, FALSE);
@@ -760,10 +793,10 @@ gtk_tree_store_iter_parent (GtkTreeModel *tree_model,
g_assert (parent != NULL);
- if (parent != tree_store->root)
+ if (parent != priv->root)
{
iter->user_data = parent;
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
return TRUE;
}
else
@@ -782,22 +815,23 @@ gtk_tree_store_real_set_value (GtkTreeStore *tree_store,
GValue *value,
gboolean sort)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreeDataList *list;
GtkTreeDataList *prev;
gint old_column = column;
- GValue real_value = {0, };
+ GValue real_value = { 0, };
gboolean converted = FALSE;
gboolean retval = FALSE;
- if (! g_type_is_a (G_VALUE_TYPE (value), tree_store->column_headers[column]))
+ if (! g_type_is_a (G_VALUE_TYPE (value), priv->column_headers[column]))
{
- if (! (g_value_type_compatible (G_VALUE_TYPE (value), tree_store->column_headers[column]) &&
- g_value_type_compatible (tree_store->column_headers[column], G_VALUE_TYPE (value))))
+ if (! (g_value_type_compatible (G_VALUE_TYPE (value), priv->column_headers[column]) &&
+ g_value_type_compatible (priv->column_headers[column], G_VALUE_TYPE (value))))
{
g_warning ("%s: Unable to convert from %s to %s\n",
G_STRLOC,
g_type_name (G_VALUE_TYPE (value)),
- g_type_name (tree_store->column_headers[column]));
+ g_type_name (priv->column_headers[column]));
return retval;
}
if (!g_value_transform (value, &real_value))
@@ -805,7 +839,7 @@ gtk_tree_store_real_set_value (GtkTreeStore *tree_store,
g_warning ("%s: Unable to make conversion from %s to %s\n",
G_STRLOC,
g_type_name (G_VALUE_TYPE (value)),
- g_type_name (tree_store->column_headers[column]));
+ g_type_name (priv->column_headers[column]));
g_value_unset (&real_value);
return retval;
}
@@ -889,7 +923,7 @@ gtk_tree_store_set_value (GtkTreeStore *tree_store,
{
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
g_return_if_fail (VALID_ITER (iter, tree_store));
- g_return_if_fail (column >= 0 && column < tree_store->n_columns);
+ g_return_if_fail (column >= 0 && column < tree_store->priv->n_columns);
g_return_if_fail (G_IS_VALUE (value));
if (gtk_tree_store_real_set_value (tree_store, iter, column, value, TRUE))
@@ -905,22 +939,23 @@ gtk_tree_store_set_value (GtkTreeStore *tree_store,
static GtkTreeIterCompareFunc
gtk_tree_store_get_compare_func (GtkTreeStore *tree_store)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreeIterCompareFunc func = NULL;
if (GTK_TREE_STORE_IS_SORTED (tree_store))
{
- if (tree_store->sort_column_id != -1)
+ if (priv->sort_column_id != -1)
{
GtkTreeDataSortHeader *header;
- header = _gtk_tree_data_list_get_header (tree_store->sort_list,
- tree_store->sort_column_id);
+ header = _gtk_tree_data_list_get_header (priv->sort_list,
+ priv->sort_column_id);
g_return_val_if_fail (header != NULL, NULL);
g_return_val_if_fail (header->func != NULL, NULL);
func = header->func;
}
else
{
- func = tree_store->default_sort_func;
+ func = priv->default_sort_func;
}
}
@@ -936,6 +971,7 @@ gtk_tree_store_set_vector_internal (GtkTreeStore *tree_store,
GValue *values,
gint n_values)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
gint i;
GtkTreeIterCompareFunc func = NULL;
@@ -950,7 +986,7 @@ gtk_tree_store_set_vector_internal (GtkTreeStore *tree_store,
FALSE) || *emit_signal;
if (func == _gtk_tree_data_list_compare_func &&
- columns[i] == tree_store->sort_column_id)
+ columns[i] == priv->sort_column_id)
*maybe_need_sort = TRUE;
}
}
@@ -962,6 +998,7 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
gboolean *maybe_need_sort,
va_list var_args)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
gint column;
GtkTreeIterCompareFunc func = NULL;
@@ -976,12 +1013,12 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
GValue value = { 0, };
gchar *error = NULL;
- if (column < 0 || column >= tree_store->n_columns)
+ if (column < 0 || column >= priv->n_columns)
{
g_warning ("%s: Invalid column number %d added to iter (remember to end your list of columns with a -1)", G_STRLOC, column);
break;
}
- g_value_init (&value, tree_store->column_headers[column]);
+ g_value_init (&value, priv->column_headers[column]);
G_VALUE_COLLECT (&value, var_args, 0, &error);
if (error)
@@ -1002,7 +1039,7 @@ gtk_tree_store_set_valist_internal (GtkTreeStore *tree_store,
FALSE) || *emit_signal;
if (func == _gtk_tree_data_list_compare_func &&
- column == tree_store->sort_column_id)
+ column == priv->sort_column_id)
*maybe_need_sort = TRUE;
g_value_unset (&value);
@@ -1033,6 +1070,7 @@ gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,
GValue *values,
gint n_values)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
gboolean emit_signal = FALSE;
gboolean maybe_need_sort = FALSE;
@@ -1045,7 +1083,7 @@ gtk_tree_store_set_valuesv (GtkTreeStore *tree_store,
columns, values, n_values);
if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
- gtk_tree_store_sort_iter_changed (tree_store, iter, tree_store->sort_column_id, TRUE);
+ gtk_tree_store_sort_iter_changed (tree_store, iter, priv->sort_column_id, TRUE);
if (emit_signal)
{
@@ -1072,6 +1110,7 @@ gtk_tree_store_set_valist (GtkTreeStore *tree_store,
GtkTreeIter *iter,
va_list var_args)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
gboolean emit_signal = FALSE;
gboolean maybe_need_sort = FALSE;
@@ -1084,7 +1123,7 @@ gtk_tree_store_set_valist (GtkTreeStore *tree_store,
var_args);
if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
- gtk_tree_store_sort_iter_changed (tree_store, iter, tree_store->sort_column_id, TRUE);
+ gtk_tree_store_sort_iter_changed (tree_store, iter, priv->sort_column_id, TRUE);
if (emit_signal)
{
@@ -1139,6 +1178,7 @@ gboolean
gtk_tree_store_remove (GtkTreeStore *tree_store,
GtkTreeIter *iter)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GtkTreeIter new_iter = {0,};
GNode *parent;
@@ -1154,21 +1194,21 @@ gtk_tree_store_remove (GtkTreeStore *tree_store,
if (G_NODE (iter->user_data)->data)
g_node_traverse (G_NODE (iter->user_data), G_POST_ORDER, G_TRAVERSE_ALL,
- -1, node_free, tree_store->column_headers);
+ -1, node_free, priv->column_headers);
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), iter);
g_node_destroy (G_NODE (iter->user_data));
gtk_tree_model_row_deleted (GTK_TREE_MODEL (tree_store), path);
- if (parent != G_NODE (tree_store->root))
+ if (parent != G_NODE (priv->root))
{
/* child_toggled */
if (parent->children == NULL)
{
gtk_tree_path_up (path);
- new_iter.stamp = tree_store->stamp;
+ new_iter.stamp = priv->stamp;
new_iter.user_data = parent;
gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, &new_iter);
}
@@ -1178,7 +1218,7 @@ gtk_tree_store_remove (GtkTreeStore *tree_store,
/* revalidate iter */
if (next_node != NULL)
{
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = next_node;
return TRUE;
}
@@ -1213,6 +1253,7 @@ gtk_tree_store_insert (GtkTreeStore *tree_store,
GtkTreeIter *parent,
gint position)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
@@ -1225,20 +1266,20 @@ gtk_tree_store_insert (GtkTreeStore *tree_store,
if (parent)
parent_node = parent->user_data;
else
- parent_node = tree_store->root;
+ parent_node = priv->root;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
new_node = g_node_new (NULL);
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = new_node;
g_node_insert (parent_node, position, new_node);
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 != tree_store->root)
+ if (parent_node != priv->root)
{
if (new_node->prev == NULL && new_node->next == NULL)
{
@@ -1276,6 +1317,7 @@ gtk_tree_store_insert_before (GtkTreeStore *tree_store,
GtkTreeIter *parent,
GtkTreeIter *sibling)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GNode *parent_node = NULL;
GNode *new_node;
@@ -1288,7 +1330,7 @@ gtk_tree_store_insert_before (GtkTreeStore *tree_store,
g_return_if_fail (VALID_ITER (sibling, tree_store));
if (parent == NULL && sibling == NULL)
- parent_node = tree_store->root;
+ parent_node = priv->root;
else if (parent == NULL)
parent_node = G_NODE (sibling->user_data)->parent;
else if (sibling == NULL)
@@ -1299,7 +1341,7 @@ gtk_tree_store_insert_before (GtkTreeStore *tree_store,
parent_node = G_NODE (parent->user_data);
}
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
new_node = g_node_new (NULL);
@@ -1307,19 +1349,19 @@ gtk_tree_store_insert_before (GtkTreeStore *tree_store,
sibling ? G_NODE (sibling->user_data) : NULL,
new_node);
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = new_node;
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 != tree_store->root)
+ if (parent_node != priv->root)
{
if (new_node->prev == NULL && new_node->next == NULL)
{
GtkTreeIter parent_iter;
- parent_iter.stamp = tree_store->stamp;
+ parent_iter.stamp = priv->stamp;
parent_iter.user_data = parent_node;
gtk_tree_path_up (path);
@@ -1356,6 +1398,7 @@ gtk_tree_store_insert_after (GtkTreeStore *tree_store,
GtkTreeIter *parent,
GtkTreeIter *sibling)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
@@ -1368,7 +1411,7 @@ gtk_tree_store_insert_after (GtkTreeStore *tree_store,
g_return_if_fail (VALID_ITER (sibling, tree_store));
if (parent == NULL && sibling == NULL)
- parent_node = tree_store->root;
+ parent_node = priv->root;
else if (parent == NULL)
parent_node = G_NODE (sibling->user_data)->parent;
else if (sibling == NULL)
@@ -1380,7 +1423,7 @@ gtk_tree_store_insert_after (GtkTreeStore *tree_store,
parent_node = G_NODE (parent->user_data);
}
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
new_node = g_node_new (NULL);
@@ -1388,19 +1431,19 @@ gtk_tree_store_insert_after (GtkTreeStore *tree_store,
sibling ? G_NODE (sibling->user_data) : NULL,
new_node);
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = new_node;
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 != tree_store->root)
+ if (parent_node != priv->root)
{
if (new_node->prev == NULL && new_node->next == NULL)
{
GtkTreeIter parent_iter;
- parent_iter.stamp = tree_store->stamp;
+ parent_iter.stamp = priv->stamp;
parent_iter.user_data = parent_node;
gtk_tree_path_up (path);
@@ -1449,6 +1492,7 @@ gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
gint position,
...)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
@@ -1468,13 +1512,13 @@ gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
if (parent)
parent_node = parent->user_data;
else
- parent_node = tree_store->root;
+ parent_node = priv->root;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
new_node = g_node_new (NULL);
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = new_node;
g_node_insert (parent_node, position, new_node);
@@ -1485,12 +1529,12 @@ gtk_tree_store_insert_with_values (GtkTreeStore *tree_store,
va_end (var_args);
if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
- gtk_tree_store_sort_iter_changed (tree_store, iter, tree_store->sort_column_id, FALSE);
+ 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 != tree_store->root)
+ if (parent_node != priv->root)
{
if (new_node->prev == NULL && new_node->next == NULL)
{
@@ -1529,6 +1573,7 @@ gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
GValue *values,
gint n_values)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GtkTreePath *path;
GNode *parent_node;
GNode *new_node;
@@ -1547,13 +1592,13 @@ gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
if (parent)
parent_node = parent->user_data;
else
- parent_node = tree_store->root;
+ parent_node = priv->root;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
new_node = g_node_new (NULL);
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = new_node;
g_node_insert (parent_node, position, new_node);
@@ -1562,12 +1607,12 @@ gtk_tree_store_insert_with_valuesv (GtkTreeStore *tree_store,
columns, values, n_values);
if (maybe_need_sort && GTK_TREE_STORE_IS_SORTED (tree_store))
- gtk_tree_store_sort_iter_changed (tree_store, iter, tree_store->sort_column_id, FALSE);
+ 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 != tree_store->root)
+ if (parent_node != priv->root)
{
if (new_node->prev == NULL && new_node->next == NULL)
{
@@ -1598,6 +1643,7 @@ gtk_tree_store_prepend (GtkTreeStore *tree_store,
GtkTreeIter *iter,
GtkTreeIter *parent)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *parent_node;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
@@ -1605,10 +1651,10 @@ gtk_tree_store_prepend (GtkTreeStore *tree_store,
if (parent != NULL)
g_return_if_fail (VALID_ITER (parent, tree_store));
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
if (parent == NULL)
- parent_node = tree_store->root;
+ parent_node = priv->root;
else
parent_node = parent->user_data;
@@ -1616,7 +1662,7 @@ gtk_tree_store_prepend (GtkTreeStore *tree_store,
{
GtkTreePath *path;
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = g_node_new (NULL);
g_node_prepend (parent_node, G_NODE (iter->user_data));
@@ -1624,7 +1670,7 @@ gtk_tree_store_prepend (GtkTreeStore *tree_store,
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 != tree_store->root)
+ if (parent_node != priv->root)
{
gtk_tree_path_up (path);
gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
@@ -1656,6 +1702,7 @@ gtk_tree_store_append (GtkTreeStore *tree_store,
GtkTreeIter *iter,
GtkTreeIter *parent)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *parent_node;
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
@@ -1664,17 +1711,17 @@ gtk_tree_store_append (GtkTreeStore *tree_store,
g_return_if_fail (VALID_ITER (parent, tree_store));
if (parent == NULL)
- parent_node = tree_store->root;
+ parent_node = priv->root;
else
parent_node = parent->user_data;
- tree_store->columns_dirty = TRUE;
+ priv->columns_dirty = TRUE;
if (parent_node->children == NULL)
{
GtkTreePath *path;
- iter->stamp = tree_store->stamp;
+ iter->stamp = priv->stamp;
iter->user_data = g_node_new (NULL);
g_node_append (parent_node, G_NODE (iter->user_data));
@@ -1682,7 +1729,7 @@ gtk_tree_store_append (GtkTreeStore *tree_store,
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 != tree_store->root)
+ if (parent_node != priv->root)
{
gtk_tree_path_up (path);
gtk_tree_model_row_has_child_toggled (GTK_TREE_MODEL (tree_store), path, parent);
@@ -1766,7 +1813,7 @@ gtk_tree_store_clear_traverse (GNode *node,
if (node->parent)
{
- iter.stamp = store->stamp;
+ iter.stamp = store->priv->stamp;
iter.user_data = node;
gtk_tree_store_remove (store, &iter);
@@ -1774,7 +1821,7 @@ gtk_tree_store_clear_traverse (GNode *node,
}
else if (node->parent)
{
- iter.stamp = store->stamp;
+ iter.stamp = store->priv->stamp;
iter.user_data = node;
gtk_tree_store_remove (store, &iter);
@@ -1786,11 +1833,12 @@ gtk_tree_store_clear_traverse (GNode *node,
static void
gtk_tree_store_increment_stamp (GtkTreeStore *tree_store)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
do
{
- tree_store->stamp++;
+ priv->stamp++;
}
- while (tree_store->stamp == 0);
+ while (priv->stamp == 0);
}
/**
@@ -1804,7 +1852,7 @@ gtk_tree_store_clear (GtkTreeStore *tree_store)
{
g_return_if_fail (GTK_IS_TREE_STORE (tree_store));
- gtk_tree_store_clear_traverse (tree_store->root, tree_store);
+ gtk_tree_store_clear_traverse (tree_store->priv->root, tree_store);
gtk_tree_store_increment_stamp (tree_store);
}
@@ -1856,7 +1904,7 @@ gtk_tree_store_iter_is_valid (GtkTreeStore *tree_store,
if (!VALID_ITER (iter, tree_store))
return FALSE;
- return gtk_tree_store_iter_is_valid_helper (iter, tree_store->root);
+ return gtk_tree_store_iter_is_valid_helper (iter, tree_store->priv->root);
}
/* DND */
@@ -1928,7 +1976,7 @@ copy_node_data (GtkTreeStore *tree_store,
col = 0;
while (dl)
{
- copy_iter = _gtk_tree_data_list_node_copy (dl, tree_store->column_headers[col]);
+ copy_iter = _gtk_tree_data_list_node_copy (dl, tree_store->priv->column_headers[col]);
if (copy_head == NULL)
copy_head = copy_iter;
@@ -2204,7 +2252,7 @@ gtk_tree_store_reorder (GtkTreeStore *tree_store,
g_return_if_fail (new_order != NULL);
if (!parent)
- level = G_NODE (tree_store->root)->children;
+ level = G_NODE (tree_store->priv->root)->children;
else
level = G_NODE (parent->user_data)->children;
@@ -2246,7 +2294,7 @@ gtk_tree_store_reorder (GtkTreeStore *tree_store,
if (parent)
G_NODE (parent->user_data)->children = sort_array[0].node;
else
- G_NODE (tree_store->root)->children = sort_array[0].node;
+ G_NODE (tree_store->priv->root)->children = sort_array[0].node;
/* emit signal */
if (parent)
@@ -2307,11 +2355,11 @@ gtk_tree_store_swap (GtkTreeStore *tree_store,
{
gtk_tree_path_free (path_a);
gtk_tree_path_free (path_b);
-
+
g_warning ("Given children are not in the same level\n");
return;
}
- parent_node = G_NODE (tree_store->root);
+ parent_node = G_NODE (tree_store->priv->root);
}
else
{
@@ -2319,7 +2367,7 @@ gtk_tree_store_swap (GtkTreeStore *tree_store,
{
gtk_tree_path_free (path_a);
gtk_tree_path_free (path_b);
-
+
g_warning ("Given children don't have a common parent\n");
return;
}
@@ -2396,7 +2444,7 @@ gtk_tree_store_swap (GtkTreeStore *tree_store,
order[i] = i;
gtk_tree_model_rows_reordered (GTK_TREE_MODEL (tree_store), path_a,
- parent_node == tree_store->root
+ parent_node == tree_store->priv->root
? NULL : &parent, order);
gtk_tree_path_free (path_a);
g_free (order);
@@ -2494,7 +2542,7 @@ gtk_tree_store_move (GtkTreeStore *tree_store,
parent = G_NODE (parent_iter.user_data);
}
else
- parent = G_NODE (tree_store->root);
+ parent = G_NODE (tree_store->priv->root);
/* yes, I know that this can be done shorter, but I'm doing it this way
* so the code is also maintainable
@@ -2772,6 +2820,7 @@ gtk_tree_store_compare_func (gconstpointer a,
gpointer user_data)
{
GtkTreeStore *tree_store = user_data;
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *node_a;
GNode *node_b;
GtkTreeIterCompareFunc func;
@@ -2781,12 +2830,12 @@ gtk_tree_store_compare_func (gconstpointer a,
GtkTreeIter iter_b;
gint retval;
- if (tree_store->sort_column_id != -1)
+ if (priv->sort_column_id != -1)
{
GtkTreeDataSortHeader *header;
- header = _gtk_tree_data_list_get_header (tree_store->sort_list,
- tree_store->sort_column_id);
+ header = _gtk_tree_data_list_get_header (priv->sort_list,
+ priv->sort_column_id);
g_return_val_if_fail (header != NULL, 0);
g_return_val_if_fail (header->func != NULL, 0);
@@ -2795,22 +2844,22 @@ gtk_tree_store_compare_func (gconstpointer a,
}
else
{
- g_return_val_if_fail (tree_store->default_sort_func != NULL, 0);
- func = tree_store->default_sort_func;
- data = tree_store->default_sort_data;
+ g_return_val_if_fail (priv->default_sort_func != NULL, 0);
+ func = priv->default_sort_func;
+ data = priv->default_sort_data;
}
node_a = ((SortTuple *) a)->node;
node_b = ((SortTuple *) b)->node;
- iter_a.stamp = tree_store->stamp;
+ iter_a.stamp = priv->stamp;
iter_a.user_data = node_a;
- iter_b.stamp = tree_store->stamp;
+ iter_b.stamp = priv->stamp;
iter_b.user_data = node_b;
retval = (* func) (GTK_TREE_MODEL (user_data), &iter_a, &iter_b, data);
- if (tree_store->order == GTK_SORT_DESCENDING)
+ if (priv->order == GTK_SORT_DESCENDING)
{
if (retval > 0)
retval = -1;
@@ -2879,7 +2928,7 @@ gtk_tree_store_sort_helper (GtkTreeStore *tree_store,
for (i = 0; i < list_length; i++)
new_order[i] = g_array_index (sort_array, SortTuple, i).offset;
- iter.stamp = tree_store->stamp;
+ iter.stamp = tree_store->priv->stamp;
iter.user_data = parent;
path = gtk_tree_store_get_path (GTK_TREE_MODEL (tree_store), &iter);
gtk_tree_model_rows_reordered (GTK_TREE_MODEL (tree_store),
@@ -2901,15 +2950,17 @@ gtk_tree_store_sort_helper (GtkTreeStore *tree_store,
static void
gtk_tree_store_sort (GtkTreeStore *tree_store)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
+
if (!GTK_TREE_STORE_IS_SORTED (tree_store))
return;
- if (tree_store->sort_column_id != -1)
+ if (priv->sort_column_id != -1)
{
GtkTreeDataSortHeader *header = NULL;
- header = _gtk_tree_data_list_get_header (tree_store->sort_list,
- tree_store->sort_column_id);
+ header = _gtk_tree_data_list_get_header (priv->sort_list,
+ priv->sort_column_id);
/* We want to make sure that we have a function */
g_return_if_fail (header != NULL);
@@ -2917,10 +2968,10 @@ gtk_tree_store_sort (GtkTreeStore *tree_store)
}
else
{
- g_return_if_fail (tree_store->default_sort_func != NULL);
+ g_return_if_fail (priv->default_sort_func != NULL);
}
- gtk_tree_store_sort_helper (tree_store, G_NODE (tree_store->root), TRUE);
+ gtk_tree_store_sort_helper (tree_store, G_NODE (priv->root), TRUE);
}
static void
@@ -2929,6 +2980,7 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
gint column,
gboolean emit_signal)
{
+ GtkTreeStorePrivate *priv = tree_store->priv;
GNode *prev = NULL;
GNode *next = NULL;
GNode *node;
@@ -2946,12 +2998,12 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
g_return_if_fail (G_NODE (iter->user_data)->parent != NULL);
- tmp_iter.stamp = tree_store->stamp;
- if (tree_store->sort_column_id != -1)
+ tmp_iter.stamp = priv->stamp;
+ if (priv->sort_column_id != -1)
{
GtkTreeDataSortHeader *header;
- header = _gtk_tree_data_list_get_header (tree_store->sort_list,
- tree_store->sort_column_id);
+ header = _gtk_tree_data_list_get_header (priv->sort_list,
+ priv->sort_column_id);
g_return_if_fail (header != NULL);
g_return_if_fail (header->func != NULL);
func = header->func;
@@ -2959,14 +3011,14 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
}
else
{
- g_return_if_fail (tree_store->default_sort_func != NULL);
- func = tree_store->default_sort_func;
- data = tree_store->default_sort_data;
+ g_return_if_fail (priv->default_sort_func != NULL);
+ func = priv->default_sort_func;
+ data = priv->default_sort_data;
}
/* If it's the built in function, we don't sort. */
if (func == _gtk_tree_data_list_compare_func &&
- tree_store->sort_column_id != column)
+ priv->sort_column_id != column)
return;
old_location = 0;
@@ -2997,7 +3049,7 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
cmp_b = (* func) (GTK_TREE_MODEL (tree_store), iter, &tmp_iter, data);
}
- if (tree_store->order == GTK_SORT_DESCENDING)
+ if (priv->order == GTK_SORT_DESCENDING)
{
if (cmp_a < 0)
cmp_a = 1;
@@ -3037,7 +3089,7 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
node = node->parent->children;
new_location = 0;
tmp_iter.user_data = node;
- if (tree_store->order == GTK_SORT_DESCENDING)
+ if (priv->order == GTK_SORT_DESCENDING)
cmp_a = (* func) (GTK_TREE_MODEL (tree_store), &tmp_iter, iter, data);
else
cmp_a = (* func) (GTK_TREE_MODEL (tree_store), iter, &tmp_iter, data);
@@ -3048,7 +3100,7 @@ gtk_tree_store_sort_iter_changed (GtkTreeStore *tree_store,
node = node->next;
new_location++;
tmp_iter.user_data = node;
- if (tree_store->order == GTK_SORT_DESCENDING)
+ if (priv->order == GTK_SORT_DESCENDING)
cmp_a = (* func) (GTK_TREE_MODEL (tree_store), &tmp_iter, iter, data);
else
cmp_a = (* func) (GTK_TREE_MODEL (tree_store), iter, &tmp_iter, data);
@@ -3123,14 +3175,15 @@ gtk_tree_store_get_sort_column_id (GtkTreeSortable *sortable,
GtkSortType *order)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
+ GtkTreeStorePrivate *priv = tree_store->priv;
if (sort_column_id)
- * sort_column_id = tree_store->sort_column_id;
+ * sort_column_id = priv->sort_column_id;
if (order)
- * order = tree_store->order;
+ * order = priv->order;
- if (tree_store->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID ||
- tree_store->sort_column_id == GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
+ if (priv->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID ||
+ priv->sort_column_id == GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
return FALSE;
return TRUE;
@@ -3142,10 +3195,10 @@ gtk_tree_store_set_sort_column_id (GtkTreeSortable *sortable,
GtkSortType order)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
+ GtkTreeStorePrivate *priv = tree_store->priv;
-
- if ((tree_store->sort_column_id == sort_column_id) &&
- (tree_store->order == order))
+ if ((priv->sort_column_id == sort_column_id) &&
+ (priv->order == order))
return;
if (sort_column_id != GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID)
@@ -3154,7 +3207,7 @@ gtk_tree_store_set_sort_column_id (GtkTreeSortable *sortable,
{
GtkTreeDataSortHeader *header = NULL;
- header = _gtk_tree_data_list_get_header (tree_store->sort_list,
+ header = _gtk_tree_data_list_get_header (priv->sort_list,
sort_column_id);
/* We want to make sure that we have a function */
@@ -3163,12 +3216,12 @@ gtk_tree_store_set_sort_column_id (GtkTreeSortable *sortable,
}
else
{
- g_return_if_fail (tree_store->default_sort_func != NULL);
+ g_return_if_fail (priv->default_sort_func != NULL);
}
}
- tree_store->sort_column_id = sort_column_id;
- tree_store->order = order;
+ priv->sort_column_id = sort_column_id;
+ priv->order = order;
gtk_tree_sortable_sort_column_changed (sortable);
@@ -3183,12 +3236,13 @@ gtk_tree_store_set_sort_func (GtkTreeSortable *sortable,
GDestroyNotify destroy)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
+ GtkTreeStorePrivate *priv = tree_store->priv;
- tree_store->sort_list = _gtk_tree_data_list_set_header (tree_store->sort_list,
- sort_column_id,
- func, data, destroy);
+ priv->sort_list = _gtk_tree_data_list_set_header (priv->sort_list,
+ sort_column_id,
+ func, data, destroy);
- if (tree_store->sort_column_id == sort_column_id)
+ if (priv->sort_column_id == sort_column_id)
gtk_tree_store_sort (tree_store);
}
@@ -3199,20 +3253,21 @@ gtk_tree_store_set_default_sort_func (GtkTreeSortable *sortable,
GDestroyNotify destroy)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
+ GtkTreeStorePrivate *priv = tree_store->priv;
- if (tree_store->default_sort_destroy)
+ if (priv->default_sort_destroy)
{
- GDestroyNotify d = tree_store->default_sort_destroy;
+ GDestroyNotify d = priv->default_sort_destroy;
- tree_store->default_sort_destroy = NULL;
- d (tree_store->default_sort_data);
+ priv->default_sort_destroy = NULL;
+ d (priv->default_sort_data);
}
- tree_store->default_sort_func = func;
- tree_store->default_sort_data = data;
- tree_store->default_sort_destroy = destroy;
+ priv->default_sort_func = func;
+ priv->default_sort_data = data;
+ priv->default_sort_destroy = destroy;
- if (tree_store->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID)
+ if (priv->sort_column_id == GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID)
gtk_tree_store_sort (tree_store);
}
@@ -3221,7 +3276,7 @@ gtk_tree_store_has_default_sort_func (GtkTreeSortable *sortable)
{
GtkTreeStore *tree_store = (GtkTreeStore *) sortable;
- return (tree_store->default_sort_func != NULL);
+ return (tree_store->priv->default_sort_func != NULL);
}
static void
diff --git a/gtk/gtktreestore.h b/gtk/gtktreestore.h
index aee9bac..5fba118 100644
--- a/gtk/gtktreestore.h
+++ b/gtk/gtktreestore.h
@@ -40,25 +40,15 @@ G_BEGIN_DECLS
#define GTK_IS_TREE_STORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TREE_STORE))
#define GTK_TREE_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_TREE_STORE, GtkTreeStoreClass))
-typedef struct _GtkTreeStore GtkTreeStore;
-typedef struct _GtkTreeStoreClass GtkTreeStoreClass;
+typedef struct _GtkTreeStore GtkTreeStore;
+typedef struct _GtkTreeStoreClass GtkTreeStoreClass;
+typedef struct _GtkTreeStorePrivate GtkTreeStorePrivate;
struct _GtkTreeStore
{
GObject parent;
- gint GSEAL (stamp);
- gpointer GSEAL (root);
- gpointer GSEAL (last);
- gint GSEAL (n_columns);
- gint GSEAL (sort_column_id);
- GList *GSEAL (sort_list);
- GtkSortType GSEAL (order);
- GType *GSEAL (column_headers);
- GtkTreeIterCompareFunc GSEAL (default_sort_func);
- gpointer GSEAL (default_sort_data);
- GDestroyNotify GSEAL (default_sort_destroy);
- guint GSEAL (columns_dirty) : 1;
+ GtkTreeStorePrivate *priv;
};
struct _GtkTreeStoreClass
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]