Commit b41d6acd authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

add a finalize and destroy handler.

Mon Oct  1 16:08:23 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
	and destroy handler.

	* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963

	* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
	'start_editing' flag to select_cursor_row.  Bug spotted by Manish
	Singh <yosh@gimp.org>.
parent 06a50088
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
Mon Oct 1 16:08:23 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkliststore.c (gtk_list_store_class_init): add a finalize
and destroy handler.
* gtk/gtktreestore.c (gtk_list_store_class_init): ditto, #59963
* gtk/gtktreeview.h (struct _GtkTreeViewClass): Add
'start_editing' flag to select_cursor_row. Bug spotted by Manish
Singh <yosh@gimp.org>.
2001-10-01 Matthias Clasen <matthiasc@poet.de>
* gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace
......
......@@ -35,6 +35,8 @@ static void gtk_list_store_tree_model_init (GtkTreeModelIface *iface);
static void gtk_list_store_drag_source_init(GtkTreeDragSourceIface *iface);
static void gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface);
static void gtk_list_store_sortable_init (GtkTreeSortableIface *iface);
static void gtk_list_store_destroy (GtkObject *gobject);
static void gtk_list_store_finalize (GObject *object);
static guint gtk_list_store_get_flags (GtkTreeModel *tree_model);
static gint gtk_list_store_get_n_columns (GtkTreeModel *tree_model);
static GType gtk_list_store_get_column_type (GtkTreeModel *tree_model,
......@@ -193,8 +195,13 @@ static void
gtk_list_store_class_init (GtkListStoreClass *class)
{
GObjectClass *object_class;
GtkObjectClass *gobject_class;
object_class = (GObjectClass*) class;
gobject_class = (GtkObjectClass*) class;
object_class->finalize = gtk_list_store_finalize;
gobject_class->destroy = gtk_list_store_destroy;
}
static void
......@@ -380,6 +387,30 @@ gtk_list_store_set_column_type (GtkListStore *list_store,
list_store->column_headers[column] = type;
}
static void
gtk_list_store_finalize (GObject *object)
{
GtkListStore *list_store = GTK_LIST_STORE (object);
g_list_foreach (list_store->root, (GFunc) _gtk_tree_data_list_free, list_store->column_headers);
_gtk_tree_data_list_header_free (list_store->sort_list);
g_free (list_store->column_headers);
}
static void
gtk_list_store_destroy (GtkObject *gobject)
{
GtkListStore *list_store = GTK_LIST_STORE (gobject);
if (list_store->default_sort_destroy)
{
(* list_store->default_sort_destroy) (list_store->default_sort_data);
list_store->default_sort_destroy = NULL;
list_store->default_sort_data = NULL;
}
}
/* Fulfill the GtkTreeModel requirements */
static guint
gtk_list_store_get_flags (GtkTreeModel *tree_model)
......
......@@ -34,6 +34,8 @@ static void gtk_tree_store_tree_model_init (GtkTreeModelIface *iface);
static void gtk_tree_store_drag_source_init(GtkTreeDragSourceIface *iface);
static void gtk_tree_store_drag_dest_init (GtkTreeDragDestIface *iface);
static void gtk_tree_store_sortable_init (GtkTreeSortableIface *iface);
static void gtk_tree_store_finalize (GObject *object);
static void gtk_tree_store_destroy (GtkObject *object);
static guint gtk_tree_store_get_flags (GtkTreeModel *tree_model);
static gint gtk_tree_store_get_n_columns (GtkTreeModel *tree_model);
static GType gtk_tree_store_get_column_type (GtkTreeModel *tree_model,
......@@ -194,9 +196,13 @@ static void
gtk_tree_store_class_init (GtkTreeStoreClass *tree_store_class)
{
GObjectClass *object_class;
GtkObjectClass *gobject_class;
object_class = (GObjectClass *) tree_store_class;
gobject_class = (GtkObjectClass *) tree_store_class;
object_class->finalize = gtk_tree_store_finalize;
gobject_class->destroy = gtk_tree_store_destroy;
}
static void
......@@ -330,14 +336,6 @@ gtk_tree_store_newv (gint n_columns,
return retval;
}
/**
* gtk_tree_store_set_n_columns:
* @tree_store:
* @n_columns:
*
* As a side effect of calling this function, all sort columns that overlap with
* the current number of columns will be removed.
**/
static void
gtk_tree_store_set_n_columns (GtkTreeStore *tree_store,
gint n_columns)
......@@ -397,6 +395,35 @@ gtk_tree_store_set_column_type (GtkTreeStore *tree_store,
tree_store->column_headers[column] = type;
}
static void
node_free (GNode *node, gpointer data)
{
_gtk_tree_data_list_free (node->data, (GType*)data);
}
static void
gtk_tree_store_finalize (GObject *object)
{
GtkTreeStore *tree_store = GTK_TREE_STORE (object);
g_node_children_foreach (tree_store->root, G_TRAVERSE_LEAFS, node_free, tree_store->column_headers);
_gtk_tree_data_list_header_free (tree_store->sort_list);
g_free (tree_store->column_headers);
}
static void
gtk_tree_store_destroy (GtkObject *gobject)
{
GtkTreeStore *tree_store = GTK_TREE_STORE (gobject);
if (tree_store->default_sort_destroy)
{
(* tree_store->default_sort_destroy) (tree_store->default_sort_data);
tree_store->default_sort_destroy = NULL;
tree_store->default_sort_data = NULL;
}
}
/* fulfill the GtkTreeModel requirements */
/* NOTE: GtkTreeStore::root is a GNode, that acts as the parent node. However,
* it is not visible to the tree or to the user., and the path "0" refers to the
......
......@@ -90,7 +90,8 @@ struct _GtkTreeViewClass
GtkMovementStep step,
gint count);
void (* select_all) (GtkTreeView *tree_view);
void (* select_cursor_row) (GtkTreeView *tree_view);
void (* select_cursor_row) (GtkTreeView *tree_view,
gboolean start_editing);
void (* toggle_cursor_row) (GtkTreeView *tree_view);
void (* expand_collapse_cursor_row) (GtkTreeView *tree_view,
gboolean logical,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment