The argument specifies which dataset the syntax is meant to apply to.
For now, this is obvious, because there is only one dataset, but in
the future there will be more than one.
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2010 Free Software Foundation
+ Copyright (C) 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&fd)));
+ g_free (execute_syntax_string (dw, generate_syntax (&fd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&fd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2010 Free Software Foundation
+ Copyright (C) 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&bin_d)));
+ g_free (execute_syntax_string (dw, generate_syntax (&bin_d)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&bin_d)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2010 Free Software Foundation
+ Copyright (C) 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&csd)));
+ g_free (execute_syntax_string (dw, generate_syntax (&csd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&csd)));
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&cd)));
+ g_free (execute_syntax_string (de, generate_syntax (&cd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&cd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&scd)));
+ g_free (execute_syntax_string (de, generate_syntax (&scd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&scd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2010 Free Software Foundation
+ Copyright (C) 2008, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&cd)));
+ g_free (execute_syntax_string (de, generate_syntax (&cd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&cd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&scd)));
+ g_free (execute_syntax_string (de, generate_syntax (&scd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&scd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation
+ Copyright (C) 2007, 2008, 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&ex_d)));
+ g_free (execute_syntax_string (de, generate_syntax (&ex_d)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&ex_d)));
}
gboolean
-execute_syntax (struct lex_reader *lex_reader)
+execute_syntax (PsppireDataWindow *window, struct lex_reader *lex_reader)
{
struct lexer *lexer;
gboolean retval = TRUE;
/* Executes null-terminated string SYNTAX as syntax.
Returns SYNTAX. */
gchar *
-execute_syntax_string (gchar *syntax)
+execute_syntax_string (PsppireDataWindow *window, gchar *syntax)
{
- execute_const_syntax_string (syntax);
+ execute_const_syntax_string (window, syntax);
return syntax;
}
/* Executes null-terminated string SYNTAX as syntax. */
void
-execute_const_syntax_string (const gchar *syntax)
+execute_const_syntax_string (PsppireDataWindow *window, const gchar *syntax)
{
- execute_syntax (lex_reader_for_string (syntax));
+ execute_syntax (window, lex_reader_for_string (syntax));
}
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation
+ Copyright (C) 2007, 2009, 2010, 2011 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
#define EXECUTOR_H
#include <glib.h>
+#include "ui/gui/psppire-data-window.h"
struct lex_reader;
-gboolean execute_syntax (struct lex_reader *);
-gchar *execute_syntax_string (gchar *syntax);
-void execute_const_syntax_string (const gchar *syntax);
+gboolean execute_syntax (PsppireDataWindow *, struct lex_reader *);
+gchar *execute_syntax_string (PsppireDataWindow *, gchar *syntax);
+void execute_const_syntax_string (PsppireDataWindow *, const gchar *syntax);
#endif
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&fd)));
+ g_free (execute_syntax_string (dw, generate_syntax (&fd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&fd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&fd)));
+ g_free (execute_syntax_string (de, generate_syntax (&fd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&fd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2010 Free Software Foundation
+ Copyright (C) 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&krd)));
+ g_free (execute_syntax_string (dw, generate_syntax (&krd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&krd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&ow)));
+ g_free (execute_syntax_string (de, generate_syntax (&ow)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&ow)));
#include <gtk-contrib/gtkextra-sheet.h>
#include "psppire-data-editor.h"
#include "psppire-var-sheet.h"
+#include "psppire.h"
#include "psppire-data-store.h"
#include <libpspp/i18n.h>
/* Sorting */
static void
-do_sort (PsppireDataStore *ds, int var, gboolean descend)
+do_sort (PsppireDataEditor *de, int var, gboolean descend)
{
- const struct variable *v =
- psppire_dict_get_variable (ds->dict, var);
+ const struct variable *v
+ = psppire_dict_get_variable (de->data_store->dict, var);
gchar *syntax;
syntax = g_strdup_printf ("SORT CASES BY %s%s.",
var_get_name (v), descend ? " (D)" : "");
- g_free (execute_syntax_string (syntax));
+ g_free (execute_syntax_string (psppire_default_data_window (), syntax));
}
PsppireSheetRange range;
psppire_sheet_get_selected_range (PSPPIRE_SHEET(de->data_sheet[0]), &range);
- do_sort (de->data_store, range.col0, FALSE);
+ do_sort (de, range.col0, FALSE);
}
PsppireSheetRange range;
psppire_sheet_get_selected_range (PSPPIRE_SHEET(de->data_sheet[0]), &range);
- do_sort (de->data_store, range.col0, TRUE);
+ do_sort (de, range.col0, TRUE);
}
/* Run the EXECUTE command. */
static void
-execute (void)
+execute (PsppireDataWindow *dw)
{
- execute_const_syntax_string ("EXECUTE.");
+ execute_const_syntax_string (dw, "EXECUTE.");
}
static void
syntax = g_strdup_printf ("GET FILE=%s.", ds_cstr (&filename));
ds_destroy (&filename);
- ok = execute_syntax (lex_reader_for_string (syntax));
+ ok = execute_syntax (PSPPIRE_DATA_WINDOW (de),
+ lex_reader_for_string (syntax));
g_free (syntax);
return ok;
}
ds_destroy (&filename);
- g_free (execute_syntax_string (syntax));
+ g_free (execute_syntax_string (de, syntax));
}
static void
display_dict (PsppireDataWindow *de)
{
- execute_const_syntax_string ("DISPLAY DICTIONARY.");
+ execute_const_syntax_string (de, "DISPLAY DICTIONARY.");
}
static void
g_free (utf8_file_name);
syntax = g_strdup_printf ("SYSFILE INFO %s.", ds_cstr (&filename));
- g_free (execute_syntax_string (syntax));
+ g_free (execute_syntax_string (de, syntax));
}
gtk_widget_destroy (dialog);
static void
new_file (PsppireDataWindow *de)
{
- execute_const_syntax_string ("NEW FILE.");
+ execute_const_syntax_string (de, "NEW FILE.");
psppire_window_set_filename (PSPPIRE_WINDOW (de), NULL);
}
lex_reader_set_file_name (reader, psppire_window_get_filename (win));
- execute_syntax (reader);
+ execute_syntax (psppire_default_data_window (), reader);
}
if (data_file != NULL)
load_data_file (data_file);
- execute_const_syntax_string ("");
+ execute_const_syntax_string (PSPPIRE_DATA_WINDOW (the_data_window), "");
gtk_widget_show (the_data_window);
}
i18n_done ();
}
+PsppireDataWindow *
+psppire_default_data_window (void)
+{
+ return PSPPIRE_DATA_WINDOW (the_data_window);
+}
static void
func (gpointer key, gpointer value, gpointer data)
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2004, 2005, 2006, 2009, 2010 Free Software Foundation
+ Copyright (C) 2004, 2005, 2006, 2009, 2010, 2011 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_H
#define PSPPIRE_H
+#include "ui/gui/psppire-data-window.h"
+
struct lexer;
void initialize (const char *data_file);
const char * output_file_name (void);
void psppire_set_lexer (struct lexer *);
+PsppireDataWindow *psppire_default_data_window (void);
#endif /* PSPPIRE_H */
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation
+ Copyright (C) 2007, 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2010 Free Software Foundation
+ Copyright (C) 2008, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2009, 2010 Free Software Foundation
+ Copyright (C) 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&rd)));
+ g_free (execute_syntax_string (de, generate_syntax (&rd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&rd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&scd)));
+ g_free (execute_syntax_string (de, generate_syntax (&scd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&scd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&scd)));
+ g_free (execute_syntax_string (de, generate_syntax (&scd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&scd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&sfd)));
+ g_free (execute_syntax_string (de, generate_syntax (&sfd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&sfd)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2009, 2010 Free Software Foundation
+ Copyright (C) 2007, 2009, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&tt_d)));
+ g_free (execute_syntax_string (de, generate_syntax (&tt_d)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&tt_d)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&tt_d)));
+ g_free (execute_syntax_string (de, generate_syntax (&tt_d)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&tt_d)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2010 Free Software Foundation
+ Copyright (C) 2008, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&tt_d)));
+ g_free (execute_syntax_string (de, generate_syntax (&tt_d)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&tt_d)));
/* Pops up the Text Data Import assistant. */
void
-text_data_import_assistant (GtkWindow *parent_window)
+text_data_import_assistant (PsppireDataWindow *dw)
{
+ GtkWindow *parent_window = GTK_WINDOW (dw);
struct import_assistant *ia;
ia = xzalloc (sizeof *ia);
switch (ia->asst.response)
{
case GTK_RESPONSE_APPLY:
- free (execute_syntax_string (generate_syntax (ia)));
+ free (execute_syntax_string (dw, generate_syntax (ia)));
break;
case PSPPIRE_RESPONSE_PASTE:
free (paste_syntax_to_window (generate_syntax (ia)));
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2008, 2010 Free Software Foundation
+ Copyright (C) 2008, 2010, 2011 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 TEXT_DATA_IMPORT_DIALOG_H
#define TEXT_DATA_IMPORT_DIALOG_H
-#include <gtk/gtk.h>
+#include <glib-object.h>
+#include "ui/gui/psppire-data-window.h"
-void text_data_import_assistant (GtkWindow *parent_window);
+void text_data_import_assistant (PsppireDataWindow *);
#endif
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (dict, xml)));
+ g_free (execute_syntax_string (de, generate_syntax (dict, xml)));
break;
case PSPPIRE_RESPONSE_PASTE:
{
/* PSPPIRE - a graphical user interface for PSPP.
- Copyright (C) 2007, 2010 Free Software Foundation
+ Copyright (C) 2007, 2010, 2011 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
switch (response)
{
case GTK_RESPONSE_OK:
- g_free (execute_syntax_string (generate_syntax (&wcd)));
+ g_free (execute_syntax_string (de, generate_syntax (&wcd)));
break;
case PSPPIRE_RESPONSE_PASTE:
g_free (paste_syntax_to_window (generate_syntax (&wcd)));