]> Pileus Git - ~andy/gtk/commitdiff
fix initial val for sort column.
authorJonathan Blandford <jrb@redhat.com>
Tue, 4 Sep 2001 22:15:18 +0000 (22:15 +0000)
committerJonathan Blandford <jrb@src.gnome.org>
Tue, 4 Sep 2001 22:15:18 +0000 (22:15 +0000)
Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>

* gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
sort column.

* gtk/gtktreestore.c (gtk_list_store_init): ditto

* gtk/gtktreesortable.c: add docs.

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkliststore.c
gtk/gtktreesortable.c
gtk/gtktreesortable.h
gtk/gtktreestore.c

index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 8c251b3a4e0f716eaa8b96933664ac8632b2d884..8d4323a5d322550243a25eb57a2c70d0f16f1c1c 100644 (file)
@@ -1,3 +1,12 @@
+Tue Sep  4 18:13:43 2001  Jonathan Blandford  <jrb@redhat.com>
+
+       * gtk/gtkliststore.c (gtk_list_store_init): fix initial val for
+       sort column.
+
+       * gtk/gtktreestore.c (gtk_list_store_init): ditto
+
+       * gtk/gtktreesortable.c: add docs.
+
 Tue Sep  4 09:37:19 2001  Owen Taylor  <otaylor@redhat.com>
 
        * Version 1.3.7
index 0c3f06b1979451760b208d479ae35536ed69310d..50e17a7261214b12394297daf400addb46617189 100644 (file)
@@ -26,7 +26,7 @@
 #include <gobject/gvaluecollector.h>
 
 #define G_SLIST(x) ((GSList *) x)
-#define GTK_LIST_STORE_IS_SORTED(list) (GTK_LIST_STORE (list)->sort_column_id != -1)
+#define GTK_LIST_STORE_IS_SORTED(list) (GTK_LIST_STORE (list)->sort_column_id != -2)
 #define VALID_ITER(iter, list_store) (iter!= NULL && iter->user_data != NULL && list_store->stamp == iter->stamp)
 
 static void         gtk_list_store_init            (GtkListStore      *list_store);
@@ -246,7 +246,7 @@ gtk_list_store_init (GtkListStore *list_store)
   list_store->sort_list = NULL;
   list_store->stamp = g_random_int ();
   list_store->length = 0;
-  list_store->sort_column_id = -1;
+  list_store->sort_column_id = -2;
 }
 
 /**
index 97a52c10e9c752bee86d5c18e6ba65e672dcc845..8a114c33f8e9cf770f53809acc5d92159351b8a6 100644 (file)
@@ -67,6 +67,12 @@ gtk_tree_sortable_base_init (gpointer g_class)
     }
 }
 
+/**
+ * gtk_tree_sortable_sort_column_changed:
+ * @sortable: A #GtkTreeSortable
+ * 
+ * Emits a GtkTreeSortable::sort_column_changed signal on 
+ **/
 void
 gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable)
 {
@@ -76,6 +82,18 @@ gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable)
                         "sort_column_changed");
 }
 
