diff --git a/ChangeLog b/ChangeLog index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8010a2256d..6360d9cb30 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,14 @@ +Mon Oct 1 16:08:23 2001 Jonathan Blandford + + * 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 . + 2001-10-01 Matthias Clasen * gtk/gtkitemfactory.c (gtk_item_factory_parse_rc_scanner): replace diff --git a/gtk/gtkliststore.c b/gtk/gtkliststore.c index e2aec14448..c7d79c5b89 100644 --- a/gtk/gtkliststore.c +++ b/gtk/gtkliststore.c @@ -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) diff --git a/gtk/gtktreestore.c b/gtk/gtktreestore.c index 764b9d1e87..62f3a1cd88 100644 --- a/gtk/gtktreestore.c +++ b/gtk/gtktreestore.c @@ -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 diff --git a/gtk/gtktreeview.h b/gtk/gtktreeview.h index 0d309d45fa..28e86db372 100644 --- a/gtk/gtktreeview.h +++ b/gtk/gtktreeview.h @@ -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,