1 #ifndef _GNM_SHEET_CONTROL_GUI_PRIV_H_
2 # define _GNM_SHEET_CONTROL_GUI_PRIV_H_
3 
4 #include <sheet-control-gui.h>
5 #include <sheet-control-priv.h>
6 #include <sheet-object.h>
7 
8 G_BEGIN_DECLS
9 
10 #define	SCG_NUM_PANES		4
11 struct _SheetControlGUI {
12 	SheetControl sheet_control;
13 
14 	/* Cached SheetControl attribute to reduce casting. */
15 	WBCGtk *wbcg;
16 
17 	GtkGrid		*grid;
18 	GtkWidget	*select_all_btn;
19 	GtkWidget       *label;
20 	struct {
21 		GPtrArray	*buttons;
22 		GtkWidget	*button_box;
23 	} col_group, row_group;
24 
25 	GnmPane	*pane [SCG_NUM_PANES];
26 	int	 active_panes;
27 
28 	int grab_stack; /* utility to keep track of grabs in the various canvases */
29 
30 	/* Scrolling information */
31 	GtkPaned	*vpane, *hpane;	/* drag panes for freezing */
32 	GtkWidget	*vs, *hs;	/* Scrollbars */
33 	GtkAdjustment	*va, *ha;	/* Adjustments */
34 	int              vpos, hpos;    /* Handle positions */
35 	guint		 pane_drag_handler;
36 	int              screen_width, screen_height;
37 	guint            scroll_bar_timer;
38 
39 	/* SheetObject support */
40 	GHashTable	 *selected_objects;
41 
42 	/* Keep track of a rangeselector state */
43 	struct {
44 		gboolean active;
45 		GnmCellPos	 base_corner;	/* Corner remains static when rubber banding */
46 		GnmCellPos	 move_corner;	/* Corner to move when extending */
47 		GnmRange	 displayed;	/* The range to display */
48 	} rangesel;
49 
50 	/* Comments */
51 	struct {
52 		GnmComment *selected;
53 		GtkWidget   *item;	/* TODO : make this a canvas item with an arrow */
54 		int	     timer;
55 		int          x, y;
56 	} comment;
57 
58 	/* im */
59 	struct {
60 		GtkWidget   *item;
61 		int	     timer;
62 	} im;
63 
64 	struct {
65 		int		timer, counter, n;
66 		gboolean	jump, horiz;
67 		SCGUIMoveFunc	handler;
68 	} delayedMovement;
69 };
70 
71 typedef struct {
72 	SheetControlClass parent_class;
73 } SheetControlGUIClass;
74 
75 /* SCG virtual methods called directly from the GUI layer*/
76 void scg_adjust_preferences     (SheetControlGUI *scg);
77 void scg_mode_edit		(SheetControlGUI *scg);
78 
79 #define SCG_FOREACH_PANE(scg, pane, code)		\
80   do {							\
81 	int i;						\
82 	for (i = scg->active_panes; i-- > 0 ; ) {	\
83 		GnmPane *pane = scg->pane[i];		\
84 		if (pane) {				\
85 			code				\
86 		}					\
87 	}						\
88   } while (0)
89 
90 G_END_DECLS
91 
92 #endif /* _GNM_SHEET_CONTROL_GUI_PRIV_H_ */
93