1 /* vim: set sw=8: -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 #ifndef _GNM_SHEET_CONTROL_GUI_H_
3 # define _GNM_SHEET_CONTROL_GUI_H_
5 #include "gnumeric-fwd.h"
6 #include "sheet-control.h"
11 #define GNM_SCG_TYPE (sheet_control_gui_get_type ())
12 #define GNM_SCG(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GNM_SCG_TYPE, SheetControlGUI))
13 #define GNM_IS_SCG(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GNM_SCG_TYPE))
15 GType
sheet_control_gui_get_type (void);
16 SheetControlGUI
*sheet_control_gui_new (SheetView
*sv
, WBCGtk
*wbcg
);
18 void scg_take_focus (SheetControlGUI
*scg
);
20 void scg_context_menu (SheetControlGUI
*scg
, GdkEvent
*event
,
21 gboolean is_col
, gboolean is_row
);
23 void scg_object_anchor_to_coords (SheetControlGUI
const *scg
,
24 SheetObjectAnchor
const *anchor
, double *coords
);
25 void scg_object_coords_to_anchor (SheetControlGUI
const *scg
,
26 double const *coords
, SheetObjectAnchor
*in_out
);
28 void scg_objects_drag (SheetControlGUI
*scg
, GnmPane
*gcanvas
,
30 gdouble
*dx
, gdouble
*dy
,
31 int drag_type
, gboolean symmetric
, gboolean snap_to_grid
,
32 gboolean is_mouse_move
);
33 void scg_objects_drag_commit (SheetControlGUI
*scg
, int drag_type
,
34 gboolean created_objects
,
35 GOUndo
**pundo
, GOUndo
**predo
,
37 void scg_objects_nudge (SheetControlGUI
*scg
, GnmPane
*gcanvas
,
38 int drag_type
, double dx
, double dy
,
40 gboolean snap_to_grid
);
42 void scg_object_select (SheetControlGUI
*scg
, SheetObject
*so
);
43 void scg_object_unselect (SheetControlGUI
*scg
, SheetObject
*so
);
44 void scg_object_select_next (SheetControlGUI
*scg
, gboolean reverse
);
46 void scg_comment_select (SheetControlGUI
*scg
, GnmComment
*cc
,
48 void scg_comment_display (SheetControlGUI
*scg
, GnmComment
*cc
,
50 void scg_comment_unselect (SheetControlGUI
*scg
, GnmComment
*cc
);
52 void scg_select_all (SheetControlGUI
*scg
);
53 gboolean
scg_colrow_select (SheetControlGUI
*scg
,
54 gboolean is_cols
, int index
, int modifiers
);
55 void scg_colrow_size_set (SheetControlGUI
*scg
,
56 gboolean is_cols
, int index
, int new_size_pixels
);
57 gint64
scg_colrow_distance_get (SheetControlGUI
const *scg
,
58 gboolean is_cols
, int from
, int to
);
60 void scg_edit_start (SheetControlGUI
*scg
);
61 void scg_edit_stop (SheetControlGUI
*scg
);
63 void scg_rangesel_start (SheetControlGUI
*scg
,
64 int base_col
, int base_row
,
65 int move_col
, int move_row
);
66 void scg_rangesel_bound (SheetControlGUI
*scg
,
67 int base_col
, int base_row
,
68 int move_col
, int move_row
);
69 void scg_rangesel_stop (SheetControlGUI
*scg
, gboolean clear_str
);
70 void scg_rangesel_extend_to (SheetControlGUI
*scg
, int col
, int row
);
71 void scg_rangesel_move (SheetControlGUI
*scg
, int dir
,
72 gboolean jump_to_bound
, gboolean horiz
);
73 void scg_rangesel_extend (SheetControlGUI
*scg
, int n
,
74 gboolean jump_to_bound
, gboolean horiz
);
75 void scg_make_cell_visible (SheetControlGUI
*scg
, int col
, int row
,
76 gboolean force_scroll
, gboolean couple_panes
);
78 void scg_set_display_cursor (SheetControlGUI
*scg
);
79 void scg_cursor_visible (SheetControlGUI
*scg
, gboolean is_visible
);
80 void scg_cursor_move (SheetControlGUI
*scg
, int dir
,
81 gboolean jump_to_bound
, gboolean horiz
);
82 void scg_cursor_extend (SheetControlGUI
*scg
, int n
,
83 gboolean jump_to_bound
, gboolean horiz
);
85 void scg_special_cursor_start (SheetControlGUI
*scg
, int style
, int button
);
86 void scg_special_cursor_stop (SheetControlGUI
*scg
);
87 gboolean
scg_special_cursor_bound_set (SheetControlGUI
*scg
, GnmRange
const *r
);
89 void scg_set_left_col (SheetControlGUI
*scg
, int new_first_col
);
90 void scg_set_top_row (SheetControlGUI
*scg
, int new_first_row
);
92 void scg_size_guide_start (SheetControlGUI
*scg
, gboolean vert
,
93 int colrow
, gboolean is_colrow_resize
);
94 void scg_size_guide_motion (SheetControlGUI
*scg
, gboolean vert
,
96 void scg_size_guide_stop (SheetControlGUI
*scg
);
98 typedef void (*SCGUIMoveFunc
) (SheetControlGUI
*scg
, int n
,
99 gboolean jump
, gboolean horiz
);
100 void scg_queue_movement (SheetControlGUI
*scg
,
101 SCGUIMoveFunc handler
,
102 int n
, gboolean jump
, gboolean horiz
);
103 void scg_paste_image (SheetControlGUI
*scg
, GnmRange
*where
,
104 guint8
const *data
, unsigned len
);
105 void scg_drag_data_received (SheetControlGUI
*scg
, GtkWidget
*source_widget
,
107 GtkSelectionData
*selection_data
);
108 void scg_drag_data_get (SheetControlGUI
*scg
,
109 GtkSelectionData
*selection_data
);
111 void scg_delete_sheet_if_possible (SheetControlGUI
*scg
);
113 void scg_reload_item_edits (SheetControlGUI
*scg
);
115 /* Convenience wrappers. */
116 SheetView
*scg_view (SheetControlGUI
const *scg
);
117 Sheet
*scg_sheet (SheetControlGUI
const *scg
);
118 WorkbookControl
*scg_wbc (SheetControlGUI
const *scg
);
120 /* DO NOT USE THIS WITHOUT ALOT OF THOUGHT */
121 GnmPane
*scg_pane (SheetControlGUI
*scg
, int pane
);
123 WBCGtk
*scg_wbcg (SheetControlGUI
const *scg
);
127 #endif /* _GNM_SHEET_CONTROL_GUI_H_ */