#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)
{
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);
}
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;
}
{
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");
}
/**
*
* 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,
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);
}
*
* 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,