Commit a038ab94 authored by Jody Goldberg's avatar Jody Goldberg Committed by Jody Goldberg

Move more of the pure view elements into WorkbookPrivate.


2000-01-31  Jody Goldberg <jgoldberg@home.com>

	* src/worksheet.h : Move more of the pure view elements into
	  WorkbookPrivate.

	* src/sheet.h : Remove include of workbook.h

	* *.c : manually include workbook.h only where we need it.

	* src/ranges.c (parse_range) : Move here from dialog-analysis-tools.c
	  to avoid warnings.

	* src/corba-workbook.c (Workbook_save_to) : Adjust to new calling
	  convention.
	* src/corba-workbook-factory.c (WorkbookFactory_read) : Ditto.

	* src/parser.y : Support interbook references.

	* src/item-bar.c : Ignore scroll-wheel events. Eventually the app will
	  handle these rather than the grid.
parent c530d9be
2000-01-31 Jody Goldberg <jgoldberg@home.com>
* src/worksheet.h : Move more of the pure view elements into
WorkbookPrivate.
* src/sheet.h : Remove include of workbook.h
* *.c : manually include workbook.h only where we need it.
* src/ranges.c (parse_range) : Move here from dialog-analysis-tools.c
to avoid warnings.
* src/corba-workbook.c (Workbook_save_to) : Adjust to new calling
convention.
* src/corba-workbook-factory.c (WorkbookFactory_read) : Ditto.
* src/parser.y : Support interbook references.
* src/item-bar.c : Ignore scroll-wheel events. Eventually the app will
handle these rather than the grid.
2000-01-31 Matthias Warkus <mawa@iname.com>
* *.png, Makefile.am, gnumeric.keys.in: New file type icons. Flame
......
2000-01-31 Jody Goldberg <jgoldberg@home.com>
* src/worksheet.h : Move more of the pure view elements into
WorkbookPrivate.
* src/sheet.h : Remove include of workbook.h
* *.c : manually include workbook.h only where we need it.
* src/ranges.c (parse_range) : Move here from dialog-analysis-tools.c
to avoid warnings.
* src/corba-workbook.c (Workbook_save_to) : Adjust to new calling
convention.
* src/corba-workbook-factory.c (WorkbookFactory_read) : Ditto.
* src/parser.y : Support interbook references.
* src/item-bar.c : Ignore scroll-wheel events. Eventually the app will
handle these rather than the grid.
2000-01-31 Matthias Warkus <mawa@iname.com>
* *.png, Makefile.am, gnumeric.keys.in: New file type icons. Flame
......
......@@ -18,6 +18,7 @@
#include <gnome.h>
#include "plugin.h"
#include "gnumeric.h"
#include "workbook.h"
#include "file.h"
#include "command-context.h"
......
......@@ -15,6 +15,7 @@
#include "gnumeric-util.h"
#include "file.h"
#include "main.h"
#include "workbook.h"
#include "command-context.h"
#include "excel.h"
......
......@@ -12,6 +12,10 @@
**/
#include "ms-excel-read.h"
#ifdef ENABLE_BONOBO
#include <bonobo.h>
#endif
typedef struct {
char const * reproid;
#ifdef ENABLE_BONOBO
......
......@@ -21,6 +21,7 @@
#include "selection.h"
#include "utils.h" /* for cell_name */
#include "ranges.h"
#include "workbook.h"
#include "ms-excel-util.h"
#include "ms-excel-xf.h"
#include "workbook-view.h"
......@@ -4005,7 +4006,7 @@ ms_excel_read_workbook (CommandContext *context, Workbook *workbook,
gnumeric_error_read (context, problem_loading);
return -1;
}
workbook_recalc (wb->gnum_wb);
workbook_recalc (workbook);
return 0;
}
......
......@@ -39,6 +39,7 @@
#include "utils.h"
#include "print-info.h"
#include "command-context.h"
#include "workbook.h"
#include "ms-ole.h"
#include "ms-biff.h"
......
......@@ -18,6 +18,7 @@
#include <gnome.h>
#include "plugin.h"
#include "gnumeric.h"
#include "workbook.h"
#include "file.h"
#include "command-context.h"
......
......@@ -38,6 +38,7 @@
#include "file.h"
#include "mstyle.h"
#include "formats.h"
#include "workbook.h"
#include "command-context.h"
#include "stf.h"
......
......@@ -22,6 +22,7 @@
#include <errno.h>
#include <gnome.h>
#include "config.h"
#include "workbook.h"
#include "epsf.h"
#include "ps.h"
#include "font.h"
......
......@@ -22,6 +22,7 @@
#include <gnome.h>
#include <errno.h>
#include "config.h"
#include "workbook.h"
#include "html.h"
#include "font.h"
#include "command-context.h"
......
......@@ -22,6 +22,7 @@
#include <gnome.h>
#include <errno.h>
#include "config.h"
#include "workbook.h"
#include "html.h"
#include "font.h"
#include "command-context.h"
......
......@@ -22,6 +22,7 @@
#include <errno.h>
#include <gnome.h>
#include "config.h"
#include "workbook.h"
#include "latex.h"
#include "font.h"
#include "command-context.h"
......
......@@ -22,6 +22,7 @@
#include <errno.h>
#include <gnome.h>
#include "config.h"
#include "workbook.h"
#include "roff.h"
#include "font.h"
#include "command-context.h"
......
......@@ -17,6 +17,7 @@
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
......
......@@ -18,6 +18,7 @@
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
......
......@@ -18,6 +18,7 @@
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
......
......@@ -22,6 +22,7 @@
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
......
2000-01-31 Jody Goldberg <jgoldberg@home.com>
* python.c (gnumeric_apply) : Make the const warning quiet.
2000-01-14 Jon K Hellan <hellan@acm.org>
* python.c (convert_py_exception_to_string): New function.
......
......@@ -16,7 +16,7 @@
/* Yuck!
* See comment in plugins/guile/plugin.c
*/
static EvalPosition *eval_pos = NULL;
static EvalPosition const *eval_pos = NULL;
/*
* Support for registering Python-based functions for use in formulas.
......@@ -159,7 +159,7 @@ marshal_func (FunctionEvalInfo *ei, Value *argv [])
FunctionDefinition const * const fndef = ei->func_def;
Value *v;
GList *l;
EvalPosition *old_eval_pos;
EvalPosition const *old_eval_pos;
int i, min, max;
char *exc_string;
......
......@@ -18,6 +18,7 @@
#include <gnome.h>
#include "plugin.h"
#include "gnumeric.h"
#include "workbook.h"
#include "file.h"
#include "utils.h"
#include "command-context.h"
......
......@@ -24,6 +24,7 @@
#include "gnumeric.h"
#include "file.h"
#include "command-context.h"
#include "workbook.h"
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
......
......@@ -19,6 +19,7 @@
#include <sys/types.h>
#include <fcntl.h>
#include <errno.h>
#include "workbook.h"
#include "command-context.h"
#include "text-io.h"
#include "file.h"
......
......@@ -17,6 +17,7 @@
#include <ctype.h>
#include <gnome.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "main.h"
#include "sheet.h"
......
......@@ -9,6 +9,7 @@
#include <gnome.h>
#include "gnumeric.h"
#include "dialogs.h"
#include "workbook.h"
/*
* We need to get rid of that so that we will be able
......
......@@ -17,7 +17,7 @@
#include "utils.h"
#include "tools.h"
#include "regression.h"
#include "workbook.h"
typedef struct {
GSList *array;
......
......@@ -9,6 +9,7 @@
#include "application.h"
#include "clipboard.h"
#include "selection.h"
#include "workbook.h"
#include "workbook-view.h"
typedef struct
......
#ifndef GNUMERIC_APPLICATION_H
#define GNUMERIC_APPLICATION_H
#include "workbook.h"
#include "gnumeric.h"
void application_init (void);
......
......@@ -16,6 +16,7 @@
#include "selection.h"
#include "application.h"
#include "render-ascii.h"
#include "workbook.h"
#include "workbook-view.h"
#include "ranges.h"
......
......@@ -10,6 +10,7 @@
#include "gnumeric-type-util.h"
#include "commands.h"
#include "sheet.h"
#include "workbook.h"
#include "workbook-view.h"
#include "ranges.h"
#include "sort.h"
......
......@@ -10,8 +10,8 @@
#include <gnome.h>
#include "sheet.h"
#include "gnumeric.h"
#include "workbook.h"
#include "Gnumeric.h"
#include "xml-io.h"
#include "corba.h"
#include "command-context-corba.h"
......
......@@ -10,6 +10,7 @@
#include <bonobo/bonobo-object.h>
#include "sheet.h"
#include "gnumeric.h"
#include "workbook.h"
#include "Gnumeric.h"
#include "xml-io.h"
#include "corba.h"
......
......@@ -13,6 +13,7 @@
#include "ranges.h"
#include "eval.h"
#include "main.h"
#include "workbook.h"
typedef enum {
REMOVE_DEPS = 0,
......
......@@ -9,6 +9,7 @@
#include <gnome.h>
#include "gnumeric.h"
#include "dialogs.h"
#include "workbook.h"
/*
* We need to get rid of that so that we will be able
......
......@@ -13,6 +13,7 @@
#include "gnumeric-util.h"
#include "gnumeric-sheet.h"
#include "dialogs.h"
#include "workbook.h"
#include "func.h"
......
......@@ -10,13 +10,14 @@
#include <glade/glade.h>
#include <string.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "utils-dialog.h"
#include "dialogs.h"
#include "utils.h"
#include "utils-dialog.h"
#include "tools.h"
#include "ranges.h"
static void dialog_correlation_tool (Workbook *wb, Sheet *sheet);
static void dialog_covariance_tool (Workbook *wb, Sheet *sheet);
......@@ -199,25 +200,6 @@ static check_button_t standard_errors_button[] = {
static int selected_row;
int
parse_range (char *text, int *start_col, int *start_row,
int *end_col, int *end_row)
{
char buf[256];
char *p;
strcpy(buf, text);
p = strchr(buf, ':');
if (p == NULL)
return 0;
*p = '\0';
if (!parse_cell_name (buf, start_col, start_row))
return 0;
if (!parse_cell_name (p+1, end_col, end_row))
return 0;
return 1;
}
/* Parses text specifying ranges into columns, sorting from left to right.
For example, the text "A5:B30,J10:J15,C1:C5" would be returned in **ranges
as the equivalent of running parse_ranges on "A5:A30" "B5:B30" "J10:J15" and
......
......@@ -10,10 +10,10 @@
#include <gnome.h>
#include <glade/glade.h>
#include "gnumeric.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "dialogs.h"
static void
autosave_on_off_toggled(GtkWidget *widget, Workbook *wb)
{
......
......@@ -20,6 +20,7 @@
#include "utils-dialog.h"
#include "ranges.h"
#include "commands.h"
#include "workbook.h"
#include "sort.h"
#define GLADE_FILE "cell-sort.glade"
......
......@@ -11,6 +11,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#define LIST_KEY "name_list_data"
......
......@@ -13,6 +13,7 @@
#include "selection.h"
#include "dialogs.h"
#include "workbook-view.h"
#include "workbook.h"
#include "commands.h"
#define GLADE_FILE "delete-cells.glade"
......
......@@ -10,6 +10,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#include "cell.h"
#include "expr.h"
#include "func.h"
......
......@@ -12,6 +12,7 @@
#include "dialogs.h"
#include "cell.h"
#include "expr.h"
#include "workbook.h"
#include "func.h"
typedef struct {
......
......@@ -10,6 +10,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#include "cell.h"
#include "expr.h"
#include "func.h"
......
......@@ -17,6 +17,7 @@
#include "expr.h"
#include "eval.h"
#include "utils.h"
#include "workbook.h"
#include "utils-dialog.h"
#include "goal-seek.h"
#ifdef HAVE_IEEEFP_H
......
......@@ -10,6 +10,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#include "utils-dialog.h"
static void
......
......@@ -13,6 +13,7 @@
#include "selection.h"
#include "dialogs.h"
#include "workbook-view.h"
#include "workbook.h"
#include "commands.h"
#define GLADE_FILE "insert-cells.glade"
......
......@@ -15,6 +15,7 @@
#include "utils-dialog.h"
#include "func.h"
#include "tools.h"
#include "workbook.h"
#include "utils.h"
#include "utils-dialog.h"
......
......@@ -11,7 +11,7 @@
#include "gnumeric.h"
#include "gnumeric-util.h"
#include "dialogs.h"
#include "workbook.h"
#define NUM_RADIO_BUTTONS 5
#define GLADE_FILE "dialog-zoom.glade"
......
......@@ -15,6 +15,7 @@
#include <bonobo/bonobo-embeddable-factory.h>
#include "Gnumeric.h"
#include "sheet.h"
#include "workbook.h"
#include "embeddable-grid.h"
/*
......
......@@ -13,6 +13,7 @@
#include "ranges.h"
#include "eval.h"
#include "main.h"
#include "workbook.h"
typedef enum {
REMOVE_DEPS = 0,
......
......@@ -12,6 +12,7 @@
#include <gdk/gdkkeysyms.h>
#include "gnumeric.h"
#include "eval.h"
#include "workbook.h"
#include "expr-name.h"
/* We don't expect that many global names ! */
......
......@@ -16,6 +16,7 @@
#include "func.h"
#include "utils.h"
#include "ranges.h"
#include "workbook.h"
EvalPosition *
eval_pos_init (EvalPosition *eval_pos, Sheet *sheet, int col, int row)
......
......@@ -12,6 +12,7 @@
#include "dialogs.h"
#include "xml-io.h"
#include "file.h"
#include "workbook.h"
#include "command-context.h"
#include <locale.h>
......
......@@ -13,6 +13,7 @@
#include "utils.h"
#include "func.h"
#include "eval.h"
#include "workbook.h"
/* The list of categories */
static GList *categories = NULL;
......
......@@ -895,9 +895,11 @@ gnumeric_sheet_drag_data_get (GtkWidget *widget,
Sheet *sheet = GNUMERIC_SHEET (widget)->sheet_view->sheet;
Workbook *wb = sheet->workbook;
char *s;
CommandContext *command_context =
workbook_command_context_gui (sheet->workbook);
if (wb->filename == NULL)
workbook_save (wb);
workbook_save (command_context, wb);
if (wb->filename == NULL)
return;
......
......@@ -895,9 +895,11 @@ gnumeric_sheet_drag_data_get (GtkWidget *widget,
Sheet *sheet = GNUMERIC_SHEET (widget)->sheet_view->sheet;
Workbook *wb = sheet->workbook;
char *s;
CommandContext *command_context =
workbook_command_context_gui (sheet->workbook);
if (wb->filename == NULL)
workbook_save (wb);
workbook_save (command_context, wb);
if (wb->filename == NULL)
return;
......
......@@ -12,6 +12,7 @@
#include "gnumeric-util.h"
#include "style.h"
#include "color.h"
#include "workbook.h"
void
gnumeric_no_modify_array_notice (Workbook *wb)
......
......@@ -12,6 +12,7 @@
#include "gnumeric-util.h"
#include "style.h"
#include "color.h"
#include "workbook.h"
void
gnumeric_no_modify_array_notice (Workbook *wb)
......
......@@ -560,6 +560,10 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
break;
case GDK_BUTTON_PRESS:
/* Ignore scroll wheel events */
if (e->button.button > 3)
return FALSE;
if (is_vertical)
pos = e->button.y;
else
......@@ -623,8 +627,13 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
Sheet *sheet;
int new_size;
/* Ignore scroll wheel events */
if (e->button.button > 3)
return FALSE;
if (!resizing)
break;
if (e->button.button == 3)
break;
......@@ -642,6 +651,10 @@ item_bar_event (GnomeCanvasItem *item, GdkEvent *e)
{
gboolean needs_ungrab = FALSE;
/* Ignore scroll wheel events */
if (e->button.button > 3)
return FALSE;
if (item_bar->start_selection >= 0) {
needs_ungrab = TRUE;
item_bar->start_selection = -1;
......
......@@ -14,6 +14,7 @@
#include "clipboard.h"
#include "cursors.h"
#include "selection.h"
#include "workbook.h"
#include "gnumeric-util.h"
#include "sheet-autofill.h"
......
......@@ -23,6 +23,7 @@
#include "workbook-cmd-format.h"
#include "pattern.h"
#include "workbook-view.h"
#include "workbook.h"
#include "commands.h"
static GnomeCanvasItemClass *item_grid_parent_class;
......
......@@ -12,6 +12,7 @@
#include "xml-io.h"
#include "plugin.h"
#include "format.h"
#include "workbook.h"
#include "cursors.h"
#include "number-match.h"
#include "main.h"
......
......@@ -12,6 +12,7 @@
#include "xml-io.h"
#include "plugin.h"
#include "format.h"
#include "workbook.h"
#include "cursors.h"
#include "number-match.h"
#include "main.h"
......
......@@ -19,6 +19,7 @@
#include "symbol.h"
#include "expr.h"
#include "sheet.h"
#include "application.h"
#include "utils.h"
#include "auto-format.h"
......@@ -272,14 +273,10 @@ int yyparse(void);
ExprTree *tree;
CellRef *cell;
GList *list;
Sheet *sheetref;
Workbook *bookref;
}
%type <tree> exp array_exp
%type <list> arg_list array_row, array_cols
%token <tree> NUMBER STRING FUNCALL CONSTANT CELLREF GTE LTE NE
%token <sheetref> SHEETREF
%token <bookref> BOOKREF
%token SEPARATOR
%type <tree> cellref
......@@ -373,15 +370,47 @@ cellref: CELLREF {
$$ = $1;
}
| SHEETREF '!' CELLREF {
| STRING '!' CELLREF {
Sheet *sheet = sheet_lookup_by_name (parser_wb, $1->u.constant->v.str->str);
/* TODO : Get rid of ParseErr and replace it with something richer. */
unregister_allocation ($3);
unregister_allocation ($1); expr_tree_unref ($1);
if (sheet == NULL) {
parser_error = PARSE_ERR_SYNTAX;
return ERROR;
}
$$ = $3;
$$->u.ref.sheet = $1;
$$->u.ref.sheet = sheet;
register_expr_allocation($$);
}
| '[' BOOKREF ']' SHEETREF '!' CELLREF {
/* FIXME: what about $2? -- MW. */
| '[' STRING ']' STRING '!' CELLREF {
/* TODO : Get rid of ParseErr and replace it with something richer.
* The replace ment should include more detail as to what the error
* was, and where in the expr string to highlight.
*
* e.g. for =1+Shhet!A1+2
* We should return "Unknow Sheet 'Shhet'" and the indicies 3:7
* to mark the offending region.
*/
Workbook * wb =
application_workbook_get_by_name ($2->u.constant->v.str->str);
Sheet *sheet = NULL;
if (wb != NULL)
sheet = sheet_lookup_by_name (wb, $4->u.constant->v.str->str);
unregister_allocation ($6);
unregister_allocation ($4); expr_tree_unref ($4);
unregister_allocation ($2); expr_tree_unref ($2);
if (sheet == NULL) {