Numerous GUI enhancements.
[pspp-builds.git] / src / ui / gui / dialog-common.h
1 /*
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2007  Free Software Foundation
4
5     This program is free software; you can redistribute it and/or modify
6     it under the terms of the GNU General Public License as published by
7     the Free Software Foundation; either version 2 of the License, or
8     (at your option) any later version.
9
10     This program is distributed in the hope that it will be useful,
11     but WITHOUT ANY WARRANTY; without even the implied warranty of
12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13     GNU General Public License for more details.
14
15     You should have received a copy of the GNU General Public License
16     along with this program; if not, write to the Free Software
17     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18     02110-1301, USA. */
19
20
21 /* Some common routines used in the implementation of dialog boxes */
22
23
24 #ifndef DIALOG_COMMON_H
25 #define DIALOG_COMMON_H
26
27 #include <gtk/gtk.h>
28 #include "psppire-dict.h"
29
30 /* Append the names of selected variables to STRING.
31    TREEVIEW is the treeview containing the variables.
32    DICT is the dictionary for those variables.
33 */
34 gint append_variable_names (GString *, PsppireDict *, GtkTreeView *);
35
36
37 /* Returns the variable currently selected by the iterator
38    pointing to TREEMODEL */
39 struct variable * get_selected_variable (GtkTreeModel *treemodel,
40                                          GtkTreeIter *iter,
41                                          PsppireDict *dict);
42
43
44
45 /* A (*GtkTreeCellDataFunc) function.
46    This function expects TREEMODEL to hold G_TYPE_INT.  The ints it holds
47    are the indices of the variables in the dictionary, which DATA points to.
48    It renders the name of the variable into CELL.
49 */
50 void cell_var_name (GtkTreeViewColumn *tree_column,
51                     GtkCellRenderer *cell,
52                     GtkTreeModel *tree_model,
53                     GtkTreeIter *iter,
54                     gpointer data);
55
56
57 /* Set a model for DEST, which is an GtkListStore of g_int's
58    whose values are the indices into DICT */
59 void set_dest_model (GtkTreeView *dest, PsppireDict *dict);
60
61
62 #endif