]> Pileus Git - ~andy/gtk/blob - gtk/gtkliststore.h
Massive padding addition to class structures.
[~andy/gtk] / gtk / gtkliststore.h
1 /* gtkliststore.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, write to the
16  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17  * Boston, MA 02111-1307, USA.
18  */
19
20 #ifndef __GTK_LIST_STORE_H__
21 #define __GTK_LIST_STORE_H__
22
23 #include <gtk/gtktreemodel.h>
24 #include <gtk/gtktreesortable.h>
25
26 #ifdef __cplusplus
27 extern "C" {
28 #endif /* __cplusplus */
29
30 #define GTK_TYPE_LIST_STORE            (gtk_list_store_get_type ())
31 #define GTK_LIST_STORE(obj)            (GTK_CHECK_CAST ((obj), GTK_TYPE_LIST_STORE, GtkListStore))
32 #define GTK_LIST_STORE_CLASS(klass)    (GTK_CHECK_CLASS_CAST ((klass), GTK_TYPE_LIST_STORE, GtkListStoreClass))
33 #define GTK_IS_LIST_STORE(obj)         (GTK_CHECK_TYPE ((obj), GTK_TYPE_LIST_STORE))
34 #define GTK_IS_LIST_STORE_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GTK_TYPE_LIST_STORE))
35 #define GTK_LIST_STORE_GET_CLASS(obj)  (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_LIST_STORE, GtkListStoreClass))
36
37 typedef struct _GtkListStore       GtkListStore;
38 typedef struct _GtkListStoreClass  GtkListStoreClass;
39
40 struct _GtkListStore
41 {
42   GObject parent;
43
44   /*< private >*/
45   gint stamp;
46   gpointer root;
47   gpointer tail;
48   GList *sort_list;
49   gint n_columns;
50   gint sort_column_id;
51   GtkSortType order;
52   GType *column_headers;
53   gint length;
54   GtkTreeIterCompareFunc default_sort_func;
55   gpointer default_sort_data;
56   GtkDestroyNotify default_sort_destroy;
57   guint columns_dirty : 1;
58 };
59
60 struct _GtkListStoreClass
61 {
62   GObjectClass parent_class;
63
64   /* Padding for future expansion */
65   void (*_gtk_reserved1) (void);
66   void (*_gtk_reserved2) (void);
67   void (*_gtk_reserved3) (void);
68   void (*_gtk_reserved4) (void);
69 };
70
71
72 GtkType       gtk_list_store_get_type         (void);
73 GtkListStore *gtk_list_store_new              (gint          n_columns,
74                                                ...);
75 GtkListStore *gtk_list_store_newv             (gint          n_columns,
76                                                GType        *types);
77 void          gtk_list_store_set_column_types (GtkListStore *list_store,
78                                                gint          n_columns,
79                                                GType        *types);
80
81 /* NOTE: use gtk_tree_model_get to get values from a GtkListStore */
82
83 void          gtk_list_store_set_value        (GtkListStore *list_store,
84                                                GtkTreeIter  *iter,
85                                                gint          column,
86                                                GValue       *value);
87 void          gtk_list_store_set              (GtkListStore *list_store,
88                                                GtkTreeIter  *iter,
89                                                ...);
90 void          gtk_list_store_set_valist       (GtkListStore *list_store,
91                                                GtkTreeIter  *iter,
92                                                va_list       var_args);
93 void          gtk_list_store_remove           (GtkListStore *list_store,
94                                                GtkTreeIter  *iter);
95 void          gtk_list_store_insert           (GtkListStore *list_store,
96                                                GtkTreeIter  *iter,
97                                                gint          position);
98 void          gtk_list_store_insert_before    (GtkListStore *list_store,
99                                                GtkTreeIter  *iter,
100                                                GtkTreeIter  *sibling);
101 void          gtk_list_store_insert_after     (GtkListStore *list_store,
102                                                GtkTreeIter  *iter,
103                                                GtkTreeIter  *sibling);
104 void          gtk_list_store_prepend          (GtkListStore *list_store,
105                                                GtkTreeIter  *iter);
106 void          gtk_list_store_append           (GtkListStore *list_store,
107                                                GtkTreeIter  *iter);
108 void          gtk_list_store_clear            (GtkListStore *list_store);
109
110
111 #ifdef __cplusplus
112 }
113 #endif /* __cplusplus */
114
115
116 #endif /* __GTK_LIST_STORE_H__ */