item-grid.h 1.28 KB
Newer Older
1 2
#ifndef GNUMERIC_ITEM_GRID_H
#define GNUMERIC_ITEM_GRID_H
3

Arturo Espinosa's avatar
Arturo Espinosa committed
4
#define ITEM_GRID(obj)          (GTK_CHECK_CAST((obj), item_grid_get_type (), ItemGrid))
5 6 7
#define ITEM_GRID_CLASS(k)      (GTK_CHECK_CLASS_CAST ((k), item_grid_get_type ()))
#define IS_ITEM_GRID(o)         (GTK_CHECK_TYPE((o), item_grid_get_type ()))

8 9 10 11 12 13
typedef enum {
	ITEM_GRID_NO_SELECTION,
	ITEM_GRID_SELECTING_CELL_RANGE,
	ITEM_GRID_SELECTING_FORMULA_RANGE
} ItemGridSelectionType;

14 15 16
typedef struct {
	GnomeCanvasItem canvas_item;

Arturo Espinosa's avatar
Arturo Espinosa committed
17 18
	SheetView *sheet_view;
	Sheet     *sheet;
19 20

	/* The first displayed column and row */
Arturo Espinosa's avatar
Arturo Espinosa committed
21 22
	ColType    left_col;
	RowType    top_row;
23

24
	ItemGridSelectionType selecting;
25
	
26
	/* Offset from spreadsheet origin in units */
Arturo Espinosa's avatar
Arturo Espinosa committed
27 28
	long       top_offset;
	long       left_offset;
29

Arturo Espinosa's avatar
Arturo Espinosa committed
30 31 32
	GdkGC      *grid_gc;	/* Draw grid gc */
	GdkGC      *fill_gc;	/* Default background fill gc */
	GdkGC      *gc;		/* Color used for the cell */
33
	
Arturo Espinosa's avatar
Arturo Espinosa committed
34 35 36
	GdkColor   background;
	GdkColor   grid_color;
	GdkColor   default_color;
Arturo Espinosa's avatar
Arturo Espinosa committed
37

Arturo Espinosa's avatar
Arturo Espinosa committed
38
	int        visual_is_paletted;
39 40 41
} ItemGrid;

GtkType item_grid_get_type (void);
42 43
int     item_grid_find_col (ItemGrid *item_grid, int x, int *col_origin);
int     item_grid_find_row (ItemGrid *item_grid, int y, int *row_origin);
44 45 46 47 48

typedef struct {
	GnomeCanvasItemClass parent_class;
} ItemGridClass;

49
#endif /* GNUMERIC_ITEM_GRID_H */