1/* gtktreedatalist.h
2 * Copyright (C) 2000 Red Hat, Inc., Jonathan Blandford <jrb@redhat.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
13 *
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#ifndef __GTK_TREE_DATA_LIST_H__
19#define __GTK_TREE_DATA_LIST_H__
20
21#include <gtk/gtktreemodel.h>
22#include <gtk/gtktreesortable.h>
23
24typedef struct _GtkTreeDataList GtkTreeDataList;
25struct _GtkTreeDataList
26{
27 GtkTreeDataList *next;
28
29 union {
30 int v_int;
31 gint8 v_char;
32 guint8 v_uchar;
33 guint v_uint;
34 glong v_long;
35 gulong v_ulong;
36 gint64 v_int64;
37 guint64 v_uint64;
38 float v_float;
39 double v_double;
40 gpointer v_pointer;
41 } data;
42};
43
44typedef struct _GtkTreeDataSortHeader
45{
46 int sort_column_id;
47 GtkTreeIterCompareFunc func;
48 gpointer data;
49 GDestroyNotify destroy;
50} GtkTreeDataSortHeader;
51
52GtkTreeDataList *_gtk_tree_data_list_alloc (void);
53void _gtk_tree_data_list_free (GtkTreeDataList *list,
54 GType *column_headers);
55gboolean _gtk_tree_data_list_check_type (GType type);
56void _gtk_tree_data_list_node_to_value (GtkTreeDataList *list,
57 GType type,
58 GValue *value);
59void _gtk_tree_data_list_value_to_node (GtkTreeDataList *list,
60 GValue *value);
61
62GtkTreeDataList *_gtk_tree_data_list_node_copy (GtkTreeDataList *list,
63 GType type);
64
65/* Header code */
66int _gtk_tree_data_list_compare_func (GtkTreeModel *model,
67 GtkTreeIter *a,
68 GtkTreeIter *b,
69 gpointer user_data);
70GList * _gtk_tree_data_list_header_new (int n_columns,
71 GType *types);
72void _gtk_tree_data_list_header_free (GList *header_list);
73GtkTreeDataSortHeader *_gtk_tree_data_list_get_header (GList *header_list,
74 int sort_column_id);
75GList *_gtk_tree_data_list_set_header (GList *header_list,
76 int sort_column_id,
77 GtkTreeIterCompareFunc func,
78 gpointer data,
79 GDestroyNotify destroy);
80
81#endif /* __GTK_TREE_DATA_LIST_H__ */
82

source code of gtk/gtk/gtktreedatalist.h