sheet-view.h 1.75 KB
Newer Older
Arturo Espinosa's avatar
Arturo Espinosa committed
1 2 3 4 5 6 7 8 9 10 11 12 13
#ifndef SHEET_VIEW_H
#define SHEET_VIEW_H

#include <gtk/gtktable.h>

#define SHEET_VIEW_TYPE        (sheet_view_get_type ())
#define SHEET_VIEW(obj)        (GTK_CHECK_CAST((obj), SHEET_VIEW_TYPE, SheetView))
#define SHEET_VIEW_CLASS(k)    (GTK_CHECK_CLASS_CAST((k), SHEET_VIEW_TYPE))
#define IS_SHEET_VIEW(o)       (GTK_CHECK_TYPE((o), SHEET_VIEW_TYPE))

typedef struct {
	GtkTable  table;

14 15 16 17 18 19 20 21
	Sheet            *sheet;
	GtkWidget        *sheet_view;
	GnomeCanvas      *col_canvas, *row_canvas;
	GnomeCanvasItem  *col_item, *row_item;

	/* Object group */
	GnomeCanvasGroup *object_group;

22 23
	/*
	 * Temporary object used during the creation of objects
24 25 26
	 * in the canvas
	 */
	void             *temp_item;
27 28 29 30 31

	/*
	 * Control points for the current item
	 */
	GList            *control_points;
Arturo Espinosa's avatar
Arturo Espinosa committed
32 33 34 35 36 37
	
	/* Scrolling information */
	GtkWidget  *vs, *hs;	/* The scrollbars */
	GtkObject  *va, *ha;    /* The adjustments */

	/* Tip for scrolling */
38
	GtkWidget        *tip;
Arturo Espinosa's avatar
Arturo Espinosa committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
} SheetView;

GtkType     sheet_view_get_type              (void);
GtkWidget  *sheet_view_new                   (Sheet *sheet);

void        sheet_view_set_zoom_factor       (SheetView *sheet_view, double factor);

void        sheet_view_col_set_selection     (SheetView *sheet_view, ColRowInfo *ci);
void        sheet_view_row_set_selection     (SheetView *sheet_view, ColRowInfo *ci);

void        sheet_view_redraw_all            (SheetView *sheet_view);
void        sheet_view_redraw_cell_region    (SheetView *sheet_view,
					      int start_col, int start_row,
					      int end_col, int end_row);
void        sheet_view_redraw_rows           (SheetView *sheet_view);
void        sheet_view_redraw_columns        (SheetView *sheet_view);

typedef struct {
	GtkTableClass parent_class;
} SheetViewClass;

#endif /* SHEET_VIEW_H */