Commit 21fd434c authored by Jonathan Blandford's avatar Jonathan Blandford Committed by Jonathan Blandford

fix braino. New interface to add cleanup sortable support.

Thu Mar 22 19:27:34 2001  Jonathan Blandford  <jrb@redhat.com>

	* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
	fix braino.
	* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
	support.

	* gtk/gtktreeview.c: Addition of initial sortable support.

	* gtk/gtktreestore.c: Addition of initial sortable support.

	* gtk/gtkliststore.c: Addition of initial sortable support.

	* gtk/gtkmarshal.list: yet another marshaller.

	* gtk/gtktreedatallist.[ch]: shared code between the store models
	for handling sorting headers.
parent 18b5348b
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
Thu Mar 22 19:27:34 2001 Jonathan Blandford <jrb@redhat.com>
* gtk/gtkcellrenderertoggle.c (gtk_cell_renderer_toggle_render):
fix braino.
* gtk/gtktreesortable.[ch]: New interface to add cleanup sortable
support.
* gtk/gtktreeview.c: Addition of initial sortable support.
* gtk/gtktreestore.c: Addition of initial sortable support.
* gtk/gtkliststore.c: Addition of initial sortable support.
* gtk/gtkmarshal.list: yet another marshaller.
* gtk/gtktreedatallist.[ch]: shared code between the store models
for handling sorting headers.
2001-03-22 Havoc Pennington <hp@redhat.com>
* gtk/gtkcontainer.c (gtk_container_set_focus_chain):
......
......@@ -344,6 +344,7 @@ gtk_c_sources = @STRIP_BEGIN@ \
gtktreemodel.c \
gtktreemodelsort.c \
gtktreeselection.c \
gtktreesortable.c \
gtktreestore.c \
gtktreeview.c \
gtktreeviewcolumn.c \
......
......@@ -291,8 +291,8 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
window,
state, shadow,
cell_area, widget, "cellradio",
cell_area->x + x_offset,
cell_area->y + y_offset,
cell_area->x + x_offset + cell->xpad,
cell_area->y + y_offset + cell->ypad,
width, height);
}
else
......@@ -301,8 +301,8 @@ gtk_cell_renderer_toggle_render (GtkCellRenderer *cell,
window,
state, shadow,
cell_area, widget, "cellcheck",
cell_area->x + x_offset,
cell_area->y + y_offset,
cell_area->x + x_offset + cell->xpad,
cell_area->y + y_offset + cell->ypad,
width, height);
}
}
......
......@@ -32,6 +32,7 @@ static void gtk_list_store_class_init (GtkListStoreClass *class);
static void gtk_list_store_tree_model_init (GtkTreeModelIface *iface);
static void gtk_list_store_drag_source_init(GtkTreeDragSourceIface *iface);
static void gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface);
static void gtk_list_store_sortable_init (GtkTreeSortableIface *iface);
static guint gtk_list_store_get_flags (GtkTreeModel *tree_model);
static gint gtk_list_store_get_n_columns (GtkTreeModel *tree_model);
static GType gtk_list_store_get_column_type (GtkTreeModel *tree_model,
......@@ -62,6 +63,8 @@ static gboolean gtk_list_store_iter_parent (GtkTreeModel *tree_mode
GtkTreeIter *iter,
GtkTreeIter *child);
/* Drag and Drop */
static gboolean gtk_list_store_drag_data_delete (GtkTreeDragSource *drag_source,
GtkTreePath *path);
static gboolean gtk_list_store_drag_data_get (GtkTreeDragSource *drag_source,
......@@ -74,6 +77,22 @@ static gboolean gtk_list_store_row_drop_possible (GtkTreeDragDest *drag_dest,
GtkTreeModel *src_model,
GtkTreePath *src_path,
GtkTreePath *dest_path);
/* sortable */
static gboolean gtk_list_store_get_sort_column_id (GtkTreeSortable *sortable,
gint *sort_column_id,
GtkTreeSortOrder *order);
static void gtk_list_store_set_sort_column_id (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeSortOrder order);
static void gtk_list_store_sort_column_id_set_func (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeIterCompareFunc func,
gpointer data,
GtkDestroyNotify destroy);
static void
validate_list_store (GtkListStore *list_store)
{
......@@ -125,7 +144,14 @@ gtk_list_store_get_type (void)
NULL,
NULL
};
static const GInterfaceInfo sortable_info =
{
(GInterfaceInitFunc) gtk_list_store_sortable_init,
NULL,
NULL
};
list_store_type = g_type_register_static (G_TYPE_OBJECT, "GtkListStore", &list_store_info, 0);
g_type_add_interface_static (list_store_type,
GTK_TYPE_TREE_MODEL,
......@@ -136,6 +162,9 @@ gtk_list_store_get_type (void)
g_type_add_interface_static (list_store_type,
GTK_TYPE_TREE_DRAG_DEST,
&drag_dest_info);
g_type_add_interface_static (list_store_type,
GTK_TYPE_TREE_SORTABLE,
&sortable_info);
}
return list_store_type;
......@@ -174,17 +203,26 @@ gtk_list_store_drag_source_init (GtkTreeDragSourceIface *iface)
}
static void
gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface)
gtk_list_store_drag_dest_init (GtkTreeDragDestIface *iface)
{
iface->drag_data_received = gtk_list_store_drag_data_received;
iface->row_drop_possible = gtk_list_store_row_drop_possible;
}
static void
gtk_list_store_sortable_init (GtkTreeSortableIface *iface)
{
iface->get_sort_column_id = gtk_list_store_get_sort_column_id;
iface->set_sort_column_id = gtk_list_store_set_sort_column_id;
iface->sort_column_id_set_func = gtk_list_store_sort_column_id_set_func;
}
static void
gtk_list_store_init (GtkListStore *list_store)
{
list_store->root = NULL;
list_store->tail = NULL;
list_store->sort_list = NULL;
list_store->stamp = g_random_int ();
list_store->length = 0;
}
......@@ -286,6 +324,11 @@ gtk_list_store_set_n_columns (GtkListStore *list_store,
g_free (list_store->column_headers);
}
if (list_store->sort_list)
_gtk_tree_data_list_header_free (list_store->sort_list);
list_store->sort_list = _gtk_tree_data_list_header_new (n_columns, list_store->column_headers);
list_store->column_headers = new_columns;
list_store->n_columns = n_columns;
}
......@@ -815,7 +858,7 @@ insert_after (GtkListStore *list_store,
sibling->next = new_list;
/* if list was the tail, the new node is the new tail */
if (sibling == list_store->tail)
if (sibling == ((GSList *) list_store->tail))
list_store->tail = new_list;
list_store->length += 1;
......@@ -1069,7 +1112,7 @@ gtk_list_store_append (GtkListStore *list_store,
iter->user_data = g_slist_alloc ();
if (list_store->tail)
list_store->tail->next = iter->user_data;
((GSList *)list_store->tail)->next = iter->user_data;
else
list_store->root = iter->user_data;
......@@ -1271,3 +1314,84 @@ gtk_list_store_row_drop_possible (GtkTreeDragDest *drag_dest,
else
return FALSE;
}
/* Sorting */
static gboolean
gtk_list_store_get_sort_column_id (GtkTreeSortable *sortable,
gint *sort_column_id,
GtkTreeSortOrder *order)
{
GtkListStore *list_store = (GtkListStore *) sortable;
g_return_val_if_fail (sortable != NULL, FALSE);
g_return_val_if_fail (GTK_IS_LIST_STORE (sortable), FALSE);
if (list_store->sort_column_id == -1)
return FALSE;
if (sort_column_id)
* sort_column_id = list_store->sort_column_id;
if (order)
* order = list_store->order;
return TRUE;
}
static void
gtk_list_store_set_sort_column_id (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeSortOrder order)
{
GtkListStore *list_store = (GtkListStore *) sortable;
GList *list;
g_return_if_fail (sortable != NULL);
g_return_if_fail (GTK_IS_LIST_STORE (sortable));
for (list = list_store->sort_list; list; list = list->next)
{
GtkTreeDataSortHeader *header = (GtkTreeDataSortHeader*) list->data;
if (header->sort_column_id == sort_column_id)
break;
}
g_return_if_fail (list != NULL);
list_store->sort_column_id = sort_column_id;
list_store->order = order;
}
static void
gtk_list_store_sort_column_id_set_func (GtkTreeSortable *sortable,
gint sort_column_id,
GtkTreeIterCompareFunc func,
gpointer data,
GtkDestroyNotify destroy)
{
GtkListStore *list_store = (GtkListStore *) sortable;
GtkTreeDataSortHeader *header = NULL;
GList *list;
g_return_if_fail (sortable != NULL);
g_return_if_fail (GTK_IS_LIST_STORE (sortable));
g_return_if_fail (func != NULL);
for (list = list_store->sort_list; list; list = list->next)
{
header = (GtkTreeDataSortHeader*) list->data;
if (header->sort_column_id == sort_column_id)
break;
}
if (header == NULL)
{
header = g_new0 (GtkTreeDataSortHeader, 1);
header->sort_column_id = sort_column_id;
list_store->sort_list = g_list_append (list_store->sort_list, header);
}
if (header->destroy)
(* header->destroy) (header->data);
header->func = func;
header->data = data;
header->destroy = destroy;
}
......@@ -21,6 +21,7 @@
#define __GTK_LIST_STORE_H__
#include <gtk/gtktreemodel.h>
#include <gtk/gtktreesortable.h>
#ifdef __cplusplus
extern "C" {
......@@ -42,8 +43,11 @@ struct _GtkListStore
/*< private >*/
gint stamp;
gpointer root;
GSList *tail;
gpointer tail;
GList *sort_list;
gint n_columns;
gint sort_column_id;
GtkTreeSortOrder order;
GType *column_headers;
gint length;
};
......
......@@ -38,6 +38,7 @@ NONE:STRING,INT,POINTER
VOID:BOOLEAN
VOID:BOXED
VOID:BOXED,BOXED
VOID:BOXED,POINTER
VOID:BOXED,OBJECT
VOID:BOXED,STRING,INT
VOID:BOXED,UINT
......
......@@ -38,6 +38,7 @@ NONE:STRING,INT,POINTER
VOID:BOOLEAN
VOID:BOXED
VOID:BOXED,BOXED
VOID:BOXED,POINTER
VOID:BOXED,OBJECT
VOID:BOXED,STRING,INT
VOID:BOXED,UINT
......
......@@ -15,10 +15,13 @@
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* This file contains code shared between GtkTreeStore and GtkListStore. Please
* do not use it.
*/
#include "gtktreedatalist.h"
#include <string.h>
static GMemChunk *tree_chunk = NULL;
#define TREE_CHUNK_PREALLOCS 64
......@@ -250,3 +253,106 @@ _gtk_tree_data_list_node_copy (GtkTreeDataList *list,
return new_list;
}
static gint
gtk_tree_data_list_compare_func (GtkTreeModel *model,
GtkTreeIter *a,
GtkTreeIter *b,
gpointer user_data)
{
gint column = GPOINTER_TO_INT (user_data);
GType type = gtk_tree_model_get_column_type (model, column);
GValue a_value = {0, };
GValue b_value = {0, };
gint retval;
gtk_tree_model_get_value (model, a, column, &a_value);
gtk_tree_model_get_value (model, b, column, &b_value);
switch (G_TYPE_FUNDAMENTAL (type))
{
case G_TYPE_BOOLEAN:
retval = (g_value_get_int (&a_value) < g_value_get_int (&b_value));
break;
case G_TYPE_CHAR:
retval = (g_value_get_char (&a_value) < g_value_get_char (&b_value));
break;
case G_TYPE_UCHAR:
retval = (g_value_get_uchar (&a_value) < g_value_get_uchar (&b_value));
break;
case G_TYPE_INT:
retval = (g_value_get_int (&a_value) < g_value_get_int (&b_value));
break;
case G_TYPE_UINT:
retval = (g_value_get_uint (&a_value) < g_value_get_uint (&b_value));
break;
case G_TYPE_ENUM:
/* this is somewhat bogus. */
retval = (g_value_get_int (&a_value) < g_value_get_int (&b_value));
break;
case G_TYPE_FLAGS:
retval = (g_value_get_uint (&a_value) < g_value_get_uint (&b_value));
break;
case G_TYPE_FLOAT:
retval = (g_value_get_float (&a_value) < g_value_get_float (&b_value));
break;
case G_TYPE_DOUBLE:
retval = (g_value_get_double (&a_value) < g_value_get_double (&b_value));
break;
case G_TYPE_STRING:
retval = strcmp (g_value_get_string (&a_value), g_value_get_string (&b_value));
break;
case G_TYPE_POINTER:
case G_TYPE_BOXED:
case G_TYPE_OBJECT:
default:
g_warning ("Attempting to sort on invalid type %s\n", g_type_name (type));
retval = FALSE;
break;
}
g_value_unset (&a_value);
g_value_unset (&b_value);
return retval;
}
GList *
_gtk_tree_data_list_header_new (gint n_columns,
GType *types)
{
GList *retval = NULL;
gint i;
for (i = 0; i < n_columns; i ++)
{
GtkTreeDataSortHeader *header;
header = g_new (GtkTreeDataSortHeader, 1);
retval = g_list_prepend (retval, header);
header->sort_column_id = i;
header->func = gtk_tree_data_list_compare_func;
header->destroy = NULL;
header->data = GINT_TO_POINTER (i);
}
return g_list_reverse (retval);
}
void
_gtk_tree_data_list_header_free (GList *list)
{
GList *tmp;
for (tmp = list; tmp; tmp = tmp->next)
{
GtkTreeDataSortHeader *header = (GtkTreeDataSortHeader *) tmp->data;
if (header->destroy)
(* header->destroy) (header->data);
g_free (header);
}
g_list_free (list);
}
......@@ -23,6 +23,7 @@
#include <glib.h>
#include <glib-object.h>
#include "gtktreesortable.h"
typedef struct _GtkTreeDataList GtkTreeDataList;
struct _GtkTreeDataList
......@@ -40,6 +41,13 @@ struct _GtkTreeDataList
} data;
};
typedef struct _GtkTreeDataSortHeader
{
gint sort_column_id;
GtkTreeIterCompareFunc func;
gpointer data;
GtkDestroyNotify destroy;
} GtkTreeDataSortHeader;
GtkTreeDataList *_gtk_tree_data_list_alloc (void);
void _gtk_tree_data_list_free (GtkTreeDataList *list,
......@@ -54,5 +62,9 @@ void _gtk_tree_data_list_value_to_node (GtkTreeDataList *list,
GtkTreeDataList *_gtk_tree_data_list_node_copy (GtkTreeDataList *list,
GType type);
/* Header code */
GList *_gtk_tree_data_list_header_new (gint n_columns,
GType *types);
void _gtk_tree_data_list_header_free (GList *header_list);
#endif /* __GTK_TREE_DATA_LIST_H__ */
......@@ -42,7 +42,7 @@ gtk_tree_model_get_type (void)
{
static GtkType tree_model_type = 0;
if (!tree_model_type)
if (! tree_model_type)
{
static const GTypeInfo tree_model_info =
{
......@@ -68,9 +68,9 @@ gtk_tree_model_get_type (void)
static void
gtk_tree_model_base_init (gpointer g_class)
{
static gboolean initted = FALSE;
static gboolean initialized = FALSE;
if (! initted)
if (! initialized)
{
g_signal_newc ("changed",
GTK_TYPE_TREE_MODEL,
......@@ -107,7 +107,16 @@ gtk_tree_model_base_init (gpointer g_class)
gtk_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
GTK_TYPE_TREE_PATH);
initted = TRUE;
g_signal_newc ("reordered",
GTK_TYPE_TREE_MODEL,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeModelIface, reordered),
NULL, NULL,
gtk_marshal_VOID__BOXED_POINTER,
G_TYPE_NONE, 2,
GTK_TYPE_TREE_PATH,
G_TYPE_POINTER);
initialized = TRUE;
}
}
......@@ -1057,6 +1066,18 @@ gtk_tree_model_deleted (GtkTreeModel *tree_model,
g_signal_emit_by_name (tree_model, "deleted", path);
}
void
gtk_tree_model_reordered (GtkTreeModel *tree_model,
GtkTreePath *path,
gint *new_order)
{
g_return_if_fail (tree_model != NULL);
g_return_if_fail (GTK_IS_TREE_MODEL (tree_model));
g_return_if_fail (new_order != NULL);
g_signal_emit_by_name (tree_model, "reordered", path, new_order);
}
/**
** GtkTreeRowReference
......
......@@ -217,6 +217,9 @@ void gtk_tree_model_has_child_toggled (GtkTreeModel *tree_model,
GtkTreeIter *iter);
void gtk_tree_model_deleted (GtkTreeModel *tree_model,
GtkTreePath *path);
void gtk_tree_model_reordered (GtkTreeModel *tree_model,
GtkTreePath *path,
gint *new_order);
......
......@@ -92,7 +92,8 @@ struct _GtkTreeViewPrivate
/* Focus code */
gboolean header_has_focus;
GList *focus_column;
GtkTreeViewColumn *focus_column;
GtkTreeViewColumn *scroll_column;
/* Selection stuff */
GtkTreeRowReference *anchor;
......
/* gtktreesortable.c
* Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#include "gtktreesortable.h"
#include "gtksignal.h"
static void gtk_tree_sortable_base_init (gpointer g_class);
GtkType
gtk_tree_sortable_get_type (void)
{
static GtkType tree_sortable_type = 0;
if (! tree_sortable_type)
{
static const GTypeInfo tree_sortable_info =
{
sizeof (GtkTreeSortableIface), /* class_size */
gtk_tree_sortable_base_init, /* base_init */
NULL, /* base_finalize */
NULL,
NULL, /* class_finalize */
NULL, /* class_data */
0,
0,
NULL
};
tree_sortable_type = g_type_register_static (G_TYPE_INTERFACE, "GtkTreeSortable", &tree_sortable_info, 0);
g_type_interface_add_prerequisite (tree_sortable_type, G_TYPE_OBJECT);
}
return tree_sortable_type;
}
static void
gtk_tree_sortable_base_init (gpointer g_class)
{
static gboolean initialized = FALSE;
if (! initialized)
{
g_signal_newc ("sort_column_changed",
GTK_TYPE_TREE_SORTABLE,
G_SIGNAL_RUN_LAST,
G_STRUCT_OFFSET (GtkTreeSortableIface, sort_column_changed),
NULL, NULL,
gtk_marshal_VOID__VOID,
G_TYPE_NONE, 0);
initialized = TRUE;
}
}
gboolean
gtk_tree_sortable_get_sort_column_id (GtkTreeSortable *sortable,
gint *sort_column_id,
GtkTreeSortOrder *order)
{
GtkTreeSortableIface *iface;
g_return_val_if_fail (sortable != NULL, FALSE);
g_return_val_if_fail (GTK_IS_TREE_SORTABLE (sortable), FALSE);
iface = GTK_TREE_SORTABLE_GET_IFACE (sortable);
g_return_val_if_fail (iface != NULL, FALSE);
g_return_val_if_fail (iface->get_sort_column_id != NULL, FALSE);
return (* iface->get_sort_column_id) (sortable, sort_column_id, order);