diff options
author | Chris Toshok <toshok@helixcode.com> | 2000-06-09 07:16:22 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2000-06-09 07:16:22 +0800 |
commit | e581631a9ce0803ba629ac67cd8934a6e23753ae (patch) | |
tree | 16fd9ebf869dd9fd82d265ce5a60a4ea7aeba652 /widgets/table/e-tree-model.h | |
parent | f856d999c5cade657d045ea22b1fb64be481829d (diff) | |
download | gsoc2013-evolution-e581631a9ce0803ba629ac67cd8934a6e23753ae.tar.gz gsoc2013-evolution-e581631a9ce0803ba629ac67cd8934a6e23753ae.tar.zst gsoc2013-evolution-e581631a9ce0803ba629ac67cd8934a6e23753ae.zip |
New files. A tree model using a GNode structure to store it's info.
2000-06-08 Chris Toshok <toshok@helixcode.com>
* e-tree-gnode.c, e-tree-gnode.h: New files. A tree model using a
GNode structure to store it's info.
* e-tree-model.c, e-tree-model.h: New files. A proxy model
sitting between a table model and the real tree model (of which
ETreeGNode is an example).
* e-cell-tree.c, e-cell-tree.h: New files. A cell renderer
capable of wrapping up a subcell and drawing the tree controls for
expanding/collapsing trees.
* tree-expanded.xpm, tree-unexpanded.xpm: New files. the standard
+ and - icons.
* e-tree-example-1.c: New file, giving a (pretty poor :) example
of using ETreeGNode.
* Makefile.am: at the tree stuff to the build, and build
tree-example-1.
* .cvsignore: ignore tree-example-1.
svn path=/trunk/; revision=3483
Diffstat (limited to 'widgets/table/e-tree-model.h')
-rw-r--r-- | widgets/table/e-tree-model.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h new file mode 100644 index 0000000000..6924f3ea0e --- /dev/null +++ b/widgets/table/e-tree-model.h @@ -0,0 +1,72 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +#ifndef _E_TREE_MODEL_H_ +#define _E_TREE_MODEL_H_ + +#include "e-table-model.h" + +#define E_TREE_MODEL_TYPE (e_tree_model_get_type ()) +#define E_TREE_MODEL(o) (GTK_CHECK_CAST ((o), E_TREE_MODEL_TYPE, ETreeModel)) +#define E_TREE_MODEL_CLASS(k) (GTK_CHECK_CLASS_CAST((k), E_TREE_MODEL_TYPE, ETreeModelClass)) +#define E_IS_TREE_MODEL(o) (GTK_CHECK_TYPE ((o), E_TREE_MODEL_TYPE)) +#define E_IS_TREE_MODEL_CLASS(k) (GTK_CHECK_CLASS_TYPE ((k), E_TREE_MODEL_TYPE)) + +typedef gpointer ETreePathItem; +typedef GList ETreePath; + +typedef struct { + ETableModel base; + + ETableModel *source; + + ETreePath *root_node; + + GArray *array; + +} ETreeModel; + +typedef struct { + ETableModelClass parent_class; + + /* + * Virtual methods + */ + ETreePath *(*get_root) (ETreeModel *etm); + + ETreePath *(*get_next) (ETreeModel *etm, ETreePath* node); + ETreePath *(*get_prev) (ETreeModel *etm, ETreePath* node); + + void *(*value_at) (ETreeModel *etm, ETreePath* node, int col); + void (*set_value_at) (ETreeModel *etm, ETreePath* node, int col, const void *val); + gboolean (*is_editable) (ETreeModel *etm, ETreePath* node, int col); + + guint (*get_children) (ETreeModel *etm, ETreePath* node, ETreePath ***paths); + void (*release_paths) (ETreeModel *etm, ETreePath **paths, guint num_paths); + gboolean (*is_expanded) (ETreeModel *etm, ETreePath* node); + void (*set_expanded) (ETreeModel *etm, ETreePath* node, gboolean expanded); + + /* + * Signals + */ + +} ETreeModelClass; + +GtkType e_tree_model_get_type (void); + +ETreeModel *e_tree_model_new (void); + +/* operations on "nodes" in the tree */ +ETreePath * e_tree_model_get_root (ETreeModel *etree); +ETreePath * e_tree_model_node_at_row (ETreeModel *etree, int row); +guint e_tree_model_node_depth (ETreeModel *etree, ETreePath *path); +ETreePath *e_tree_model_node_get_parent (ETreeModel *etree, ETreePath *path); +ETreePath *e_tree_model_node_get_next (ETreeModel *etree, ETreePath *path); +ETreePath *e_tree_model_node_get_prev (ETreeModel *etree, ETreePath *path); +gboolean e_tree_model_node_is_root (ETreeModel *etree, ETreePath *path); + +gboolean e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath *path); +gboolean e_tree_model_node_is_expanded (ETreeModel *etree, ETreePath *path); +guint e_tree_model_node_get_children (ETreeModel *etree, ETreePath *path, ETreePath ***paths); +void e_tree_model_release_paths (ETreeModel *etree, ETreePath **paths, guint num_paths); +guint e_tree_model_node_num_visible_descendents (ETreeModel *etm, ETreePath *node); + +#endif /* _E_TREE_MODEL_H */ |