Change license from GPLv2+ to GPLv3+.
[pspp-builds.git] / src / ui / gui / dialog-common.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2007 Free Software Foundation, Inc.
3
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.
8
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.
13
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/>. */
16
17 /* Some common routines used in the implementation of dialog boxes */
18
19
20 #ifndef DIALOG_COMMON_H
21 #define DIALOG_COMMON_H
22
23 #include <gtk/gtk.h>
24 #include "psppire-dict.h"
25
26 /* Append the names of selected variables to STRING.
27    TREEVIEW is the treeview containing the variables.
28    DICT is the dictionary for those variables.
29 */
30 gint append_variable_names (GString *, PsppireDict *, GtkTreeView *);
31
32
33 /* Returns the variable currently selected by the iterator
34    pointing to TREEMODEL */
35 struct variable * get_selected_variable (GtkTreeModel *treemodel,
36                                          GtkTreeIter *iter,
37                                          PsppireDict *dict);
38
39
40
41 /* A (*GtkTreeCellDataFunc) function.
42    This function expects TREEMODEL to hold G_TYPE_INT.  The ints it holds
43    are the indices of the variables in the dictionary, which DATA points to.
44    It renders the name of the variable into CELL.
45 */
46 void cell_var_name (GtkTreeViewColumn *tree_column,
47                     GtkCellRenderer *cell,
48                     GtkTreeModel *tree_model,
49                     GtkTreeIter *iter,
50                     gpointer data);
51
52
53 /* Set a model for DEST, which is an GtkListStore of g_int's
54    whose values are the indices into DICT */
55 void set_dest_model (GtkTreeView *dest, PsppireDict *dict);
56
57
58 #endif