Implemented the recently used files menus.
[pspp-builds.git] / src / ui / gui / helper.h
1 /*
2     PSPPIRE --- A Graphical User Interface for PSPP
3     Copyright (C) 2004  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 #ifndef __MISC_H__
22 #define __MISC_H__
23
24 #include "relocatable.h"
25
26 #include <data/value.h>
27 #include <data/format.h>
28
29 #include <gtk/gtk.h>
30 #include <glade/glade.h>
31
32
33 /*
34    GtkRecentChooserMenu was added in 2.10.0
35    but it didn't support GtkRecentFilters until
36    2.10.2
37 */
38 #define RECENT_LISTS_AVAILABLE GTK_CHECK_VERSION (2, 10, 2)
39
40
41 /* Formats a value according to FORMAT
42    The returned string must be freed when no longer required */
43 gchar * value_to_text (union value v, struct fmt_spec format);
44
45
46 gboolean text_to_value (const gchar *text, union value *v,
47                        struct fmt_spec format);
48
49 GtkWidget * get_widget_assert (GladeXML *xml, const gchar *name);
50
51 /* Converts a string in the pspp locale to utf-8 */
52 char * pspp_locale_to_utf8 (const gchar *text, gssize len, GError **err);
53
54
55 void connect_help (GladeXML *);
56
57 void reference_manual (GtkMenuItem *, gpointer);
58
59 struct getl_interface;
60 gboolean execute_syntax (struct getl_interface *sss);
61
62
63 #define XML_NEW(FILE) \
64    glade_xml_new (relocate(PKGDATADIR "/" FILE), NULL, NULL)
65
66
67
68 #endif