Commit 12622861 authored by Morten Welinder's avatar Morten Welinder
Browse files

Fix interdependent header files.

parent 780daecf
1999-04-30 Morten Welinder <terra@diku.dk>
* src/*.h: Properly forward-declare structures. Include
dependencies. Change the occasional "void *" to its right
type.
* src/*.[cy]: Include more dependencies.
* src/sheet.c (sheet_delete_row): Remove from workbook hash also.
1999-04-29 Morten Welinder <terra@diku.dk>
......
1999-04-30 Morten Welinder <terra@diku.dk>
* src/*.h: Properly forward-declare structures. Include
dependencies. Change the occasional "void *" to its right
type.
* src/*.[cy]: Include more dependencies.
* src/sheet.c (sheet_delete_row): Remove from workbook hash also.
1999-04-29 Morten Welinder <terra@diku.dk>
......
1999-04-30 Morten Welinder <terra@diku.dk>
* src/*.h: Properly forward-declare structures. Include
dependencies. Change the occasional "void *" to its right
type.
* src/*.[cy]: Include more dependencies.
* src/sheet.c (sheet_delete_row): Remove from workbook hash also.
1999-04-29 Morten Welinder <terra@diku.dk>
......
1999-04-30 Morten Welinder <terra@diku.dk>
* src/*.h: Properly forward-declare structures. Include
dependencies. Change the occasional "void *" to its right
type.
* src/*.[cy]: Include more dependencies.
* src/sheet.c (sheet_delete_row): Remove from workbook hash also.
1999-04-29 Morten Welinder <terra@diku.dk>
......
......@@ -13,6 +13,7 @@
#include "format.h"
#include "color.h"
#include "cursors.h"
#include "utils.h"
static int redraws_frozen = 0;
static GHashTable *cell_hash_queue;
......@@ -1408,11 +1409,10 @@ str_trim_spaces (char *s)
* Returns the number of columns used for the draw
*/
int
cell_draw (Cell *cell, void *sv, GdkGC *gc, GdkDrawable *drawable, int x1, int y1)
cell_draw (Cell *cell, SheetView *sheet_view, GdkGC *gc, GdkDrawable *drawable, int x1, int y1)
{
Style *style = cell->style;
GdkFont *font = style->font->font;
SheetView *sheet_view = sv;
GdkGC *white_gc = GTK_WIDGET (sheet_view->sheet_view)->style->white_gc;
GdkRectangle rect;
......
#ifndef GNUMERIC_CELL_H
#define GNUMERIC_CELL_H
/* Forward references for structures. */
typedef struct _Cell Cell;
typedef struct _CellRegion CellRegion;
typedef GList CellList;
typedef struct _ColRowInfo ColRowInfo;
#include "style.h"
#include "sheet.h"
#include "sheet-view.h"
#include "str.h"
#include "expr.h"
typedef unsigned char ColType;
typedef unsigned short RowType;
typedef struct {
struct _ColRowInfo {
int pos; /* the column or row number */
/* The height */
......@@ -15,7 +27,7 @@ typedef struct {
unsigned int hard_size:1; /* has the user explicitly set the dimensions? */
void *data;
} ColRowInfo;
};
#define COL_INTERNAL_WIDTH(col) ((col)->pixels - ((col)->margin_b + (col)->margin_a))
#define ROW_INTERNAL_HEIGHT(row) ((row)->pixels - ((row)->margin_b + (row)->margin_a))
......@@ -51,8 +63,8 @@ typedef struct {
*
* Definition of a Gnumeric Cell
*/
typedef struct {
void *sheet;
struct _Cell {
Sheet *sheet;
ColRowInfo *col;
ColRowInfo *row;
......@@ -74,9 +86,7 @@ typedef struct {
CellComment *comment;
int flags;
char generation;
} Cell;
typedef GList CellList;
};
/* #define CELL_TEXT_GET(cell) ((cell)->text ? cell->text->str : cell->entered_text->str) */
#define CELL_IS_FORMAT_SET(cell) ((cell)->flags & CELL_FORMAT_SET)
......@@ -97,10 +107,10 @@ typedef struct {
typedef GList CellCopyList;
typedef struct {
struct _CellRegion {
int cols, rows;
CellCopyList *list;
} CellRegion;
};
char *value_format (Value *value, StyleFormat *format, char **color);
......@@ -148,7 +158,7 @@ void cell_formula_changed (Cell *cell);
void cell_queue_redraw (Cell *cell);
int cell_get_horizontal_align (const Cell *cell);
int cell_draw (Cell *cell, void *sheet_view,
int cell_draw (Cell *cell, SheetView *sheet_view,
GdkGC *gc, GdkDrawable *drawable,
int x, int y);
......@@ -177,4 +187,3 @@ void row_init_span (ColRowInfo *ri);
void row_destroy_span (ColRowInfo *ri);
#endif /* GNUMERIC_CELL_H */
#ifndef GNUMERIC_EVAL_H
#define GNUMERIC_EVAL_H
#include "sheet.h"
#include "cell.h"
/*
* A DependencyRange defines a range of cells whose values
* are used by another Cell in the spreadsheet.
......
......@@ -13,6 +13,7 @@
#include "dialogs.h"
#include "cell.h"
#include "expr.h"
#include "utils.h"
typedef struct {
GtkWidget *parent;
......
......@@ -16,7 +16,7 @@
#include "cell.h"
#include "expr.h"
#include "eval.h"
#include "utils.h"
#define MAX_CELL_NAME_LEN 20
......
......@@ -12,7 +12,7 @@
#include "gnumeric-util.h"
#include "dialogs.h"
#include "func.h"
#include "utils.h"
/* Different constraint types */
static const char *constraint_strs[] = {
......
#ifndef GNUMERIC_DIALOGS_H
#define GNUMERIC_DIALOGS_H
#include "sheet.h"
#include "cell.h"
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Workbook *wb, Sheet *sheet);
int dialog_paste_special (Workbook *wb);
......
......@@ -13,6 +13,7 @@
#include "dialogs.h"
#include "cell.h"
#include "expr.h"
#include "utils.h"
typedef struct {
GtkWidget *parent;
......
......@@ -16,7 +16,7 @@
#include "cell.h"
#include "expr.h"
#include "eval.h"
#include "utils.h"
#define MAX_CELL_NAME_LEN 20
......
......@@ -12,7 +12,7 @@
#include "gnumeric-util.h"
#include "dialogs.h"
#include "func.h"
#include "utils.h"
/* Different constraint types */
static const char *constraint_strs[] = {
......
#ifndef GNUMERIC_DIALOGS_H
#define GNUMERIC_DIALOGS_H
#include "sheet.h"
#include "cell.h"
void dialog_goto_cell (Workbook *wb);
void dialog_cell_format (Workbook *wb, Sheet *sheet);
int dialog_paste_special (Workbook *wb);
......
......@@ -3,6 +3,8 @@
#include <stdio.h>
#include "gnumeric.h"
#include "dump.h"
#include "symbol.h"
#include "func.h"
static FILE *output_file;
......
#ifndef GNUMERIC_EVAL_H
#define GNUMERIC_EVAL_H
#include "sheet.h"
#include "cell.h"
/*
* A DependencyRange defines a range of cells whose values
* are used by another Cell in the spreadsheet.
......
......@@ -13,6 +13,7 @@
#include "eval.h"
#include "format.h"
#include "func.h"
#include "utils.h"
ExprTree *
expr_parse_string (const char *expr, Sheet *sheet, int col, int row,
......
#ifndef GNUMERIC_EXPR_H
#define GNUMERIC_EXPR_H
/* Forward reference. We should probably just include sheet.h to get this. */
struct _Sheet;
/* Forward references for structures. */
typedef struct _Value Value;
typedef struct _ExprTree ExprTree;
typedef struct _CellRef CellRef;
#include "sheet.h"
#include "symbol.h"
#include "numbers.h"
#include "str.h"
typedef enum {
OPER_EQUAL, /* Compare value equal */
......@@ -41,15 +48,15 @@ typedef enum {
VALUE_ARRAY,
} ValueType;
typedef struct {
struct _Sheet *sheet;
struct _CellRef {
Sheet *sheet;
int col, row;
unsigned int col_relative:1;
unsigned int row_relative:1;
} CellRef;
};
typedef struct _Value {
struct _Value {
ValueType type;
union {
CellRef cell;
......@@ -60,19 +67,19 @@ typedef struct _Value {
struct {
int x, y ;
struct _Value **vals; /* Array [x][y] */
Value **vals; /* Array [x][y] */
} array ;
String *str;
Symbol *sym;
float_t v_float; /* floating point */
int_t v_int;
} v;
} Value;
};
#define VALUE_IS_NUMBER(x) (((x)->type == VALUE_INTEGER) || \
((x)->type == VALUE_FLOAT))
struct ExprTree {
struct _ExprTree {
Operation oper;
int ref_count;
......@@ -85,18 +92,16 @@ struct ExprTree {
} function;
struct {
struct ExprTree *value_a;
struct ExprTree *value_b;
ExprTree *value_a;
ExprTree *value_b;
} binary;
struct ExprTree *value;
ExprTree *value;
CellRef ref;
} u;
};
typedef struct ExprTree ExprTree;
typedef enum {
PARSE_OK,
PARSE_ERR_NO_QUOTE,
......@@ -135,7 +140,7 @@ struct FunctionDefinition {
char *args;
char *named_arguments;
char **help;
Value *(*expr_fn)(struct _Sheet *sheet, GList *expr_node_list, int eval_col, int eval_row, char **error_string);
Value *(*expr_fn)(Sheet *sheet, GList *expr_node_list, int eval_col, int eval_row, char **error_string);
Value *(*fn)(struct FunctionDefinition *func_def, Value *argv [], char **error_string);
};
......@@ -146,30 +151,30 @@ void cell_get_abs_col_row (const CellRef *cell_ref,
int eval_col, int eval_row,
int *col, int *row);
ExprTree *expr_parse_string (const char *expr, struct _Sheet *sheet, int col, int row,
ExprTree *expr_parse_string (const char *expr, Sheet *sheet, int col, int row,
const char **desired_format, char **error_msg);
/* In parser.y */
ParseErr gnumeric_expr_parser (const char *expr, struct _Sheet *sheet,
ParseErr gnumeric_expr_parser (const char *expr, Sheet *sheet,
int col, int row, const char **desired_format,
ExprTree **tree);
ExprTree *expr_tree_duplicate (ExprTree *expr);
ExprTree *expr_tree_relocate (ExprTree *expr, int col_diff, int row_diff);
char *expr_decode_tree (ExprTree *tree, struct _Sheet *sheet,
char *expr_decode_tree (ExprTree *tree, Sheet *sheet,
int col, int row);
void expr_tree_ref (ExprTree *tree);
void expr_tree_unref (ExprTree *tree);
ExprTree *expr_tree_invalidate_references (ExprTree *src, struct _Sheet *sheet,
ExprTree *expr_tree_invalidate_references (ExprTree *src, Sheet *sheet,
int src_col, int src_row, int col, int row,
int colcount, int rowcount);
ExprTree *expr_tree_fixup_references (ExprTree *src, struct _Sheet *sheet,
ExprTree *expr_tree_fixup_references (ExprTree *src, Sheet *sheet,
int src_col, int src_row, int col, int row,
int coldelta, int rowdelta);
Value *eval_expr (struct _Sheet *sheet, ExprTree *tree,
Value *eval_expr (Sheet *sheet, ExprTree *tree,
int col, int row,
char **error_string);
......
#ifndef GNUMERIC_FILE_H
#define GNUMERIC_FILE_H
#include "sheet.h"
typedef gboolean (*FileFormatProbe)(const char *filename);
typedef Workbook *(*FileFormatOpen) (const char *filename);
typedef int (*FileFormatSave) (Workbook *wb, const char *filename);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment