1 /* PSPPIRE - a graphical user interface for PSPP.
2 Copyright (C) 2011, 2012 Free Software Foundation, Inc.
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 This program 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>. */
17 #ifndef PSPPIRE_EMPTY_LIST_STORE_H
18 #define PSPPIRE_EMPTY_LIST_STORE_H 1
20 /* PsppireEmptyListStore is an GtkTreeModel implementation that has a
21 client-specified number of rows and zero columns. It is a useful model for
22 GtkTreeView or PsppSheetView when the client can easily synthesize cell data
23 using a callback set with gtk_tree_view_column_set_cell_data_func(). In
24 that situation, GtkListStore can be wasteful (because it uses a lot of
25 memory to store what does not need to be stored) and situation-specific
26 custom models require additional boilerplate. */
28 #include <glib-object.h>
33 #define PSPPIRE_TYPE_EMPTY_LIST_STORE (psppire_empty_list_store_get_type())
34 #define PSPPIRE_EMPTY_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj),PSPPIRE_TYPE_EMPTY_LIST_STORE,PsppireEmptyListStore))
35 #define PSPPIRE_EMPTY_LIST_STORE_CLASS(class) (G_TYPE_CHECK_CLASS_CAST ((class),PSPPIRE_TYPE_EMPTY_LIST_STORE,PsppireEmptyListStoreClass))
36 #define PSPPIRE_IS_EMPTY_LIST_STORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj),PSPPIRE_TYPE_EMPTY_LIST_STORE))
37 #define PSPPIRE_IS_EMPTY_LIST_STORE_CLASS(class) (G_TYPE_CHECK_CLASS_TYPE ((class),PSPPIRE_TYPE_EMPTY_LIST_STORE))
38 #define PSPPIRE_EMPTY_LIST_STORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),PSPPIRE_TYPE_EMPTY_LIST_STORE,PsppireEmptyListStoreClass))
40 typedef struct _PsppireEmptyListStore PsppireEmptyListStore;
41 typedef struct _PsppireEmptyListStoreClass PsppireEmptyListStoreClass;
43 struct _PsppireEmptyListStore {
48 struct _PsppireEmptyListStoreClass {
49 GObjectClass parent_class;
52 GType psppire_empty_list_store_get_type (void) G_GNUC_CONST;
53 PsppireEmptyListStore* psppire_empty_list_store_new (gint n_rows);
55 gint psppire_empty_list_store_get_n_rows (const PsppireEmptyListStore *);
56 void psppire_empty_list_store_set_n_rows (PsppireEmptyListStore *,
59 void psppire_empty_list_store_row_changed (PsppireEmptyListStore *,
61 void psppire_empty_list_store_row_inserted (PsppireEmptyListStore *,
63 void psppire_empty_list_store_row_deleted (PsppireEmptyListStore *,
66 gint empty_list_store_iter_to_row (const GtkTreeIter *);
70 #endif /* PSPPIRE_EMPTY_LIST_STORE_H */