]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtktreesortable.c
New static function to set the background of all windows.
[~andy/gtk] / gtk / gtktreesortable.c
index 1bf89a95a1972b664dc138207b5d72e9d84695ff..f9ad6fb3b33b777e4f0228d86789944bb8a7b8ec 100644 (file)
 
 
 #include "gtktreesortable.h"
-#include "gtksignal.h"
+#include "gtkmarshalers.h"
 
 static void gtk_tree_sortable_base_init (gpointer g_class);
 
-GtkType
+GType
 gtk_tree_sortable_get_type (void)
 {
-  static GtkType tree_sortable_type = 0;
+  static GType tree_sortable_type = 0;
 
   if (! tree_sortable_type)
     {
@@ -42,7 +42,11 @@ gtk_tree_sortable_get_type (void)
        0,
        NULL
       };
-      tree_sortable_type = g_type_register_static (G_TYPE_INTERFACE, "GtkTreeSortable", &tree_sortable_info, 0);
+
+      tree_sortable_type =
+       g_type_register_static (G_TYPE_INTERFACE, "GtkTreeSortable",
+                               &tree_sortable_info, 0);
+
       g_type_interface_add_prerequisite (tree_sortable_type, GTK_TYPE_TREE_MODEL);
     }
 
@@ -61,7 +65,7 @@ gtk_tree_sortable_base_init (gpointer g_class)
                     G_SIGNAL_RUN_LAST,
                     G_STRUCT_OFFSET (GtkTreeSortableIface, sort_column_changed),
                     NULL, NULL,
-                    gtk_marshal_VOID__VOID,
+                    _gtk_marshal_VOID__VOID,
                     G_TYPE_NONE, 0);
       initialized = TRUE;
     }
@@ -78,8 +82,7 @@ gtk_tree_sortable_sort_column_changed (GtkTreeSortable *sortable)
 {
   g_return_if_fail (GTK_IS_TREE_SORTABLE (sortable));
 
-  g_signal_emit_by_name (G_OBJECT (sortable),
-                        "sort_column_changed");
+  g_signal_emit_by_name (sortable, "sort_column_changed");
 }
 
 /**
@@ -150,7 +153,7 @@ gtk_tree_sortable_set_sort_column_id (GtkTreeSortable  *sortable,
  * 
  * 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.
+ * model will sort using this function.
  **/
 void
 gtk_tree_sortable_set_sort_func (GtkTreeSortable        *sortable,
@@ -167,7 +170,7 @@ gtk_tree_sortable_set_sort_func (GtkTreeSortable        *sortable,
 
   g_return_if_fail (iface != NULL);
   g_return_if_fail (iface->set_sort_func != NULL);
-  g_return_if_fail (sort_column_id > 0);
+  g_return_if_fail (sort_column_id >= 0);
 
   (* iface->set_sort_func) (sortable, sort_column_id, sort_func, user_data, destroy);
 }
@@ -181,9 +184,12 @@ gtk_tree_sortable_set_sort_func (GtkTreeSortable        *sortable,
  * 
  * Sets the default comparison function used when sorting to be @sort_func.  If
  * the current sort column id of @sortable is
- * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort.  If
- * @sort_func is %NULL, then the default sort_func, and there will be no default
- * sort_func.  In this case, the model is unsorted.
+ * %GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, then the model will sort using this function.
+ *
+ * If @sort_func is %NULL, then there will be no default comparison function.
+ * This means that once the model  has been sorted, it can't go back to the
+ * default state. In this case, when the current sort column id of @sortable is
+ * GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID, the model will be unsorted.
  **/
 void
 gtk_tree_sortable_set_default_sort_func (GtkTreeSortable        *sortable,