+/**
+ * gtk_tree_sortable_get_sort_column_id:
+ * @sortable: A #GtkTreeSortable
+ * @sort_column_id: The sort column id to be filled in
+ * @order: The #GtkSortType to be filled in
+ * 
+ * Fills in @sort_column_id and @order with the current sort column and the
+ * order, if applicable.  If the sort column is not set, then FALSE is returned,
+ * and the values in @sort_column_id and @order are unchanged.
+  * 
+ * Return value: %TRUE, if the sort column has been set
+ **/
 gboolean
 gtk_tree_sortable_get_sort_column_id (GtkTreeSortable  *sortable,
                                      gint             *sort_column_id,
@@ -93,6 +111,17 @@ gtk_tree_sortable_get_sort_column_id (GtkTreeSortable  *sortable,
   return (* iface->get_sort_column_id) (sortable, sort_column_id, order);
 }
 
+/**
+ * gtk_tree_sortable_set_sort_column_id:
+ * @sortable: A #GtkTreeSortable
+ * @sort_column_id: the sort column id to set
+ * @order: The sort order of the column
+ * 
+ * Sets the current sort column to be @sort_column_id.  The @sortable will
+ * resort itself to reflect this change, after emitting a
+ * GtkTreeSortable::sort_column_changed signal.  If @sort_column_id is -1, then
+ * the default sort function will be used, if it is set.
+ **/
 void
 gtk_tree_sortable_set_sort_column_id (GtkTreeSortable  *sortable,
                                      gint              sort_column_id,
@@ -111,11 +140,23 @@ gtk_tree_sortable_set_sort_column_id (GtkTreeSortable  *sortable,
 
 }
 
+/**
+ * gtk_tree_sortable_set_sort_func:
+ * @sortable: A #GtkTreeSortable
+ * @sort_column_id: the sort column id to set the function for
+ * @sort_func: The sorting function
+ * @user_data: User data to pass to the sort func, or %NULL
+ * @destroy: Destroy notifier of @user_data, or %NULL
+ * 
+ * Sets the comparison function used when sorting to be @sort_func.  If the
+ * current sort column id of @sortable is the same as @sort_column_id, then the
+ * model will sort.
+ **/
 void
 gtk_tree_sortable_set_sort_func (GtkTreeSortable        *sortable,
                                 gint                    sort_column_id,
-                                GtkTreeIterCompareFunc  func,
-                                gpointer                data,
+                                GtkTreeIterCompareFunc  sort_func,
+                                gpointer                user_data,
                                 GtkDestroyNotify        destroy)
 {
   GtkTreeSortableIface *iface;
@@ -127,13 +168,24 @@ gtk_tree_sortable_set_sort_func (GtkTreeSortable        *sortable,
   g_return_if_fail (iface != NULL);
   g_return_if_fail (iface->set_sort_func != NULL);
   
-  (* iface->set_sort_func) (sortable, sort_column_id, func, data, destroy);
+  (* iface->set_sort_func) (sortable, sort_column_id, sort_func, user_data, destroy);
 }
 
+/**
+ * gtk_tree_sortable_set_default_sort_func:
+ * @sortable: A #GtkTreeSortable
+ * @sort_func: The sorting function
+ * @user_data: User data to pass to the sort func, or %NULL
+ * @destroy: Destroy notifier of @user_data, or %NULL
+ * 
+ * Sets the default comparison function used when sorting to be @sort_func.  If
+ * the current sort column id of @sortable is the same as @sort_column_id, then
+ * the model will sort.
+ **/
 void
 gtk_tree_sortable_set_default_sort_func (GtkTreeSortable        *sortable,
-                                        GtkTreeIterCompareFunc  func,
-                                        gpointer                data,
+                                        GtkTreeIterCompareFunc  sort_func,
+                                        gpointer                user_data,
                                         GtkDestroyNotify        destroy)
 {
   GtkTreeSortableIface *iface;
@@ -145,9 +197,19 @@ gtk_tree_sortable_set_default_sort_func (GtkTreeSortable        *sortable,
   g_return_if_fail (iface != NULL);
   g_return_if_fail (iface->set_default_sort_func != NULL);
   
-  (* iface->set_default_sort_func) (sortable, func, data, destroy);
+  (* iface->set_default_sort_func) (sortable, sort_func, user_data, destroy);
 }
 
+/**
+ * gtk_tree_sortable_has_default_sort_func:
+ * @sortable: A #GtkTreeSortable
+ * 
+ * Returns %TRUE if the model has a default sort function.  This is used
+ * primarily by GtkTreeViewColumns in order to determine if a model can go back
+ * to the default state, or not.
+ * 
+ * Return value: %TRUE, if the model has a default sort function
+ **/
 gboolean
 gtk_tree_sortable_has_default_sort_func (GtkTreeSortable *sortable)
 {
index d41c7f957fe8a0678eae3f400f380a2fd9117e0a..a5296cb0291fe0fd3dc14cd2c195d6ec9714006f 100644 (file)
@@ -81,12 +81,12 @@ void     gtk_tree_sortable_set_sort_column_id    (GtkTreeSortable        *sortab
                                                  GtkSortType             order);
 void     gtk_tree_sortable_set_sort_func         (GtkTreeSortable        *sortable,
                                                  gint                    sort_column_id,
-                                                 GtkTreeIterCompareFunc  func,
-                                                 gpointer                data,
+                                                 GtkTreeIterCompareFunc  sort_func,
+                                                 gpointer                user_data,
                                                  GtkDestroyNotify        destroy);
 void     gtk_tree_sortable_set_default_sort_func (GtkTreeSortable        *sortable,
-                                                 GtkTreeIterCompareFunc  func,
-                                                 gpointer                data,
+                                                 GtkTreeIterCompareFunc  sort_func,
+                                                 gpointer                user_data,
                                                  GtkDestroyNotify        destroy);
 gboolean gtk_tree_sortable_has_default_sort_func (GtkTreeSortable        *sortable);
                                                  
index cd56957e28ef616d926770f54ec8adfe85c44094..6d17ba32155393bd4b51914a1defe81e30786d97 100644 (file)
@@ -25,7 +25,7 @@
 #include <gobject/gvaluecollector.h>
 
 #define G_NODE(node) ((GNode *)node)
-#define GTK_TREE_STORE_IS_SORTED(tree) (GTK_TREE_STORE (tree)->sort_column_id != -1)
+#define GTK_TREE_STORE_IS_SORTED(tree) (GTK_TREE_STORE (tree)->sort_column_id != -2)
 #define VALID_ITER(iter, tree_store) (iter!= NULL && iter->user_data != NULL && tree_store->stamp == iter->stamp)
 
 static void         gtk_tree_store_init            (GtkTreeStore      *tree_store);
@@ -246,7 +246,7 @@ gtk_tree_store_init (GtkTreeStore *tree_store)
   tree_store->root = g_node_new (NULL);
   tree_store->stamp = g_random_int ();
   tree_store->sort_list = NULL;
-  tree_store->sort_column_id = -1;
+  tree_store->sort_column_id = -2;
 }
 
 /**