Files
evolution/widgets/table/e-tree-model.c
Christopher James Lahey 1510304c2d Deal with proxy_node_changed being called on a different root node than
2001-03-19  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c (ets_proxy_node_changed): Deal with
	proxy_node_changed being called on a different root node than the
	one we have in our tree.

	* e-tree-table-adapter.c: Did some general clean up here.

	* Merged branch:

2001-03-19  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c (find_child_path): Added this function to allow
	us to find paths that have been removed from the source.
	(ets_proxy_node_removed): Fixed the memmove here a bit.  Call
	find_child_path.

	* e-tree-table-adapter.c (find_node): Check that the passed in
	path isn't NULL.

2001-03-19  Christopher James Lahey  <clahey@ximian.com>

	* e-table-item.c (eti_reflow): Get width from header object
	instead of calculating it ourselves.

	* e-table-selection-model.c: Turn off selection saving since it's
	so slow.

	* e-table.c (e_table_set_state_object): Set the width of the newly
	created header object.

	* e-tree.c (e_tree_set_state_object): Set the width of the newly
	created header object.
	(tree_canvas_size_allocate): Don't bother setting the dimensions
	of the white background twice.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-table-selection-model.c, e-table-selection-model.h: Made
	ETableSelectionModel save the cursor properly across changed
	signals if has_save_id is true.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-table-selection-model.c, e-table-selection-model.h: Made
	ETableSelectionModel save selection properly across changed
	signals if has_save_id is true.

	* e-tree-memory.c: A couple of typos.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-memory.c, e-tree-sorted.c: Send pre_changes properly.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-table-adapter.c: Send pre_changes when performing
	set_expanded or root_node_set_visible.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c (ets_is_expandable): When the API requests
	whether the object is expandable and it isn't, make sure to send a
	signal when it becomes expandable.

	* e-tree-table-adapter.c: Made it so that in a number of cases
	where it doesn't need to create an empty hash table node if the
	current tree node has no children, it doesn't.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-memory-callbacks.c, e-tree-memory-callbacks.h
	(etmc_has_save_id, etmc_get_save_id): Added has_save_id and
	get_save_id to the list of methods supported by
	e_tree_memory_callbacks.

	* e-tree-table-adapter.c, e-tree-table-adapter.h: Added saving of
	expanded nodes.

2001-03-18  Christopher James Lahey  <clahey@ximian.com>

	* e-table-model.c, e-table-model.h (e_table_model_get_save_id):
	Changed row_save_id to get_save_id to be consistent with ETree.

	* e-tree-model.c, e-tree-model.h: Added "pre_change" signal.
	Added has_save_id and get_save_id methods.

	* e-tree-sorted.c: Proxy pre_change signal.  Implemented
	has_save_id and get_save_id.  If the base model doesn't provide
	has_save_id then we g_strdup_printf the pointer of the base model
	ETreePath as the save_id.

	* e-tree-table-adapter.c: Proxy pre_change signal.  If base model
	has_save_id, then use the results of get_save_id as the key for
	the hash table of node attributes.  Otherwise use the pointer as
	before.

2001-03-17  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c (ets_sort_idle): Fixed it so that all nodes get
	sorted properly instead of just the top node.

2001-03-17  Christopher James Lahey  <clahey@ximian.com>

	* e-table-sorting-utils.c (e_table_sorting_utils_tree_sort): Made
	tree sorting faster by using a cache.

	* e-tree-sorted.c: Added commented out debugging g_prints.

2001-03-17  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c: Switched to using GMemChunks.

2001-03-17  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-sorted.c (resort_node): Made it so that children of a
	node that's being sorted don't send changed signals.

2001-03-17  Christopher James Lahey  <clahey@ximian.com>

	* e-table-sorting-utils.c, e-table-sorting-utils.h: Switched to
	using e_sort and e_search instead of qsort and a linear search.
	Added the tree functions e_table_sorting_utils_tree_sort,
	e_table_sorting_utils_tree_check_position, and
	e_table_sorting_utils_tree_insert.

	* e-tree-sorted.c: Made this actually do sorting.

	* e-tree-table-adapter.c (etta_proxy_node_changed): The old_size
	needs to be the number of visible children + 1 to include the top
	node.

	* e-tree.c (e_tree_set_state_object): Set the sort_info on the
	ETreeSorted when you get a new sort_info.

