gui: Redo var sheet, data sheet, text import with PsppSheetView.
[pspp] / src / ui / gui / psppire-data-window.h
index 77687dc9c53a2098c68f300243a93fbb4fa1bc54..f939d9ff1522ecb35679526d5b1ad24f78b7e59c 100644 (file)
@@ -1,5 +1,5 @@
 /* PSPPIRE - a graphical user interface for PSPP.
-   Copyright (C) 2008  Free Software Foundation
+   Copyright (C) 2008, 2010, 2011, 2012  Free Software Foundation
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #ifndef __PSPPIRE_DATA_WINDOW_H__
 #define __PSPPIRE_DATA_WINDOW_H__
 
+/* PsppireDataWindow is a top-level window for editing a PSPP dataset.
+
+   PsppireDataWindow contains a PsppireDataEditor.
+
+   PsppireDataWindow's own functionality basically amounts to managing menus
+   and toolbars.  In addition to maintaining some menu itema and toolbar items
+   of its own, it merges in menu and toolbar items provided by its child
+   PsppireDataEditor (based on the "ui-manager" property of PsppireDataEditor).
+ */
 
 #include <glib.h>
 #include <glib-object.h>
-#include <gtk/gtkaction.h>
-#include "psppire-window.h"
-#include "psppire-data-editor.h"
-#include <glade/glade.h>
 #include <gtk/gtk.h>
 
+#include "libpspp/ll.h"
+#include "ui/gui/psppire-window.h"
+#include "ui/gui/psppire-data-editor.h"
+
 G_BEGIN_DECLS
 
 #define PSPPIRE_DATA_WINDOW_TYPE            (psppire_data_window_get_type ())
@@ -49,61 +58,21 @@ struct _PsppireDataWindow
 
   /* <private> */
   PsppireDataEditor *data_editor;
-  GladeXML *xml;
-  GtkAction *action_data_new;
-  GtkAction *action_data_open;
-  GtkAction *action_data_save_as;
-  GtkAction *action_data_save;
-
-  GtkAction *invoke_text_import_assistant;
-
-  /* Actions which invoke dialog boxes */
-  GtkAction *invoke_weight_cases_dialog;
-  GtkAction *invoke_transpose_dialog;
-  GtkAction *invoke_split_file_dialog;
-  GtkAction *invoke_sort_cases_dialog;
-  GtkAction *invoke_compute_dialog;
-  GtkAction *invoke_comments_dialog;
-  GtkAction *invoke_select_cases_dialog;
-  GtkAction *invoke_goto_dialog;
-  GtkAction *invoke_variable_info_dialog;
-  GtkAction *invoke_find_dialog;
-  GtkAction *invoke_rank_dialog;
-  GtkAction *invoke_recode_same_dialog;
-  GtkAction *invoke_recode_different_dialog;
-
-  GtkAction *invoke_crosstabs_dialog;
-  GtkAction *invoke_descriptives_dialog;
-  GtkAction *invoke_frequencies_dialog;
-  GtkAction *invoke_examine_dialog;
-  GtkAction *invoke_regression_dialog;
-
-  GtkAction *invoke_t_test_independent_samples_dialog;
-  GtkAction *invoke_t_test_paired_samples_dialog;
-  GtkAction *invoke_oneway_anova_dialog;
-  GtkAction *invoke_t_test_one_sample_dialog;
-
-  GtkToggleAction *toggle_split_window;
-  GtkToggleAction *toggle_value_labels;
-
-
-  GtkAction *insert_variable;
-  GtkAction *insert_case;
-  GtkAction *delete_variables;
-  GtkAction *delete_cases;
-
-
-  GtkMenu *data_sheet_variable_popup_menu;
-  GtkMenu *data_sheet_cases_popup_menu;
-  GtkMenu *var_sheet_variable_popup_menu;
+  GtkBuilder *builder;
+  GtkUIManager *ui_manager;
 
+  PsppireVarStore *var_store;
+  struct dataset *dataset;
+  PsppireDataStore *data_store;
 
   gboolean save_as_portable;
 
-  /* Name of the file this data is associated with (ie, was loaded from or
-     has been  saved to), in "filename encoding",  or NULL, if it's not
-     associated with any file */
-  gchar *file_name;
+  struct ll ll;                 /* In global 'all_data_windows' list. */
+  unsigned long int lazy_serial;
+  unsigned int dataset_seqno;
+
+  GtkUIManager *uim;
+  guint merge_id;
 };
 
 struct _PsppireDataWindowClass
@@ -111,9 +80,22 @@ struct _PsppireDataWindowClass
   PsppireWindowClass parent_class;
 };
 
+extern struct session *the_session;
+extern struct ll_list all_data_windows;
+
 GType      psppire_data_window_get_type        (void);
-GtkWidget* psppire_data_window_new             (void);
+GtkWidget* psppire_data_window_new             (struct dataset *);
+
+PsppireDataWindow *psppire_default_data_window (void);
+void psppire_data_window_set_default (PsppireDataWindow *);
+void psppire_data_window_undefault (PsppireDataWindow *);
+
+PsppireDataWindow *psppire_data_window_for_dataset (struct dataset *);
+PsppireDataWindow *psppire_data_window_for_data_store (PsppireDataStore *);
 
+bool psppire_data_window_is_empty (PsppireDataWindow *);
+void create_data_window (void);
+void open_data_window (PsppireWindow *victim, const char *file_name);
 
 G_END_DECLS