nautilus/components/tree/nautilus-tree-model.h
Maciej Stachowiak 4dbe9d17c8 Fixes for bugzilla tasks 1525 and 1530.
* components/tree/nautilus-tree-expansion-state.h,
	components/tree/nautilus-tree-expansion-state.c: New files
	implementing the NautilusTreeExpansionState class, a class to
	track the expansion state of various nodes in the tree, and
	save/load it to/from GConf.
	* components/tree/nautilus-tree-model.h,
	components/tree/nautilus-tree-model.c
	(nautilus_tree_model_stop_monitoring_node_recursive): New function
	to stop monitoring a node and any children of it's that you may be
	monitoring all at one go.
	(nautilus_tree_model_stop_monitoring_node): Disconnect signal
	handlers from the proper object (D'oh!) and avoid disconnecting
	more than once if you stop monitoring more than once (D'oh!).

	* components/tree/nautilus-tree-view.c:
	(nautilus_tree_view_insert_model_node,
	nautilus_tree_view_remove_model_node,
	nautilus_tree_view_update_model_node),
	nautilus_tree_view_initialize, nautilus_tree_view_destroy,
	tree_expand_callback, tree_collapse_callback): Track expansion
	state using the new class, and make sure that when a node is
	expanded it gets reloaded recursively.
	(ctree_is_node_expanded): Convenience function to check if a
	GtkCTreeNode is currenly expanded.
	(reload_node_for_uri): New function to force reload of a node.
	(expand_node_for_uri): New function to do everything necessary
	associated with the expansion of a node.

	* libnautilus-extensions/nautilus-glib-extensions.h,
	libnautilus-extensions/nautilus-glib-extensions.c:
	(nautilus_g_slist_free_deep_custom, nautilus_g_slist_free_deep):
	New functions for freeing GSLists, similar to the GList versions.
	* libnautilus-extensions/nautilus-preferences.h,
	libnautilus-extensions/nautilus-preferences.c
	(nautilus_preferences_set_string_list,
	nautilus_preferences_get_string_list): New functions for
	manipulating preferences that are a list of strings.
	* libnautilus-extensions/nautilus-volume-monitor.c
	(mntent_is_removable_fs): Added some FIXMEs
	* src/nautilus-view-frame.c: Remove a stary character from the
	copyright notice.
2000-08-11 07:21:57 +00:00

111 lines
3.8 KiB
C

/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/*
* Copyright (C) 2000 Eazel, Inc
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Maciej Stachowiak <mjs@eazel.com>
*/
/* nautilus-tree-model.h - Model for the tree view */
#ifndef NAUTILUS_TREE_MODEL_H
#define NAUTILUS_TREE_MODEL_H
#include <gtk/gtkobject.h>
#include "nautilus-tree-node.h"
typedef struct NautilusTreeModel NautilusTreeModel;
typedef struct NautilusTreeModelClass NautilusTreeModelClass;
#define NAUTILUS_TYPE_TREE_MODEL (nautilus_tree_model_get_type ())
#define NAUTILUS_TREE_MODEL(obj) (GTK_CHECK_CAST ((obj), NAUTILUS_TYPE_TREE_MODEL, NautilusTreeModel))
#define NAUTILUS_TREE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), NAUTILUS_TYPE_TREE_MODEL, NautilusTreeModelClass))
#define NAUTILUS_IS_TREE_MODEL(obj) (GTK_CHECK_TYPE ((obj), NAUTILUS_TYPE_TREE_MODEL))
#define NAUTILUS_IS_TREE_MODEL_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), NAUTILUS_TYPE_TREE_MODEL))
typedef struct NautilusTreeModelDetails NautilusTreeModelDetails;
struct NautilusTreeModel {
GtkObject parent;
NautilusTreeModelDetails *details;
};
struct NautilusTreeModelClass {
GtkObjectClass parent_class;
void (*node_added) (NautilusTreeModel *model,
NautilusTreeNode *node);
void (*node_changed) (NautilusTreeModel *model,
NautilusTreeNode *node);
void (*node_removed) (NautilusTreeModel *model,
NautilusTreeNode *node);
void (*done_loading_children) (NautilusTreeModel *model,
NautilusTreeNode *node);
};
typedef void (*NautilusTreeModelCallback) (NautilusTreeModel *model,
NautilusTreeNode *node,
gpointer callback_data);
GtkType nautilus_tree_model_get_type (void);
NautilusTreeModel *nautilus_tree_model_new (const char *root_uri);
void nautilus_tree_model_monitor_add (NautilusTreeModel *model,
gconstpointer client,
NautilusTreeModelCallback initial_nodes_callback,
gpointer callback_data);
void nautilus_tree_model_monitor_remove (NautilusTreeModel *model,
gconstpointer client);
void nautilus_tree_model_monitor_node (NautilusTreeModel *model,
NautilusTreeNode *node,
gconstpointer client);
void nautilus_tree_model_stop_monitoring_node (NautilusTreeModel *model,
NautilusTreeNode *node,
gconstpointer client);
void
nautilus_tree_model_stop_monitoring_node_recursive (NautilusTreeModel *model,
NautilusTreeNode *node,
gconstpointer client);
NautilusTreeNode *nautilus_tree_model_get_node (NautilusTreeModel *model,
const char *uri);
#if 0
NautilusTreeNode *nautilus_tree_model_get_nearest_parent_node (NautilusTreeModel *model,
const char *uri);
NautilusTreeNode *nautilus_tree_model_get_root_node (NautilusTreeModel *model);
#endif
#endif /* NAUTILUS_TREE_MODEL_H */