2001-03-16  Christopher James Lahey  <clahey@ximian.com>

	* Makefile.am: Added e-tree-sorted.c and e-tree-sorted.h.

	* e-table-item.c (eti_realize_cell_views): Only realize the cells
	if they're not realized already and if the canvas is realized.

	* e-table-sorted.c (ets_proxy_model_cell_changed): Matched the
	change to the signature of e_table_sorting_utils_affects_sort.

	* e-table-sorting-utils.c, e-table-sorting-utils.h
	(e_table_sorting_utils_affects_sort): Changed the signature of
	this function to not take the ETableModel source since it doesn't
	use it and we need to use this function for ETreeSorted which
	doesn't have an ETableModel.

	* e-tree-memory.c (etmm_get_expanded_default): Actually implement
	the get_expanded_default for this tree.

	* e-tree-model.h: Cleaned up the indentation here.

	* e-tree-sorted.c, e-tree-sorted.h: New class meant to be used for
	sorting trees.  It doesn't actually sort yet.  It simply acts as
	an ETreeProxy which is the hardest part of making ETreeSorted.

	* e-tree.c, e-tree.h: Made this use an ETreeSorted.

2001-03-14  Christopher James Lahey  <clahey@ximian.com>

	* e-table-item.c, e-table-item.h, e-table-selection-model.c,
	e-table-selection-model.h, e-table-sorted.c, e-table-sorted.h,
	e-table-subset.c, e-table-subset.h, e-table.c, e-table.h: Switch
	to handling e_table_model_rows_inserted instead of
	e_table_model_row_inserted and e_table_model_rows_deleted instead
	of e_table_model_row_deleted.

	* e-table-model.c, e-table-model.h: Replaced the signals
	"model_row_inserted" and "model_row_deleted" with
	"model_rows_inserted" and "model_rows_deleted" so that when
	multiple rows are inserted or deleted at the same time they can be
	handled properly.

	* e-tree-table-adapter.c: Call "model_rows_inserted" and
	"model_rows_deleted" instead of "model_changed" when inserting or
	deleting multiple rows.

2001-03-14  Christopher James Lahey  <clahey@ximian.com>

	* e-table-item.c (e_table_item_row_diff): Made this not count the
	pixel between rows if it isn't there.

2001-03-14  Christopher James Lahey  <clahey@ximian.com>

	* e-table-item.c (eti_header_structure_changed): Properly attach &
	realize cell views here.

2001-03-13  Christopher James Lahey  <clahey@ximian.com>

	* e-tree-table-adapter.c (etta_proxy_node_removed): Check that
	parent_node and parent aren't NULL before making function calls on
	them.

2001-03-13  Christopher James Lahey  <clahey@ximian.com>

	* e-table-item.c (confirm_height_cache): Fixed a height cache
	miscalculation.

	* e-tree-table-adapter.c (find_first_child_node): Made the
	semantics of this mean that find_first_child_node(adapter, -1)
	means return the first node in the tree.

2001-03-13  Christopher James Lahey  <clahey@ximian.com>

	* e-table-extras.c: Added a "string-integer" comparison function
	to the default %ETableExtras so you can do comparisons based on
	integer value even if you using strings for the data (this lets
	you do editable numbers, for instance.)

	* e-table-item.c: Rearranged it a bit so that if you have
	draw_grid off it doesn't add space for the horizontal lines, nor
	leave them the background color.

	* e-table-model.c, e-table-model.h: Added the row_save_id and
	has_save_id methods to %ETableModel.

	* e-tree.c, e-tree.h: Replaced e_tree_compute_location with
	e_tree_get_cell_at.

2001-03-08  Christopher James Lahey  <clahey@ximian.com>

	* Makefile.am: Added e-table/e-table-utils.c,
	e-table/e-tree-memory-callbacks.c, e-table/e-tree-memory.c,
	e-table/e-tree-scrolled.c, e-table/e-tree-table-adapter.c, and
	e-table/e-tree.c.  Removed e-table/e-tree-simple.c.  Added
	e-table/e-table-utils.h, e-table/e-tree-memory-callbacks.h,
	e-table/e-tree-memory.h, e-table/e-tree-scrolled.h,
	e-table/e-tree-table-adapter.h, and e-table/e-tree.h.  Removed
	e-table/e-tree-simple.h.

	* e-cell-tree.c: Updated this for the new tree.

	* e-table-item.c: Added some redraw requests where appropriate.

	* e-table-item.h: Fixed an incorrect class method declaration.

	* e-table-model.c, e-table-model.h: Removed
	e_table_model_has_sort_group and e_table_model_row_sort_group.

	* e-table-scrolled.h: Removed unused headers.

	* e-table-simple.c, e-table-simple.h: Rearranged this a bit.

	* e-table-sorter.c, e-table-sorting-utils.c,
	e-table-sorting-utils.h: Removed sort group stuff.  Added the
	function e_table_sorting_utils_check_position.

	* e-table-utils.c, e-table-utils.h: Utility functions for ETable
	and ETree.

	* e-table.c: Moved some of the functionality from here to
	e-table-utils.c so that it can be reused by ETree.

	* e-tree-memory-callbacks.c, e-tree-memory-callbacks.h: Class to
	implement an ETreeMemory as callbacks instead of overriding the
	class.

	* e-tree-memory.c, e-tree-memory.h: ETreeModel that stores a tree
	of physical nodes.

	* e-tree-model.c, e-tree-model.h: Removed most of the
	functionality from here to the classes ETreeMemory and
	ETreeTableAdapter.  This is now just a simple virtualized tree
	class.

	* e-tree-scrolled.c, e-tree-scrolled.h: New class.  An ETree in an
	EScrollFrame.

	* e-tree-simple.c: Small change.  This is no longer used.

	* e-tree-table-adapter.c, e-tree-table-adapter.h: ETableModel that
	represents an ETreeModel as a table.

	* e-tree.c, e-tree.h: New super class kind of like ETable but for
	trees.

End of branch

svn path=/trunk/; revision=8837
2001-03-20 04:43:42 +00:00

