2 PSPPIRE --- A Graphical User Interface for PSPP
3 Copyright (C) 2004, 2005, 2006 Free Software Foundation
4 Written by John Darrington
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
22 * Initial main.c file generated by Glade. Edit as required.
23 * Glade will not overwrite this file.
27 #include <libpspp/version.h>
28 #include <libpspp/copyleft.h>
32 #include <glade/glade.h>
33 #include "menu-actions.h"
34 #include "psppire-dict.h"
35 #include "psppire-var-store.h"
36 #include "psppire-data-store.h"
39 #include "data-sheet.h"
40 #include "var-sheet.h"
41 #include "psppire-case-array.h"
46 PsppireDict *the_dictionary = 0;
47 PsppireCaseArray *the_cases = 0;
50 PsppireDataStore *data_store = 0;
53 static bool parse_command_line (int *argc, char ***argv);
57 main(int argc, char *argv[])
59 PsppireVarStore *var_store ;
60 GtkWidget *data_editor ;
62 GtkSheet *data_sheet ;
64 if ( ! parse_command_line(&argc, &argv) )
67 gtk_init(&argc, &argv);
71 the_dictionary = psppire_dict_new();
73 /* Create the model for the var_sheet */
74 var_store = psppire_var_store_new(the_dictionary);
76 /* Create the model for the data sheet */
77 the_cases = psppire_case_array_new(100, 20);
79 data_store = psppire_data_store_new(the_dictionary, the_cases);
81 /* load the interface */
82 xml = glade_xml_new(PKGDATADIR "/psppire.glade", NULL, NULL);
86 data_editor = get_widget_assert(xml, "data_editor");
87 gtk_window_set_icon_from_file(GTK_WINDOW(data_editor),
88 PKGDATADIR "/psppicon.png",0);
90 /* connect the signals in the interface */
91 glade_xml_signal_autoconnect(xml);
93 var_sheet = GTK_SHEET(get_widget_assert(xml, "variable_sheet"));
94 data_sheet = GTK_SHEET(get_widget_assert(xml, "data_sheet"));
96 gtk_sheet_set_model(var_sheet, G_SHEET_MODEL(var_store));
98 gtk_sheet_set_model(data_sheet, G_SHEET_MODEL(data_store));
101 gtk_init_add(callbacks_on_init, 0);
103 /* start the event loop */
109 /* Parses the command line specified by ARGC and ARGV as received by
110 main(). Returns true if normal execution should proceed,
111 false if the command-line indicates that PSPP should exit. */
113 parse_command_line (int *argc, char ***argv)
115 static struct option long_options[] =
117 {"help", no_argument, NULL, 'h'},
118 {"version", no_argument, NULL, 'V'},
126 c = getopt_long (*argc, *argv, "hV", long_options, NULL);
133 g_print("Usage: psppire {|--help|--version}\n");