Remove deprecated objects GtkAction and GtkUIManager
[pspp] / src / ui / gui / psppire-data-window.h
index ecf86bb9abbf48c5b5cd848c2a123ac312e2c2f2..ee4d8e0cab767d54509194e7401d06471371e5a9 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, 2013, 2014, 2016  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 <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 ())
@@ -42,6 +52,12 @@ typedef struct _PsppireDataWindow       PsppireDataWindow;
 typedef struct _PsppireDataWindowClass  PsppireDataWindowClass;
 
 
+enum PsppireDataWindowFormat {
+  PSPPIRE_DATA_WINDOW_SAV,
+  PSPPIRE_DATA_WINDOW_ZSAV,
+  PSPPIRE_DATA_WINDOW_POR
+};
+
 struct _PsppireDataWindow
 {
   PsppireWindow parent;
@@ -50,26 +66,37 @@ struct _PsppireDataWindow
   PsppireDataEditor *data_editor;
   GtkBuilder *builder;
 
+  PsppireDict *dict;
+  struct dataset *dataset;
+  PsppireDataStore *data_store;
 
-  GtkAction *invoke_goto_dialog;
+  enum PsppireDataWindowFormat format;
 
-  GtkAction *insert_variable;
-  GtkAction *insert_case;
-  GtkAction *delete_variables;
-  GtkAction *delete_cases;
+  struct ll ll;                 /* In global 'all_data_windows' list. */
+  unsigned long int lazy_serial;
+  unsigned int dataset_seqno;
 
+  GtkToolItem *ti_value_labels_button;
 
-  GtkMenu *data_sheet_variable_popup_menu;
-  GtkMenu *data_sheet_cases_popup_menu;
-  GtkMenu *var_sheet_variable_popup_menu;
+  GtkToolItem *ti_jump_to_variable;
+  GtkToolItem *ti_insert_variable;
+  GtkToolItem *ti_jump_to_case;
+  GtkToolItem *ti_insert_case;
+  GtkToolItem *ti_find;
 
+  GtkWidget *mi_go_to_case;
+  GtkWidget *mi_insert_case;
+  GtkWidget *mi_find;
+  GtkWidget *mi_find_separator;
 
-  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;
+  GtkWidget *mi_edit_separator ;
+  GtkWidget *mi_cut;
+  GtkWidget *mi_copy;
+  GtkWidget *mi_paste;
+  GtkWidget *mi_clear_variables;
+  GtkWidget *mi_clear_cases;
+  GtkWidget *mi_insert_var;
 };
 
 struct _PsppireDataWindowClass
@@ -77,10 +104,23 @@ 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);
-void       psppire_data_window_load_file (PsppireDataWindow *, const gchar *);
+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 *);
+GtkWindow * create_data_window (void);
+void open_data_window (PsppireWindow *victim, const char *file_name,
+                       const char *encoding, gpointer hint);
 
 G_END_DECLS