Merge commit 'HEAD'; commit 'master/master'
[pspp-builds.git] / src / ui / gui / helper.h
1 /* PSPPIRE - a graphical user interface for PSPP.
2    Copyright (C) 2004  Free Software Foundation
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
18 #ifndef __MISC_H__
19 #define __MISC_H__
20
21 #include "relocatable.h"
22
23 #include <data/format.h>
24 #include <data/value.h>
25
26 #include <gtk/gtk.h>
27 #include <glade/glade.h>
28
29
30
31 void paste_syntax_in_new_window (const gchar *syntax);
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 struct fmt_spec;
41
42 /* Formats a value according to FORMAT
43    The returned string must be freed when no longer required */
44 gchar * value_to_text (union value v, struct fmt_spec format);
45
46
47 gboolean text_to_value (const gchar *text, union value *v,
48                        struct fmt_spec format);
49
50 GtkWidget * get_widget_assert (gpointer x, const gchar *name);
51
52 /* Converts a string in the pspp locale to utf-8 */
53 char * pspp_locale_to_utf8 (const gchar *text, gssize len, GError **err);
54
55
56 void connect_help (GladeXML *);
57
58 void reference_manual (GtkMenuItem *, gpointer);
59
60 struct getl_interface;
61 gboolean execute_syntax (struct getl_interface *sss);
62
63 #define XML_NEW(FILE) \
64    glade_xml_new (relocate(PKGDATADIR "/" FILE), NULL, NULL)
65
66
67 #define builder_new(NAME) builder_new_real (relocate (PKGDATADIR "/" NAME))
68
69 GtkBuilder *builder_new_real (const gchar *name);
70
71
72 /* Create a deep copy of SRC */
73 GtkListStore * clone_list_store (const GtkListStore *src);
74
75
76 #endif