Commit ae89b1e1 authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

add this

2001-01-04  Havoc Pennington  <hp@redhat.com>

	* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
	this

	* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
	user_data instead of tree_node

	* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
	TREE_VIEW_COLUMN_SIZE

	* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
	"size" field to "width" finishes bug 40061

	* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
	for bitfields, bug 40268
parent c020b3b4
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
2001-01-04 Havoc Pennington <hp@redhat.com>
* gtk/gtktreeselection.c (gtk_tree_selection_get_tree_view): add
this
* gtk/gtktreemodel.h (struct _GtkTreeIter): rename fields to
user_data instead of tree_node
* gtk/gtktreeprivate.h (TREE_VIEW_COLUMN_WIDTH): rename from
TREE_VIEW_COLUMN_SIZE
* gtk/gtktreeviewcolumn.h (struct _GtkTreeViewColumn): rename
"size" field to "width" finishes bug 40061
* gtk/gtkcellrenderer.h: Use GtkCellRendererState instead of guint
for bitfields, bug 40268
2001-01-04 Havoc Pennington <hp@redhat.com>
Rename some stuff:
......
......@@ -212,13 +212,13 @@ gtk_cell_renderer_get_size (GtkCellRenderer *cell,
}
void
gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
guint flags)
gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags)
{
/* It's actually okay to pass in a NULL cell, as we run into that
* a lot
......@@ -238,13 +238,13 @@ gtk_cell_renderer_render (GtkCellRenderer *cell,
}
gint
gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags)
gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags)
{
/* It's actually okay to pass in a NULL cell, as we run into that
* a lot
......
......@@ -65,43 +65,43 @@ struct _GtkCellRendererClass
GtkWidget *widget,
gint *width,
gint *height);
void (* render) (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
guint flags);
gint (* event) (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
void (* render) (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags);
gint (* event) (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
};
GtkType gtk_cell_renderer_get_type (void);
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
gint *width,
gint *height);
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
guint flags);
gint gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
guint flags);
void gtk_cell_renderer_get_size (GtkCellRenderer *cell,
GtkWidget *widget,
gint *width,
gint *height);
void gtk_cell_renderer_render (GtkCellRenderer *cell,
GdkWindow *window,
GtkWidget *widget,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GdkRectangle *expose_area,
GtkCellRendererState flags);
gint gtk_cell_renderer_event (GtkCellRenderer *cell,
GdkEvent *event,
GtkWidget *widget,
gchar *path,
GdkRectangle *background_area,
GdkRectangle *cell_area,
GtkCellRendererState flags);
#ifdef __cplusplus
}
......
......@@ -280,10 +280,10 @@ gtk_list_store_get_iter (GtkTreeModel *tree_model,
g_return_val_if_fail (gtk_tree_path_get_depth (path) > 0, FALSE);
iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
iter->tree_node = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root),
iter->user_data = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root),
gtk_tree_path_get_indices (path)[0]);
return iter->tree_node != NULL;
return iter->user_data != NULL;
}
static GtkTreePath *
......@@ -299,7 +299,7 @@ gtk_list_store_get_path (GtkTreeModel *tree_model,
for (list = G_SLIST (GTK_LIST_STORE (tree_model)->root); list; list = list->next)
{
if (list == G_SLIST (iter->tree_node))
if (list == G_SLIST (iter->user_data))
break;
i++;
}
......@@ -324,7 +324,7 @@ gtk_list_store_get_value (GtkTreeModel *tree_model,
g_return_if_fail (column < GTK_LIST_STORE (tree_model)->n_columns);
g_return_if_fail (GTK_LIST_STORE (tree_model)->stamp == iter->stamp);
list = G_SLIST (iter->tree_node)->data;
list = G_SLIST (iter->user_data)->data;
while (tmp_column-- > 0 && list)
list = list->next;
......@@ -344,9 +344,9 @@ gtk_list_store_iter_next (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_IS_LIST_STORE (tree_model), FALSE);
g_return_val_if_fail (GTK_LIST_STORE (tree_model)->stamp == iter->stamp, FALSE);
iter->tree_node = G_SLIST (iter->tree_node)->next;
iter->user_data = G_SLIST (iter->user_data)->next;
return (iter->tree_node != NULL);
return (iter->user_data != NULL);
}
static gboolean
......@@ -355,7 +355,7 @@ gtk_list_store_iter_children (GtkTreeModel *tree_model,
GtkTreeIter *parent)
{
iter->stamp = 0;
iter->tree_node = NULL;
iter->user_data = NULL;
return FALSE;
}
......@@ -389,18 +389,18 @@ gtk_list_store_iter_nth_child (GtkTreeModel *tree_model,
{
g_return_val_if_fail (iter->stamp == GTK_LIST_STORE (tree_model)->stamp, FALSE);
iter->stamp = 0;
iter->tree_node = NULL;
iter->user_data = NULL;
return FALSE;
}
iter->tree_node = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root), n);
if (iter->tree_node)
iter->user_data = g_slist_nth (G_SLIST (GTK_LIST_STORE (tree_model)->root), n);
if (iter->user_data)
iter->stamp = GTK_LIST_STORE (tree_model)->stamp;
else
iter->stamp = 0;
return (iter->tree_node != NULL);
return (iter->user_data != NULL);
}
static gboolean
......@@ -409,7 +409,7 @@ gtk_list_store_iter_parent (GtkTreeModel *tree_model,
GtkTreeIter *child)
{
iter->stamp = 0;
iter->tree_node = NULL;
iter->user_data = NULL;
return FALSE;
}
......@@ -432,7 +432,7 @@ gtk_list_store_set_cell (GtkListStore *list_store,
g_return_if_fail (iter != NULL);
g_return_if_fail (column >= 0 && column < list_store->n_columns);
prev = list = G_SLIST (iter->tree_node)->data;
prev = list = G_SLIST (iter->user_data)->data;
while (list != NULL)
{
......@@ -450,9 +450,9 @@ gtk_list_store_set_cell (GtkListStore *list_store,
list = list->next;
}
if (G_SLIST (iter->tree_node)->data == NULL)
if (G_SLIST (iter->user_data)->data == NULL)
{
G_SLIST (iter->tree_node)->data = list = _gtk_tree_data_list_alloc ();
G_SLIST (iter->user_data)->data = list = _gtk_tree_data_list_alloc ();
list->next = NULL;
}
else
......@@ -483,13 +483,13 @@ gtk_list_store_remove (GtkListStore *list_store,
g_return_if_fail (list_store != NULL);
g_return_if_fail (GTK_IS_LIST_STORE (list_store));
if (G_SLIST (iter->tree_node)->data)
_gtk_tree_data_list_free ((GtkTreeDataList *) G_SLIST (iter->tree_node)->data,
if (G_SLIST (iter->user_data)->data)
_gtk_tree_data_list_free ((GtkTreeDataList *) G_SLIST (iter->user_data)->data,
list_store->column_headers);
path = gtk_list_store_get_path (GTK_TREE_MODEL (list_store), iter);
list_store->root = g_slist_remove_link (G_SLIST (list_store->root),
G_SLIST (iter->tree_node));
G_SLIST (iter->user_data));
list_store->stamp ++;
gtk_signal_emit_by_name (GTK_OBJECT (list_store),
"deleted",
......@@ -517,13 +517,13 @@ gtk_list_store_insert (GtkListStore *list_store,
}
iter->stamp = list_store->stamp;
iter->tree_node = g_slist_alloc ();
iter->user_data = g_slist_alloc ();
list = g_slist_nth (G_SLIST (list_store->root), position - 1);
if (list)
{
G_SLIST (iter->tree_node)->next = list->next;
list->next = G_SLIST (iter->tree_node)->next;
G_SLIST (iter->user_data)->next = list->next;
list->next = G_SLIST (iter->user_data)->next;
}
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, position);
......@@ -554,10 +554,10 @@ gtk_list_store_insert_before (GtkListStore *list_store,
}
iter->stamp = list_store->stamp;
iter->tree_node = g_slist_alloc ();
iter->user_data = g_slist_alloc ();
prev = list = list_store->root;
while (list && list != sibling->tree_node)
while (list && list != sibling->user_data)
{
prev = list;
list = list->next;
......@@ -566,12 +566,12 @@ gtk_list_store_insert_before (GtkListStore *list_store,
if (prev)
{
prev->next = iter->tree_node;
prev->next = iter->user_data;
}
else
{
G_SLIST (iter->tree_node)->next = list_store->root;
list_store->root = iter->tree_node;
G_SLIST (iter->user_data)->next = list_store->root;
list_store->root = iter->user_data;
}
path = gtk_tree_path_new ();
......@@ -603,15 +603,15 @@ gtk_list_store_insert_after (GtkListStore *list_store,
return;
}
for (list = list_store->root; list && list != sibling->tree_node; list = list->next)
for (list = list_store->root; list && list != sibling->user_data; list = list->next)
i++;
g_return_if_fail (list != NULL);
iter->stamp = list_store->stamp;
iter->tree_node = g_slist_alloc ();
iter->user_data = g_slist_alloc ();
G_SLIST (iter->tree_node)->next = G_SLIST (sibling->tree_node)->next;
G_SLIST (iter->user_data)->next = G_SLIST (sibling->user_data)->next;
G_SLIST (sibling)->next = G_SLIST (iter);
path = gtk_tree_path_new ();
......@@ -633,10 +633,10 @@ gtk_list_store_prepend (GtkListStore *list_store,
g_return_if_fail (iter != NULL);
iter->stamp = list_store->stamp;
iter->tree_node = g_slist_alloc ();
iter->user_data = g_slist_alloc ();
G_SLIST (iter->tree_node)->next = G_SLIST (list_store->root);
list_store->root = iter->tree_node;
G_SLIST (iter->user_data)->next = G_SLIST (list_store->root);
list_store->root = iter->user_data;
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, 0);
......@@ -659,7 +659,7 @@ gtk_list_store_append (GtkListStore *list_store,
g_return_if_fail (iter != NULL);
iter->stamp = list_store->stamp;
iter->tree_node = g_slist_alloc ();
iter->user_data = g_slist_alloc ();
prev = list = list_store->root;
while (list)
......@@ -670,9 +670,9 @@ gtk_list_store_append (GtkListStore *list_store,
}
if (prev)
prev->next = iter->tree_node;
prev->next = iter->user_data;
else
list_store->root = iter->tree_node;
list_store->root = iter->user_data;
path = gtk_tree_path_new ();
gtk_tree_path_append_index (path, i);
......
......@@ -46,9 +46,9 @@ typedef enum
struct _GtkTreeIter
{
gint stamp;
gpointer tree_node;
gpointer tree_node2;
gpointer tree_node3;
gpointer user_data;
gpointer user_data2;
gpointer user_data3;
};
struct _GtkTreeModelIface
......
......@@ -390,7 +390,7 @@ gtk_tree_model_sort_changed (GtkTreeModel *s_model,
}
gtk_tree_model_get_iter (GTK_TREE_MODEL (data), &iter, path);
elt = (SortElt *) iter.tree_node;
elt = (SortElt *) iter.user_data;
array = get_array (elt, tree_model_sort);
/* FIXME: as an optimization for when the column other then the one we're
......@@ -445,8 +445,8 @@ gtk_tree_model_sort_insert_value (GtkTreeModelSort *sort,
return FALSE;
}
gtk_tree_model_get_iter (GTK_TREE_MODEL (sort), &iter, parent_path);
elt.parent = ((SortElt *) iter.tree_node);
array = ((SortElt *) iter.tree_node)->children;
elt.parent = ((SortElt *) iter.user_data);
array = ((SortElt *) iter.user_data)->children;
gtk_tree_path_free (parent_path);
if (array == NULL)
{
......@@ -584,7 +584,7 @@ gtk_tree_model_sort_deleted (GtkTreeModel *s_model,
gint i;
gtk_tree_model_get_iter (GTK_TREE_MODEL (tree_model_sort), &iter, path);
elt = (SortElt *) iter.tree_node;
elt = (SortElt *) iter.user_data;
offset = elt->offset;
array = get_array (elt, tree_model_sort);
if (array->len == 1)
......@@ -652,7 +652,7 @@ gtk_tree_model_sort_get_iter_helper (GtkTreeModelSort *tree_model_sort,
if (depth == gtk_tree_path_get_depth (path) - 1)
{
iter->stamp = tree_model_sort->stamp;
iter->tree_node = elt;
iter->user_data = elt;
return TRUE;
}
......@@ -713,7 +713,7 @@ gtk_tree_model_sort_get_value (GtkTreeModel *tree_model,
g_return_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL);
g_return_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == iter->stamp);
elt = iter->tree_node;
elt = iter->user_data;
gtk_tree_model_get_value (GTK_TREE_MODEL_SORT (tree_model)->child_model, (GtkTreeIter *)elt, column, value);
}
......@@ -729,7 +729,7 @@ gtk_tree_model_sort_iter_next (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL, FALSE);
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == iter->stamp, FALSE);
elt = iter->tree_node;
elt = iter->user_data;
array = get_array (elt, tree_model);
if (elt - ((SortElt*) array->data) >= array->len - 1)
......@@ -737,7 +737,7 @@ gtk_tree_model_sort_iter_next (GtkTreeModel *tree_model,
iter->stamp = 0;
return FALSE;
}
iter->tree_node = elt + 1;
iter->user_data = elt + 1;
return TRUE;
}
......@@ -755,7 +755,7 @@ gtk_tree_model_sort_iter_children (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == parent->stamp, FALSE);
if (parent)
elt = parent->tree_node;
elt = parent->user_data;
else
elt = (SortElt *) ((GArray *)GTK_TREE_MODEL_SORT (tree_model)->root)->data;
......@@ -770,7 +770,7 @@ gtk_tree_model_sort_iter_children (GtkTreeModel *tree_model,
return FALSE;
iter->stamp = GTK_TREE_MODEL_SORT (tree_model)->stamp;
iter->tree_node = elt->children->data;
iter->user_data = elt->children->data;
return TRUE;
}
......@@ -785,7 +785,7 @@ gtk_tree_model_sort_iter_has_child (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL, FALSE);
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == iter->stamp, FALSE);
elt = iter->tree_node;
elt = iter->user_data;
if (elt->children)
return TRUE;
......@@ -802,7 +802,7 @@ gtk_tree_model_sort_iter_n_children (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL, 0);
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == iter->stamp, 0);
elt = iter->tree_node;
elt = iter->user_data;
if (elt->children)
return elt->children->len;
......@@ -823,7 +823,7 @@ gtk_tree_model_sort_iter_nth_child (GtkTreeModel *tree_model,
if (parent)
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == parent->stamp, FALSE);
elt = iter->tree_node;
elt = iter->user_data;
if (elt->children == NULL)
......@@ -841,7 +841,7 @@ gtk_tree_model_sort_iter_nth_child (GtkTreeModel *tree_model,
return FALSE;
iter->stamp = GTK_TREE_MODEL_SORT (tree_model)->stamp;
iter->tree_node = &g_array_index (elt->children, SortElt, n);
iter->user_data = &g_array_index (elt->children, SortElt, n);
return TRUE;
}
......@@ -857,11 +857,11 @@ gtk_tree_model_sort_iter_parent (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->child_model != NULL, FALSE);
g_return_val_if_fail (GTK_TREE_MODEL_SORT (tree_model)->stamp == child->stamp, FALSE);
elt = iter->tree_node;
elt = iter->user_data;
if (elt->parent)
{
iter->stamp = GTK_TREE_MODEL_SORT (tree_model)->stamp;
iter->tree_node = elt->parent;
iter->user_data = elt->parent;
return TRUE;
}
......
......@@ -44,7 +44,7 @@ typedef enum
#define GTK_TREE_VIEW_UNSET_FLAG(tree_view, flag) G_STMT_START{ (tree_view->priv->flags&=~(flag)); }G_STMT_END
#define GTK_TREE_VIEW_FLAG_SET(tree_view, flag) ((tree_view->priv->flags&flag)==flag)
#define TREE_VIEW_HEADER_HEIGHT(tree_view) (GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_HEADERS_VISIBLE)?tree_view->priv->header_height:0)
#define TREE_VIEW_COLUMN_SIZE(column) (CLAMP (column->size, (column->min_width!=-1)?column->min_width:column->size, (column->max_width!=-1)?column->max_width:column->size))
#define TREE_VIEW_COLUMN_WIDTH(column) (CLAMP (column->width, (column->min_width!=-1)?column->min_width:column->width, (column->max_width!=-1)?column->max_width:column->width))
#define TREE_VIEW_DRAW_EXPANDERS(tree_view) (!GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_IS_LIST)&&GTK_TREE_VIEW_FLAG_SET (tree_view, GTK_TREE_VIEW_SHOW_EXPANDERS))
struct _GtkTreeViewPrivate
......
......@@ -239,6 +239,14 @@ gtk_tree_selection_get_user_data (GtkTreeSelection *selection)
return selection->user_data;
}
GtkTreeView*
gtk_tree_selection_get_tree_view (GtkTreeSelection *selection)
{
g_return_val_if_fail (GTK_IS_TREE_SELECTION (selection), NULL);
return selection->tree_view;
}
/**
* gtk_tree_selection_get_selected:
* @selection: A #GtkTreeSelection.
......
......@@ -76,7 +76,7 @@ void gtk_tree_selection_set_select_function (GtkTreeSelection
GtkTreeSelectionFunc func,
gpointer data);
gpointer gtk_tree_selection_get_user_data (GtkTreeSelection *selection);
GtkTreeView* gtk_tree_selection_get_tree_view (GtkTreeSelection *selection);
/* Only meaningful if GTK_TREE_SELECTION_SINGLE is set */
/* Use selected_foreach for GTK_TREE_SELECTION_MULTI */
......@@ -103,9 +103,6 @@ void gtk_tree_selection_select_range (GtkTreeSelection
GtkTreePath *end_path);
/*< private >*/
/* FIXME underscores, return GtkTreeSelection, rename from_tree_view */
#ifdef __cplusplus
}
#endif /* __cplusplus */
......
......@@ -286,10 +286,10 @@ gtk_tree_store_get_path (GtkTreeModel *tree_model,
g_return_val_if_fail (GTK_IS_TREE_STORE (tree_model), NULL);
g_return_val_if_fail (iter != NULL, NULL);
g_return_val_if_fail (GTK_TREE_STORE (tree_model)->stamp == iter->stamp, NULL);
if (iter->tree_node == NULL)
if (iter->user_data == NULL)
return NULL;
if (G_NODE (iter->tree_node)->parent == G_NODE (GTK_TREE_STORE (tree_model)->root))
if (G_NODE (iter->user_data)->parent == G_NODE (GTK_TREE_STORE (tree_model)->root))
{
retval = gtk_tree_path_new ();
tmp_node = G_NODE (GTK_TREE_STORE (tree_model)->root)->children;
......@@ -297,11 +297,11 @@ gtk_tree_store_get_path (GtkTreeModel *tree_model,
else
{
GtkTreeIter tmp_iter = *iter;
tmp_iter.tree_node = G_NODE (tmp_iter.tree_node)->parent;
tmp_iter.user_data = G_NODE (tmp_iter.user_data)->parent;
retval = gtk_tree_store_get_path (tree_model,
&tmp_iter);
tmp_node = G_NODE (iter->tree_node)->parent->children;
tmp_node = G_NODE (iter->user_data)->parent->children;
}
if (retval == NULL)
......@@ -315,7 +315,7 @@ gtk_tree_store_get_path (GtkTreeModel *tree_model,
for (; tmp_node; tmp_node = tmp_node->next)
{
if (tmp_node == G_NODE (iter->tree_node))
if (tmp_node == G_NODE (iter->user_data))
break;
i++;
}
......@@ -349,7 +349,7 @@ gtk_tree_store_get_value (GtkTreeModel *tree_model,
g_return_if_fail (iter->stamp == GTK_TREE_STORE (tree_model)->stamp);
g_return_if_fail (column < GTK_TREE_STORE (tree_model)->n_columns);
list = G_NODE (iter->tree_node)->data;
list = G_NODE (iter->user_data)->data;
while (tmp_column-- > 0 && list)
list = list->next;
......@@ -371,12 +371,12 @@ static gboolean
gtk_tree_store_iter_next (GtkTreeModel *tree_model,
GtkTreeIter *iter)
{
if (iter->tree_node == NULL)
if (iter->user_data == NULL)
return FALSE;
iter->tree_node = G_NODE (iter->tree_node)->next;
iter->user_data = G_NODE (iter->user_data)->next;
return (iter->tree_node != NULL);
return (iter->user_data != NULL);
}
static gboolean
......@@ -386,11 +386,11 @@ gtk_tree_store_iter_children (GtkTreeModel *tree_model,
{
iter->stamp = GTK_TREE_STORE (tree_model)->stamp;
if (parent)
iter->tree_node = G_NODE (parent->tree_node)->children;
iter->user_data = G_NODE (parent->user_data)->children;