Commit 49b033cc authored by Arturo Espinosa's avatar Arturo Espinosa

TODO updates, framework updated -mig

parent 6ef7285c
GNOME Spread Sheet task list
* Parser
The parser should understand the Excel syntax for expressions. This
is the API we need:
GList *evaluate (Sheet *sheet,
char *expression,
Type *result_type,
ValueType *val,
char **error_string);
Input values:
Sheet Is the Sheet the cell is part of.
expression Is the expression to be evaluated
Return value:
GList * A list of any cells referenced.
Output values (pointed destination holds result)
result_type Is set us the type of the expression, check
the header files for details.
val The val union set properly to the computed expression
if no error was set.
error_string if error_string is NULL, then no error was found,
otherwise it points to the error string that gets
displayed by the spreadsheet.
The expressions parsed should be compatible with what Excel accepts.
* Information formatting
Given a structure like this:
Given the Cell structure in cell.h:
if the Cell->content_type is either VALUE_INTEGER or VALUE_FLOAT,
produce a formatted string based Excel-compatible format.
I should mention again this: The format that the routine takes
should be compatible with the Excel format.
Desired API:
char *format_number (Value value, GdkColor *computed_color)
Input values:
value The value that is either a VALUE_INTEGER or
struct {
int type; /* string or number */
union {
char *string_value;
double number_value;
Returned value:
char* The formatted string.
And an Excel-like format, render the value with the specified
format specifier.
Other Output values:
computed_color This is a GdkColor set to the color computed
by the format_number routine (yes, the format
can include colors for certain conditions).
* Engine
typedef unsigned char ColType;
typedef unsigned short RowType;
typedef enum {
} ValueType;
* We use the GNU Multi-precission library for storing integers
* and floating point numbers
typedef struct {
ValueType type;
union {
char *string; /* string */
mpz_t integer; /* integer number */
mpf_t fp; /* floating point */
} v;
} Value;
typedef {
int ref_count;
GdkColor color;
} CellColor;
typedef struct {
int column;
int row;
ColType col;
RowType row;
/* Text as entered by the user */
char *entered_text;
/* Type of the content and the actual parsed content */
Value value;
Style style;
/* Rendered versions of the cell */
char *text; /* Text displayed */
int width; /* Width of text */
int height; /* Height of text */
/* computed versions of the cell contents */
char *text; /* Text displayed */
GdkColor color; /* color for the displayed text */
int width; /* Width of text */
int height; /* Height of text */
} Cell;
#define CELL_IS_FORMULA(cell) (cell->entered_text [0] == '=')
#endif /* GNUMERIC_CELL_H */
typedef GList ColStyleList;
struct Workbook;
typedef struct {
RowType row;
int height;
Style *style; /* if existant, this row style */
} RowInfo;
typedef struct {
ColType col;
int width;
Style style; /* if existant, this column style */
} ColInfo;
typedef struct {
struct Workbook *parent_workbook;
char *name;
Style style;
GList *cols_info;
GList *rows_info;
void *contents;
} Sheet;
typedef struct {
Style style;
GHashTable *sheets; /* keeps a list of the sheets on this workbook */
} Workbook;
......@@ -47,7 +47,7 @@ typedef enum {
} StyleHAlignFlags;
......@@ -77,25 +77,4 @@ typedef struct {
unsigned int orientation:4;
} Style;
typedef struct {
int row;
int height;
Style style;
} RowStyle;
typedef struct {
int col;
int width;
Style style;
} ColStyle;
typedef struct {
int sheet;
Style style;
} SheetStyle;
typedef struct {
Style style;
} WorkbookStyle;
#endif /* GNUMERIC_STYLE_H */
Markdown is supported
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