[gtk+] gtktreesortable: Move documentation to inline comments
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gtktreesortable: Move documentation to inline comments
- Date: Fri, 22 Oct 2010 22:32:19 +0000 (UTC)
commit e51daa79fe2c17499bfa76e6fb25e40d04bba2d6
Author: Javier Jardón <jjardon gnome org>
Date: Fri Oct 22 22:10:03 2010 +0200
gtktreesortable: Move documentation to inline comments
docs/reference/gtk/tmpl/.gitignore | 1 +
docs/reference/gtk/tmpl/gtktreesortable.sgml | 135 --------------------------
gtk/gtktreesortable.c | 12 +++
gtk/gtktreesortable.h | 22 ++++
4 files changed, 35 insertions(+), 135 deletions(-)
---
diff --git a/docs/reference/gtk/tmpl/.gitignore b/docs/reference/gtk/tmpl/.gitignore
index 66a2821..4058528 100644
--- a/docs/reference/gtk/tmpl/.gitignore
+++ b/docs/reference/gtk/tmpl/.gitignore
@@ -50,6 +50,7 @@ gtktoolbar.sgml
gtktoolitem.sgml
gtktooltip.sgml
gtktreednd.sgml
+gtktreesortable.sgml
gtktreestore.sgml
gtktreeviewcolumn.sgml
gtktypeutils.sgml
diff --git a/gtk/gtktreesortable.c b/gtk/gtktreesortable.c
index b699f1e..75f7e3c 100644
--- a/gtk/gtktreesortable.c
+++ b/gtk/gtktreesortable.c
@@ -24,6 +24,18 @@
#include "gtkintl.h"
+/**
+ * SECTION:gtktreesortable
+ * @Short_description: The interface for sortable models used by GtkTreeView
+ * @Title: GtkTreeSortable
+ * @See_also:#GtkTreeModel, #GtkTreeView
+ *
+ * #GtkTreeSortable is an interface to be implemented by tree models which
+ * support sorting. The #GtkTreeView uses the methods provided by this interface
+ * to sort the model.
+ */
+
+
static void gtk_tree_sortable_base_init (gpointer g_class);
GType
diff --git a/gtk/gtktreesortable.h b/gtk/gtktreesortable.h
index 4931276..c9ce6e7 100644
--- a/gtk/gtktreesortable.h
+++ b/gtk/gtktreesortable.h
@@ -46,6 +46,28 @@ enum {
typedef struct _GtkTreeSortable GtkTreeSortable; /* Dummy typedef */
typedef struct _GtkTreeSortableIface GtkTreeSortableIface;
+/**
+ * GtkTreeIterCompareFunc:
+ * @model: The #GtkTreeModel the comparison is within
+ * @a: A #GtkTreeIter in @model
+ * @b: Another #GtkTreeIter in @model
+ * @user_data: Data passed when the compare func is assigned e.g. by
+ * gtk_tree_sortable_set_sort_func()
+ *
+ * A GtkTreeIterCompareFunc should return a negative integer, zero, or a positive
+ * integer if @a sorts before @b, @a sorts with @b, or @a sorts after @b
+ * respectively. If two iters compare as equal, their order in the sorted model
+ * is undefined. In order to ensure that the #GtkTreeSortable behaves as
+ * expected, the GtkTreeIterCompareFunc must define a partial order on
+ * the model, i.e. it must be reflexive, antisymmetric and transitive.
+ *
+ * For example, if @model is a product catalogue, then a compare function
+ * for the "price" column could be one which returns
+ * <literal>price_of(@a) - price_of(@b)</literal>.
+ *
+ * Returns: a negative integer, zero or a positive integer depending on whether
+ * @a sorts before, with or after @b
+ */
typedef gint (* GtkTreeIterCompareFunc) (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]