4 * Copyright (C) 2001 Jon K Hellan (hellan@acm.org)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21 #include <gnumeric-config.h>
23 #include "sheet-control-priv.h"
24 #include "sheet-view.h"
26 #include <gsf/gsf-impl-utils.h>
28 #define SC_CLASS(o) SHEET_CONTROL_CLASS (G_OBJECT_GET_CLASS (o))
29 #define SC_VIRTUAL_FULL(func, handle, arglist, call) \
30 void sc_ ## func arglist \
32 SheetControlClass *sc_class; \
34 g_return_if_fail (GNM_IS_SHEET_CONTROL (sc)); \
36 sc_class = SC_CLASS (sc); \
37 if (sc_class->handle != NULL) \
38 sc_class->handle call; \
40 #define SC_VIRTUAL(func, arglist, call) SC_VIRTUAL_FULL(func, func, arglist, call)
42 /*****************************************************************************/
44 static GObjectClass
*parent_class
;
47 sc_finalize (GObject
*obj
)
49 /* Commented out until needed */
50 /* SheetControl *sc = GNM_SHEET_CONTROL (obj); */
51 parent_class
->finalize (obj
);
55 sc_class_init (GObjectClass
*object_class
)
57 parent_class
= g_type_class_peek_parent (object_class
);
58 object_class
->finalize
= sc_finalize
;
61 GSF_CLASS (SheetControl
, sheet_control
,
62 sc_class_init
, NULL
, G_TYPE_OBJECT
)
68 * Returns: (transfer none) (nullable): the workbook control.
71 sc_wbc (SheetControl
const *sc
)
73 g_return_val_if_fail (GNM_IS_SHEET_CONTROL (sc
), NULL
);
81 * Returns: (transfer none) (nullable): the sheet.
84 sc_sheet (SheetControl
const *sc
)
86 g_return_val_if_fail (GNM_IS_SHEET_CONTROL (sc
), NULL
);
87 return sc
->view
? sc
->view
->sheet
: NULL
;
94 * Returns: (transfer none) (nullable): the sheet view.
97 sc_view (SheetControl
const *sc
)
99 g_return_val_if_fail (GNM_IS_SHEET_CONTROL (sc
), NULL
);
103 SC_VIRTUAL (resize
, (SheetControl
*sc
, gboolean force_scroll
), (sc
, force_scroll
))
105 SC_VIRTUAL (redraw_all
, (SheetControl
*sc
, gboolean headers
), (sc
, headers
))
106 SC_VIRTUAL (redraw_range
,
107 (SheetControl
*sc
, GnmRange
const *r
),
109 SC_VIRTUAL (redraw_headers
,
111 gboolean
const col
, gboolean
const row
, GnmRange
const * r
),
114 SC_VIRTUAL (ant
, (SheetControl
*sc
), (sc
))
115 SC_VIRTUAL (unant
, (SheetControl
*sc
), (sc
))
117 SC_VIRTUAL (scrollbar_config
, (SheetControl
*sc
), (sc
))
119 SC_VIRTUAL (mode_edit
, (SheetControl
*sc
), (sc
))
121 SC_VIRTUAL (set_top_left
,
122 (SheetControl
*sc
, int col
, int row
),
124 SC_VIRTUAL (recompute_visible_region
,
125 (SheetControl
*sc
, gboolean full_recompute
),
126 (sc
, full_recompute
))
127 SC_VIRTUAL (make_cell_visible
,
128 (SheetControl
*sc
, int col
, int row
, gboolean couple_panes
),
129 (sc
, col
, row
, couple_panes
))
131 SC_VIRTUAL (cursor_bound
, (SheetControl
*sc
, GnmRange
const *r
), (sc
, r
))
132 SC_VIRTUAL (set_panes
, (SheetControl
*sc
), (sc
))
134 SC_VIRTUAL (object_create_view
, (SheetControl
*sc
, SheetObject
*so
), (sc
, so
))
135 SC_VIRTUAL (scale_changed
, (SheetControl
*sc
), (sc
))
137 SC_VIRTUAL (show_im_tooltip
, (SheetControl
*sc
, GnmInputMsg
*im
, GnmCellPos
*pos
), (sc
, im
, pos
))