743 lines
15 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/*
* e-tree-model.c: a Tree Model
*
* Author:
* Chris Toshok (toshok@ximian.com)
* Chris Lahey <clahey@ximian.com>
*
* Adapted from the gtree code and ETableModel.
*
* (C) 2000, 2001 Ximian, Inc.
*/
#include <config.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
#include <gnome-xml/parser.h>
#include <gnome-xml/xmlmemory.h>
#include <gtk/gtksignal.h>
#include <stdlib.h>
#include "gal/util/e-util.h"
#include "gal/util/e-xml-utils.h"
#include "e-tree-model.h"
#define ETM_CLASS(e) ((ETreeModelClass *)((GtkObject *)e)->klass)
#define PARENT_TYPE (gtk_object_get_type())
static GtkObjectClass *parent_class;
enum {
PRE_CHANGE,
NODE_CHANGED,
NODE_DATA_CHANGED,
NODE_COL_CHANGED,
NODE_INSERTED,
NODE_REMOVED,
LAST_SIGNAL
};
static guint e_tree_model_signals [LAST_SIGNAL] = {0, };
static void
e_tree_model_class_init (GtkObjectClass *klass)
{
ETreeModelClass *tree_class = (ETreeModelClass *) klass;
parent_class = gtk_type_class (PARENT_TYPE);
e_tree_model_signals [PRE_CHANGE] =
gtk_signal_new ("pre_change",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, pre_change),
gtk_marshal_NONE__NONE,
GTK_TYPE_NONE, 0);
e_tree_model_signals [NODE_CHANGED] =
gtk_signal_new ("node_changed",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, node_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
e_tree_model_signals [NODE_DATA_CHANGED] =
gtk_signal_new ("node_data_changed",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, node_data_changed),
gtk_marshal_NONE__POINTER,
GTK_TYPE_NONE, 1, GTK_TYPE_POINTER);
e_tree_model_signals [NODE_COL_CHANGED] =
gtk_signal_new ("node_col_changed",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, node_col_changed),
gtk_marshal_NONE__POINTER_INT,
GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_INT);
e_tree_model_signals [NODE_INSERTED] =
gtk_signal_new ("node_inserted",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, node_inserted),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
e_tree_model_signals [NODE_REMOVED] =
gtk_signal_new ("node_removed",
GTK_RUN_LAST,
klass->type,
GTK_SIGNAL_OFFSET (ETreeModelClass, node_removed),
gtk_marshal_NONE__POINTER_POINTER,
GTK_TYPE_NONE, 2, GTK_TYPE_POINTER, GTK_TYPE_POINTER);
gtk_object_class_add_signals (klass, e_tree_model_signals, LAST_SIGNAL);
tree_class->get_root = NULL;
tree_class->get_parent = NULL;
tree_class->get_first_child = NULL;
tree_class->get_last_child = NULL;
tree_class->get_next = NULL;
tree_class->get_prev = NULL;
tree_class->is_root = NULL;
tree_class->is_expandable = NULL;
tree_class->get_children = NULL;
tree_class->depth = NULL;
tree_class->icon_at = NULL;
tree_class->get_expanded_default = NULL;
tree_class->column_count = NULL;
tree_class->has_save_id = NULL;
tree_class->get_save_id = NULL;
tree_class->value_at = NULL;
tree_class->set_value_at = NULL;
tree_class->is_editable = NULL;
tree_class->duplicate_value = NULL;
tree_class->free_value = NULL;
tree_class->initialize_value = NULL;
tree_class->value_is_empty = NULL;
tree_class->value_to_string = NULL;
tree_class->pre_change = NULL;
tree_class->node_changed = NULL;
tree_class->node_data_changed = NULL;
tree_class->node_col_changed = NULL;
tree_class->node_inserted = NULL;
tree_class->node_removed = NULL;
}
static void
e_tree_init (GtkObject *object)
{
}
E_MAKE_TYPE(e_tree_model, "ETreeModel", ETreeModel, e_tree_model_class_init, e_tree_init, PARENT_TYPE)
/* signals */
/**
* e_tree_model_node_changed:
* @tree_model:
* @node:
*
*
*
* Return value:
**/
void
e_tree_model_pre_change (ETreeModel *tree_model)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [PRE_CHANGE]);
}
/**
* e_tree_model_node_changed:
* @tree_model:
* @node:
*
*
*
* Return value:
**/
void
e_tree_model_node_changed (ETreeModel *tree_model, ETreePath node)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [NODE_CHANGED], node);
}
/**
* e_tree_model_node_data_changed:
* @tree_model:
* @node:
*
*
*
* Return value:
**/
void
e_tree_model_node_data_changed (ETreeModel *tree_model, ETreePath node)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [NODE_DATA_CHANGED], node);
}
/**
* e_tree_model_node_col_changed:
* @tree_model:
* @node:
*
*
*
* Return value:
**/
void
e_tree_model_node_col_changed (ETreeModel *tree_model, ETreePath node, int col)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [NODE_COL_CHANGED], node, col);
}
/**
* e_tree_model_node_inserted:
* @tree_model:
* @parent_node:
* @inserted_node:
*
*
**/
void
e_tree_model_node_inserted (ETreeModel *tree_model,
ETreePath parent_node,
ETreePath inserted_node)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [NODE_INSERTED],
parent_node, inserted_node);
}
/**
* e_tree_model_node_removed:
* @tree_model:
* @parent_node:
* @removed_node:
*
*
**/
void
e_tree_model_node_removed (ETreeModel *tree_model, ETreePath parent_node, ETreePath removed_node)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (E_IS_TREE_MODEL (tree_model));
gtk_signal_emit (GTK_OBJECT (tree_model),
e_tree_model_signals [NODE_REMOVED],
parent_node, removed_node);
}
/**
* e_tree_model_new
*
* XXX docs here.
*
* return values: a newly constructed ETreeModel.
*/
ETreeModel *
e_tree_model_new ()
{
ETreeModel *et;
et = gtk_type_new (e_tree_model_get_type ());
return et;
}
/**
* e_tree_model_get_root
* @etree: the ETreeModel of which we want the root node.
*
* Accessor for the root node of @etree.
*
* return values: the ETreePath corresponding to the root node.
*/
ETreePath
e_tree_model_get_root (ETreeModel *etree)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_root)
return ETM_CLASS(etree)->get_root(etree);
else
return NULL;
}
/**
* e_tree_model_node_get_parent:
* @etree:
* @path:
*
*
*
* Return value:
**/
ETreePath
e_tree_model_node_get_parent (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail(etree != NULL, NULL);
if (ETM_CLASS(etree)->get_parent)
return ETM_CLASS(etree)->get_parent(etree, node);
else
return NULL;
}
/**
* e_tree_model_node_get_first_child:
* @etree:
* @node:
*
*
*
* Return value:
**/
ETreePath
e_tree_model_node_get_first_child (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_first_child)
return ETM_CLASS(etree)->get_first_child(etree, node);
else
return NULL;
}
/**
* e_tree_model_node_get_last_child:
* @etree:
* @node:
*
*
*
* Return value:
**/
ETreePath
e_tree_model_node_get_last_child (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_last_child)
return ETM_CLASS(etree)->get_last_child(etree, node);
else
return NULL;
}
/**
* e_tree_model_node_get_next:
* @etree:
* @node:
*
*
*
* Return value:
**/
ETreePath
e_tree_model_node_get_next (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_next)
return ETM_CLASS(etree)->get_next(etree, node);
else
return NULL;
}
/**
* e_tree_model_node_get_prev:
* @etree:
* @node:
*
*
*
* Return value:
**/
ETreePath
e_tree_model_node_get_prev (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_prev)
return ETM_CLASS(etree)->get_prev(etree, node);
else
return NULL;
}
/**
* e_tree_model_node_is_root:
* @etree:
* @path:
*
*
*
* Return value:
**/
gboolean
e_tree_model_node_is_root (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail(etree != NULL, FALSE);
if (ETM_CLASS(etree)->is_root)
return ETM_CLASS(etree)->is_root(etree, node);
else
return FALSE;
}
/**
* e_tree_model_node_is_expandable:
* @etree:
* @path:
*
*
*
* Return value:
**/
gboolean
e_tree_model_node_is_expandable (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail(etree != NULL, FALSE);
if (ETM_CLASS(etree)->is_expandable)
return ETM_CLASS(etree)->is_expandable(etree, node);
else
return FALSE;
}
guint
e_tree_model_node_get_children (ETreeModel *etree, ETreePath node, ETreePath **nodes)
{
g_return_val_if_fail(etree != NULL, 0);
if (ETM_CLASS(etree)->get_children)
return ETM_CLASS(etree)->get_children (etree, node, nodes);
else
return 0;
}
/**
* e_tree_model_node_depth:
* @etree:
* @path:
*
*
*
* Return value:
**/
guint
e_tree_model_node_depth (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, 0);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0);
if (ETM_CLASS(etree)->depth)
return ETM_CLASS(etree)->depth(etree, node);
else
return 0;
}
/**
* e_tree_model_icon_at
* @etree: The ETreeModel.
* @path: The ETreePath to the node we're getting the icon of.
*
* XXX docs here.
*
* return values: the GdkPixbuf associated with this node.
*/
GdkPixbuf *
e_tree_model_icon_at (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->icon_at)
return ETM_CLASS(etree)->icon_at (etree, node);
else
return NULL;
}
/**
* e_tree_model_get_expanded_default
* @etree: The ETreeModel.
*
* XXX docs here.
*
* return values: Whether nodes should be expanded by default.
*/
gboolean
e_tree_model_get_expanded_default (ETreeModel *etree)
{
g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS(etree)->get_expanded_default)
return ETM_CLASS(etree)->get_expanded_default (etree);
else
return FALSE;
}
/**
* e_tree_model_column_count
* @etree: The ETreeModel.
*
* XXX docs here.
*
* return values: The number of columns
*/
gint
e_tree_model_column_count (ETreeModel *etree)
{
g_return_val_if_fail (etree != NULL, 0);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), 0);
if (ETM_CLASS(etree)->column_count)
return ETM_CLASS(etree)->column_count (etree);
else
return 0;
}
/**
* e_tree_model_has_save_id
* @etree: The ETreeModel.
*
* XXX docs here.
*
* return values: Whether this tree has valid save id data.
*/
gboolean
e_tree_model_has_save_id (ETreeModel *etree)
{
g_return_val_if_fail (etree != NULL, FALSE);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), FALSE);
if (ETM_CLASS(etree)->has_save_id)
return ETM_CLASS(etree)->has_save_id (etree);
else
return FALSE;
}
/**
* e_tree_model_get_save_id
* @etree: The ETreeModel.
* @node: The ETreePath.
*
* XXX docs here.
*
* return values: The save id for this path.
*/
gchar *
e_tree_model_get_save_id (ETreeModel *etree, ETreePath node)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->get_save_id)
return ETM_CLASS(etree)->get_save_id (etree, node);
else
return NULL;
}
/**
* e_tree_model_icon_of_node
* @etree: The ETreeModel.
* @path: The ETreePath to the node we're getting the icon of.
*
* XXX docs here.
*
* return values: the GdkPixbuf associated with this node.
*/
void *
e_tree_model_value_at (ETreeModel *etree, ETreePath node, int col)
{
g_return_val_if_fail (etree != NULL, NULL);
g_return_val_if_fail (E_IS_TREE_MODEL (etree), NULL);
if (ETM_CLASS(etree)->value_at)
return ETM_CLASS(etree)->value_at (etree, node, col);
else
return NULL;
}
/**
* e_tree_model_icon_of_node
* @etree: The ETreeModel.
* @path: The ETreePath to the node we're getting the icon of.
*
* XXX docs here.
*
* return values: the GdkPixbuf associated with this node.
*/
void
e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, int col, const void *val)
{
g_return_if_fail (etree != NULL);
g_return_if_fail (E_IS_TREE_MODEL (etree));
if (ETM_CLASS(etree)->set_value_at)
ETM_CLASS(etree)->set_value_at (etree, node, col, val);
}
/**
* e_tree_model_node_is_editable:
* @etree:
* @path:
*
*
*
* Return value:
**/
gboolean
e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, int col)
{
g_return_val_if_fail(etree != NULL, FALSE);
if (ETM_CLASS(etree)->is_editable)
return ETM_CLASS(etree)->is_editable(etree, node, col);
else
return FALSE;
}
/**
* e_tree_model_duplicate_value:
* @etree:
* @path:
*
*
*
* Return value:
**/
void *
e_tree_model_duplicate_value (ETreeModel *etree, int col, const void *value)
{
g_return_val_if_fail(etree != NULL, NULL);
if (ETM_CLASS(etree)->duplicate_value)
return ETM_CLASS(etree)->duplicate_value(etree, col, value);
else
return NULL;
}
/**
* e_tree_model_free_value:
* @etree:
* @path:
*
*
*
* Return value:
**/
void
e_tree_model_free_value (ETreeModel *etree, int col, void *value)
{
g_return_if_fail(etree != NULL);
if (ETM_CLASS(etree)->free_value)
ETM_CLASS(etree)->free_value(etree, col, value);
}
/**
* e_tree_model_initialize_value:
* @etree:
* @path:
*
*
*
* Return value:
**/
void *
e_tree_model_initialize_value (ETreeModel *etree, int col)
{
g_return_val_if_fail(etree != NULL, NULL);
if (ETM_CLASS(etree)->initialize_value)
return ETM_CLASS(etree)->initialize_value(etree, col);
else
return NULL;
}
/**
* e_tree_model_value_is_empty:
* @etree:
* @path:
*
*
*
* Return value:
**/
gboolean
e_tree_model_value_is_empty (ETreeModel *etree, int col, const void *value)
{
g_return_val_if_fail(etree != NULL, TRUE);
if (ETM_CLASS(etree)->value_is_empty)
return ETM_CLASS(etree)->value_is_empty(etree, col, value);
else
return TRUE;
}
/**
* e_tree_model_value_to_string:
* @etree:
* @path:
*
*
*
* Return value:
**/
char *
e_tree_model_value_to_string (ETreeModel *etree, int col, const void *value)
{
g_return_val_if_fail(etree != NULL, g_strdup(""));
if (ETM_CLASS(etree)->value_to_string)
return ETM_CLASS(etree)->value_to_string(etree, col, value);
else
return g_strdup("");
}