aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/table/e-tree-model.h
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-10-03 06:10:13 +0800
committerChris Toshok <toshok@src.gnome.org>2000-10-03 06:10:13 +0800
commit4dd58b9823a9526d9c55f01f77678fabe65dc0b3 (patch)
tree1e26718ba986a516212cb982df6a9b57f7d3bd1d /widgets/table/e-tree-model.h
parent9f50c83ac540a7a9624619b8ceb4da06b854057e (diff)
downloadgsoc2013-evolution-4dd58b9823a9526d9c55f01f77678fabe65dc0b3.tar.gz
gsoc2013-evolution-4dd58b9823a9526d9c55f01f77678fabe65dc0b3.tar.zst
gsoc2013-evolution-4dd58b9823a9526d9c55f01f77678fabe65dc0b3.zip
change/add prototypes and a typedef for ETreePathCompareFunc.
2000-10-02 Chris Toshok <toshok@helixcode.com> * e-tree-model.h: change/add prototypes and a typedef for ETreePathCompareFunc. * e-tree-model.c (e_tree_model_node_set_compare_function): new function, used to set the comparison function for sorted nodes. Eventually sorting entail just calling this function, with the tree maintaining the sort. (e_tree_model_node_sort): use a helper function (e_tree_model_node_compare) to allow the e-tree user's comparison function to take mode reasonable paramaters. also, fix it so the previous expanded state is kept with the node. i can't believe i wrote it the way it originally was. also, don't take the comparison function here. it's set in e_tree_model_node_set_compare_function. svn path=/trunk/; revision=5674
Diffstat (limited to 'widgets/table/e-tree-model.h')
-rw-r--r--widgets/table/e-tree-model.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h
index b00101ca8e..ab142cc217 100644
--- a/widgets/table/e-tree-model.h
+++ b/widgets/table/e-tree-model.h
@@ -12,8 +12,11 @@
#define E_IS_TREE_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TREE_MODEL_TYPE))
typedef GNode ETreePath;
+typedef struct ETreeModel ETreeModel;
+typedef struct ETreeModelClass ETreeModelClass;
+typedef gint (*ETreePathCompareFunc)(ETreeModel *, ETreePath *path1, ETreePath *path2);
-typedef struct {
+struct ETreeModel {
ETableModel base;
GNode *root;
gboolean root_visible;
@@ -21,9 +24,9 @@ typedef struct {
guint32 num_expanded_to_save;
guint32 num_collapsed_to_save;
GHashTable *expanded_state; /* used for loading/saving expanded state */
-} ETreeModel;
+};
-typedef struct {
+struct ETreeModelClass {
ETableModelClass parent_class;
/*
@@ -62,7 +65,7 @@ typedef struct {
void (*node_collapsed) (ETreeModel *etm, ETreePath *node);
void (*node_expanded) (ETreeModel *etm, ETreePath *node, gboolean *allow_expand);
-} ETreeModelClass;
+};
GtkType e_tree_model_get_type (void);
void e_tree_model_construct (ETreeModel *etree);
@@ -100,7 +103,8 @@ void e_tree_model_root_node_set_visible (ETreeModel *etree, gboolean visib
gboolean e_tree_model_root_node_is_visible (ETreeModel *etree);
/* sort routine, analogous to gtk_ctree_node_sort */
-void e_tree_model_node_sort (ETreeModel *tree_model, ETreePath *node, GCompareFunc compare);
+void e_tree_model_node_set_compare_function (ETreeModel *tree_model, ETreePath *node, ETreePathCompareFunc compare);
+void e_tree_model_node_sort (ETreeModel *tree_model, ETreePath *node);
/*
** Routines for emitting signals on the ETreeModel